diff --git a/examples/problems/co2injectionproblem.hh b/examples/problems/co2injectionproblem.hh index c2d92de4f..404b934e7 100644 --- a/examples/problems/co2injectionproblem.hh +++ b/examples/problems/co2injectionproblem.hh @@ -210,14 +210,6 @@ struct FluidSystemTemperatureLow -struct InitialTimeStepSize -{ - using type = GetPropType; - static constexpr type value = 250; -}; - template struct MaxDepth { @@ -405,6 +397,7 @@ public: Parameters::SetDefault("data/co2injection.dgf"); Parameters::SetDefault>(1e4); + Parameters::SetDefault>(250); } /*! diff --git a/examples/problems/co2ptflashproblem.hh b/examples/problems/co2ptflashproblem.hh index 39fc1213a..0b99ed78d 100644 --- a/examples/problems/co2ptflashproblem.hh +++ b/examples/problems/co2ptflashproblem.hh @@ -176,14 +176,6 @@ struct Initialpressure static constexpr type value = 75.e5; }; -// convergence control -template -struct InitialTimeStepSize -{ - using type = GetPropType; - static constexpr type value = 0.1 * 60. * 60.; -}; - template struct LinearSolverAbsTolerance { @@ -392,6 +384,7 @@ public: } Parameters::SetDefault>(60. * 60.); + Parameters::SetDefault>(0.1 * 60. * 60.); } /*! diff --git a/examples/problems/cuvetteproblem.hh b/examples/problems/cuvetteproblem.hh index 6460d9296..53710f8da 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 initial time step size of the simulation -template -struct InitialTimeStepSize -{ - using type = GetPropType; - static constexpr type value = 1; -}; - // Set the maximum time step template struct MaxTimeStepSize @@ -305,6 +297,7 @@ public: Parameters::SetDefault("./data/cuvette_11x4.dgf"); Parameters::SetDefault>(100.0); + Parameters::SetDefault>(1.0); } /*! diff --git a/examples/problems/diffusionproblem.hh b/examples/problems/diffusionproblem.hh index c6a20b70b..e4b480e89 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 initial time step size of the simulation -template -struct InitialTimeStepSize -{ - using type = GetPropType; - static constexpr type value = 1000; -}; - } // namespace Opm::Parameters namespace Opm { @@ -220,6 +212,7 @@ public: } Parameters::SetDefault>(1e6); + Parameters::SetDefault>(1000); } /*! diff --git a/examples/problems/fingerproblem.hh b/examples/problems/fingerproblem.hh index 27f7e3357..7431e90b8 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 initial time step size of the simulation -template -struct InitialTimeStepSize -{ - using type = GetPropType; - static constexpr type value = 10; -}; - template struct InitialWaterSaturation { @@ -290,6 +282,7 @@ public: Parameters::SetDefault(+1); Parameters::SetDefault>(215); + Parameters::SetDefault>(10); } /*! diff --git a/examples/problems/fractureproblem.hh b/examples/problems/fractureproblem.hh index 2579c2fea..83ba3986e 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 initial time step size -template -struct InitialTimeStepSize -{ - using type = GetPropType; - static constexpr type value = 100; -}; - } // namespace Opm::Parameters namespace Opm { @@ -306,6 +298,7 @@ public: Parameters::SetDefault("data/fracture.art.dgf"); Parameters::SetDefault>(3e3); + Parameters::SetDefault>(100); } /*! diff --git a/examples/problems/groundwaterproblem.hh b/examples/problems/groundwaterproblem.hh index 2b704f29a..5e37f3e12 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 initial time step size of the simulation -template -struct InitialTimeStepSize -{ - using type = GetPropType; - static constexpr type value = 1; -}; - template struct LensLowerLeftX { @@ -296,6 +288,7 @@ public: Parameters::SetDefault("./data/groundwater_2d.dgf"); Parameters::SetDefault>(1.0); + Parameters::SetDefault>(1.0); } /*! diff --git a/examples/problems/infiltrationproblem.hh b/examples/problems/infiltrationproblem.hh index 6d3c11d55..64c2175ed 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 initial time step size of the simulation -template -struct InitialTimeStepSize -{ - using type = GetPropType; - static constexpr type value = 60; -}; - // Write newton convergence? template struct NewtonWriteConvergence @@ -236,6 +228,7 @@ public: Parameters::SetDefault("./data/infiltration_50x3.dgf"); Parameters::SetDefault(1); Parameters::SetDefault>(6e3); + Parameters::SetDefault>(60.0); } /*! diff --git a/examples/problems/lensproblem.hh b/examples/problems/lensproblem.hh index c9d7b30d3..7c1f56894 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 initial time step size of the simulation -template -struct InitialTimeStepSize -{ - using type = GetPropType; - static constexpr type value = 250; -}; - // define the properties specific for the lens problem template struct LensLowerLeftX @@ -372,6 +364,7 @@ public: } Parameters::SetDefault>(30e3); + Parameters::SetDefault>(250.0); } /*! diff --git a/examples/problems/obstacleproblem.hh b/examples/problems/obstacleproblem.hh index 0c1ca2577..eb299f702 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 initial time step size of the simulation -template -struct InitialTimeStepSize -{ - using type = GetPropType; - static constexpr type value = 250; -}; - } // namespace Opm::Parameters namespace Opm { @@ -275,6 +267,7 @@ public: Parameters::SetDefault("./data/obstacle_24x16.dgf"); Parameters::SetDefault>(1e4); + Parameters::SetDefault>(250); } /*! diff --git a/examples/problems/outflowproblem.hh b/examples/problems/outflowproblem.hh index 4737fb0c8..f1eeaf232 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 initial time step size of the simulation -template -struct InitialTimeStepSize -{ - using type = GetPropType; - static constexpr type value = 1; -}; - // Also write mass fractions to the output template struct VtkWriteMassFractions @@ -183,6 +175,7 @@ public: Parameters::SetDefault("./data/outflow.dgf"); Parameters::SetDefault>(100.0); + Parameters::SetDefault>(1.0); } /*! diff --git a/examples/problems/powerinjectionproblem.hh b/examples/problems/powerinjectionproblem.hh index b35a55772..71d245b44 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 initial time step size of the simulation -template -struct InitialTimeStepSize -{ - using type = GetPropType; - static constexpr type value = 1e-3; -}; - // Write out the filter velocities for this problem template struct VtkWriteFilterVelocities @@ -248,6 +240,7 @@ public: } Parameters::SetDefault>(100.0); + Parameters::SetDefault>(1e-3); } /*! diff --git a/examples/problems/reservoirproblem.hh b/examples/problems/reservoirproblem.hh index 8f891a2d7..addfe62c9 100644 --- a/examples/problems/reservoirproblem.hh +++ b/examples/problems/reservoirproblem.hh @@ -139,14 +139,6 @@ template struct EnableGravity { static constexpr bool value = true; }; -// The default for the initial time step size of the simulation [s] -template -struct InitialTimeStepSize -{ - using type = GetPropType; - static constexpr type value = 100e3; -}; - // set the defaults for some problem specific properties template struct MaxDepth @@ -439,6 +431,9 @@ public: //! By default this problem spans 1000 days (100 "settle down" days and 900 days of //! production) Parameters::SetDefault>(1000.0*24*60*60); + + Parameters::SetDefault("data/reservoir.dgf"); + Parameters::SetDefault>(100e3); } /*! diff --git a/examples/problems/richardslensproblem.hh b/examples/problems/richardslensproblem.hh index cf5245309..44dee3c30 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 initial time step size of the simulation -template -struct InitialTimeStepSize -{ - using type = GetPropType; - static constexpr type value = 100; -}; - // Do not write the intermediate results of the newton method template struct NewtonWriteConvergence @@ -266,6 +258,7 @@ public: } Parameters::SetDefault>(3000.0); + Parameters::SetDefault>(100.0); } /*! diff --git a/examples/problems/waterairproblem.hh b/examples/problems/waterairproblem.hh index f10f57fe1..18716c10d 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 initial time step size of the simulation -template -struct InitialTimeStepSize -{ - using type = GetPropType; - static constexpr type value = 250; -}; - // Write newton convergence template struct NewtonWriteConvergence @@ -310,6 +302,7 @@ public: Parameters::SetDefault(+1); Parameters::SetDefault>(1.0 * 365 * 24 * 60 * 60); + Parameters::SetDefault>(250.0); } /*! diff --git a/examples/tutorial1problem.hh b/examples/tutorial1problem.hh index e78e2845f..e58b0ce14 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 the size of the initial time step [s] -template -struct InitialTimeStepSize -{ - using type = GetPropType; - static constexpr type value = 125.0; -}; - } // namespace Opm::Parameters namespace Opm { @@ -225,6 +217,7 @@ public: } Parameters::SetDefault>(100e3); + Parameters::SetDefault>(125.0); } //! 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 e871a1b4d..6b9ff8565 100644 --- a/opm/models/utils/basicparameters.hh +++ b/opm/models/utils/basicparameters.hh @@ -28,8 +28,6 @@ #ifndef EWOMS_BASIC_PARAMETERS_HH #define EWOMS_BASIC_PARAMETERS_HH -#include - namespace Opm::Parameters { //! grid resolution @@ -59,8 +57,8 @@ struct GridFile { static constexpr auto value = ""; }; struct GridGlobalRefinements { static constexpr unsigned value = 0; }; //! The default value for the simulation's initial time step size -template -struct InitialTimeStepSize { using type = Properties::UndefinedProperty; }; +template +struct InitialTimeStepSize { static constexpr Scalar value = -1e35; }; //! Set a value for the ParameterFile property struct ParameterFile { static constexpr auto value = ""; }; diff --git a/opm/models/utils/basicproperties.hh b/opm/models/utils/basicproperties.hh index 36a9ac495..9d751ba9c 100644 --- a/opm/models/utils/basicproperties.hh +++ b/opm/models/utils/basicproperties.hh @@ -177,16 +177,4 @@ struct Vanguard } // namespace Opm::Properties -namespace Opm::Parameters { - -//! The default value for the simulation's initial time step size -template -struct InitialTimeStepSize -{ - using type = GetPropType; - static constexpr type value = -1e35; -}; - -} // namespace Opm::Parameters - #endif diff --git a/opm/models/utils/simulator.hh b/opm/models/utils/simulator.hh index aecc04adb..116da39c6 100644 --- a/opm/models/utils/simulator.hh +++ b/opm/models/utils/simulator.hh @@ -130,7 +130,7 @@ public: startTime_ = 0.0; time_ = 0.0; endTime_ = Parameters::Get>(); - timeStepSize_ = Parameters::get(); + timeStepSize_ = Parameters::Get>(); assert(timeStepSize_ > 0); const std::string& predetTimeStepFile = Parameters::Get(); @@ -256,7 +256,7 @@ public: { Parameters::Register> ("The simulation time at which the simulation is finished [s]"); - Parameters::registerParam + Parameters::Register> ("The size of the initial time step [s]"); Parameters::Register> ("The simulation time at which a restart should be attempted [s]"); diff --git a/opm/models/utils/start.hh b/opm/models/utils/start.hh index 714ef616c..2284ffcc3 100644 --- a/opm/models/utils/start.hh +++ b/opm/models/utils/start.hh @@ -323,7 +323,7 @@ static inline int start(int argc, char **argv, bool registerParams=true) return 1; } - Scalar initialTimeStepSize = Parameters::get(); + Scalar initialTimeStepSize = Parameters::Get>(); if (initialTimeStepSize < -1e50) { if (myRank == 0) Parameters::printUsage(argv[0],