mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Use SingleWellState for production and injection control
This commit is contained in:
@@ -257,8 +257,9 @@ namespace Opm
|
||||
// If the well is pressure controlled the potential equals the rate.
|
||||
bool thp_controlled_well = false;
|
||||
bool bhp_controlled_well = false;
|
||||
const auto& ws = well_state.well(this->index_of_well_);
|
||||
if (this->isInjector()) {
|
||||
const Well::InjectorCMode& current = well_state.currentInjectionControl(index_of_well_);
|
||||
const Well::InjectorCMode& current = ws.injection_cmode;
|
||||
if (current == Well::InjectorCMode::THP) {
|
||||
thp_controlled_well = true;
|
||||
}
|
||||
@@ -266,7 +267,7 @@ namespace Opm
|
||||
bhp_controlled_well = true;
|
||||
}
|
||||
} else {
|
||||
const Well::ProducerCMode& current = well_state.currentProductionControl(index_of_well_);
|
||||
const Well::ProducerCMode& current = ws.production_cmode;
|
||||
if (current == Well::ProducerCMode::THP) {
|
||||
thp_controlled_well = true;
|
||||
}
|
||||
@@ -354,10 +355,10 @@ namespace Opm
|
||||
// Set current control to bhp, and bhp value in state, modify bhp limit in control object.
|
||||
if (well_copy.well_ecl_.isInjector()) {
|
||||
inj_controls.bhp_limit = bhp;
|
||||
well_state_copy.currentInjectionControl(index_of_well_, Well::InjectorCMode::BHP);
|
||||
ws.injection_cmode = Well::InjectorCMode::BHP;
|
||||
} else {
|
||||
prod_controls.bhp_limit = bhp;
|
||||
well_state_copy.currentProductionControl(index_of_well_, Well::ProducerCMode::BHP);
|
||||
ws.production_cmode = Well::ProducerCMode::BHP;
|
||||
}
|
||||
ws.bhp = bhp;
|
||||
well_copy.scaleSegmentPressuresWithBhp(well_state_copy);
|
||||
|
||||
Reference in New Issue
Block a user