From 0e71c0e29b4b78988eeacdcce7f30f74ad53abac Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Thu, 27 Aug 2020 11:38:38 +0200 Subject: [PATCH] changed: remove SET_BOOL_PROP macro usage --- ebos/ebos.hh | 38 +++++-- ebos/ebos_brine.cc | 5 +- ebos/ebos_foam.cc | 5 +- ebos/ebos_oilwaterpolymer.cc | 5 +- ebos/ebos_polymer.cc | 5 +- ebos/ebos_solvent.cc | 5 +- ebos/ebos_thermal.cc | 5 +- ebos/eclbasevanguard.hh | 20 +++- ebos/ecloutputblackoilmodule.hh | 5 +- ebos/eclproblem.hh | 107 ++++++++++++++---- ebos/vtkecltracermodule.hh | 5 +- flow/flow_blackoil_dunecpr.cpp | 35 ++++-- flow/flow_ebos_brine.cpp | 5 +- flow/flow_ebos_energy.cpp | 5 +- flow/flow_ebos_foam.cpp | 5 +- flow/flow_ebos_oilwater_brine.cpp | 5 +- flow/flow_ebos_oilwater_polymer.cpp | 5 +- ...flow_ebos_oilwater_polymer_injectivity.cpp | 10 +- flow/flow_ebos_polymer.cpp | 5 +- flow/flow_ebos_solvent.cpp | 5 +- flow/flow_onephase_energy.cpp | 5 +- opm/simulators/flow/BlackoilModelEbos.hpp | 45 ++++++-- .../flow/BlackoilModelParametersEbos.hpp | 40 +++++-- opm/simulators/flow/FlowMainEbos.hpp | 5 +- .../SimulatorFullyImplicitBlackoilEbos.hpp | 15 ++- .../linalg/FlowLinearSolverParameters.hpp | 50 ++++++-- .../timestepping/AdaptiveTimeSteppingEbos.hpp | 5 +- tests/test_ecl_output.cc | 10 +- 28 files changed, 367 insertions(+), 93 deletions(-) diff --git a/ebos/ebos.hh b/ebos/ebos.hh index 9102ad464..61e8a8e55 100644 --- a/ebos/ebos.hh +++ b/ebos/ebos.hh @@ -55,7 +55,10 @@ SET_TYPE_PROP(EbosTypeTag, Problem, Opm::EbosProblem); // Enable experimental features for ebos: ebos is the research simulator of the OPM // project. If you're looking for a more stable "production quality" simulator, consider // using `flow` -SET_BOOL_PROP(EbosTypeTag, EnableExperiments, true); +template +struct EnableExperiments { + static constexpr bool value = true; +}; // use flow's well model for now SET_TYPE_PROP(EbosTypeTag, EclWellModel, Opm::BlackoilWellModel); @@ -63,15 +66,33 @@ SET_TYPE_PROP(EbosTypeTag, EclWellModel, Opm::BlackoilWellModel); // currently, ebos uses the non-multisegment well model by default to avoid // regressions. the --use-multisegment-well=true|false command line parameter is still // available in ebos, but hidden from view. -SET_BOOL_PROP(EbosTypeTag, UseMultisegmentWell, false); +template +struct UseMultisegmentWell { + static constexpr bool value = false; +}; // set some properties that are only required by the well model -SET_BOOL_PROP(EbosTypeTag, MatrixAddWellContributions, true); -SET_BOOL_PROP(EbosTypeTag, EnableTerminalOutput, false); +template +struct MatrixAddWellContributions { + static constexpr bool value = true; +}; + +template +struct EnableTerminalOutput { + static constexpr bool value = false; +}; + // flow's well model only works with surface volumes -SET_BOOL_PROP(EbosTypeTag, BlackoilConserveSurfaceVolume, true); +template +struct BlackoilConserveSurfaceVolume { + static constexpr bool value = true; +}; + // the values for the residual are for the whole cell instead of for a cubic meter of the cell -SET_BOOL_PROP(EbosTypeTag, UseVolumetricResidual, false); +template +struct UseVolumetricResidual { + static constexpr bool value = false; +}; // by default use flow's aquifer model for now SET_TYPE_PROP(EbosTypeTag, EclAquiferModel, Opm::BlackoilAquiferModel); @@ -111,7 +132,10 @@ SET_INT_PROP(EbosTypeTag, ThreadsPerProcess, 2); // By default, ebos accepts the result of the time integration unconditionally if the // smallest time step size is reached. -SET_BOOL_PROP(EbosTypeTag, ContinueOnConvergenceError, true); +template +struct ContinueOnConvergenceError { + static constexpr bool value = true; +}; } // namespace Opm::Properties diff --git a/ebos/ebos_brine.cc b/ebos/ebos_brine.cc index fbce8d330..dee1a1672 100644 --- a/ebos/ebos_brine.cc +++ b/ebos/ebos_brine.cc @@ -39,7 +39,10 @@ struct EbosBrineTypeTag { } // enable the brine extension of the black oil model -SET_BOOL_PROP(EbosBrineTypeTag, EnableBrine, true); +template +struct EnableBrine { + static constexpr bool value = true; +}; } // namespace Opm::Properties diff --git a/ebos/ebos_foam.cc b/ebos/ebos_foam.cc index 17274799e..c6af9da0b 100644 --- a/ebos/ebos_foam.cc +++ b/ebos/ebos_foam.cc @@ -39,7 +39,10 @@ struct EbosFoamTypeTag { } // enable the foam extension of the black oil model -SET_BOOL_PROP(EbosFoamTypeTag, EnableFoam, true); +template +struct EnableFoam { + static constexpr bool value = true; +}; } // namespace Opm::Properties diff --git a/ebos/ebos_oilwaterpolymer.cc b/ebos/ebos_oilwaterpolymer.cc index 4991fb2c3..03ca84304 100644 --- a/ebos/ebos_oilwaterpolymer.cc +++ b/ebos/ebos_oilwaterpolymer.cc @@ -38,7 +38,10 @@ struct EbosOilWaterPolymerTypeTag { } // enable the polymer extension of the black oil model -SET_BOOL_PROP(EbosOilWaterPolymerTypeTag, EnablePolymer, true); +template +struct EnablePolymer { + static constexpr bool value = true; +}; //! The indices indices which only enable oil and water SET_PROP(EbosOilWaterPolymerTypeTag, Indices) diff --git a/ebos/ebos_polymer.cc b/ebos/ebos_polymer.cc index 5ac936c80..11d02f23a 100644 --- a/ebos/ebos_polymer.cc +++ b/ebos/ebos_polymer.cc @@ -39,7 +39,10 @@ struct EbosPolymerTypeTag { } // enable the polymer extension of the black oil model -SET_BOOL_PROP(EbosPolymerTypeTag, EnablePolymer, true); +template +struct EnablePolymer { + static constexpr bool value = true; +}; } // namespace Opm::Properties diff --git a/ebos/ebos_solvent.cc b/ebos/ebos_solvent.cc index ccf28a368..55c5bd45d 100644 --- a/ebos/ebos_solvent.cc +++ b/ebos/ebos_solvent.cc @@ -39,7 +39,10 @@ struct EbosSolventTypeTag { } // enable the solvent extension of the black oil model -SET_BOOL_PROP(EbosSolventTypeTag, EnableSolvent, true); +template +struct EnableSolvent { + static constexpr bool value = true; +}; } // namespace Opm::Properties diff --git a/ebos/ebos_thermal.cc b/ebos/ebos_thermal.cc index 1ba1862fc..cca80dc0f 100644 --- a/ebos/ebos_thermal.cc +++ b/ebos/ebos_thermal.cc @@ -39,7 +39,10 @@ struct EbosThermalTypeTag { } // enable the energy extension of the black oil model -SET_BOOL_PROP(EbosThermalTypeTag, EnableEnergy, true); +template +struct EnableEnergy { + static constexpr bool value = true; +}; } // namespace Opm::Properties diff --git a/ebos/eclbasevanguard.hh b/ebos/eclbasevanguard.hh index 2b6e3918b..8b99991d9 100644 --- a/ebos/eclbasevanguard.hh +++ b/ebos/eclbasevanguard.hh @@ -85,11 +85,23 @@ NEW_PROP_TAG(OwnerCellsFirst); SET_STRING_PROP(EclBaseVanguard, IgnoreKeywords, ""); SET_STRING_PROP(EclBaseVanguard, EclDeckFileName, ""); SET_INT_PROP(EclBaseVanguard, EclOutputInterval, -1); // use the deck-provided value -SET_BOOL_PROP(EclBaseVanguard, EnableOpmRstFile, false); -SET_BOOL_PROP(EclBaseVanguard, EclStrictParsing, false); -SET_BOOL_PROP(EclBaseVanguard, SchedRestart, false); +template +struct EnableOpmRstFile { + static constexpr bool value = false; +}; +template +struct EclStrictParsing { + static constexpr bool value = false; +}; +template +struct SchedRestart { + static constexpr bool value = false; +}; SET_INT_PROP(EclBaseVanguard, EdgeWeightsMethod, 1); -SET_BOOL_PROP(EclBaseVanguard, OwnerCellsFirst, true); +template +struct OwnerCellsFirst { + static constexpr bool value = true; +}; } // namespace Opm::Properties diff --git a/ebos/ecloutputblackoilmodule.hh b/ebos/ecloutputblackoilmodule.hh index 751941efc..5b4dcd3dc 100644 --- a/ebos/ecloutputblackoilmodule.hh +++ b/ebos/ecloutputblackoilmodule.hh @@ -53,7 +53,10 @@ struct EclOutputBlackOil {}; NEW_PROP_TAG(ForceDisableFluidInPlaceOutput); -SET_BOOL_PROP(EclOutputBlackOil, ForceDisableFluidInPlaceOutput, false); +template +struct ForceDisableFluidInPlaceOutput { + static constexpr bool value = false; +}; } // namespace Opm::Properties diff --git a/ebos/eclproblem.hh b/ebos/eclproblem.hh index 88937b1a6..e00786f97 100644 --- a/ebos/eclproblem.hh +++ b/ebos/eclproblem.hh @@ -248,16 +248,28 @@ SET_TYPE_PROP(EclBaseProblem, EclAquiferModel, Opm::EclBaseAquiferModel SET_TYPE_PROP(EclBaseProblem, EclWellModel, EclWellManager); // Enable aquifers by default in experimental mode -SET_BOOL_PROP(EclBaseProblem, EclEnableAquifers, true); +template +struct EclEnableAquifers { + static constexpr bool value = true; +}; // Enable gravity -SET_BOOL_PROP(EclBaseProblem, EnableGravity, true); +template +struct EnableGravity { + static constexpr bool value = true; +}; // only write the solutions for the report steps to disk -SET_BOOL_PROP(EclBaseProblem, EnableWriteAllSolutions, false); +template +struct EnableWriteAllSolutions { + static constexpr bool value = false; +}; // disable API tracking -SET_BOOL_PROP(EclBaseProblem, EnableApiTracking, false); +template +struct EnableApiTracking { + static constexpr bool value = false; +}; // The default for the end time of the simulation [s] // @@ -313,26 +325,44 @@ SET_INT_PROP(EclBaseProblem, NewtonMaxIterations, 14); SET_INT_PROP(EclBaseProblem, NewtonTargetIterations, 6); // Disable the VTK output by default for this problem ... -SET_BOOL_PROP(EclBaseProblem, EnableVtkOutput, false); +template +struct EnableVtkOutput { + static constexpr bool value = false; +}; // ... but enable the ECL output by default -SET_BOOL_PROP(EclBaseProblem, EnableEclOutput, true); +template +struct EnableEclOutput { + static constexpr bool value = true; +}; // If available, write the ECL output in a non-blocking manner -SET_BOOL_PROP(EclBaseProblem, EnableAsyncEclOutput, true); +template +struct EnableAsyncEclOutput { + static constexpr bool value = true; +}; // By default, use single precision for the ECL formated results -SET_BOOL_PROP(EclBaseProblem, EclOutputDoublePrecision, false); +template +struct EclOutputDoublePrecision { + static constexpr bool value = false; +}; // The default location for the ECL output files SET_STRING_PROP(EclBaseProblem, OutputDir, "."); // the cache for intensive quantities can be used for ECL problems and also yields a // decent speedup... -SET_BOOL_PROP(EclBaseProblem, EnableIntensiveQuantityCache, true); +template +struct EnableIntensiveQuantityCache { + static constexpr bool value = true; +}; // the cache for the storage term can also be used and also yields a decent speedup -SET_BOOL_PROP(EclBaseProblem, EnableStorageCache, true); +template +struct EnableStorageCache { + static constexpr bool value = true; +}; // Use the "velocity module" which uses the Eclipse "NEWTRAN" transmissibilities SET_TYPE_PROP(EclBaseProblem, FluxModule, Opm::EclTransFluxModule); @@ -351,36 +381,67 @@ SET_INT_PROP(EclBaseProblem, RestartWritingInterval, 0xffffff); // disable // Drift compensation is an experimental feature, i.e., systematic errors in the // conservation quantities are only compensated for // as default if experimental mode is enabled. -SET_BOOL_PROP(EclBaseProblem, - EclEnableDriftCompensation, - getPropValue()); +template +struct EclEnableDriftCompensation { + static constexpr bool value = getPropValue(); +}; // By default, we enable the debugging checks if we're compiled in debug mode -SET_BOOL_PROP(EclBaseProblem, EnableDebuggingChecks, true); +template +struct EnableDebuggingChecks { + static constexpr bool value = true; +}; // store temperature (but do not conserve energy, as long as EnableEnergy is false) -SET_BOOL_PROP(EclBaseProblem, EnableTemperature, true); +template +struct EnableTemperature { + static constexpr bool value = true; +}; // disable all extensions supported by black oil model. this should not really be // necessary but it makes things a bit more explicit -SET_BOOL_PROP(EclBaseProblem, EnablePolymer, false); -SET_BOOL_PROP(EclBaseProblem, EnableSolvent, false); -SET_BOOL_PROP(EclBaseProblem, EnableEnergy, false); -SET_BOOL_PROP(EclBaseProblem, EnableFoam, false); +template +struct EnablePolymer { + static constexpr bool value = false; +}; +template +struct EnableSolvent { + static constexpr bool value = false; +}; +template +struct EnableEnergy { + static constexpr bool value = false; +}; +template +struct EnableFoam { + static constexpr bool value = false; +}; // disable thermal flux boundaries by default -SET_BOOL_PROP(EclBaseProblem, EnableThermalFluxBoundaries, false); +template +struct EnableThermalFluxBoundaries { + static constexpr bool value = false; +}; -SET_BOOL_PROP(EclBaseProblem, EnableTracerModel, false); +template +struct EnableTracerModel { + static constexpr bool value = false; +}; // By default, simulators derived from the EclBaseProblem are production simulators, // i.e., experimental features must be explicitly enabled at compile time -SET_BOOL_PROP(EclBaseProblem, EnableExperiments, false); +template +struct EnableExperiments { + static constexpr bool value = false; +}; // set defaults for the time stepping parameters SET_SCALAR_PROP(EclBaseProblem, EclMaxTimeStepSizeAfterWellEvent, 3600*24*365.25); SET_SCALAR_PROP(EclBaseProblem, EclRestartShrinkFactor, 3); -SET_BOOL_PROP(EclBaseProblem, EclEnableTuning, false); +template +struct EclEnableTuning { + static constexpr bool value = false; +}; SET_STRING_PROP(EclBaseProblem, OutputMode, "all"); diff --git a/ebos/vtkecltracermodule.hh b/ebos/vtkecltracermodule.hh index b6d26dace..3143ef923 100644 --- a/ebos/vtkecltracermodule.hh +++ b/ebos/vtkecltracermodule.hh @@ -51,7 +51,10 @@ struct VtkEclTracer {}; NEW_PROP_TAG(VtkWriteEclTracerConcentration); // set default values for what quantities to output -SET_BOOL_PROP(VtkEclTracer, VtkWriteEclTracerConcentration, false); +template +struct VtkWriteEclTracerConcentration { + static constexpr bool value = false; +}; } // namespace Opm::Properties diff --git a/flow/flow_blackoil_dunecpr.cpp b/flow/flow_blackoil_dunecpr.cpp index d0b4cc10e..bddbc70c0 100644 --- a/flow/flow_blackoil_dunecpr.cpp +++ b/flow/flow_blackoil_dunecpr.cpp @@ -32,12 +32,21 @@ namespace Opm { }; } - SET_BOOL_PROP(EclFlowProblemSimple, MatrixAddWellContributions, true); + template + struct MatrixAddWellContributions { + static constexpr bool value = true; + }; SET_INT_PROP(EclFlowProblemSimple, LinearSolverVerbosity,0); SET_SCALAR_PROP(EclFlowProblemSimple, LinearSolverReduction, 1e-2); SET_INT_PROP(EclFlowProblemSimple, LinearSolverMaxIter, 100); - SET_BOOL_PROP(EclFlowProblemSimple, UseAmg, true);//probably not used - SET_BOOL_PROP(EclFlowProblemSimple, UseCpr, true); + template + struct UseAmg { // probably not used + static constexpr bool value = true; + }; + template + struct UseCpr { + static constexpr bool value = true; + }; SET_INT_PROP(EclFlowProblemSimple, CprMaxEllIter, 1); SET_INT_PROP(EclFlowProblemSimple, CprEllSolvetype, 3); SET_INT_PROP(EclFlowProblemSimple, CprReuseSetup, 3); @@ -66,12 +75,24 @@ namespace Opm { //SET_TYPE_PROP(EclFlowProblemSimple, LinearSolverBackend, Opm::Linear::SuperLUBackend)//not work //SET_TAG_PROP(EclFlowProblem, FluidState, Opm::BlackOilFluidState); SET_TYPE_PROP(EclFlowProblemSimple, LinearSolverBackend, Opm::ISTLSolverEbosFlexible); - SET_BOOL_PROP(EclFlowProblemSimple, EnableStorageCache, true); - SET_BOOL_PROP(EclFlowProblemSimple, EnableIntensiveQuantityCache, true); + template + struct EnableStorageCache { + static constexpr bool value = true; + }; + template + struct EnableIntensiveQuantityCache { + static constexpr bool value = true; + }; //SET_INT_PROP(EclFlowProblemSimple, NumWellAdjoint, 1); - //SET_BOOL_PROP(EclFlowProblem, EnableStorageCache, true); - //SET_BOOL_PROP(EclFlowProblem, EnableIntensiveQuantityCache, true); +// template +// struct EnableStorageCache { +// static constexpr bool value = true; +// }; +// template +// struct EnableIntensiveQuantityCache { +// static constexpr bool value = true; +// }; } } diff --git a/flow/flow_ebos_brine.cpp b/flow/flow_ebos_brine.cpp index cdc105e1e..6ba2b673b 100644 --- a/flow/flow_ebos_brine.cpp +++ b/flow/flow_ebos_brine.cpp @@ -36,7 +36,10 @@ struct EclFlowBrineProblem { using InheritsFrom = std::tuple; }; } -SET_BOOL_PROP(EclFlowBrineProblem, EnableBrine, true); +template +struct EnableBrine { + static constexpr bool value = true; +}; }} namespace Opm { diff --git a/flow/flow_ebos_energy.cpp b/flow/flow_ebos_energy.cpp index 117023b06..5f45c0708 100644 --- a/flow/flow_ebos_energy.cpp +++ b/flow/flow_ebos_energy.cpp @@ -36,7 +36,10 @@ struct EclFlowEnergyProblem { using InheritsFrom = std::tuple; }; } -SET_BOOL_PROP(EclFlowEnergyProblem, EnableEnergy, true); +template +struct EnableEnergy { + static constexpr bool value = true; +}; }} namespace Opm { diff --git a/flow/flow_ebos_foam.cpp b/flow/flow_ebos_foam.cpp index b0c806bf3..afee1ac43 100644 --- a/flow/flow_ebos_foam.cpp +++ b/flow/flow_ebos_foam.cpp @@ -36,7 +36,10 @@ struct EclFlowFoamProblem { using InheritsFrom = std::tuple; }; } -SET_BOOL_PROP(EclFlowFoamProblem, EnableFoam, true); +template +struct EnableFoam { + static constexpr bool value = true; +}; }} namespace Opm { diff --git a/flow/flow_ebos_oilwater_brine.cpp b/flow/flow_ebos_oilwater_brine.cpp index 157418cbf..d899e4aa9 100644 --- a/flow/flow_ebos_oilwater_brine.cpp +++ b/flow/flow_ebos_oilwater_brine.cpp @@ -41,7 +41,10 @@ struct EclFlowOilWaterBrineProblem { using InheritsFrom = std::tuple; }; } -SET_BOOL_PROP(EclFlowOilWaterBrineProblem, EnableBrine, true); +template +struct EnableBrine { + static constexpr bool value = true; +}; //! The indices required by the model SET_PROP(EclFlowOilWaterBrineProblem, Indices) { diff --git a/flow/flow_ebos_oilwater_polymer.cpp b/flow/flow_ebos_oilwater_polymer.cpp index 94e9311af..c7e81871e 100644 --- a/flow/flow_ebos_oilwater_polymer.cpp +++ b/flow/flow_ebos_oilwater_polymer.cpp @@ -41,7 +41,10 @@ struct EclFlowOilWaterPolymerProblem { using InheritsFrom = std::tuple; }; } -SET_BOOL_PROP(EclFlowOilWaterPolymerProblem, EnablePolymer, true); +template +struct EnablePolymer { + static constexpr bool value = true; +}; //! The indices required by the model //! The indices required by the model SET_PROP(EclFlowOilWaterPolymerProblem, Indices) diff --git a/flow/flow_ebos_oilwater_polymer_injectivity.cpp b/flow/flow_ebos_oilwater_polymer_injectivity.cpp index 31efd5efa..e4f61eded 100644 --- a/flow/flow_ebos_oilwater_polymer_injectivity.cpp +++ b/flow/flow_ebos_oilwater_polymer_injectivity.cpp @@ -41,8 +41,14 @@ struct EclFlowOilWaterPolymerInjectivityProblem { using InheritsFrom = std::tuple; }; } -SET_BOOL_PROP(EclFlowOilWaterPolymerInjectivityProblem, EnablePolymer, true); -SET_BOOL_PROP(EclFlowOilWaterPolymerInjectivityProblem, EnablePolymerMW, true); +template +struct EnablePolymer { + static constexpr bool value = true; +}; +template +struct EnablePolymerMW { + static constexpr bool value = true; +}; //! The indices required by the model // For this case, there will be two primary variables introduced for the polymer // polymer concentration and polymer molecular weight diff --git a/flow/flow_ebos_polymer.cpp b/flow/flow_ebos_polymer.cpp index a50fb1cbc..8d87d1803 100644 --- a/flow/flow_ebos_polymer.cpp +++ b/flow/flow_ebos_polymer.cpp @@ -36,7 +36,10 @@ struct EclFlowPolymerProblem { using InheritsFrom = std::tuple; }; } -SET_BOOL_PROP(EclFlowPolymerProblem, EnablePolymer, true); +template +struct EnablePolymer { + static constexpr bool value = true; +}; }} namespace Opm { diff --git a/flow/flow_ebos_solvent.cpp b/flow/flow_ebos_solvent.cpp index 655448296..96095eb03 100644 --- a/flow/flow_ebos_solvent.cpp +++ b/flow/flow_ebos_solvent.cpp @@ -36,7 +36,10 @@ struct EclFlowSolventProblem { using InheritsFrom = std::tuple; }; } -SET_BOOL_PROP(EclFlowSolventProblem, EnableSolvent, true); +template +struct EnableSolvent { + static constexpr bool value = true; +}; }} namespace Opm { diff --git a/flow/flow_onephase_energy.cpp b/flow/flow_onephase_energy.cpp index dc749763a..734f56c44 100644 --- a/flow/flow_onephase_energy.cpp +++ b/flow/flow_onephase_energy.cpp @@ -29,7 +29,10 @@ struct EclFlowProblemSimple { using InheritsFrom = std::tuple; }; } -SET_BOOL_PROP(EclFlowProblemSimple, EnableEnergy, true); +template +struct EnableEnergy { + static constexpr bool value = true; +}; //! The indices required by the model SET_PROP(EclFlowProblemSimple, Indices) { diff --git a/opm/simulators/flow/BlackoilModelEbos.hpp b/opm/simulators/flow/BlackoilModelEbos.hpp index a01bbfe12..83e20beba 100644 --- a/opm/simulators/flow/BlackoilModelEbos.hpp +++ b/opm/simulators/flow/BlackoilModelEbos.hpp @@ -78,21 +78,48 @@ struct EclFlowProblem { }; } SET_STRING_PROP(EclFlowProblem, OutputDir, ""); -SET_BOOL_PROP(EclFlowProblem, EnableDebuggingChecks, false); +template +struct EnableDebuggingChecks { + static constexpr bool value = false; +}; // default in flow is to formulate the equations in surface volumes -SET_BOOL_PROP(EclFlowProblem, BlackoilConserveSurfaceVolume, true); -SET_BOOL_PROP(EclFlowProblem, UseVolumetricResidual, false); +template +struct BlackoilConserveSurfaceVolume { + static constexpr bool value = true; +}; +template +struct UseVolumetricResidual { + static constexpr bool value = false; +}; SET_TYPE_PROP(EclFlowProblem, EclAquiferModel, Opm::BlackoilAquiferModel); // disable all extensions supported by black oil model. this should not really be // necessary but it makes things a bit more explicit -SET_BOOL_PROP(EclFlowProblem, EnablePolymer, false); -SET_BOOL_PROP(EclFlowProblem, EnableSolvent, false); -SET_BOOL_PROP(EclFlowProblem, EnableTemperature, true); -SET_BOOL_PROP(EclFlowProblem, EnableEnergy, false); -SET_BOOL_PROP(EclFlowProblem, EnableFoam, false); -SET_BOOL_PROP(EclFlowProblem, EnableBrine, false); +template +struct EnablePolymer { + static constexpr bool value = false; +}; +template +struct EnableSolvent { + static constexpr bool value = false; +}; +template +struct EnableTemperature { + static constexpr bool value = true; +}; +template +struct EnableEnergy { + static constexpr bool value = false; +}; +template +struct EnableFoam { + static constexpr bool value = false; +}; +template +struct EnableBrine { + static constexpr bool value = false; +}; SET_TYPE_PROP(EclFlowProblem, EclWellModel, Opm::BlackoilWellModel); SET_TAG_PROP(EclFlowProblem, LinearSolverSplice, FlowIstlSolver); diff --git a/opm/simulators/flow/BlackoilModelParametersEbos.hpp b/opm/simulators/flow/BlackoilModelParametersEbos.hpp index 8a18ba09f..9d9334f73 100644 --- a/opm/simulators/flow/BlackoilModelParametersEbos.hpp +++ b/opm/simulators/flow/BlackoilModelParametersEbos.hpp @@ -72,22 +72,46 @@ SET_SCALAR_PROP(FlowModelParameters, ToleranceCnvRelaxed, 1e9); SET_SCALAR_PROP(FlowModelParameters, ToleranceWells, 1e-4); SET_SCALAR_PROP(FlowModelParameters, ToleranceWellControl, 1e-7); SET_INT_PROP(FlowModelParameters, MaxWelleqIter, 30); -SET_BOOL_PROP(FlowModelParameters, UseMultisegmentWell, true); +template +struct UseMultisegmentWell { + static constexpr bool value = true; +}; SET_SCALAR_PROP(FlowModelParameters, MaxSinglePrecisionDays, 20.0); SET_INT_PROP(FlowModelParameters, MaxStrictIter, 8); -SET_BOOL_PROP(FlowModelParameters, SolveWelleqInitially, true); -SET_BOOL_PROP(FlowModelParameters, UpdateEquationsScaling, false); -SET_BOOL_PROP(FlowModelParameters, UseUpdateStabilization, true); -SET_BOOL_PROP(FlowModelParameters, MatrixAddWellContributions, false); +template +struct SolveWelleqInitially { + static constexpr bool value = true; +}; +template +struct UpdateEquationsScaling { + static constexpr bool value = false; +}; +template +struct UseUpdateStabilization { + static constexpr bool value = true; +}; +template +struct MatrixAddWellContributions { + static constexpr bool value = false; +}; SET_SCALAR_PROP(FlowModelParameters, TolerancePressureMsWells, 0.01*1e5); SET_SCALAR_PROP(FlowModelParameters, MaxPressureChangeMsWells, 10*1e5); -SET_BOOL_PROP(FlowModelParameters, UseInnerIterationsMsWells, true); +template +struct UseInnerIterationsMsWells { + static constexpr bool value = true; +}; SET_INT_PROP(FlowModelParameters, MaxInnerIterMsWells, 100); -SET_BOOL_PROP(FlowModelParameters, UseInnerIterationsWells, false); +template +struct UseInnerIterationsWells { + static constexpr bool value = false; +}; SET_INT_PROP(FlowModelParameters, MaxInnerIterWells, 50); SET_INT_PROP(FlowModelParameters, StrictInnerIterMsWells, 40); SET_SCALAR_PROP(FlowModelParameters, RegularizationFactorMsw, 1); -SET_BOOL_PROP(FlowModelParameters, EnableWellOperabilityCheck, true); +template +struct EnableWellOperabilityCheck { + static constexpr bool value = true; +}; SET_SCALAR_PROP(FlowModelParameters, RelaxedFlowTolInnerIterMsw, 1); SET_SCALAR_PROP(FlowModelParameters, RelaxedPressureTolInnerIterMsw, 0.5e5); diff --git a/opm/simulators/flow/FlowMainEbos.hpp b/opm/simulators/flow/FlowMainEbos.hpp index dd63db85b..d8d28994d 100644 --- a/opm/simulators/flow/FlowMainEbos.hpp +++ b/opm/simulators/flow/FlowMainEbos.hpp @@ -57,7 +57,10 @@ NEW_PROP_TAG(EnableLoggingFalloutWarning); // TODO: enumeration parameters. we use strings for now. SET_STRING_PROP(EclFlowProblem, EnableDryRun, "auto"); // Do not merge parallel output files or warn about them -SET_BOOL_PROP(EclFlowProblem, EnableLoggingFalloutWarning, false); +template +struct EnableLoggingFalloutWarning { + static constexpr bool value = false; +}; SET_INT_PROP(EclFlowProblem, OutputInterval, 1); } // namespace Opm::Properties diff --git a/opm/simulators/flow/SimulatorFullyImplicitBlackoilEbos.hpp b/opm/simulators/flow/SimulatorFullyImplicitBlackoilEbos.hpp index bcdddd021..49e997c12 100644 --- a/opm/simulators/flow/SimulatorFullyImplicitBlackoilEbos.hpp +++ b/opm/simulators/flow/SimulatorFullyImplicitBlackoilEbos.hpp @@ -39,9 +39,18 @@ namespace Opm::Properties { NEW_PROP_TAG(EnableAdaptiveTimeStepping); NEW_PROP_TAG(EnableTuning); -SET_BOOL_PROP(EclFlowProblem, EnableTerminalOutput, true); -SET_BOOL_PROP(EclFlowProblem, EnableAdaptiveTimeStepping, true); -SET_BOOL_PROP(EclFlowProblem, EnableTuning, false); +template +struct EnableTerminalOutput { + static constexpr bool value = true; +}; +template +struct EnableAdaptiveTimeStepping { + static constexpr bool value = true; +}; +template +struct EnableTuning { + static constexpr bool value = false; +}; } // namespace Opm::Properties diff --git a/opm/simulators/linalg/FlowLinearSolverParameters.hpp b/opm/simulators/linalg/FlowLinearSolverParameters.hpp index 3f3057464..46e278ede 100644 --- a/opm/simulators/linalg/FlowLinearSolverParameters.hpp +++ b/opm/simulators/linalg/FlowLinearSolverParameters.hpp @@ -80,19 +80,49 @@ SET_INT_PROP(FlowIstlSolverParams, LinearSolverRestart, 40); SET_INT_PROP(FlowIstlSolverParams, FlowLinearSolverVerbosity, 0); SET_INT_PROP(FlowIstlSolverParams, IluFillinLevel, 0); SET_STRING_PROP(FlowIstlSolverParams, MiluVariant, "ILU"); -SET_BOOL_PROP(FlowIstlSolverParams, IluRedblack, false); -SET_BOOL_PROP(FlowIstlSolverParams, IluReorderSpheres, false); -SET_BOOL_PROP(FlowIstlSolverParams, UseGmres, false); -SET_BOOL_PROP(FlowIstlSolverParams, LinearSolverRequireFullSparsityPattern, false); -SET_BOOL_PROP(FlowIstlSolverParams, LinearSolverIgnoreConvergenceFailure, false); -SET_BOOL_PROP(FlowIstlSolverParams, UseAmg, false); -SET_BOOL_PROP(FlowIstlSolverParams, UseCpr, false); +template +struct IluRedblack { + static constexpr bool value = false; +}; +template +struct IluReorderSpheres { + static constexpr bool value = false; +}; +template +struct UseGmres { + static constexpr bool value = false; +}; +template +struct LinearSolverRequireFullSparsityPattern { + static constexpr bool value = false; +}; +template +struct LinearSolverIgnoreConvergenceFailure { + static constexpr bool value = false; +}; +template +struct UseAmg { + static constexpr bool value = false; +}; +template +struct UseCpr { + static constexpr bool value = false; +}; SET_TYPE_PROP(FlowIstlSolverParams, LinearSolverBackend, Opm::ISTLSolverEbos); -SET_BOOL_PROP(FlowIstlSolverParams, PreconditionerAddWellContributions, false); +template +struct PreconditionerAddWellContributions { + static constexpr bool value = false; +}; SET_STRING_PROP(FlowIstlSolverParams, SystemStrategy, "none"); -SET_BOOL_PROP(FlowIstlSolverParams, ScaleLinearSystem, false); +template +struct ScaleLinearSystem { + static constexpr bool value = false; +}; SET_INT_PROP(FlowIstlSolverParams, CprSolverVerbose, 0); -SET_BOOL_PROP(FlowIstlSolverParams, CprUseDrs, false); +template +struct CprUseDrs { + static constexpr bool value = false; +}; SET_INT_PROP(FlowIstlSolverParams, CprMaxEllIter, 20); SET_INT_PROP(FlowIstlSolverParams, CprEllSolvetype, 0); SET_INT_PROP(FlowIstlSolverParams, CprReuseSetup, 3); diff --git a/opm/simulators/timestepping/AdaptiveTimeSteppingEbos.hpp b/opm/simulators/timestepping/AdaptiveTimeSteppingEbos.hpp index 563a29152..1e2255410 100644 --- a/opm/simulators/timestepping/AdaptiveTimeSteppingEbos.hpp +++ b/opm/simulators/timestepping/AdaptiveTimeSteppingEbos.hpp @@ -52,7 +52,10 @@ SET_INT_PROP(FlowTimeSteppingParameters, SolverMaxRestarts, 10); SET_INT_PROP(FlowTimeSteppingParameters, SolverVerbosity, 1); SET_INT_PROP(FlowTimeSteppingParameters, TimeStepVerbosity, 1); SET_SCALAR_PROP(FlowTimeSteppingParameters, InitialTimeStepInDays, 1.0); -SET_BOOL_PROP(FlowTimeSteppingParameters, FullTimeStepInitially, false); +template +struct FullTimeStepInitially { + static constexpr bool value = false; +}; SET_SCALAR_PROP(FlowTimeSteppingParameters, TimeStepAfterEventInDays, -1.0); SET_STRING_PROP(FlowTimeSteppingParameters, TimeStepControl, "pid"); SET_SCALAR_PROP(FlowTimeSteppingParameters, TimeStepControlTolerance, 1e-1); diff --git a/tests/test_ecl_output.cc b/tests/test_ecl_output.cc index 9c209e790..c1363c2ba 100644 --- a/tests/test_ecl_output.cc +++ b/tests/test_ecl_output.cc @@ -82,8 +82,14 @@ struct TestEclOutputTypeTag { using InheritsFrom = std::tuple; }; } -SET_BOOL_PROP(TestEclOutputTypeTag, EnableGravity, false); -SET_BOOL_PROP(TestEclOutputTypeTag, EnableAsyncEclOutput, false); +template +struct EnableGravity { + static constexpr bool value = false; +}; +template +struct EnableAsyncEclOutput { + static constexpr bool value = false; +}; } // namespace Opm::Properties