mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Use WellContainer for perf rate of polymer/solvent/brine
This commit is contained in:
parent
104036d4b8
commit
76292552ec
@ -628,7 +628,7 @@ namespace Opm
|
|||||||
|
|
||||||
// Store the perforation phase flux for later usage.
|
// Store the perforation phase flux for later usage.
|
||||||
if (has_solvent && componentIdx == contiSolventEqIdx) {
|
if (has_solvent && componentIdx == contiSolventEqIdx) {
|
||||||
auto * perf_rate_solvent = well_state.perfRateSolvent(this->index_of_well_);
|
auto& perf_rate_solvent = well_state.perfRateSolvent(this->index_of_well_);
|
||||||
perf_rate_solvent[perf] = cq_s[componentIdx].value();
|
perf_rate_solvent[perf] = cq_s[componentIdx].value();
|
||||||
} else {
|
} else {
|
||||||
perf_rates[perf*np + ebosCompIdxToFlowCompIdx(componentIdx)] = cq_s[componentIdx].value();
|
perf_rates[perf*np + ebosCompIdxToFlowCompIdx(componentIdx)] = cq_s[componentIdx].value();
|
||||||
@ -794,7 +794,7 @@ namespace Opm
|
|||||||
cq_s_poly *= extendEval(intQuants.polymerConcentration() * intQuants.polymerViscosityCorrection());
|
cq_s_poly *= extendEval(intQuants.polymerConcentration() * intQuants.polymerViscosityCorrection());
|
||||||
}
|
}
|
||||||
// Note. Efficiency factor is handled in the output layer
|
// Note. Efficiency factor is handled in the output layer
|
||||||
auto * perf_rate_polymer = well_state.perfRatePolymer(this->index_of_well_);
|
auto& perf_rate_polymer = well_state.perfRatePolymer(this->index_of_well_);
|
||||||
perf_rate_polymer[perf] = cq_s_poly.value();
|
perf_rate_polymer[perf] = cq_s_poly.value();
|
||||||
|
|
||||||
cq_s_poly *= well_efficiency_factor_;
|
cq_s_poly *= well_efficiency_factor_;
|
||||||
@ -827,7 +827,7 @@ namespace Opm
|
|||||||
const double dis_gas_frac = perf_dis_gas_rate / cq_s_zfrac_effective.value();
|
const double dis_gas_frac = perf_dis_gas_rate / cq_s_zfrac_effective.value();
|
||||||
cq_s_zfrac_effective *= extendEval(dis_gas_frac*intQuants.xVolume() + (1.0-dis_gas_frac)*intQuants.yVolume());
|
cq_s_zfrac_effective *= extendEval(dis_gas_frac*intQuants.xVolume() + (1.0-dis_gas_frac)*intQuants.yVolume());
|
||||||
}
|
}
|
||||||
auto * perf_rate_solvent = well_state.perfRateSolvent(this->index_of_well_);
|
auto& perf_rate_solvent = well_state.perfRateSolvent(this->index_of_well_);
|
||||||
perf_rate_solvent[perf] = cq_s_zfrac_effective.value();
|
perf_rate_solvent[perf] = cq_s_zfrac_effective.value();
|
||||||
|
|
||||||
cq_s_zfrac_effective *= well_efficiency_factor_;
|
cq_s_zfrac_effective *= well_efficiency_factor_;
|
||||||
@ -844,7 +844,7 @@ namespace Opm
|
|||||||
cq_s_sm *= extendEval(intQuants.fluidState().saltConcentration());
|
cq_s_sm *= extendEval(intQuants.fluidState().saltConcentration());
|
||||||
}
|
}
|
||||||
// Note. Efficiency factor is handled in the output layer
|
// Note. Efficiency factor is handled in the output layer
|
||||||
auto * perf_rate_brine = well_state.perfRateBrine(this->index_of_well_);
|
auto& perf_rate_brine = well_state.perfRateBrine(this->index_of_well_);
|
||||||
perf_rate_brine[perf] = cq_s_sm.value();
|
perf_rate_brine[perf] = cq_s_sm.value();
|
||||||
|
|
||||||
cq_s_sm *= well_efficiency_factor_;
|
cq_s_sm *= well_efficiency_factor_;
|
||||||
@ -2113,7 +2113,7 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
|
|
||||||
if constexpr (has_solvent) {
|
if constexpr (has_solvent) {
|
||||||
const auto * solvent_perf_rates_state = well_state.perfRateSolvent(this->index_of_well_);
|
const auto& solvent_perf_rates_state = well_state.perfRateSolvent(this->index_of_well_);
|
||||||
for (int perf = 0; perf < nperf; ++perf) {
|
for (int perf = 0; perf < nperf; ++perf) {
|
||||||
perfRates[perf * num_components_ + contiSolventEqIdx] = solvent_perf_rates_state[perf];
|
perfRates[perf * num_components_ + contiSolventEqIdx] = solvent_perf_rates_state[perf];
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,9 @@ void WellState::base_init(const std::vector<double>& cellPressures,
|
|||||||
this->perf_water_throughput_.clear();
|
this->perf_water_throughput_.clear();
|
||||||
this->perf_water_velocity_.clear();
|
this->perf_water_velocity_.clear();
|
||||||
this->perfrates_.clear();
|
this->perfrates_.clear();
|
||||||
|
this->perfRateBrine_.clear();
|
||||||
|
this->perfRateSolvent_.clear();
|
||||||
|
this->perfRatePolymer_.clear();
|
||||||
this->status_.clear();
|
this->status_.clear();
|
||||||
this->well_perf_data_.clear();
|
this->well_perf_data_.clear();
|
||||||
this->parallel_well_info_.clear();
|
this->parallel_well_info_.clear();
|
||||||
@ -107,6 +110,9 @@ void WellState::initSingleWell(const std::vector<double>& cellPressures,
|
|||||||
this->perf_skin_pressure_.add(well.name(), std::vector<double>(num_perf_this_well, 0));
|
this->perf_skin_pressure_.add(well.name(), std::vector<double>(num_perf_this_well, 0));
|
||||||
this->perf_water_velocity_.add(well.name(), std::vector<double>(num_perf_this_well, 0));
|
this->perf_water_velocity_.add(well.name(), std::vector<double>(num_perf_this_well, 0));
|
||||||
this->perf_water_throughput_.add(well.name(), std::vector<double>(num_perf_this_well, 0));
|
this->perf_water_throughput_.add(well.name(), std::vector<double>(num_perf_this_well, 0));
|
||||||
|
this->perfRatePolymer_.add(well.name(), std::vector<double>(num_perf_this_well, 0));
|
||||||
|
this->perfRateSolvent_.add(well.name(), std::vector<double>(num_perf_this_well, 0));
|
||||||
|
this->perfRateBrine_.add(well.name(), std::vector<double>(num_perf_this_well, 0));
|
||||||
this->bhp_.add(well.name(), 0.0);
|
this->bhp_.add(well.name(), 0.0);
|
||||||
this->thp_.add(well.name(), 0.0);
|
this->thp_.add(well.name(), 0.0);
|
||||||
if ( well.isInjector() )
|
if ( well.isInjector() )
|
||||||
@ -336,14 +342,10 @@ void WellState::init(const std::vector<double>& cellPressures,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
perfRateSolvent_.assign(nperf, 0.0);
|
|
||||||
productivity_index_.assign(nw * this->numPhases(), 0.0);
|
productivity_index_.assign(nw * this->numPhases(), 0.0);
|
||||||
conn_productivity_index_.assign(nperf * this->numPhases(), 0.0);
|
conn_productivity_index_.assign(nperf * this->numPhases(), 0.0);
|
||||||
well_potentials_.assign(nw * this->numPhases(), 0.0);
|
well_potentials_.assign(nw * this->numPhases(), 0.0);
|
||||||
|
|
||||||
perfRatePolymer_.assign(nperf, 0.0);
|
|
||||||
perfRateBrine_.assign(nperf, 0.0);
|
|
||||||
|
|
||||||
for (int w = 0; w < nw; ++w) {
|
for (int w = 0; w < nw; ++w) {
|
||||||
switch (wells_ecl[w].getStatus()) {
|
switch (wells_ecl[w].getStatus()) {
|
||||||
case Well::Status::SHUT:
|
case Well::Status::SHUT:
|
||||||
@ -462,12 +464,7 @@ void WellState::init(const std::vector<double>& cellPressures,
|
|||||||
if (pu.has_solvent) {
|
if (pu.has_solvent) {
|
||||||
if (global_num_perf_same)
|
if (global_num_perf_same)
|
||||||
{
|
{
|
||||||
auto * solvent_target = this->perfRateSolvent(newIndex);
|
this->perfRateSolvent_.copy_welldata(prevState->perfRateSolvent_, wname);
|
||||||
const auto * solvent_src = prevState->perfRateSolvent(oldIndex);
|
|
||||||
for (int perf = 0; perf < num_perf_this_well; ++perf)
|
|
||||||
{
|
|
||||||
solvent_target[perf] = solvent_src[perf];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -766,15 +763,15 @@ void WellState::reportConnections(data::Well& well,
|
|||||||
comp.rates.set( pi [ i ], *(connPI + i) );
|
comp.rates.set( pi [ i ], *(connPI + i) );
|
||||||
}
|
}
|
||||||
if ( pu.has_polymer ) {
|
if ( pu.has_polymer ) {
|
||||||
const auto * perf_polymer_rate = this->perfRatePolymer(well_index);
|
const auto& perf_polymer_rate = this->perfRatePolymer(well_index);
|
||||||
comp.rates.set( rt::polymer, perf_polymer_rate[local_comp_index]);
|
comp.rates.set( rt::polymer, perf_polymer_rate[local_comp_index]);
|
||||||
}
|
}
|
||||||
if ( pu.has_brine ) {
|
if ( pu.has_brine ) {
|
||||||
const auto * perf_brine_rate = this->perfRateBrine(well_index);
|
const auto& perf_brine_rate = this->perfRateBrine(well_index);
|
||||||
comp.rates.set( rt::brine, perf_brine_rate[local_comp_index]);
|
comp.rates.set( rt::brine, perf_brine_rate[local_comp_index]);
|
||||||
}
|
}
|
||||||
if ( pu.has_solvent ) {
|
if ( pu.has_solvent ) {
|
||||||
const auto * perf_solvent_rate = this->perfRateSolvent(well_index);
|
const auto& perf_solvent_rate = this->perfRateSolvent(well_index);
|
||||||
comp.rates.set( rt::solvent, perf_solvent_rate[local_comp_index] );
|
comp.rates.set( rt::solvent, perf_solvent_rate[local_comp_index] );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -940,20 +937,20 @@ WellState::calculateSegmentRates(const std::vector<std::vector<int>>& segment_in
|
|||||||
|
|
||||||
double WellState::solventWellRate(const int w) const
|
double WellState::solventWellRate(const int w) const
|
||||||
{
|
{
|
||||||
const auto * perf_rates_solvent = this->perfRateSolvent(w);
|
const auto& perf_rates_solvent = this->perfRateSolvent(w);
|
||||||
return parallel_well_info_[w]->sumPerfValues(perf_rates_solvent, perf_rates_solvent + this->numPerf(w));
|
return parallel_well_info_[w]->sumPerfValues(perf_rates_solvent.begin(), perf_rates_solvent.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
double WellState::polymerWellRate(const int w) const
|
double WellState::polymerWellRate(const int w) const
|
||||||
{
|
{
|
||||||
const auto * perf_rates_polymer = this->perfRatePolymer(w);
|
const auto& perf_rates_polymer = this->perfRatePolymer(w);
|
||||||
return parallel_well_info_[w]->sumPerfValues(perf_rates_polymer, perf_rates_polymer + this->numPerf(w));
|
return parallel_well_info_[w]->sumPerfValues(perf_rates_polymer.begin(), perf_rates_polymer.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
double WellState::brineWellRate(const int w) const
|
double WellState::brineWellRate(const int w) const
|
||||||
{
|
{
|
||||||
const auto * perf_rates_brine = this->perfRateBrine(w);
|
const auto& perf_rates_brine = this->perfRateBrine(w);
|
||||||
return parallel_well_info_[w]->sumPerfValues(perf_rates_brine, perf_rates_brine + this->numPerf(w));
|
return parallel_well_info_[w]->sumPerfValues(perf_rates_brine.begin(), perf_rates_brine.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -158,36 +158,36 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// One rate pr well connection.
|
/// One rate pr well connection.
|
||||||
double * perfRateSolvent(std::size_t well_index) {
|
std::vector<double>& perfRateSolvent(std::size_t well_index) {
|
||||||
return &perfRateSolvent_[this->first_perf_index_[well_index]];
|
return this->perfRateSolvent_[well_index];
|
||||||
}
|
}
|
||||||
|
|
||||||
const double * perfRateSolvent(std::size_t well_index) const {
|
const std::vector<double>& perfRateSolvent(std::size_t well_index) const {
|
||||||
return &perfRateSolvent_[this->first_perf_index_[well_index]];
|
return this->perfRateSolvent_[well_index];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// One rate pr well
|
/// One rate pr well
|
||||||
double solventWellRate(const int w) const;
|
double solventWellRate(const int w) const;
|
||||||
|
|
||||||
/// One rate pr well connection.
|
/// One rate pr well connection.
|
||||||
double * perfRatePolymer(std::size_t well_index) {
|
std::vector<double>& perfRatePolymer(std::size_t well_index) {
|
||||||
return &this->perfRatePolymer_[this->first_perf_index_[well_index]];
|
return this->perfRatePolymer_[well_index];
|
||||||
}
|
}
|
||||||
|
|
||||||
const double * perfRatePolymer(std::size_t well_index) const {
|
const std::vector<double>& perfRatePolymer(std::size_t well_index) const {
|
||||||
return &this->perfRatePolymer_[this->first_perf_index_[well_index]];
|
return this->perfRatePolymer_[well_index];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// One rate pr well
|
/// One rate pr well
|
||||||
double polymerWellRate(const int w) const;
|
double polymerWellRate(const int w) const;
|
||||||
|
|
||||||
/// One rate pr well connection.
|
/// One rate pr well connection.
|
||||||
double* perfRateBrine(std::size_t well_index) {
|
std::vector<double>& perfRateBrine(std::size_t well_index) {
|
||||||
return &this->perfRateBrine_[this->first_perf_index_[well_index]];
|
return this->perfRateBrine_[well_index];
|
||||||
}
|
}
|
||||||
|
|
||||||
const double* perfRateBrine(std::size_t well_index) const {
|
const std::vector<double>& perfRateBrine(std::size_t well_index) const {
|
||||||
return &this->perfRateBrine_[this->first_perf_index_[well_index]];
|
return this->perfRateBrine_[well_index];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// One rate pr well
|
/// One rate pr well
|
||||||
@ -452,11 +452,11 @@ private:
|
|||||||
std::map<std::string, std::pair<bool, std::vector<double>>> well_rates;
|
std::map<std::string, std::pair<bool, std::vector<double>>> well_rates;
|
||||||
|
|
||||||
|
|
||||||
std::vector<double> perfRateSolvent_;
|
WellContainer<std::vector<double>> perfRateSolvent_;
|
||||||
|
|
||||||
// only for output
|
// only for output
|
||||||
std::vector<double> perfRatePolymer_;
|
WellContainer<std::vector<double>> perfRatePolymer_;
|
||||||
std::vector<double> perfRateBrine_;
|
WellContainer<std::vector<double>> perfRateBrine_;
|
||||||
|
|
||||||
// it is the throughput of water flow through the perforations
|
// it is the throughput of water flow through the perforations
|
||||||
// it is used as a measure of formation damage around well-bore due to particle deposition
|
// it is used as a measure of formation damage around well-bore due to particle deposition
|
||||||
|
Loading…
Reference in New Issue
Block a user