EclNewtonMethod: make the exponent of the tolerance scaling settable by a parameter

the parameter is called `EclNewtonSumToleranceExponent`. if it is set
to 1, the specified tolerance will be used directly. (this is not
desireable in the general case though, because at the same result
quality, the sum error for large reservoirs can be larger than for
small ones.)
This commit is contained in:
Andreas Lauser
2019-01-11 11:18:06 +01:00
parent 0492796e85
commit c2377e7b10
2 changed files with 17 additions and 9 deletions

View File

@@ -38,6 +38,7 @@ BEGIN_PROPERTIES
NEW_PROP_TAG(EclNewtonSumTolerance); NEW_PROP_TAG(EclNewtonSumTolerance);
NEW_PROP_TAG(EclNewtonStrictIterations); NEW_PROP_TAG(EclNewtonStrictIterations);
NEW_PROP_TAG(EclNewtonRelaxedVolumeFraction); NEW_PROP_TAG(EclNewtonRelaxedVolumeFraction);
NEW_PROP_TAG(EclNewtonSumToleranceExponent);
NEW_PROP_TAG(EclNewtonRelaxedTolerance); NEW_PROP_TAG(EclNewtonRelaxedTolerance);
END_PROPERTIES END_PROPERTIES
@@ -104,6 +105,9 @@ public:
"The fraction of the pore volume of the reservoir " "The fraction of the pore volume of the reservoir "
"where the volumetric error may be voilated during " "where the volumetric error may be voilated during "
"strict Newton iterations."); "strict Newton iterations.");
EWOMS_REGISTER_PARAM(TypeTag, Scalar, EclNewtonSumToleranceExponent,
"The the exponent used to scale the sum tolerance by "
"the total pore volume of the reservoir.");
EWOMS_REGISTER_PARAM(TypeTag, Scalar, EclNewtonRelaxedTolerance, EWOMS_REGISTER_PARAM(TypeTag, Scalar, EclNewtonRelaxedTolerance,
"The maximum error which the volumetric residual " "The maximum error which the volumetric residual "
"may exhibit if it is in a 'relaxed' " "may exhibit if it is in a 'relaxed' "
@@ -191,15 +195,11 @@ public:
for (unsigned eqIdx = 0; eqIdx < numEq; ++eqIdx) for (unsigned eqIdx = 0; eqIdx < numEq; ++eqIdx)
errorSum_ = std::max(std::abs(componentSumError[eqIdx]), errorSum_); errorSum_ = std::max(std::abs(componentSumError[eqIdx]), errorSum_);
// update the sum tolerance: larger reservoirs can tolerate a higher amount of // scale the tolerance for the total error with the pore volume. by default, the
// mass lost per time step than smaller ones! since this is not linear, we use // exponent is 1/3, i.e., cubic root.
// the cube root of the overall pore volume, i.e., the value specified by the Scalar x = EWOMS_GET_PARAM(TypeTag, Scalar, EclNewtonSumTolerance);
// NewtonSumTolerance parameter is the "incorrect" mass per timestep for an Scalar y = EWOMS_GET_PARAM(TypeTag, Scalar, EclNewtonSumToleranceExponent);
// reservoir that exhibits 1 m^3 of pore volume. A reservoir with a total pore sumTolerance_ = x*std::pow(sumPv, y);
// volume of 10^3 m^3 will tolerate 10 times as much.
sumTolerance_ =
EWOMS_GET_PARAM(TypeTag, Scalar, EclNewtonSumTolerance)
* std::cbrt(sumPv);
// make sure that the error never grows beyond the maximum // make sure that the error never grows beyond the maximum
// allowed one // allowed one

View File

@@ -244,6 +244,14 @@ SET_SCALAR_PROP(EclBaseProblem, NewtonRawTolerance, 1e-2);
// will tolerate larger residuals. // will tolerate larger residuals.
SET_SCALAR_PROP(EclBaseProblem, EclNewtonSumTolerance, 1e-4); SET_SCALAR_PROP(EclBaseProblem, EclNewtonSumTolerance, 1e-4);
// set the exponent for the volume scaling of the sum tolerance: larger reservoirs can
// tolerate a higher amount of mass lost per time step than smaller ones! since this is
// not linear, we use the cube root of the overall pore volume by default, i.e., the
// value specified by the NewtonSumTolerance parameter is the "incorrect" mass per
// timestep for an reservoir that exhibits 1 m^3 of pore volume. A reservoir with a total
// pore volume of 10^3 m^3 will tolerate 10 times as much.
SET_SCALAR_PROP(EclBaseProblem, EclNewtonSumToleranceExponent, 1.0/3.0);
// set number of Newton iterations where the volumetric residual is considered for // set number of Newton iterations where the volumetric residual is considered for
// convergence // convergence
SET_INT_PROP(EclBaseProblem, EclNewtonStrictIterations, 8); SET_INT_PROP(EclBaseProblem, EclNewtonStrictIterations, 8);