From d8934ea7a950aed273f78819af2f344df406fd39 Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Thu, 17 Feb 2022 08:58:38 +0100 Subject: [PATCH] Set well control to thp or bhp in well testing --- opm/simulators/wells/WellInterface_impl.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/opm/simulators/wells/WellInterface_impl.hpp b/opm/simulators/wells/WellInterface_impl.hpp index ec8fe2cd4..7c0e6183c 100644 --- a/opm/simulators/wells/WellInterface_impl.hpp +++ b/opm/simulators/wells/WellInterface_impl.hpp @@ -418,6 +418,13 @@ namespace Opm // keep a copy of the original well state const WellState well_state0 = well_state; const double dt = ebosSimulator.timeStepSize(); + const auto& summary_state = ebosSimulator.vanguard().summaryState(); + const bool has_thp_limit = this->wellHasTHPConstraints(summary_state); + if (has_thp_limit) + well_state.well(this->indexOfWell()).production_cmode = Well::ProducerCMode::THP; + else + well_state.well(this->indexOfWell()).production_cmode = Well::ProducerCMode::BHP; + const bool converged = iterateWellEquations(ebosSimulator, dt, well_state, group_state, deferred_logger); if (converged) { deferred_logger.debug("WellTest: Well equation for well " + this->name() + " converged");