Merge pull request #906 from akva2/basicproperties_split_param

basicproperties: split out params
This commit is contained in:
Bård Skaflestad 2024-07-01 20:11:47 +02:00 committed by GitHub
commit db0b4e1e6d
23 changed files with 589 additions and 495 deletions

View File

@ -206,29 +206,30 @@ struct Temperature<TypeTag, TTag::Co2InjectionBaseProblem>
template<class TypeTag>
struct SimulationName<TypeTag, TTag::Co2InjectionBaseProblem> { static constexpr auto value = "co2injection"; };
} // namespace Opm::Properties
namespace Opm::Parameters {
// The default for the end time of the simulation
template<class TypeTag>
struct EndTime<TypeTag, TTag::Co2InjectionBaseProblem>
struct EndTime<TypeTag, Properties::TTag::Co2InjectionBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e4;
};
// 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"; };
struct GridFile<TypeTag, Properties::TTag::Co2InjectionBaseProblem>
{ static constexpr auto value = "data/co2injection.dgf"; };
} // namespace Opm::Properties
namespace Opm::Parameters {
// 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>

View File

@ -53,7 +53,6 @@
#include <dune/common/fmatrix.hh>
#include <sstream>
#include <iostream>
#include <string>
namespace Opm {
@ -163,20 +162,6 @@ struct SimulationName<TypeTag, TTag::CO2PTBaseProblem> {
static constexpr auto value = "co2_ptflash";
};
// The default for the end time of the simulation
template <class TypeTag>
struct EndTime<TypeTag, TTag::CO2PTBaseProblem> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 60. * 60.;
};
// 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>;
@ -238,36 +223,6 @@ struct Vanguard<TypeTag, TTag::CO2PTBaseProblem> {
using type = Opm::StructuredGridVanguard<TypeTag>;
};
//\Note: from the Julia code, the problem is a 1D problem with 3X1 cell.
//\Note: DomainSizeX is 3.0 meters
//\Note: DomainSizeY is 1.0 meters
template <class TypeTag>
struct DomainSizeX<TypeTag, TTag::CO2PTBaseProblem> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 300; // meter
};
template <class TypeTag>
struct DomainSizeY<TypeTag, TTag::CO2PTBaseProblem> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 1.0;
};
// DomainSizeZ is not needed, while to keep structuredgridvanguard.hh compile
template <class TypeTag>
struct DomainSizeZ<TypeTag, TTag::CO2PTBaseProblem> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 1.0;
};
template<class TypeTag>
struct CellsX<TypeTag, TTag::CO2PTBaseProblem> { static constexpr unsigned value = 30; };
template<class TypeTag>
struct CellsY<TypeTag, TTag::CO2PTBaseProblem> { static constexpr unsigned value = 1; };
// CellsZ is not needed, while to keep structuredgridvanguard.hh compile
template<class TypeTag>
struct CellsZ<TypeTag, TTag::CO2PTBaseProblem> { static constexpr unsigned value = 1; };
template <class TypeTag>
struct EnableEnergy<TypeTag, TTag::CO2PTBaseProblem> {
static constexpr bool value = false;
@ -277,6 +232,60 @@ struct EnableEnergy<TypeTag, TTag::CO2PTBaseProblem> {
namespace Opm::Parameters {
template<class TypeTag>
struct CellsX<TypeTag, Properties::TTag::CO2PTBaseProblem>
{ static constexpr unsigned value = 30; };
template<class TypeTag>
struct CellsY<TypeTag, Properties::TTag::CO2PTBaseProblem>
{ static constexpr unsigned value = 1; };
// CellsZ is not needed, while to keep structuredgridvanguard.hh compile
template<class TypeTag>
struct CellsZ<TypeTag, Properties::TTag::CO2PTBaseProblem>
{ static constexpr unsigned value = 1; };
//\Note: from the Julia code, the problem is a 1D problem with 3X1 cell.
//\Note: DomainSizeX is 3.0 meters
//\Note: DomainSizeY is 1.0 meters
template <class TypeTag>
struct DomainSizeX<TypeTag, Properties::TTag::CO2PTBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 300; // meter
};
template <class TypeTag>
struct DomainSizeY<TypeTag, Properties::TTag::CO2PTBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1.0;
};
// DomainSizeZ is not needed, while to keep structuredgridvanguard.hh compile
template <class TypeTag>
struct DomainSizeZ<TypeTag, Properties::TTag::CO2PTBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1.0;
};
// The default for the end time of the simulation
template <class TypeTag>
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>
@ -508,7 +517,7 @@ public:
{
int spatialIdx = context.globalSpaceIndex(spaceIdx, timeIdx);
int inj = 0;
int prod = Parameters::get<TypeTag, Properties::CellsX>() - 1;
int prod = Parameters::get<TypeTag, Parameters::CellsX>() - 1;
if (spatialIdx == inj || spatialIdx == prod) {
return 1.0;
} else {
@ -516,7 +525,7 @@ public:
}
}
/*!
/*!
* \copydoc FvBaseMultiPhaseProblem::materialLawParams
*/
template <class Context>
@ -559,7 +568,7 @@ private:
// p0 = 75e5
// T0 = 423.25
int inj = 0;
int prod = Parameters::get<TypeTag, Properties::CellsX>() - 1;
int prod = Parameters::get<TypeTag, Parameters::CellsX>() - 1;
int spatialIdx = context.globalSpaceIndex(spaceIdx, timeIdx);
ComponentVector comp;
comp[0] = Evaluation::createVariable(0.5, 1);

