changed: move the InitialTimeStepSize parameter to Opm::Parameters

This commit is contained in:
Arne Morten Kvarving
2024-07-01 10:20:05 +02:00
parent 7101b68989
commit 65fa0fae9e
20 changed files with 155 additions and 152 deletions

View File

@@ -206,14 +206,6 @@ struct Temperature<TypeTag, TTag::Co2InjectionBaseProblem>
template<class TypeTag>
struct SimulationName<TypeTag, TTag::Co2InjectionBaseProblem> { static constexpr auto value = "co2injection"; };
// The default for the initial time step size of the simulation
template<class TypeTag>
struct InitialTimeStepSize<TypeTag, TTag::Co2InjectionBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 250;
};
// The default DGF file to load
template<class TypeTag>
struct GridFile<TypeTag, TTag::Co2InjectionBaseProblem> { static constexpr auto value = "data/co2injection.dgf"; };
@@ -230,6 +222,14 @@ struct EndTime<TypeTag, Properties::TTag::Co2InjectionBaseProblem>
static constexpr type value = 1e4;
};
// 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;
};
// Write the Newton convergence behavior to disk?
template<class TypeTag>
struct NewtonWriteConvergence<TypeTag, Properties::TTag::Co2InjectionBaseProblem>

View File

@@ -163,13 +163,6 @@ struct SimulationName<TypeTag, TTag::CO2PTBaseProblem> {
static constexpr auto value = "co2_ptflash";
};
// convergence control
template <class TypeTag>
struct InitialTimeStepSize<TypeTag, TTag::CO2PTBaseProblem> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 0.1 * 60. * 60.;
};
template <class TypeTag>
struct LinearSolverTolerance<TypeTag, TTag::CO2PTBaseProblem> {
using type = GetPropType<TypeTag, Scalar>;
@@ -272,11 +265,20 @@ namespace Opm::Parameters {
// The default for the end time of the simulation
template <class TypeTag>
struct EndTime<TypeTag, Properties::TTag::CO2PTBaseProblem> {
struct EndTime<TypeTag, Properties::TTag::CO2PTBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 60. * 60.;
};
// 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.;
};
// Write the Newton convergence behavior to disk?
template <class TypeTag>
struct NewtonWriteConvergence<TypeTag, Properties::TTag::CO2PTBaseProblem>

View File

@@ -116,14 +116,6 @@ public:
using type = Opm::SomertonThermalConductionLaw<FluidSystem, Scalar>;
};
// The default for the initial time step size of the simulation
template<class TypeTag>
struct InitialTimeStepSize<TypeTag, TTag::CuvetteBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 1;
};
// The default DGF file to load
template<class TypeTag>
struct GridFile<TypeTag, TTag::CuvetteBaseProblem> { static constexpr auto value = "./data/cuvette_11x4.dgf"; };
@@ -140,6 +132,14 @@ struct EndTime<TypeTag, Properties::TTag::CuvetteBaseProblem>
static constexpr type value = 180;
};
// 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>

View File

@@ -137,14 +137,6 @@ struct CellsY<TypeTag, TTag::DiffusionBaseProblem> { static constexpr unsigned v
template<class TypeTag>
struct CellsZ<TypeTag, TTag::DiffusionBaseProblem> { static constexpr unsigned value = 1; };
// The default for the initial time step size of the simulation
template<class TypeTag>
struct InitialTimeStepSize<TypeTag, TTag::DiffusionBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 1000;
};
} // namespace Opm::Properties
namespace Opm::Parameters {
@@ -157,6 +149,14 @@ struct EndTime<TypeTag, Properties::TTag::DiffusionBaseProblem>
static constexpr type value = 1e6;
};
// 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 {

View File

@@ -170,14 +170,6 @@ struct CellsY<TypeTag, TTag::FingerBaseProblem> { static constexpr unsigned valu
template<class TypeTag>
struct CellsZ<TypeTag, TTag::FingerBaseProblem> { static constexpr unsigned value = 1; };
// The default for the initial time step size of the simulation
template<class TypeTag>
struct InitialTimeStepSize<TypeTag, TTag::FingerBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 10;
};
} // namespace Opm::Properties
namespace Opm::Parameters {
@@ -190,6 +182,14 @@ struct EndTime<TypeTag, Properties::TTag::FingerBaseProblem>
static constexpr type value = 215;
};
// 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;
};
// Write the solutions of individual newton iterations?
template<class TypeTag>
struct NewtonWriteConvergence<TypeTag, Properties::TTag::FingerBaseProblem>

