mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Add relaxed mb tolerance parameter
This commit is contained in:
@@ -875,7 +875,7 @@ namespace Opm {
|
||||
}
|
||||
|
||||
|
||||
void updateTUNING(const Tuning& tuning) {
|
||||
void updateTUNING(const Tuning& tuning) {
|
||||
param_.tolerance_mb_ = tuning.XXXMBE;
|
||||
if ( terminal_output_ ) {
|
||||
OpmLog::debug(fmt::format("Setting BlackoilModel mass balance limit (XXXMBE) to {:.2e}", tuning.XXXMBE));
|
||||
@@ -907,12 +907,14 @@ namespace Opm {
|
||||
auto cnvErrorPvFraction = computeCnvErrorPv(B_avg, dt);
|
||||
cnvErrorPvFraction /= (pvSum - numAquiferPvSum);
|
||||
|
||||
const double tol_mb = param_.tolerance_mb_;
|
||||
// Default value of relaxed_max_pv_fraction_ is 0.03 and min_strict_cnv_iter_ is 0.
|
||||
// For each iteration, we need to determine whether to use the relaxed CNV tolerance.
|
||||
// To disable the usage of relaxed CNV tolerance, you can set the relaxed_max_pv_fraction_ to be 0.
|
||||
const bool use_relaxed = cnvErrorPvFraction < param_.relaxed_max_pv_fraction_ && iteration >= param_.min_strict_cnv_iter_;
|
||||
const double tol_cnv = use_relaxed ? param_.tolerance_cnv_relaxed_ : param_.tolerance_cnv_;
|
||||
const bool use_relaxed_cnv = cnvErrorPvFraction < param_.relaxed_max_pv_fraction_ && iteration >= param_.min_strict_cnv_iter_;
|
||||
const double tol_cnv = use_relaxed_cnv ? param_.tolerance_cnv_relaxed_ : param_.tolerance_cnv_;
|
||||
|
||||
const bool use_relaxed_mb = iteration >= param_.min_strict_mb_iter_;
|
||||
const double tol_mb = use_relaxed_mb ? param_.tolerance_mb_relaxed_ : param_.tolerance_mb_;
|
||||
|
||||
// Finish computation
|
||||
std::vector<Scalar> CNV(numComp);
|
||||
|
||||
Reference in New Issue
Block a user