View File

@ -116,29 +116,30 @@ public:
using type = Opm::SomertonThermalConductionLaw<FluidSystem, Scalar>;
};
} // namespace Opm::Properties
namespace Opm::Parameters {
// The default for the end time of the simulation
template<class TypeTag>
struct EndTime<TypeTag, TTag::CuvetteBaseProblem>
struct EndTime<TypeTag, Properties::TTag::CuvetteBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 180;
};
// 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"; };
struct GridFile<TypeTag, Properties::TTag::CuvetteBaseProblem>
{ static constexpr auto value = "./data/cuvette_11x4.dgf"; };
} // namespace Opm::Properties
namespace Opm::Parameters {
// 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>

View File

@ -110,50 +110,61 @@ struct EnableDiffusion<TypeTag, TTag::DiffusionBaseProblem> { static constexpr b
template<class TypeTag>
struct EnableGravity<TypeTag, TTag::DiffusionBaseProblem> { static constexpr bool value = false; };
} // namespace Opm::Properties
namespace Opm::Parameters {
template<class TypeTag>
struct CellsX<TypeTag, Properties::TTag::DiffusionBaseProblem>
{ static constexpr unsigned value = 250; };
template<class TypeTag>
struct CellsY<TypeTag, Properties::TTag::DiffusionBaseProblem>
{ static constexpr unsigned value = 1; };
template<class TypeTag>
struct CellsZ<TypeTag, Properties::TTag::DiffusionBaseProblem>
{ static constexpr unsigned value = 1; };
// define the properties specific for the diffusion problem
template<class TypeTag>
struct DomainSizeX<TypeTag, TTag::DiffusionBaseProblem>
struct DomainSizeX<TypeTag, Properties::TTag::DiffusionBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 1.0;
};
template<class TypeTag>
struct DomainSizeY<TypeTag, TTag::DiffusionBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 1.0;
};
template<class TypeTag>
struct DomainSizeZ<TypeTag, TTag::DiffusionBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1.0;
};
template<class TypeTag>
struct CellsX<TypeTag, TTag::DiffusionBaseProblem> { static constexpr unsigned value = 250; };
struct DomainSizeY<TypeTag, Properties::TTag::DiffusionBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1.0;
};
template<class TypeTag>
struct CellsY<TypeTag, TTag::DiffusionBaseProblem> { static constexpr unsigned value = 1; };
template<class TypeTag>
struct CellsZ<TypeTag, TTag::DiffusionBaseProblem> { static constexpr unsigned value = 1; };
struct DomainSizeZ<TypeTag, Properties::TTag::DiffusionBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1.0;
};
// The default for the end time of the simulation
template<class TypeTag>
struct EndTime<TypeTag, TTag::DiffusionBaseProblem>
struct EndTime<TypeTag, Properties::TTag::DiffusionBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e6;
};
// The default for the initial time step size of the simulation
template<class TypeTag>
struct InitialTimeStepSize<TypeTag, TTag::DiffusionBaseProblem>
struct InitialTimeStepSize<TypeTag, Properties::TTag::DiffusionBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1000;
};
} // namespace Opm::Properties
} // namespace Opm::Parameters
namespace Opm {
/*!

View File

@ -136,26 +136,6 @@ struct EnableConstraints<TypeTag, TTag::FingerBaseProblem> { static constexpr in
template<class TypeTag>
struct EnableGravity<TypeTag, TTag::FingerBaseProblem> { static constexpr bool value = true; };
// define the properties specific for the finger problem
template<class TypeTag>
struct DomainSizeX<TypeTag, TTag::FingerBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 0.1;
};
template<class TypeTag>
struct DomainSizeY<TypeTag, TTag::FingerBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 0.3;
};
template<class TypeTag>
struct DomainSizeZ<TypeTag, TTag::FingerBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 0.1;
};
template<class TypeTag>
struct InitialWaterSaturation<TypeTag, TTag::FingerBaseProblem>
{
@ -163,33 +143,60 @@ struct InitialWaterSaturation<TypeTag, TTag::FingerBaseProblem>
static constexpr type value = 0.01;
};
} // namespace Opm::Properties
namespace Opm::Parameters {
template<class TypeTag>
struct CellsX<TypeTag, TTag::FingerBaseProblem> { static constexpr unsigned value = 20; };
struct CellsX<TypeTag, Properties::TTag::FingerBaseProblem>
{ static constexpr unsigned value = 20; };
template<class TypeTag>
struct CellsY<TypeTag, TTag::FingerBaseProblem> { static constexpr unsigned value = 70; };
struct CellsY<TypeTag, Properties::TTag::FingerBaseProblem>
{ static constexpr unsigned value = 70; };
template<class TypeTag>
struct CellsZ<TypeTag, TTag::FingerBaseProblem> { static constexpr unsigned value = 1; };
struct CellsZ<TypeTag, Properties::TTag::FingerBaseProblem>
{ static constexpr unsigned value = 1; };
// define the properties specific for the finger problem
template<class TypeTag>
struct DomainSizeX<TypeTag, Properties::TTag::FingerBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 0.1;
};
template<class TypeTag>
struct DomainSizeY<TypeTag, Properties::TTag::FingerBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 0.3;
};
template<class TypeTag>
struct DomainSizeZ<TypeTag, Properties::TTag::FingerBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 0.1;
};
// The default for the end time of the simulation
template<class TypeTag>
struct EndTime<TypeTag, TTag::FingerBaseProblem>
struct EndTime<TypeTag, Properties::TTag::FingerBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 215;
};
// The default for the initial time step size of the simulation
template<class TypeTag>
struct InitialTimeStepSize<TypeTag, TTag::FingerBaseProblem>
struct InitialTimeStepSize<TypeTag, Properties::TTag::FingerBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 10;
};
} // namespace Opm::Properties
namespace Opm::Parameters {
// Write the solutions of individual newton iterations?
template<class TypeTag>
struct NewtonWriteConvergence<TypeTag, Properties::TTag::FingerBaseProblem>

View File

@ -160,27 +160,32 @@ struct EnableGravity<TypeTag, TTag::FractureProblem> { static constexpr bool val
template<class TypeTag>
struct EnableConstraints<TypeTag, TTag::FractureProblem> { static constexpr bool value = true; };
// Set the default value for the file name of the grid
template<class TypeTag>
struct GridFile<TypeTag, TTag::FractureProblem> { static constexpr auto value = "data/fracture.art.dgf"; };
} // namespace Opm::Properties
namespace Opm::Parameters {
// Set the default value for the end time
template<class TypeTag>
struct EndTime<TypeTag, TTag::FractureProblem>
struct EndTime<TypeTag, Properties::TTag::FractureProblem>
{
using type = GetPropType<TypeTag, Scalar>;
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 3e3;
};
// Set the default value for the file name of the grid
template<class TypeTag>
struct GridFile<TypeTag, Properties::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>
struct InitialTimeStepSize<TypeTag, Properties::TTag::FractureProblem>
{
using type = GetPropType<TypeTag, Scalar>;
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 100;
};
} // namespace Opm::Properties
} // namespace Opm::Parameters
namespace Opm {
/*!

View File

@ -145,26 +145,6 @@ struct PermeabilityLens<TypeTag, TTag::GroundWaterBaseProblem>
template<class TypeTag>
struct EnableGravity<TypeTag, TTag::GroundWaterBaseProblem> { static constexpr bool value = true; };
// The default for the end time of the simulation
template<class TypeTag>
struct EndTime<TypeTag, TTag::GroundWaterBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 1;
};
// 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"; };
// Use the conjugated gradient linear solver with the default preconditioner (i.e.,
// ILU-0) from dune-istl
template<class TypeTag>
@ -176,6 +156,31 @@ struct LinearSolverWrapper<TypeTag, TTag::GroundWaterBaseProblem>
} // namespace Opm::Properties
namespace Opm::Parameters {
// The default for the end time of the simulation
template<class TypeTag>
struct EndTime<TypeTag, Properties::TTag::GroundWaterBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1;
};
// The default DGF file to load
template<class TypeTag>
struct GridFile<TypeTag, Properties::TTag::GroundWaterBaseProblem>
{ static constexpr auto value = "./data/groundwater_2d.dgf"; };
// 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 {
/*!
* \ingroup TestProblems

View File

@ -96,30 +96,30 @@ public:
using type = Opm::ThreePhaseParkerVanGenuchten<Traits>;
};
} // namespace Opm::Properties
namespace Opm::Parameters {
// The default for the end time of the simulation
template<class TypeTag>
struct EndTime<TypeTag, TTag::InfiltrationBaseProblem>
struct EndTime<TypeTag, Properties::TTag::InfiltrationBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 6e3;
};
// 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>
struct GridFile<TypeTag, Properties::TTag::InfiltrationBaseProblem>
{ static constexpr auto value = "./data/infiltration_50x3.dgf"; };
} // namespace Opm::Properties
namespace Opm::Parameters {
// 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>

View File

@ -175,48 +175,6 @@ struct LensUpperRightZ<TypeTag, TTag::LensBaseProblem>
static constexpr type value = 1.0;
};
template<class TypeTag>
struct DomainSizeX<TypeTag, TTag::LensBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 6.0;
};
template<class TypeTag>
struct DomainSizeY<TypeTag, TTag::LensBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 4.0;
};
template<class TypeTag>
struct DomainSizeZ<TypeTag, TTag::LensBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 1.0;
};
template<class TypeTag>
struct CellsX<TypeTag, TTag::LensBaseProblem> { static constexpr unsigned value = 48; };
template<class TypeTag>
struct CellsY<TypeTag, TTag::LensBaseProblem> { static constexpr unsigned value = 32; };
template<class TypeTag>
struct CellsZ<TypeTag, TTag::LensBaseProblem> { static constexpr unsigned value = 16; };
// The default for the end time of the simulation
template<class TypeTag>
struct EndTime<TypeTag, TTag::LensBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 30e3;
};
// 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; };
@ -225,6 +183,39 @@ struct VtkWriteIntrinsicPermeabilities<TypeTag, TTag::LensBaseProblem> { static
namespace Opm::Parameters {
template<class TypeTag>
struct CellsX<TypeTag, Properties::TTag::LensBaseProblem>
{ static constexpr unsigned value = 48; };
template<class TypeTag>
struct CellsY<TypeTag, Properties::TTag::LensBaseProblem>
{ static constexpr unsigned value = 32; };
template<class TypeTag>
struct CellsZ<TypeTag, Properties::TTag::LensBaseProblem>
{ static constexpr unsigned value = 16; };
template<class TypeTag>
struct DomainSizeX<TypeTag, Properties::TTag::LensBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 6.0;
};
template<class TypeTag>
struct DomainSizeY<TypeTag, Properties::TTag::LensBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 4.0;
};
template<class TypeTag>
struct DomainSizeZ<TypeTag, Properties::TTag::LensBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1.0;
};
// enable the cache for intensive quantities by default for this problem
template<class TypeTag>
struct EnableIntensiveQuantityCache<TypeTag, Properties::TTag::LensBaseProblem>
@ -235,6 +226,22 @@ template<class TypeTag>
struct EnableStorageCache<TypeTag, Properties::TTag::LensBaseProblem>
{ static constexpr bool value = true; };
// The default for the end time of the simulation
template<class TypeTag>
struct EndTime<TypeTag, Properties::TTag::LensBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
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,27 +115,32 @@ struct SolidEnergyLaw<TypeTag, TTag::ObstacleBaseProblem>
template<class TypeTag>
struct EnableGravity<TypeTag, TTag::ObstacleBaseProblem> { static constexpr bool value = true; };
} // namespace Opm::Properties
namespace Opm::Parameters {
// The default for the end time of the simulation
template<class TypeTag>
struct EndTime<TypeTag, TTag::ObstacleBaseProblem>
struct EndTime<TypeTag, Properties::TTag::ObstacleBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e4;
};
// 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"; };
struct GridFile<TypeTag, Properties::TTag::ObstacleBaseProblem>
{ static constexpr auto value = "./data/obstacle_24x16.dgf"; };
} // namespace Opm::Properties
// 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,27 +80,32 @@ struct EnableGravity<TypeTag, TTag::OutflowBaseProblem> { static constexpr bool
template<class TypeTag>
struct VtkWriteMassFractions<TypeTag, TTag::OutflowBaseProblem> { static constexpr bool value = true; };
} // namespace Opm::Properties
namespace Opm::Parameters {
// The default for the end time of the simulation
template<class TypeTag>
struct EndTime<TypeTag, TTag::OutflowBaseProblem>
struct EndTime<TypeTag, Properties::TTag::OutflowBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 100;
};
// 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"; };
struct GridFile<TypeTag, Properties::TTag::OutflowBaseProblem>
{ static constexpr auto value = "./data/outflow.dgf"; };
} // namespace Opm::Properties
// 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

@ -127,50 +127,61 @@ struct VtkWriteFilterVelocities<TypeTag, TTag::PowerInjectionBaseProblem> { stat
template<class TypeTag>
struct EnableGravity<TypeTag, TTag::PowerInjectionBaseProblem> { static constexpr bool value = false; };
} // namespace Opm::Properties
namespace Opm::Parameters {
template<class TypeTag>
struct CellsX<TypeTag, Properties::TTag::PowerInjectionBaseProblem>
{ static constexpr unsigned value = 250; };
template<class TypeTag>
struct CellsY<TypeTag, Properties::TTag::PowerInjectionBaseProblem>
{ static constexpr unsigned value = 1; };
template<class TypeTag>
struct CellsZ<TypeTag, Properties::TTag::PowerInjectionBaseProblem>
{ static constexpr unsigned value = 1; };
// define the properties specific for the power injection problem
template<class TypeTag>
struct DomainSizeX<TypeTag, TTag::PowerInjectionBaseProblem>
struct DomainSizeX<TypeTag, Properties::TTag::PowerInjectionBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 100.0;
};
template<class TypeTag>
struct DomainSizeY<TypeTag, TTag::PowerInjectionBaseProblem>
struct DomainSizeY<TypeTag, Properties::TTag::PowerInjectionBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 1.0;
};
template<class TypeTag>
struct DomainSizeZ<TypeTag, TTag::PowerInjectionBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1.0;
};
template<class TypeTag>
struct CellsX<TypeTag, TTag::PowerInjectionBaseProblem> { static constexpr unsigned value = 250; };
template<class TypeTag>
struct CellsY<TypeTag, TTag::PowerInjectionBaseProblem> { static constexpr unsigned value = 1; };
template<class TypeTag>
struct CellsZ<TypeTag, TTag::PowerInjectionBaseProblem> { static constexpr unsigned value = 1; };
struct DomainSizeZ<TypeTag, Properties::TTag::PowerInjectionBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1.0;
};
// The default for the end time of the simulation
template<class TypeTag>
struct EndTime<TypeTag, TTag::PowerInjectionBaseProblem>
struct EndTime<TypeTag, Properties::TTag::PowerInjectionBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 100;
};
// The default for the initial time step size of the simulation
template<class TypeTag>
struct InitialTimeStepSize<TypeTag, TTag::PowerInjectionBaseProblem>
struct InitialTimeStepSize<TypeTag, Properties::TTag::PowerInjectionBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e-3;
};
} // namespace Opm::Properties
} // 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,25 +123,6 @@ struct Temperature<TypeTag, TTag::ReservoirBaseProblem>
static constexpr type value = 293.15;
};
//! 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<class TypeTag>
struct EndTime<TypeTag, TTag::ReservoirBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
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, 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>
@ -167,14 +149,34 @@ public:
using type = Opm::BlackOilFluidSystem<Scalar>;
};
// The default DGF file to load
template<class TypeTag>
struct GridFile<TypeTag, TTag::ReservoirBaseProblem> { static constexpr auto value = "data/reservoir.dgf"; };
} // namespace Opm::Properties
namespace Opm::Parameters {
//! 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<class TypeTag>
struct EndTime<TypeTag, Properties::TTag::ReservoirBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1000.0*24*60*60;
};
// The default DGF file to load
template<class TypeTag>
struct GridFile<TypeTag, Properties::TTag::ReservoirBaseProblem>
{ static constexpr auto value = "data/reservoir.dgf"; };
// 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,29 +107,30 @@ struct EnableGravity<TypeTag, TTag::RichardsLensProblem> { static constexpr bool
template<class TypeTag>
struct NumericDifferenceMethod<TypeTag, TTag::RichardsLensProblem> { static constexpr int value = 0; };
} // namespace Opm::Properties
namespace Opm::Parameters {
// The default for the end time of the simulation
template<class TypeTag>
struct EndTime<TypeTag, TTag::RichardsLensProblem>
struct EndTime<TypeTag, Properties::TTag::RichardsLensProblem>
{
using type = GetPropType<TypeTag, Scalar>;
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 3000;
};
// 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"; };
struct GridFile<TypeTag, Properties::TTag::RichardsLensProblem>
{ static constexpr auto value = "./data/richardslens_24x16.dgf"; };
} // namespace Opm::Properties
namespace Opm::Parameters {
// 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>

View File

@ -123,26 +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 end time of the simulation (1 year)
template<class TypeTag>
struct EndTime<TypeTag, TTag::WaterAirBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
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, 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"; };
// Use the restarted GMRES linear solver with the ILU-2 preconditioner from dune-istl
template<class TypeTag>
struct LinearSolverSplice<TypeTag, TTag::WaterAirBaseProblem>
@ -162,6 +142,27 @@ struct PreconditionerOrder<TypeTag, TTag::WaterAirBaseProblem> { static constexp
namespace Opm::Parameters {
// The default for the end time of the simulation (1 year)
template<class TypeTag>
struct EndTime<TypeTag, Properties::TTag::WaterAirBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1.0 * 365 * 24 * 60 * 60;
};
// The default DGF file to load
template<class TypeTag>
struct GridFile<TypeTag, Properties::TTag::WaterAirBaseProblem>
{ static constexpr auto value = "./data/waterair.dgf"; };
// 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,51 +124,62 @@ public:
template<class TypeTag>
struct EnableGravity<TypeTag, TTag::Tutorial1Problem> { static constexpr bool value = false; }; /*@\label{tutorial1:gravity}@*/
} // namespace Opm::Properties
namespace Opm::Parameters {
// // define the number of cells used for discretizing the physical domain
template<class TypeTag>
struct CellsX<TypeTag, Properties::TTag::Tutorial1Problem>
{ static constexpr unsigned value = 100; };
template<class TypeTag>
struct CellsY<TypeTag, Properties::TTag::Tutorial1Problem>
{ static constexpr unsigned value = 1; };
template<class TypeTag>
struct CellsZ<TypeTag, Properties::TTag::Tutorial1Problem>
{ static constexpr unsigned value = 1; }; /*@\label{tutorial1:default-params-end}@*/
// define the physical size of the problem's domain [m]
template<class TypeTag>
struct DomainSizeX<TypeTag, Properties::TTag::Tutorial1Problem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 300.0;
}; /*@\label{tutorial1:grid-default-params-begin}@*/
template<class TypeTag>
struct DomainSizeY<TypeTag, Properties::TTag::Tutorial1Problem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 60.0;
};
template<class TypeTag>
struct DomainSizeZ<TypeTag, Properties::TTag::Tutorial1Problem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 0.0;
};
// define how long the simulation should run [s]
template<class TypeTag>
struct EndTime<TypeTag, TTag::Tutorial1Problem>
struct EndTime<TypeTag, Properties::TTag::Tutorial1Problem>
{
using type = GetPropType<TypeTag, Scalar>;
using type = GetPropType<TypeTag, Properties::Scalar>;
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, TTag::Tutorial1Problem>
struct InitialTimeStepSize<TypeTag, Properties::TTag::Tutorial1Problem>
{
using type = GetPropType<TypeTag, Scalar>;
using type = GetPropType<TypeTag, Properties::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>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 300.0;
}; /*@\label{tutorial1:grid-default-params-begin}@*/
template<class TypeTag>
struct DomainSizeY<TypeTag, TTag::Tutorial1Problem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 60.0;
};
template<class TypeTag>
struct DomainSizeZ<TypeTag, TTag::Tutorial1Problem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 0.0;
};
// // define the number of cells used for discretizing the physical domain
template<class TypeTag>
struct CellsX<TypeTag, TTag::Tutorial1Problem> { static constexpr unsigned value = 100; };
template<class TypeTag>
struct CellsY<TypeTag, TTag::Tutorial1Problem> { static constexpr unsigned value = 1; };
template<class TypeTag>
struct CellsZ<TypeTag, TTag::Tutorial1Problem> { static constexpr unsigned value = 1; }; /*@\label{tutorial1:default-params-end}@*/
} // namespace Opm::Properties
} // namespace Opm::Parameters
namespace Opm {
//! Tutorial problem using the "immiscible" model.

View File

@ -70,20 +70,20 @@ public:
Parameters::registerParam<TypeTag, Parameters::GridGlobalRefinements>
("The number of global refinements of the grid "
"executed after it was loaded");
Parameters::registerParam<TypeTag, Properties::DomainSizeX>
Parameters::registerParam<TypeTag, Parameters::DomainSizeX>
("The size of the domain in x direction");
Parameters::registerParam<TypeTag, Properties::CellsX>
Parameters::registerParam<TypeTag, Parameters::CellsX>
("The number of intervalls in x direction");
if (dimWorld > 1) {
Parameters::registerParam<TypeTag, Properties::DomainSizeY>
Parameters::registerParam<TypeTag, Parameters::DomainSizeY>
("The size of the domain in y direction");
Parameters::registerParam<TypeTag, Properties::CellsY>
Parameters::registerParam<TypeTag, Parameters::CellsY>
("The number of intervalls in y direction");
}
if (dimWorld > 2) {
Parameters::registerParam<TypeTag, Properties::DomainSizeZ>
Parameters::registerParam<TypeTag, Parameters::DomainSizeZ>
("The size of the domain in z direction");
Parameters::registerParam<TypeTag, Properties::CellsZ>
Parameters::registerParam<TypeTag, Parameters::CellsZ>
("The number of intervalls in z direction");
}
}
@ -101,15 +101,15 @@ public:
for (unsigned i = 0; i < dimWorld; ++i)
cellRes[i] = 0;
upperRight[0] = Parameters::get<TypeTag, Properties::DomainSizeX>();
cellRes[0] = Parameters::get<TypeTag, Properties::CellsX>();
upperRight[0] = Parameters::get<TypeTag, Parameters::DomainSizeX>();
cellRes[0] = Parameters::get<TypeTag, Parameters::CellsX>();
if (dimWorld > 1) {
upperRight[1] = Parameters::get<TypeTag, Properties::DomainSizeY>();
cellRes[1] = Parameters::get<TypeTag, Properties::CellsY>();
upperRight[1] = Parameters::get<TypeTag, Parameters::DomainSizeY>();
cellRes[1] = Parameters::get<TypeTag, Parameters::CellsY>();
}
if (dimWorld > 2) {
upperRight[2] = Parameters::get<TypeTag, Properties::DomainSizeZ>();
cellRes[2] = Parameters::get<TypeTag, Properties::CellsZ>();
upperRight[2] = Parameters::get<TypeTag, Parameters::DomainSizeZ>();
cellRes[2] = Parameters::get<TypeTag, Parameters::CellsZ>();
}
unsigned numRefinements = Parameters::get<TypeTag, Parameters::GridGlobalRefinements>();

