move DomainSize(X|Y|Z) to TypeTag-free parameter system

This commit is contained in:
Arne Morten Kvarving
2024-07-05 17:49:51 +02:00
parent 25aed6d79a
commit 0509285170
10 changed files with 41 additions and 161 deletions

View File

@@ -156,31 +156,6 @@ struct EpisodeLength { using type = Properties::UndefinedProperty;};
template <class TypeTag, class MyTypeTag>
struct Initialpressure { using type = Properties::UndefinedProperty;};
//\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;
};
// Enable gravity false
template <class TypeTag>
struct EnableGravity<TypeTag, Properties::TTag::CO2PTBaseProblem>
@@ -413,13 +388,15 @@ public:
("Time interval [s] for episode length");
Parameters::SetDefault<Parameters::CellsX>(30);
Parameters::SetDefault<Parameters::DomainSizeX<Scalar>>(300.0);
if constexpr (dim > 1) {
Parameters::SetDefault<Parameters::CellsY>(1);
Parameters::SetDefault<Parameters::DomainSizeY<Scalar>>(1.0);
}
if constexpr (dim == 3) {
Parameters::SetDefault<Parameters::CellsZ>(1);
Parameters::SetDefault<Parameters::DomainSizeZ<Scalar>>(1.0);
}
}

View File

@@ -110,28 +110,6 @@ struct EnableDiffusion<TypeTag, TTag::DiffusionBaseProblem> { static constexpr b
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;
};
// Disable gravity
template<class TypeTag>
struct EnableGravity<TypeTag, Properties::TTag::DiffusionBaseProblem>

View File

@@ -131,28 +131,6 @@ namespace Opm::Parameters {
template<class TypeTag, class MyTypeTag>
struct InitialWaterSaturation { using type = Properties::UndefinedProperty; };
// 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;
};
// Enable gravity
template<class TypeTag>
struct EnableGravity<TypeTag, Properties::TTag::FingerBaseProblem>
@@ -310,13 +288,15 @@ public:
("The initial saturation in the domain [] of the wetting phase");
Parameters::SetDefault<Parameters::CellsX>(20);
Parameters::SetDefault<Parameters::DomainSizeX<Scalar>>(0.1);
if constexpr (dim > 1) {
Parameters::SetDefault<Parameters::CellsY>(70);
Parameters::SetDefault<Parameters::DomainSizeY<Scalar>>(0.3);
}
if constexpr (dim == 3) {
Parameters::SetDefault<Parameters::CellsZ>(1);
Parameters::SetDefault<Parameters::DomainSizeZ<Scalar>>(0.1);
}
}

View File

@@ -138,27 +138,6 @@ struct LensUpperRightY { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct LensUpperRightZ { using type = Properties::UndefinedProperty; };
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 gravity
template<class TypeTag>
struct EnableGravity<TypeTag, Properties::TTag::LensBaseProblem>
@@ -385,9 +364,12 @@ public:
Parameters::SetDefault<Parameters::CellsX>(48);
Parameters::SetDefault<Parameters::CellsY>(32);
Parameters::SetDefault<Parameters::DomainSizeX<Scalar>>(6.0);
Parameters::SetDefault<Parameters::DomainSizeY<Scalar>>(4.0);
if constexpr (dim == 3) {
Parameters::SetDefault<Parameters::CellsZ>(16);
Parameters::SetDefault<Parameters::DomainSizeZ<Scalar>>(1.0);
}
}

View File

@@ -123,28 +123,6 @@ public:
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;
};
// Disable gravity
template<class TypeTag>
struct EnableGravity<TypeTag, Properties::TTag::PowerInjectionBaseProblem>
@@ -266,13 +244,15 @@ public:
ParentType::registerParameters();
Parameters::SetDefault<Parameters::CellsX>(250);
Parameters::SetDefault<Parameters::DomainSizeX<Scalar>>(100.0);
if constexpr (dim > 1) {
Parameters::SetDefault<Parameters::CellsY>(1);
Parameters::SetDefault<Parameters::DomainSizeY<Scalar>>(1.0);
}
if constexpr (dim == 3) {
Parameters::SetDefault<Parameters::CellsZ>(1);
Parameters::SetDefault<Parameters::DomainSizeZ<Scalar>>(1.0);
}
}

View File

@@ -124,28 +124,6 @@ public:
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;
};
// Disable gravity
template<class TypeTag>
struct EnableGravity<TypeTag, Properties::TTag::Tutorial1Problem>
@@ -246,9 +224,12 @@ public:
Parameters::SetDefault<Parameters::CellsX>(100);
Parameters::SetDefault<Parameters::CellsY>(1);
Parameters::SetDefault<Parameters::DomainSizeX<Scalar>>(300.0);
Parameters::SetDefault<Parameters::DomainSizeY<Scalar>>(60.0);
if constexpr (dim == 3) {
Parameters::SetDefault<Parameters::CellsZ>(1);
Parameters::SetDefault<Parameters::DomainSizeZ<Scalar>>(0.0);
}
}