diff --git a/examples/co2injection_flash_ecfv.cpp b/examples/co2injection_flash_ecfv.cpp index ea7358d96..cce743128 100644 --- a/examples/co2injection_flash_ecfv.cpp +++ b/examples/co2injection_flash_ecfv.cpp @@ -75,21 +75,11 @@ struct Scalar } // namespace Opm::Properties -namespace Opm::Parameters { - -#if ! HAVE_QUAD -template -struct NewtonTolerance -{ - using type = GetPropType; - static constexpr type value = 1e-5; -}; -#endif - -} // namespace Opm::Parameters - int main(int argc, char **argv) { using EcfvProblemTypeTag = Opm::Properties::TTag::Co2InjectionFlashEcfvProblem; +#if ! HAVE_QUAD + Opm::Co2InjectionTolerance = 1e-5; +#endif return Opm::start(argc, argv); } diff --git a/examples/co2injection_flash_ni_ecfv.cpp b/examples/co2injection_flash_ni_ecfv.cpp index b5419ee75..36f0a8921 100644 --- a/examples/co2injection_flash_ni_ecfv.cpp +++ b/examples/co2injection_flash_ni_ecfv.cpp @@ -77,21 +77,11 @@ struct Scalar } // namespace Opm::Properties -namespace Opm::Parameters { - -#if ! HAVE_QUAD -template -struct NewtonTolerance -{ - using type = GetPropType; - static constexpr type value = 1e-5; -}; -#endif - -} // namespace Opm::Parameters - int main(int argc, char **argv) { using EcfvProblemTypeTag = Opm::Properties::TTag::Co2InjectionFlashNiEcfvProblem; +#if ! HAVE_QUAD + Opm::Co2InjectionTolerance = 1e-5; +#endif return Opm::start(argc, argv); } diff --git a/examples/co2injection_flash_ni_vcfv.cpp b/examples/co2injection_flash_ni_vcfv.cpp index 99ea4cfbf..f448a67fe 100644 --- a/examples/co2injection_flash_ni_vcfv.cpp +++ b/examples/co2injection_flash_ni_vcfv.cpp @@ -73,21 +73,11 @@ struct Scalar } // namespace Opm::Properties -namespace Opm::Parameters { - -#if ! HAVE_QUAD -template -struct NewtonTolerance -{ - using type = GetPropType; - static constexpr type value = 1e-5; -}; -#endif - -} // namespace Opm::Parameters - int main(int argc, char **argv) { using VcfvProblemTypeTag = Opm::Properties::TTag::Co2InjectionFlashNiVcfvProblem; +#if ! HAVE_QUAD + Opm::Co2InjectionTolerance = 1e-5; +#endif return Opm::start(argc, argv); } diff --git a/examples/co2injection_flash_vcfv.cpp b/examples/co2injection_flash_vcfv.cpp index 3c66fa159..d4a100e34 100644 --- a/examples/co2injection_flash_vcfv.cpp +++ b/examples/co2injection_flash_vcfv.cpp @@ -69,21 +69,11 @@ struct Scalar } // namespace Opm::Properties -namespace Opm::Parameters { - -#if ! HAVE_QUAD -template -struct NewtonTolerance -{ - using type = GetPropType; - static constexpr type value = 1e-5; -}; -#endif - -} // namespace Opm::Parameters - int main(int argc, char **argv) { using VcfvProblemTypeTag = Opm::Properties::TTag::Co2InjectionFlashVcfvProblem; +#if ! HAVE_QUAD + Opm::Co2InjectionTolerance = 1e-5; +#endif return Opm::start(argc, argv); } diff --git a/examples/problems/co2injectionproblem.hh b/examples/problems/co2injectionproblem.hh index 404b934e7..6a2ae04c4 100644 --- a/examples/problems/co2injectionproblem.hh +++ b/examples/problems/co2injectionproblem.hh @@ -141,101 +141,35 @@ 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; }; - -// Enable gravity -template -struct EnableGravity -{ static constexpr bool value = true; }; - -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; -}; - -// Write the Newton convergence behavior to disk? -template -struct NewtonWriteConvergence -{ static constexpr bool value = false; }; - -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 namespace Opm { + +double Co2InjectionTolerance = 1e-8; + /*! * \ingroup TestProblems * @@ -314,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(); @@ -376,28 +310,30 @@ 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"); Parameters::SetDefault>(1e4); Parameters::SetDefault>(250); + Parameters::SetDefault>(Scalar{Co2InjectionTolerance}); + Parameters::SetDefault(true); } /*! @@ -411,7 +347,7 @@ public: std::string name() const { std::ostringstream oss; - oss << Parameters::get() + oss << Parameters::Get() << "_" << Model::name(); if (getPropValue()) oss << "_ni"; diff --git a/examples/problems/co2ptflashproblem.hh b/examples/problems/co2ptflashproblem.hh index 0b99ed78d..318b772b2 100644 --- a/examples/problems/co2ptflashproblem.hh +++ b/examples/problems/co2ptflashproblem.hh @@ -144,114 +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;}; - -// Enable gravity false -template -struct EnableGravity -{ static constexpr bool value = false; }; - // 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 EpisodeLength { static constexpr Scalar value = 0.1 * 60. * 60.; }; -template -struct Initialpressure -{ - using type = GetPropType; - static constexpr type value = 75.e5; -}; +template +struct Initialpressure { static constexpr Scalar value = 75e5; }; -template -struct LinearSolverAbsTolerance -{ - using type = GetPropType; - static constexpr type value = 0.; -}; - -template -struct LinearSolverTolerance -{ - using type = GetPropType; - static constexpr type value = 1e-3; -}; - -// Write the Newton convergence behavior to disk? -template -struct NewtonWriteConvergence -{ static constexpr bool value = false; }; - -template -struct NewtonTolerance -{ - using type = GetPropType; - static constexpr type value = 1e-3; -}; - -template -struct NewtonTargetIterations -{ - using type = GetPropType; - static constexpr type value = 6; -}; - -template -struct NewtonMaxIterations -{ static constexpr int value = 30; }; - -template -struct SimulationName -{ static constexpr auto value = "co2_ptflash"; }; +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; }; - -template -struct VtkWriteFilterVelocities -{ static constexpr bool value = true; }; - -template -struct VtkWriteFugacityCoeffs -{ static constexpr bool value = true; }; - -template -struct VtkWriteLiquidMoleFractions -{ static constexpr bool value = true; }; - -template -struct VtkWritePotentialGradients -{ static constexpr bool value = true; }; - -template -struct VtkWriteTotalMassFractions -{ static constexpr bool value = true; }; - -template -struct VtkWriteTotalMoleFractions -{ static constexpr bool value = true; }; +template +struct Temperature { static constexpr Scalar value = 423.25; }; } // namespace Opm::Parameters @@ -307,7 +211,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; @@ -325,7 +229,7 @@ public: void initPetrophysics() { - temperature_ = Parameters::get(); + temperature_ = Parameters::Get>(); K_ = this->toDimMatrix_(9.869232667160131e-14); porosity_ = 0.1; @@ -362,13 +266,13 @@ public: { ParentType::registerParameters(); - Parameters::registerParam + Parameters::Register> ("The temperature [K] in the reservoir"); - Parameters::registerParam + Parameters::Register> ("The initial pressure [Pa s] in the reservoir"); - Parameters::registerParam + Parameters::Register ("The name of the simulation used for the output files"); - Parameters::registerParam + Parameters::Register> ("Time interval [s] for episode length"); Parameters::SetDefault(30); @@ -385,6 +289,19 @@ public: Parameters::SetDefault>(60. * 60.); Parameters::SetDefault>(0.1 * 60. * 60.); + Parameters::SetDefault(30); + Parameters::SetDefault(6); + Parameters::SetDefault>(1e-3); + Parameters::SetDefault(true); + Parameters::SetDefault(true); + Parameters::SetDefault(true); + Parameters::SetDefault(true); + Parameters::SetDefault(true); + Parameters::SetDefault(true); + Parameters::SetDefault(true); + + Parameters::SetDefault>(0.0); + Parameters::SetDefault>(1e-3); } /*! @@ -393,7 +310,7 @@ public: std::string name() const { std::ostringstream oss; - oss << Parameters::get(); + oss << Parameters::Get(); return oss.str(); } @@ -402,7 +319,7 @@ public: // the old one. void endEpisode() { - Scalar epi_len = Parameters::get(); + Scalar epi_len = Parameters::Get>(); this->simulator().startNextEpisode(epi_len); } @@ -544,7 +461,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. diff --git a/examples/problems/cuvetteproblem.hh b/examples/problems/cuvetteproblem.hh index b8f248323..b3af92b57 100644 --- a/examples/problems/cuvetteproblem.hh +++ b/examples/problems/cuvetteproblem.hh @@ -114,15 +114,6 @@ public: } // namespace Opm::Properties -namespace Opm::Parameters { - -// Enable gravity -template -struct EnableGravity -{ static constexpr bool value = true; }; - -} // namespace Opm::Parameters - namespace Opm { /*! * \ingroup TestProblems @@ -291,6 +282,7 @@ public: Parameters::SetDefault>(100.0); Parameters::SetDefault>(1.0); Parameters::SetDefault>(600.0); + Parameters::SetDefault(true); } /*! diff --git a/examples/problems/diffusionproblem.hh b/examples/problems/diffusionproblem.hh index e4b480e89..879a7152e 100644 --- a/examples/problems/diffusionproblem.hh +++ b/examples/problems/diffusionproblem.hh @@ -108,15 +108,6 @@ struct EnableDiffusion { static constexpr b } // namespace Opm::Properties -namespace Opm::Parameters { - -// Disable gravity -template -struct EnableGravity -{ static constexpr bool value = false; }; - -} // namespace Opm::Parameters - namespace Opm { /*! * \ingroup TestProblems diff --git a/examples/problems/fingerproblem.hh b/examples/problems/fingerproblem.hh index 7431e90b8..f4b6acbb2 100644 --- a/examples/problems/fingerproblem.hh +++ b/examples/problems/fingerproblem.hh @@ -28,32 +28,38 @@ #ifndef EWOMS_FINGER_PROBLEM_HH #define EWOMS_FINGER_PROBLEM_HH -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - #if HAVE_DUNE_ALUGRID #include #endif -#include -#include #include +#include +#include + #include -#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include + +#include + +#include +#include + +#include + +#include + #include namespace Opm { @@ -128,25 +134,8 @@ struct EnableConstraints { static constexpr in namespace Opm::Parameters { -template -struct InitialWaterSaturation { using type = Properties::UndefinedProperty; }; - -// Enable gravity -template -struct EnableGravity -{ static constexpr bool value = true; }; - -template -struct InitialWaterSaturation -{ - using type = GetPropType; - static constexpr type value = 0.01; -}; - -// Write the solutions of individual newton iterations? -template -struct NewtonWriteConvergence -{ static constexpr bool value = false; }; +template +struct InitialWaterSaturation { static constexpr Scalar value = 0.01; }; } // namespace Opm::Parameters @@ -263,7 +252,7 @@ public: { ParentType::registerParameters(); - Parameters::registerParam + Parameters::Register> ("The initial saturation in the domain [] of the wetting phase"); Parameters::SetDefault(20); @@ -283,6 +272,7 @@ public: Parameters::SetDefault>(215); Parameters::SetDefault>(10); + Parameters::SetDefault(true); } /*! @@ -534,7 +524,7 @@ private: auto& fs = initialFluidState_; fs.setPressure(wettingPhaseIdx, /*pressure=*/1e5); - Scalar Sw = Parameters::get(); + Scalar Sw = Parameters::Get>(); fs.setSaturation(wettingPhaseIdx, Sw); fs.setSaturation(nonWettingPhaseIdx, 1 - Sw); diff --git a/examples/problems/fractureproblem.hh b/examples/problems/fractureproblem.hh index 83ba3986e..e0f34907b 100644 --- a/examples/problems/fractureproblem.hh +++ b/examples/problems/fractureproblem.hh @@ -158,15 +158,6 @@ struct EnableConstraints { static constexpr bool } // namespace Opm::Properties -namespace Opm::Parameters { - -// Disable gravity -template -struct EnableGravity -{ static constexpr bool value = false; }; - -} // namespace Opm::Parameters - namespace Opm { /*! * \ingroup TestProblems diff --git a/examples/problems/groundwaterproblem.hh b/examples/problems/groundwaterproblem.hh index 5e37f3e12..28cf81971 100644 --- a/examples/problems/groundwaterproblem.hh +++ b/examples/problems/groundwaterproblem.hh @@ -28,19 +28,22 @@ #ifndef EWOMS_GROUND_WATER_PROBLEM_HH #define EWOMS_GROUND_WATER_PROBLEM_HH -#include -#include +#include +#include +#include + +#include +#include #include #include #include -#include -#include +#include -#include -#include -#include +#include + +#include #include #include @@ -88,90 +91,29 @@ struct LinearSolverWrapper namespace Opm::Parameters { -template -struct LensLowerLeftX { using type = Properties::UndefinedProperty; }; +template +struct LensLowerLeftX { static constexpr Scalar value = 0.25; }; -template -struct LensLowerLeftY { using type = Properties::UndefinedProperty; }; +template +struct LensLowerLeftY { static constexpr Scalar value = 0.25; }; -template -struct LensLowerLeftZ { using type = Properties::UndefinedProperty; }; +template +struct LensLowerLeftZ { static constexpr Scalar value = 0.25; }; -template -struct LensUpperRightX { using type = Properties::UndefinedProperty; }; +template +struct LensUpperRightX { static constexpr Scalar value = 0.75; }; -template -struct LensUpperRightY { using type = Properties::UndefinedProperty; }; +template +struct LensUpperRightY { static constexpr Scalar value = 0.75; }; -template -struct LensUpperRightZ { using type = Properties::UndefinedProperty; }; +template +struct LensUpperRightZ { static constexpr Scalar value = 0.75; }; -template -struct Permeability { using type = Properties::UndefinedProperty; }; +template +struct Permeability { static constexpr Scalar value = 1e-10; }; -template -struct PermeabilityLens { using type = Properties::UndefinedProperty; }; - -// Enable gravity -template -struct EnableGravity -{ static constexpr bool value = true; }; - -template -struct LensLowerLeftX -{ - using type = GetPropType; - static constexpr type value = 0.25; -}; - -template -struct LensLowerLeftY -{ - using type = GetPropType; - static constexpr type value = 0.25; -}; - -template -struct LensLowerLeftZ -{ - using type = GetPropType; - static constexpr type value = 0.25; -}; - -template -struct LensUpperRightX -{ - using type = GetPropType; - static constexpr type value = 0.75; -}; - -template -struct LensUpperRightY -{ - using type = GetPropType; - static constexpr type value = 0.75; -}; - -template -struct LensUpperRightZ -{ - using type = GetPropType; - static constexpr type value = 0.75; -}; - -template -struct Permeability -{ - using type = GetPropType; - static constexpr type value = 1e-10; -}; - -template -struct PermeabilityLens -{ - using type = GetPropType; - static constexpr type value = 1e-12; -}; +template +struct PermeabilityLens { static constexpr Scalar value = 1e-12; }; } // namespace Opm::Parameters @@ -239,20 +181,20 @@ public: eps_ = 1.0e-3; - lensLowerLeft_[0] = Parameters::get(); + lensLowerLeft_[0] = Parameters::Get>(); if (dim > 1) - lensLowerLeft_[1] = Parameters::get(); + lensLowerLeft_[1] = Parameters::Get>(); if (dim > 2) - lensLowerLeft_[2] = Parameters::get(); + lensLowerLeft_[2] = Parameters::Get>(); - lensUpperRight_[0] = Parameters::get(); + lensUpperRight_[0] = Parameters::Get>(); if (dim > 1) - lensUpperRight_[1] = Parameters::get(); + lensUpperRight_[1] = Parameters::Get>(); if (dim > 2) - lensUpperRight_[2] = Parameters::get(); + lensUpperRight_[2] = Parameters::Get>(); - intrinsicPerm_ = this->toDimMatrix_(Parameters::get()); - intrinsicPermLens_ = this->toDimMatrix_(Parameters::get()); + intrinsicPerm_ = this->toDimMatrix_(Parameters::Get>()); + intrinsicPermLens_ = this->toDimMatrix_(Parameters::Get>()); } /*! @@ -262,33 +204,34 @@ public: { ParentType::registerParameters(); - Parameters::registerParam + Parameters::Register> ("The x-coordinate of the lens' lower-left corner [m]."); - Parameters::registerParam + Parameters::Register> ("The x-coordinate of the lens' upper-right corner [m]."); if (dimWorld > 1) { - Parameters::registerParam + Parameters::Register> ("The y-coordinate of the lens' lower-left corner [m]."); - Parameters::registerParam + Parameters::Register> ("The y-coordinate of the lens' upper-right corner [m]."); } if (dimWorld > 2) { - Parameters::registerParam + Parameters::Register> ("The z-coordinate of the lens' lower-left corner [m]."); - Parameters::registerParam + Parameters::Register> ("The z-coordinate of the lens' upper-right corner [m]."); } - Parameters::registerParam + Parameters::Register> ("The intrinsic permeability [m^2] of the ambient material."); - Parameters::registerParam + Parameters::Register> ("The intrinsic permeability [m^2] of the lens."); Parameters::SetDefault("./data/groundwater_2d.dgf"); Parameters::SetDefault>(1.0); Parameters::SetDefault>(1.0); + Parameters::SetDefault(true); } /*! diff --git a/examples/problems/infiltrationproblem.hh b/examples/problems/infiltrationproblem.hh index 64c2175ed..cbae93e5a 100644 --- a/examples/problems/infiltrationproblem.hh +++ b/examples/problems/infiltrationproblem.hh @@ -27,21 +27,25 @@ #ifndef EWOMS_INFILTRATION_PROBLEM_HH #define EWOMS_INFILTRATION_PROBLEM_HH -#include - -#include -#include -#include -#include -#include -#include +#include +#include +#include #include #include -#include -#include -#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include #include #include @@ -90,20 +94,6 @@ public: } // namespace Opm::Properties -namespace Opm::Parameters { - -// Enable gravity? -template -struct EnableGravity -{ static constexpr bool value = true; }; - -// Write newton convergence? -template -struct NewtonWriteConvergence -{ static constexpr bool value = false; }; - -} // namespace Opm::Parameters - namespace Opm { /*! * \ingroup TestProblems @@ -229,6 +219,7 @@ public: Parameters::SetDefault(1); Parameters::SetDefault>(6e3); Parameters::SetDefault>(60.0); + Parameters::SetDefault(true); } /*! diff --git a/examples/problems/lensproblem.hh b/examples/problems/lensproblem.hh index 22409c556..3517005c2 100644 --- a/examples/problems/lensproblem.hh +++ b/examples/problems/lensproblem.hh @@ -28,27 +28,33 @@ #ifndef EWOMS_LENS_PROBLEM_HH #define EWOMS_LENS_PROBLEM_HH -#include -#include -#include -#include -#include +#include +#include +#include + +#include +#include #include #include #include #include -#include #include -#include -#include +#include -#include -#include -#include +#include +#include +#include +#include + +#include + +#include +#include + +#include #include #include -#include namespace Opm { template @@ -119,77 +125,24 @@ public: namespace Opm::Parameters { -// declare the properties specific for the lens problem -template -struct LensLowerLeftX { using type = Properties::UndefinedProperty; }; - -template -struct LensLowerLeftY { using type = Properties::UndefinedProperty; }; - -template -struct LensLowerLeftZ { using type = Properties::UndefinedProperty; }; - -template -struct LensUpperRightX { using type = Properties::UndefinedProperty; }; - -template -struct LensUpperRightY { using type = Properties::UndefinedProperty; }; - -template -struct LensUpperRightZ { using type = Properties::UndefinedProperty; }; - -// Enable gravity -template -struct EnableGravity -{ static constexpr bool value = true; }; - // define the properties specific for the lens problem -template -struct LensLowerLeftX -{ - using type = GetPropType; - static constexpr type value = 1.0; -}; +template +struct LensLowerLeftX { static constexpr Scalar value = 1.0; }; -template -struct LensLowerLeftY -{ - using type = GetPropType; - static constexpr type value = 2.0; -}; +template +struct LensLowerLeftY { static constexpr Scalar value = 2.0; }; -template -struct LensLowerLeftZ -{ - using type = GetPropType; - static constexpr type value = 0.0; -}; +template +struct LensLowerLeftZ { static constexpr Scalar value = 0.0; }; -template -struct LensUpperRightX -{ - using type = GetPropType; - static constexpr type value = 4.0; -}; +template +struct LensUpperRightX { static constexpr Scalar value = 4.0; }; -template -struct LensUpperRightY -{ - using type = GetPropType; - static constexpr type value = 3.0; -}; +template +struct LensUpperRightY { static constexpr Scalar value = 3.0; }; -template -struct LensUpperRightZ -{ - using type = GetPropType; - static constexpr type value = 1.0; -}; - -// Write the solutions of individual newton iterations? -template -struct NewtonWriteConvergence -{ static constexpr bool value = false; }; +template +struct LensUpperRightZ { static constexpr Scalar value = 1.0; }; } // namespace Opm::Parameters @@ -279,14 +232,14 @@ public: FluidSystem::init(); temperature_ = 273.15 + 20; // -> 20°C - lensLowerLeft_[0] = Parameters::get(); - lensLowerLeft_[1] = Parameters::get(); - lensUpperRight_[0] = Parameters::get(); - lensUpperRight_[1] = Parameters::get(); + lensLowerLeft_[0] = Parameters::Get>(); + lensLowerLeft_[1] = Parameters::Get>(); + lensUpperRight_[0] = Parameters::Get>(); + lensUpperRight_[1] = Parameters::Get>(); if constexpr (dim == 3) { - lensLowerLeft_[2] = Parameters::get(); - lensUpperRight_[2] = Parameters::get(); + lensLowerLeft_[2] = Parameters::Get>(); + lensUpperRight_[2] = Parameters::Get>(); } // residual saturations @@ -320,19 +273,19 @@ public: { ParentType::registerParameters(); - Parameters::registerParam + Parameters::Register> ("The x-coordinate of the lens' lower-left corner [m]."); - Parameters::registerParam + Parameters::Register> ("The y-coordinate of the lens' lower-left corner [m]."); - Parameters::registerParam + Parameters::Register> ("The x-coordinate of the lens' upper-right corner [m]."); - Parameters::registerParam + Parameters::Register> ("The y-coordinate of the lens' upper-right corner [m]."); if constexpr (dim == 3) { - Parameters::registerParam + Parameters::Register> ("The z-coordinate of the lens' lower-left corner [m]."); - Parameters::registerParam + Parameters::Register> ("The z-coordinate of the lens' upper-right corner [m]."); } @@ -357,6 +310,8 @@ public: Parameters::SetDefault(true); Parameters::SetDefault(true); Parameters::SetDefault>(250.0); + Parameters::SetDefault(true); + Parameters::SetDefault(true); } /*! diff --git a/examples/problems/obstacleproblem.hh b/examples/problems/obstacleproblem.hh index eb299f702..306833f80 100644 --- a/examples/problems/obstacleproblem.hh +++ b/examples/problems/obstacleproblem.hh @@ -28,28 +28,30 @@ #ifndef EWOMS_OBSTACLE_PROBLEM_HH #define EWOMS_OBSTACLE_PROBLEM_HH -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include #include #include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include #include #include -#include namespace Opm { template @@ -113,15 +115,6 @@ struct SolidEnergyLaw } // namespace Opm::Properties -namespace Opm::Parameters { - -// Enable gravity -template -struct EnableGravity -{ static constexpr bool value = true; }; - -} // namespace Opm::Parameters - namespace Opm { /*! * \ingroup TestProblems @@ -268,6 +261,7 @@ public: Parameters::SetDefault("./data/obstacle_24x16.dgf"); Parameters::SetDefault>(1e4); Parameters::SetDefault>(250); + Parameters::SetDefault(true); } /*! diff --git a/examples/problems/outflowproblem.hh b/examples/problems/outflowproblem.hh index f1eeaf232..4e52b5365 100644 --- a/examples/problems/outflowproblem.hh +++ b/examples/problems/outflowproblem.hh @@ -74,20 +74,6 @@ public: } // namespace Opm::Properties -namespace Opm::Parameters { - -// Disable gravity -template -struct EnableGravity -{ static constexpr bool value = false; }; - -// Also write mass fractions to the output -template -struct VtkWriteMassFractions -{ static constexpr bool value = true; }; - -} // namespac Opm::Parameters - namespace Opm { /*! * \ingroup TestProblems @@ -176,6 +162,8 @@ public: Parameters::SetDefault("./data/outflow.dgf"); Parameters::SetDefault>(100.0); Parameters::SetDefault>(1.0); + + Parameters::SetDefault(true); } /*! diff --git a/examples/problems/powerinjectionproblem.hh b/examples/problems/powerinjectionproblem.hh index 71d245b44..1bda5db62 100644 --- a/examples/problems/powerinjectionproblem.hh +++ b/examples/problems/powerinjectionproblem.hh @@ -121,20 +121,6 @@ public: } // namespace Opm::Properties -namespace Opm::Parameters { - -// Disable gravity -template -struct EnableGravity -{ static constexpr bool value = false; }; - -// Write out the filter velocities for this problem -template -struct VtkWriteFilterVelocities -{ static constexpr bool value = true; }; - -} // namespace Opm::Parameters - namespace Opm { /*! * \ingroup TestProblems @@ -241,6 +227,7 @@ public: Parameters::SetDefault>(100.0); Parameters::SetDefault>(1e-3); + Parameters::SetDefault(true); } /*! diff --git a/examples/problems/reservoirproblem.hh b/examples/problems/reservoirproblem.hh index e6f44df83..5180093d4 100644 --- a/examples/problems/reservoirproblem.hh +++ b/examples/problems/reservoirproblem.hh @@ -46,6 +46,8 @@ #include +#include + #include #include @@ -124,57 +126,16 @@ public: namespace Opm::Parameters { // Maximum depth of the reservoir -template -struct MaxDepth { using type = Properties::UndefinedProperty; }; +template +struct MaxDepth { static constexpr Scalar value = 2500.0; }; // The temperature inside the reservoir -template -struct Temperature { using type = Properties::UndefinedProperty; }; +template +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 -struct WellWidth { using type = Properties::UndefinedProperty; }; - -// Enable gravity -template -struct EnableGravity -{ static constexpr bool value = true; }; - -// set the defaults for some problem specific properties -template -struct MaxDepth -{ - using type = GetPropType; - static constexpr type value = 2500; -}; - -// Write the Newton convergence behavior to disk? -template -struct NewtonWriteConvergence -{ static constexpr bool value = false; }; - -// increase the tolerance for this problem to get larger time steps -template -struct NewtonTolerance -{ - using type = GetPropType; - static constexpr type value = 1e-6; -}; - -template -struct Temperature -{ - using type = GetPropType; - static constexpr type value = 293.15; -}; - -// The width of producer/injector wells as a fraction of the width of the spatial domain -template -struct WellWidth -{ - using type = GetPropType; - static constexpr type value = 0.01; -}; +template +struct WellWidth { static constexpr Scalar value = 0.01; }; } // namespace Opm::Parameters @@ -255,9 +216,9 @@ public: { ParentType::finishInit(); - temperature_ = Parameters::get(); - maxDepth_ = Parameters::get(); - wellWidth_ = Parameters::get(); + temperature_ = Parameters::Get>(); + maxDepth_ = Parameters::Get>(); + wellWidth_ = Parameters::Get>(); std::vector > Bo = { { 101353, 1.062 }, @@ -419,11 +380,11 @@ public: { ParentType::registerParameters(); - 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 width of producer/injector wells as a fraction of the width" " of the spatial domain"); @@ -436,6 +397,10 @@ public: Parameters::SetDefault(true); Parameters::SetDefault("data/reservoir.dgf"); Parameters::SetDefault>(100e3); + // increase the tolerance for this problem to get larger time steps + Parameters::SetDefault>(1e-6); + + Parameters::SetDefault(true); } /*! diff --git a/examples/problems/richardslensproblem.hh b/examples/problems/richardslensproblem.hh index 44dee3c30..0e8b24e26 100644 --- a/examples/problems/richardslensproblem.hh +++ b/examples/problems/richardslensproblem.hh @@ -101,30 +101,6 @@ public: } // namespace Opm::Properties -namespace Opm::Parameters { - -// Enable gravitational acceleration -template -struct EnableGravity -{ static constexpr bool value = true; }; - -// Do not write the intermediate results of the newton method -template -struct NewtonWriteConvergence -{ static constexpr bool value = false; }; - -// Set the "desireable" number of newton iterations of a time step -template -struct NewtonTargetIterations -{ static constexpr int value = 18; }; - -// Set the maximum number of newton iterations of a time step -template -struct NewtonMaxIterations -{ static constexpr int value = 28; }; - -} // namespace Opm::Parameters - namespace Opm { /*! @@ -259,6 +235,9 @@ public: Parameters::SetDefault>(3000.0); Parameters::SetDefault>(100.0); + Parameters::SetDefault(28); + Parameters::SetDefault(18); + Parameters::SetDefault(true); } /*! diff --git a/examples/problems/waterairproblem.hh b/examples/problems/waterairproblem.hh index 18716c10d..e675624a6 100644 --- a/examples/problems/waterairproblem.hh +++ b/examples/problems/waterairproblem.hh @@ -45,6 +45,8 @@ #include #include +#include + #include #include @@ -133,20 +135,6 @@ struct PreconditionerWrapper } // namespace Opm::Properties -namespace Opm::Parameters { - -// Enable gravity -template -struct EnableGravity -{ static constexpr bool value = true; }; - -// Write newton convergence -template -struct NewtonWriteConvergence -{ static constexpr bool value = false; }; - -} // namespace Opm::Parameters - namespace Opm { /*! * \ingroup TestProblems @@ -303,6 +291,8 @@ public: Parameters::SetDefault>(1.0 * 365 * 24 * 60 * 60); Parameters::SetDefault>(250.0); + Parameters::SetDefault(true); + Parameters::SetDefault(2); } /*! diff --git a/examples/tutorial1problem.hh b/examples/tutorial1problem.hh index e58b0ce14..f7e7a13a5 100644 --- a/examples/tutorial1problem.hh +++ b/examples/tutorial1problem.hh @@ -122,16 +122,8 @@ public: } // namespace Opm::Properties -namespace Opm::Parameters { - -// Disable gravity -template -struct EnableGravity -{ static constexpr bool value = false; }; /*@\label{tutorial1:gravity}@*/ - -} // namespace Opm::Parameters - namespace Opm { + //! Tutorial problem using the "immiscible" model. template class Tutorial1Problem diff --git a/opm/models/blackoil/blackoilfoammodules.hh b/opm/models/blackoil/blackoilfoammodules.hh index 1030b2e87..737d554b8 100644 --- a/opm/models/blackoil/blackoilfoammodules.hh +++ b/opm/models/blackoil/blackoilfoammodules.hh @@ -189,7 +189,7 @@ public: Simulator&) { if constexpr (enableFoam) { - if (Parameters::get()) { + if (Parameters::Get()) { OpmLog::warning("VTK output requested, currently unsupported by the foam module."); } } diff --git a/opm/models/blackoil/blackoilmodel.hh b/opm/models/blackoil/blackoilmodel.hh index 7ffc65d07..36252fc57 100644 --- a/opm/models/blackoil/blackoilmodel.hh +++ b/opm/models/blackoil/blackoilmodel.hh @@ -30,57 +30,52 @@ #include -#include "blackoilproblem.hh" -#include "blackoilindices.hh" -#include "blackoiltwophaseindices.hh" -#include "blackoilextensivequantities.hh" -#include "blackoilprimaryvariables.hh" -#include "blackoilintensivequantities.hh" -#include "blackoilratevector.hh" -#include "blackoilboundaryratevector.hh" -#include "blackoillocalresidual.hh" -#include "blackoilnewtonmethod.hh" -#include "blackoilproperties.hh" -#include "blackoilsolventmodules.hh" -#include "blackoilpolymermodules.hh" -#include "blackoilfoammodules.hh" -#include "blackoilbrinemodules.hh" -#include "blackoilextbomodules.hh" -#include "blackoildarcyfluxmodule.hh" -#include "blackoilmicpmodules.hh" +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include "blackoildiffusionmodule.hh" -#include "blackoildispersionmodule.hh" -#include -#include +#include +#include +#include #include #include namespace Opm { + template class BlackOilModel; -template -class EclVanguard; } namespace Opm::Properties { namespace TTag { + //! The type tag for the black-oil problems -struct BlackOilModel { using InheritsFrom = std::tuple; }; +struct BlackOilModel +{ using InheritsFrom = std::tuple; }; } // namespace TTag //! Set the local residual function diff --git a/opm/models/blackoil/blackoilnewtonmethod.hh b/opm/models/blackoil/blackoilnewtonmethod.hh index b149b9e28..847bb7c25 100644 --- a/opm/models/blackoil/blackoilnewtonmethod.hh +++ b/opm/models/blackoil/blackoilnewtonmethod.hh @@ -44,84 +44,6 @@ struct DiscNewtonMethod; } // namespace Opm::Properties -namespace Opm:: Parameters { - -template -struct DpMaxRel -{ - using type = GetPropType; - static constexpr type value = 0.3; -}; - -template -struct DsMax -{ - using type = GetPropType; - static constexpr type value = 0.2; -}; - -template -struct PriVarOscilationThreshold -{ - using type = GetPropType; - static constexpr type value = 1e-5; -}; - -template -struct ProjectSaturations -{ static constexpr bool value = false; }; - -template -struct MaxTemperatureChange -{ - using type = GetPropType; - static constexpr type value = 5; //Kelvin -}; - -template -struct TemperatureMax -{ - using type = GetPropType; - static constexpr type value = 1e9; // Kelvin -}; - -template -struct TemperatureMin -{ - using type = GetPropType; - static constexpr type value = 0.0; // Kelvin -}; - -template -struct PressureMax -{ - using type = GetPropType; - static constexpr type value = 1e99; // Kelvin -}; - -template -struct PressureMin -{ - using type = GetPropType; - static constexpr type value = -1e99; // Kelvin -}; - -template -struct MaximumWaterSaturation -{ - using type = GetPropType; - static constexpr type value = 1.0; -}; - -template -struct WaterOnlyThreshold -{ - using type = GetPropType; - static constexpr type value = 1.0; -}; - -} // namespace Opm::Parameters - namespace Opm { /*! @@ -150,17 +72,17 @@ class BlackOilNewtonMethod : public GetPropType(); - dpMaxRel_ = Parameters::get(); - dsMax_ = Parameters::get(); - projectSaturations_ = Parameters::get(); - maxTempChange_ = Parameters::get(); - tempMax_ = Parameters::get(); - tempMin_ = Parameters::get(); - pressMax_ = Parameters::get(); - pressMin_ = Parameters::get(); - waterSaturationMax_ = Parameters::get(); - waterOnlyThreshold_ = Parameters::get(); + priVarOscilationThreshold_ = Parameters::Get>(); + dpMaxRel_ = Parameters::Get>(); + dsMax_ = Parameters::Get>(); + projectSaturations_ = Parameters::Get(); + maxTempChange_ = Parameters::Get>(); + tempMax_ = Parameters::Get>(); + tempMin_ = Parameters::Get>(); + pressMax_ = Parameters::Get>(); + pressMin_ = Parameters::Get>(); + waterSaturationMax_ = Parameters::Get>(); + waterOnlyThreshold_ = Parameters::Get>(); } /*! @@ -181,28 +103,28 @@ public: { ParentType::registerParameters(); - Parameters::registerParam + Parameters::Register> ("Maximum relative change of pressure in a single iteration"); - Parameters::registerParam + Parameters::Register> ("Maximum absolute change of any saturation in a single iteration"); - Parameters::registerParam + Parameters::Register> ("The threshold value for the primary variable switching conditions " "after its meaning has switched to hinder oscilations"); - Parameters::registerParam + Parameters::Register ("Option for doing saturation projection"); - Parameters::registerParam + Parameters::Register> ("Maximum absolute change of temperature in a single iteration"); - Parameters::registerParam + Parameters::Register> ("Maximum absolute temperature"); - Parameters::registerParam + Parameters::Register> ("Minimum absolute temperature"); - Parameters::registerParam + Parameters::Register> ("Maximum absolute pressure"); - Parameters::registerParam + Parameters::Register> ("Minimum absolute pressure"); - Parameters::registerParam + Parameters::Register> ("Maximum water saturation"); - Parameters::registerParam + Parameters::Register> ("Cells with water saturation above or equal is considered one-phase water only"); } @@ -524,6 +446,7 @@ private: // to detect and hinder oscillations std::vector wasSwitched_; }; + } // namespace Opm #endif diff --git a/opm/models/blackoil/blackoilnewtonmethodparameters.hh b/opm/models/blackoil/blackoilnewtonmethodparameters.hh index a31c7b00f..689708334 100644 --- a/opm/models/blackoil/blackoilnewtonmethodparameters.hh +++ b/opm/models/blackoil/blackoilnewtonmethodparameters.hh @@ -28,42 +28,39 @@ #ifndef EWOMS_BLACK_OIL_NEWTON_METHOD_PARAMETERS_HH #define EWOMS_BLACK_OIL_NEWTON_METHOD_PARAMETERS_HH -#include - namespace Opm::Parameters { -template -struct DpMaxRel { using type = Properties::UndefinedProperty; }; +template +struct DpMaxRel { static constexpr Scalar value = 0.3; }; -template -struct DsMax { using type = Properties::UndefinedProperty; }; +template +struct DsMax { static constexpr Scalar value = 0.2; }; -template -struct PriVarOscilationThreshold { using type = Properties::UndefinedProperty; }; +template +struct PriVarOscilationThreshold { static constexpr Scalar value = 1e-5; }; -template -struct ProjectSaturations { using type = Properties::UndefinedProperty; }; +struct ProjectSaturations { static constexpr bool value = false; }; -template -struct MaxTemperatureChange { using type = Properties::UndefinedProperty; }; +template +struct MaxTemperatureChange { static constexpr Scalar value = 5.0; }; // Kelvin -template -struct TemperatureMax { using type = Properties::UndefinedProperty; }; +template +struct TemperatureMax { static constexpr Scalar value = 1e9; }; // Kelvin -template -struct TemperatureMin { using type = Properties::UndefinedProperty; }; +template +struct TemperatureMin { static constexpr Scalar value = 0.0; }; // Kelvin -template -struct PressureMax { using type = Properties::UndefinedProperty; }; +template +struct PressureMax { static constexpr Scalar value = 1e99; }; -template -struct PressureMin { using type = Properties::UndefinedProperty; }; +template +struct PressureMin { static constexpr Scalar value = -1e99; }; -template -struct MaximumWaterSaturation { using type = Properties::UndefinedProperty; }; +template +struct MaximumWaterSaturation { static constexpr Scalar value = 1.0; }; -template -struct WaterOnlyThreshold { using type = Properties::UndefinedProperty; }; +template +struct WaterOnlyThreshold { static constexpr Scalar value = 1.0; }; } // namespace Opm::Parameters diff --git a/opm/models/blackoil/blackoilsolventmodules.hh b/opm/models/blackoil/blackoilsolventmodules.hh index 19b4acdc9..b0052e506 100644 --- a/opm/models/blackoil/blackoilsolventmodules.hh +++ b/opm/models/blackoil/blackoilsolventmodules.hh @@ -1369,7 +1369,7 @@ public: Valgrind::CheckDefined(solventPGrad); // correct the pressure gradients by the gravitational acceleration - if (Parameters::get()) { + if (Parameters::Get()) { // estimate the gravitational acceleration at a given SCV face // using the arithmetic mean const auto& gIn = elemCtx.problem().gravity(elemCtx, i, timeIdx); diff --git a/opm/models/common/darcyfluxmodule.hh b/opm/models/common/darcyfluxmodule.hh index 13bb70bd3..aef4789a8 100644 --- a/opm/models/common/darcyfluxmodule.hh +++ b/opm/models/common/darcyfluxmodule.hh @@ -212,7 +212,7 @@ protected: } // correct the pressure gradients by the gravitational acceleration - if (Parameters::get()) { + if (Parameters::Get()) { // estimate the gravitational acceleration at a given SCV face // using the arithmetic mean const auto& gIn = elemCtx.problem().gravity(elemCtx, i, timeIdx); @@ -362,7 +362,7 @@ protected: K_ = intQuantsIn.intrinsicPermeability(); // correct the pressure gradients by the gravitational acceleration - if (Parameters::get()) { + if (Parameters::Get()) { // estimate the gravitational acceleration at a given SCV face // using the arithmetic mean const auto& gIn = elemCtx.problem().gravity(elemCtx, i, timeIdx); diff --git a/opm/models/common/multiphasebasemodel.hh b/opm/models/common/multiphasebasemodel.hh index 5e901aa1d..1d251ac73 100644 --- a/opm/models/common/multiphasebasemodel.hh +++ b/opm/models/common/multiphasebasemodel.hh @@ -57,7 +57,9 @@ namespace Opm::Properties { //! The generic type tag for problems using the immiscible multi-phase model // Create new type tags namespace TTag { -struct MultiPhaseBaseModel { using InheritsFrom = std::tuple; }; + +struct MultiPhaseBaseModel {}; + } // end namespace TTag //! Specify the splices of the MultiPhaseBaseModel type tag @@ -139,15 +141,6 @@ struct ThermalConductionLawParams } // namespace Opm::Properties -namespace Opm::Parameters { - -//! disable gravity by default -template -struct EnableGravity -{ static constexpr bool value = false; }; - -} - namespace Opm { /*! diff --git a/opm/models/common/multiphasebaseparameters.hh b/opm/models/common/multiphasebaseparameters.hh index f03dfc665..62582f166 100644 --- a/opm/models/common/multiphasebaseparameters.hh +++ b/opm/models/common/multiphasebaseparameters.hh @@ -24,19 +24,16 @@ * \file * \ingroup MultiPhaseBaseModel * - * \brief Defines the common paramamters for the porous medium + * \brief Defines the common parameters for the porous medium * multi-phase models. */ #ifndef EWOMS_MULTI_PHASE_BASE_PARAMETERS_HH #define EWOMS_MULTI_PHASE_BASE_PARAMETERS_HH -#include - namespace Opm::Parameters { -//! Returns whether gravity is considered in the problem -template -struct EnableGravity { using type = Properties::UndefinedProperty; }; +//! Returns whether gravity is considered in the problem. +struct EnableGravity { static constexpr bool value = false; }; } // namespace Opm::Parameters diff --git a/opm/models/common/multiphasebaseproblem.hh b/opm/models/common/multiphasebaseproblem.hh index 8c71d4df3..3b6103eab 100644 --- a/opm/models/common/multiphasebaseproblem.hh +++ b/opm/models/common/multiphasebaseproblem.hh @@ -93,7 +93,7 @@ public: { ParentType::registerParameters(); - Parameters::registerParam + Parameters::Register ("Use the gravity correction for the pressure gradients."); } @@ -398,8 +398,9 @@ private: void init_() { gravity_ = 0.0; - if (Parameters::get()) + if (Parameters::Get()) { gravity_[dimWorld-1] = -9.81; + } } }; diff --git a/opm/models/discretefracture/discretefracturemodel.hh b/opm/models/discretefracture/discretefracturemodel.hh index 7c0cc8ac1..b8a839ac8 100644 --- a/opm/models/discretefracture/discretefracturemodel.hh +++ b/opm/models/discretefracture/discretefracturemodel.hh @@ -53,7 +53,7 @@ namespace Opm::Properties { // Create new type tags namespace TTag { //! The generic type tag for problems using the immiscible multi-phase model -struct DiscreteFractureModel { using InheritsFrom = std::tuple; }; +struct DiscreteFractureModel { using InheritsFrom = std::tuple; }; } // end namespace TTag //! The class for the model diff --git a/opm/models/discretization/common/fvbasediscretization.hh b/opm/models/discretization/common/fvbasediscretization.hh index 135ef828b..610609a30 100644 --- a/opm/models/discretization/common/fvbasediscretization.hh +++ b/opm/models/discretization/common/fvbasediscretization.hh @@ -282,29 +282,6 @@ struct DiscreteFunction } // namespace Opm::Properties -namespace Opm::Parameters { - -// use default initialization based on rule-of-thumb of Newton tolerance -template -struct LinearSolverAbsTolerance -{ - using type = GetPropType; - static constexpr type value = -1.; -}; - -// if the deflection of the newton method is large, we do not need to solve the linear -// approximation accurately. Assuming that the value for the current solution is quite -// close to the final value, a reduction of 3 orders of magnitude in the defect should be -// sufficient... -template -struct LinearSolverTolerance -{ - using type = GetPropType; - static constexpr type value = 1e-3; -}; - -} // namespace Opm::Parameters - namespace Opm { /*! diff --git a/opm/models/discretization/common/fvbaseproperties.hh b/opm/models/discretization/common/fvbaseproperties.hh index c4aa6835c..bcd773a3c 100644 --- a/opm/models/discretization/common/fvbaseproperties.hh +++ b/opm/models/discretization/common/fvbaseproperties.hh @@ -36,7 +36,6 @@ namespace Opm::Properties { namespace TTag { struct FvBaseNewtonMethod; -struct VtkPrimaryVars; struct FiniteDifferenceLocalLinearizer; struct ParallelBiCGStabLinearSolver; } @@ -45,7 +44,7 @@ namespace TTag { //! The type tag for models based on the finite volume schemes struct FvBaseDiscretization -{ using InheritsFrom = std::tuple; }; +{ using InheritsFrom = std::tuple; }; } // namespace TTag diff --git a/opm/models/flash/flashmodel.hh b/opm/models/flash/flashmodel.hh index b0d7db9fd..070bae613 100644 --- a/opm/models/flash/flashmodel.hh +++ b/opm/models/flash/flashmodel.hh @@ -32,8 +32,8 @@ #include -#include #include +#include #include #include @@ -44,8 +44,8 @@ #include #include #include -#include #include +#include #include #include @@ -64,10 +64,7 @@ namespace Opm::Properties { namespace TTag { //! The type tag for the isothermal single phase problems -struct FlashModel { using InheritsFrom = std::tuple; }; +struct FlashModel { using InheritsFrom = std::tuple; }; } // namespace TTag //! Use the FlashLocalResidual function for the flash model diff --git a/opm/models/immiscible/immisciblemodel.hh b/opm/models/immiscible/immisciblemodel.hh index 450c3b12f..c6a1401f2 100644 --- a/opm/models/immiscible/immisciblemodel.hh +++ b/opm/models/immiscible/immisciblemodel.hh @@ -60,7 +60,7 @@ namespace Opm::Properties { // Create new type tags namespace TTag { //! The generic type tag for problems using the immiscible multi-phase model -struct ImmiscibleModel { using InheritsFrom = std::tuple; }; +struct ImmiscibleModel { using InheritsFrom = std::tuple; }; //! The type tag for single-phase immiscible problems struct ImmiscibleSinglePhaseModel { using InheritsFrom = std::tuple; }; @@ -166,24 +166,6 @@ public: } // namespace Opm::Properties -namespace Opm::Parameters { - -// disable output of a few quantities which make sense in a -// multi-phase but not in a single-phase context -template -struct VtkWriteSaturations -{ static constexpr bool value = false; }; - -template -struct VtkWriteMobilities -{ static constexpr bool value = false; }; - -template -struct VtkWriteRelativePermeabilities -{ static constexpr bool value = false; }; - -} // namespace Opm::Parameters - namespace Opm { /*! @@ -257,6 +239,10 @@ public: if (enableEnergy) Opm::VtkEnergyModule::registerParameters(); + + Parameters::SetDefault(false); + Parameters::SetDefault(false); + Parameters::SetDefault(false); } /*! diff --git a/opm/models/io/vtkblackoilenergymodule.hh b/opm/models/io/vtkblackoilenergymodule.hh index a72a100c2..e782fdbcf 100644 --- a/opm/models/io/vtkblackoilenergymodule.hh +++ b/opm/models/io/vtkblackoilenergymodule.hh @@ -41,44 +41,13 @@ #include #include -namespace Opm::Properties::TTag { - -// create new type tag for the VTK multi-phase output -struct VtkBlackOilEnergy {}; - -} // namespace Opm::Properties::TTag - namespace Opm::Parameters { -// create the property tags needed for the energy module -template -struct VtkWriteRockInternalEnergy { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteTotalThermalConductivity { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteFluidInternalEnergies { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteFluidEnthalpies { using type = Properties::UndefinedProperty; }; - // set default values for what quantities to output -template -struct VtkWriteRockInternalEnergy -{ static constexpr bool value = true; }; - -template -struct VtkWriteTotalThermalConductivity -{ static constexpr bool value = true; }; - -template -struct VtkWriteFluidInternalEnergies -{ static constexpr bool value = true; }; - -template -struct VtkWriteFluidEnthalpies -{ static constexpr bool value = true; }; +struct VtkWriteRockInternalEnergy { static constexpr bool value = true; }; +struct VtkWriteTotalThermalConductivity { static constexpr bool value = true; }; +struct VtkWriteFluidInternalEnergies { static constexpr bool value = true; }; +struct VtkWriteFluidEnthalpies { static constexpr bool value = true; }; } // namespace Opm::Parameters @@ -123,15 +92,15 @@ public: if (!enableEnergy) return; - Parameters::registerParam + Parameters::Register ("Include the volumetric internal energy of rock " "in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the total thermal conductivity of the medium and the fluids " "in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the internal energies of the fluids in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the enthalpies of the fluids in the VTK output files"); } @@ -225,25 +194,25 @@ public: private: static bool rockInternalEnergyOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool totalThermalConductivityOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool fluidInternalEnergiesOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool fluidEnthalpiesOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } diff --git a/opm/models/io/vtkblackoilmicpmodule.hh b/opm/models/io/vtkblackoilmicpmodule.hh index 9c22e96e6..cf626b8ed 100644 --- a/opm/models/io/vtkblackoilmicpmodule.hh +++ b/opm/models/io/vtkblackoilmicpmodule.hh @@ -41,51 +41,14 @@ #include #include -namespace Opm::Properties::TTag { - -// create new type tag for the VTK multi-phase output -struct VtkBlackOilMICP {}; - -} // namespace Opm::Properties::TTag - namespace Opm::Parameters { -// create the property tags needed for the MICP output module -template -struct VtkWriteMicrobialConcentration { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteOxygenConcentration { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteUreaConcentration { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteBiofilmConcentration { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteCalciteConcentration { using type = Properties::UndefinedProperty; }; - // set default values for what quantities to output -template -struct VtkWriteMicrobialConcentration -{ static constexpr bool value = true; }; - -template -struct VtkWriteOxygenConcentration -{ static constexpr bool value = true; }; - -template -struct VtkWriteUreaConcentration -{ static constexpr bool value = true; }; - -template -struct VtkWriteBiofilmConcentration -{ static constexpr bool value = true; }; - -template -struct VtkWriteCalciteConcentration -{ static constexpr bool value = true; }; +struct VtkWriteMicrobialConcentration { static constexpr bool value = true; }; +struct VtkWriteOxygenConcentration { static constexpr bool value = true; }; +struct VtkWriteUreaConcentration { static constexpr bool value = true; }; +struct VtkWriteBiofilmConcentration { static constexpr bool value = true; }; +struct VtkWriteCalciteConcentration { static constexpr bool value = true; }; } // namespace Opm::Parameters @@ -127,18 +90,18 @@ public: if (!enableMICP) return; - Parameters::registerParam + Parameters::Register ("Include the concentration of the microbial component in the water phase " "in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the concentration of the oxygen component in the water phase " "in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the concentration of the urea component in the water phase " "in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the biofilm volume fraction in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the calcite volume fraction in the VTK output files"); } @@ -239,31 +202,31 @@ public: private: static bool microbialConcentrationOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool oxygenConcentrationOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool ureaConcentrationOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool biofilmConcentrationOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool calciteConcentrationOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } diff --git a/opm/models/io/vtkblackoilmodule.hh b/opm/models/io/vtkblackoilmodule.hh index 6ec841f12..4b0de723d 100644 --- a/opm/models/io/vtkblackoilmodule.hh +++ b/opm/models/io/vtkblackoilmodule.hh @@ -41,93 +41,20 @@ #include #include -namespace Opm::Properties::TTag { - -// create new type tag for the VTK multi-phase output -struct VtkBlackOil {}; - -} // namespace Opm::Properties::TTag - namespace Opm::Parameters { -// create the property tags needed for the multi phase module -template -struct VtkWriteGasDissolutionFactor { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteOilVaporizationFactor { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteOilFormationVolumeFactor { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteGasFormationVolumeFactor { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteWaterFormationVolumeFactor { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteOilSaturationPressure { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteGasSaturationPressure { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteSaturationRatios { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteSaturatedOilGasDissolutionFactor { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteSaturatedGasOilVaporizationFactor { using type = Properties::UndefinedProperty; }; - -template -struct VtkWritePrimaryVarsMeaning { using type = Properties::UndefinedProperty; }; - // set default values for what quantities to output -template -struct VtkWriteGasDissolutionFactor -{ static constexpr bool value = false; }; - -template -struct VtkWriteOilVaporizationFactor -{ static constexpr bool value = false; }; - -template -struct VtkWriteOilFormationVolumeFactor -{ static constexpr bool value = false; }; - -template -struct VtkWriteGasFormationVolumeFactor -{ static constexpr bool value = false; }; - -template -struct VtkWriteWaterFormationVolumeFactor -{ static constexpr bool value = false; }; - -template -struct VtkWriteOilSaturationPressure -{ static constexpr bool value = false; }; - -template -struct VtkWriteGasSaturationPressure -{ static constexpr bool value = false; }; - -template -struct VtkWriteSaturationRatios -{ static constexpr bool value = false; }; - -template -struct VtkWriteSaturatedOilGasDissolutionFactor -{ static constexpr bool value = false; }; - -template -struct VtkWriteSaturatedGasOilVaporizationFactor -{ static constexpr bool value = false; }; - -template -struct VtkWritePrimaryVarsMeaning -{ static constexpr bool value = false; }; +struct VtkWriteGasDissolutionFactor { static constexpr bool value = false; }; +struct VtkWriteOilVaporizationFactor { static constexpr bool value = false; }; +struct VtkWriteOilFormationVolumeFactor { static constexpr bool value = false; }; +struct VtkWriteGasFormationVolumeFactor { static constexpr bool value = false; }; +struct VtkWriteWaterFormationVolumeFactor { static constexpr bool value = false; }; +struct VtkWriteOilSaturationPressure { static constexpr bool value = false; }; +struct VtkWriteGasSaturationPressure { static constexpr bool value = false; }; +struct VtkWriteSaturationRatios { static constexpr bool value = false; }; +struct VtkWriteSaturatedOilGasDissolutionFactor { static constexpr bool value = false; }; +struct VtkWriteSaturatedGasOilVaporizationFactor { static constexpr bool value = false; }; +struct VtkWritePrimaryVarsMeaning { static constexpr bool value = false; }; } // namespace Opm::Parameters @@ -174,36 +101,36 @@ public: */ static void registerParameters() { - Parameters::registerParam + Parameters::Register ("Include the gas dissolution factor (R_s) of the observed oil " "in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the oil vaporization factor (R_v) of the observed gas " "in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the oil formation volume factor (B_o) in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the gas formation volume factor (B_g) in the " "VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the water formation volume factor (B_w) in the " "VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the saturation pressure of oil (p_o,sat) in the " "VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the saturation pressure of gas (p_g,sat) in the " "VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the gas dissolution factor (R_s,sat) of gas saturated " "oil in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the oil vaporization factor (R_v,sat) of oil saturated " "gas in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Write the ratio of the actually and maximum dissolved component of " "the mixtures"); - Parameters::registerParam + Parameters::Register ("Include how the primary variables should be interpreted to the " "VTK output files"); } @@ -378,67 +305,67 @@ public: private: static bool gasDissolutionFactorOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool oilVaporizationFactorOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool oilFormationVolumeFactorOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool gasFormationVolumeFactorOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool waterFormationVolumeFactorOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool oilSaturationPressureOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool gasSaturationPressureOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool saturatedOilGasDissolutionFactorOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool saturatedGasOilVaporizationFactorOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool saturationRatiosOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool primaryVarsMeaningOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } diff --git a/opm/models/io/vtkblackoilpolymermodule.hh b/opm/models/io/vtkblackoilpolymermodule.hh index 31942f59f..eb7f7f23d 100644 --- a/opm/models/io/vtkblackoilpolymermodule.hh +++ b/opm/models/io/vtkblackoilpolymermodule.hh @@ -50,49 +50,13 @@ struct VtkBlackOilPolymer {}; namespace Opm::Parameters { -// create the property tags needed for the polymer output module -template -struct VtkWritePolymerConcentration { using type = Properties::UndefinedProperty; }; - -template -struct VtkWritePolymerDeadPoreVolume { using type = Properties::UndefinedProperty; }; - -template -struct VtkWritePolymerAdsorption { using type = Properties::UndefinedProperty; }; - -template -struct VtkWritePolymerRockDensity { using type = Properties::UndefinedProperty; }; - -template -struct VtkWritePolymerViscosityCorrection { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteWaterViscosityCorrection { using type = Properties::UndefinedProperty; }; - // set default values for what quantities to output -template -struct VtkWritePolymerConcentration -{ static constexpr bool value = true; }; - -template -struct VtkWritePolymerDeadPoreVolume -{ static constexpr bool value = true; }; - -template -struct VtkWritePolymerViscosityCorrection -{ static constexpr bool value = true; }; - -template -struct VtkWriteWaterViscosityCorrection -{ static constexpr bool value = true; }; - -template -struct VtkWritePolymerRockDensity -{ static constexpr bool value = true; }; - -template -struct VtkWritePolymerAdsorption -{ static constexpr bool value = true; }; +struct VtkWritePolymerConcentration { static constexpr bool value = true; }; +struct VtkWritePolymerDeadPoreVolume { static constexpr bool value = true; }; +struct VtkWritePolymerViscosityCorrection { static constexpr bool value = true; }; +struct VtkWriteWaterViscosityCorrection { static constexpr bool value = true; }; +struct VtkWritePolymerRockDensity { static constexpr bool value = true; }; +struct VtkWritePolymerAdsorption { static constexpr bool value = true; }; } // namespace Opm::Parameters @@ -134,22 +98,22 @@ public: if (!enablePolymer) return; - Parameters::registerParam + Parameters::Register ("Include the concentration of the polymer component in the water phase " "in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the fraction of the \"dead\" pore volume " "in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the amount of already adsorbed polymer component" "in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the adsorption rate of the polymer component" "in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the viscosity correction of the polymer component " "in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the viscosity correction of the water component " "due to polymers in the VTK output files"); } @@ -258,37 +222,37 @@ public: private: static bool polymerConcentrationOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool polymerDeadPoreVolumeOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool polymerRockDensityOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool polymerAdsorptionOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool polymerViscosityCorrectionOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool waterViscosityCorrectionOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } diff --git a/opm/models/io/vtkblackoilsolventmodule.hh b/opm/models/io/vtkblackoilsolventmodule.hh index 3b4c5adea..acb47519a 100644 --- a/opm/models/io/vtkblackoilsolventmodule.hh +++ b/opm/models/io/vtkblackoilsolventmodule.hh @@ -41,51 +41,14 @@ #include #include -namespace Opm::Properties::TTag { - -// create new type tag for the VTK multi-phase output -struct VtkBlackOilSolvent {}; - -} // namespace Opm::Properties::TTag - namespace Opm::Parameters { -// create the property tags needed for the solvent output module -template -struct VtkWriteSolventSaturation { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteSolventRsw { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteSolventDensity { using type = Properties::UndefinedProperty; }; -template - -struct VtkWriteSolventViscosity { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteSolventMobility { using type = Properties::UndefinedProperty; }; - // set default values for what quantities to output -template -struct VtkWriteSolventSaturation -{ static constexpr bool value = true; }; - -template -struct VtkWriteSolventRsw -{ static constexpr bool value = true; }; - -template -struct VtkWriteSolventDensity -{ static constexpr bool value = true; }; - -template -struct VtkWriteSolventViscosity -{ static constexpr bool value = true; }; - -template -struct VtkWriteSolventMobility -{ static constexpr bool value = true; }; +struct VtkWriteSolventSaturation { static constexpr bool value = true; }; +struct VtkWriteSolventRsw { static constexpr bool value = true; }; +struct VtkWriteSolventDensity { static constexpr bool value = true; }; +struct VtkWriteSolventViscosity { static constexpr bool value = true; }; +struct VtkWriteSolventMobility { static constexpr bool value = true; }; } // namespace Opm::Properties @@ -127,19 +90,19 @@ public: if (!enableSolvent) return; - Parameters::registerParam + Parameters::Register ("Include the \"saturation\" of the solvent component " "in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the \"dissolved volume in water\" of the solvent component " "in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the \"density\" of the solvent component " "in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the \"viscosity\" of the solvent component " "in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the \"mobility\" of the solvent component " "in the VTK output files"); } @@ -240,31 +203,31 @@ public: private: static bool solventSaturationOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool solventRswOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool solventDensityOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool solventViscosityOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool solventMobilityOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } diff --git a/opm/models/io/vtkcompositionmodule.hh b/opm/models/io/vtkcompositionmodule.hh index f062032a3..bc16cf15c 100644 --- a/opm/models/io/vtkcompositionmodule.hh +++ b/opm/models/io/vtkcompositionmodule.hh @@ -37,65 +37,16 @@ #include #include -namespace Opm::Properties::TTag { - -// create new type tag for the VTK composition output -struct VtkComposition {}; - -} // namespace Opm::Properties::TTag - namespace Opm::Parameters { -// create the property tags needed for the composition module -template -struct VtkWriteMassFractions { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteMoleFractions { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteTotalMassFractions { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteTotalMoleFractions { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteMolarities { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteFugacities { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteFugacityCoeffs { using type = Properties::UndefinedProperty; }; - // set default values for what quantities to output -template -struct VtkWriteMassFractions -{ static constexpr bool value = false; }; - -template -struct VtkWriteMoleFractions -{ static constexpr bool value = true; }; - -template -struct VtkWriteTotalMassFractions -{ static constexpr bool value = false; }; - -template -struct VtkWriteTotalMoleFractions -{ static constexpr bool value = false; }; - -template -struct VtkWriteMolarities -{ static constexpr bool value = false; }; - -template -struct VtkWriteFugacities -{ static constexpr bool value = false; }; - -template -struct VtkWriteFugacityCoeffs -{ static constexpr bool value = false; }; +struct VtkWriteMassFractions { static constexpr bool value = false; }; +struct VtkWriteMoleFractions { static constexpr bool value = true; }; +struct VtkWriteTotalMassFractions { static constexpr bool value = false; }; +struct VtkWriteTotalMoleFractions { static constexpr bool value = false; }; +struct VtkWriteMolarities { static constexpr bool value = false; }; +struct VtkWriteFugacities { static constexpr bool value = false; }; +struct VtkWriteFugacityCoeffs { static constexpr bool value = false; }; } // namespace Opm::Properties @@ -144,19 +95,19 @@ public: */ static void registerParameters() { - Parameters::registerParam + Parameters::Register ("Include mass fractions in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include mole fractions in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include total mass fractions in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include total mole fractions in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include component molarities in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include component fugacities in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include component fugacity coefficients in the VTK output files"); } @@ -278,43 +229,43 @@ public: private: static bool massFracOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool moleFracOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool totalMassFracOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool totalMoleFracOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool molarityOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool fugacityOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool fugacityCoeffOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } diff --git a/opm/models/io/vtkdiffusionmodule.hh b/opm/models/io/vtkdiffusionmodule.hh index 023fd8a27..13bf3912f 100644 --- a/opm/models/io/vtkdiffusionmodule.hh +++ b/opm/models/io/vtkdiffusionmodule.hh @@ -28,49 +28,23 @@ #ifndef EWOMS_VTK_DIFFUSION_MODULE_HH #define EWOMS_VTK_DIFFUSION_MODULE_HH -#include "vtkmultiwriter.hh" -#include "baseoutputmodule.hh" - #include #include #include +#include +#include + #include #include -namespace Opm::Properties::TTag { - -// create new type tag for the VTK output of the quantities for molecular -// diffusion -struct VtkDiffusion {}; - -} // namespace Opm::Properties::TTag - namespace Opm::Parameters { -// create the property tags needed for the diffusion module -template -struct VtkWriteTortuosities { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteDiffusionCoefficients { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteEffectiveDiffusionCoefficients { using type = Properties::UndefinedProperty; }; - // set default values for what quantities to output -template -struct VtkWriteTortuosities -{ static constexpr bool value = false; }; - -template -struct VtkWriteDiffusionCoefficients -{ static constexpr bool value = false; }; - -template -struct VtkWriteEffectiveDiffusionCoefficients -{ static constexpr bool value = false; }; +struct VtkWriteTortuosities { static constexpr bool value = false; }; +struct VtkWriteDiffusionCoefficients { static constexpr bool value = false; }; +struct VtkWriteEffectiveDiffusionCoefficients { static constexpr bool value = false; }; } // namespace Opm::Parameters @@ -117,12 +91,12 @@ public: */ static void registerParameters() { - Parameters::registerParam + Parameters::Register ("Include the tortuosity for each phase in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the molecular diffusion coefficients in " "the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the effective molecular diffusion " "coefficients the medium in the VTK output files"); } @@ -194,19 +168,19 @@ public: private: static bool tortuosityOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool diffusionCoefficientOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool effectiveDiffusionCoefficientOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } diff --git a/opm/models/io/vtkdiscretefracturemodule.hh b/opm/models/io/vtkdiscretefracturemodule.hh index 785e2715e..49904a5e9 100644 --- a/opm/models/io/vtkdiscretefracturemodule.hh +++ b/opm/models/io/vtkdiscretefracturemodule.hh @@ -41,65 +41,16 @@ #include -namespace Opm::Properties::TTag { - -// create new type tag for the VTK multi-phase output -struct VtkDiscreteFracture {}; - -} // namespace Opm::Properties::TTag - namespace Opm::Parameters { -// create the property tags needed for the multi phase module -template -struct VtkWriteFractureSaturations { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteFractureMobilities { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteFractureRelativePermeabilities { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteFracturePorosity { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteFractureIntrinsicPermeabilities { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteFractureFilterVelocities { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteFractureVolumeFraction { using type = Properties::UndefinedProperty; }; - // set default values for what quantities to output -template -struct VtkWriteFractureSaturations -{ static constexpr bool value = true; }; - -template -struct VtkWriteFractureMobilities -{ static constexpr bool value = false; }; - -template -struct VtkWriteFractureRelativePermeabilities -{ static constexpr bool value = true; }; - -template -struct VtkWriteFracturePorosity -{ static constexpr bool value = true; }; - -template -struct VtkWriteFractureIntrinsicPermeabilities -{ static constexpr bool value = false; }; - -template -struct VtkWriteFractureFilterVelocities -{ static constexpr bool value = false; }; - -template -struct VtkWriteFractureVolumeFraction -{ static constexpr bool value = true; }; +struct VtkWriteFractureSaturations { static constexpr bool value = true; }; +struct VtkWriteFractureMobilities { static constexpr bool value = false; }; +struct VtkWriteFractureRelativePermeabilities { static constexpr bool value = true; }; +struct VtkWriteFracturePorosity { static constexpr bool value = true; }; +struct VtkWriteFractureIntrinsicPermeabilities { static constexpr bool value = false; }; +struct VtkWriteFractureFilterVelocities { static constexpr bool value = false; }; +struct VtkWriteFractureVolumeFraction { static constexpr bool value = true; }; } // namespace Opm::Parameters @@ -153,20 +104,20 @@ public: */ static void registerParameters() { - Parameters::registerParam + Parameters::Register ("Include the phase saturations in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the phase mobilities in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the phase relative permeabilities in the " "VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the porosity in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the intrinsic permeability in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include in the filter velocities of the phases in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Add the fraction of the total volume which is " "occupied by fractures in the VTK output"); } @@ -339,43 +290,43 @@ public: private: static bool saturationOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool mobilityOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool relativePermeabilityOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool porosityOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool intrinsicPermeabilityOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool volumeFractionOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool velocityOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } diff --git a/opm/models/io/vtkenergymodule.hh b/opm/models/io/vtkenergymodule.hh index 411c12798..414d545ce 100644 --- a/opm/models/io/vtkenergymodule.hh +++ b/opm/models/io/vtkenergymodule.hh @@ -34,51 +34,18 @@ #include -#include #include - -namespace Opm::Properties::TTag { - -// create new type tag for the VTK energy output -struct VtkEnergy {}; - -} // namespace Opm::Properties::TTag - +#include namespace Opm::Parameters { -// create the property tags needed for the energy module -template -struct VtkWriteInternalEnergies { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteEnthalpies { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteSolidInternalEnergy { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteThermalConductivity { using type = Properties::UndefinedProperty; }; - - // set default values for what quantities to output -template -struct VtkWriteSolidInternalEnergy -{ static constexpr bool value = false; }; +struct VtkWriteSolidInternalEnergy { static constexpr bool value = false; }; +struct VtkWriteThermalConductivity { static constexpr bool value = false; }; +struct VtkWriteInternalEnergies { static constexpr bool value = false; }; +struct VtkWriteEnthalpies { static constexpr bool value = false; }; -template -struct VtkWriteThermalConductivity -{ static constexpr bool value = false; }; - -template -struct VtkWriteInternalEnergies -{ static constexpr bool value = false; }; - -template -struct VtkWriteEnthalpies -{ static constexpr bool value = false; }; - -} // namespace Opm::Properties +} // namespace Opm::Parameters namespace Opm { /*! @@ -125,16 +92,16 @@ public: */ static void registerParameters() { - Parameters::registerParam + Parameters::Register ("Include the volumetric internal energy of solid" "matrix in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the total thermal conductivity of the" "medium in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the specific enthalpy of the phases in " "the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the specific internal energy of the " "phases in the VTK output files"); } @@ -209,25 +176,25 @@ public: private: static bool solidInternalEnergyOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool thermalConductivityOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool enthalpyOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool internalEnergyOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } diff --git a/opm/models/io/vtkmultiphasemodule.hh b/opm/models/io/vtkmultiphasemodule.hh index 881135211..b5e86b5e5 100644 --- a/opm/models/io/vtkmultiphasemodule.hh +++ b/opm/models/io/vtkmultiphasemodule.hh @@ -27,117 +27,38 @@ #ifndef EWOMS_VTK_MULTI_PHASE_MODULE_HH #define EWOMS_VTK_MULTI_PHASE_MODULE_HH -#include "vtkmultiwriter.hh" -#include "baseoutputmodule.hh" +#include #include #include #include -#include -#include +#include +#include -#include +#include +#include #include -namespace Opm::Properties::TTag { - -// create new type tag for the VTK multi-phase output -struct VtkMultiPhase {}; - -} // namespace Opm::Properties::TTag - namespace Opm::Parameters { -// create the property tags needed for the multi phase module -template -struct VtkWriteExtrusionFactor { using type = Properties::UndefinedProperty; }; - -template -struct VtkWritePressures { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteDensities { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteSaturations { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteMobilities { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteRelativePermeabilities { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteViscosities { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteAverageMolarMasses { using type = Properties::UndefinedProperty; }; - -template -struct VtkWritePorosity { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteIntrinsicPermeabilities { using type = Properties::UndefinedProperty; }; - -template -struct VtkWritePotentialGradients { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteFilterVelocities { using type = Properties::UndefinedProperty; }; - // set default values for what quantities to output -template -struct VtkWriteExtrusionFactor -{ static constexpr bool value = false; }; +struct VtkWriteExtrusionFactor { static constexpr bool value = false; }; +struct VtkWritePressures { static constexpr bool value = true; }; +struct VtkWriteDensities { static constexpr bool value = true; }; +struct VtkWriteSaturations { static constexpr bool value = true; }; +struct VtkWriteMobilities { static constexpr bool value = false; }; +struct VtkWriteRelativePermeabilities { static constexpr bool value = true; }; +struct VtkWriteViscosities { static constexpr bool value = false; }; +struct VtkWriteAverageMolarMasses { static constexpr bool value = false; }; +struct VtkWritePorosity { static constexpr bool value = true; }; +struct VtkWriteIntrinsicPermeabilities { static constexpr bool value = false; }; +struct VtkWritePotentialGradients { static constexpr bool value = false; }; +struct VtkWriteFilterVelocities { static constexpr bool value = false; }; -template -struct VtkWritePressures -{ static constexpr bool value = true; }; - -template -struct VtkWriteDensities -{ static constexpr bool value = true; }; - -template -struct VtkWriteSaturations -{ static constexpr bool value = true; }; - -template -struct VtkWriteMobilities -{ static constexpr bool value = false; }; - -template -struct VtkWriteRelativePermeabilities -{ static constexpr bool value = true; }; - -template -struct VtkWriteViscosities -{ static constexpr bool value = false; }; - -template -struct VtkWriteAverageMolarMasses -{ static constexpr bool value = false; }; - -template -struct VtkWritePorosity -{ static constexpr bool value = true; }; - -template -struct VtkWriteIntrinsicPermeabilities -{ static constexpr bool value = false; }; - -template -struct VtkWritePotentialGradients -{ static constexpr bool value = false; }; - -template -struct VtkWriteFilterVelocities -{ static constexpr bool value = false; }; - -} // namespace Opm::Properties +} // namespace Opm::Parameters namespace Opm { @@ -197,29 +118,29 @@ public: */ static void registerParameters() { - Parameters::registerParam + Parameters::Register ("Include the extrusion factor of the degrees of freedom into the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the phase pressures in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the phase densities in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the phase saturations in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the phase mobilities in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the phase relative permeabilities in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include component phase viscosities in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the average phase mass in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the porosity in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the intrinsic permeability in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include in the filter velocities of the phases the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the phase pressure potential gradients in the VTK output files"); } @@ -454,73 +375,73 @@ public: private: static bool extrusionFactorOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool pressureOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool densityOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool saturationOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool mobilityOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool relativePermeabilityOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool viscosityOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool averageMolarMassOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool porosityOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool intrinsicPermeabilityOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool velocityOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool potentialGradientOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } diff --git a/opm/models/io/vtkphasepresencemodule.hh b/opm/models/io/vtkphasepresencemodule.hh index 37bec49a3..225218438 100644 --- a/opm/models/io/vtkphasepresencemodule.hh +++ b/opm/models/io/vtkphasepresencemodule.hh @@ -35,22 +35,9 @@ #include #include -namespace Opm::Properties::TTag { - -// create new type tag for the VTK primary variables output -struct VtkPhasePresence {}; - -} // namespace Opm::Properties::TTag - namespace Opm::Parameters { -// create the property tags needed for the primary variables module -template -struct VtkWritePhasePresence { using type = Properties::UndefinedProperty; }; - -template -struct VtkWritePhasePresence -{ static constexpr bool value = false; }; +struct VtkWritePhasePresence { static constexpr bool value = false; }; } // namespace Opm::Parameters @@ -86,7 +73,7 @@ public: */ static void registerParameters() { - Parameters::registerParam + Parameters::Register ("Include the phase presence pseudo primary " "variable in the VTK output files"); } @@ -137,7 +124,7 @@ public: private: static bool phasePresenceOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } diff --git a/opm/models/io/vtkprimaryvarsmodule.hh b/opm/models/io/vtkprimaryvarsmodule.hh index 1bc02d2d7..8cbd9aae5 100644 --- a/opm/models/io/vtkprimaryvarsmodule.hh +++ b/opm/models/io/vtkprimaryvarsmodule.hh @@ -35,36 +35,11 @@ #include #include -namespace Opm::Properties::TTag { - -// create new type tag for the VTK primary variables output -struct VtkPrimaryVars {}; - -} // namespace Opm::Properties::TTag - namespace Opm::Parameters { -// create the property tags needed for the primary variables module -template -struct VtkWritePrimaryVars { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteProcessRank { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteDofIndex { using type = Properties::UndefinedProperty; }; - -template -struct VtkWritePrimaryVars -{ static constexpr bool value = false; }; - -template -struct VtkWriteProcessRank -{ static constexpr bool value = false; }; - -template -struct VtkWriteDofIndex -{ static constexpr bool value = false; }; +struct VtkWritePrimaryVars { static constexpr bool value = false; }; +struct VtkWriteProcessRank { static constexpr bool value = false; }; +struct VtkWriteDofIndex { static constexpr bool value = false; }; } // namespace Opm::Properties @@ -102,11 +77,11 @@ public: */ static void registerParameters() { - Parameters::registerParam + Parameters::Register ("Include the primary variables into the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the MPI process rank into the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include the index of the degrees of freedom into the VTK output files"); } @@ -178,17 +153,17 @@ public: private: static bool primaryVarsOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool processRankOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool dofIndexOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } diff --git a/opm/models/io/vtkptflashmodule.hh b/opm/models/io/vtkptflashmodule.hh index f8b9758c1..cb25f1e0d 100644 --- a/opm/models/io/vtkptflashmodule.hh +++ b/opm/models/io/vtkptflashmodule.hh @@ -27,40 +27,21 @@ #ifndef OPM_VTK_PTFLASH_MODULE_HH #define OPM_VTK_PTFLASH_MODULE_HH -#include "vtkmultiwriter.hh" -#include "baseoutputmodule.hh" - #include #include -#include +#include +#include + #include - -namespace Opm::Properties::TTag { - -// create new type tag for the VTK PTFlash output -struct VtkPTFlash {}; - -} // namespace Opm::Properties::TTag +#include namespace Opm::Parameters { -// create the property tags needed for the composition module -template -struct VtkWriteLiquidMoleFractions { using type = Properties::UndefinedProperty; }; - -template -struct VtkWriteEquilibriumConstants { using type = Properties::UndefinedProperty; }; - // set default values for what quantities to output -template -struct VtkWriteLiquidMoleFractions -{ static constexpr bool value = false; }; - -template -struct VtkWriteEquilibriumConstants -{ static constexpr bool value = false; }; +struct VtkWriteLiquidMoleFractions { static constexpr bool value = false; }; +struct VtkWriteEquilibriumConstants { static constexpr bool value = false; }; } // namespace Opm::Parameters @@ -105,9 +86,9 @@ public: */ static void registerParameters() { - Parameters::registerParam + Parameters::Register ("Include liquid mole fractions (L) in the VTK output files"); - Parameters::registerParam + Parameters::Register ("Include equilibrium constants (K) in the VTK output files"); } @@ -169,13 +150,13 @@ public: private: static bool LOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } static bool equilConstOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } diff --git a/opm/models/io/vtktemperaturemodule.hh b/opm/models/io/vtktemperaturemodule.hh index d001569ed..96f25c9f0 100644 --- a/opm/models/io/vtktemperaturemodule.hh +++ b/opm/models/io/vtktemperaturemodule.hh @@ -37,23 +37,10 @@ #include #include -namespace Opm::Properties::TTag { - -// create new type tag for the VTK temperature output -struct VtkTemperature {}; - -} // namespace Opm::Properties::TTag - namespace Opm::Parameters { -// create the property tags needed for the temperature module -template -struct VtkWriteTemperature { using type = Properties::UndefinedProperty; }; - // set default values for what quantities to output -template -struct VtkWriteTemperature -{ static constexpr bool value = true; }; +struct VtkWriteTemperature { static constexpr bool value = true; }; } // namespace Opm::Parameters @@ -91,7 +78,7 @@ public: */ static void registerParameters() { - Parameters::registerParam + Parameters::Register ("Include the temperature in the VTK output files"); } @@ -143,7 +130,7 @@ public: private: static bool temperatureOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::Get(); return val; } diff --git a/opm/models/ncp/ncpmodel.hh b/opm/models/ncp/ncpmodel.hh index 3bf0cc8b0..4dbaefd4d 100644 --- a/opm/models/ncp/ncpmodel.hh +++ b/opm/models/ncp/ncpmodel.hh @@ -69,10 +69,7 @@ namespace TTag { /*! * \brief Define the type tag for the compositional NCP model. */ -struct NcpModel { using InheritsFrom = std::tuple; }; +struct NcpModel { using InheritsFrom = std::tuple; }; } // namespace TTag //! Use the Ncp local jacobian operator for the compositional NCP model diff --git a/opm/models/ncp/ncpnewtonmethod.hh b/opm/models/ncp/ncpnewtonmethod.hh index 3a9e16cc6..b21760c1f 100644 --- a/opm/models/ncp/ncpnewtonmethod.hh +++ b/opm/models/ncp/ncpnewtonmethod.hh @@ -117,10 +117,10 @@ protected: // make sure that the error never grows beyond the maximum // allowed one - if (this->error_ > Parameters::get()) + if (this->error_ > Parameters::Get>()) throw Opm::NumericalProblem("Newton: Error "+std::to_string(double(this->error_))+ + " is larger than maximum allowed error of " - + std::to_string(Parameters::get())); + + std::to_string(Parameters::Get>())); } /*! diff --git a/opm/models/nonlinear/newtonmethod.hh b/opm/models/nonlinear/newtonmethod.hh index 206294821..222a05a72 100644 --- a/opm/models/nonlinear/newtonmethod.hh +++ b/opm/models/nonlinear/newtonmethod.hh @@ -79,42 +79,6 @@ struct NewtonConvergenceWriter { using type = NullC } // namespace Opm::Properties -namespace Opm::Parameters { - -template -struct NewtonVerbose -{ static constexpr bool value = true; }; - -template -struct NewtonWriteConvergence -{ static constexpr bool value = false; }; - -template -struct NewtonTolerance -{ - using type = GetPropType; - static constexpr type value = 1e-8; -}; - -// set the abortion tolerance to some very large value. if not -// overwritten at run-time this basically disables abortions -template -struct NewtonMaxError -{ - using type = GetPropType; - static constexpr type value = 1e100; -}; - -template -struct NewtonTargetIterations -{ static constexpr int value = 10; }; - -template -struct NewtonMaxIterations -{ static constexpr int value = 20; }; - -} // namespace Opm::Parameters - namespace Opm { /*! * \ingroup Newton @@ -154,7 +118,7 @@ public: { lastError_ = 1e100; error_ = 1e100; - tolerance_ = Parameters::get(); + tolerance_ = Parameters::Get>(); numIterations_ = 0; } @@ -166,20 +130,20 @@ public: { LinearSolverBackend::registerParameters(); - Parameters::registerParam + Parameters::Register ("Specify whether the Newton method should inform " "the user about its progress or not"); - Parameters::registerParam + Parameters::Register ("Write the convergence behaviour of the Newton " "method to a VTK file"); - Parameters::registerParam + Parameters::Register ("The 'optimum' number of Newton iterations per time step"); - Parameters::registerParam + Parameters::Register ("The maximum number of Newton iterations per time step"); - Parameters::registerParam + Parameters::Register> ("The maximum raw error tolerated by the Newton" "method for considering a solution to be converged"); - Parameters::registerParam + Parameters::Register> ("The maximum error tolerated by the Newton " "method to which does not cause an abort"); } @@ -544,7 +508,7 @@ protected: */ bool verbose_() const { - return Parameters::get() && (comm_.rank() == 0); + return Parameters::Get() && (comm_.rank() == 0); } /*! @@ -557,8 +521,9 @@ protected: { numIterations_ = 0; - if (Parameters::get()) + if (Parameters::Get()) { convergenceWriter_.beginTimeStep(); + } } /*! @@ -609,7 +574,7 @@ protected: { const auto& constraintsMap = model().linearizer().constraintsMap(); lastError_ = error_; - Scalar newtonMaxError = Parameters::get(); + Scalar newtonMaxError = Parameters::Get>(); // calculate the error as the maximum weighted tolerance of // the solution's residual @@ -774,7 +739,7 @@ protected: void writeConvergence_(const SolutionVector& currentSolution, const GlobalEqVector& solutionUpdate) { - if (Parameters::get()) { + if (Parameters::Get()) { convergenceWriter_.beginIteration(); convergenceWriter_.writeFields(currentSolution, solutionUpdate); convergenceWriter_.endIteration(); @@ -846,8 +811,9 @@ protected: */ void end_() { - if (Parameters::get()) + if (Parameters::Get()) { convergenceWriter_.endTimeStep(); + } } /*! @@ -868,10 +834,10 @@ protected: // optimal number of iterations we want to achieve int targetIterations_() const - { return Parameters::get(); } + { return Parameters::Get(); } // maximum number of iterations we do before giving up int maxIterations_() const - { return Parameters::get(); } + { return Parameters::Get(); } static bool enableConstraints_() { return getPropValue(); } diff --git a/opm/models/nonlinear/newtonmethodparameters.hh b/opm/models/nonlinear/newtonmethodparameters.hh index 1019636ee..72afa9ece 100644 --- a/opm/models/nonlinear/newtonmethodparameters.hh +++ b/opm/models/nonlinear/newtonmethodparameters.hh @@ -23,32 +23,15 @@ #ifndef EWOMS_NEWTON_METHOD_PARAMETERS_HH #define EWOMS_NEWTON_METHOD_PARAMETERS_HH -#include - namespace Opm::Parameters { -//! Specifies whether the Newton method should print messages or not -template -struct NewtonVerbose { using type = Properties::UndefinedProperty; }; - -//! Specifies whether the convergence rate and the global residual -//! gets written out to disk for every Newton iteration -template -struct NewtonWriteConvergence { using type = Properties::UndefinedProperty; }; - -/*! - * \brief The value for the error below which convergence is declared - * - * This value can (and for the porous media models will) be changed to account for grid - * scaling and other effects. - */ -template -struct NewtonTolerance { using type = Properties::UndefinedProperty; }; - //! The maximum error which may occur in a simulation before the //! Newton method for the time step is aborted -template -struct NewtonMaxError { using type = Properties::UndefinedProperty; }; +template +struct NewtonMaxError { static constexpr Scalar value = 1e100; }; + +//! Number of maximum iterations for the Newton method. +struct NewtonMaxIterations { static constexpr int value = 20; }; /*! * \brief The number of iterations at which the Newton method @@ -58,12 +41,23 @@ struct NewtonMaxError { using type = Properties::UndefinedProperty; }; * is to scale the last time-step size by the deviation of the * number of iterations used from the target steps. */ -template -struct NewtonTargetIterations { using type = Properties::UndefinedProperty; }; +struct NewtonTargetIterations { static constexpr int value = 10; }; -//! Number of maximum iterations for the Newton method. -template -struct NewtonMaxIterations { using type = Properties::UndefinedProperty; }; +/*! + * \brief The value for the error below which convergence is declared + * + * This value can (and for the porous media models will) be changed to account for grid + * scaling and other effects. + */ +template +struct NewtonTolerance { static constexpr Scalar value = 1e-8; }; + +//! Specifies whether the Newton method should print messages or not +struct NewtonVerbose { static constexpr bool value = true; }; + +//! Specifies whether the convergence rate and the global residual +//! gets written out to disk for every Newton iteration +struct NewtonWriteConvergence { static constexpr bool value = false; }; } // end namespace Opm::Parameters diff --git a/opm/models/ptflash/flashmodel.hh b/opm/models/ptflash/flashmodel.hh index 279be8d06..3d87ba365 100644 --- a/opm/models/ptflash/flashmodel.hh +++ b/opm/models/ptflash/flashmodel.hh @@ -35,13 +35,13 @@ #include #include -#include #include +#include -#include #include #include #include +#include #include #include @@ -69,11 +69,7 @@ namespace Opm::Properties { namespace TTag { //! The type tag for the isothermal single phase problems -struct FlashModel { using InheritsFrom = std::tuple; }; +struct FlashModel { using InheritsFrom = std::tuple; }; } // namespace TTag //! Use the FlashLocalResidual function for the flash model diff --git a/opm/models/pvs/pvsmodel.hh b/opm/models/pvs/pvsmodel.hh index f220dc47b..ec165efe2 100644 --- a/opm/models/pvs/pvsmodel.hh +++ b/opm/models/pvs/pvsmodel.hh @@ -69,11 +69,7 @@ namespace TTag { //! The type tag for the isothermal single phase problems struct PvsModel { - using InheritsFrom = std::tuple; }; + using InheritsFrom = std::tuple; }; } // namespace TTag //! Use the PVS local jacobian operator for the PVS model diff --git a/opm/simulators/linalg/istlpreconditionerwrappers.hh b/opm/simulators/linalg/istlpreconditionerwrappers.hh index fb81432f3..3a0a5d456 100644 --- a/opm/simulators/linalg/istlpreconditionerwrappers.hh +++ b/opm/simulators/linalg/istlpreconditionerwrappers.hh @@ -75,16 +75,16 @@ namespace Linear { \ static void registerParameters() \ { \ - Parameters::registerParam \ + Parameters::Register \ ("The order of the preconditioner"); \ - Parameters::registerParam \ + Parameters::Register> \ ("The relaxation factor of the preconditioner"); \ } \ \ void prepare(IstlMatrix& matrix) \ { \ - int order = Parameters::get(); \ - Scalar relaxationFactor = Parameters::get(); \ + int order = Parameters::Get(); \ + Scalar relaxationFactor = Parameters::Get>(); \ seqPreCond_ = new SequentialPreconditioner(matrix, order, \ relaxationFactor); \ } \ @@ -118,14 +118,14 @@ namespace Linear { \ static void registerParameters() \ { \ - Parameters::registerParam \ + Parameters::Register> \ ("The relaxation factor of the preconditioner"); \ } \ \ void prepare(OverlappingMatrix& matrix) \ { \ Scalar relaxationFactor = \ - Parameters::get(); \ + Parameters::Get>();\ seqPreCond_ = new SequentialPreconditioner(matrix, \ relaxationFactor); \ } \ @@ -155,7 +155,7 @@ class PreconditionerWrapperILU using OverlappingMatrix = GetPropType; using OverlappingVector = GetPropType; - static constexpr int order = getPropValue(); + static constexpr int order = 0; public: using SequentialPreconditioner = Dune::SeqILU; @@ -165,13 +165,15 @@ public: static void registerParameters() { - Parameters::registerParam + Parameters::Register> ("The relaxation factor of the preconditioner"); + Parameters::Register + ("The order of the preconditioner"); } void prepare(OverlappingMatrix& matrix) { - Scalar relaxationFactor = Parameters::get(); + Scalar relaxationFactor = Parameters::Get>(); // create the sequential preconditioner. seqPreCond_ = new SequentialPreconditioner(matrix, relaxationFactor); diff --git a/opm/simulators/linalg/istlsolverwrappers.hh b/opm/simulators/linalg/istlsolverwrappers.hh index 9da2649d9..8d1146ad8 100644 --- a/opm/simulators/linalg/istlsolverwrappers.hh +++ b/opm/simulators/linalg/istlsolverwrappers.hh @@ -79,12 +79,12 @@ namespace Opm::Linear { ScalarProduct& parScalarProduct, \ Preconditioner& parPreCond) \ { \ - Scalar tolerance = Parameters::get(); \ - int maxIter = Parameters::get(); \ + Scalar tolerance = Parameters::Get>(); \ + int maxIter = Parameters::Get();\ \ int verbosity = 0; \ if (parOperator.overlap().myRank() == 0) \ - verbosity = Parameters::get(); \ + verbosity = Parameters::Get(); \ solver_ = std::make_shared(parOperator, parScalarProduct, \ parPreCond, tolerance, maxIter, \ verbosity); \ @@ -125,7 +125,7 @@ public: static void registerParameters() { - Parameters::registerParam + Parameters::Register ("Number of iterations after which the GMRES linear solver is restarted"); } @@ -134,13 +134,13 @@ public: ScalarProduct& parScalarProduct, Preconditioner& parPreCond) { - Scalar tolerance = Parameters::get(); - int maxIter = Parameters::get(); + Scalar tolerance = Parameters::Get>(); + int maxIter = Parameters::Get(); int verbosity = 0; if (parOperator.overlap().myRank() == 0) - verbosity = Parameters::get(); - int restartAfter = Parameters::get(); + verbosity = Parameters::Get(); + int restartAfter = Parameters::Get(); solver_ = std::make_shared(parOperator, parScalarProduct, parPreCond, diff --git a/opm/simulators/linalg/linalgparameters.hh b/opm/simulators/linalg/linalgparameters.hh index 62ca4c552..bfa3985db 100644 --- a/opm/simulators/linalg/linalgparameters.hh +++ b/opm/simulators/linalg/linalgparameters.hh @@ -29,29 +29,22 @@ #ifndef EWOMS_LINALG_PARAMETERS_HH #define EWOMS_LINALG_PARAMETERS_HH -#include - namespace Opm::Parameters { -template -struct AmgCoarsenTarget { using type = Properties::UndefinedProperty; }; - //! number of iterations between solver restarts for the GMRES solver -template -struct GMResRestart { using type = Properties::UndefinedProperty; }; +struct GMResRestart { static constexpr int value = 10; }; /*! * \brief Maximum accepted error of the norm of the residual. */ -template -struct LinearSolverAbsTolerance { using type = Properties::UndefinedProperty; }; +template +struct LinearSolverAbsTolerance { static constexpr Scalar value = -1.0; }; -template -struct LinearSolverMaxError { using type = Properties::UndefinedProperty; }; +template +struct LinearSolverMaxError { static constexpr Scalar value = 1e7; }; //! Maximum number of iterations eyecuted by the linear solver -template -struct LinearSolverMaxIterations { using type = Properties::UndefinedProperty; }; +struct LinearSolverMaxIterations { static constexpr int value = 1000; }; /*! * \brief The size of the algebraic overlap of the linear solver. @@ -60,14 +53,13 @@ struct LinearSolverMaxIterations { using type = Properties::UndefinedProperty; } * of a grid, but it is only existant for the linear system of * equations. */ -template -struct LinearSolverOverlapSize { using type = Properties::UndefinedProperty; }; +struct LinearSolverOverlapSize { static constexpr unsigned value = 2; }; /*! * \brief Maximum accepted error of the solution of the linear solver. */ -template -struct LinearSolverTolerance { using type = Properties::UndefinedProperty; }; +template +struct LinearSolverTolerance { static constexpr Scalar value = 1e-3; }; /*! * \brief Specifies the verbosity of the linear solver @@ -76,16 +68,14 @@ struct LinearSolverTolerance { using type = Properties::UndefinedProperty; }; * property to 1 prints aggregated convergence rates, 2 prints the * convergence rate of every iteration of the scheme. */ -template -struct LinearSolverVerbosity { using type = Properties::UndefinedProperty; }; +struct LinearSolverVerbosity { static constexpr int value = 0; }; //! The order of the sequential preconditioner -template -struct PreconditionerOrder { using type = Properties::UndefinedProperty; }; +struct PreconditionerOrder { static constexpr int value = 0; }; //! The relaxation factor of the preconditioner -template -struct PreconditionerRelaxation { using type = Properties::UndefinedProperty; }; +template +struct PreconditionerRelaxation { static constexpr Scalar value = 1.0; }; } // namespace Opm::Parameters diff --git a/opm/simulators/linalg/parallelamgbackend.hh b/opm/simulators/linalg/parallelamgbackend.hh index e3bc26448..17523090a 100644 --- a/opm/simulators/linalg/parallelamgbackend.hh +++ b/opm/simulators/linalg/parallelamgbackend.hh @@ -69,16 +69,7 @@ namespace Opm::Parameters { //! The target number of DOFs per processor for the parallel algebraic //! multi-grid solver -template -struct AmgCoarsenTarget -{ static constexpr int value = 5000; }; - -template -struct LinearSolverMaxError -{ - using type = GetPropType; - static constexpr type value = 1e7; -}; +struct AmgCoarsenTarget { static constexpr int value = 5000; }; } @@ -160,10 +151,10 @@ public: { ParentType::registerParameters(); - Parameters::registerParam + Parameters::Register> ("The maximum residual error which the linear solver tolerates " "without giving up"); - Parameters::registerParam + Parameters::Register ("The coarsening target for the agglomerations of " "the AMG preconditioner"); } @@ -203,24 +194,25 @@ protected: const auto& gridView = this->simulator_.gridView(); using CCC = CombinedCriterion; - Scalar linearSolverTolerance = Parameters::get(); - Scalar linearSolverAbsTolerance = Parameters::get(); - if(linearSolverAbsTolerance < 0.0) + Scalar linearSolverTolerance = Parameters::Get>(); + Scalar linearSolverAbsTolerance = Parameters::Get>(); + if (linearSolverAbsTolerance < 0.0) { linearSolverAbsTolerance = this->simulator_.model().newtonMethod().tolerance()/100.0; + } convCrit_.reset(new CCC(gridView.comm(), /*residualReductionTolerance=*/linearSolverTolerance, /*absoluteResidualTolerance=*/linearSolverAbsTolerance, - Parameters::get())); + Parameters::Get>())); auto bicgstabSolver = std::make_shared(parPreCond, *convCrit_, parScalarProduct); int verbosity = 0; if (parOperator.overlap().myRank() == 0) - verbosity = Parameters::get(); + verbosity = Parameters::Get(); bicgstabSolver->setVerbosity(verbosity); - bicgstabSolver->setMaxIterations(Parameters::get()); + bicgstabSolver->setMaxIterations(Parameters::Get()); bicgstabSolver->setLinearOperator(&parOperator); bicgstabSolver->setRhs(this->overlappingb_); @@ -284,7 +276,7 @@ protected: int verbosity = 0; if (this->simulator_.vanguard().gridView().comm().rank() == 0) - verbosity = Parameters::get(); + verbosity = Parameters::Get(); using SmootherArgs = typename Dune::Amg::SmootherTraits::Arguments; @@ -299,7 +291,7 @@ protected: // Dune::Amg::FirstDiagonal>> using CoarsenCriterion = Dune::Amg:: CoarsenCriterion >; - int coarsenTarget = Parameters::get(); + int coarsenTarget = Parameters::Get(); CoarsenCriterion coarsenCriterion(/*maxLevel=*/15, coarsenTarget); coarsenCriterion.setDefaultValuesAnisotropic(GridView::dimension, /*aggregateSizePerDim=*/3); diff --git a/opm/simulators/linalg/parallelbasebackend.hh b/opm/simulators/linalg/parallelbasebackend.hh index fb098b9ba..b79089a84 100644 --- a/opm/simulators/linalg/parallelbasebackend.hh +++ b/opm/simulators/linalg/parallelbasebackend.hh @@ -152,15 +152,15 @@ public: */ static void registerParameters() { - Parameters::registerParam + Parameters::Register> ("The maximum allowed error between of the linear solver"); - Parameters::registerParam + Parameters::Register> ("The maximum accepted error of the norm of the residual"); - Parameters::registerParam + Parameters::Register ("The size of the algebraic overlap for the linear solver"); - Parameters::registerParam + Parameters::Register ("The maximum number of iterations of the linear solver"); - Parameters::registerParam + Parameters::Register ("The verbosity level of the linear solver"); PreconditionerWrapper::registerParameters(); @@ -195,7 +195,7 @@ public: simulator_.model().dofMapper()); // create the overlapping Jacobian matrix - unsigned overlapSize = Parameters::get(); + unsigned overlapSize = Parameters::Get(); overlappingMatrix_ = new OverlappingMatrix(M.istlMatrix(), borderListCreator.borderList(), borderListCreator.blackList(), @@ -444,36 +444,4 @@ struct PreconditionerWrapper } // namespace Opm::Properties -namespace Opm::Parameters { - -//! set the default number of maximum iterations for the linear solver -template -struct LinearSolverMaxIterations -{ static constexpr int value = 1000; }; - -//! set the default overlap size to 2 -template -struct LinearSolverOverlapSize -{ static constexpr unsigned value = 2; }; - -//! make the linear solver shut up by default -template -struct LinearSolverVerbosity -{ static constexpr int value = 0; }; - -//! set the preconditioner order to 0 by default -template -struct PreconditionerOrder -{ static constexpr int value = 0; }; - -//! set the preconditioner relaxation parameter to 1.0 by default -template -struct PreconditionerRelaxation -{ - using type = GetPropType; - static constexpr type value = 1.0; -}; - -} // namespace Opm::Parameters - #endif diff --git a/opm/simulators/linalg/parallelbicgstabbackend.hh b/opm/simulators/linalg/parallelbicgstabbackend.hh index b0747dc74..8b581990d 100644 --- a/opm/simulators/linalg/parallelbicgstabbackend.hh +++ b/opm/simulators/linalg/parallelbicgstabbackend.hh @@ -59,17 +59,6 @@ struct LinearSolverBackend } // namespace Opm::Properties -namespace Opm::Parameters { - -template -struct LinearSolverMaxError -{ - using type = GetPropType; - static constexpr type value = 1e7; -}; - -} - namespace Opm::Linear { /*! @@ -131,7 +120,7 @@ public: { ParentType::registerParameters(); - Parameters::registerParam + Parameters::Register> ("The maximum residual error which the linear solver tolerates" " without giving up"); } @@ -146,24 +135,24 @@ protected: const auto& gridView = this->simulator_.gridView(); using CCC = CombinedCriterion; - Scalar linearSolverTolerance = Parameters::get(); - Scalar linearSolverAbsTolerance = Parameters::get(); + Scalar linearSolverTolerance = Parameters::Get>(); + Scalar linearSolverAbsTolerance = Parameters::Get>(); if(linearSolverAbsTolerance < 0.0) linearSolverAbsTolerance = this->simulator_.model().newtonMethod().tolerance() / 100.0; convCrit_.reset(new CCC(gridView.comm(), /*residualReductionTolerance=*/linearSolverTolerance, /*absoluteResidualTolerance=*/linearSolverAbsTolerance, - Parameters::get())); + Parameters::Get>())); auto bicgstabSolver = std::make_shared(parPreCond, *convCrit_, parScalarProduct); int verbosity = 0; if (parOperator.overlap().myRank() == 0) - verbosity = Parameters::get(); + verbosity = Parameters::Get(); bicgstabSolver->setVerbosity(verbosity); - bicgstabSolver->setMaxIterations(Parameters::get()); + bicgstabSolver->setMaxIterations(Parameters::Get()); bicgstabSolver->setLinearOperator(&parOperator); bicgstabSolver->setRhs(this->overlappingb_); diff --git a/opm/simulators/linalg/parallelistlbackend.hh b/opm/simulators/linalg/parallelistlbackend.hh index a264ae20f..314c3a1e9 100644 --- a/opm/simulators/linalg/parallelistlbackend.hh +++ b/opm/simulators/linalg/parallelistlbackend.hh @@ -158,13 +158,4 @@ struct PreconditionerWrapper } // namespace Opm::Properties -namespace Opm::Parameters { - -//! set the GMRes restart parameter to 10 by default -template -struct GMResRestart -{ static constexpr int value = 10; }; - -} - #endif diff --git a/opm/simulators/linalg/superlubackend.hh b/opm/simulators/linalg/superlubackend.hh index 451a08c6b..f33b36e36 100644 --- a/opm/simulators/linalg/superlubackend.hh +++ b/opm/simulators/linalg/superlubackend.hh @@ -73,7 +73,7 @@ public: static void registerParameters() { - Parameters::registerParam + Parameters::Register ("The verbosity level of the linear solver"); } @@ -114,7 +114,7 @@ public: { Vector bTmp(b); - int verbosity = Parameters::get(); + int verbosity = Parameters::Get(); Dune::InverseOperatorResult result; Dune::SuperLU solver(A, verbosity > 0); solver.apply(x, bTmp, result);