diff --git a/opm/models/discretization/common/fvbasediscretization.hh b/opm/models/discretization/common/fvbasediscretization.hh index a52c02e79..135ef828b 100644 --- a/opm/models/discretization/common/fvbasediscretization.hh +++ b/opm/models/discretization/common/fvbasediscretization.hh @@ -284,12 +284,6 @@ struct DiscreteFunction namespace Opm::Parameters { -// do not use thermodynamic hints by default. If you enable this, make sure to also -// enable the intensive quantity cache above to avoid getting an exception... -template -struct EnableThermodynamicHints -{ static constexpr bool value = false; }; - // use default initialization based on rule-of-thumb of Newton tolerance template struct LinearSolverAbsTolerance @@ -430,7 +424,7 @@ public: , enableGridAdaptation_(Parameters::Get() ) , enableIntensiveQuantityCache_(Parameters::Get()) , enableStorageCache_(Parameters::Get()) - , enableThermodynamicHints_(Parameters::get()) + , enableThermodynamicHints_(Parameters::Get()) { bool isEcfv = std::is_same >::value; if (enableGridAdaptation_ && !isEcfv) @@ -486,7 +480,7 @@ public: ("Enable adaptive grid refinement/coarsening"); Parameters::Register ("Global switch for turning on writing VTK files"); - Parameters::registerParam + Parameters::Register ("Enable thermodynamic hints"); Parameters::Register ("Turn on caching of intensive quantities"); diff --git a/opm/models/discretization/common/fvbaseparameters.hh b/opm/models/discretization/common/fvbaseparameters.hh index eec31d8b9..ee6e37681 100644 --- a/opm/models/discretization/common/fvbaseparameters.hh +++ b/opm/models/discretization/common/fvbaseparameters.hh @@ -30,8 +30,6 @@ #ifndef EWOMS_FV_BASE_PARAMETERS_HH #define EWOMS_FV_BASE_PARAMETERS_HH -#include - #include namespace Opm::Parameters { @@ -81,6 +79,16 @@ struct EnableIntensiveQuantityCache { static constexpr bool value = false; }; */ struct EnableStorageCache { static constexpr bool value = false; }; +/*! + * \brief Specify whether to use the already calculated solutions as + * starting values of the intensive quantities. + * + * This only makes sense if the calculation of the intensive quantities is + * very expensive (e.g. for non-linear fugacity functions where the + * solver converges faster). + */ +struct EnableThermodynamicHints { static constexpr bool value = false; }; + /*! * \brief Global switch to enable or disable the writing of VTK output files * @@ -119,17 +127,6 @@ struct OutputDir { static constexpr auto value = ""; }; //! \brief Number of threads per process. struct ThreadsPerProcess { static constexpr int value = 1; }; -/*! - * \brief Specify whether to use the already calculated solutions as - * starting values of the intensive quantities. - * - * This only makes sense if the calculation of the intensive quantities is - * very expensive (e.g. for non-linear fugacity functions where the - * solver converges faster). - */ -template -struct EnableThermodynamicHints { using type = Properties::UndefinedProperty; }; - } // namespace Opm::Parameters #endif diff --git a/opm/models/flash/flashmodel.hh b/opm/models/flash/flashmodel.hh index 2a456f56e..b0d7db9fd 100644 --- a/opm/models/flash/flashmodel.hh +++ b/opm/models/flash/flashmodel.hh @@ -118,17 +118,6 @@ struct EnableEnergy { static constexpr bool value = f } // namespace Opm::Properties -namespace Opm::Parameters { - -// since thermodynamic hints are basically free if the cache for intensive quantities is -// enabled, and this model usually shows quite a performance improvment if they are -// enabled, let's enable them by default. -template -struct EnableThermodynamicHints -{ static constexpr bool value = true; }; - -} // namespace Opm::Parameters - namespace Opm { /*! @@ -237,6 +226,11 @@ public: // The updates of intensive quantities tend to be _very_ expensive for this // model, so let's try to minimize the number of required ones Parameters::SetDefault(true); + + // since thermodynamic hints are basically free if the cache for intensive quantities is + // enabled, and this model usually shows quite a performance improvment if they are + // enabled, let's enable them by default. + Parameters::SetDefault(true); } /*! diff --git a/opm/models/ptflash/flashmodel.hh b/opm/models/ptflash/flashmodel.hh index fcdb6a038..279be8d06 100644 --- a/opm/models/ptflash/flashmodel.hh +++ b/opm/models/ptflash/flashmodel.hh @@ -141,17 +141,6 @@ struct EnableEnergy } // namespace Opm::Properties -namespace Opm::Parameters { - -// since thermodynamic hints are basically free if the cache for intensive quantities is -// enabled, and this model usually shows quite a performance improvment if they are -// enabled, let's enable them by default. -template -struct EnableThermodynamicHints -{ static constexpr bool value = true; }; - -} // namespace Opm::Parameters - namespace Opm { /*! @@ -248,6 +237,11 @@ public: Parameters::SetDefault>(1e-12); Parameters::SetDefault(true); + + // since thermodynamic hints are basically free if the cache for intensive quantities is + // enabled, and this model usually shows quite a performance improvment if they are + // enabled, let's enable them by default. + Parameters::SetDefault(true); } /*!