Merge pull request #5128 from steink/fix_network_convergence_issues

Fix network convergence issues
This commit is contained in:
Kai Bao 2024-01-30 00:17:09 +01:00 committed by GitHub
commit 2ddba5b339
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 11 deletions

View File

@ -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_) {

View File

@ -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<double> res;
ConvergenceReport report = this->StdWellEval::getWellConvergence(well_state,