From ec1359c9159db84d1c8066d1b84e7f3a8595e50d Mon Sep 17 00:00:00 2001 From: Halvor M Nilsen Date: Tue, 4 Feb 2025 12:37:39 +0100 Subject: [PATCH] Change primary variables to be consistent when updated from wellstate --- opm/simulators/wells/MultisegmentWellPrimaryVariables.cpp | 2 ++ opm/simulators/wells/StandardWellPrimaryVariables.cpp | 3 +++ 2 files changed, 5 insertions(+) diff --git a/opm/simulators/wells/MultisegmentWellPrimaryVariables.cpp b/opm/simulators/wells/MultisegmentWellPrimaryVariables.cpp index 1c2a99507..c1722cb40 100644 --- a/opm/simulators/wells/MultisegmentWellPrimaryVariables.cpp +++ b/opm/simulators/wells/MultisegmentWellPrimaryVariables.cpp @@ -152,6 +152,7 @@ update(const WellState& well_state, } } } + init(); } template @@ -208,6 +209,7 @@ updateNewton(const BVectorWell& dwells, if (stop_or_zero_rate_target) { value_[0][WQTotal] = 0.; } + init(); } template diff --git a/opm/simulators/wells/StandardWellPrimaryVariables.cpp b/opm/simulators/wells/StandardWellPrimaryVariables.cpp index 17410e2f3..0c43bf9e9 100644 --- a/opm/simulators/wells/StandardWellPrimaryVariables.cpp +++ b/opm/simulators/wells/StandardWellPrimaryVariables.cpp @@ -223,6 +223,7 @@ update(const WellState& well_state, // BHP value_[Bhp] = ws.bhp; + init(); } template @@ -301,6 +302,7 @@ updateNewton(const BVectorWell& dwells, // so that bhp constaint can be an active control when needed. constexpr Scalar bhp_lower_limit = 1. * unit::barsa - 1. * unit::Pascal; value_[Bhp] = std::max(value_[Bhp] - dx1_limited, bhp_lower_limit); + init(); } template @@ -320,6 +322,7 @@ updateNewtonPolyMW(const BVectorWell& dwells) value_[pskin_index] -= relaxation_factor * dx_pskin; } } + init(); } template