changed: EclTimeStepping parameters moved to Opm::Parameters namespace

This commit is contained in:
Arne Morten Kvarving 2024-06-28 12:17:13 +02:00
parent 04a9b0893e
commit 6f7fcb5872
4 changed files with 51 additions and 57 deletions

View File

@ -315,9 +315,9 @@ public:
enableEclOutput_ = Parameters::get<TypeTag, Properties::EnableEclOutput>();
this->enableTuning_ = Parameters::get<TypeTag, Properties::EnableTuning>();
this->enableTuning_ = Parameters::get<TypeTag, Parameters::EnableTuning>();
this->initialTimeStepSize_ = Parameters::get<TypeTag, Parameters::InitialTimeStepSize>();
this->maxTimeStepAfterWellEvent_ = Parameters::get<TypeTag, Properties::TimeStepAfterEventInDays>() * 24 * 60 * 60;
this->maxTimeStepAfterWellEvent_ = Parameters::get<TypeTag, Parameters::TimeStepAfterEventInDays>() * 24 * 60 * 60;
// The value N for this parameter is defined in the following order of presedence:
// 1. Command line value (--num-pressure-points-equil=N)
@ -2689,7 +2689,7 @@ private:
int episodeIdx = simulator.episodeIndex();
// first thing in the morning, limit the time step size to the maximum size
Scalar maxTimeStepSize = Parameters::get<TypeTag, Properties::SolverMaxTimeStepInDays>() * 24 * 60 * 60;
Scalar maxTimeStepSize = Parameters::get<TypeTag, Parameters::SolverMaxTimeStepInDays>() * 24 * 60 * 60;
int reportStepIdx = std::max(episodeIdx, 0);
if (this->enableTuning_) {
const auto& tuning = schedule[reportStepIdx].tuning();

View File

@ -282,7 +282,7 @@ public:
// adaptive time stepping
bool enableAdaptive = Parameters::get<TypeTag, Properties::EnableAdaptiveTimeStepping>();
bool enableTUNING = Parameters::get<TypeTag, Properties::EnableTuning>();
bool enableTUNING = Parameters::get<TypeTag, Parameters::EnableTuning>();
if (enableAdaptive) {
const UnitSystem& unitSystem = this->simulator_.vanguard().eclState().getUnits();
const auto& sched_state = schedule()[timer.currentStepNum()];
@ -372,7 +372,7 @@ public:
this->solver_->model().beginReportStep();
const bool enableTUNING = Parameters::get<TypeTag, Properties::EnableTuning>();
const bool enableTUNING = Parameters::get<TypeTag, Parameters::EnableTuning>();
// If sub stepping is enabled allow the solver to sub cycle
// in case the report steps are too large for the solver to converge

View File

@ -254,18 +254,18 @@ std::set<std::string> consistentlyFailingWells(const std::vector<StepReport>& sr
const double max_next_tstep = -1.0,
const bool terminalOutput = true)
: timeStepControl_()
, restartFactor_(Parameters::get<TypeTag, Properties::SolverRestartFactor>()) // 0.33
, growthFactor_(Parameters::get<TypeTag, Properties::SolverGrowthFactor>()) // 2.0
, maxGrowth_(Parameters::get<TypeTag, Properties::SolverMaxGrowth>()) // 3.0
, maxTimeStep_(Parameters::get<TypeTag, Properties::SolverMaxTimeStepInDays>() * 24 * 60 * 60) // 365.25
, minTimeStep_(unitSystem.to_si(UnitSystem::measure::time, Parameters::get<TypeTag, Properties::SolverMinTimeStep>())) // 1e-12;
, restartFactor_(Parameters::get<TypeTag, Parameters::SolverRestartFactor>()) // 0.33
, growthFactor_(Parameters::get<TypeTag, Parameters::SolverGrowthFactor>()) // 2.0
, maxGrowth_(Parameters::get<TypeTag, Parameters::SolverMaxGrowth>()) // 3.0
, 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;
, ignoreConvergenceFailure_(Parameters::get<TypeTag, Properties::SolverContinueOnConvergenceFailure>()) // false;
, solverRestartMax_(Parameters::get<TypeTag, Properties::SolverMaxRestarts>()) // 10
, solverVerbose_(Parameters::get<TypeTag, Properties::SolverVerbosity>() > 0 && terminalOutput) // 2
, timestepVerbose_(Parameters::get<TypeTag, Properties::TimeStepVerbosity>() > 0 && terminalOutput) // 2
, suggestedNextTimestep_((max_next_tstep <= 0 ? Parameters::get<TypeTag, Properties::InitialTimeStepInDays>() : max_next_tstep) * 24 * 60 * 60) // 1.0
, fullTimestepInitially_(Parameters::get<TypeTag, Properties::FullTimeStepInitially>()) // false
, timestepAfterEvent_(Parameters::get<TypeTag, Properties::TimeStepAfterEventInDays>() * 24 * 60 * 60) // 1e30
, timestepAfterEvent_(Parameters::get<TypeTag, Parameters::TimeStepAfterEventInDays>() * 24 * 60 * 60) // 1e30
, useNewtonIteration_(false)
, minTimeStepBeforeShuttingProblematicWells_(Parameters::get<TypeTag, Properties::MinTimeStepBeforeShuttingProblematicWellsInDays>() * unit::day)

View File

@ -26,85 +26,79 @@
#include <opm/models/utils/basicproperties.hh>
#include <opm/models/utils/propertysystem.hh>
namespace Opm::Properties {
namespace TTag {
namespace Opm::Properties::TTag {
struct EclTimeSteppingParameters {};
}
template<class TypeTag, class MyTypeTag>
struct EnableTuning {
using type = UndefinedProperty;
};
namespace Opm::Parameters {
template<class TypeTag, class MyTypeTag>
struct SolverGrowthFactor {
using type = UndefinedProperty;
};
struct EnableTuning { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct SolverMaxGrowth {
using type = UndefinedProperty;
};
struct SolverGrowthFactor { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct SolverMaxTimeStepInDays {
using type = UndefinedProperty;
};
struct SolverMaxGrowth { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct SolverMinTimeStep {
using type = UndefinedProperty;
};
struct SolverMaxTimeStepInDays { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct SolverRestartFactor {
using type = UndefinedProperty;
};
struct SolverMinTimeStep { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct TimeStepAfterEventInDays {
using type = UndefinedProperty;
};
struct SolverRestartFactor { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct TimeStepAfterEventInDays { using type = Properties::UndefinedProperty; };
template<class TypeTag>
struct EnableTuning<TypeTag, TTag::EclTimeSteppingParameters> {
static constexpr bool value = false;
};
struct EnableTuning<TypeTag, Properties::TTag::EclTimeSteppingParameters>
{ static constexpr bool value = false; };
template<class TypeTag>
struct SolverGrowthFactor<TypeTag, TTag::EclTimeSteppingParameters> {
using type = GetPropType<TypeTag, Scalar>;
struct SolverGrowthFactor<TypeTag, Properties::TTag::EclTimeSteppingParameters>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 2.0;
};
template<class TypeTag>
struct SolverMaxGrowth<TypeTag, TTag::EclTimeSteppingParameters> {
using type = GetPropType<TypeTag, Scalar>;
struct SolverMaxGrowth<TypeTag, Properties::TTag::EclTimeSteppingParameters>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 3.0;
};
template<class TypeTag>
struct SolverMinTimeStep<TypeTag, TTag::EclTimeSteppingParameters> {
using type = GetPropType<TypeTag, Scalar>;
struct SolverMinTimeStep<TypeTag, Properties::TTag::EclTimeSteppingParameters>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1.0e-12;
};
template<class TypeTag>
struct SolverMaxTimeStepInDays<TypeTag, TTag::EclTimeSteppingParameters> {
using type = GetPropType<TypeTag, Scalar>;
struct SolverMaxTimeStepInDays<TypeTag, Properties::TTag::EclTimeSteppingParameters>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 365.0;
};
template<class TypeTag>
struct SolverRestartFactor<TypeTag, TTag::EclTimeSteppingParameters> {
using type = GetPropType<TypeTag, Scalar>;
struct SolverRestartFactor<TypeTag, Properties::TTag::EclTimeSteppingParameters>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 0.33;
};
template<class TypeTag>
struct TimeStepAfterEventInDays<TypeTag, TTag::EclTimeSteppingParameters> {
using type = GetPropType<TypeTag, Scalar>;
struct TimeStepAfterEventInDays<TypeTag, Properties::TTag::EclTimeSteppingParameters>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = -1.0;
};
@ -115,21 +109,21 @@ namespace Opm {
template<class TypeTag>
void registerEclTimeSteppingParameters()
{
Parameters::registerParam<TypeTag, Properties::EnableTuning>
Parameters::registerParam<TypeTag, Parameters::EnableTuning>
("Honor some aspects of the TUNING keyword.");
Parameters::registerParam<TypeTag, Properties::SolverGrowthFactor>
Parameters::registerParam<TypeTag, Parameters::SolverGrowthFactor>
("The factor time steps are elongated after a successful substep");
Parameters::registerParam<TypeTag, Properties::SolverMaxGrowth>
Parameters::registerParam<TypeTag, Parameters::SolverMaxGrowth>
("The maximum factor time steps are elongated after a report step");
Parameters::registerParam<TypeTag, Properties::SolverMaxTimeStepInDays>
Parameters::registerParam<TypeTag, Parameters::SolverMaxTimeStepInDays>
("The maximum size of a time step in days");
Parameters::registerParam<TypeTag, Properties::SolverMinTimeStep>
Parameters::registerParam<TypeTag, Parameters::SolverMinTimeStep>
("The minimum size of a time step in days for field and "
"metric and hours for lab. If a step cannot converge without "
"getting cut below this step size the simulator will stop");
Parameters::registerParam<TypeTag, Properties::SolverRestartFactor>
Parameters::registerParam<TypeTag, Parameters::SolverRestartFactor>
("The factor time steps are elongated after restarts");
Parameters::registerParam<TypeTag, Properties::TimeStepAfterEventInDays>
Parameters::registerParam<TypeTag, Parameters::TimeStepAfterEventInDays>
("Time step size of the first time step after an event "
"occurs during the simulation in days");
}