changed: move the Co2InjectionProblem parameters to Opm::Parameters

This commit is contained in:
Arne Morten Kvarving 2024-07-01 14:13:14 +02:00
parent 2cb931e11e
commit 024bbe09eb

View File

@ -57,11 +57,12 @@
#include <string> #include <string>
namespace Opm { namespace Opm {
//! \cond SKIP_THIS //! \cond SKIP_THIS
template <class TypeTag> template <class TypeTag>
class Co2InjectionProblem; class Co2InjectionProblem;
//! \endcond //! \endcond
} }
namespace Opm::Properties { namespace Opm::Properties {
@ -70,27 +71,6 @@ namespace TTag {
struct Co2InjectionBaseProblem {}; struct Co2InjectionBaseProblem {};
} }
// declare the CO2 injection problem specific property tags
template<class TypeTag, class MyTypeTag>
struct FluidSystemPressureLow { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct FluidSystemPressureHigh { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct FluidSystemNumPressure { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct FluidSystemTemperatureLow { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct FluidSystemTemperatureHigh { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct FluidSystemNumTemperature { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct MaxDepth { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct Temperature { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct SimulationName { using type = UndefinedProperty; };
// Set the grid type // Set the grid type
template<class TypeTag> template<class TypeTag>
struct Grid<TypeTag, TTag::Co2InjectionBaseProblem> { using type = Dune::YaspGrid<2>; }; struct Grid<TypeTag, TTag::Co2InjectionBaseProblem> { using type = Dune::YaspGrid<2>; };
@ -157,55 +137,38 @@ struct SolidEnergyLaw<TypeTag, TTag::Co2InjectionBaseProblem>
template<class TypeTag> template<class TypeTag>
struct LinearSolverSplice<TypeTag, TTag::Co2InjectionBaseProblem> { using type = TTag::ParallelAmgLinearSolver; }; struct LinearSolverSplice<TypeTag, TTag::Co2InjectionBaseProblem> { using type = TTag::ParallelAmgLinearSolver; };
// set the defaults for the problem specific properties
template<class TypeTag>
struct FluidSystemPressureLow<TypeTag, TTag::Co2InjectionBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 3e7;
};
template<class TypeTag>
struct FluidSystemPressureHigh<TypeTag, TTag::Co2InjectionBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 4e7;
};
template<class TypeTag>
struct FluidSystemNumPressure<TypeTag, TTag::Co2InjectionBaseProblem> { static constexpr unsigned value = 100; };
template<class TypeTag>
struct FluidSystemTemperatureLow<TypeTag, TTag::Co2InjectionBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 290;
};
template<class TypeTag>
struct FluidSystemTemperatureHigh<TypeTag, TTag::Co2InjectionBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 500;
};
template<class TypeTag>
struct FluidSystemNumTemperature<TypeTag, TTag::Co2InjectionBaseProblem> { static constexpr unsigned value = 100; };
template<class TypeTag>
struct MaxDepth<TypeTag, TTag::Co2InjectionBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 2500;
};
template<class TypeTag>
struct Temperature<TypeTag, TTag::Co2InjectionBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 293.15;
};
template<class TypeTag>
struct SimulationName<TypeTag, TTag::Co2InjectionBaseProblem> { static constexpr auto value = "co2injection"; };
} // namespace Opm::Properties } // namespace Opm::Properties
namespace Opm::Parameters { namespace Opm::Parameters {
// declare the CO2 injection problem specific property tags
template<class TypeTag, class MyTypeTag>
struct FluidSystemPressureLow { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct FluidSystemPressureHigh { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct FluidSystemNumPressure { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct FluidSystemTemperatureLow { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct FluidSystemTemperatureHigh { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct FluidSystemNumTemperature { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct MaxDepth { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct Temperature { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct SimulationName { using type = Properties::UndefinedProperty; };
// Enable gravity // Enable gravity
template<class TypeTag> template<class TypeTag>
struct EnableGravity<TypeTag, Properties::TTag::Co2InjectionBaseProblem> struct EnableGravity<TypeTag, Properties::TTag::Co2InjectionBaseProblem>
@ -219,6 +182,42 @@ struct EndTime<TypeTag, Properties::TTag::Co2InjectionBaseProblem>
static constexpr type value = 1e4; static constexpr type value = 1e4;
}; };
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;
};
// The default DGF file to load // The default DGF file to load
template<class TypeTag> template<class TypeTag>
struct GridFile<TypeTag, Properties::TTag::Co2InjectionBaseProblem> struct GridFile<TypeTag, Properties::TTag::Co2InjectionBaseProblem>
@ -232,11 +231,29 @@ struct InitialTimeStepSize<TypeTag, Properties::TTag::Co2InjectionBaseProblem>
static constexpr type value = 250; static constexpr type value = 250;
}; };
template<class TypeTag>
struct MaxDepth<TypeTag, Properties::TTag::Co2InjectionBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 2500;
};
// Write the Newton convergence behavior to disk? // Write the Newton convergence behavior to disk?
template<class TypeTag> template<class TypeTag>
struct NewtonWriteConvergence<TypeTag, Properties::TTag::Co2InjectionBaseProblem> struct NewtonWriteConvergence<TypeTag, Properties::TTag::Co2InjectionBaseProblem>
{ static constexpr bool value = false; }; { static constexpr bool value = false; };
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
namespace Opm { namespace Opm {
@ -318,16 +335,16 @@ public:
eps_ = 1e-6; eps_ = 1e-6;
temperatureLow_ = Parameters::get<TypeTag, Properties::FluidSystemTemperatureLow>(); temperatureLow_ = Parameters::get<TypeTag, Parameters::FluidSystemTemperatureLow>();
temperatureHigh_ = Parameters::get<TypeTag, Properties::FluidSystemTemperatureHigh>(); temperatureHigh_ = Parameters::get<TypeTag, Parameters::FluidSystemTemperatureHigh>();
nTemperature_ = Parameters::get<TypeTag, Properties::FluidSystemNumTemperature>(); nTemperature_ = Parameters::get<TypeTag, Parameters::FluidSystemNumTemperature>();
pressureLow_ = Parameters::get<TypeTag, Properties::FluidSystemPressureLow>(); pressureLow_ = Parameters::get<TypeTag, Parameters::FluidSystemPressureLow>();
pressureHigh_ = Parameters::get<TypeTag, Properties::FluidSystemPressureHigh>(); pressureHigh_ = Parameters::get<TypeTag, Parameters::FluidSystemPressureHigh>();
nPressure_ = Parameters::get<TypeTag, Properties::FluidSystemNumPressure>(); nPressure_ = Parameters::get<TypeTag, Parameters::FluidSystemNumPressure>();
maxDepth_ = Parameters::get<TypeTag, Properties::MaxDepth>(); maxDepth_ = Parameters::get<TypeTag, Parameters::MaxDepth>();
temperature_ = Parameters::get<TypeTag, Properties::Temperature>(); temperature_ = Parameters::get<TypeTag, Parameters::Temperature>();
// initialize the tables of the fluid system // initialize the tables of the fluid system
// FluidSystem::init(); // FluidSystem::init();
@ -380,23 +397,23 @@ public:
{ {
ParentType::registerParameters(); ParentType::registerParameters();
Parameters::registerParam<TypeTag, Properties::FluidSystemTemperatureLow> Parameters::registerParam<TypeTag, Parameters::FluidSystemTemperatureLow>
("The lower temperature [K] for tabulation of the fluid system"); ("The lower temperature [K] for tabulation of the fluid system");
Parameters::registerParam<TypeTag, Properties::FluidSystemTemperatureHigh> Parameters::registerParam<TypeTag, Parameters::FluidSystemTemperatureHigh>
("The upper temperature [K] for tabulation of the fluid system"); ("The upper temperature [K] for tabulation of the fluid system");
Parameters::registerParam<TypeTag, Properties::FluidSystemNumTemperature> Parameters::registerParam<TypeTag, 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, Properties::FluidSystemPressureLow> Parameters::registerParam<TypeTag, Parameters::FluidSystemPressureLow>
("The lower pressure [Pa] for tabulation of the fluid system"); ("The lower pressure [Pa] for tabulation of the fluid system");
Parameters::registerParam<TypeTag, Properties::FluidSystemPressureHigh> Parameters::registerParam<TypeTag, Parameters::FluidSystemPressureHigh>
("The upper pressure [Pa] for tabulation of the fluid system"); ("The upper pressure [Pa] for tabulation of the fluid system");
Parameters::registerParam<TypeTag, Properties::FluidSystemNumPressure> Parameters::registerParam<TypeTag, 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, Properties::Temperature> Parameters::registerParam<TypeTag, Parameters::Temperature>
("The temperature [K] in the reservoir"); ("The temperature [K] in the reservoir");
Parameters::registerParam<TypeTag, Properties::MaxDepth> Parameters::registerParam<TypeTag, Parameters::MaxDepth>
("The maximum depth [m] of the reservoir"); ("The maximum depth [m] of the reservoir");
Parameters::registerParam<TypeTag, Properties::SimulationName> Parameters::registerParam<TypeTag, Parameters::SimulationName>
("The name of the simulation used for the output files"); ("The name of the simulation used for the output files");
} }
@ -411,7 +428,7 @@ public:
std::string name() const std::string name() const
{ {
std::ostringstream oss; std::ostringstream oss;
oss << Parameters::get<TypeTag, Properties::SimulationName>() oss << Parameters::get<TypeTag, Parameters::SimulationName>()
<< "_" << Model::name(); << "_" << Model::name();
if (getPropValue<TypeTag, Properties::EnableEnergy>()) if (getPropValue<TypeTag, Properties::EnableEnergy>())
oss << "_ni"; oss << "_ni";
@ -706,6 +723,7 @@ private:
Scalar pressureLow_, pressureHigh_; Scalar pressureLow_, pressureHigh_;
Scalar temperatureLow_, temperatureHigh_; Scalar temperatureLow_, temperatureHigh_;
}; };
} // namespace Opm } // namespace Opm
#endif #endif