diff --git a/flowexperimental/flowexp.hpp b/flowexperimental/flowexp.hpp index ac5479ddf..81c6fd84e 100644 --- a/flowexperimental/flowexp.hpp +++ b/flowexperimental/flowexp.hpp @@ -126,12 +126,6 @@ template struct EnableTerminalOutput { static constexpr bool value = false; }; -// set the maximum number of Newton iterations to 8 so that we fail quickly (albeit -// relatively often) -template -struct NewtonMaxIterations -{ static constexpr int value = 8; }; - // the maximum volumetric error of a cell in the relaxed region template struct EclNewtonRelaxedTolerance @@ -220,6 +214,7 @@ public: // smallest time step size is reached. Parameters::SetDefault(true); + Parameters::SetDefault(8); Parameters::SetDefault>(1e-2); } diff --git a/opm/simulators/flow/NonlinearSolver.hpp b/opm/simulators/flow/NonlinearSolver.hpp index 47056f6f1..ae242137c 100644 --- a/opm/simulators/flow/NonlinearSolver.hpp +++ b/opm/simulators/flow/NonlinearSolver.hpp @@ -76,14 +76,6 @@ struct NewtonRelaxationType } // namespace Opm::Parameters -namespace Opm::Parameters { - -template -struct NewtonMaxIterations -{ static constexpr int value = 20; }; - -} // namespace Opm::Parameters - namespace Opm { // Available relaxation scheme types. @@ -134,7 +126,7 @@ void stabilizeNonlinearUpdate(BVector& dx, BVector& dxOld, // overload with given parameters relaxMax_ = Parameters::get(); - maxIter_ = Parameters::get(); + maxIter_ = Parameters::Get(); minIter_ = Parameters::get(); const auto& relaxationTypeString = Parameters::get(); @@ -152,12 +144,14 @@ void stabilizeNonlinearUpdate(BVector& dx, BVector& dxOld, { Parameters::registerParam ("The maximum relaxation factor of a Newton iteration"); - Parameters::registerParam + Parameters::Register ("The maximum number of Newton iterations per time step"); Parameters::registerParam ("The minimum number of Newton iterations per time step"); Parameters::registerParam ("The type of relaxation used by Newton method"); + + Parameters::SetDefault(20); } void reset() diff --git a/tests/TestTypeTag.hpp b/tests/TestTypeTag.hpp index a0938b96b..5d8b1040b 100644 --- a/tests/TestTypeTag.hpp +++ b/tests/TestTypeTag.hpp @@ -106,12 +106,6 @@ template struct MatrixAddWellContributions { static constexpr bool value = true; }; -// set the maximum number of Newton iterations to 8 so that we fail quickly (albeit -// relatively often) -template -struct NewtonMaxIterations -{ static constexpr int value = 8; }; - // currently, ebos uses the non-multisegment well model by default to avoid // regressions. the --use-multisegment-well=true|false command line parameter is still // available in ebos, but hidden from view.