Merge pull request #4817 from steink/skip_rate_init_for_stopped_or_zero_target_wells

Skip initialization of rates for stopped/zero-rate-target wells
This commit is contained in:
Kai Bao 2023-08-29 21:17:18 +02:00 committed by GitHub
commit 005e67ffbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -435,13 +435,15 @@ namespace Opm {
// we need the inj_multiplier from the previous time step // we need the inj_multiplier from the previous time step
this->initInjMult(); this->initInjMult();
const auto& summaryState = ebosSimulator_.vanguard().summaryState();
if (alternative_well_rate_init_) { if (alternative_well_rate_init_) {
// Update the well rates of well_state_, if only single-phase rates, to // Update the well rates of well_state_, if only single-phase rates, to
// have proper multi-phase rates proportional to rates at bhp zero. // have proper multi-phase rates proportional to rates at bhp zero.
// This is done only for producers, as injectors will only have a single // This is done only for producers, as injectors will only have a single
// nonzero phase anyway. // nonzero phase anyway.
for (auto& well : well_container_) { for (auto& well : well_container_) {
if (well->isProducer()) { const bool zero_target = well->stopppedOrZeroRateTarget(summaryState, this->wellState());
if (well->isProducer() && !zero_target) {
well->updateWellStateRates(ebosSimulator_, this->wellState(), local_deferredLogger); well->updateWellStateRates(ebosSimulator_, this->wellState(), local_deferredLogger);
} }
} }
@ -466,7 +468,6 @@ namespace Opm {
//update guide rates //update guide rates
const auto& comm = ebosSimulator_.vanguard().grid().comm(); const auto& comm = ebosSimulator_.vanguard().grid().comm();
const auto& summaryState = ebosSimulator_.vanguard().summaryState();
std::vector<double> pot(numPhases(), 0.0); std::vector<double> pot(numPhases(), 0.0);
const Group& fieldGroup = schedule().getGroup("FIELD", reportStepIdx); const Group& fieldGroup = schedule().getGroup("FIELD", reportStepIdx);
WellGroupHelpers::updateGuideRates(fieldGroup, schedule(), summaryState, this->phase_usage_, reportStepIdx, simulationTime, WellGroupHelpers::updateGuideRates(fieldGroup, schedule(), summaryState, this->phase_usage_, reportStepIdx, simulationTime,