Allow using UDQ for WCONPROD item 12 (ALQ)

This commit is contained in:
Vegard Kippe 2023-12-01 13:21:34 +01:00
parent b7ad5a9d29
commit 69f82f1104
4 changed files with 7 additions and 6 deletions

View File

@ -403,7 +403,7 @@ copyToWellState(const MultisegmentWellGeneric<Scalar>& 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)},

View File

@ -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) ) {

View File

@ -407,7 +407,7 @@ void WellState::init(const std::vector<double>& cellPressures,
}
updateWellsDefaultALQ(wells_ecl);
updateWellsDefaultALQ(wells_ecl, summary_state);
}
void WellState::resize(const std::vector<Well>& 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<Well>& wells_ecl)
void WellState::updateWellsDefaultALQ(const std::vector<Well>& wells_ecl, const SummaryState& summary_state)
{
const int nw = wells_ecl.size();
for (int i = 0; i<nw; i++) {
const Well &well = wells_ecl[i];
if (well.isProducer()) {
// NOTE: This is the value set in item 12 of WCONPROD, or with WELTARG
auto alq = well.alq_value();
auto alq = well.alq_value(summary_state);
this->alq_state.update_default(well.name(), alq);
}
}

View File

@ -336,7 +336,8 @@ private:
// constant lift gas injection and for gas lift optimization
// (THP controlled wells).
void updateWellsDefaultALQ(const std::vector<Well>& wells_ecl);
void updateWellsDefaultALQ(const std::vector<Well>& 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