Allow for gaslift for wells that violate thp limit but are not allowed to switch

This commit is contained in:
Tor Harald Sandve 2022-09-02 12:11:39 +02:00
parent 42ef6ed9de
commit b072cc1d5d
6 changed files with 28 additions and 17 deletions

View File

@ -61,6 +61,8 @@ namespace Opm
double bhp, bool bhp_is_limited, bool debug_output=true) const override;
void setAlqMaxRate_(const GasLiftOpt::Well& well);
void setupPhaseVariables_();
bool checkThpControl_() const override;
const Simulator &ebos_simulator_;
const WellInterface<TypeTag> &well_;

View File

@ -278,22 +278,6 @@ checkInitialALQmodified_(double alq, double initial_alq) const
}
}
bool
GasLiftSingleWellGeneric::
checkThpControl_() const
{
const int well_index = this->well_state_.index(this->well_name_).value();
const Well::ProducerCMode& control_mode =
this->well_state_.well(well_index).production_cmode;
bool thp_control = control_mode == Well::ProducerCMode::THP;
if (this->debug) {
if (!thp_control) {
displayDebugMessage_("Well is not under THP control, skipping iteration..");
}
}
return thp_control;
}
std::pair<std::optional<double>,double>
GasLiftSingleWellGeneric::
computeConvergedBhpAtThpLimitByMaybeIncreasingALQ_() const

View File

@ -248,7 +248,7 @@ protected:
bool checkGroupTargetsViolated(
const BasicRates& rates, const BasicRates& new_rates) const;
bool checkInitialALQmodified_(double alq, double initial_alq) const;
bool checkThpControl_() const;
virtual bool checkThpControl_() const = 0;
virtual std::optional<double> computeBhpAtThpLimit_(double alq) const = 0;
std::pair<std::optional<double>,double> computeConvergedBhpAtThpLimitByMaybeIncreasingALQ_() const;
std::pair<std::optional<BasicRates>,double> computeInitialWellRates_() const;

View File

@ -210,4 +210,23 @@ setAlqMaxRate_(const GasLiftOpt::Well &well)
}
}
template<typename TypeTag>
bool
GasLiftSingleWell<TypeTag>::
checkThpControl_() const
{
const int well_index = this->well_state_.index(this->well_name_).value();
const Well::ProducerCMode& control_mode =
this->well_state_.well(well_index).production_cmode;
bool thp_control = control_mode == Well::ProducerCMode::THP;
const WellInterfaceGeneric &well = getWell();
thp_control = thp_control || well.thpLimitViolatedButNotSwitched();
if (this->debug) {
if (!thp_control) {
displayDebugMessage_("Well is not under THP control, skipping iteration..");
}
}
return thp_control;
}
}

View File

@ -420,6 +420,11 @@ bool WellInterfaceGeneric::useVfpExplicit() const
return ((wvfpexp.explicit_lookup() && !changedToOpenThisStep())|| operability_status_.use_vfpexplicit);
}
bool WellInterfaceGeneric::thpLimitViolatedButNotSwitched() const
{
return operability_status_.thp_limit_violated_but_not_switched;
}
double WellInterfaceGeneric::getALQ(const WellState& well_state) const
{
return well_state.getALQ(name());

View File

@ -91,6 +91,7 @@ public:
// whether the well is operable
bool isOperableAndSolvable() const;
bool useVfpExplicit () const;
bool thpLimitViolatedButNotSwitched() const;
void initCompletions();
void closeCompletions(const WellTestState& wellTestState);