mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
changed: move the MaxTimeStepSize parameter to Opm::Parameters
This commit is contained in:
@@ -80,14 +80,6 @@ struct FluidSystem<TypeTag, TTag::CuvetteBaseProblem>
|
|||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct EnableGravity<TypeTag, TTag::CuvetteBaseProblem> { static constexpr bool value = true; };
|
struct EnableGravity<TypeTag, TTag::CuvetteBaseProblem> { static constexpr bool value = true; };
|
||||||
|
|
||||||
// Set the maximum time step
|
|
||||||
template<class TypeTag>
|
|
||||||
struct MaxTimeStepSize<TypeTag, TTag::CuvetteBaseProblem>
|
|
||||||
{
|
|
||||||
using type = GetPropType<TypeTag, Scalar>;
|
|
||||||
static constexpr type value = 600.;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Set the material Law
|
// Set the material Law
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct MaterialLaw<TypeTag, TTag::CuvetteBaseProblem>
|
struct MaterialLaw<TypeTag, TTag::CuvetteBaseProblem>
|
||||||
@@ -146,6 +138,18 @@ struct GridFile<TypeTag, TTag::CuvetteBaseProblem> { static constexpr auto value
|
|||||||
|
|
||||||
} // namespace Opm::Properties
|
} // namespace Opm::Properties
|
||||||
|
|
||||||
|
namespace Opm::Parameters {
|
||||||
|
|
||||||
|
// Set the maximum time step
|
||||||
|
template<class TypeTag>
|
||||||
|
struct MaxTimeStepSize<TypeTag, Properties::TTag::CuvetteBaseProblem>
|
||||||
|
{
|
||||||
|
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||||
|
static constexpr type value = 600.;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Opm::Parameters
|
||||||
|
|
||||||
namespace Opm {
|
namespace Opm {
|
||||||
/*!
|
/*!
|
||||||
* \ingroup TestProblems
|
* \ingroup TestProblems
|
||||||
|
|||||||
@@ -221,14 +221,6 @@ struct UseLinearizationLock<TypeTag, TTag::FvBaseDiscretization> { static conste
|
|||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct Linearizer<TypeTag, TTag::FvBaseDiscretization> { using type = FvBaseLinearizer<TypeTag>; };
|
struct Linearizer<TypeTag, TTag::FvBaseDiscretization> { using type = FvBaseLinearizer<TypeTag>; };
|
||||||
|
|
||||||
//! use an unlimited time step size by default
|
|
||||||
template<class TypeTag>
|
|
||||||
struct MaxTimeStepSize<TypeTag, TTag::FvBaseDiscretization>
|
|
||||||
{
|
|
||||||
using type = GetPropType<TypeTag, Scalar>;
|
|
||||||
static constexpr type value = std::numeric_limits<type>::infinity();
|
|
||||||
};
|
|
||||||
|
|
||||||
//! By default, accept any time step larger than zero
|
//! By default, accept any time step larger than zero
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct MinTimeStepSize<TypeTag, TTag::FvBaseDiscretization>
|
struct MinTimeStepSize<TypeTag, TTag::FvBaseDiscretization>
|
||||||
@@ -345,6 +337,14 @@ template<class TypeTag>
|
|||||||
struct EnableAsyncVtkOutput<TypeTag, Properties::TTag::FvBaseDiscretization>
|
struct EnableAsyncVtkOutput<TypeTag, Properties::TTag::FvBaseDiscretization>
|
||||||
{ static constexpr bool value = true; };
|
{ static constexpr bool value = true; };
|
||||||
|
|
||||||
|
//! use an unlimited time step size by default
|
||||||
|
template<class TypeTag>
|
||||||
|
struct MaxTimeStepSize<TypeTag, Properties::TTag::FvBaseDiscretization>
|
||||||
|
{
|
||||||
|
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||||
|
static constexpr type value = std::numeric_limits<type>::infinity();
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace Opm::Parameters
|
} // namespace Opm::Parameters
|
||||||
|
|
||||||
namespace Opm {
|
namespace Opm {
|
||||||
|
|||||||
@@ -73,6 +73,14 @@ struct EnableVtkOutput { using type = Properties::UndefinedProperty; };
|
|||||||
template<class TypeTag, class MyTypeTag>
|
template<class TypeTag, class MyTypeTag>
|
||||||
struct EnableAsyncVtkOutput { using type = Properties::UndefinedProperty; };
|
struct EnableAsyncVtkOutput { using type = Properties::UndefinedProperty; };
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Specify the maximum size of a time integration [s].
|
||||||
|
*
|
||||||
|
* The default is to not limit the step size.
|
||||||
|
*/
|
||||||
|
template<class TypeTag, class MyTypeTag>
|
||||||
|
struct MaxTimeStepSize { using type = Properties::UndefinedProperty; };
|
||||||
|
|
||||||
} // namespace Opm::Parameters
|
} // namespace Opm::Parameters
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ public:
|
|||||||
static void registerParameters()
|
static void registerParameters()
|
||||||
{
|
{
|
||||||
Model::registerParameters();
|
Model::registerParameters();
|
||||||
Parameters::registerParam<TypeTag, Properties::MaxTimeStepSize>
|
Parameters::registerParam<TypeTag, Parameters::MaxTimeStepSize>
|
||||||
("The maximum size to which all time steps are limited to [s]");
|
("The maximum size to which all time steps are limited to [s]");
|
||||||
Parameters::registerParam<TypeTag, Properties::MinTimeStepSize>
|
Parameters::registerParam<TypeTag, Properties::MinTimeStepSize>
|
||||||
("The minimum size to which all time steps are limited to [s]");
|
("The minimum size to which all time steps are limited to [s]");
|
||||||
@@ -593,7 +593,7 @@ public:
|
|||||||
if (nextTimeStepSize_ > 0.0)
|
if (nextTimeStepSize_ > 0.0)
|
||||||
return nextTimeStepSize_;
|
return nextTimeStepSize_;
|
||||||
|
|
||||||
Scalar dtNext = std::min(Parameters::get<TypeTag, Properties::MaxTimeStepSize>(),
|
Scalar dtNext = std::min(Parameters::get<TypeTag, Parameters::MaxTimeStepSize>(),
|
||||||
newtonMethod().suggestTimeStepSize(simulator().timeStepSize()));
|
newtonMethod().suggestTimeStepSize(simulator().timeStepSize()));
|
||||||
|
|
||||||
if (dtNext < simulator().maxTimeStepSize()
|
if (dtNext < simulator().maxTimeStepSize()
|
||||||
|
|||||||
@@ -215,14 +215,6 @@ struct VtkOutputFormat { using type = UndefinedProperty; };
|
|||||||
template<class TypeTag, class MyTypeTag>
|
template<class TypeTag, class MyTypeTag>
|
||||||
struct EnableConstraints { using type = UndefinedProperty; };
|
struct EnableConstraints { using type = UndefinedProperty; };
|
||||||
|
|
||||||
/*!
|
|
||||||
* \brief Specify the maximum size of a time integration [s].
|
|
||||||
*
|
|
||||||
* The default is to not limit the step size.
|
|
||||||
*/
|
|
||||||
template<class TypeTag, class MyTypeTag>
|
|
||||||
struct MaxTimeStepSize { using type = UndefinedProperty; };
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Specify the minimal size of a time integration [s].
|
* \brief Specify the minimal size of a time integration [s].
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user