changed: remove SET_SCALAR_PROP macro usage

This commit is contained in:
Arne Morten Kvarving
2020-08-27 11:38:38 +02:00
parent fca83318aa
commit 7d853d2e05
7 changed files with 220 additions and 45 deletions

View File

@@ -62,15 +62,51 @@ NEW_PROP_TAG(RegularizationFactorMsw);
NEW_PROP_TAG(UseInnerIterationsWells);
NEW_PROP_TAG(MaxInnerIterWells);
SET_SCALAR_PROP(FlowModelParameters, DbhpMaxRel, 1.0);
SET_SCALAR_PROP(FlowModelParameters, DwellFractionMax, 0.2);
SET_SCALAR_PROP(FlowModelParameters, MaxResidualAllowed, 1e7);
SET_SCALAR_PROP(FlowModelParameters, RelaxedMaxPvFraction, 1.0);
SET_SCALAR_PROP(FlowModelParameters, ToleranceMb, 1e-6);
SET_SCALAR_PROP(FlowModelParameters, ToleranceCnv,1e-2);
SET_SCALAR_PROP(FlowModelParameters, ToleranceCnvRelaxed, 1e9);
SET_SCALAR_PROP(FlowModelParameters, ToleranceWells, 1e-4);
SET_SCALAR_PROP(FlowModelParameters, ToleranceWellControl, 1e-7);
template<class TypeTag>
struct DbhpMaxRel<TypeTag, TTag::FlowModelParameters> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 1.0;
};
template<class TypeTag>
struct DwellFractionMax<TypeTag, TTag::FlowModelParameters> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 0.2;
};
template<class TypeTag>
struct MaxResidualAllowed<TypeTag, TTag::FlowModelParameters> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 1e7;
};
template<class TypeTag>
struct RelaxedMaxPvFraction<TypeTag, TTag::FlowModelParameters> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 1.0;
};
template<class TypeTag>
struct ToleranceMb<TypeTag, TTag::FlowModelParameters> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 1e-6;
};
template<class TypeTag>
struct ToleranceCnv<TypeTag, TTag::FlowModelParameters> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 1e-2;
};
template<class TypeTag>
struct ToleranceCnvRelaxed<TypeTag, TTag::FlowModelParameters> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 1e9;
};
template<class TypeTag>
struct ToleranceWells<TypeTag, TTag::FlowModelParameters> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 1e-4;
};
template<class TypeTag>
struct ToleranceWellControl<TypeTag, TTag::FlowModelParameters> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 1e-7;
};
template<class TypeTag>
struct MaxWelleqIter<TypeTag, TTag::FlowModelParameters> {
static constexpr int value = 30;
@@ -79,7 +115,11 @@ template<class TypeTag>
struct UseMultisegmentWell<TypeTag, TTag::FlowModelParameters> {
static constexpr bool value = true;
};
SET_SCALAR_PROP(FlowModelParameters, MaxSinglePrecisionDays, 20.0);
template<class TypeTag>
struct MaxSinglePrecisionDays<TypeTag, TTag::FlowModelParameters> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 20.0;
};
template<class TypeTag>
struct MaxStrictIter<TypeTag, TTag::FlowModelParameters> {
static constexpr int value = 8;
@@ -100,8 +140,16 @@ template<class TypeTag>
struct MatrixAddWellContributions<TypeTag, TTag::FlowModelParameters> {
static constexpr bool value = false;
};
SET_SCALAR_PROP(FlowModelParameters, TolerancePressureMsWells, 0.01*1e5);
SET_SCALAR_PROP(FlowModelParameters, MaxPressureChangeMsWells, 10*1e5);
template<class TypeTag>
struct TolerancePressureMsWells<TypeTag, TTag::FlowModelParameters> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 0.01*1e5;
};
template<class TypeTag>
struct MaxPressureChangeMsWells<TypeTag, TTag::FlowModelParameters> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 10*1e5;
};
template<class TypeTag>
struct UseInnerIterationsMsWells<TypeTag, TTag::FlowModelParameters> {
static constexpr bool value = true;
@@ -122,14 +170,25 @@ template<class TypeTag>
struct StrictInnerIterMsWells<TypeTag, TTag::FlowModelParameters> {
static constexpr int value = 40;
};
SET_SCALAR_PROP(FlowModelParameters, RegularizationFactorMsw, 1);
template<class TypeTag>
struct RegularizationFactorMsw<TypeTag, TTag::FlowModelParameters> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 1;
};
template<class TypeTag>
struct EnableWellOperabilityCheck<TypeTag, TTag::FlowModelParameters> {
static constexpr bool value = true;
};
SET_SCALAR_PROP(FlowModelParameters, RelaxedFlowTolInnerIterMsw, 1);
SET_SCALAR_PROP(FlowModelParameters, RelaxedPressureTolInnerIterMsw, 0.5e5);
template<class TypeTag>
struct RelaxedFlowTolInnerIterMsw<TypeTag, TTag::FlowModelParameters> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 1;
};
template<class TypeTag>
struct RelaxedPressureTolInnerIterMsw<TypeTag, TTag::FlowModelParameters> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 0.5e5;
};
// if openMP is available, determine the number threads per process automatically.
#if _OPENMP

View File

