mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #4648 from GitPaean/not_call_alq_value_for_injectors
we should not request alq_value for injectors
This commit is contained in:
commit
dc3316a103
@ -393,6 +393,8 @@ copyToWellState(const MultisegmentWellGeneric<Scalar>& mswell,
|
|||||||
[maxVel](const auto hf) { return (hf > 0.0) ? maxVel : 0.0; });
|
[maxVel](const auto hf) { return (hf > 0.0) ? maxVel : 0.0; });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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_)
|
WellBhpThpCalculator(well_)
|
||||||
.updateThp(rho, stop_or_zero_rate_target, [this]() { return well_.wellEcl().alq_value(); },
|
.updateThp(rho, stop_or_zero_rate_target, [this]() { return well_.wellEcl().alq_value(); },
|
||||||
{FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx),
|
{FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx),
|
||||||
|
@ -41,6 +41,7 @@
|
|||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include <optional>
|
||||||
|
|
||||||
static constexpr bool extraBhpAtThpLimitOutput = false;
|
static constexpr bool extraBhpAtThpLimitOutput = false;
|
||||||
|
|
||||||
@ -101,7 +102,7 @@ double WellBhpThpCalculator::mostStrictBhpFromBhpLimits(const SummaryState& summ
|
|||||||
double WellBhpThpCalculator::calculateThpFromBhp(const std::vector<double>& rates,
|
double WellBhpThpCalculator::calculateThpFromBhp(const std::vector<double>& rates,
|
||||||
const double bhp,
|
const double bhp,
|
||||||
const double rho,
|
const double rho,
|
||||||
const double alq,
|
const std::optional<double>& alq,
|
||||||
DeferredLogger& deferred_logger) const
|
DeferredLogger& deferred_logger) const
|
||||||
{
|
{
|
||||||
assert(int(rates.size()) == 3); // the vfp related only supports three phases now.
|
assert(int(rates.size()) == 3); // the vfp related only supports three phases now.
|
||||||
@ -117,6 +118,7 @@ double WellBhpThpCalculator::calculateThpFromBhp(const std::vector<double>& rate
|
|||||||
// pick the density in the top layer
|
// pick the density in the top layer
|
||||||
double thp = 0.0;
|
double thp = 0.0;
|
||||||
if (well_.isInjector()) {
|
if (well_.isInjector()) {
|
||||||
|
assert(!alq.has_value());
|
||||||
const int table_id = well_.wellEcl().vfp_table_number();
|
const int table_id = well_.wellEcl().vfp_table_number();
|
||||||
const double vfp_ref_depth = well_.vfpProperties()->getInj()->getTable(table_id).getDatumDepth();
|
const double vfp_ref_depth = well_.vfpProperties()->getInj()->getTable(table_id).getDatumDepth();
|
||||||
const double dp = wellhelpers::computeHydrostaticCorrection(well_.refDepth(), vfp_ref_depth, rho, well_.gravity());
|
const double dp = wellhelpers::computeHydrostaticCorrection(well_.refDepth(), vfp_ref_depth, rho, well_.gravity());
|
||||||
@ -128,7 +130,8 @@ double WellBhpThpCalculator::calculateThpFromBhp(const std::vector<double>& rate
|
|||||||
const double vfp_ref_depth = well_.vfpProperties()->getProd()->getTable(table_id).getDatumDepth();
|
const double vfp_ref_depth = well_.vfpProperties()->getProd()->getTable(table_id).getDatumDepth();
|
||||||
const double dp = wellhelpers::computeHydrostaticCorrection(well_.refDepth(), vfp_ref_depth, rho, well_.gravity());
|
const double dp = wellhelpers::computeHydrostaticCorrection(well_.refDepth(), vfp_ref_depth, rho, well_.gravity());
|
||||||
|
|
||||||
thp = well_.vfpProperties()->getProd()->thp(table_id, aqua, liquid, vapour, bhp + dp, alq);
|
assert(alq.has_value());
|
||||||
|
thp = well_.vfpProperties()->getProd()->thp(table_id, aqua, liquid, vapour, bhp + dp, alq.value());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
OPM_DEFLOG_THROW(std::logic_error, "Expected INJECTOR or PRODUCER well", deferred_logger);
|
OPM_DEFLOG_THROW(std::logic_error, "Expected INJECTOR or PRODUCER well", deferred_logger);
|
||||||
@ -261,7 +264,8 @@ void WellBhpThpCalculator::updateThp(const double rho,
|
|||||||
rates[ Gas ] = ws.surface_rates[pu.phase_pos[ Gas ] ];
|
rates[ Gas ] = ws.surface_rates[pu.phase_pos[ Gas ] ];
|
||||||
}
|
}
|
||||||
|
|
||||||
ws.thp = this->calculateThpFromBhp(rates, ws.bhp, rho, alq_value(), deferred_logger);
|
const std::optional<double> alq = this->well_.isProducer() ? std::optional<double>(alq_value()) : std::nullopt;
|
||||||
|
ws.thp = this->calculateThpFromBhp(rates, ws.bhp, rho, alq, deferred_logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class EvalWell>
|
template<class EvalWell>
|
||||||
|
@ -57,7 +57,7 @@ public:
|
|||||||
double calculateThpFromBhp(const std::vector<double>& rates,
|
double calculateThpFromBhp(const std::vector<double>& rates,
|
||||||
const double bhp,
|
const double bhp,
|
||||||
const double rho,
|
const double rho,
|
||||||
const double alq,
|
const std::optional<double>& alq,
|
||||||
DeferredLogger& deferred_logger) const;
|
DeferredLogger& deferred_logger) const;
|
||||||
|
|
||||||
//! \brief Compute BHP from THP limit for a producer.
|
//! \brief Compute BHP from THP limit for a producer.
|
||||||
|
Loading…
Reference in New Issue
Block a user