mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #4054 from totto82/gasliftthplim
Allow for gaslift for wells that violate thp limit but are not allowed to switch
This commit is contained in:
commit
5a90ced52d
@ -61,6 +61,8 @@ namespace Opm
|
|||||||
double bhp, bool bhp_is_limited, bool debug_output=true) const override;
|
double bhp, bool bhp_is_limited, bool debug_output=true) const override;
|
||||||
void setAlqMaxRate_(const GasLiftOpt::Well& well);
|
void setAlqMaxRate_(const GasLiftOpt::Well& well);
|
||||||
void setupPhaseVariables_();
|
void setupPhaseVariables_();
|
||||||
|
bool checkThpControl_() const override;
|
||||||
|
|
||||||
|
|
||||||
const Simulator &ebos_simulator_;
|
const Simulator &ebos_simulator_;
|
||||||
const WellInterface<TypeTag> &well_;
|
const WellInterface<TypeTag> &well_;
|
||||||
|
@ -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>
|
std::pair<std::optional<double>,double>
|
||||||
GasLiftSingleWellGeneric::
|
GasLiftSingleWellGeneric::
|
||||||
computeConvergedBhpAtThpLimitByMaybeIncreasingALQ_() const
|
computeConvergedBhpAtThpLimitByMaybeIncreasingALQ_() const
|
||||||
|
@ -248,7 +248,7 @@ protected:
|
|||||||
bool checkGroupTargetsViolated(
|
bool checkGroupTargetsViolated(
|
||||||
const BasicRates& rates, const BasicRates& new_rates) const;
|
const BasicRates& rates, const BasicRates& new_rates) const;
|
||||||
bool checkInitialALQmodified_(double alq, double initial_alq) 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;
|
virtual std::optional<double> computeBhpAtThpLimit_(double alq) const = 0;
|
||||||
std::pair<std::optional<double>,double> computeConvergedBhpAtThpLimitByMaybeIncreasingALQ_() const;
|
std::pair<std::optional<double>,double> computeConvergedBhpAtThpLimitByMaybeIncreasingALQ_() const;
|
||||||
std::pair<std::optional<BasicRates>,double> computeInitialWellRates_() const;
|
std::pair<std::optional<BasicRates>,double> computeInitialWellRates_() const;
|
||||||
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -425,6 +425,11 @@ bool WellInterfaceGeneric::useVfpExplicit() const
|
|||||||
return ((wvfpexp.explicit_lookup() && !changedToOpenThisStep())|| operability_status_.use_vfpexplicit);
|
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
|
double WellInterfaceGeneric::getALQ(const WellState& well_state) const
|
||||||
{
|
{
|
||||||
return well_state.getALQ(name());
|
return well_state.getALQ(name());
|
||||||
|
@ -91,6 +91,7 @@ public:
|
|||||||
// whether the well is operable
|
// whether the well is operable
|
||||||
bool isOperableAndSolvable() const;
|
bool isOperableAndSolvable() const;
|
||||||
bool useVfpExplicit () const;
|
bool useVfpExplicit () const;
|
||||||
|
bool thpLimitViolatedButNotSwitched() const;
|
||||||
|
|
||||||
void initCompletions();
|
void initCompletions();
|
||||||
void closeCompletions(const WellTestState& wellTestState);
|
void closeCompletions(const WellTestState& wellTestState);
|
||||||
|
Loading…
Reference in New Issue
Block a user