Merge pull request #3290 from joakim-hove/wellcontainer-rsrv

Use WellContainer<double> for RS / RV
This commit is contained in:
Joakim Hove 2021-05-26 07:22:51 +02:00 committed by GitHub
commit c400b6eeef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 16 deletions

View File

@ -2565,8 +2565,8 @@ namespace Opm
duneDSolver_.reset();
well_state.wellVaporizedOilRates()[index_of_well_] = 0.;
well_state.wellDissolvedGasRates()[index_of_well_] = 0.;
well_state.wellVaporizedOilRates(index_of_well_) = 0.;
well_state.wellDissolvedGasRates(index_of_well_) = 0.;
// for the black oil cases, there will be four equations,
// the first three of them are the mass balance equations, the last one is the pressure equations.
@ -2660,8 +2660,8 @@ namespace Opm
// updating the solution gas rate and solution oil rate
if (this->isProducer()) {
well_state.wellDissolvedGasRates()[index_of_well_] += perf_dis_gas_rate;
well_state.wellVaporizedOilRates()[index_of_well_] += perf_vap_oil_rate;
well_state.wellDissolvedGasRates(index_of_well_) += perf_dis_gas_rate;
well_state.wellVaporizedOilRates(index_of_well_) += perf_vap_oil_rate;
}
// store the perf pressure and rates

View File

@ -584,8 +584,8 @@ namespace Opm
const double volume = 0.002831684659200; // 0.1 cu ft;
// the solution gas rate and solution oil rate needs to be reset to be zero for well_state.
well_state.wellVaporizedOilRates()[index_of_well_] = 0.;
well_state.wellDissolvedGasRates()[index_of_well_] = 0.;
well_state.wellVaporizedOilRates(index_of_well_) = 0.;
well_state.wellDissolvedGasRates(index_of_well_) = 0.;
const int np = number_of_phases_;
@ -719,8 +719,8 @@ namespace Opm
// updating the solution gas rate and solution oil rate
if (this->isProducer()) {
well_state.wellDissolvedGasRates()[index_of_well_] += perf_dis_gas_rate;
well_state.wellVaporizedOilRates()[index_of_well_] += perf_vap_oil_rate;
well_state.wellDissolvedGasRates(index_of_well_) += perf_dis_gas_rate;
well_state.wellVaporizedOilRates(index_of_well_) += perf_vap_oil_rate;
}
if constexpr (has_energy) {

View File

@ -255,8 +255,8 @@ void WellState::init(const std::vector<double>& cellPressures,
}
well_reservoir_rates_.clear();
well_dissolved_gas_rates_.resize(nw, 0.0);
well_vaporized_oil_rates_.resize(nw, 0.0);
well_dissolved_gas_rates_.clear();
well_vaporized_oil_rates_.clear();
this->events_.clear();
{
@ -307,6 +307,8 @@ void WellState::init(const std::vector<double>& cellPressures,
first_perf_index_[w] = connpos;
this->well_reservoir_rates_.add(wname, std::vector<double>(np, 0));
this->well_dissolved_gas_rates_.add(wname, 0);
this->well_vaporized_oil_rates_.add(wname, 0);
}
is_producer_.clear();

View File

@ -182,14 +182,14 @@ public:
return well_reservoir_rates_[well_index];
}
std::vector<double>& wellDissolvedGasRates()
double& wellDissolvedGasRates(std::size_t well_index)
{
return well_dissolved_gas_rates_;
return well_dissolved_gas_rates_[well_index];
}
std::vector<double>& wellVaporizedOilRates()
double& wellVaporizedOilRates(std::size_t well_index)
{
return well_vaporized_oil_rates_;
return well_vaporized_oil_rates_[well_index];
}
const std::vector<double>& segRates() const
@ -498,11 +498,11 @@ private:
// dissolved gas rates or solution gas production rates
// should be zero for injection wells
std::vector<double> well_dissolved_gas_rates_;
WellContainer<double> well_dissolved_gas_rates_;
// vaporized oil rates or solution oil producation rates
// should be zero for injection wells
std::vector<double> well_vaporized_oil_rates_;
WellContainer<double> well_vaporized_oil_rates_;
// some events happens to the well, like this well is a new well
// or new well control keywords happens