diff --git a/opm/simulators/wells/StandardWell_impl.hpp b/opm/simulators/wells/StandardWell_impl.hpp index 84bb22ae4..fd354f901 100644 --- a/opm/simulators/wells/StandardWell_impl.hpp +++ b/opm/simulators/wells/StandardWell_impl.hpp @@ -1773,6 +1773,7 @@ namespace Opm } case Well2::ProducerCMode::THP: { + well_state.thp()[well_index] = controls.thp_limit; auto bhp = robustSolveBhpAtThpLimitProd(ebos_simulator, summaryState, deferred_logger); if (bhp) { well_state.bhp()[well_index] = *bhp; @@ -1946,6 +1947,7 @@ namespace Opm } } else if (well_operable && !old_well_operable) { deferred_logger.info(" well " + name() + " gets REVIVED during iteration "); + this->openWell(); changed_to_stopped_this_step_ = false; } } @@ -2791,8 +2793,8 @@ namespace Opm // does the well have a THP related constraint? const auto& summaryState = ebosSimulator.vanguard().summaryState(); - // does the well have a THP related constraint? - if ( !well.Base::wellHasTHPConstraints(summaryState) ) { + const Well2::ProducerCMode& current_control = well_state.currentProductionControls()[this->index_of_well_]; + if ( !well.Base::wellHasTHPConstraints(summaryState) || current_control == Well2::ProducerCMode::BHP ) { // get the bhp value based on the bhp constraints const double bhp = well.mostStrictBhpFromBhpLimits(summaryState); assert(std::abs(bhp) != std::numeric_limits::max()); diff --git a/opm/simulators/wells/WellInterface_impl.hpp b/opm/simulators/wells/WellInterface_impl.hpp index 75a3b19ee..d3e3e17d4 100644 --- a/opm/simulators/wells/WellInterface_impl.hpp +++ b/opm/simulators/wells/WellInterface_impl.hpp @@ -449,6 +449,9 @@ namespace Opm WellState& well_state, Opm::DeferredLogger& deferred_logger) /* const */ { + if (this->wellIsStopped()) { + return; + } const auto& summaryState = ebos_simulator.vanguard().summaryState(); const auto& well = well_ecl_;