Merge pull request #4571 from totto82/fixgl

Increase alq to its minimum value while checking that is does not violate its rate limits
This commit is contained in:
Bård Skaflestad 2023-03-30 10:31:51 +02:00 committed by GitHub
commit 5a3deaf57b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -918,15 +918,18 @@ GasLiftSingleWellGeneric::increaseALQtoMinALQ_(const double orig_alq, const Limi
LimitedRates rates = orig_rates;
while (!stop_iteration) {
double temp_alq = alq + this->increment_;
alq = temp_alq;
if (temp_alq >= min_alq)
break;
auto temp_rates = computeLimitedWellRatesWithALQ_(temp_alq);
if (!temp_rates)
break;
alq = temp_alq;
rates = *temp_rates;
if (rates.limited())
break;
if (temp_rates) {
rates = *temp_rates;
if (rates.limited())
break;
}
}
return std::make_pair(rates, alq);
}