From c70f63b99bc136508616ab0085c234dbc1351c7e Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Mon, 26 Jul 2021 17:55:37 +0200 Subject: [PATCH] Make sure WellState injection control is updated --- opm/simulators/wells/WellInterfaceFluidSystem.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opm/simulators/wells/WellInterfaceFluidSystem.cpp b/opm/simulators/wells/WellInterfaceFluidSystem.cpp index a41e4a9b1..5a003ee83 100644 --- a/opm/simulators/wells/WellInterfaceFluidSystem.cpp +++ b/opm/simulators/wells/WellInterfaceFluidSystem.cpp @@ -93,7 +93,7 @@ checkIndividualConstraints(WellState& well_state, if (well.isInjector()) { const auto controls = well.injectionControls(summaryState); - auto currentControl = well_state.currentInjectionControl(well_index); + const auto currentControl = well_state.currentInjectionControl(well_index); if (controls.hasControl(Well::InjectorCMode::BHP) && currentControl != Well::InjectorCMode::BHP) { @@ -150,7 +150,7 @@ checkIndividualConstraints(WellState& well_state, current_rate += well_state.wellReservoirRates(well_index)[ pu.phase_pos[BlackoilPhases::Vapour] ]; if (controls.reservoir_rate < current_rate) { - currentControl = Well::InjectorCMode::RESV; + well_state.currentInjectionControl(well_index, Well::InjectorCMode::RESV); return true; } } @@ -160,7 +160,7 @@ checkIndividualConstraints(WellState& well_state, const auto& thp = getTHPConstraint(summaryState); double current_thp = well_state.thp(well_index); if (thp < current_thp) { - currentControl = Well::InjectorCMode::THP; + well_state.currentInjectionControl(well_index, Well::InjectorCMode::THP); return true; } }