mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Add support for maximum total gas (alq + gas rate) in GLIFTOPT
Dont increase gaslift if the groups alq + gas production rate is above the given target
This commit is contained in:
@@ -1129,6 +1129,7 @@ runOptimizeLoop_(bool increase)
|
||||
if (!alq_opt) break;
|
||||
auto delta_alq = *alq_opt - temp_alq;
|
||||
if (state.checkGroupALQrateExceeded(delta_alq)) break;
|
||||
|
||||
temp_alq = *alq_opt;
|
||||
if (this->debug) state.debugShowIterationInfo(temp_alq);
|
||||
rates = new_rates;
|
||||
@@ -1138,6 +1139,9 @@ runOptimizeLoop_(bool increase)
|
||||
state.stop_iteration = true;
|
||||
temp_rates = updateRatesToGroupLimits_(*rates, *temp_rates);
|
||||
|
||||
auto delta_gas_rate = temp_rates->gas - rates->gas;
|
||||
if (state.checkGroupTotalRateExceeded(delta_alq, delta_gas_rate)) break;
|
||||
|
||||
/* if (this->debug_abort_if_increase_and_gas_is_limited_) {
|
||||
if (gas_is_limited && increase) {
|
||||
// if gas is limited we do not want to increase
|
||||
@@ -1552,6 +1556,33 @@ checkGroupALQrateExceeded(double delta_alq)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
GasLiftSingleWellGeneric::OptimizeState::
|
||||
checkGroupTotalRateExceeded(double delta_alq, double delta_gas_rate)
|
||||
{
|
||||
const auto &pairs =
|
||||
this->parent.group_info_.getWellGroups(this->parent.well_name_);
|
||||
for (const auto &[group_name, efficiency] : pairs) {
|
||||
auto max_total_rate_opt = this->parent.group_info_.maxTotalGasRate(group_name);
|
||||
if (max_total_rate_opt) {
|
||||
double alq =
|
||||
this->parent.group_info_.alqRate(group_name) + efficiency * delta_alq;
|
||||
double gas_rate =
|
||||
this->parent.group_info_.gasRate(group_name) + efficiency * delta_gas_rate;
|
||||
|
||||
if ( (alq + gas_rate) > *max_total_rate_opt) {
|
||||
if (this->parent.debug) {
|
||||
const std::string msg = fmt::format(
|
||||
"Group {} : total gas rate {} exceeds max_total_gas_rate {}. Stopping iteration",
|
||||
group_name, alq + gas_rate, *max_total_rate_opt);
|
||||
this->parent.displayDebugMessage_(msg);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
//
|
||||
// bool checkEcoGradient(double gradient)
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user