diff --git a/examples/co2injection_flash_ecfv.cpp b/examples/co2injection_flash_ecfv.cpp index 7798b5d0c..391dfb0d9 100644 --- a/examples/co2injection_flash_ecfv.cpp +++ b/examples/co2injection_flash_ecfv.cpp @@ -66,7 +66,12 @@ struct Scalar { using type = quad; // precision scalars... (this seems to only apply to Dune >= 2.4) SET_TAG_PROP(Co2InjectionFlashEcfvProblem, LinearSolverSplice, ParallelBiCGStabLinearSolver); #else -SET_SCALAR_PROP(Co2InjectionFlashEcfvProblem, NewtonTolerance, 1e-5); +template +struct NewtonTolerance +{ + using type = GetPropType; + static constexpr type value = 1e-5; +}; #endif } // namespace Opm::Properties diff --git a/examples/co2injection_flash_ni_ecfv.cpp b/examples/co2injection_flash_ni_ecfv.cpp index 65575bf09..c41279b49 100644 --- a/examples/co2injection_flash_ni_ecfv.cpp +++ b/examples/co2injection_flash_ni_ecfv.cpp @@ -66,7 +66,12 @@ struct Scalar { using type = quad // precision scalars... (this seems to only apply to Dune >= 2.4) SET_TAG_PROP(Co2InjectionFlashNiEcfvProblem, LinearSolverSplice, ParallelBiCGStabLinearSolver); #else -SET_SCALAR_PROP(Co2InjectionFlashNiEcfvProblem, NewtonTolerance, 1e-5); +template +struct NewtonTolerance +{ + using type = GetPropType; + static constexpr type value = 1e-5; +}; #endif } // namespace Opm::Properties diff --git a/examples/co2injection_flash_ni_vcfv.cpp b/examples/co2injection_flash_ni_vcfv.cpp index a3c2bbb5d..54a8408ad 100644 --- a/examples/co2injection_flash_ni_vcfv.cpp +++ b/examples/co2injection_flash_ni_vcfv.cpp @@ -63,7 +63,12 @@ struct Scalar { using type = quad // precision scalars... (this seems to only apply to Dune >= 2.4) SET_TAG_PROP(Co2InjectionFlashNiVcfvProblem, LinearSolverSplice, ParallelBiCGStabLinearSolver); #else -SET_SCALAR_PROP(Co2InjectionFlashNiVcfvProblem, NewtonTolerance, 1e-5); +template +struct NewtonTolerance +{ + using type = GetPropType; + static constexpr type value = 1e-5; +}; #endif } // namespace Opm::Properties diff --git a/examples/co2injection_flash_vcfv.cpp b/examples/co2injection_flash_vcfv.cpp index ba1ad11f4..8be53d8fe 100644 --- a/examples/co2injection_flash_vcfv.cpp +++ b/examples/co2injection_flash_vcfv.cpp @@ -63,7 +63,12 @@ struct Scalar { using type = quad; // precision scalars... (this seems to only apply to Dune >= 2.4) SET_TAG_PROP(Co2InjectionFlashVcfvProblem, LinearSolverSplice, ParallelBiCGStabLinearSolver); #else -SET_SCALAR_PROP(Co2InjectionFlashVcfvProblem, NewtonTolerance, 1e-5); +template +struct NewtonTolerance +{ + using type = GetPropType; + static constexpr type value = 1e-5; +}; #endif } // namespace Opm::Properties diff --git a/examples/problems/co2injectionproblem.hh b/examples/problems/co2injectionproblem.hh index 039a29601..c5fa001f0 100644 --- a/examples/problems/co2injectionproblem.hh +++ b/examples/problems/co2injectionproblem.hh @@ -166,24 +166,64 @@ template struct EnableGravity { static constexpr bool value = true; }; // set the defaults for the problem specific properties -SET_SCALAR_PROP(Co2InjectionBaseProblem, FluidSystemPressureLow, 3e7); -SET_SCALAR_PROP(Co2InjectionBaseProblem, FluidSystemPressureHigh, 4e7); +template +struct FluidSystemPressureLow +{ + using type = GetPropType; + static constexpr type value = 3e7; +}; +template +struct FluidSystemPressureHigh +{ + using type = GetPropType; + static constexpr type value = 4e7; +}; template struct FluidSystemNumPressure { static constexpr int value = 100; }; -SET_SCALAR_PROP(Co2InjectionBaseProblem, FluidSystemTemperatureLow, 290); -SET_SCALAR_PROP(Co2InjectionBaseProblem, FluidSystemTemperatureHigh, 500); +template +struct FluidSystemTemperatureLow +{ + using type = GetPropType; + static constexpr type value = 290; +}; +template +struct FluidSystemTemperatureHigh +{ + using type = GetPropType; + static constexpr type value = 500; +}; template struct FluidSystemNumTemperature { static constexpr int value = 100; }; -SET_SCALAR_PROP(Co2InjectionBaseProblem, MaxDepth, 2500); -SET_SCALAR_PROP(Co2InjectionBaseProblem, Temperature, 293.15); +template +struct MaxDepth +{ + using type = GetPropType; + static constexpr type value = 2500; +}; +template +struct Temperature +{ + using type = GetPropType; + static constexpr type value = 293.15; +}; SET_STRING_PROP(Co2InjectionBaseProblem, SimulationName, "co2injection"); // The default for the end time of the simulation -SET_SCALAR_PROP(Co2InjectionBaseProblem, EndTime, 1e4); +template +struct EndTime +{ + using type = GetPropType; + static constexpr type value = 1e4; +}; // The default for the initial time step size of the simulation -SET_SCALAR_PROP(Co2InjectionBaseProblem, InitialTimeStepSize, 250); +template +struct InitialTimeStepSize +{ + using type = GetPropType; + static constexpr type value = 250; +}; // The default DGF file to load SET_STRING_PROP(Co2InjectionBaseProblem, GridFile, "data/co2injection.dgf"); diff --git a/examples/problems/cuvetteproblem.hh b/examples/problems/cuvetteproblem.hh index b740c8c30..e71c85316 100644 --- a/examples/problems/cuvetteproblem.hh +++ b/examples/problems/cuvetteproblem.hh @@ -80,7 +80,12 @@ template struct EnableGravity { static constexpr bool value = true; }; // Set the maximum time step -SET_SCALAR_PROP(CuvetteBaseProblem, MaxTimeStepSize, 600.); +template +struct MaxTimeStepSize +{ + using type = GetPropType; + static constexpr type value = 600.; +}; // Set the material Law template @@ -118,10 +123,20 @@ public: }; // The default for the end time of the simulation -SET_SCALAR_PROP(CuvetteBaseProblem, EndTime, 180); +template +struct EndTime +{ + using type = GetPropType; + static constexpr type value = 180; +}; // The default for the initial time step size of the simulation -SET_SCALAR_PROP(CuvetteBaseProblem, InitialTimeStepSize, 1); +template +struct InitialTimeStepSize +{ + using type = GetPropType; + static constexpr type value = 1; +}; // The default DGF file to load SET_STRING_PROP(CuvetteBaseProblem, GridFile, "./data/cuvette_11x4.dgf"); diff --git a/examples/problems/diffusionproblem.hh b/examples/problems/diffusionproblem.hh index cc8de1367..3b93ffd30 100644 --- a/examples/problems/diffusionproblem.hh +++ b/examples/problems/diffusionproblem.hh @@ -108,9 +108,24 @@ template struct EnableGravity { static constexpr bool value = false; }; // define the properties specific for the diffusion problem -SET_SCALAR_PROP(DiffusionBaseProblem, DomainSizeX, 1.0); -SET_SCALAR_PROP(DiffusionBaseProblem, DomainSizeY, 1.0); -SET_SCALAR_PROP(DiffusionBaseProblem, DomainSizeZ, 1.0); +template +struct DomainSizeX +{ + using type = GetPropType; + static constexpr type value = 1.0; +}; +template +struct DomainSizeY +{ + using type = GetPropType; + static constexpr type value = 1.0; +}; +template +struct DomainSizeZ +{ + using type = GetPropType; + static constexpr type value = 1.0; +}; template struct CellsX { static constexpr int value = 250; }; @@ -120,10 +135,20 @@ template struct CellsZ { static constexpr int value = 1; }; // The default for the end time of the simulation -SET_SCALAR_PROP(DiffusionBaseProblem, EndTime, 1e6); +template +struct EndTime +{ + using type = GetPropType; + static constexpr type value = 1e6; +}; // The default for the initial time step size of the simulation -SET_SCALAR_PROP(DiffusionBaseProblem, InitialTimeStepSize, 1000); +template +struct InitialTimeStepSize +{ + using type = GetPropType; + static constexpr type value = 1000; +}; } // namespace Opm::Properties diff --git a/examples/problems/fingerproblem.hh b/examples/problems/fingerproblem.hh index 31edab77f..532202d54 100644 --- a/examples/problems/fingerproblem.hh +++ b/examples/problems/fingerproblem.hh @@ -141,11 +141,31 @@ template struct EnableGravity { static constexpr bool value = true; }; // define the properties specific for the finger problem -SET_SCALAR_PROP(FingerBaseProblem, DomainSizeX, 0.1); -SET_SCALAR_PROP(FingerBaseProblem, DomainSizeY, 0.3); -SET_SCALAR_PROP(FingerBaseProblem, DomainSizeZ, 0.1); +template +struct DomainSizeX +{ + using type = GetPropType; + static constexpr type value = 0.1; +}; +template +struct DomainSizeY +{ + using type = GetPropType; + static constexpr type value = 0.3; +}; +template +struct DomainSizeZ +{ + using type = GetPropType; + static constexpr type value = 0.1; +}; -SET_SCALAR_PROP(FingerBaseProblem, InitialWaterSaturation, 0.01); +template +struct InitialWaterSaturation +{ + using type = GetPropType; + static constexpr type value = 0.01; +}; template struct CellsX { static constexpr int value = 20; }; @@ -155,10 +175,20 @@ template struct CellsZ { static constexpr int value = 1; }; // The default for the end time of the simulation -SET_SCALAR_PROP(FingerBaseProblem, EndTime, 215); +template +struct EndTime +{ + using type = GetPropType; + static constexpr type value = 215; +}; // The default for the initial time step size of the simulation -SET_SCALAR_PROP(FingerBaseProblem, InitialTimeStepSize, 10); +template +struct InitialTimeStepSize +{ + using type = GetPropType; + static constexpr type value = 10; +}; } // namespace Opm::Properties diff --git a/examples/problems/fractureproblem.hh b/examples/problems/fractureproblem.hh index 78c763b5b..5f102e49e 100644 --- a/examples/problems/fractureproblem.hh +++ b/examples/problems/fractureproblem.hh @@ -165,10 +165,20 @@ struct EnableConstraints { static constexpr bool SET_STRING_PROP(FractureProblem, GridFile, "data/fracture.art.dgf"); // Set the default value for the end time -SET_SCALAR_PROP(FractureProblem, EndTime, 3e3); +template +struct EndTime +{ + using type = GetPropType; + static constexpr type value = 3e3; +}; // Set the default value for the initial time step size -SET_SCALAR_PROP(FractureProblem, InitialTimeStepSize, 100); +template +struct InitialTimeStepSize +{ + using type = GetPropType; + static constexpr type value = 100; +}; } // namespace Opm::Properties diff --git a/examples/problems/groundwaterproblem.hh b/examples/problems/groundwaterproblem.hh index ca6d3d5c2..bddd294fb 100644 --- a/examples/problems/groundwaterproblem.hh +++ b/examples/problems/groundwaterproblem.hh @@ -92,24 +92,74 @@ struct Grid { using type = Dune::YaspGrid SET_TYPE_PROP(GroundWaterBaseProblem, Problem, Opm::GroundWaterProblem); -SET_SCALAR_PROP(GroundWaterBaseProblem, LensLowerLeftX, 0.25); -SET_SCALAR_PROP(GroundWaterBaseProblem, LensLowerLeftY, 0.25); -SET_SCALAR_PROP(GroundWaterBaseProblem, LensLowerLeftZ, 0.25); -SET_SCALAR_PROP(GroundWaterBaseProblem, LensUpperRightX, 0.75); -SET_SCALAR_PROP(GroundWaterBaseProblem, LensUpperRightY, 0.75); -SET_SCALAR_PROP(GroundWaterBaseProblem, LensUpperRightZ, 0.75); -SET_SCALAR_PROP(GroundWaterBaseProblem, Permeability, 1e-10); -SET_SCALAR_PROP(GroundWaterBaseProblem, PermeabilityLens, 1e-12); +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; +}; // Enable gravity template struct EnableGravity { static constexpr bool value = true; }; // The default for the end time of the simulation -SET_SCALAR_PROP(GroundWaterBaseProblem, EndTime, 1); +template +struct EndTime +{ + using type = GetPropType; + static constexpr type value = 1; +}; // The default for the initial time step size of the simulation -SET_SCALAR_PROP(GroundWaterBaseProblem, InitialTimeStepSize, 1); +template +struct InitialTimeStepSize +{ + using type = GetPropType; + static constexpr type value = 1; +}; // The default DGF file to load SET_STRING_PROP(GroundWaterBaseProblem, GridFile, "./data/groundwater_2d.dgf"); diff --git a/examples/problems/infiltrationproblem.hh b/examples/problems/infiltrationproblem.hh index 4891120e4..f84dad693 100644 --- a/examples/problems/infiltrationproblem.hh +++ b/examples/problems/infiltrationproblem.hh @@ -100,10 +100,20 @@ public: }; // The default for the end time of the simulation -SET_SCALAR_PROP(InfiltrationBaseProblem, EndTime, 6e3); +template +struct EndTime +{ + using type = GetPropType; + static constexpr type value = 6e3; +}; // The default for the initial time step size of the simulation -SET_SCALAR_PROP(InfiltrationBaseProblem, InitialTimeStepSize, 60); +template +struct InitialTimeStepSize +{ + using type = GetPropType; + static constexpr type value = 60; +}; // The default DGF file to load SET_STRING_PROP(InfiltrationBaseProblem, GridFile, diff --git a/examples/problems/lensproblem.hh b/examples/problems/lensproblem.hh index d433958d9..eedb4d6f0 100644 --- a/examples/problems/lensproblem.hh +++ b/examples/problems/lensproblem.hh @@ -143,16 +143,61 @@ template struct EnableGravity { static constexpr bool value = true; }; // define the properties specific for the lens problem -SET_SCALAR_PROP(LensBaseProblem, LensLowerLeftX, 1.0); -SET_SCALAR_PROP(LensBaseProblem, LensLowerLeftY, 2.0); -SET_SCALAR_PROP(LensBaseProblem, LensLowerLeftZ, 0.0); -SET_SCALAR_PROP(LensBaseProblem, LensUpperRightX, 4.0); -SET_SCALAR_PROP(LensBaseProblem, LensUpperRightY, 3.0); -SET_SCALAR_PROP(LensBaseProblem, LensUpperRightZ, 1.0); +template +struct LensLowerLeftX +{ + using type = GetPropType; + static constexpr type value = 1.0; +}; +template +struct LensLowerLeftY +{ + using type = GetPropType; + static constexpr type value = 2.0; +}; +template +struct LensLowerLeftZ +{ + using type = GetPropType; + static constexpr type value = 0.0; +}; +template +struct LensUpperRightX +{ + using type = GetPropType; + static constexpr type value = 4.0; +}; +template +struct LensUpperRightY +{ + using type = GetPropType; + static constexpr type value = 3.0; +}; +template +struct LensUpperRightZ +{ + using type = GetPropType; + static constexpr type value = 1.0; +}; -SET_SCALAR_PROP(LensBaseProblem, DomainSizeX, 6.0); -SET_SCALAR_PROP(LensBaseProblem, DomainSizeY, 4.0); -SET_SCALAR_PROP(LensBaseProblem, DomainSizeZ, 1.0); +template +struct DomainSizeX +{ + using type = GetPropType; + static constexpr type value = 6.0; +}; +template +struct DomainSizeY +{ + using type = GetPropType; + static constexpr type value = 4.0; +}; +template +struct DomainSizeZ +{ + using type = GetPropType; + static constexpr type value = 1.0; +}; template struct CellsX { static constexpr int value = 48; }; @@ -162,10 +207,20 @@ template struct CellsZ { static constexpr int value = 16; }; // The default for the end time of the simulation -SET_SCALAR_PROP(LensBaseProblem, EndTime, 30e3); +template +struct EndTime +{ + using type = GetPropType; + static constexpr type value = 30e3; +}; // The default for the initial time step size of the simulation -SET_SCALAR_PROP(LensBaseProblem, InitialTimeStepSize, 250); +template +struct InitialTimeStepSize +{ + using type = GetPropType; + static constexpr type value = 250; +}; // By default, include the intrinsic permeability tensor to the VTK output files template diff --git a/examples/problems/obstacleproblem.hh b/examples/problems/obstacleproblem.hh index 5955bd700..5af5b514c 100644 --- a/examples/problems/obstacleproblem.hh +++ b/examples/problems/obstacleproblem.hh @@ -114,10 +114,20 @@ template struct EnableGravity { static constexpr bool value = true; }; // The default for the end time of the simulation -SET_SCALAR_PROP(ObstacleBaseProblem, EndTime, 1e4); +template +struct EndTime +{ + using type = GetPropType; + static constexpr type value = 1e4; +}; // The default for the initial time step size of the simulation -SET_SCALAR_PROP(ObstacleBaseProblem, InitialTimeStepSize, 250); +template +struct InitialTimeStepSize +{ + using type = GetPropType; + static constexpr type value = 250; +}; // The default DGF file to load SET_STRING_PROP(ObstacleBaseProblem, GridFile, "./data/obstacle_24x16.dgf"); diff --git a/examples/problems/outflowproblem.hh b/examples/problems/outflowproblem.hh index d75e149fa..cd5a1ce30 100644 --- a/examples/problems/outflowproblem.hh +++ b/examples/problems/outflowproblem.hh @@ -78,10 +78,20 @@ template struct VtkWriteMassFractions { static constexpr bool value = true; }; // The default for the end time of the simulation -SET_SCALAR_PROP(OutflowBaseProblem, EndTime, 100); +template +struct EndTime +{ + using type = GetPropType; + static constexpr type value = 100; +}; // The default for the initial time step size of the simulation -SET_SCALAR_PROP(OutflowBaseProblem, InitialTimeStepSize, 1); +template +struct InitialTimeStepSize +{ + using type = GetPropType; + static constexpr type value = 1; +}; // The default DGF file to load SET_STRING_PROP(OutflowBaseProblem, GridFile, "./data/outflow.dgf"); diff --git a/examples/problems/powerinjectionproblem.hh b/examples/problems/powerinjectionproblem.hh index e48e38fe2..94168b7d6 100644 --- a/examples/problems/powerinjectionproblem.hh +++ b/examples/problems/powerinjectionproblem.hh @@ -128,9 +128,24 @@ template struct EnableGravity { static constexpr bool value = false; }; // define the properties specific for the power injection problem -SET_SCALAR_PROP(PowerInjectionBaseProblem, DomainSizeX, 100.0); -SET_SCALAR_PROP(PowerInjectionBaseProblem, DomainSizeY, 1.0); -SET_SCALAR_PROP(PowerInjectionBaseProblem, DomainSizeZ, 1.0); +template +struct DomainSizeX +{ + using type = GetPropType; + static constexpr type value = 100.0; +}; +template +struct DomainSizeY +{ + using type = GetPropType; + static constexpr type value = 1.0; +}; +template +struct DomainSizeZ +{ + using type = GetPropType; + static constexpr type value = 1.0; +}; template struct CellsX { static constexpr int value = 250; }; @@ -140,10 +155,20 @@ template struct CellsZ { static constexpr int value = 1; }; // The default for the end time of the simulation -SET_SCALAR_PROP(PowerInjectionBaseProblem, EndTime, 100); +template +struct EndTime +{ + using type = GetPropType; + static constexpr type value = 100; +}; // The default for the initial time step size of the simulation -SET_SCALAR_PROP(PowerInjectionBaseProblem, InitialTimeStepSize, 1e-3); +template +struct InitialTimeStepSize +{ + using type = GetPropType; + static constexpr type value = 1e-3; +}; } // namespace Opm::Properties diff --git a/examples/problems/reservoirproblem.hh b/examples/problems/reservoirproblem.hh index eeffa77aa..ea1b1ed08 100644 --- a/examples/problems/reservoirproblem.hh +++ b/examples/problems/reservoirproblem.hh @@ -110,20 +110,45 @@ template struct EnableConstraints { static constexpr bool value = true; }; // set the defaults for some problem specific properties -SET_SCALAR_PROP(ReservoirBaseProblem, MaxDepth, 2500); -SET_SCALAR_PROP(ReservoirBaseProblem, Temperature, 293.15); +template +struct MaxDepth +{ + using type = GetPropType; + static constexpr type value = 2500; +}; +template +struct Temperature +{ + using type = GetPropType; + static constexpr type value = 293.15; +}; //! The default for the end time of the simulation [s]. //! //! By default this problem spans 1000 days (100 "settle down" days and 900 days of //! production) -SET_SCALAR_PROP(ReservoirBaseProblem, EndTime, 1000.0*24*60*60); +template +struct EndTime +{ + using type = GetPropType; + static constexpr type value = 1000.0*24*60*60; +}; // The default for the initial time step size of the simulation [s] -SET_SCALAR_PROP(ReservoirBaseProblem, InitialTimeStepSize, 100e3); +template +struct InitialTimeStepSize +{ + using type = GetPropType; + static constexpr type value = 100e3; +}; // The width of producer/injector wells as a fraction of the width of the spatial domain -SET_SCALAR_PROP(ReservoirBaseProblem, WellWidth, 0.01); +template +struct WellWidth +{ + using type = GetPropType; + static constexpr type value = 0.01; +}; /*! * \brief Explicitly set the fluid system to the black-oil fluid system @@ -147,7 +172,12 @@ public: SET_STRING_PROP(ReservoirBaseProblem, GridFile, "data/reservoir.dgf"); // increase the tolerance for this problem to get larger time steps -SET_SCALAR_PROP(ReservoirBaseProblem, NewtonTolerance, 1e-6); +template +struct NewtonTolerance +{ + using type = GetPropType; + static constexpr type value = 1e-6; +}; } // namespace Opm::Properties diff --git a/examples/problems/richardslensproblem.hh b/examples/problems/richardslensproblem.hh index 603a44d8a..a1e74e629 100644 --- a/examples/problems/richardslensproblem.hh +++ b/examples/problems/richardslensproblem.hh @@ -122,10 +122,20 @@ template struct NewtonWriteConvergence { static constexpr bool value = false; }; // The default for the end time of the simulation -SET_SCALAR_PROP(RichardsLensProblem, EndTime, 3000); +template +struct EndTime +{ + using type = GetPropType; + static constexpr type value = 3000; +}; // The default for the initial time step size of the simulation -SET_SCALAR_PROP(RichardsLensProblem, InitialTimeStepSize, 100); +template +struct InitialTimeStepSize +{ + using type = GetPropType; + static constexpr type value = 100; +}; // The default DGF file to load SET_STRING_PROP(RichardsLensProblem, GridFile, "./data/richardslens_24x16.dgf"); diff --git a/examples/problems/waterairproblem.hh b/examples/problems/waterairproblem.hh index 2bfdf53a0..0bac9ed2f 100644 --- a/examples/problems/waterairproblem.hh +++ b/examples/problems/waterairproblem.hh @@ -126,10 +126,20 @@ template struct NewtonWriteConvergence { static constexpr bool value = false; }; // The default for the end time of the simulation (1 year) -SET_SCALAR_PROP(WaterAirBaseProblem, EndTime, 1.0 * 365 * 24 * 60 * 60); +template +struct EndTime +{ + using type = GetPropType; + static constexpr type value = 1.0 * 365 * 24 * 60 * 60; +}; // The default for the initial time step size of the simulation -SET_SCALAR_PROP(WaterAirBaseProblem, InitialTimeStepSize, 250); +template +struct InitialTimeStepSize +{ + using type = GetPropType; + static constexpr type value = 250; +}; // The default DGF file to load SET_STRING_PROP(WaterAirBaseProblem, GridFile, "./data/waterair.dgf"); diff --git a/examples/reservoir_ncp_vcfv.cpp b/examples/reservoir_ncp_vcfv.cpp index 642a8b339..acf478efd 100644 --- a/examples/reservoir_ncp_vcfv.cpp +++ b/examples/reservoir_ncp_vcfv.cpp @@ -50,7 +50,12 @@ struct EnableStorageCache { static const // reduce the base epsilon for the finite difference method to 10^-11. for some reason // the simulator converges better with this. (TODO: use automatic differentiation?) -SET_SCALAR_PROP(ReservoirNcpVcfvProblem, BaseEpsilon, 1e-11); +template +struct BaseEpsilon +{ + using type = GetPropType; + static constexpr type value = 1e-11; +}; } // namespace Opm::Properties diff --git a/examples/tutorial1problem.hh b/examples/tutorial1problem.hh index 271815ec0..67d35965e 100644 --- a/examples/tutorial1problem.hh +++ b/examples/tutorial1problem.hh @@ -119,15 +119,40 @@ template struct EnableGravity { static constexpr bool value = false; }; /*@\label{tutorial1:gravity}@*/ // define how long the simulation should run [s] -SET_SCALAR_PROP(Tutorial1Problem, EndTime, 100e3); /*@\label{tutorial1:default-params-begin}@*/ +template +struct EndTime +{ + using type = GetPropType; + static constexpr type value = 100e3; +}; /*@\label{tutorial1:default-params-begin}@*/ // define the size of the initial time step [s] -SET_SCALAR_PROP(Tutorial1Problem, InitialTimeStepSize, 125.0); +template +struct InitialTimeStepSize +{ + using type = GetPropType; + static constexpr type value = 125.0; +}; // define the physical size of the problem's domain [m] -SET_SCALAR_PROP(Tutorial1Problem, DomainSizeX, 300.0); /*@\label{tutorial1:grid-default-params-begin}@*/ -SET_SCALAR_PROP(Tutorial1Problem, DomainSizeY, 60.0); -SET_SCALAR_PROP(Tutorial1Problem, DomainSizeZ, 0.0); +template +struct DomainSizeX +{ + using type = GetPropType; + static constexpr type value = 300.0; +}; /*@\label{tutorial1:grid-default-params-begin}@*/ +template +struct DomainSizeY +{ + using type = GetPropType; + static constexpr type value = 60.0; +}; +template +struct DomainSizeZ +{ + using type = GetPropType; + static constexpr type value = 0.0; +}; // // define the number of cells used for discretizing the physical domain template diff --git a/opm/models/blackoil/blackoilnewtonmethod.hh b/opm/models/blackoil/blackoilnewtonmethod.hh index 8b0a9e890..c65c443d5 100644 --- a/opm/models/blackoil/blackoilnewtonmethod.hh +++ b/opm/models/blackoil/blackoilnewtonmethod.hh @@ -49,9 +49,24 @@ struct PriVarOscilationThreshold { using type = UndefinedProperty; }; template struct ProjectSaturations { using type = UndefinedProperty; }; -SET_SCALAR_PROP(NewtonMethod, DpMaxRel, 0.3); -SET_SCALAR_PROP(NewtonMethod, DsMax, 0.2); -SET_SCALAR_PROP(NewtonMethod, PriVarOscilationThreshold, 1e-5); +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; }; diff --git a/opm/models/discretization/common/fvbasediscretization.hh b/opm/models/discretization/common/fvbasediscretization.hh index 3f70cad5e..0eb9ae6aa 100644 --- a/opm/models/discretization/common/fvbasediscretization.hh +++ b/opm/models/discretization/common/fvbasediscretization.hh @@ -220,10 +220,20 @@ template struct Linearizer { using type = Opm::FvBaseLinearizer; }; //! use an unlimited time step size by default -SET_SCALAR_PROP(FvBaseDiscretization, MaxTimeStepSize, std::numeric_limits::infinity()); +template +struct MaxTimeStepSize +{ + using type = GetPropType; + static constexpr type value = std::numeric_limits::infinity(); +}; //! By default, accept any time step larger than zero -SET_SCALAR_PROP(FvBaseDiscretization, MinTimeStepSize, 0.0); +template +struct MinTimeStepSize +{ + using type = GetPropType; + static constexpr type value = 0.0; +}; //! Disable grid adaptation by default template @@ -270,10 +280,20 @@ struct EnableThermodynamicHints { static co // 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... -SET_SCALAR_PROP(FvBaseDiscretization, LinearSolverTolerance, 1e-3); +template +struct LinearSolverTolerance +{ + using type = GetPropType; + static constexpr type value = 1e-3; +}; // use default initialization based on rule-of-thumb of Newton tolerance -SET_SCALAR_PROP(FvBaseDiscretization, LinearSolverAbsTolerance, -1.); +template +struct LinearSolverAbsTolerance +{ + using type = GetPropType; + static constexpr type value = -1.; +}; //! Set the history size of the time discretization to 2 (for implicit euler) template diff --git a/opm/models/flash/flashmodel.hh b/opm/models/flash/flashmodel.hh index ba49c258b..d02964bcc 100644 --- a/opm/models/flash/flashmodel.hh +++ b/opm/models/flash/flashmodel.hh @@ -74,7 +74,12 @@ SET_TYPE_PROP(FlashModel, FlashSolver, GetPropType>); //! Let the flash solver choose its tolerance by default -SET_SCALAR_PROP(FlashModel, FlashTolerance, -1.0); +template +struct FlashTolerance +{ + using type = GetPropType; + static constexpr type value = -1.0; +}; //! the Model property template diff --git a/opm/models/ncp/ncpmodel.hh b/opm/models/ncp/ncpmodel.hh index fb4ba267a..cb286f47a 100644 --- a/opm/models/ncp/ncpmodel.hh +++ b/opm/models/ncp/ncpmodel.hh @@ -122,11 +122,26 @@ template struct Indices { using type = Opm::NcpIndices; }; //! The unmodified weight for the pressure primary variable -SET_SCALAR_PROP(NcpModel, NcpPressureBaseWeight, 1.0); +template +struct NcpPressureBaseWeight +{ + using type = GetPropType; + static constexpr type value = 1.0; +}; //! The weight for the saturation primary variables -SET_SCALAR_PROP(NcpModel, NcpSaturationsBaseWeight, 1.0); +template +struct NcpSaturationsBaseWeight +{ + using type = GetPropType; + static constexpr type value = 1.0; +}; //! The unmodified weight for the fugacity primary variables -SET_SCALAR_PROP(NcpModel, NcpFugacitiesBaseWeight, 1.0e-6); +template +struct NcpFugacitiesBaseWeight +{ + using type = GetPropType; + static constexpr type value = 1.0e-6; +}; } // namespace Opm::Properties diff --git a/opm/models/nonlinear/newtonmethod.hh b/opm/models/nonlinear/newtonmethod.hh index d4ab90679..56692ced9 100644 --- a/opm/models/nonlinear/newtonmethod.hh +++ b/opm/models/nonlinear/newtonmethod.hh @@ -130,10 +130,20 @@ template struct NewtonWriteConvergence { static constexpr bool value = false; }; template struct NewtonVerbose { static constexpr bool value = true; }; -SET_SCALAR_PROP(NewtonMethod, NewtonTolerance, 1e-8); +template +struct NewtonTolerance +{ + using type = GetPropType; + static constexpr type value = 1e-8; +}; // set the abortion tolerace to some very large value. if not // overwritten at run-time this basically disables abortions -SET_SCALAR_PROP(NewtonMethod, NewtonMaxError, 1e100); +template +struct NewtonMaxError +{ + using type = GetPropType; + static constexpr type value = 1e100; +}; template struct NewtonTargetIterations { static constexpr int value = 10; }; template diff --git a/opm/models/pvs/pvsmodel.hh b/opm/models/pvs/pvsmodel.hh index 0613fb6dd..a64d41760 100644 --- a/opm/models/pvs/pvsmodel.hh +++ b/opm/models/pvs/pvsmodel.hh @@ -120,13 +120,28 @@ template struct EnableDiffusion { static constexpr bool value = false; }; //! The basis value for the weight of the pressure primary variable -SET_SCALAR_PROP(PvsModel, PvsPressureBaseWeight, 1.0); +template +struct PvsPressureBaseWeight +{ + using type = GetPropType; + static constexpr type value = 1.0; +}; //! The basis value for the weight of the saturation primary variables -SET_SCALAR_PROP(PvsModel, PvsSaturationsBaseWeight, 1.0); +template +struct PvsSaturationsBaseWeight +{ + using type = GetPropType; + static constexpr type value = 1.0; +}; //! The basis value for the weight of the mole fraction primary variables -SET_SCALAR_PROP(PvsModel, PvsMoleFractionsBaseWeight, 1.0); +template +struct PvsMoleFractionsBaseWeight +{ + using type = GetPropType; + static constexpr type value = 1.0; +}; } // namespace Opm::Properties diff --git a/opm/models/utils/basicproperties.hh b/opm/models/utils/basicproperties.hh index d37e9263b..a831d967c 100644 --- a/opm/models/utils/basicproperties.hh +++ b/opm/models/utils/basicproperties.hh @@ -244,13 +244,28 @@ template struct PrintParameters { static constexpr int value = 2; }; //! The default value for the simulation's end time -SET_SCALAR_PROP(NumericModel, EndTime, -1e35); +template +struct EndTime +{ + using type = GetPropType; + static constexpr type value = -1e35; +}; //! The default value for the simulation's initial time step size -SET_SCALAR_PROP(NumericModel, InitialTimeStepSize, -1e35); +template +struct InitialTimeStepSize +{ + using type = GetPropType; + static constexpr type value = -1e35; +}; //! The default value for the simulation's restart time -SET_SCALAR_PROP(NumericModel, RestartTime, -1e35); +template +struct RestartTime +{ + using type = GetPropType; + static constexpr type value = -1e35; +}; //! By default, do not force any time steps SET_STRING_PROP(NumericModel, PredeterminedTimeStepsFile, ""); diff --git a/opm/simulators/linalg/parallelamgbackend.hh b/opm/simulators/linalg/parallelamgbackend.hh index 49d8d65fd..e83fb407a 100644 --- a/opm/simulators/linalg/parallelamgbackend.hh +++ b/opm/simulators/linalg/parallelamgbackend.hh @@ -60,7 +60,12 @@ struct ParallelAmgLinearSolver { using InheritsFrom = std::tuple struct AmgCoarsenTarget { static constexpr int value = 5000; }; -SET_SCALAR_PROP(ParallelAmgLinearSolver, LinearSolverMaxError, 1e7); +template +struct LinearSolverMaxError +{ + using type = GetPropType; + static constexpr type value = 1e7; +}; SET_TYPE_PROP(ParallelAmgLinearSolver, LinearSolverBackend, Opm::Linear::ParallelAmgBackend); diff --git a/opm/simulators/linalg/parallelbasebackend.hh b/opm/simulators/linalg/parallelbasebackend.hh index 6b80e29d8..d72047862 100644 --- a/opm/simulators/linalg/parallelbasebackend.hh +++ b/opm/simulators/linalg/parallelbasebackend.hh @@ -392,7 +392,12 @@ template struct LinearSolverVerbosity { static constexpr int value = 0; }; //! set the preconditioner relaxation parameter to 1.0 by default -SET_SCALAR_PROP(ParallelBaseLinearSolver, PreconditionerRelaxation, 1.0); +template +struct PreconditionerRelaxation +{ + using type = GetPropType; + static constexpr type value = 1.0; +}; //! set the preconditioner order to 0 by default template diff --git a/opm/simulators/linalg/parallelbicgstabbackend.hh b/opm/simulators/linalg/parallelbicgstabbackend.hh index f486103cb..4802ec2df 100644 --- a/opm/simulators/linalg/parallelbicgstabbackend.hh +++ b/opm/simulators/linalg/parallelbicgstabbackend.hh @@ -52,7 +52,12 @@ SET_TYPE_PROP(ParallelBiCGStabLinearSolver, LinearSolverBackend, Opm::Linear::ParallelBiCGStabSolverBackend); -SET_SCALAR_PROP(ParallelBiCGStabLinearSolver, LinearSolverMaxError, 1e7); +template +struct LinearSolverMaxError +{ + using type = GetPropType; + static constexpr type value = 1e7; +}; } // namespace Opm::Properties