From a9ab62e6b8c912b7b91ebfd3236d2b147b341b95 Mon Sep 17 00:00:00 2001 From: Stein Krogstad Date: Fri, 26 Jan 2024 14:58:06 +0100 Subject: [PATCH 1/2] Don't set lower bound on network update --- opm/simulators/wells/BlackoilWellModelGeneric.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/opm/simulators/wells/BlackoilWellModelGeneric.cpp b/opm/simulators/wells/BlackoilWellModelGeneric.cpp index e89248acf..9638c9371 100644 --- a/opm/simulators/wells/BlackoilWellModelGeneric.cpp +++ b/opm/simulators/wells/BlackoilWellModelGeneric.cpp @@ -1172,15 +1172,11 @@ updateNetworkPressures(const int reportStepIdx) // due to the fact our nodal pressure calculation is somewhat explicit // TODO: the following parameters are subject to adjustment for optimization purpose constexpr double upper_update_bound = 5.0 * unit::barsa; - constexpr double lower_update_bound = 0.05 * unit::barsa; // relative dampening factor based on update value constexpr double damping_factor = 0.1; - const double allowed_change = std::max(std::min(damping_factor * std::abs(change), upper_update_bound), - lower_update_bound); - if (std::abs(change) > allowed_change) { - const double sign = change > 0 ? 1. : -1.; - node_pressures_[name] = pressure + sign * allowed_change; - } + const double damped_change = std::min(damping_factor * std::abs(change), upper_update_bound); + const double sign = change > 0 ? 1. : -1.; + node_pressures_[name] = pressure + sign * damped_change; } } else { for (const auto& [name, pressure]: node_pressures_) { From 24c4f75ecbfc4c70a33d3cd0e79412fedb1da9da Mon Sep 17 00:00:00 2001 From: Stein Krogstad Date: Fri, 26 Jan 2024 15:02:14 +0100 Subject: [PATCH 2/2] 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,