From 9a12869cdb128418afe40340de2e3785c7e1d375 Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Thu, 26 Jan 2023 14:03:05 +0100 Subject: [PATCH] making sure to check the network nodal pressure constraint when checking the THP constraint for producers. --- opm/simulators/wells/WellConstraints.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/opm/simulators/wells/WellConstraints.cpp b/opm/simulators/wells/WellConstraints.cpp index 335f3e872..ed6b15ccd 100644 --- a/opm/simulators/wells/WellConstraints.cpp +++ b/opm/simulators/wells/WellConstraints.cpp @@ -129,6 +129,9 @@ activeInjectionConstraint(const SingleWellState& ws, return Well::InjectorCMode::RESV; } + // Note: we are not working on injecting network yet, so it is possible we need to change the following line + // to be as follows to incorporate the injecting network nodal pressure + // if (well_.wellHasTHPConstraints(summaryState) && currentControl != Well::InjectorCMode::THP) if (controls.hasControl(Well::InjectorCMode::THP) && currentControl != Well::InjectorCMode::THP) { const auto& thp = well_.getTHPConstraint(summaryState); @@ -248,7 +251,7 @@ activeProductionConstraint(const SingleWellState& ws, } } - if (controls.hasControl(Well::ProducerCMode::THP) && currentControl != Well::ProducerCMode::THP) { + if (well_.wellHasTHPConstraints(summaryState) && currentControl != Well::ProducerCMode::THP) { const auto& thp = well_.getTHPConstraint(summaryState); double current_thp = ws.thp; if (thp > current_thp && !ws.trivial_target) {