From bc04fb68ef9515e14fc2b62fedbd638bd30ec13f Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Mon, 30 Nov 2020 09:23:16 +0100 Subject: [PATCH] check the sum not individual phases for operability --- opm/simulators/wells/MultisegmentWell_impl.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/opm/simulators/wells/MultisegmentWell_impl.hpp b/opm/simulators/wells/MultisegmentWell_impl.hpp index 3d7c2a0ff..ce8f04b47 100644 --- a/opm/simulators/wells/MultisegmentWell_impl.hpp +++ b/opm/simulators/wells/MultisegmentWell_impl.hpp @@ -2404,12 +2404,12 @@ namespace Opm // if the BHP limit is not defaulted or the well does not have a THP limit // we need to check the BHP limit + double temp = 0; for (int p = 0; p < number_of_phases_; ++p) { - const double temp = ipr_a_[p] - ipr_b_[p] * bhp_limit; - if (temp < 0.) { - this->operability_status_.operable_under_only_bhp_limit = false; - break; - } + temp += ipr_a_[p] - ipr_b_[p] * bhp_limit; + } + if (temp < 0.) { + this->operability_status_.operable_under_only_bhp_limit = false; } // checking whether running under BHP limit will violate THP limit