From 3a65a7ba22a937d41ce1d17c3151c98e42cc8492 Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Tue, 23 Mar 2021 09:23:35 +0100 Subject: [PATCH] reset target from wconprod and wconinje --- .../wells/WellStateFullyImplicitBlackoil.hpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp b/opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp index e1f120dec..196e47853 100644 --- a/opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp +++ b/opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp @@ -218,13 +218,11 @@ namespace Opm // thp thp()[ newIndex ] = prevState->thp()[ oldIndex ]; - // Currently this is taken care of by updateWellStateFromTarge. Maybe we should just remove the initialization and just use updateWellStateFromTarget - //if (effective_events_occurred_[w]) { - // continue; - //} - - current_injection_controls_[ newIndex ] = prevState->currentInjectionControls()[ oldIndex ]; - current_production_controls_[ newIndex ] = prevState->currentProductionControls()[ oldIndex ]; + // If new target is set using WCONPROD, WCONINJE etc. we change to the new control. + if (!effective_events_occurred_[w]) { + current_injection_controls_[ newIndex ] = prevState->currentInjectionControls()[ oldIndex ]; + current_production_controls_[ newIndex ] = prevState->currentProductionControls()[ oldIndex ]; + } // wellrates for( int i=0, idx=newIndex*np, oldidx=oldIndex*np; i