Double check econ potential limits

Sometimes the potentials are inaccurate as a safty measure we
also check that the rates are violated.
The rates are supposed to be less or equal to the potentials.
This commit is contained in:
Tor Harald Sandve 2022-03-24 10:43:57 +01:00
parent 6b74ba512a
commit 71acf4e056

View File

@ -715,8 +715,15 @@ updateWellTestStateEconomic(const SingleWellState& ws,
const auto& quantity_limit = econ_production_limits.quantityLimit(); const auto& quantity_limit = econ_production_limits.quantityLimit();
if (econ_production_limits.onAnyRateLimit()) { if (econ_production_limits.onAnyRateLimit()) {
if (quantity_limit == WellEconProductionLimits::QuantityLimit::POTN) if (quantity_limit == WellEconProductionLimits::QuantityLimit::POTN) {
rate_limit_violated = checkRateEconLimits(econ_production_limits, ws.well_potentials.data(), deferred_logger); rate_limit_violated = checkRateEconLimits(econ_production_limits, ws.well_potentials.data(), deferred_logger);
// Due to instability of the bhpFromThpLimit code the potentials are sometimes wrong
// this can lead to premature shutting of wells due to rate limits of the potentials.
// Since rates are supposed to be less or equal to the potentials, we double-check
// that also the rate limit is violated before shutting the well.
if (rate_limit_violated)
rate_limit_violated = checkRateEconLimits(econ_production_limits, ws.surface_rates.data(), deferred_logger);
}
else { else {
rate_limit_violated = checkRateEconLimits(econ_production_limits, ws.surface_rates.data(), deferred_logger); rate_limit_violated = checkRateEconLimits(econ_production_limits, ws.surface_rates.data(), deferred_logger);
} }