From 0d0dfc0efe7884aadfd52fb41f9226f43f08c7ff Mon Sep 17 00:00:00 2001 From: Halvor M Nilsen Date: Thu, 13 Feb 2025 14:42:30 +0100 Subject: [PATCH 1/2] skip gaslift if not active --- opm/simulators/wells/BlackoilWellModelGasLift_impl.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/opm/simulators/wells/BlackoilWellModelGasLift_impl.hpp b/opm/simulators/wells/BlackoilWellModelGasLift_impl.hpp index ee08402a3a..214456159e 100644 --- a/opm/simulators/wells/BlackoilWellModelGasLift_impl.hpp +++ b/opm/simulators/wells/BlackoilWellModelGasLift_impl.hpp @@ -46,10 +46,14 @@ maybeDoGasLiftOptimize(const Simulator& simulator, DeferredLogger& deferred_logger) { OPM_TIMEFUNCTION(); + const auto& glo = simulator.vanguard().schedule().glo(simulator.episodeIndex()) + if(!glo.active()) { + return false; + } bool do_glift_optimization = false; int num_wells_changed = 0; const double simulation_time = simulator.time(); - const Scalar min_wait = simulator.vanguard().schedule().glo(simulator.episodeIndex()).min_wait(); + const Scalar min_wait = glo.min_wait(); // We only optimize if a min_wait time has past. // If all_newton is true we still want to optimize several times pr timestep // i.e. we also optimize if check simulation_time == last_glift_opt_time_ From 5b161e229892a154c5901e1b0c31dd95ca8c8857 Mon Sep 17 00:00:00 2001 From: Halvor M Nilsen Date: Thu, 13 Feb 2025 15:05:34 +0100 Subject: [PATCH 2/2] fixed error --- opm/simulators/wells/BlackoilWellModelGasLift_impl.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opm/simulators/wells/BlackoilWellModelGasLift_impl.hpp b/opm/simulators/wells/BlackoilWellModelGasLift_impl.hpp index 214456159e..a2c148c97c 100644 --- a/opm/simulators/wells/BlackoilWellModelGasLift_impl.hpp +++ b/opm/simulators/wells/BlackoilWellModelGasLift_impl.hpp @@ -46,7 +46,7 @@ maybeDoGasLiftOptimize(const Simulator& simulator, DeferredLogger& deferred_logger) { OPM_TIMEFUNCTION(); - const auto& glo = simulator.vanguard().schedule().glo(simulator.episodeIndex()) + const auto& glo = simulator.vanguard().schedule().glo(simulator.episodeIndex()); if(!glo.active()) { return false; }