diff --git a/ebos/eclnewtonmethod.hh b/ebos/eclnewtonmethod.hh index c45a3dfa8..62d9547e2 100644 --- a/ebos/eclnewtonmethod.hh +++ b/ebos/eclnewtonmethod.hh @@ -173,6 +173,16 @@ public: for (unsigned eqIdx = 0; eqIdx < numEq; ++eqIdx) errorSum_ = std::max(std::abs(componentSumError[eqIdx]), errorSum_); + // update 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, 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. + sumTolerance_ = + EWOMS_GET_PARAM(TypeTag, Scalar, NewtonSumTolerance) + * std::cbrt(sumPv); + // make sure that the error never grows beyond the maximum // allowed one if (this->error_ > newtonMaxError) diff --git a/ebos/eclproblem.hh b/ebos/eclproblem.hh index c9b8a33d4..ffd2c5876 100644 --- a/ebos/eclproblem.hh +++ b/ebos/eclproblem.hh @@ -236,10 +236,13 @@ SET_SCALAR_PROP(EclBaseProblem, EndTime, 1e100); // not millions of trillions of years, that is...) SET_SCALAR_PROP(EclBaseProblem, InitialTimeStepSize, 1e100); -// increase the default raw tolerance for the newton solver because this is what everone -// else seems to be doing... +// set the tolerated amount of "incorrect" mass to ~1e-6 kg of oil per time step for a +// reservoir that exhibits a pore volume of 1 m^3. larger reservoirs will tolerate larger +// residuals. +SET_SCALAR_PROP(EclBaseProblem, NewtonSumTolerance, 1e-6); + +// the default for the volumetric error for oil per second is 10^-2 kg/(m^3 * s). SET_SCALAR_PROP(EclBaseProblem, NewtonRawTolerance, 1e-2); -SET_SCALAR_PROP(EclBaseProblem, NewtonSumTolerance, 1e-3); // set the maximum number of Newton iterations to 14 because the likelyhood that a time // step succeeds at more than 14 Newton iteration is rather small