From 32e45489d7e3c058eab77af216af0f26fc1c5343 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 2 Nov 2023 10:59:16 +0100 Subject: [PATCH] This is a combination of 3 commits. autochoke producers control mode set to THP simplyfying code as some logic is moved to the parser minor repair work --- .../wells/BlackoilWellModelGeneric.cpp | 3 --- .../wells/BlackoilWellModel_impl.hpp | 3 +++ opm/simulators/wells/WellInterface_impl.hpp | 19 ++++++++----------- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/opm/simulators/wells/BlackoilWellModelGeneric.cpp b/opm/simulators/wells/BlackoilWellModelGeneric.cpp index 4eae4abc30..1551181591 100644 --- a/opm/simulators/wells/BlackoilWellModelGeneric.cpp +++ b/opm/simulators/wells/BlackoilWellModelGeneric.cpp @@ -1562,9 +1562,6 @@ updateNetworkPressures(const int reportStepIdx, const Scalar damping_factor) if (thp_is_limit) { ws.thp = well->getTHPConstraint(summaryState_); } - //PJPE: Set thp of wells belonging to a subsea manifold equal to the node_pressure - if (network.node(well->wellEcl().groupName()).as_choke()) - ws.thp = new_limit; } } } diff --git a/opm/simulators/wells/BlackoilWellModel_impl.hpp b/opm/simulators/wells/BlackoilWellModel_impl.hpp index 79f9d95eb2..e78f01077d 100644 --- a/opm/simulators/wells/BlackoilWellModel_impl.hpp +++ b/opm/simulators/wells/BlackoilWellModel_impl.hpp @@ -2686,6 +2686,9 @@ namespace Opm { const std::string msg = "Compute initial well solution for " + well->name() + " initially failed. Continue with the previous rates"; deferred_logger.warning("WELL_INITIAL_SOLVE_FAILED", msg); } + // If we're using local well solves that include control switches, they also update + // operability, so reset before main iterations begin + well->resetWellOperability(); } } updatePrimaryVariables(deferred_logger); diff --git a/opm/simulators/wells/WellInterface_impl.hpp b/opm/simulators/wells/WellInterface_impl.hpp index 0071749f72..0b05c2a123 100644 --- a/opm/simulators/wells/WellInterface_impl.hpp +++ b/opm/simulators/wells/WellInterface_impl.hpp @@ -1473,19 +1473,16 @@ namespace Opm efficiencyFactor, deferred_logger); - // we don't want to scale with zero and get zero rates. - if (scale > 0) { - for (int p = 0; p 0) { + for (int p = 0; p