From a72bf040fd198287b4979a2abfd4a91b094f3cdc Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Tue, 16 Sep 2025 15:05:25 +0200 Subject: [PATCH] Stop all non-operable wells --- opm/simulators/wells/WellInterface_impl.hpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/opm/simulators/wells/WellInterface_impl.hpp b/opm/simulators/wells/WellInterface_impl.hpp index 613ab248ef..31878dd39d 100644 --- a/opm/simulators/wells/WellInterface_impl.hpp +++ b/opm/simulators/wells/WellInterface_impl.hpp @@ -957,17 +957,21 @@ namespace Opm } } this->changed_to_open_this_step_ = false; - const bool well_operable = this->operability_status_.isOperableAndSolvable(); + changed_to_stopped_this_step_ = false; - if (!well_operable && old_well_operable) { - deferred_logger.debug(" well " + this->name() + " gets STOPPED during iteration "); + const bool well_operable = this->operability_status_.isOperableAndSolvable(); + if (!well_operable) { this->stopWell(); - changed_to_stopped_this_step_ = true; - } else if (well_operable && !old_well_operable) { - deferred_logger.debug(" well " + this->name() + " gets REVIVED during iteration "); + if (old_well_operable) { + deferred_logger.debug(" well " + this->name() + " gets STOPPED during iteration "); + changed_to_stopped_this_step_ = true; + } + } else if (well_state.isOpen(this->name())) { this->openWell(); - changed_to_stopped_this_step_ = false; - this->changed_to_open_this_step_ = true; + if (!old_well_operable) { + deferred_logger.debug(" well " + this->name() + " gets REVIVED during iteration "); + this->changed_to_open_this_step_ = true; + } } }