From 85a9b75076f52851aacbab441bfb4209a3782ecb Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Wed, 14 Nov 2018 12:13:28 +0100 Subject: [PATCH] ebos: allow larger errors for larger reservoirs albeit, we scale the error only to the cube root of the pore volume. the rationale is that the same amount of mass can get lost "along" a line for each timestep. maybe it would be a good idea to do something like this for time step size as well because taking multiple small time steps currently allows a much larger error in the result than doing it in one big step. --- ebos/eclnewtonmethod.hh | 10 ++++++++++ ebos/eclproblem.hh | 9 ++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) 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