move LensProblem parameters to TypeTag-free parameter system

This commit is contained in:
Arne Morten Kvarving 2024-07-05 17:49:51 +02:00
parent 0d7bba7f4f
commit 9a572e1c16

View File

@ -41,6 +41,7 @@
#include <opm/material/fluidstates/ImmiscibleFluidState.hpp>
#include <opm/material/fluidsystems/TwoPhaseImmiscibleFluidSystem.hpp>
#include <opm/models/common/multiphasebaseparameters.hh>
#include <opm/models/common/transfluxmodule.hh>
#include <opm/models/discretization/common/fvbaseadlocallinearizer.hh>
@ -124,67 +125,24 @@ public:
namespace Opm::Parameters {
// declare the properties specific for the lens problem
template<class TypeTag, class MyTypeTag>
struct LensLowerLeftX { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct LensLowerLeftY { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct LensLowerLeftZ { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct LensUpperRightX { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct LensUpperRightY { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct LensUpperRightZ { using type = Properties::UndefinedProperty; };
// define the properties specific for the lens problem
template<class TypeTag>
struct LensLowerLeftX<TypeTag, Properties::TTag::LensBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1.0;
};
template<class Scalar>
struct LensLowerLeftX { static constexpr Scalar value = 1.0; };
template<class TypeTag>
struct LensLowerLeftY<TypeTag, Properties::TTag::LensBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 2.0;
};
template<class Scalar>
struct LensLowerLeftY { static constexpr Scalar value = 2.0; };
template<class TypeTag>
struct LensLowerLeftZ<TypeTag, Properties::TTag::LensBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 0.0;
};
template<class Scalar>
struct LensLowerLeftZ { static constexpr Scalar value = 0.0; };
template<class TypeTag>
struct LensUpperRightX<TypeTag, Properties::TTag::LensBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 4.0;
};
template<class Scalar>
struct LensUpperRightX { static constexpr Scalar value = 4.0; };
template<class TypeTag>
struct LensUpperRightY<TypeTag, Properties::TTag::LensBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 3.0;
};
template<class Scalar>
struct LensUpperRightY { static constexpr Scalar value = 3.0; };
template<class TypeTag>
struct LensUpperRightZ<TypeTag, Properties::TTag::LensBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1.0;
};
template<class Scalar>
struct LensUpperRightZ { static constexpr Scalar value = 1.0; };
} // namespace Opm::Parameters
@ -274,14 +232,14 @@ public:
FluidSystem::init();
temperature_ = 273.15 + 20; // -> 20°C
lensLowerLeft_[0] = Parameters::get<TypeTag, Parameters::LensLowerLeftX>();
lensLowerLeft_[1] = Parameters::get<TypeTag, Parameters::LensLowerLeftY>();
lensUpperRight_[0] = Parameters::get<TypeTag, Parameters::LensUpperRightX>();
lensUpperRight_[1] = Parameters::get<TypeTag, Parameters::LensUpperRightY>();
lensLowerLeft_[0] = Parameters::Get<Parameters::LensLowerLeftX<Scalar>>();
lensLowerLeft_[1] = Parameters::Get<Parameters::LensLowerLeftY<Scalar>>();
lensUpperRight_[0] = Parameters::Get<Parameters::LensUpperRightX<Scalar>>();
lensUpperRight_[1] = Parameters::Get<Parameters::LensUpperRightY<Scalar>>();
if constexpr (dim == 3) {
lensLowerLeft_[2] = Parameters::get<TypeTag, Parameters::LensLowerLeftZ>();
lensUpperRight_[2] = Parameters::get<TypeTag, Parameters::LensUpperRightZ>();
lensLowerLeft_[2] = Parameters::Get<Parameters::LensLowerLeftZ<Scalar>>();
lensUpperRight_[2] = Parameters::Get<Parameters::LensUpperRightZ<Scalar>>();
}
// residual saturations
@ -315,19 +273,19 @@ public:
{
ParentType::registerParameters();
Parameters::registerParam<TypeTag, Parameters::LensLowerLeftX>
Parameters::Register<Parameters::LensLowerLeftX<Scalar>>
("The x-coordinate of the lens' lower-left corner [m].");
Parameters::registerParam<TypeTag, Parameters::LensLowerLeftY>
Parameters::Register<Parameters::LensLowerLeftY<Scalar>>
("The y-coordinate of the lens' lower-left corner [m].");
Parameters::registerParam<TypeTag, Parameters::LensUpperRightX>
Parameters::Register<Parameters::LensUpperRightX<Scalar>>
("The x-coordinate of the lens' upper-right corner [m].");
Parameters::registerParam<TypeTag, Parameters::LensUpperRightY>
Parameters::Register<Parameters::LensUpperRightY<Scalar>>
("The y-coordinate of the lens' upper-right corner [m].");
if constexpr (dim == 3) {
Parameters::registerParam<TypeTag, Parameters::LensLowerLeftZ>
Parameters::Register<Parameters::LensLowerLeftZ<Scalar>>
("The z-coordinate of the lens' lower-left corner [m].");
Parameters::registerParam<TypeTag, Parameters::LensUpperRightZ>
Parameters::Register<Parameters::LensUpperRightZ<Scalar>>
("The z-coordinate of the lens' upper-right corner [m].");
}