diff --git a/opm/simulators/wells/StandardWellConnections.hpp b/opm/simulators/wells/StandardWellConnections.hpp index ae75661ed..26bb696f4 100644 --- a/opm/simulators/wells/StandardWellConnections.hpp +++ b/opm/simulators/wells/StandardWellConnections.hpp @@ -62,7 +62,8 @@ public: std::vector& rvwmax_perf, std::vector& surf_dens_perf) const; - Scalar getRho() const + //! \brief Returns density for first perforation. + Scalar rho() const { return this->perf_densities_.empty() ? 0.0 : perf_densities_[0]; } diff --git a/opm/simulators/wells/StandardWellEval.cpp b/opm/simulators/wells/StandardWellEval.cpp index 5da334d0f..7a09c4441 100644 --- a/opm/simulators/wells/StandardWellEval.cpp +++ b/opm/simulators/wells/StandardWellEval.cpp @@ -78,7 +78,7 @@ updateWellStateFromPrimaryVariables(WellState& well_state, this->primary_variables_.copyToWellState(well_state, deferred_logger); WellBhpThpCalculator(baseif_). - updateThp(connections_.getRho(), + updateThp(connections_.rho(), [this,&well_state]() { return this->baseif_.getALQ(well_state); }, {FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx), FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx), diff --git a/opm/simulators/wells/StandardWell_impl.hpp b/opm/simulators/wells/StandardWell_impl.hpp index 2c31cb7c7..bbe1d2259 100644 --- a/opm/simulators/wells/StandardWell_impl.hpp +++ b/opm/simulators/wells/StandardWell_impl.hpp @@ -546,7 +546,7 @@ namespace Opm assembleControlEq(well_state, group_state, schedule, summaryState, this->primary_variables_, - this->connections_.getRho(), + this->connections_.rho(), this->linSys_, deferred_logger); @@ -1117,7 +1117,7 @@ namespace Opm this->adaptRatesForVFP(well_rates_bhp_limit); const double thp = WellBhpThpCalculator(*this).calculateThpFromBhp(well_rates_bhp_limit, bhp_limit, - this->connections_.getRho(), + this->connections_.rho(), this->getALQ(well_state), deferred_logger); const double thp_limit = this->getTHPConstraint(summaryState); @@ -1918,7 +1918,7 @@ namespace Opm StandardWell:: getRefDensity() const { - return this->connections_.getRho(); + return this->connections_.rho(); } @@ -2316,7 +2316,7 @@ namespace Opm auto bhpAtLimit = WellBhpThpCalculator(*this).computeBhpAtThpLimitProd(frates, summary_state, max_pressure, - this->connections_.getRho(), + this->connections_.rho(), alq_value, deferred_logger); auto v = frates(*bhpAtLimit); @@ -2336,7 +2336,7 @@ namespace Opm bhpAtLimit = WellBhpThpCalculator(*this).computeBhpAtThpLimitProd(fratesIter, summary_state, max_pressure, - this->connections_.getRho(), + this->connections_.rho(), alq_value, deferred_logger); v = frates(*bhpAtLimit); @@ -2370,7 +2370,7 @@ namespace Opm return WellBhpThpCalculator(*this).computeBhpAtThpLimitInj(frates, summary_state, - this->connections_.getRho(), + this->connections_.rho(), 1e-6, 50, true,