Finally fix selection for relaxed tolerance.

Default values are MaxStrictIter=8 and RelaxedPvFraction=1.0.
To activate relaxed pv fraction set MaxStrictIter to 0 and
fraction below 1.
This commit is contained in:
Markus Blatt 2020-08-26 15:42:27 +02:00
parent 9829bfd61a
commit bee46ed309
2 changed files with 6 additions and 2 deletions

View File

@ -729,7 +729,11 @@ namespace Opm {
cnvErrorPvFraction /= pvSum; cnvErrorPvFraction /= pvSum;
const double tol_mb = param_.tolerance_mb_; const double tol_mb = param_.tolerance_mb_;
const bool use_relaxed = cnvErrorPvFraction < param_.relaxed_max_pv_fraction_ || iteration >= param_.max_strict_iter_; // Default value of relaxed_max_pv_fraction_ is 1 and
// max_strict_iter_ is 8. Hence only iteration chooses
// whether to use relaxed or not.
// To activate only fraction use fraction below 1 and iter 0.
const bool use_relaxed = cnvErrorPvFraction < param_.relaxed_max_pv_fraction_ && iteration >= param_.max_strict_iter_;
const double tol_cnv = use_relaxed ? param_.tolerance_cnv_relaxed_ : param_.tolerance_cnv_; const double tol_cnv = use_relaxed ? param_.tolerance_cnv_relaxed_ : param_.tolerance_cnv_;
// Finish computation // Finish computation

View File

@ -63,7 +63,7 @@ NEW_PROP_TAG(MaxInnerIterWells);
SET_SCALAR_PROP(FlowModelParameters, DbhpMaxRel, 1.0); SET_SCALAR_PROP(FlowModelParameters, DbhpMaxRel, 1.0);
SET_SCALAR_PROP(FlowModelParameters, DwellFractionMax, 0.2); SET_SCALAR_PROP(FlowModelParameters, DwellFractionMax, 0.2);
SET_SCALAR_PROP(FlowModelParameters, MaxResidualAllowed, 1e7); SET_SCALAR_PROP(FlowModelParameters, MaxResidualAllowed, 1e7);
SET_SCALAR_PROP(FlowModelParameters, RelaxedMaxPvFraction, .0); SET_SCALAR_PROP(FlowModelParameters, RelaxedMaxPvFraction, 1.0);
SET_SCALAR_PROP(FlowModelParameters, ToleranceMb, 1e-6); SET_SCALAR_PROP(FlowModelParameters, ToleranceMb, 1e-6);
SET_SCALAR_PROP(FlowModelParameters, ToleranceCnv,1e-2); SET_SCALAR_PROP(FlowModelParameters, ToleranceCnv,1e-2);
SET_SCALAR_PROP(FlowModelParameters, ToleranceCnvRelaxed, 1e9); SET_SCALAR_PROP(FlowModelParameters, ToleranceCnvRelaxed, 1e9);