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:
parent
eb6265b148
commit
0b923e505a
@ -202,6 +202,14 @@ maxAlq(const std::string& group_name)
|
||||
return group_rate.maxAlq();
|
||||
}
|
||||
|
||||
std::optional<double>
|
||||
GasLiftGroupInfo::
|
||||
maxTotalGasRate(const std::string& group_name)
|
||||
{
|
||||
auto& group_rate = this->group_rate_map_.at(group_name);
|
||||
return group_rate.maxTotalGasRate();
|
||||
}
|
||||
|
||||
double
|
||||
GasLiftGroupInfo::
|
||||
oilRate(const std::string &group_name) const
|
||||
|
@ -101,6 +101,7 @@ public:
|
||||
void initialize();
|
||||
std::optional<double> liquidTarget(const std::string& group_name) const;
|
||||
std::optional<double> maxAlq(const std::string& group_name);
|
||||
std::optional<double> maxTotalGasRate(const std::string& group_name);
|
||||
double oilRate(const std::string& group_name) const;
|
||||
std::optional<double> oilTarget(const std::string& group_name) const;
|
||||
static const std::string rateToString(Rate rate);
|
||||
@ -158,6 +159,7 @@ protected:
|
||||
std::optional<double> gasTarget() const { return gas_target_; }
|
||||
std::optional<double> waterTarget() const { return water_target_; }
|
||||
std::optional<double> maxAlq() const { return max_alq_; }
|
||||
std::optional<double> maxTotalGasRate() const { return total_gas_; }
|
||||
double oilRate() const { return oil_rate_; }
|
||||
std::optional<double> oilTarget() const { return oil_target_; }
|
||||
std::optional<double> liquidTarget() const { return liquid_target_; }
|
||||
|
@ -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)
|
||||
//
|
||||
|
@ -225,6 +225,7 @@ protected:
|
||||
bool checkAlqOutsideLimits(double alq, double oil_rate);
|
||||
bool checkEcoGradient(double gradient);
|
||||
bool checkGroupALQrateExceeded(double delta_alq);
|
||||
bool checkGroupTotalRateExceeded(double delta_alq, double delta_gas_rate);
|
||||
bool checkOilRateExceedsTarget(double oil_rate);
|
||||
bool checkRatesViolated(const LimitedRates& rates) const;
|
||||
void debugShowIterationInfo(double alq);
|
||||
|
Loading…
Reference in New Issue
Block a user