@@ -45,7 +45,11 @@ NEW_PROP_TAG(FlowNewtonMaxIterations);
NEW_PROP_TAG(FlowNewtonMinIterations);
NEW_PROP_TAG(NewtonRelaxationType);
SET_SCALAR_PROP(FlowNonLinearSolver, NewtonMaxRelax, 0.5);
template<class TypeTag>
struct NewtonMaxRelax<TypeTag, TTag::FlowNonLinearSolver> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 0.5;
};
template<class TypeTag>
struct FlowNewtonMaxIterations<TypeTag, TTag::FlowNonLinearSolver> {
static constexpr int value = 20;

View File

@@ -73,8 +73,16 @@ NEW_PROP_TAG(GpuMode);
NEW_PROP_TAG(BdaDeviceId);
NEW_PROP_TAG(OpenclPlatformId);
SET_SCALAR_PROP(FlowIstlSolverParams, LinearSolverReduction, 1e-2);
SET_SCALAR_PROP(FlowIstlSolverParams, IluRelaxation, 0.9);
template<class TypeTag>
struct LinearSolverReduction<TypeTag, TTag::FlowIstlSolverParams> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 1e-2;
};
template<class TypeTag>
struct IluRelaxation<TypeTag, TTag::FlowIstlSolverParams> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 0.9;
};
template<class TypeTag>
struct LinearSolverMaxIter<TypeTag, TTag::FlowIstlSolverParams> {
static constexpr int value = 200;

View File

@@ -43,11 +43,31 @@ NEW_PROP_TAG(TimeStepControlGrowthRate);
NEW_PROP_TAG(TimeStepControlFileName);
NEW_PROP_TAG(MinTimeStepBeforeShuttingProblematicWellsInDays);
SET_SCALAR_PROP(FlowTimeSteppingParameters, SolverRestartFactor, 0.33);
SET_SCALAR_PROP(FlowTimeSteppingParameters, SolverGrowthFactor, 2.0);
SET_SCALAR_PROP(FlowTimeSteppingParameters, SolverMaxGrowth, 3.0);
SET_SCALAR_PROP(FlowTimeSteppingParameters, SolverMaxTimeStepInDays, 365.0);
SET_SCALAR_PROP(FlowTimeSteppingParameters, SolverMinTimeStep, 0.0);
template<class TypeTag>
struct SolverRestartFactor<TypeTag, TTag::FlowTimeSteppingParameters> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 0.33;
};
template<class TypeTag>
struct SolverGrowthFactor<TypeTag, TTag::FlowTimeSteppingParameters> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 2.0;
};
template<class TypeTag>
struct SolverMaxGrowth<TypeTag, TTag::FlowTimeSteppingParameters> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 3.0;
};
template<class TypeTag>
struct SolverMaxTimeStepInDays<TypeTag, TTag::FlowTimeSteppingParameters> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 365.0;
};
template<class TypeTag>
struct SolverMinTimeStep<TypeTag, TTag::FlowTimeSteppingParameters> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 0.0;
};
template<class TypeTag>
struct SolverMaxRestarts<TypeTag, TTag::FlowTimeSteppingParameters> {
static constexpr int value = 10;
@@ -60,17 +80,29 @@ template<class TypeTag>
struct TimeStepVerbosity<TypeTag, TTag::FlowTimeSteppingParameters> {
static constexpr int value = 1;
};
SET_SCALAR_PROP(FlowTimeSteppingParameters, InitialTimeStepInDays, 1.0);
template<class TypeTag>
struct InitialTimeStepInDays<TypeTag, TTag::FlowTimeSteppingParameters> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 1.0;
};
template<class TypeTag>
struct FullTimeStepInitially<TypeTag, TTag::FlowTimeSteppingParameters> {
static constexpr bool value = false;
};
SET_SCALAR_PROP(FlowTimeSteppingParameters, TimeStepAfterEventInDays, -1.0);
template<class TypeTag>
struct TimeStepAfterEventInDays<TypeTag, TTag::FlowTimeSteppingParameters> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = -1.0;
};
template<class TypeTag>
struct TimeStepControl<TypeTag, TTag::FlowTimeSteppingParameters> {
static constexpr auto value = "pid";
};
SET_SCALAR_PROP(FlowTimeSteppingParameters, TimeStepControlTolerance, 1e-1);
template<class TypeTag>
struct TimeStepControlTolerance<TypeTag, TTag::FlowTimeSteppingParameters> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 1e-1;
};
template<class TypeTag>
struct TimeStepControlTargetIterations<TypeTag, TTag::FlowTimeSteppingParameters> {
static constexpr int value = 30;
@@ -79,13 +111,25 @@ template<class TypeTag>
struct TimeStepControlTargetNewtonIterations<TypeTag, TTag::FlowTimeSteppingParameters> {
static constexpr int value = 8;
};
SET_SCALAR_PROP(FlowTimeSteppingParameters, TimeStepControlDecayRate, 0.75);
SET_SCALAR_PROP(FlowTimeSteppingParameters, TimeStepControlGrowthRate, 1.25);
template<class TypeTag>
struct TimeStepControlDecayRate<TypeTag, TTag::FlowTimeSteppingParameters> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 0.75;
};
template<class TypeTag>
struct TimeStepControlGrowthRate<TypeTag, TTag::FlowTimeSteppingParameters> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 1.25;
};
template<class TypeTag>
struct TimeStepControlFileName<TypeTag, TTag::FlowTimeSteppingParameters> {
static constexpr auto value = "timesteps";
};
SET_SCALAR_PROP(FlowTimeSteppingParameters, MinTimeStepBeforeShuttingProblematicWellsInDays, 0.001);
template<class TypeTag>
struct MinTimeStepBeforeShuttingProblematicWellsInDays<TypeTag, TTag::FlowTimeSteppingParameters> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 0.001;
};
} // namespace Opm::Properties