View File

@@ -164,14 +164,6 @@ struct EnableConstraints<TypeTag, TTag::FractureProblem> { static constexpr bool
template<class TypeTag>
struct GridFile<TypeTag, TTag::FractureProblem> { static constexpr auto value = "data/fracture.art.dgf"; };
// Set the default value for the initial time step size
template<class TypeTag>
struct InitialTimeStepSize<TypeTag, TTag::FractureProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 100;
};
} // namespace Opm::Properties
namespace Opm::Parameters {
@@ -184,6 +176,14 @@ struct EndTime<TypeTag, Properties::TTag::FractureProblem>
static constexpr type value = 3e3;
};
// 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 {

View File

@@ -145,14 +145,6 @@ struct PermeabilityLens<TypeTag, TTag::GroundWaterBaseProblem>
template<class TypeTag>
struct EnableGravity<TypeTag, TTag::GroundWaterBaseProblem> { static constexpr bool value = true; };
// The default for the initial time step size of the simulation
template<class TypeTag>
struct InitialTimeStepSize<TypeTag, TTag::GroundWaterBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 1;
};
// The default DGF file to load
template<class TypeTag>
struct GridFile<TypeTag, TTag::GroundWaterBaseProblem> { static constexpr auto value = "./data/groundwater_2d.dgf"; };
@@ -178,6 +170,14 @@ struct EndTime<TypeTag, Properties::TTag::GroundWaterBaseProblem>
static constexpr type value = 1;
};
// 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;
};
} // namespace Opm::Parameters
namespace Opm {

View File

@@ -96,14 +96,6 @@ public:
using type = Opm::ThreePhaseParkerVanGenuchten<Traits>;
};
// The default for the initial time step size of the simulation
template<class TypeTag>
struct InitialTimeStepSize<TypeTag, TTag::InfiltrationBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 60;
};
// The default DGF file to load
template<class TypeTag>
struct GridFile<TypeTag, TTag::InfiltrationBaseProblem>
@@ -121,6 +113,14 @@ struct EndTime<TypeTag, Properties::TTag::InfiltrationBaseProblem>
static constexpr type value = 6e3;
};
// 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>

View File

@@ -201,14 +201,6 @@ struct CellsY<TypeTag, TTag::LensBaseProblem> { static constexpr unsigned value
template<class TypeTag>
struct CellsZ<TypeTag, TTag::LensBaseProblem> { static constexpr unsigned value = 16; };
// The default for the initial time step size of the simulation
template<class TypeTag>
struct InitialTimeStepSize<TypeTag, TTag::LensBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 250;
};
// By default, include the intrinsic permeability tensor to the VTK output files
template<class TypeTag>
struct VtkWriteIntrinsicPermeabilities<TypeTag, TTag::LensBaseProblem> { static constexpr bool value = true; };
@@ -235,6 +227,14 @@ struct EndTime<TypeTag, Properties::TTag::LensBaseProblem>
static constexpr type value = 30e3;
};
// 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;
};
// Write the solutions of individual newton iterations?
template<class TypeTag>
struct NewtonWriteConvergence<TypeTag, Properties::TTag::LensBaseProblem>

View File

