changed: AdaptiveTimeStepping parameters moved to Opm::Parameters namespace

This commit is contained in:
Arne Morten Kvarving 2024-06-28 12:17:13 +02:00
parent 6f7fcb5872
commit 5f5697ff91

View File

@ -47,162 +47,160 @@
#include <string> #include <string>
#include <vector> #include <vector>
namespace Opm::Properties { namespace Opm::Properties::TTag {
namespace TTag {
struct FlowTimeSteppingParameters { struct FlowTimeSteppingParameters {
using InheritsFrom = std::tuple<EclTimeSteppingParameters>; using InheritsFrom = std::tuple<EclTimeSteppingParameters>;
}; };
} }
namespace Opm::Parameters {
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct SolverContinueOnConvergenceFailure { struct SolverContinueOnConvergenceFailure { using type = Properties::UndefinedProperty; };
using type = UndefinedProperty;
};
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct SolverMaxRestarts { struct SolverMaxRestarts { using type = Properties::UndefinedProperty; };
using type = UndefinedProperty;
};
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct SolverVerbosity {
using type = UndefinedProperty; struct SolverVerbosity { using type = Properties::UndefinedProperty; };
};
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct TimeStepVerbosity { struct TimeStepVerbosity { using type = Properties::UndefinedProperty; };
using type = UndefinedProperty;
};
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct InitialTimeStepInDays { struct InitialTimeStepInDays { using type = Properties::UndefinedProperty; };
using type = UndefinedProperty;
};
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct FullTimeStepInitially { struct FullTimeStepInitially { using type = Properties::UndefinedProperty; };
using type = UndefinedProperty;
};
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct TimeStepControl { struct TimeStepControl { using type = Properties::UndefinedProperty; };
using type = UndefinedProperty;
};
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct TimeStepControlTolerance { struct TimeStepControlTolerance { using type = Properties::UndefinedProperty; };
using type = UndefinedProperty;
};
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct TimeStepControlTargetIterations { struct TimeStepControlTargetIterations { using type = Properties::UndefinedProperty; };
using type = UndefinedProperty;
};
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct TimeStepControlTargetNewtonIterations { struct TimeStepControlTargetNewtonIterations { using type = Properties::UndefinedProperty; };
using type = UndefinedProperty;
};
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct TimeStepControlDecayRate { struct TimeStepControlDecayRate { using type = Properties::UndefinedProperty; };
using type = UndefinedProperty;
};
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct TimeStepControlGrowthRate { struct TimeStepControlGrowthRate { using type = Properties::UndefinedProperty; };
using type = UndefinedProperty;
};
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct TimeStepControlDecayDampingFactor { struct TimeStepControlDecayDampingFactor { using type = Properties::UndefinedProperty; };
using type = UndefinedProperty;
};
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct TimeStepControlGrowthDampingFactor { struct TimeStepControlGrowthDampingFactor { using type = Properties::UndefinedProperty; };
using type = UndefinedProperty;
};
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct TimeStepControlFileName { struct TimeStepControlFileName { using type = Properties::UndefinedProperty; };
using type = UndefinedProperty;
};
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct MinTimeStepBeforeShuttingProblematicWellsInDays { struct MinTimeStepBeforeShuttingProblematicWellsInDays { using type = Properties::UndefinedProperty; };
using type = UndefinedProperty;
};
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct MinTimeStepBasedOnNewtonIterations { struct MinTimeStepBasedOnNewtonIterations { using type = Properties::UndefinedProperty; };
using type = UndefinedProperty;
template<class TypeTag>
struct SolverContinueOnConvergenceFailure<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
{ static constexpr bool value = false; };
template<class TypeTag>
struct SolverMaxRestarts<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
{ static constexpr int value = 10; };
template<class TypeTag>
struct SolverVerbosity<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
{ static constexpr int value = 1; };
template<class TypeTag>
struct TimeStepVerbosity<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
{ static constexpr int value = 1; };
template<class TypeTag>
struct InitialTimeStepInDays<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1.0;
}; };
template<class TypeTag> template<class TypeTag>
struct SolverContinueOnConvergenceFailure<TypeTag, TTag::FlowTimeSteppingParameters> { struct FullTimeStepInitially<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
static constexpr bool value = false; { static constexpr bool value = false; };
};
template<class TypeTag> template<class TypeTag>
struct SolverMaxRestarts<TypeTag, TTag::FlowTimeSteppingParameters> { struct TimeStepControl<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
static constexpr int value = 10; { static constexpr auto value = "pid+newtoniteration"; };
};
template<class TypeTag> template<class TypeTag>
struct SolverVerbosity<TypeTag, TTag::FlowTimeSteppingParameters> { struct TimeStepControlTolerance<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
static constexpr int value = 1; {
}; using type = GetPropType<TypeTag, Properties::Scalar>;
template<class TypeTag>
struct TimeStepVerbosity<TypeTag, TTag::FlowTimeSteppingParameters> {
static constexpr int value = 1;
};
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;
};
template<class TypeTag>
struct TimeStepControl<TypeTag, TTag::FlowTimeSteppingParameters> {
static constexpr auto value = "pid+newtoniteration";
};
template<class TypeTag>
struct TimeStepControlTolerance<TypeTag, TTag::FlowTimeSteppingParameters> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 1e-1; static constexpr type value = 1e-1;
}; };
template<class TypeTag> template<class TypeTag>
struct TimeStepControlTargetIterations<TypeTag, TTag::FlowTimeSteppingParameters> { struct TimeStepControlTargetIterations<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
static constexpr int value = 30; { static constexpr int value = 30; };
};
template<class TypeTag> template<class TypeTag>
struct TimeStepControlTargetNewtonIterations<TypeTag, TTag::FlowTimeSteppingParameters> { struct TimeStepControlTargetNewtonIterations<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
static constexpr int value = 8; { static constexpr int value = 8; };
};
template<class TypeTag> template<class TypeTag>
struct TimeStepControlDecayRate<TypeTag, TTag::FlowTimeSteppingParameters> { struct TimeStepControlDecayRate<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
using type = GetPropType<TypeTag, Scalar>; {
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 0.75; static constexpr type value = 0.75;
}; };
template<class TypeTag> template<class TypeTag>
struct TimeStepControlGrowthRate<TypeTag, TTag::FlowTimeSteppingParameters> { struct TimeStepControlGrowthRate<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
using type = GetPropType<TypeTag, Scalar>; {
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1.25; static constexpr type value = 1.25;
}; };
template<class TypeTag> template<class TypeTag>
struct TimeStepControlDecayDampingFactor<TypeTag, TTag::FlowTimeSteppingParameters> { struct TimeStepControlDecayDampingFactor<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
using type = GetPropType<TypeTag, Scalar>; {
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1.0; static constexpr type value = 1.0;
}; };
template<class TypeTag> template<class TypeTag>
struct TimeStepControlGrowthDampingFactor<TypeTag, TTag::FlowTimeSteppingParameters> { struct TimeStepControlGrowthDampingFactor<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
using type = GetPropType<TypeTag, Scalar>; {
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 3.2; static constexpr type value = 3.2;
}; };
template<class TypeTag> template<class TypeTag>
struct TimeStepControlFileName<TypeTag, TTag::FlowTimeSteppingParameters> { struct TimeStepControlFileName<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
static constexpr auto value = "timesteps"; { static constexpr auto value = "timesteps"; };
};
template<class TypeTag> template<class TypeTag>
struct MinTimeStepBeforeShuttingProblematicWellsInDays<TypeTag, TTag::FlowTimeSteppingParameters> { struct MinTimeStepBeforeShuttingProblematicWellsInDays<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
using type = GetPropType<TypeTag, Scalar>; {
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 0.01; static constexpr type value = 0.01;
}; };
template<class TypeTag> template<class TypeTag>
struct MinTimeStepBasedOnNewtonIterations<TypeTag, TTag::FlowTimeSteppingParameters> { struct MinTimeStepBasedOnNewtonIterations<TypeTag, Properties::TTag::FlowTimeSteppingParameters>
using type = GetPropType<TypeTag, Scalar>; {
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 0.0; static constexpr type value = 0.0;
}; };
} // namespace Opm::Properties } // namespace Opm::Parameters
namespace Opm { namespace Opm {
@ -259,15 +257,15 @@ std::set<std::string> consistentlyFailingWells(const std::vector<StepReport>& sr
, maxGrowth_(Parameters::get<TypeTag, Parameters::SolverMaxGrowth>()) // 3.0 , maxGrowth_(Parameters::get<TypeTag, Parameters::SolverMaxGrowth>()) // 3.0
, maxTimeStep_(Parameters::get<TypeTag, Parameters::SolverMaxTimeStepInDays>() * 24 * 60 * 60) // 365.25 , maxTimeStep_(Parameters::get<TypeTag, Parameters::SolverMaxTimeStepInDays>() * 24 * 60 * 60) // 365.25
, minTimeStep_(unitSystem.to_si(UnitSystem::measure::time, Parameters::get<TypeTag, Parameters::SolverMinTimeStep>())) // 1e-12; , minTimeStep_(unitSystem.to_si(UnitSystem::measure::time, Parameters::get<TypeTag, Parameters::SolverMinTimeStep>())) // 1e-12;
, ignoreConvergenceFailure_(Parameters::get<TypeTag, Properties::SolverContinueOnConvergenceFailure>()) // false; , ignoreConvergenceFailure_(Parameters::get<TypeTag, Parameters::SolverContinueOnConvergenceFailure>()) // false;
, solverRestartMax_(Parameters::get<TypeTag, Properties::SolverMaxRestarts>()) // 10 , solverRestartMax_(Parameters::get<TypeTag, Parameters::SolverMaxRestarts>()) // 10
, solverVerbose_(Parameters::get<TypeTag, Properties::SolverVerbosity>() > 0 && terminalOutput) // 2 , solverVerbose_(Parameters::get<TypeTag, Parameters::SolverVerbosity>() > 0 && terminalOutput) // 2
, timestepVerbose_(Parameters::get<TypeTag, Properties::TimeStepVerbosity>() > 0 && terminalOutput) // 2 , timestepVerbose_(Parameters::get<TypeTag, Parameters::TimeStepVerbosity>() > 0 && terminalOutput) // 2
, suggestedNextTimestep_((max_next_tstep <= 0 ? Parameters::get<TypeTag, Properties::InitialTimeStepInDays>() : max_next_tstep) * 24 * 60 * 60) // 1.0 , suggestedNextTimestep_((max_next_tstep <= 0 ? Parameters::get<TypeTag, Parameters::InitialTimeStepInDays>() : max_next_tstep) * 24 * 60 * 60) // 1.0
, fullTimestepInitially_(Parameters::get<TypeTag, Properties::FullTimeStepInitially>()) // false , fullTimestepInitially_(Parameters::get<TypeTag, Parameters::FullTimeStepInitially>()) // false
, timestepAfterEvent_(Parameters::get<TypeTag, Parameters::TimeStepAfterEventInDays>() * 24 * 60 * 60) // 1e30 , timestepAfterEvent_(Parameters::get<TypeTag, Parameters::TimeStepAfterEventInDays>() * 24 * 60 * 60) // 1e30
, useNewtonIteration_(false) , useNewtonIteration_(false)
, minTimeStepBeforeShuttingProblematicWells_(Parameters::get<TypeTag, Properties::MinTimeStepBeforeShuttingProblematicWellsInDays>() * unit::day) , minTimeStepBeforeShuttingProblematicWells_(Parameters::get<TypeTag, Parameters::MinTimeStepBeforeShuttingProblematicWellsInDays>() * unit::day)
{ {
init_(unitSystem); init_(unitSystem);
@ -289,14 +287,14 @@ std::set<std::string> consistentlyFailingWells(const std::vector<StepReport>& sr
, maxTimeStep_(tuning.TSMAXZ) // 365.25 , maxTimeStep_(tuning.TSMAXZ) // 365.25
, minTimeStep_(tuning.TSFMIN) // 0.1; , minTimeStep_(tuning.TSFMIN) // 0.1;
, ignoreConvergenceFailure_(true) , ignoreConvergenceFailure_(true)
, solverRestartMax_(Parameters::get<TypeTag, Properties::SolverMaxRestarts>()) // 10 , solverRestartMax_(Parameters::get<TypeTag, Parameters::SolverMaxRestarts>()) // 10
, solverVerbose_(Parameters::get<TypeTag, Properties::SolverVerbosity>() > 0 && terminalOutput) // 2 , solverVerbose_(Parameters::get<TypeTag, Parameters::SolverVerbosity>() > 0 && terminalOutput) // 2
, timestepVerbose_(Parameters::get<TypeTag, Properties::TimeStepVerbosity>() > 0 && terminalOutput) // 2 , timestepVerbose_(Parameters::get<TypeTag, Parameters::TimeStepVerbosity>() > 0 && terminalOutput) // 2
, suggestedNextTimestep_(max_next_tstep <= 0 ? Parameters::get<TypeTag, Properties::InitialTimeStepInDays>() * 24 * 60 * 60 : max_next_tstep) // 1.0 , suggestedNextTimestep_(max_next_tstep <= 0 ? Parameters::get<TypeTag, Parameters::InitialTimeStepInDays>() * 24 * 60 * 60 : max_next_tstep) // 1.0
, fullTimestepInitially_(Parameters::get<TypeTag, Properties::FullTimeStepInitially>()) // false , fullTimestepInitially_(Parameters::get<TypeTag, Parameters::FullTimeStepInitially>()) // false
, timestepAfterEvent_(tuning.TMAXWC) // 1e30 , timestepAfterEvent_(tuning.TMAXWC) // 1e30
, useNewtonIteration_(false) , useNewtonIteration_(false)
, minTimeStepBeforeShuttingProblematicWells_(Parameters::get<TypeTag, Properties::MinTimeStepBeforeShuttingProblematicWellsInDays>() * unit::day) , minTimeStepBeforeShuttingProblematicWells_(Parameters::get<TypeTag, Parameters::MinTimeStepBeforeShuttingProblematicWellsInDays>() * unit::day)
{ {
init_(unitSystem); init_(unitSystem);
} }
@ -305,20 +303,20 @@ std::set<std::string> consistentlyFailingWells(const std::vector<StepReport>& sr
{ {
registerEclTimeSteppingParameters<TypeTag>(); registerEclTimeSteppingParameters<TypeTag>();
// TODO: make sure the help messages are correct (and useful) // TODO: make sure the help messages are correct (and useful)
Parameters::registerParam<TypeTag, Properties::SolverContinueOnConvergenceFailure> Parameters::registerParam<TypeTag, Parameters::SolverContinueOnConvergenceFailure>
("Continue instead of stop when minimum solver time step is reached"); ("Continue instead of stop when minimum solver time step is reached");
Parameters::registerParam<TypeTag, Properties::SolverMaxRestarts> Parameters::registerParam<TypeTag, Parameters::SolverMaxRestarts>
("The maximum number of breakdowns before a substep is given up and " ("The maximum number of breakdowns before a substep is given up and "
"the simulator is terminated"); "the simulator is terminated");
Parameters::registerParam<TypeTag, Properties::SolverVerbosity> Parameters::registerParam<TypeTag, Parameters::SolverVerbosity>
("Specify the \"chattiness\" of the non-linear solver itself"); ("Specify the \"chattiness\" of the non-linear solver itself");
Parameters::registerParam<TypeTag, Properties::TimeStepVerbosity> Parameters::registerParam<TypeTag, Parameters::TimeStepVerbosity>
("Specify the \"chattiness\" during the time integration"); ("Specify the \"chattiness\" during the time integration");
Parameters::registerParam<TypeTag, Properties::InitialTimeStepInDays> Parameters::registerParam<TypeTag, Parameters::InitialTimeStepInDays>
("The size of the initial time step in days"); ("The size of the initial time step in days");
Parameters::registerParam<TypeTag, Properties::FullTimeStepInitially> Parameters::registerParam<TypeTag, Parameters::FullTimeStepInitially>
("Always attempt to finish a report step using a single substep"); ("Always attempt to finish a report step using a single substep");
Parameters::registerParam<TypeTag, Properties::TimeStepControl> Parameters::registerParam<TypeTag, Parameters::TimeStepControl>
("The algorithm used to determine time-step sizes. " ("The algorithm used to determine time-step sizes. "
"Valid options are: " "Valid options are: "
"'pid' (default), " "'pid' (default), "
@ -327,31 +325,31 @@ std::set<std::string> consistentlyFailingWells(const std::vector<StepReport>& sr
"'iterationcount', " "'iterationcount', "
"'newtoniterationcount' " "'newtoniterationcount' "
"and 'hardcoded'"); "and 'hardcoded'");
Parameters::registerParam<TypeTag, Properties::TimeStepControlTolerance> Parameters::registerParam<TypeTag, Parameters::TimeStepControlTolerance>
("The tolerance used by the time step size control algorithm"); ("The tolerance used by the time step size control algorithm");
Parameters::registerParam<TypeTag, Properties::TimeStepControlTargetIterations> Parameters::registerParam<TypeTag, Parameters::TimeStepControlTargetIterations>
("The number of linear iterations which the time step control scheme " ("The number of linear iterations which the time step control scheme "
"should aim for (if applicable)"); "should aim for (if applicable)");
Parameters::registerParam<TypeTag, Properties::TimeStepControlTargetNewtonIterations> Parameters::registerParam<TypeTag, Parameters::TimeStepControlTargetNewtonIterations>
("The number of Newton iterations which the time step control scheme " ("The number of Newton iterations which the time step control scheme "
"should aim for (if applicable)"); "should aim for (if applicable)");
Parameters::registerParam<TypeTag, Properties::TimeStepControlDecayRate> Parameters::registerParam<TypeTag, Parameters::TimeStepControlDecayRate>
("The decay rate of the time step size of the number of " ("The decay rate of the time step size of the number of "
"target iterations is exceeded"); "target iterations is exceeded");
Parameters::registerParam<TypeTag, Properties::TimeStepControlGrowthRate> Parameters::registerParam<TypeTag, Parameters::TimeStepControlGrowthRate>
("The growth rate of the time step size of the number of " ("The growth rate of the time step size of the number of "
"target iterations is undercut"); "target iterations is undercut");
Parameters::registerParam<TypeTag, Properties::TimeStepControlDecayDampingFactor> Parameters::registerParam<TypeTag, Parameters::TimeStepControlDecayDampingFactor>
("The decay rate of the time step decrease when the " ("The decay rate of the time step decrease when the "
"target iterations is exceeded"); "target iterations is exceeded");
Parameters::registerParam<TypeTag, Properties::TimeStepControlGrowthDampingFactor> Parameters::registerParam<TypeTag, Parameters::TimeStepControlGrowthDampingFactor>
("The growth rate of the time step increase when the " ("The growth rate of the time step increase when the "
"target iterations is undercut"); "target iterations is undercut");
Parameters::registerParam<TypeTag, Properties::TimeStepControlFileName> Parameters::registerParam<TypeTag, Parameters::TimeStepControlFileName>
("The name of the file which contains the hardcoded time steps sizes"); ("The name of the file which contains the hardcoded time steps sizes");
Parameters::registerParam<TypeTag, Properties::MinTimeStepBeforeShuttingProblematicWellsInDays> Parameters::registerParam<TypeTag, Parameters::MinTimeStepBeforeShuttingProblematicWellsInDays>
("The minimum time step size in days for which problematic wells are not shut"); ("The minimum time step size in days for which problematic wells are not shut");
Parameters::registerParam<TypeTag, Properties::MinTimeStepBasedOnNewtonIterations> Parameters::registerParam<TypeTag, Parameters::MinTimeStepBasedOnNewtonIterations>
("The minimum time step size (in days for field and metric unit and hours for lab unit) " ("The minimum time step size (in days for field and metric unit and hours for lab unit) "
"can be reduced to based on newton iteration counts"); "can be reduced to based on newton iteration counts");
} }
@ -815,25 +813,25 @@ std::set<std::string> consistentlyFailingWells(const std::vector<StepReport>& sr
void init_(const UnitSystem& unitSystem) void init_(const UnitSystem& unitSystem)
{ {
// valid are "pid" and "pid+iteration" // valid are "pid" and "pid+iteration"
std::string control = Parameters::get<TypeTag, Properties::TimeStepControl>(); // "pid" std::string control = Parameters::get<TypeTag, Parameters::TimeStepControl>(); // "pid"
const double tol = Parameters::get<TypeTag, Properties::TimeStepControlTolerance>(); // 1e-1 const double tol = Parameters::get<TypeTag, Parameters::TimeStepControlTolerance>(); // 1e-1
if (control == "pid") { if (control == "pid") {
timeStepControl_ = std::make_unique<PIDTimeStepControl>(tol); timeStepControl_ = std::make_unique<PIDTimeStepControl>(tol);
timeStepControlType_ = TimeStepControlType::PID; timeStepControlType_ = TimeStepControlType::PID;
} }
else if (control == "pid+iteration") { else if (control == "pid+iteration") {
const int iterations = Parameters::get<TypeTag, Properties::TimeStepControlTargetIterations>(); // 30 const int iterations = Parameters::get<TypeTag, Parameters::TimeStepControlTargetIterations>(); // 30
const double decayDampingFactor = Parameters::get<TypeTag, Properties::TimeStepControlDecayDampingFactor>(); // 1.0 const double decayDampingFactor = Parameters::get<TypeTag, Parameters::TimeStepControlDecayDampingFactor>(); // 1.0
const double growthDampingFactor = Parameters::get<TypeTag, Properties::TimeStepControlGrowthDampingFactor>(); // 3.2 const double growthDampingFactor = Parameters::get<TypeTag, Parameters::TimeStepControlGrowthDampingFactor>(); // 3.2
timeStepControl_ = std::make_unique<PIDAndIterationCountTimeStepControl>(iterations, decayDampingFactor, growthDampingFactor, tol); timeStepControl_ = std::make_unique<PIDAndIterationCountTimeStepControl>(iterations, decayDampingFactor, growthDampingFactor, tol);
timeStepControlType_ = TimeStepControlType::PIDAndIterationCount; timeStepControlType_ = TimeStepControlType::PIDAndIterationCount;
} }
else if (control == "pid+newtoniteration") { else if (control == "pid+newtoniteration") {
const int iterations = Parameters::get<TypeTag, Properties::TimeStepControlTargetNewtonIterations>(); // 8 const int iterations = Parameters::get<TypeTag, Parameters::TimeStepControlTargetNewtonIterations>(); // 8
const double decayDampingFactor = Parameters::get<TypeTag, Properties::TimeStepControlDecayDampingFactor>(); // 1.0 const double decayDampingFactor = Parameters::get<TypeTag, Parameters::TimeStepControlDecayDampingFactor>(); // 1.0
const double growthDampingFactor = Parameters::get<TypeTag, Properties::TimeStepControlGrowthDampingFactor>(); // 3.2 const double growthDampingFactor = Parameters::get<TypeTag, Parameters::TimeStepControlGrowthDampingFactor>(); // 3.2
const double nonDimensionalMinTimeStepIterations = Parameters::get<TypeTag, Properties::MinTimeStepBasedOnNewtonIterations>(); // 0.0 by default const double nonDimensionalMinTimeStepIterations = Parameters::get<TypeTag, Parameters::MinTimeStepBasedOnNewtonIterations>(); // 0.0 by default
// the min time step can be reduced by the newton iteration numbers // the min time step can be reduced by the newton iteration numbers
double minTimeStepReducedByIterations = unitSystem.to_si(UnitSystem::measure::time, nonDimensionalMinTimeStepIterations); double minTimeStepReducedByIterations = unitSystem.to_si(UnitSystem::measure::time, nonDimensionalMinTimeStepIterations);
timeStepControl_ = std::make_unique<PIDAndIterationCountTimeStepControl>(iterations, decayDampingFactor, timeStepControl_ = std::make_unique<PIDAndIterationCountTimeStepControl>(iterations, decayDampingFactor,
@ -842,22 +840,22 @@ std::set<std::string> consistentlyFailingWells(const std::vector<StepReport>& sr
useNewtonIteration_ = true; useNewtonIteration_ = true;
} }
else if (control == "iterationcount") { else if (control == "iterationcount") {
const int iterations = Parameters::get<TypeTag, Properties::TimeStepControlTargetIterations>(); // 30 const int iterations = Parameters::get<TypeTag, Parameters::TimeStepControlTargetIterations>(); // 30
const double decayrate = Parameters::get<TypeTag, Properties::TimeStepControlDecayRate>(); // 0.75 const double decayrate = Parameters::get<TypeTag, Parameters::TimeStepControlDecayRate>(); // 0.75
const double growthrate = Parameters::get<TypeTag, Properties::TimeStepControlGrowthRate>(); // 1.25 const double growthrate = Parameters::get<TypeTag, Parameters::TimeStepControlGrowthRate>(); // 1.25
timeStepControl_ = std::make_unique<SimpleIterationCountTimeStepControl>(iterations, decayrate, growthrate); timeStepControl_ = std::make_unique<SimpleIterationCountTimeStepControl>(iterations, decayrate, growthrate);
timeStepControlType_ = TimeStepControlType::SimpleIterationCount; timeStepControlType_ = TimeStepControlType::SimpleIterationCount;
} }
else if (control == "newtoniterationcount") { else if (control == "newtoniterationcount") {
const int iterations = Parameters::get<TypeTag, Properties::TimeStepControlTargetNewtonIterations>(); // 8 const int iterations = Parameters::get<TypeTag, Parameters::TimeStepControlTargetNewtonIterations>(); // 8
const double decayrate = Parameters::get<TypeTag, Properties::TimeStepControlDecayRate>(); // 0.75 const double decayrate = Parameters::get<TypeTag, Parameters::TimeStepControlDecayRate>(); // 0.75
const double growthrate = Parameters::get<TypeTag, Properties::TimeStepControlGrowthRate>(); // 1.25 const double growthrate = Parameters::get<TypeTag, Parameters::TimeStepControlGrowthRate>(); // 1.25
timeStepControl_ = std::make_unique<SimpleIterationCountTimeStepControl>(iterations, decayrate, growthrate); timeStepControl_ = std::make_unique<SimpleIterationCountTimeStepControl>(iterations, decayrate, growthrate);
useNewtonIteration_ = true; useNewtonIteration_ = true;
timeStepControlType_ = TimeStepControlType::SimpleIterationCount; timeStepControlType_ = TimeStepControlType::SimpleIterationCount;
} }
else if (control == "hardcoded") { else if (control == "hardcoded") {
const std::string filename = Parameters::get<TypeTag, Properties::TimeStepControlFileName>(); // "timesteps" const std::string filename = Parameters::get<TypeTag, Parameters::TimeStepControlFileName>(); // "timesteps"
timeStepControl_ = std::make_unique<HardcodedTimeStepControl>(filename); timeStepControl_ = std::make_unique<HardcodedTimeStepControl>(filename);
timeStepControlType_ = TimeStepControlType::HardCodedTimeStep; timeStepControlType_ = TimeStepControlType::HardCodedTimeStep;
} }