From 24c4f75ecbfc4c70a33d3cd0e79412fedb1da9da Mon Sep 17 00:00:00 2001 From: Stein Krogstad Date: Fri, 26 Jan 2024 15:02:14 +0100 Subject: [PATCH] Use stricter tolerance when dynamic thp --- opm/simulators/wells/StandardWell_impl.hpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/opm/simulators/wells/StandardWell_impl.hpp b/opm/simulators/wells/StandardWell_impl.hpp index 7fd8c7ac4..bea87fae8 100644 --- a/opm/simulators/wells/StandardWell_impl.hpp +++ b/opm/simulators/wells/StandardWell_impl.hpp @@ -1170,10 +1170,16 @@ namespace Opm // For the polymer, energy and foam cases, there is one more mass balance equations of reservoir than wells assert((int(B_avg.size()) == this->num_components_) || has_polymer || has_energy || has_foam || has_brine || has_zFraction || has_micp); - // using sricter tolerance for stopped wells and wells under zero rate target control. - constexpr double stricter_factor = 1.e-4; - const double tol_wells = this->stopppedOrZeroRateTarget(summary_state, well_state) ? - this->param_.tolerance_wells_ * stricter_factor : this->param_.tolerance_wells_; + double tol_wells = this->param_.tolerance_wells_; + // use stricter tolerance for stopped wells and wells under zero rate target control. + constexpr double stopped_factor = 1.e-4; + // use stricter tolerance for dynamic thp to ameliorate network convergence + constexpr double dynamic_thp_factor = 1.e-1; + if (this->stopppedOrZeroRateTarget(summary_state, well_state)) { + tol_wells = tol_wells*stopped_factor; + } else if (this->getDynamicThpLimit()) { + tol_wells = tol_wells*dynamic_thp_factor; + } std::vector res; ConvergenceReport report = this->StdWellEval::getWellConvergence(well_state,