mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #5634 from steink/update-thp-also-for-zero-rate-wells
Update THP also for zero-rate wells
This commit is contained in:
commit
017cf53908
@ -214,7 +214,6 @@ template<class FluidSystem, class Indices>
|
|||||||
void MultisegmentWellPrimaryVariables<FluidSystem,Indices>::
|
void MultisegmentWellPrimaryVariables<FluidSystem,Indices>::
|
||||||
copyToWellState(const MultisegmentWellGeneric<Scalar>& mswell,
|
copyToWellState(const MultisegmentWellGeneric<Scalar>& mswell,
|
||||||
const Scalar rho,
|
const Scalar rho,
|
||||||
const bool stop_or_zero_rate_target,
|
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const SummaryState& summary_state,
|
const SummaryState& summary_state,
|
||||||
DeferredLogger& deferred_logger) const
|
DeferredLogger& deferred_logger) const
|
||||||
@ -406,7 +405,7 @@ copyToWellState(const MultisegmentWellGeneric<Scalar>& mswell,
|
|||||||
// Note: for the ALQ value, in the StandardWell, WellInterfaceGeneric::getALQ(well_state) is used.
|
// Note: for the ALQ value, in the StandardWell, WellInterfaceGeneric::getALQ(well_state) is used.
|
||||||
// We might want to unify the way regarding AQL value.
|
// We might want to unify the way regarding AQL value.
|
||||||
WellBhpThpCalculator(well_)
|
WellBhpThpCalculator(well_)
|
||||||
.updateThp(rho, stop_or_zero_rate_target, [this, &summary_state]() { return well_.wellEcl().alq_value(summary_state); },
|
.updateThp(rho, [this, &summary_state]() { return well_.wellEcl().alq_value(summary_state); },
|
||||||
{FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx),
|
{FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx),
|
||||||
FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx),
|
FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx),
|
||||||
FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx)},
|
FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx)},
|
||||||
|
@ -105,7 +105,6 @@ public:
|
|||||||
//! \brief Copy values to well state.
|
//! \brief Copy values to well state.
|
||||||
void copyToWellState(const MultisegmentWellGeneric<Scalar>& mswell,
|
void copyToWellState(const MultisegmentWellGeneric<Scalar>& mswell,
|
||||||
const Scalar rho,
|
const Scalar rho,
|
||||||
const bool stop_or_zero_rate_target,
|
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const SummaryState& summary_state,
|
const SummaryState& summary_state,
|
||||||
DeferredLogger& deferred_logger) const;
|
DeferredLogger& deferred_logger) const;
|
||||||
|
@ -701,7 +701,6 @@ namespace Opm
|
|||||||
|
|
||||||
const auto& summary_state = simulator.vanguard().summaryState();
|
const auto& summary_state = simulator.vanguard().summaryState();
|
||||||
this->primary_variables_.copyToWellState(*this, getRefDensity(),
|
this->primary_variables_.copyToWellState(*this, getRefDensity(),
|
||||||
stop_or_zero_rate_target,
|
|
||||||
well_state,
|
well_state,
|
||||||
summary_state,
|
summary_state,
|
||||||
deferred_logger);
|
deferred_logger);
|
||||||
|
@ -345,8 +345,7 @@ namespace Opm
|
|||||||
const bool stop_or_zero_rate_target,
|
const bool stop_or_zero_rate_target,
|
||||||
DeferredLogger& deferred_logger);
|
DeferredLogger& deferred_logger);
|
||||||
|
|
||||||
void updateWellStateFromPrimaryVariables(const bool stop_or_zero_rate_target,
|
void updateWellStateFromPrimaryVariables(WellState<Scalar>& well_state,
|
||||||
WellState<Scalar>& well_state,
|
|
||||||
const SummaryState& summary_state,
|
const SummaryState& summary_state,
|
||||||
DeferredLogger& deferred_logger) const;
|
DeferredLogger& deferred_logger) const;
|
||||||
|
|
||||||
|
@ -68,8 +68,7 @@ extendEval(const Eval& in) const
|
|||||||
template<class FluidSystem, class Indices>
|
template<class FluidSystem, class Indices>
|
||||||
void
|
void
|
||||||
StandardWellEval<FluidSystem,Indices>::
|
StandardWellEval<FluidSystem,Indices>::
|
||||||
updateWellStateFromPrimaryVariables(const bool stop_or_zero_rate_target,
|
updateWellStateFromPrimaryVariables(WellState<Scalar>& well_state,
|
||||||
WellState<Scalar>& well_state,
|
|
||||||
const SummaryState& summary_state,
|
const SummaryState& summary_state,
|
||||||
DeferredLogger& deferred_logger) const
|
DeferredLogger& deferred_logger) const
|
||||||
{
|
{
|
||||||
@ -77,7 +76,6 @@ updateWellStateFromPrimaryVariables(const bool stop_or_zero_rate_target,
|
|||||||
|
|
||||||
WellBhpThpCalculator(baseif_).
|
WellBhpThpCalculator(baseif_).
|
||||||
updateThp(connections_.rho(),
|
updateThp(connections_.rho(),
|
||||||
stop_or_zero_rate_target,
|
|
||||||
[this,&well_state]() { return this->baseif_.getALQ(well_state); },
|
[this,&well_state]() { return this->baseif_.getALQ(well_state); },
|
||||||
{FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx),
|
{FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx),
|
||||||
FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx),
|
FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx),
|
||||||
|
@ -93,8 +93,7 @@ protected:
|
|||||||
const int num_cells,
|
const int num_cells,
|
||||||
const bool has_polymermw);
|
const bool has_polymermw);
|
||||||
|
|
||||||
void updateWellStateFromPrimaryVariables(const bool stop_or_zero_rate_target,
|
void updateWellStateFromPrimaryVariables(WellState<Scalar>& well_state,
|
||||||
WellState<Scalar>& well_state,
|
|
||||||
const SummaryState& summary_state,
|
const SummaryState& summary_state,
|
||||||
DeferredLogger& deferred_logger) const;
|
DeferredLogger& deferred_logger) const;
|
||||||
|
|
||||||
|
@ -711,7 +711,7 @@ namespace Opm
|
|||||||
updatePrimaryVariablesNewton(dwells, stop_or_zero_rate_target, deferred_logger);
|
updatePrimaryVariablesNewton(dwells, stop_or_zero_rate_target, deferred_logger);
|
||||||
|
|
||||||
const auto& summary_state = simulator.vanguard().summaryState();
|
const auto& summary_state = simulator.vanguard().summaryState();
|
||||||
updateWellStateFromPrimaryVariables(stop_or_zero_rate_target, well_state, summary_state, deferred_logger);
|
updateWellStateFromPrimaryVariables(well_state, summary_state, deferred_logger);
|
||||||
Base::calculateReservoirRates(simulator.vanguard().eclState().runspec().co2Storage(), well_state.well(this->index_of_well_));
|
Base::calculateReservoirRates(simulator.vanguard().eclState().runspec().co2Storage(), well_state.well(this->index_of_well_));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -745,12 +745,11 @@ namespace Opm
|
|||||||
template<typename TypeTag>
|
template<typename TypeTag>
|
||||||
void
|
void
|
||||||
StandardWell<TypeTag>::
|
StandardWell<TypeTag>::
|
||||||
updateWellStateFromPrimaryVariables(const bool stop_or_zero_rate_target,
|
updateWellStateFromPrimaryVariables(WellState<Scalar>& well_state,
|
||||||
WellState<Scalar>& well_state,
|
|
||||||
const SummaryState& summary_state,
|
const SummaryState& summary_state,
|
||||||
DeferredLogger& deferred_logger) const
|
DeferredLogger& deferred_logger) const
|
||||||
{
|
{
|
||||||
this->StdWellEval::updateWellStateFromPrimaryVariables(stop_or_zero_rate_target, well_state, summary_state, deferred_logger);
|
this->StdWellEval::updateWellStateFromPrimaryVariables(well_state, summary_state, deferred_logger);
|
||||||
|
|
||||||
// other primary variables related to polymer injectivity study
|
// other primary variables related to polymer injectivity study
|
||||||
if constexpr (Base::has_polymermw) {
|
if constexpr (Base::has_polymermw) {
|
||||||
|
@ -304,7 +304,6 @@ computeBhpAtThpLimitInj(const std::function<std::vector<Scalar>(const Scalar)>&
|
|||||||
template<class Scalar>
|
template<class Scalar>
|
||||||
void WellBhpThpCalculator<Scalar>::
|
void WellBhpThpCalculator<Scalar>::
|
||||||
updateThp(const Scalar rho,
|
updateThp(const Scalar rho,
|
||||||
const bool stop_or_zero_rate_target,
|
|
||||||
const std::function<Scalar()>& alq_value,
|
const std::function<Scalar()>& alq_value,
|
||||||
const std::array<unsigned,3>& active,
|
const std::array<unsigned,3>& active,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
@ -317,7 +316,7 @@ updateThp(const Scalar rho,
|
|||||||
auto& ws = well_state.well(well_.indexOfWell());
|
auto& ws = well_state.well(well_.indexOfWell());
|
||||||
|
|
||||||
// When there is no vaild VFP table provided, we set the thp to be zero.
|
// When there is no vaild VFP table provided, we set the thp to be zero.
|
||||||
if (!well_.isVFPActive(deferred_logger) || stop_or_zero_rate_target) {
|
if (!well_.isVFPActive(deferred_logger)) {
|
||||||
ws.thp = 0;
|
ws.thp = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,6 @@ public:
|
|||||||
|
|
||||||
//! \brief Update THP.
|
//! \brief Update THP.
|
||||||
void updateThp(const Scalar rho,
|
void updateThp(const Scalar rho,
|
||||||
const bool stop_or_zero_rate_target,
|
|
||||||
const std::function<Scalar()>& alq_value,
|
const std::function<Scalar()>& alq_value,
|
||||||
const std::array<unsigned,3>& active,
|
const std::array<unsigned,3>& active,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
|
Loading…
Reference in New Issue
Block a user