mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
changed: move the DomainSize(X|Y|Z) parameters to Opm::Parameters
This commit is contained in:
@@ -53,7 +53,6 @@
|
||||
#include <dune/common/fmatrix.hh>
|
||||
|
||||
#include <sstream>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
namespace Opm {
|
||||
@@ -224,28 +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>
|
||||
@@ -263,6 +240,31 @@ struct EnableEnergy<TypeTag, TTag::CO2PTBaseProblem> {
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
//\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>
|
||||
|
||||
@@ -110,26 +110,6 @@ struct EnableDiffusion<TypeTag, TTag::DiffusionBaseProblem> { static constexpr b
|
||||
template<class TypeTag>
|
||||
struct EnableGravity<TypeTag, TTag::DiffusionBaseProblem> { static constexpr bool value = false; };
|
||||
|
||||
// define the properties specific for the diffusion problem
|
||||
template<class TypeTag>
|
||||
struct DomainSizeX<TypeTag, 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>;
|
||||
static constexpr type value = 1.0;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct CellsX<TypeTag, TTag::DiffusionBaseProblem> { static constexpr unsigned value = 250; };
|
||||
template<class TypeTag>
|
||||
@@ -141,6 +121,28 @@ struct CellsZ<TypeTag, TTag::DiffusionBaseProblem> { static constexpr unsigned v
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
// define the properties specific for the diffusion problem
|
||||
template<class TypeTag>
|
||||
struct DomainSizeX<TypeTag, Properties::TTag::DiffusionBaseProblem>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 1.0;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct DomainSizeY<TypeTag, Properties::TTag::DiffusionBaseProblem>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 1.0;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
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, Properties::TTag::DiffusionBaseProblem>
|
||||
|
||||
@@ -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>
|
||||
{
|
||||
@@ -174,6 +154,28 @@ struct CellsZ<TypeTag, TTag::FingerBaseProblem> { static constexpr unsigned valu
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
// 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, Properties::TTag::FingerBaseProblem>
|
||||
|
||||
@@ -175,25 +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>
|
||||
@@ -209,6 +190,27 @@ struct VtkWriteIntrinsicPermeabilities<TypeTag, TTag::LensBaseProblem> { static
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
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>
|
||||
|
||||
@@ -127,26 +127,6 @@ struct VtkWriteFilterVelocities<TypeTag, TTag::PowerInjectionBaseProblem> { stat
|
||||
template<class TypeTag>
|
||||
struct EnableGravity<TypeTag, TTag::PowerInjectionBaseProblem> { static constexpr bool value = false; };
|
||||
|
||||
// define the properties specific for the power injection problem
|
||||
template<class TypeTag>
|
||||
struct DomainSizeX<TypeTag, TTag::PowerInjectionBaseProblem>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Scalar>;
|
||||
static constexpr type value = 100.0;
|
||||
};
|
||||
template<class TypeTag>
|
||||
struct DomainSizeY<TypeTag, 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>;
|
||||
static constexpr type value = 1.0;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct CellsX<TypeTag, TTag::PowerInjectionBaseProblem> { static constexpr unsigned value = 250; };
|
||||
template<class TypeTag>
|
||||
@@ -158,6 +138,28 @@ struct CellsZ<TypeTag, TTag::PowerInjectionBaseProblem> { static constexpr unsig
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
// define the properties specific for the power injection problem
|
||||
template<class TypeTag>
|
||||
struct DomainSizeX<TypeTag, Properties::TTag::PowerInjectionBaseProblem>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 100.0;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct DomainSizeY<TypeTag, Properties::TTag::PowerInjectionBaseProblem>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Properties::Scalar>;
|
||||
static constexpr type value = 1.0;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
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, Properties::TTag::PowerInjectionBaseProblem>
|
||||
|
||||
@@ -124,26 +124,6 @@ public:
|
||||
template<class TypeTag>
|
||||
struct EnableGravity<TypeTag, TTag::Tutorial1Problem> { static constexpr bool value = false; }; /*@\label{tutorial1:gravity}@*/
|
||||
|
||||
// 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; };
|
||||
@@ -156,6 +136,28 @@ struct CellsZ<TypeTag, TTag::Tutorial1Problem> { static constexpr unsigned value
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
// 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, Properties::TTag::Tutorial1Problem>
|
||||
|
||||
@@ -70,18 +70,18 @@ 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>
|
||||
("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>
|
||||
("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>
|
||||
("The number of intervalls in z direction");
|
||||
@@ -101,14 +101,14 @@ public:
|
||||
for (unsigned i = 0; i < dimWorld; ++i)
|
||||
cellRes[i] = 0;
|
||||
|
||||
upperRight[0] = Parameters::get<TypeTag, Properties::DomainSizeX>();
|
||||
upperRight[0] = Parameters::get<TypeTag, Parameters::DomainSizeX>();
|
||||
cellRes[0] = Parameters::get<TypeTag, Properties::CellsX>();
|
||||
if (dimWorld > 1) {
|
||||
upperRight[1] = Parameters::get<TypeTag, Properties::DomainSizeY>();
|
||||
upperRight[1] = Parameters::get<TypeTag, Parameters::DomainSizeY>();
|
||||
cellRes[1] = Parameters::get<TypeTag, Properties::CellsY>();
|
||||
}
|
||||
if (dimWorld > 2) {
|
||||
upperRight[2] = Parameters::get<TypeTag, Properties::DomainSizeZ>();
|
||||
upperRight[2] = Parameters::get<TypeTag, Parameters::DomainSizeZ>();
|
||||
cellRes[2] = Parameters::get<TypeTag, Properties::CellsZ>();
|
||||
}
|
||||
|
||||
|
||||
@@ -111,18 +111,18 @@ 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>
|
||||
("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>
|
||||
("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>
|
||||
("The number of intervalls in z direction");
|
||||
@@ -141,13 +141,13 @@ 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>();
|
||||
if (dim == 3) {
|
||||
upperRight[2] = Parameters::get<TypeTag, Properties::DomainSizeZ>();
|
||||
upperRight[2] = Parameters::get<TypeTag, Parameters::DomainSizeZ>();
|
||||
cellRes[2] = Parameters::get<TypeTag, Properties::CellsZ>();
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,14 @@
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
//! 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; };
|
||||
|
||||
@@ -105,14 +105,6 @@ template<class TypeTag, class MyTypeTag>
|
||||
struct GridPart { using type = UndefinedProperty; };
|
||||
#endif
|
||||
|
||||
//! 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; };
|
||||
|
||||
Reference in New Issue
Block a user