@@ -115,14 +115,6 @@ struct SolidEnergyLaw<TypeTag, TTag::ObstacleBaseProblem>
template<class TypeTag>
struct EnableGravity<TypeTag, TTag::ObstacleBaseProblem> { static constexpr bool value = true; };
// The default for the initial time step size of the simulation
template<class TypeTag>
struct InitialTimeStepSize<TypeTag, TTag::ObstacleBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 250;
};
// The default DGF file to load
template<class TypeTag>
struct GridFile<TypeTag, TTag::ObstacleBaseProblem> { static constexpr auto value = "./data/obstacle_24x16.dgf"; };
@@ -139,7 +131,15 @@ struct EndTime<TypeTag, Properties::TTag::ObstacleBaseProblem>
static constexpr type value = 1e4;
};
}
// 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 {
/*!

View File

@@ -80,14 +80,6 @@ struct EnableGravity<TypeTag, TTag::OutflowBaseProblem> { static constexpr bool
template<class TypeTag>
struct VtkWriteMassFractions<TypeTag, TTag::OutflowBaseProblem> { static constexpr bool value = true; };
// The default for the initial time step size of the simulation
template<class TypeTag>
struct InitialTimeStepSize<TypeTag, TTag::OutflowBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 1;
};
// The default DGF file to load
template<class TypeTag>
struct GridFile<TypeTag, TTag::OutflowBaseProblem> { static constexpr auto value = "./data/outflow.dgf"; };
@@ -104,6 +96,14 @@ struct EndTime<TypeTag, Properties::TTag::OutflowBaseProblem>
static constexpr type value = 100;
};
// 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;
};
} // namespac Opm::Parameters
namespace Opm {

View File

@@ -154,14 +154,6 @@ struct CellsY<TypeTag, TTag::PowerInjectionBaseProblem> { static constexpr unsig
template<class TypeTag>
struct CellsZ<TypeTag, TTag::PowerInjectionBaseProblem> { static constexpr unsigned value = 1; };
// The default for the initial time step size of the simulation
template<class TypeTag>
struct InitialTimeStepSize<TypeTag, TTag::PowerInjectionBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 1e-3;
};
} // namespace Opm::Properties
namespace Opm::Parameters {
@@ -174,6 +166,14 @@ struct EndTime<TypeTag, Properties::TTag::PowerInjectionBaseProblem>
static constexpr type value = 100;
};
// 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;
};
} // namespace Opm::Parameters
namespace Opm {

View File

@@ -28,7 +28,12 @@
#ifndef EWOMS_RESERVOIR_PROBLEM_HH
#define EWOMS_RESERVOIR_PROBLEM_HH
#include <opm/models/blackoil/blackoilproperties.hh>
#include <dune/common/version.hh>
#include <dune/common/fvector.hh>
#include <dune/common/fmatrix.hh>
#include <dune/grid/yaspgrid.hh>
#include <dune/grid/io/file/dgfparser/dgfyasp.hh>
#include <opm/material/fluidmatrixinteractions/LinearMaterial.hpp>
#include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp>
@@ -39,15 +44,11 @@
#include <opm/material/fluidsystems/blackoilpvt/LiveOilPvt.hpp>
#include <opm/material/fluidsystems/blackoilpvt/ConstantCompressibilityWaterPvt.hpp>
#include <dune/grid/yaspgrid.hh>
#include <dune/grid/io/file/dgfparser/dgfyasp.hh>
#include <opm/models/blackoil/blackoilproperties.hh>
#include <opm/models/nonlinear/newtonmethodparameters.hh>
#include <dune/common/version.hh>
#include <dune/common/fvector.hh>
#include <dune/common/fmatrix.hh>
#include <vector>
#include <string>
#include <vector>
namespace Opm {
template <class TypeTag>
@@ -122,14 +123,6 @@ struct Temperature<TypeTag, TTag::ReservoirBaseProblem>
static constexpr type value = 293.15;
};
// The default for the initial time step size of the simulation [s]
template<class TypeTag>
struct InitialTimeStepSize<TypeTag, TTag::ReservoirBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 100e3;
};
// The width of producer/injector wells as a fraction of the width of the spatial domain
template<class TypeTag>
struct WellWidth<TypeTag, TTag::ReservoirBaseProblem>
@@ -175,6 +168,14 @@ struct EndTime<TypeTag, Properties::TTag::ReservoirBaseProblem>
static constexpr type value = 1000.0*24*60*60;
};
// 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;
};
// Write the Newton convergence behavior to disk?
template<class TypeTag>
struct NewtonWriteConvergence<TypeTag, Properties::TTag::ReservoirBaseProblem>

View File

@@ -107,14 +107,6 @@ struct EnableGravity<TypeTag, TTag::RichardsLensProblem> { static constexpr bool
template<class TypeTag>
struct NumericDifferenceMethod<TypeTag, TTag::RichardsLensProblem> { static constexpr int value = 0; };
// The default for the initial time step size of the simulation
template<class TypeTag>
struct InitialTimeStepSize<TypeTag, TTag::RichardsLensProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 100;
};
// The default DGF file to load
template<class TypeTag>
struct GridFile<TypeTag, TTag::RichardsLensProblem> { static constexpr auto value = "./data/richardslens_24x16.dgf"; };
@@ -131,6 +123,14 @@ struct EndTime<TypeTag, Properties::TTag::RichardsLensProblem>
static constexpr type value = 3000;
};
// 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>

View File

@@ -123,14 +123,6 @@ struct EnableGravity<TypeTag, TTag::WaterAirBaseProblem> { static constexpr bool
template<class TypeTag>
struct NumericDifferenceMethod<TypeTag, TTag::WaterAirBaseProblem> { static constexpr int value = +1; };
// The default for the initial time step size of the simulation
template<class TypeTag>
struct InitialTimeStepSize<TypeTag, TTag::WaterAirBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 250;
};
// The default DGF file to load
template<class TypeTag>
struct GridFile<TypeTag, TTag::WaterAirBaseProblem> { static constexpr auto value = "./data/waterair.dgf"; };
@@ -162,6 +154,14 @@ struct EndTime<TypeTag, Properties::TTag::WaterAirBaseProblem>
static constexpr type value = 1.0 * 365 * 24 * 60 * 60;
};
// 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>

View File

@@ -124,14 +124,6 @@ public:
template<class TypeTag>
struct EnableGravity<TypeTag, 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, TTag::Tutorial1Problem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 125.0;
};
// define the physical size of the problem's domain [m]
template<class TypeTag>
struct DomainSizeX<TypeTag, TTag::Tutorial1Problem>
@@ -172,6 +164,14 @@ struct EndTime<TypeTag, Properties::TTag::Tutorial1Problem>
static constexpr type value = 100e3;
}; /*@\label{tutorial1:default-params-begin}@*/
// 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 {

