Merge pull request #1494 from joakim-hove/rename-completions

Rename Completion -> Connection
This commit is contained in:
Joakim Hove 2018-06-12 13:23:05 +02:00 committed by GitHub
commit 5034e25ab8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 22 additions and 22 deletions

View File

@ -253,26 +253,26 @@ void wellsToState( const data::Wells& wells,
state.wellRates()[ wellrate_index + i ] = well.rates.get( phs[ i ] );
}
const auto perforation_pressure = []( const data::Completion& comp ) {
const auto perforation_pressure = []( const data::Connection& comp ) {
return comp.pressure;
};
const auto perforation_reservoir_rate = []( const data::Completion& comp ) {
const auto perforation_reservoir_rate = []( const data::Connection& comp ) {
return comp.reservoir_rate;
};
std::transform( well.completions.begin(),
well.completions.end(),
std::transform( well.connections.begin(),
well.connections.end(),
state.perfPress().begin() + wm.second[ 1 ],
perforation_pressure );
std::transform( well.completions.begin(),
well.completions.end(),
std::transform( well.connections.begin(),
well.connections.end(),
state.perfRates().begin() + wm.second[ 1 ],
perforation_reservoir_rate );
int local_comp_index = 0;
for (const data::Completion& comp : well.completions) {
for (const data::Connection& comp : well.connections) {
const int global_comp_index = wm.second[1] + local_comp_index;
for (int phase_index = 0; phase_index < np; ++phase_index) {
state.perfPhaseRates()[global_comp_index*np + phase_index] = comp.rates.get(phs[phase_index]);

View File

@ -56,9 +56,9 @@ namespace Opm
// for other facilities needed but not available from parser, we need to process them here
// initialize the segment_perforations_
const CompletionSet& completion_set = well_ecl_->getCompletions(current_step_);
const ConnectionSet& completion_set = well_ecl_->getConnections(current_step_);
for (int perf = 0; perf < number_of_perforations_; ++perf) {
const Completion& completion = completion_set.get(perf);
const Connection& completion = completion_set.get(perf);
const int segment_number = completion.getSegmentNumber();
const int segment_index = segmentNumberToIndex(segment_number);
segment_perforations_[segment_index].push_back(perf);

View File

@ -69,7 +69,7 @@ public:
{
std::vector<int> compressed_well_perforations;
// All possible completions of the well
const auto& completionSet = well->getCompletions(last_time_step);
const auto& completionSet = well->getConnections(last_time_step);
compressed_well_perforations.reserve(completionSet.size());
for ( size_t c=0; c < completionSet.size(); c++ )

View File

@ -754,7 +754,7 @@ namespace Opm
bore_diameters_.reserve(nperf);
// COMPDAT handling
const auto& completionSet = well_ecl_->getCompletions(current_step_);
const auto& completionSet = well_ecl_->getConnections(current_step_);
for (size_t c=0; c<completionSet.size(); c++) {
const auto& completion = completionSet.get(c);
if (completion.getState() == WellCompletion::OPEN) {

View File

@ -484,7 +484,7 @@ namespace Opm
well.rates.set( rt::vaporized_oil, this->well_vaporized_oil_rates_[w] );
int local_comp_index = 0;
for( auto& comp : well.completions ) {
for( auto& comp : well.connections) {
const auto rates = this->perfPhaseRates().begin()
+ (np * wt.second[ 1 ])
+ (np * local_comp_index);
@ -549,7 +549,7 @@ namespace Opm
} else { // it is a multi-segment well
const SegmentSet& segment_set = well_ecl->getSegmentSet(time_step);
// assuming the order of the perforations in well_ecl is the same with Wells
const CompletionSet& completion_set = well_ecl->getCompletions(time_step);
const ConnectionSet& completion_set = well_ecl->getConnections(time_step);
// number of segment for this single well
const int well_nseg = segment_set.numberSegment();
const int nperf = completion_set.size();
@ -558,7 +558,7 @@ namespace Opm
// that is why I think we should use a well model to initialize the WellState here
std::vector<std::vector<int>> segment_perforations(well_nseg);
for (int perf = 0; perf < nperf; ++perf) {
const Completion& completion = completion_set.get(perf);
const Connection& completion = completion_set.get(perf);
const int segment_number = completion.getSegmentNumber();
const int segment_index = segment_set.segmentNumberToIndex(segment_number);
segment_perforations[segment_index].push_back(perf);

View File

@ -253,18 +253,18 @@ namespace Opm
const int num_perf_well = this->wells_->well_connpos[ well_index + 1 ]
- this->wells_->well_connpos[ well_index ];
well.completions.resize(num_perf_well);
well.connections.resize(num_perf_well);
for( int i = 0; i < num_perf_well; ++i ) {
const auto wi = this->wells_->well_connpos[ well_index ] + i;
const auto active_index = this->wells_->well_cells[ wi ];
auto& completion = well.completions[ i ];
completion.index = globalCellIdxMap[active_index];
completion.pressure = this->perfPress()[ itr.second[1] + i ];
completion.reservoir_rate = this->perfRates()[ itr.second[1] + i ];
auto& connection = well.connections[ i ];
connection.index = globalCellIdxMap[active_index];
connection.pressure = this->perfPress()[ itr.second[1] + i ];
connection.reservoir_rate = this->perfRates()[ itr.second[1] + i ];
}
assert(num_perf_well == int(well.completions.size()));
assert(num_perf_well == int(well.connections.size()));
}
return dw;

View File

@ -6,7 +6,7 @@
#include <opm/grid/utility/compressedToCartesian.hpp>
#include <opm/core/props/rock/RockFromDeck.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/CompletionSet.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ConnectionSet.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <algorithm>
@ -164,7 +164,7 @@ void WellsManager::createWellsFromSpecs(std::vector<const Well*>& wells, size_t
{ // COMPDAT handling
// shut completions and open ones stored in this process will have 1 others 0.
for(const auto& completion : well->getCompletions(timeStep)) {
for(const auto& completion : well->getConnections(timeStep)) {
if (completion.getState() == WellCompletion::OPEN) {
int i = completion.getI();
int j = completion.getJ();