mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-11-24 02:06:25 -06:00
move InitialTimeStepSize to TypeTag-free parameter system
This commit is contained in:
parent
f5c7bada37
commit
a2cbb8cb02
@ -210,14 +210,6 @@ struct FluidSystemTemperatureLow<TypeTag, Properties::TTag::Co2InjectionBaseProb
|
||||
static constexpr type value = 290;
|
||||
};
|
||||
|
||||
// The default for the initial time step size of the simulation
|
||||
template<class TypeTag>
|
||||
struct InitialTimeStepSize<TypeTag, Properties::TTag::Co2InjectionBaseProblem>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 250;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct MaxDepth<TypeTag, Properties::TTag::Co2InjectionBaseProblem>
|
||||
{
|
||||
@ -405,6 +397,7 @@ public:
|
||||
|
||||
Parameters::SetDefault<Parameters::GridFile>("data/co2injection.dgf");
|
||||
Parameters::SetDefault<Parameters::EndTime<Scalar>>(1e4);
|
||||
Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(250);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -176,14 +176,6 @@ struct Initialpressure<TypeTag, Properties::TTag::CO2PTBaseProblem>
|
||||
static constexpr type value = 75.e5;
|
||||
};
|
||||
|
||||
// convergence control
|
||||
template <class TypeTag>
|
||||
struct InitialTimeStepSize<TypeTag, Properties::TTag::CO2PTBaseProblem>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 0.1 * 60. * 60.;
|
||||
};
|
||||
|
||||
template <class TypeTag>
|
||||
struct LinearSolverAbsTolerance<TypeTag, Properties::TTag::CO2PTBaseProblem>
|
||||
{
|
||||
@ -392,6 +384,7 @@ public:
|
||||
}
|
||||
|
||||
Parameters::SetDefault<Parameters::EndTime<Scalar>>(60. * 60.);
|
||||
Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(0.1 * 60. * 60.);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -121,14 +121,6 @@ template<class TypeTag>
|
||||
struct EnableGravity<TypeTag, Properties::TTag::CuvetteBaseProblem>
|
||||
{ static constexpr bool value = true; };
|
||||
|
||||
// The default for the initial time step size of the simulation
|
||||
template<class TypeTag>
|
||||
struct InitialTimeStepSize<TypeTag, Properties::TTag::CuvetteBaseProblem>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 1;
|
||||
};
|
||||
|
||||
// Set the maximum time step
|
||||
template<class TypeTag>
|
||||
struct MaxTimeStepSize<TypeTag, Properties::TTag::CuvetteBaseProblem>
|
||||
@ -305,6 +297,7 @@ public:
|
||||
|
||||
Parameters::SetDefault<Parameters::GridFile>("./data/cuvette_11x4.dgf");
|
||||
Parameters::SetDefault<Parameters::EndTime<Scalar>>(100.0);
|
||||
Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(1.0);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -115,14 +115,6 @@ template<class TypeTag>
|
||||
struct EnableGravity<TypeTag, Properties::TTag::DiffusionBaseProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
// The default for the initial time step size of the simulation
|
||||
template<class TypeTag>
|
||||
struct InitialTimeStepSize<TypeTag, Properties::TTag::DiffusionBaseProblem>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 1000;
|
||||
};
|
||||
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
namespace Opm {
|
||||
@ -220,6 +212,7 @@ public:
|
||||
}
|
||||
|
||||
Parameters::SetDefault<Parameters::EndTime<Scalar>>(1e6);
|
||||
Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(1000);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -136,14 +136,6 @@ template<class TypeTag>
|
||||
struct EnableGravity<TypeTag, Properties::TTag::FingerBaseProblem>
|
||||
{ static constexpr bool value = true; };
|
||||
|
||||
// The default for the initial time step size of the simulation
|
||||
template<class TypeTag>
|
||||
struct InitialTimeStepSize<TypeTag, Properties::TTag::FingerBaseProblem>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 10;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct InitialWaterSaturation<TypeTag, Properties::TTag::FingerBaseProblem>
|
||||
{
|
||||
@ -290,6 +282,7 @@ public:
|
||||
Parameters::SetDefault<Parameters::NumericDifferenceMethod>(+1);
|
||||
|
||||
Parameters::SetDefault<Parameters::EndTime<Scalar>>(215);
|
||||
Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(10);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -165,14 +165,6 @@ template<class TypeTag>
|
||||
struct EnableGravity<TypeTag, Properties::TTag::FractureProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
// Set the default value for the initial time step size
|
||||
template<class TypeTag>
|
||||
struct InitialTimeStepSize<TypeTag, Properties::TTag::FractureProblem>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 100;
|
||||
};
|
||||
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
namespace Opm {
|
||||
@ -306,6 +298,7 @@ public:
|
||||
|
||||
Parameters::SetDefault<Parameters::GridFile>("data/fracture.art.dgf");
|
||||
Parameters::SetDefault<Parameters::EndTime<Scalar>>(3e3);
|
||||
Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(100);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -117,14 +117,6 @@ template<class TypeTag>
|
||||
struct EnableGravity<TypeTag, Properties::TTag::GroundWaterBaseProblem>
|
||||
{ static constexpr bool value = true; };
|
||||
|
||||
// The default for the initial time step size of the simulation
|
||||
template<class TypeTag>
|
||||
struct InitialTimeStepSize<TypeTag, Properties::TTag::GroundWaterBaseProblem>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 1;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct LensLowerLeftX<TypeTag, Properties::TTag::GroundWaterBaseProblem>
|
||||
{
|
||||
@ -296,6 +288,7 @@ public:
|
||||
|
||||
Parameters::SetDefault<Parameters::GridFile>("./data/groundwater_2d.dgf");
|
||||
Parameters::SetDefault<Parameters::EndTime<Scalar>>(1.0);
|
||||
Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(1.0);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -97,14 +97,6 @@ template<class TypeTag>
|
||||
struct EnableGravity<TypeTag, Properties::TTag::InfiltrationBaseProblem>
|
||||
{ static constexpr bool value = true; };
|
||||
|
||||
// The default for the initial time step size of the simulation
|
||||
template<class TypeTag>
|
||||
struct InitialTimeStepSize<TypeTag, Properties::TTag::InfiltrationBaseProblem>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 60;
|
||||
};
|
||||
|
||||
// Write newton convergence?
|
||||
template<class TypeTag>
|
||||
struct NewtonWriteConvergence<TypeTag, Properties::TTag::InfiltrationBaseProblem>
|
||||
@ -236,6 +228,7 @@ public:
|
||||
Parameters::SetDefault<Parameters::GridFile>("./data/infiltration_50x3.dgf");
|
||||
Parameters::SetDefault<Parameters::NumericDifferenceMethod>(1);
|
||||
Parameters::SetDefault<Parameters::EndTime<Scalar>>(6e3);
|
||||
Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(60.0);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -153,14 +153,6 @@ template<class TypeTag>
|
||||
struct EnableStorageCache<TypeTag, Properties::TTag::LensBaseProblem>
|
||||
{ static constexpr bool value = true; };
|
||||
|
||||
// The default for the initial time step size of the simulation
|
||||
template<class TypeTag>
|
||||
struct InitialTimeStepSize<TypeTag, Properties::TTag::LensBaseProblem>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 250;
|
||||
};
|
||||
|
||||
// define the properties specific for the lens problem
|
||||
template<class TypeTag>
|
||||
struct LensLowerLeftX<TypeTag, Properties::TTag::LensBaseProblem>
|
||||
@ -372,6 +364,7 @@ public:
|
||||
}
|
||||
|
||||
Parameters::SetDefault<Parameters::EndTime<Scalar>>(30e3);
|
||||
Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(250.0);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -120,14 +120,6 @@ template<class TypeTag>
|
||||
struct EnableGravity<TypeTag, Properties::TTag::ObstacleBaseProblem>
|
||||
{ static constexpr bool value = true; };
|
||||
|
||||
// The default for the initial time step size of the simulation
|
||||
template<class TypeTag>
|
||||
struct InitialTimeStepSize<TypeTag, Properties::TTag::ObstacleBaseProblem>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 250;
|
||||
};
|
||||
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
namespace Opm {
|
||||
@ -275,6 +267,7 @@ public:
|
||||
|
||||
Parameters::SetDefault<Parameters::GridFile>("./data/obstacle_24x16.dgf");
|
||||
Parameters::SetDefault<Parameters::EndTime<Scalar>>(1e4);
|
||||
Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(250);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -81,14 +81,6 @@ template<class TypeTag>
|
||||
struct EnableGravity<TypeTag, Properties::TTag::OutflowBaseProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
// The default for the initial time step size of the simulation
|
||||
template<class TypeTag>
|
||||
struct InitialTimeStepSize<TypeTag, Properties::TTag::OutflowBaseProblem>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 1;
|
||||
};
|
||||
|
||||
// Also write mass fractions to the output
|
||||
template<class TypeTag>
|
||||
struct VtkWriteMassFractions<TypeTag, Properties::TTag::OutflowBaseProblem>
|
||||
@ -183,6 +175,7 @@ public:
|
||||
|
||||
Parameters::SetDefault<Parameters::GridFile>("./data/outflow.dgf");
|
||||
Parameters::SetDefault<Parameters::EndTime<Scalar>>(100.0);
|
||||
Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(1.0);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -128,14 +128,6 @@ template<class TypeTag>
|
||||
struct EnableGravity<TypeTag, Properties::TTag::PowerInjectionBaseProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
// The default for the initial time step size of the simulation
|
||||
template<class TypeTag>
|
||||
struct InitialTimeStepSize<TypeTag, Properties::TTag::PowerInjectionBaseProblem>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 1e-3;
|
||||
};
|
||||
|
||||
// Write out the filter velocities for this problem
|
||||
template<class TypeTag>
|
||||
struct VtkWriteFilterVelocities<TypeTag, Properties::TTag::PowerInjectionBaseProblem>
|
||||
@ -248,6 +240,7 @@ public:
|
||||
}
|
||||
|
||||
Parameters::SetDefault<Parameters::EndTime<Scalar>>(100.0);
|
||||
Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(1e-3);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -139,14 +139,6 @@ template<class TypeTag>
|
||||
struct EnableGravity<TypeTag, Properties::TTag::ReservoirBaseProblem>
|
||||
{ static constexpr bool value = true; };
|
||||
|
||||
// The default for the initial time step size of the simulation [s]
|
||||
template<class TypeTag>
|
||||
struct InitialTimeStepSize<TypeTag, Properties::TTag::ReservoirBaseProblem>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 100e3;
|
||||
};
|
||||
|
||||
// set the defaults for some problem specific properties
|
||||
template<class TypeTag>
|
||||
struct MaxDepth<TypeTag, Properties::TTag::ReservoirBaseProblem>
|
||||
@ -439,6 +431,9 @@ public:
|
||||
//! By default this problem spans 1000 days (100 "settle down" days and 900 days of
|
||||
//! production)
|
||||
Parameters::SetDefault<Parameters::EndTime<Scalar>>(1000.0*24*60*60);
|
||||
|
||||
Parameters::SetDefault<Parameters::GridFile>("data/reservoir.dgf");
|
||||
Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(100e3);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -108,14 +108,6 @@ template<class TypeTag>
|
||||
struct EnableGravity<TypeTag, Properties::TTag::RichardsLensProblem>
|
||||
{ static constexpr bool value = true; };
|
||||
|
||||
// The default for the initial time step size of the simulation
|
||||
template<class TypeTag>
|
||||
struct InitialTimeStepSize<TypeTag, Properties::TTag::RichardsLensProblem>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 100;
|
||||
};
|
||||
|
||||
// Do not write the intermediate results of the newton method
|
||||
template<class TypeTag>
|
||||
struct NewtonWriteConvergence<TypeTag, Properties::TTag::RichardsLensProblem>
|
||||
@ -266,6 +258,7 @@ public:
|
||||
}
|
||||
|
||||
Parameters::SetDefault<Parameters::EndTime<Scalar>>(3000.0);
|
||||
Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(100.0);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -140,14 +140,6 @@ template<class TypeTag>
|
||||
struct EnableGravity<TypeTag, Properties::TTag::WaterAirBaseProblem>
|
||||
{ static constexpr bool value = true; };
|
||||
|
||||
// The default for the initial time step size of the simulation
|
||||
template<class TypeTag>
|
||||
struct InitialTimeStepSize<TypeTag, Properties::TTag::WaterAirBaseProblem>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 250;
|
||||
};
|
||||
|
||||
// Write newton convergence
|
||||
template<class TypeTag>
|
||||
struct NewtonWriteConvergence<TypeTag, Properties::TTag::WaterAirBaseProblem>
|
||||
@ -310,6 +302,7 @@ public:
|
||||
Parameters::SetDefault<Parameters::NumericDifferenceMethod>(+1);
|
||||
|
||||
Parameters::SetDefault<Parameters::EndTime<Scalar>>(1.0 * 365 * 24 * 60 * 60);
|
||||
Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(250.0);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -129,14 +129,6 @@ template<class TypeTag>
|
||||
struct EnableGravity<TypeTag, Properties::TTag::Tutorial1Problem>
|
||||
{ static constexpr bool value = false; }; /*@\label{tutorial1:gravity}@*/
|
||||
|
||||
// define the size of the initial time step [s]
|
||||
template<class TypeTag>
|
||||
struct InitialTimeStepSize<TypeTag, Properties::TTag::Tutorial1Problem>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 125.0;
|
||||
};
|
||||
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
namespace Opm {
|
||||
@ -225,6 +217,7 @@ public:
|
||||
}
|
||||
|
||||
Parameters::SetDefault<Parameters::EndTime<Scalar>>(100e3);
|
||||
Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(125.0);
|
||||
}
|
||||
|
||||
//! Specifies the problem name. This is used for files generated by the simulation.
|
||||
|
@ -28,8 +28,6 @@
|
||||
#ifndef EWOMS_BASIC_PARAMETERS_HH
|
||||
#define EWOMS_BASIC_PARAMETERS_HH
|
||||
|
||||
#include <opm/models/utils/propertysystem.hh>
|
||||
|
||||
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<class TypeTag, class MyTypeTag>
|
||||
struct InitialTimeStepSize { using type = Properties::UndefinedProperty; };
|
||||
template<class Scalar>
|
||||
struct InitialTimeStepSize { static constexpr Scalar value = -1e35; };
|
||||
|
||||
//! Set a value for the ParameterFile property
|
||||
struct ParameterFile { static constexpr auto value = ""; };
|
||||
|
@ -177,16 +177,4 @@ struct Vanguard<TypeTag, TTag::NumericModel>
|
||||
|
||||
} // namespace Opm::Properties
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
//! The default value for the simulation's initial time step size
|
||||
template<class TypeTag>
|
||||
struct InitialTimeStepSize<TypeTag, Properties::TTag::NumericModel>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = -1e35;
|
||||
};
|
||||
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
#endif
|
||||
|
@ -130,7 +130,7 @@ public:
|
||||
startTime_ = 0.0;
|
||||
time_ = 0.0;
|
||||
endTime_ = Parameters::Get<Parameters::EndTime<Scalar>>();
|
||||
timeStepSize_ = Parameters::get<TypeTag, Parameters::InitialTimeStepSize>();
|
||||
timeStepSize_ = Parameters::Get<Parameters::InitialTimeStepSize<Scalar>>();
|
||||
assert(timeStepSize_ > 0);
|
||||
const std::string& predetTimeStepFile =
|
||||
Parameters::Get<Parameters::PredeterminedTimeStepsFile>();
|
||||
@ -256,7 +256,7 @@ public:
|
||||
{
|
||||
Parameters::Register<Parameters::EndTime<Scalar>>
|
||||
("The simulation time at which the simulation is finished [s]");
|
||||
Parameters::registerParam<TypeTag, Parameters::InitialTimeStepSize>
|
||||
Parameters::Register<Parameters::InitialTimeStepSize<Scalar>>
|
||||
("The size of the initial time step [s]");
|
||||
Parameters::Register<Parameters::RestartTime<Scalar>>
|
||||
("The simulation time at which a restart should be attempted [s]");
|
||||
|
@ -323,7 +323,7 @@ static inline int start(int argc, char **argv, bool registerParams=true)
|
||||
return 1;
|
||||
}
|
||||
|
||||
Scalar initialTimeStepSize = Parameters::get<TypeTag, Parameters::InitialTimeStepSize>();
|
||||
Scalar initialTimeStepSize = Parameters::Get<Parameters::InitialTimeStepSize<Scalar>>();
|
||||
if (initialTimeStepSize < -1e50) {
|
||||
if (myRank == 0)
|
||||
Parameters::printUsage(argv[0],
|
||||
|
Loading…
Reference in New Issue
Block a user