From 23225d24e5ed34baefff947ebe6b8ac822365640 Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Wed, 3 Nov 2021 15:52:21 +0100 Subject: [PATCH] Fix bug in runOptimize1_ --- opm/simulators/wells/GasLiftSingleWellGeneric.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/opm/simulators/wells/GasLiftSingleWellGeneric.cpp b/opm/simulators/wells/GasLiftSingleWellGeneric.cpp index 17dc4ed16..30a87c864 100644 --- a/opm/simulators/wells/GasLiftSingleWellGeneric.cpp +++ b/opm/simulators/wells/GasLiftSingleWellGeneric.cpp @@ -843,15 +843,15 @@ GasLiftSingleWellGeneric:: runOptimize1_() { std::unique_ptr state; - auto inc_count = this->well_state_.gliftGetAlqIncreaseCount(this->well_name_); - auto dec_count = this->well_state_.gliftGetAlqDecreaseCount(this->well_name_); + int inc_count = this->well_state_.gliftGetAlqIncreaseCount(this->well_name_); + int dec_count = this->well_state_.gliftGetAlqDecreaseCount(this->well_name_); if (dec_count == 0 && inc_count == 0) { state = tryIncreaseLiftGas_(); - if (!state && !state->alqChanged()) { + if (!state || !(state->alqChanged())) { state = tryDecreaseLiftGas_(); } } - else if (dec_count == 0) { + else if (dec_count == 0) { assert(inc_count > 0); state = tryIncreaseLiftGas_(); }