move ReservoirProblem parameters to TypeTag-free parameter system

This commit is contained in:
Arne Morten Kvarving 2024-07-05 17:49:51 +02:00
parent 0ff3c08df6
commit 7425ddeb9c

View File

@ -46,6 +46,8 @@
#include <opm/models/blackoil/blackoilproperties.hh>
#include <opm/models/common/multiphasebaseparameters.hh>
#include <opm/models/discretization/common/fvbaseparameters.hh>
#include <opm/models/discretization/common/fvbaseproperties.hh>
@ -124,39 +126,16 @@ public:
namespace Opm::Parameters {
// Maximum depth of the reservoir
template<class TypeTag, class MyTypeTag>
struct MaxDepth { using type = Properties::UndefinedProperty; };
template<class Scalar>
struct MaxDepth { static constexpr Scalar value = 2500.0; };
// The temperature inside the reservoir
template<class TypeTag, class MyTypeTag>
struct Temperature { using type = Properties::UndefinedProperty; };
template<class Scalar>
struct Temperature { static constexpr Scalar value = 293.15; };
// The width of producer/injector wells as a fraction of the width of the spatial domain
template<class TypeTag, class MyTypeTag>
struct WellWidth { using type = Properties::UndefinedProperty; };
// set the defaults for some problem specific properties
template<class TypeTag>
struct MaxDepth<TypeTag, Properties::TTag::ReservoirBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 2500;
};
template<class TypeTag>
struct Temperature<TypeTag, Properties::TTag::ReservoirBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 293.15;
};
// The width of producer/injector wells as a fraction of the width of the spatial domain
template<class TypeTag>
struct WellWidth<TypeTag, Properties::TTag::ReservoirBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 0.01;
};
template<class Scalar>
struct WellWidth { static constexpr Scalar value = 0.01; };
} // namespace Opm::Parameters
@ -237,9 +216,9 @@ public:
{
ParentType::finishInit();
temperature_ = Parameters::get<TypeTag, Parameters::Temperature>();
maxDepth_ = Parameters::get<TypeTag, Parameters::MaxDepth>();
wellWidth_ = Parameters::get<TypeTag, Parameters::WellWidth>();
temperature_ = Parameters::Get<Parameters::Temperature<Scalar>>();
maxDepth_ = Parameters::Get<Parameters::MaxDepth<Scalar>>();
wellWidth_ = Parameters::Get<Parameters::WellWidth<Scalar>>();
std::vector<std::pair<Scalar, Scalar> > Bo = {
{ 101353, 1.062 },
@ -401,11 +380,11 @@ public:
{
ParentType::registerParameters();
Parameters::registerParam<TypeTag, Parameters::Temperature>
Parameters::Register<Parameters::Temperature<Scalar>>
("The temperature [K] in the reservoir");
Parameters::registerParam<TypeTag, Parameters::MaxDepth>
Parameters::Register<Parameters::MaxDepth<Scalar>>
("The maximum depth [m] of the reservoir");
Parameters::registerParam<TypeTag, Parameters::WellWidth>
Parameters::Register<Parameters::WellWidth<Scalar>>
("The width of producer/injector wells as a fraction of the width"
" of the spatial domain");