View File

@ -62,7 +62,7 @@ public:
*/
static void registerParameters()
{
Parameters::registerParam<TypeTag,Properties::GridFile>
Parameters::registerParam<TypeTag, Parameters::GridFile>
("The file name of the DGF file to load");
Parameters::registerParam<TypeTag, Parameters::GridGlobalRefinements>
("The number of global refinements of the grid "
@ -75,7 +75,7 @@ public:
DgfVanguard(Simulator& simulator)
: ParentType(simulator)
{
const std::string dgfFileName = Parameters::get<TypeTag, Properties::GridFile>();
const std::string dgfFileName = Parameters::get<TypeTag, Parameters::GridFile>();
unsigned numRefinments = Parameters::get<TypeTag, Parameters::GridGlobalRefinements>();
{

View File

@ -111,20 +111,20 @@ public:
Parameters::registerParam<TypeTag, Parameters::GridGlobalRefinements>
("The number of global refinements of the grid "
"executed after it was loaded");
Parameters::registerParam<TypeTag, Properties::DomainSizeX>
Parameters::registerParam<TypeTag, Parameters::DomainSizeX>
("The size of the domain in x direction");
Parameters::registerParam<TypeTag, Properties::CellsX>
Parameters::registerParam<TypeTag, Parameters::CellsX>
("The number of intervalls in x direction");
if (dim > 1) {
Parameters::registerParam<TypeTag, Properties::DomainSizeY>
Parameters::registerParam<TypeTag, Parameters::DomainSizeY>
("The size of the domain in y direction");
Parameters::registerParam<TypeTag, Properties::CellsY>
Parameters::registerParam<TypeTag, Parameters::CellsY>
("The number of intervalls in y direction");
}
if (dim > 2) {
Parameters::registerParam<TypeTag, Properties::DomainSizeZ>
Parameters::registerParam<TypeTag, Parameters::DomainSizeZ>
("The size of the domain in z direction");
Parameters::registerParam<TypeTag, Properties::CellsZ>
Parameters::registerParam<TypeTag, Parameters::CellsZ>
("The number of intervalls in z direction");
}
}
@ -141,14 +141,14 @@ public:
Dune::FieldVector<GridScalar, dim> upperRight;
Dune::FieldVector<GridScalar, dim> lowerLeft( 0 );
upperRight[0] = Parameters::get<TypeTag, Properties::DomainSizeX>();
upperRight[1] = Parameters::get<TypeTag, Properties::DomainSizeY>();
upperRight[0] = Parameters::get<TypeTag, Parameters::DomainSizeX>();
upperRight[1] = Parameters::get<TypeTag, Parameters::DomainSizeY>();
cellRes[0] = Parameters::get<TypeTag, Properties::CellsX>();
cellRes[1] = Parameters::get<TypeTag, Properties::CellsY>();
cellRes[0] = Parameters::get<TypeTag, Parameters::CellsX>();
cellRes[1] = Parameters::get<TypeTag, Parameters::CellsY>();
if (dim == 3) {
upperRight[2] = Parameters::get<TypeTag, Properties::DomainSizeZ>();
cellRes[2] = Parameters::get<TypeTag, Properties::CellsZ>();
upperRight[2] = Parameters::get<TypeTag, Parameters::DomainSizeZ>();
cellRes[2] = Parameters::get<TypeTag, Parameters::CellsZ>();
}
std::stringstream dgffile;

View File

@ -32,16 +32,74 @@
namespace Opm::Parameters {
//! grid resolution
template<class TypeTag, class MyTypeTag>
struct CellsX { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct CellsY { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct CellsZ { using type = Properties::UndefinedProperty; };
//! domain size
template<class TypeTag, class MyTypeTag>
struct DomainSizeX { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct DomainSizeY { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct DomainSizeZ { using type = Properties::UndefinedProperty; };
//! The default value for the simulation's end time
template<class TypeTag, class MyTypeTag>
struct EndTime { using type = Properties::UndefinedProperty; };
//! name of the grid file
template<class TypeTag, class MyTypeTag>
struct GridFile { using type = Properties::UndefinedProperty; };
//! Property which tells the Vanguard how often the grid should be refined
//! after creation.
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>
struct ParameterFile { using type = Properties::UndefinedProperty; };
//! The name of the file with a number of forced time step lengths
template<class TypeTag, class MyTypeTag>
struct PredeterminedTimeStepsFile { using type = Properties::UndefinedProperty; };
/*!
* \brief Print all parameters on startup?
*
* 0 means 'no', 1 means 'yes', 2 means 'print only to logfiles'. The
* default is 2.
*/
template<class TypeTag, class MyTypeTag>
struct PrintParameters { using type = Properties::UndefinedProperty; };
/*!
* \brief Print all properties on startup?
*
* 0 means 'no', 1 means 'yes', 2 means 'print only to logfiles'. The
* default is 2.
*/
template<class TypeTag, class MyTypeTag>
struct PrintProperties { using type = Properties::UndefinedProperty; };
//! The default value for the simulation's restart time
template<class TypeTag, class MyTypeTag>
struct RestartTime { using type = Properties::UndefinedProperty; };
} // namespace Opm:Parameters
#endif

View File

@ -105,60 +105,6 @@ template<class TypeTag, class MyTypeTag>
struct GridPart { using type = UndefinedProperty; };
#endif
/*!
* \brief Print all properties on startup?
*
* 0 means 'no', 1 means 'yes', 2 means 'print only to logfiles'. The
* default is 2.
*/
template<class TypeTag, class MyTypeTag>
struct PrintProperties { using type = UndefinedProperty; };
/*!
* \brief Print all parameters on startup?
*
* 0 means 'no', 1 means 'yes', 2 means 'print only to logfiles'. The
* default is 2.
*/
template<class TypeTag, class MyTypeTag>
struct PrintParameters { using type = UndefinedProperty; };
//! The default value for the simulation's end time
template<class TypeTag, class MyTypeTag>
struct EndTime { using type = UndefinedProperty; };
//! 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; };
//! The name of the file with a number of forced time step lengths
template<class TypeTag, class MyTypeTag>
struct PredeterminedTimeStepsFile { using type = UndefinedProperty; };
//! domain size
template<class TypeTag, class MyTypeTag>
struct DomainSizeX { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct DomainSizeY { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct DomainSizeZ { using type = UndefinedProperty; };
//! grid resolution
template<class TypeTag, class MyTypeTag>
struct CellsX { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct CellsY { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct CellsZ { using type = UndefinedProperty; };
//! name of the grid file
template<class TypeTag, class MyTypeTag>
struct GridFile { using type = UndefinedProperty; };
//! level of the grid view
template<class TypeTag, class MyTypeTag>
struct GridViewLevel { using type = UndefinedProperty; };
@ -199,11 +145,8 @@ struct ParameterTree<TypeTag, TTag::NumericModel>
//! use the global group as default for the model's parameter group
template<class TypeTag>
struct ModelParameterGroup<TypeTag, TTag::NumericModel> { static constexpr auto value = ""; };
//! Set a value for the GridFile property
template<class TypeTag>
struct GridFile<TypeTag, TTag::NumericModel> { static constexpr auto value = ""; };
struct ModelParameterGroup<TypeTag, TTag::NumericModel>
{ static constexpr auto value = ""; };
#if HAVE_DUNE_FEM
template<class TypeTag>
@ -214,70 +157,81 @@ struct GridPart<TypeTag, TTag::NumericModel>
};
template<class TypeTag>
struct GridView<TypeTag, TTag::NumericModel> { using type = typename GetPropType<TypeTag, Properties::GridPart>::GridViewType; };
struct GridView<TypeTag, TTag::NumericModel>
{ using type = typename GetPropType<TypeTag, Properties::GridPart>::GridViewType; };
#else
//! Use the leaf grid view by default.
//!
//! Except for spatial refinement, there is rarly a reason to use
//! anything else...
template<class TypeTag>
struct GridView<TypeTag, TTag::NumericModel> { using type = typename GetPropType<TypeTag, Properties::Grid>::LeafGridView; };
struct GridView<TypeTag, TTag::NumericModel>
{ using type = typename GetPropType<TypeTag, Properties::Grid>::LeafGridView; };
#endif
//! By default, print the properties on startup
template<class TypeTag>
struct PrintProperties<TypeTag, TTag::NumericModel> { static constexpr int value = 2; };
//! By default, print the values of the run-time parameters on startup
template<class TypeTag>
struct PrintParameters<TypeTag, TTag::NumericModel> { static constexpr int value = 2; };
//! The default value for the simulation's end time
template<class TypeTag>
struct EndTime<TypeTag, TTag::NumericModel>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = -1e35;
};
//! 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>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = -1e35;
};
//! By default, do not force any time steps
template<class TypeTag>
struct PredeterminedTimeStepsFile<TypeTag, TTag::NumericModel> { static constexpr auto value = ""; };
template<class TypeTag>
struct Vanguard<TypeTag, TTag::NumericModel> { using type = Opm::DgfVanguard<TypeTag>; };
struct Vanguard<TypeTag, TTag::NumericModel>
{ using type = Opm::DgfVanguard<TypeTag>; };
} // namespace Opm::Properties
namespace Opm::Parameters {
//! The default value for the simulation's end time
template<class TypeTag>
struct EndTime<TypeTag, Properties::TTag::NumericModel>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = -1e35;
};
//! Set a value for the GridFile property
template<class TypeTag>
struct GridFile<TypeTag, Properties::TTag::NumericModel>
{ static constexpr auto value = ""; };
//! Set the number of refinement levels of the grid to 0. This does not belong
//! here, strictly speaking.
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>
{ static constexpr auto value = ""; };
}
//! By default, do not force any time steps
template<class TypeTag>
struct PredeterminedTimeStepsFile<TypeTag, Properties::TTag::NumericModel>
{ static constexpr auto value = ""; };
//! By default, print the values of the run-time parameters on startup
template<class TypeTag>
struct PrintParameters<TypeTag, Properties::TTag::NumericModel>
{ static constexpr int value = 2; };
//! By default, print the properties on startup
template<class TypeTag>
struct PrintProperties<TypeTag, Properties::TTag::NumericModel>
{ static constexpr int value = 2; };
//! The default value for the simulation's restart time
template<class TypeTag>
struct RestartTime<TypeTag, Properties::TTag::NumericModel>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = -1e35;
};
} // namespace Opm::Parameters
#endif

View File

@ -129,11 +129,11 @@ public:
timeStepIdx_ = 0;
startTime_ = 0.0;
time_ = 0.0;
endTime_ = Parameters::get<TypeTag, Properties::EndTime>();
timeStepSize_ = Parameters::get<TypeTag, Properties::InitialTimeStepSize>();
endTime_ = Parameters::get<TypeTag, Parameters::EndTime>();
timeStepSize_ = Parameters::get<TypeTag, Parameters::InitialTimeStepSize>();
assert(timeStepSize_ > 0);
const std::string& predetTimeStepFile =
Parameters::get<TypeTag, Properties::PredeterminedTimeStepsFile>();
Parameters::get<TypeTag, Parameters::PredeterminedTimeStepsFile>();
if (!predetTimeStepFile.empty()) {
std::ifstream is(predetTimeStepFile);
while (!is.eof()) {
@ -254,13 +254,13 @@ public:
*/
static void registerParameters()
{
Parameters::registerParam<TypeTag, Properties::EndTime>
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>
Parameters::registerParam<TypeTag, Parameters::RestartTime>
("The simulation time at which a restart should be attempted [s]");
Parameters::registerParam<TypeTag, Properties::PredeterminedTimeStepsFile>
Parameters::registerParam<TypeTag, Parameters::PredeterminedTimeStepsFile>
("A file with a list of predetermined time step sizes (one "
"time step per line)");
@ -649,7 +649,7 @@ public:
TimerGuard writeTimerGuard(writeTimer_);
setupTimer_.start();
Scalar restartTime = Parameters::get<TypeTag, Properties::RestartTime>();
Scalar restartTime = Parameters::get<TypeTag, Parameters::RestartTime>();
if (restartTime > -1e30) {
// try to restart a previous simulation
time_ = restartTime;

View File

@ -80,10 +80,10 @@ static inline void registerAllParameters_(bool finalizeRegistration = true)
Parameters::registerParam<TypeTag, Parameters::ParameterFile>
("An .ini file which contains a set of run-time parameters");
Parameters::registerParam<TypeTag, Properties::PrintProperties>
Parameters::registerParam<TypeTag, Parameters::PrintProperties>
("Print the values of the compile time properties at "
"the start of the simulation");
Parameters::registerParam<TypeTag, Properties::PrintParameters>
Parameters::registerParam<TypeTag, Parameters::PrintParameters>
("Print the values of the run-time parameters at the "
"start of the simulation");
@ -318,7 +318,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<TypeTag, Properties::EndTime>();
Scalar endTime = Parameters::get<TypeTag, Parameters::EndTime>();
if (endTime < -1e50) {
if (myRank == 0)
Parameters::printUsage<TypeTag>(argv[0],
@ -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],
@ -354,7 +354,7 @@ static inline int start(int argc, char **argv, bool registerParams=true)
}
// print the parameters if requested
int printParams = Parameters::get<TypeTag, Properties::PrintParameters>();
int printParams = Parameters::get<TypeTag, Parameters::PrintParameters>();
if (myRank == 0) {
std::string endParametersSeparator("# [end of parameters]\n");
if (printParams) {
@ -378,7 +378,7 @@ static inline int start(int argc, char **argv, bool registerParams=true)
}
// print the properties if requested
int printProps = Parameters::get<TypeTag, Properties::PrintProperties>();
int printProps = Parameters::get<TypeTag, Parameters::PrintProperties>();
if (printProps && myRank == 0) {
if (printProps == 1 || !isatty(fileno(stdout)))
Properties::printValues<TypeTag>(std::cout);