From 92cc1543d45a72cdf3350ca1ce2d47bfcfe84dc0 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Fri, 5 Jul 2024 17:49:51 +0200 Subject: [PATCH] move Co2InjectionProblem parameters to TypeTag-free parameter system --- examples/problems/co2injectionproblem.hh | 125 ++++++----------------- 1 file changed, 33 insertions(+), 92 deletions(-) diff --git a/examples/problems/co2injectionproblem.hh b/examples/problems/co2injectionproblem.hh index 77aade79c..6a2ae04c4 100644 --- a/examples/problems/co2injectionproblem.hh +++ b/examples/problems/co2injectionproblem.hh @@ -141,87 +141,28 @@ struct LinearSolverSplice { using type = namespace Opm::Parameters { -// declare the CO2 injection problem specific property tags -template -struct FluidSystemPressureLow { using type = Properties::UndefinedProperty; }; +struct FluidSystemNumPressure { static constexpr unsigned value = 100; }; +struct FluidSystemNumTemperature { static constexpr unsigned value = 100; }; -template -struct FluidSystemPressureHigh { using type = Properties::UndefinedProperty; }; +template +struct FluidSystemPressureHigh { static constexpr Scalar value = 4e7; }; -template -struct FluidSystemNumPressure { using type = Properties::UndefinedProperty; }; +template +struct FluidSystemPressureLow { static constexpr Scalar value = 3e7; }; -template -struct FluidSystemTemperatureLow { using type = Properties::UndefinedProperty; }; +template +struct FluidSystemTemperatureHigh { static constexpr Scalar value = 500.0; }; -template -struct FluidSystemTemperatureHigh { using type = Properties::UndefinedProperty; }; +template +struct FluidSystemTemperatureLow { static constexpr Scalar value = 290.0; }; -template -struct FluidSystemNumTemperature { using type = Properties::UndefinedProperty; }; +template +struct MaxDepth { static constexpr Scalar value = 2500.0; }; -template -struct MaxDepth { using type = Properties::UndefinedProperty; }; +struct SimulationName { static constexpr auto value = "co2injection"; }; -template -struct Temperature { using type = Properties::UndefinedProperty; }; - -template -struct SimulationName { using type = Properties::UndefinedProperty; }; - -template -struct FluidSystemNumPressure -{ static constexpr unsigned value = 100; }; - -template -struct FluidSystemNumTemperature -{ static constexpr unsigned value = 100; }; - -template -struct FluidSystemPressureHigh -{ - using type = GetPropType; - static constexpr type value = 4e7; -}; - -template -struct FluidSystemPressureLow -{ - using type = GetPropType; - static constexpr type value = 3e7; -}; - -template -struct FluidSystemTemperatureHigh -{ - using type = GetPropType; - static constexpr type value = 500; -}; - -template -struct FluidSystemTemperatureLow -{ - using type = GetPropType; - static constexpr type value = 290; -}; - -template -struct MaxDepth -{ - using type = GetPropType; - static constexpr type value = 2500; -}; - -template -struct SimulationName -{ static constexpr auto value = "co2injection"; }; - -template -struct Temperature -{ - using type = GetPropType; - static constexpr type value = 293.15; -}; +template +struct Temperature { static constexpr Scalar value = 293.15; }; } // namespace Opm::Parameters @@ -307,16 +248,16 @@ public: eps_ = 1e-6; - temperatureLow_ = Parameters::get(); - temperatureHigh_ = Parameters::get(); - nTemperature_ = Parameters::get(); + temperatureLow_ = Parameters::Get>(); + temperatureHigh_ = Parameters::Get>(); + nTemperature_ = Parameters::Get(); - pressureLow_ = Parameters::get(); - pressureHigh_ = Parameters::get(); - nPressure_ = Parameters::get(); + pressureLow_ = Parameters::Get>(); + pressureHigh_ = Parameters::Get>(); + nPressure_ = Parameters::Get(); - maxDepth_ = Parameters::get(); - temperature_ = Parameters::get(); + maxDepth_ = Parameters::Get>(); + temperature_ = Parameters::Get>(); // initialize the tables of the fluid system // FluidSystem::init(); @@ -369,23 +310,23 @@ public: { ParentType::registerParameters(); - Parameters::registerParam + Parameters::Register> ("The lower temperature [K] for tabulation of the fluid system"); - Parameters::registerParam + Parameters::Register> ("The upper temperature [K] for tabulation of the fluid system"); - Parameters::registerParam + Parameters::Register ("The number of intervals between the lower and upper temperature"); - Parameters::registerParam + Parameters::Register> ("The lower pressure [Pa] for tabulation of the fluid system"); - Parameters::registerParam + Parameters::Register> ("The upper pressure [Pa] for tabulation of the fluid system"); - Parameters::registerParam + Parameters::Register ("The number of intervals between the lower and upper pressure"); - Parameters::registerParam + Parameters::Register> ("The temperature [K] in the reservoir"); - Parameters::registerParam + Parameters::Register> ("The maximum depth [m] of the reservoir"); - Parameters::registerParam + Parameters::Register ("The name of the simulation used for the output files"); Parameters::SetDefault("data/co2injection.dgf"); @@ -406,7 +347,7 @@ public: std::string name() const { std::ostringstream oss; - oss << Parameters::get() + oss << Parameters::Get() << "_" << Model::name(); if (getPropValue()) oss << "_ni";