diff --git a/opm/simulators/wells/MultisegmentWellPrimaryVariables.cpp b/opm/simulators/wells/MultisegmentWellPrimaryVariables.cpp index 5a5a6b753..b77727e74 100644 --- a/opm/simulators/wells/MultisegmentWellPrimaryVariables.cpp +++ b/opm/simulators/wells/MultisegmentWellPrimaryVariables.cpp @@ -403,7 +403,7 @@ copyToWellState(const MultisegmentWellGeneric& mswell, // Note: for the ALQ value, in the StandardWell, WellInterfaceGeneric::getALQ(well_state) is used. // We might want to unify the way regarding AQL value. WellBhpThpCalculator(well_) - .updateThp(rho, stop_or_zero_rate_target, [this]() { return well_.wellEcl().alq_value(); }, + .updateThp(rho, stop_or_zero_rate_target, [this, summary_state]() { return well_.wellEcl().alq_value(summary_state); }, {FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx), FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx), FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx)}, diff --git a/opm/simulators/wells/MultisegmentWell_impl.hpp b/opm/simulators/wells/MultisegmentWell_impl.hpp index 7742fe482..7517e65f6 100644 --- a/opm/simulators/wells/MultisegmentWell_impl.hpp +++ b/opm/simulators/wells/MultisegmentWell_impl.hpp @@ -1101,7 +1101,7 @@ namespace Opm const double thp = WellBhpThpCalculator(*this).calculateThpFromBhp(well_rates_bhp_limit, bhp_limit, this->getRefDensity(), - this->wellEcl().alq_value(), + this->wellEcl().alq_value(summaryState), thp_limit, deferred_logger); if ( (this->isProducer() && thp < thp_limit) || (this->isInjector() && thp > thp_limit) ) { diff --git a/opm/simulators/wells/WellState.cpp b/opm/simulators/wells/WellState.cpp index 0dd07f811..0c0a826f4 100644 --- a/opm/simulators/wells/WellState.cpp +++ b/opm/simulators/wells/WellState.cpp @@ -407,7 +407,7 @@ void WellState::init(const std::vector& cellPressures, } - updateWellsDefaultALQ(wells_ecl); + updateWellsDefaultALQ(wells_ecl, summary_state); } void WellState::resize(const std::vector& wells_ecl, @@ -993,14 +993,14 @@ bool WellState::wellIsOwned(const std::string& wellName) const return wellIsOwned(well_index.value(), wellName); } -void WellState::updateWellsDefaultALQ(const std::vector& wells_ecl) +void WellState::updateWellsDefaultALQ(const std::vector& wells_ecl, const SummaryState& summary_state) { const int nw = wells_ecl.size(); for (int i = 0; ialq_state.update_default(well.name(), alq); } } diff --git a/opm/simulators/wells/WellState.hpp b/opm/simulators/wells/WellState.hpp index 0b058aaa6..c25bbd2f0 100644 --- a/opm/simulators/wells/WellState.hpp +++ b/opm/simulators/wells/WellState.hpp @@ -336,7 +336,8 @@ private: // constant lift gas injection and for gas lift optimization // (THP controlled wells). - void updateWellsDefaultALQ(const std::vector& wells_ecl); + void updateWellsDefaultALQ(const std::vector& wells_ecl, const SummaryState& summary_state); + /// Allocate and initialize if wells is non-null. /// Also tries to give useful initial values to the bhp() and