From 529af98ce9b72dcf3a95f9f710437f1f19b0bd7f Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Wed, 6 Sep 2023 11:46:20 +0200 Subject: [PATCH] setting uninitialized bhp to be bhp_limit in updateWellStateWithTarget to avoid uninitialized bhp 0. to be used. --- opm/simulators/wells/WellInterface_impl.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/opm/simulators/wells/WellInterface_impl.hpp b/opm/simulators/wells/WellInterface_impl.hpp index 19508584d..fe9845afc 100644 --- a/opm/simulators/wells/WellInterface_impl.hpp +++ b/opm/simulators/wells/WellInterface_impl.hpp @@ -874,6 +874,10 @@ namespace Opm // within the wellbore from the previous result, and hopefully it is a good // initial guess for the zero rate target. ws.surface_rates[phasePos] = std::max(1.e-7, ws.surface_rates[phasePos]); + + if (ws.bhp == 0.) { + ws.bhp = controls.bhp_limit; + } } //Producer else @@ -1096,6 +1100,10 @@ namespace Opm break; } // end of switch + + if (ws.bhp == 0.) { + ws.bhp = controls.bhp_limit; + } } }