diff --git a/examples/problems/co2ptflashproblem.hh b/examples/problems/co2ptflashproblem.hh index 481d4f512..b512be650 100644 --- a/examples/problems/co2ptflashproblem.hh +++ b/examples/problems/co2ptflashproblem.hh @@ -66,16 +66,6 @@ namespace TTag { struct CO2PTBaseProblem {}; } // end namespace TTag -template -struct Temperature { using type = UndefinedProperty; }; -template -struct SimulationName { using type = UndefinedProperty; }; -template -struct EpisodeLength { using type = UndefinedProperty;}; - -template -struct Initialpressure { using type = UndefinedProperty;}; - template struct NumComp { using type = UndefinedProperty; }; @@ -139,31 +129,6 @@ public: using type = EffMaterialLaw; }; -// set the defaults for the problem specific properties - template - struct Temperature { - using type = GetPropType; - static constexpr type value = 423.25;//TODO - }; - -template -struct Initialpressure { - using type = GetPropType; - static constexpr type value = 75.e5; -}; - -template -struct SimulationName { - static constexpr auto value = "co2_ptflash"; -}; - -// this is kinds of telling the report step length -template -struct EpisodeLength { - using type = GetPropType; - static constexpr type value = 0.1 * 60. * 60.; -}; - // mesh grid template struct Vanguard { @@ -179,6 +144,18 @@ struct EnableEnergy { namespace Opm::Parameters { +template +struct Temperature { using type = Properties::UndefinedProperty; }; + +template +struct SimulationName { using type = Properties::UndefinedProperty; }; + +template +struct EpisodeLength { using type = Properties::UndefinedProperty;}; + +template +struct Initialpressure { using type = Properties::UndefinedProperty;}; + template struct CellsX { static constexpr unsigned value = 30; }; @@ -230,6 +207,21 @@ struct EndTime static constexpr type value = 60. * 60.; }; +// this is kinds of telling the report step length +template +struct EpisodeLength +{ + using type = GetPropType; + static constexpr type value = 0.1 * 60. * 60.; +}; + +template +struct Initialpressure +{ + using type = GetPropType; + static constexpr type value = 75.e5; +}; + // convergence control template struct InitialTimeStepSize @@ -275,6 +267,18 @@ template struct NewtonMaxIterations { static constexpr int value = 30; }; +template +struct SimulationName +{ static constexpr auto value = "co2_ptflash"; }; + +// set the defaults for the problem specific properties + template + struct Temperature +{ + using type = GetPropType; + static constexpr type value = 423.25; // TODO + }; + template struct VtkWriteEquilibriumConstants { static constexpr bool value = true; }; @@ -357,7 +361,7 @@ public: explicit CO2PTProblem(Simulator& simulator) : ParentType(simulator) { - const Scalar epi_len = Parameters::get(); + const Scalar epi_len = Parameters::get(); simulator.setEpisodeLength(epi_len); FluidSystem::init(); using CompParm = typename FluidSystem::ComponentParam; @@ -375,7 +379,7 @@ public: void initPetrophysics() { - temperature_ = Parameters::get(); + temperature_ = Parameters::get(); K_ = this->toDimMatrix_(9.869232667160131e-14); porosity_ = 0.1; @@ -383,7 +387,9 @@ public: template const DimVector& - gravity([[maybe_unused]]const Context& context, [[maybe_unused]] unsigned spaceIdx, [[maybe_unused]] unsigned timeIdx) const + gravity([[maybe_unused]]const Context& context, + [[maybe_unused]] unsigned spaceIdx, + [[maybe_unused]] unsigned timeIdx) const { return gravity(); } @@ -410,13 +416,13 @@ public: { ParentType::registerParameters(); - Parameters::registerParam + Parameters::registerParam ("The temperature [K] in the reservoir"); - Parameters::registerParam + Parameters::registerParam ("The initial pressure [Pa s] in the reservoir"); - Parameters::registerParam + Parameters::registerParam ("The name of the simulation used for the output files"); - Parameters::registerParam + Parameters::registerParam ("Time interval [s] for episode length"); } @@ -426,7 +432,7 @@ public: std::string name() const { std::ostringstream oss; - oss << Parameters::get(); + oss << Parameters::get(); return oss.str(); } @@ -435,7 +441,7 @@ public: // the old one. void endEpisode() { - Scalar epi_len = Parameters::get(); + Scalar epi_len = Parameters::get(); this->simulator().startNextEpisode(epi_len); } @@ -577,7 +583,7 @@ private: sat[0] = 1.0; sat[1] = 1.0 - sat[0]; - Scalar p0 = Parameters::get(); + Scalar p0 = Parameters::get(); //\Note, for an AD variable, if we multiply it with 2, the derivative will also be scalced with 2, //\Note, so we should not do it. @@ -630,6 +636,7 @@ private: MaterialLawParams mat_; DimVector gravity_; }; + } // namespace Opm #endif