NewtonTolerance moved to TypeTag-free parameter system

This commit is contained in:
Arne Morten Kvarving
2024-07-06 10:22:47 +02:00
parent 6280602201
commit 0195f8f113
6 changed files with 9 additions and 36 deletions

View File

@@ -126,14 +126,6 @@ template<class TypeTag>
struct EnableTerminalOutput<TypeTag, Properties::TTag::FlowExpTypeTag>
{ static constexpr bool value = false; };
// the default for the allowed volumetric error for oil per second
template<class TypeTag>
struct NewtonTolerance<TypeTag, Properties::TTag::FlowExpTypeTag>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e-1;
};
// set the maximum number of Newton iterations to 8 so that we fail quickly (albeit
// relatively often)
template<class TypeTag>
@@ -146,8 +138,7 @@ struct EclNewtonRelaxedTolerance<TypeTag, Properties::TTag::FlowExpTypeTag>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr auto baseValue =
Parameters::NewtonTolerance<TypeTag,
Properties::TTag::FlowExpTypeTag>::value;
Parameters::NewtonTolerance<type>::value;
static constexpr type value = 1e6 * baseValue;
};
@@ -171,6 +162,8 @@ class FlowExpProblem : public FlowProblem<TypeTag> //, public FvBaseProblem<Type
{
typedef FlowProblem<TypeTag> ParentType;
using BaseType = ParentType; // GetPropType<TypeTag, Properties::BaseProblem>;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
public:
void writeOutput(bool verbose = true)
{
@@ -226,6 +219,8 @@ public:
// By default, flowexp accepts the result of the time integration unconditionally if the
// smallest time step size is reached.
Parameters::SetDefault<Parameters::ContinueOnConvergenceError>(true);
Parameters::SetDefault<Parameters::NewtonTolerance<Scalar>>(1e-2);
}
// inherit the constructors

View File

@@ -82,7 +82,7 @@ struct EclNewtonRelaxedTolerance<TypeTag, Properties::TTag::FlowExpProblemBlackO
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr auto baseValue =
Parameters::NewtonTolerance<TypeTag, Properties::TTag::FlowExpProblemBlackOil>::value;
Parameters::NewtonTolerance<type>::value;
static constexpr type value = 10 * baseValue;
};
@@ -109,14 +109,6 @@ struct EclNewtonSumToleranceExponent<TypeTag, Properties::TTag::FlowExpProblemBl
static constexpr type value = 1.0 / 3.0;;
};
// the default for the allowed volumetric error for oil per second
template<class TypeTag>
struct NewtonTolerance<TypeTag, Properties::TTag::FlowExpProblemBlackOil>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e-2;
};
template<class TypeTag>
struct EclNewtonStrictIterations<TypeTag, Properties::TTag::FlowExpProblemBlackOil>
{ static constexpr int value = 100; };

View File

@@ -138,7 +138,7 @@ namespace Opm {
// flow also does not use the eWoms Newton method
Parameters::hideParam<TypeTag, Parameters::NewtonMaxError>();
Parameters::hideParam<TypeTag, Parameters::NewtonTolerance>();
Parameters::Hide<Parameters::NewtonTolerance<Scalar>>();
Parameters::hideParam<TypeTag, Parameters::NewtonTargetIterations>();
Parameters::Hide<Parameters::NewtonVerbose>();
Parameters::Hide<Parameters::NewtonWriteConvergence>();

View File

@@ -263,6 +263,8 @@ public:
Parameters::SetDefault<Parameters::EnableIntensiveQuantityCache>(true);
// the cache for the storage term can also be used and also yields a decent speedup
Parameters::SetDefault<Parameters::EnableStorageCache>(true);
// the default for the allowed volumetric error for oil per second
Parameters::SetDefault<Parameters::NewtonTolerance<Scalar>>(1e-2);
}

View File

@@ -398,14 +398,6 @@ template<class TypeTag>
struct ExplicitRockCompaction<TypeTag, Properties::TTag::FlowBaseProblem>
{ static constexpr bool value = false; };
// the default for the allowed volumetric error for oil per second
template<class TypeTag>
struct NewtonTolerance<TypeTag, Properties::TTag::FlowBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e-2;
};
// Parameterize equilibration accuracy
template<class TypeTag>
struct NumPressurePointsEquil<TypeTag, Properties::TTag::FlowBaseProblem>

View File

@@ -112,14 +112,6 @@ template<class TypeTag>
struct NewtonMaxIterations<TypeTag, Properties::TTag::TestTypeTag>
{ static constexpr int value = 8; };
// the default for the allowed volumetric error for oil per second
template<class TypeTag>
struct NewtonTolerance<TypeTag, Properties::TTag::TestTypeTag>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e-1;
};
// 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.