From cb7e1687282d8fb583bdd8bc51e0055b413159fb Mon Sep 17 00:00:00 2001 From: Stein Krogstad Date: Fri, 13 Sep 2024 15:09:14 +0200 Subject: [PATCH 1/3] Disallow switching to group control in local well solve --- opm/simulators/wells/WellInterface_impl.hpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/opm/simulators/wells/WellInterface_impl.hpp b/opm/simulators/wells/WellInterface_impl.hpp index d9e1d7e5a..3860d3acd 100644 --- a/opm/simulators/wells/WellInterface_impl.hpp +++ b/opm/simulators/wells/WellInterface_impl.hpp @@ -301,13 +301,14 @@ namespace Opm } else { bool changed = false; if (!fixed_control) { - const bool hasGroupControl = this->isInjector() ? inj_controls.hasControl(Well::InjectorCMode::GRUP) : - prod_controls.hasControl(Well::ProducerCMode::GRUP); + // *** Comment out checking group constraints (subject to change) *** + // const bool hasGroupControl = this->isInjector() ? inj_controls.hasControl(Well::InjectorCMode::GRUP) : + // prod_controls.hasControl(Well::ProducerCMode::GRUP); changed = this->checkIndividualConstraints(ws, summary_state, deferred_logger, inj_controls, prod_controls); - if (hasGroupControl) { - changed = changed || this->checkGroupConstraints(well_state, group_state, schedule, summary_state,deferred_logger); - } + // if (hasGroupControl) { + // changed = changed || this->checkGroupConstraints(well_state, group_state, schedule, summary_state,deferred_logger); + // } if (changed) { const bool thp_controlled = this->isInjector() ? ws.injection_cmode == Well::InjectorCMode::THP : From 41933c618ab7fe39b2b6ffb826caa31fcd0ae1ee Mon Sep 17 00:00:00 2001 From: Stein Krogstad Date: Thu, 19 Sep 2024 12:58:47 +0200 Subject: [PATCH 2/3] update description --- opm/simulators/wells/WellInterface_impl.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/opm/simulators/wells/WellInterface_impl.hpp b/opm/simulators/wells/WellInterface_impl.hpp index 3860d3acd..c21ebaf6c 100644 --- a/opm/simulators/wells/WellInterface_impl.hpp +++ b/opm/simulators/wells/WellInterface_impl.hpp @@ -301,7 +301,11 @@ namespace Opm } else { bool changed = false; if (!fixed_control) { - // *** Comment out checking group constraints (subject to change) *** + // We don't allow changing to group controls here since this may lead to inconsistencies + // in the group handling which in turn may result in excessive back and forth switching. + // If we are to allow this change, one needs to make sure all necessary information propagates + // properly, but for now, we simply disallow it. The commented code below is kept for future reference + // const bool hasGroupControl = this->isInjector() ? inj_controls.hasControl(Well::InjectorCMode::GRUP) : // prod_controls.hasControl(Well::ProducerCMode::GRUP); From d202ea256a42d2a0aae983cb6cccd1598d0d89c9 Mon Sep 17 00:00:00 2001 From: Stein Krogstad Date: Thu, 19 Sep 2024 13:28:13 +0200 Subject: [PATCH 3/3] Remove unused schedule --- opm/simulators/wells/WellInterface_impl.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/opm/simulators/wells/WellInterface_impl.hpp b/opm/simulators/wells/WellInterface_impl.hpp index c21ebaf6c..8af3d3e36 100644 --- a/opm/simulators/wells/WellInterface_impl.hpp +++ b/opm/simulators/wells/WellInterface_impl.hpp @@ -279,7 +279,6 @@ namespace Opm const bool fixed_status) { const auto& summary_state = simulator.vanguard().summaryState(); - const auto& schedule = simulator.vanguard().schedule(); auto& ws = well_state.well(this->index_of_well_); std::string from; if (this->isInjector()) {