Increase alq to its minimum value while checking that is does not violate its rate limits

This commit is contained in:
Tor Harald Sandve
2023-03-29 14:25:12 +02:00
parent 467b88644e
commit 77ed90ceb8

View File

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