diff --git a/examples/problems/co2injectionproblem.hh b/examples/problems/co2injectionproblem.hh index 7b5436b4e..c2d92de4f 100644 --- a/examples/problems/co2injectionproblem.hh +++ b/examples/problems/co2injectionproblem.hh @@ -174,14 +174,6 @@ template struct EnableGravity { static constexpr bool value = true; }; -// The default for the end time of the simulation -template -struct EndTime -{ - using type = GetPropType; - static constexpr type value = 1e4; -}; - template struct FluidSystemNumPressure { static constexpr unsigned value = 100; }; @@ -412,6 +404,7 @@ public: ("The name of the simulation used for the output files"); Parameters::SetDefault("data/co2injection.dgf"); + Parameters::SetDefault>(1e4); } /*! diff --git a/examples/problems/co2ptflashproblem.hh b/examples/problems/co2ptflashproblem.hh index 5be7e7eed..39fc1213a 100644 --- a/examples/problems/co2ptflashproblem.hh +++ b/examples/problems/co2ptflashproblem.hh @@ -161,14 +161,6 @@ template struct EnableGravity { static constexpr bool value = false; }; -// The default for the end time of the simulation -template -struct EndTime -{ - using type = GetPropType; - static constexpr type value = 60. * 60.; -}; - // this is kinds of telling the report step length template struct EpisodeLength @@ -398,6 +390,8 @@ public: Parameters::SetDefault(1); Parameters::SetDefault>(1.0); } + + Parameters::SetDefault>(60. * 60.); } /*! diff --git a/examples/problems/cuvetteproblem.hh b/examples/problems/cuvetteproblem.hh index c504105d9..6460d9296 100644 --- a/examples/problems/cuvetteproblem.hh +++ b/examples/problems/cuvetteproblem.hh @@ -121,14 +121,6 @@ template struct EnableGravity { static constexpr bool value = true; }; -// The default for the end time of the simulation -template -struct EndTime -{ - using type = GetPropType; - static constexpr type value = 180; -}; - // The default for the initial time step size of the simulation template struct InitialTimeStepSize @@ -312,6 +304,7 @@ public: ParentType::registerParameters(); Parameters::SetDefault("./data/cuvette_11x4.dgf"); + Parameters::SetDefault>(100.0); } /*! diff --git a/examples/problems/diffusionproblem.hh b/examples/problems/diffusionproblem.hh index 19b89674e..c6a20b70b 100644 --- a/examples/problems/diffusionproblem.hh +++ b/examples/problems/diffusionproblem.hh @@ -115,14 +115,6 @@ template struct EnableGravity { static constexpr bool value = false; }; -// The default for the end time of the simulation -template -struct EndTime -{ - using type = GetPropType; - static constexpr type value = 1e6; -}; - // The default for the initial time step size of the simulation template struct InitialTimeStepSize @@ -223,10 +215,11 @@ public: if constexpr (dim > 1) { Parameters::SetDefault(1); } - if constexpr (dim == 3) { Parameters::SetDefault(1); } + + Parameters::SetDefault>(1e6); } /*! diff --git a/examples/problems/fingerproblem.hh b/examples/problems/fingerproblem.hh index 98b5c24fb..27f7e3357 100644 --- a/examples/problems/fingerproblem.hh +++ b/examples/problems/fingerproblem.hh @@ -136,14 +136,6 @@ template struct EnableGravity { static constexpr bool value = true; }; -// The default for the end time of the simulation -template -struct EndTime -{ - using type = GetPropType; - static constexpr type value = 215; -}; - // The default for the initial time step size of the simulation template struct InitialTimeStepSize @@ -296,6 +288,8 @@ public: // Use forward differences Parameters::SetDefault(+1); + + Parameters::SetDefault>(215); } /*! diff --git a/examples/problems/fractureproblem.hh b/examples/problems/fractureproblem.hh index 9ac3b1bd5..2579c2fea 100644 --- a/examples/problems/fractureproblem.hh +++ b/examples/problems/fractureproblem.hh @@ -165,14 +165,6 @@ template struct EnableGravity { static constexpr bool value = false; }; -// Set the default value for the end time -template -struct EndTime -{ - using type = GetPropType; - static constexpr type value = 3e3; -}; - // Set the default value for the initial time step size template struct InitialTimeStepSize @@ -313,6 +305,7 @@ public: ParentType::registerParameters(); Parameters::SetDefault("data/fracture.art.dgf"); + Parameters::SetDefault>(3e3); } /*! diff --git a/examples/problems/groundwaterproblem.hh b/examples/problems/groundwaterproblem.hh index dc1e28b16..2b704f29a 100644 --- a/examples/problems/groundwaterproblem.hh +++ b/examples/problems/groundwaterproblem.hh @@ -117,14 +117,6 @@ template struct EnableGravity { static constexpr bool value = true; }; -// The default for the end time of the simulation -template -struct EndTime -{ - using type = GetPropType; - static constexpr type value = 1; -}; - // The default for the initial time step size of the simulation template struct InitialTimeStepSize @@ -303,6 +295,7 @@ public: ("The intrinsic permeability [m^2] of the lens."); Parameters::SetDefault("./data/groundwater_2d.dgf"); + Parameters::SetDefault>(1.0); } /*! diff --git a/examples/problems/infiltrationproblem.hh b/examples/problems/infiltrationproblem.hh index 7063f1479..6d3c11d55 100644 --- a/examples/problems/infiltrationproblem.hh +++ b/examples/problems/infiltrationproblem.hh @@ -97,14 +97,6 @@ template struct EnableGravity { static constexpr bool value = true; }; -// The default for the end time of the simulation -template -struct EndTime -{ - using type = GetPropType; - static constexpr type value = 6e3; -}; - // The default for the initial time step size of the simulation template struct InitialTimeStepSize @@ -243,6 +235,7 @@ public: Parameters::SetDefault("./data/infiltration_50x3.dgf"); Parameters::SetDefault(1); + Parameters::SetDefault>(6e3); } /*! diff --git a/examples/problems/lensproblem.hh b/examples/problems/lensproblem.hh index f5de2d98a..c9d7b30d3 100644 --- a/examples/problems/lensproblem.hh +++ b/examples/problems/lensproblem.hh @@ -153,14 +153,6 @@ template struct EnableStorageCache { static constexpr bool value = true; }; -// The default for the end time of the simulation -template -struct EndTime -{ - using type = GetPropType; - static constexpr type value = 30e3; -}; - // The default for the initial time step size of the simulation template struct InitialTimeStepSize @@ -378,6 +370,8 @@ public: if constexpr (useFD) { Parameters::SetDefault(+1); } + + Parameters::SetDefault>(30e3); } /*! diff --git a/examples/problems/obstacleproblem.hh b/examples/problems/obstacleproblem.hh index 312f06d8f..0c1ca2577 100644 --- a/examples/problems/obstacleproblem.hh +++ b/examples/problems/obstacleproblem.hh @@ -120,14 +120,6 @@ template struct EnableGravity { static constexpr bool value = true; }; -// The default for the end time of the simulation -template -struct EndTime -{ - using type = GetPropType; - static constexpr type value = 1e4; -}; - // The default for the initial time step size of the simulation template struct InitialTimeStepSize @@ -282,6 +274,7 @@ public: ParentType::registerParameters(); Parameters::SetDefault("./data/obstacle_24x16.dgf"); + Parameters::SetDefault>(1e4); } /*! diff --git a/examples/problems/outflowproblem.hh b/examples/problems/outflowproblem.hh index e9b157465..4737fb0c8 100644 --- a/examples/problems/outflowproblem.hh +++ b/examples/problems/outflowproblem.hh @@ -81,14 +81,6 @@ template struct EnableGravity { static constexpr bool value = false; }; -// The default for the end time of the simulation -template -struct EndTime -{ - using type = GetPropType; - static constexpr type value = 100; -}; - // The default for the initial time step size of the simulation template struct InitialTimeStepSize @@ -190,6 +182,7 @@ public: ParentType::registerParameters(); Parameters::SetDefault("./data/outflow.dgf"); + Parameters::SetDefault>(100.0); } /*! diff --git a/examples/problems/powerinjectionproblem.hh b/examples/problems/powerinjectionproblem.hh index 7d2d39642..b35a55772 100644 --- a/examples/problems/powerinjectionproblem.hh +++ b/examples/problems/powerinjectionproblem.hh @@ -128,14 +128,6 @@ template struct EnableGravity { static constexpr bool value = false; }; -// The default for the end time of the simulation -template -struct EndTime -{ - using type = GetPropType; - static constexpr type value = 100; -}; - // The default for the initial time step size of the simulation template struct InitialTimeStepSize @@ -254,6 +246,8 @@ public: Parameters::SetDefault(1); Parameters::SetDefault>(1.0); } + + Parameters::SetDefault>(100.0); } /*! diff --git a/examples/problems/reservoirproblem.hh b/examples/problems/reservoirproblem.hh index c65aafca7..8f891a2d7 100644 --- a/examples/problems/reservoirproblem.hh +++ b/examples/problems/reservoirproblem.hh @@ -139,17 +139,6 @@ template struct EnableGravity { static constexpr bool value = true; }; -//! The default for the end time of the simulation [s]. -//! -//! By default this problem spans 1000 days (100 "settle down" days and 900 days of -//! production) -template -struct EndTime -{ - using type = GetPropType; - static constexpr type value = 1000.0*24*60*60; -}; - // The default for the initial time step size of the simulation [s] template struct InitialTimeStepSize @@ -445,8 +434,11 @@ public: ("The width of producer/injector wells as a fraction of the width" " of the spatial domain"); - Parameters::SetDefault("data/reservoir.dgf"); + + //! By default this problem spans 1000 days (100 "settle down" days and 900 days of + //! production) + Parameters::SetDefault>(1000.0*24*60*60); } /*! diff --git a/examples/problems/richardslensproblem.hh b/examples/problems/richardslensproblem.hh index 2e423d85a..cf5245309 100644 --- a/examples/problems/richardslensproblem.hh +++ b/examples/problems/richardslensproblem.hh @@ -108,14 +108,6 @@ template struct EnableGravity { static constexpr bool value = true; }; -// The default for the end time of the simulation -template -struct EndTime -{ - using type = GetPropType; - static constexpr type value = 3000; -}; - // The default for the initial time step size of the simulation template struct InitialTimeStepSize @@ -272,6 +264,8 @@ public: if constexpr (useFD) { Parameters::SetDefault(0); } + + Parameters::SetDefault>(3000.0); } /*! diff --git a/examples/problems/waterairproblem.hh b/examples/problems/waterairproblem.hh index 058b934c5..f10f57fe1 100644 --- a/examples/problems/waterairproblem.hh +++ b/examples/problems/waterairproblem.hh @@ -140,14 +140,6 @@ template struct EnableGravity { static constexpr bool value = true; }; -// The default for the end time of the simulation (1 year) -template -struct EndTime -{ - using type = GetPropType; - static constexpr type value = 1.0 * 365 * 24 * 60 * 60; -}; - // The default for the initial time step size of the simulation template struct InitialTimeStepSize @@ -316,6 +308,8 @@ public: // Use forward differences Parameters::SetDefault(+1); + + Parameters::SetDefault>(1.0 * 365 * 24 * 60 * 60); } /*! diff --git a/examples/tutorial1problem.hh b/examples/tutorial1problem.hh index 697156b3c..e78e2845f 100644 --- a/examples/tutorial1problem.hh +++ b/examples/tutorial1problem.hh @@ -129,14 +129,6 @@ template struct EnableGravity { static constexpr bool value = false; }; /*@\label{tutorial1:gravity}@*/ -// define how long the simulation should run [s] -template -struct EndTime -{ - using type = GetPropType; - static constexpr type value = 100e3; -}; /*@\label{tutorial1:default-params-begin}@*/ - // define the size of the initial time step [s] template struct InitialTimeStepSize @@ -231,6 +223,8 @@ public: Parameters::SetDefault(1); Parameters::SetDefault>(0.0); } + + Parameters::SetDefault>(100e3); } //! Specifies the problem name. This is used for files generated by the simulation. diff --git a/opm/models/utils/basicparameters.hh b/opm/models/utils/basicparameters.hh index 05a1ef28f..e871a1b4d 100644 --- a/opm/models/utils/basicparameters.hh +++ b/opm/models/utils/basicparameters.hh @@ -48,8 +48,8 @@ template struct DomainSizeZ { static constexpr Scalar value = 1.0; }; //! The default value for the simulation's end time -template -struct EndTime { using type = Properties::UndefinedProperty; }; +template +struct EndTime { static constexpr Scalar value = -1e35; }; //! Name of the grid file struct GridFile { static constexpr auto value = ""; }; diff --git a/opm/models/utils/basicproperties.hh b/opm/models/utils/basicproperties.hh index c1553eae1..36a9ac495 100644 --- a/opm/models/utils/basicproperties.hh +++ b/opm/models/utils/basicproperties.hh @@ -179,14 +179,6 @@ struct Vanguard namespace Opm::Parameters { -//! The default value for the simulation's end time -template -struct EndTime -{ - using type = GetPropType; - static constexpr type value = -1e35; -}; - //! The default value for the simulation's initial time step size template struct InitialTimeStepSize diff --git a/opm/models/utils/simulator.hh b/opm/models/utils/simulator.hh index 3bada2a78..aecc04adb 100644 --- a/opm/models/utils/simulator.hh +++ b/opm/models/utils/simulator.hh @@ -129,7 +129,7 @@ public: timeStepIdx_ = 0; startTime_ = 0.0; time_ = 0.0; - endTime_ = Parameters::get(); + endTime_ = Parameters::Get>(); timeStepSize_ = Parameters::get(); assert(timeStepSize_ > 0); const std::string& predetTimeStepFile = @@ -254,7 +254,7 @@ public: */ static void registerParameters() { - Parameters::registerParam + Parameters::Register> ("The simulation time at which the simulation is finished [s]"); Parameters::registerParam ("The size of the initial time step [s]"); diff --git a/opm/models/utils/start.hh b/opm/models/utils/start.hh index 88008e335..714ef616c 100644 --- a/opm/models/utils/start.hh +++ b/opm/models/utils/start.hh @@ -315,7 +315,7 @@ static inline int start(int argc, char **argv, bool registerParams=true) #endif // read the initial time step and the end time - Scalar endTime = Parameters::get(); + Scalar endTime = Parameters::Get>(); if (endTime < -1e50) { if (myRank == 0) Parameters::printUsage(argv[0],