View File

@@ -41,6 +41,10 @@ struct EndTime { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct GridGlobalRefinements { using type = Properties::UndefinedProperty; };
//! The default value for the simulation's initial time step size
template<class TypeTag, class MyTypeTag>
struct InitialTimeStepSize { using type = Properties::UndefinedProperty; };
//! Property provides the name of the file from which the additional runtime
//! parameters should to be loaded from
template<class TypeTag, class MyTypeTag>

View File

@@ -105,10 +105,6 @@ template<class TypeTag, class MyTypeTag>
struct GridPart { using type = UndefinedProperty; };
#endif
//! The default value for the simulation's initial time step size
template<class TypeTag, class MyTypeTag>
struct InitialTimeStepSize { using type = UndefinedProperty; };
//! The default value for the simulation's restart time
template<class TypeTag, class MyTypeTag>
struct RestartTime { using type = UndefinedProperty; };
@@ -202,14 +198,6 @@ template<class TypeTag>
struct GridView<TypeTag, TTag::NumericModel> { using type = typename GetPropType<TypeTag, Properties::Grid>::LeafGridView; };
#endif
//! The default value for the simulation's initial time step size
template<class TypeTag>
struct InitialTimeStepSize<TypeTag, TTag::NumericModel>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = -1e35;
};
//! The default value for the simulation's restart time
template<class TypeTag>
struct RestartTime<TypeTag, TTag::NumericModel>
@@ -243,6 +231,14 @@ template<class TypeTag>
struct GridGlobalRefinements<TypeTag, Properties::TTag::NumericModel>
{ static constexpr unsigned value = 0; };
//! 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;
};
//! Set a value for the ParameterFile property
template<class TypeTag>
struct ParameterFile<TypeTag, Properties::TTag::NumericModel>

View File

@@ -130,7 +130,7 @@ public:
startTime_ = 0.0;
time_ = 0.0;
endTime_ = Parameters::get<TypeTag, Parameters::EndTime>();
timeStepSize_ = Parameters::get<TypeTag, Properties::InitialTimeStepSize>();
timeStepSize_ = Parameters::get<TypeTag, Parameters::InitialTimeStepSize>();
assert(timeStepSize_ > 0);
const std::string& predetTimeStepFile =
Parameters::get<TypeTag, Properties::PredeterminedTimeStepsFile>();
@@ -256,7 +256,7 @@ public:
{
Parameters::registerParam<TypeTag, Parameters::EndTime>
("The simulation time at which the simulation is finished [s]");
Parameters::registerParam<TypeTag, Properties::InitialTimeStepSize>
Parameters::registerParam<TypeTag, Parameters::InitialTimeStepSize>
("The size of the initial time step [s]");
Parameters::registerParam<TypeTag, Properties::RestartTime>
("The simulation time at which a restart should be attempted [s]");

View File

@@ -326,7 +326,7 @@ static inline int start(int argc, char **argv, bool registerParams=true)
return 1;
}
Scalar initialTimeStepSize = Parameters::get<TypeTag, Properties::InitialTimeStepSize>();
Scalar initialTimeStepSize = Parameters::get<TypeTag, Parameters::InitialTimeStepSize>();
if (initialTimeStepSize < -1e50) {
if (myRank == 0)
Parameters::printUsage<TypeTag>(argv[0],