move Co2InjectionProblem parameters to TypeTag-free parameter system

This commit is contained in:
Arne Morten Kvarving 2024-07-05 17:49:51 +02:00
parent 87b1ea17b4
commit 92cc1543d4

View File

@ -141,87 +141,28 @@ struct LinearSolverSplice<TypeTag, TTag::Co2InjectionBaseProblem> { using type =
namespace Opm::Parameters { namespace Opm::Parameters {
// declare the CO2 injection problem specific property tags struct FluidSystemNumPressure { static constexpr unsigned value = 100; };
template<class TypeTag, class MyTypeTag> struct FluidSystemNumTemperature { static constexpr unsigned value = 100; };
struct FluidSystemPressureLow { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct FluidSystemPressureHigh { using type = Properties::UndefinedProperty; }; struct FluidSystemPressureHigh { static constexpr Scalar value = 4e7; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct FluidSystemNumPressure { using type = Properties::UndefinedProperty; }; struct FluidSystemPressureLow { static constexpr Scalar value = 3e7; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct FluidSystemTemperatureLow { using type = Properties::UndefinedProperty; }; struct FluidSystemTemperatureHigh { static constexpr Scalar value = 500.0; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct FluidSystemTemperatureHigh { using type = Properties::UndefinedProperty; }; struct FluidSystemTemperatureLow { static constexpr Scalar value = 290.0; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct FluidSystemNumTemperature { using type = Properties::UndefinedProperty; }; struct MaxDepth { static constexpr Scalar value = 2500.0; };
template<class TypeTag, class MyTypeTag> struct SimulationName { static constexpr auto value = "co2injection"; };
struct MaxDepth { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct Temperature { using type = Properties::UndefinedProperty; }; struct Temperature { static constexpr Scalar value = 293.15; };
template<class TypeTag, class MyTypeTag>
struct SimulationName { using type = Properties::UndefinedProperty; };
template<class TypeTag>
struct FluidSystemNumPressure<TypeTag, Properties::TTag::Co2InjectionBaseProblem>
{ static constexpr unsigned value = 100; };
template<class TypeTag>
struct FluidSystemNumTemperature<TypeTag, Properties::TTag::Co2InjectionBaseProblem>
{ static constexpr unsigned value = 100; };
template<class TypeTag>
struct FluidSystemPressureHigh<TypeTag, Properties::TTag::Co2InjectionBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 4e7;
};
template<class TypeTag>
struct FluidSystemPressureLow<TypeTag, Properties::TTag::Co2InjectionBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 3e7;
};
template<class TypeTag>
struct FluidSystemTemperatureHigh<TypeTag, Properties::TTag::Co2InjectionBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 500;
};
template<class TypeTag>
struct FluidSystemTemperatureLow<TypeTag, Properties::TTag::Co2InjectionBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 290;
};
template<class TypeTag>
struct MaxDepth<TypeTag, Properties::TTag::Co2InjectionBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 2500;
};
template<class TypeTag>
struct SimulationName<TypeTag, Properties::TTag::Co2InjectionBaseProblem>
{ static constexpr auto value = "co2injection"; };
template<class TypeTag>
struct Temperature<TypeTag, Properties::TTag::Co2InjectionBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 293.15;
};
} // namespace Opm::Parameters } // namespace Opm::Parameters
@ -307,16 +248,16 @@ public:
eps_ = 1e-6; eps_ = 1e-6;
temperatureLow_ = Parameters::get<TypeTag, Parameters::FluidSystemTemperatureLow>(); temperatureLow_ = Parameters::Get<Parameters::FluidSystemTemperatureLow<Scalar>>();
temperatureHigh_ = Parameters::get<TypeTag, Parameters::FluidSystemTemperatureHigh>(); temperatureHigh_ = Parameters::Get<Parameters::FluidSystemTemperatureHigh<Scalar>>();
nTemperature_ = Parameters::get<TypeTag, Parameters::FluidSystemNumTemperature>(); nTemperature_ = Parameters::Get<Parameters::FluidSystemNumTemperature>();
pressureLow_ = Parameters::get<TypeTag, Parameters::FluidSystemPressureLow>(); pressureLow_ = Parameters::Get<Parameters::FluidSystemPressureLow<Scalar>>();
pressureHigh_ = Parameters::get<TypeTag, Parameters::FluidSystemPressureHigh>(); pressureHigh_ = Parameters::Get<Parameters::FluidSystemPressureHigh<Scalar>>();
nPressure_ = Parameters::get<TypeTag, Parameters::FluidSystemNumPressure>(); nPressure_ = Parameters::Get<Parameters::FluidSystemNumPressure>();
maxDepth_ = Parameters::get<TypeTag, Parameters::MaxDepth>(); maxDepth_ = Parameters::Get<Parameters::MaxDepth<Scalar>>();
temperature_ = Parameters::get<TypeTag, Parameters::Temperature>(); temperature_ = Parameters::Get<Parameters::Temperature<Scalar>>();
// initialize the tables of the fluid system // initialize the tables of the fluid system
// FluidSystem::init(); // FluidSystem::init();
@ -369,23 +310,23 @@ public:
{ {
ParentType::registerParameters(); ParentType::registerParameters();
Parameters::registerParam<TypeTag, Parameters::FluidSystemTemperatureLow> Parameters::Register<Parameters::FluidSystemTemperatureLow<Scalar>>
("The lower temperature [K] for tabulation of the fluid system"); ("The lower temperature [K] for tabulation of the fluid system");
Parameters::registerParam<TypeTag, Parameters::FluidSystemTemperatureHigh> Parameters::Register<Parameters::FluidSystemTemperatureHigh<Scalar>>
("The upper temperature [K] for tabulation of the fluid system"); ("The upper temperature [K] for tabulation of the fluid system");
Parameters::registerParam<TypeTag, Parameters::FluidSystemNumTemperature> Parameters::Register<Parameters::FluidSystemNumTemperature>
("The number of intervals between the lower and upper temperature"); ("The number of intervals between the lower and upper temperature");
Parameters::registerParam<TypeTag, Parameters::FluidSystemPressureLow> Parameters::Register<Parameters::FluidSystemPressureLow<Scalar>>
("The lower pressure [Pa] for tabulation of the fluid system"); ("The lower pressure [Pa] for tabulation of the fluid system");
Parameters::registerParam<TypeTag, Parameters::FluidSystemPressureHigh> Parameters::Register<Parameters::FluidSystemPressureHigh<Scalar>>
("The upper pressure [Pa] for tabulation of the fluid system"); ("The upper pressure [Pa] for tabulation of the fluid system");
Parameters::registerParam<TypeTag, Parameters::FluidSystemNumPressure> Parameters::Register<Parameters::FluidSystemNumPressure>
("The number of intervals between the lower and upper pressure"); ("The number of intervals between the lower and upper pressure");
Parameters::registerParam<TypeTag, Parameters::Temperature> Parameters::Register<Parameters::Temperature<Scalar>>
("The temperature [K] in the reservoir"); ("The temperature [K] in the reservoir");
Parameters::registerParam<TypeTag, Parameters::MaxDepth> Parameters::Register<Parameters::MaxDepth<Scalar>>
("The maximum depth [m] of the reservoir"); ("The maximum depth [m] of the reservoir");
Parameters::registerParam<TypeTag, Parameters::SimulationName> Parameters::Register<Parameters::SimulationName>
("The name of the simulation used for the output files"); ("The name of the simulation used for the output files");
Parameters::SetDefault<Parameters::GridFile>("data/co2injection.dgf"); Parameters::SetDefault<Parameters::GridFile>("data/co2injection.dgf");
@ -406,7 +347,7 @@ public:
std::string name() const std::string name() const
{ {
std::ostringstream oss; std::ostringstream oss;
oss << Parameters::get<TypeTag, Parameters::SimulationName>() oss << Parameters::Get<Parameters::SimulationName>()
<< "_" << Model::name(); << "_" << Model::name();
if (getPropValue<TypeTag, Properties::EnableEnergy>()) if (getPropValue<TypeTag, Properties::EnableEnergy>())
oss << "_ni"; oss << "_ni";