From d275af15b5d405ebebca836f2bb54e969f3e3849 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Fri, 16 May 2025 09:17:23 +0200 Subject: [PATCH] richardsmodel: cosmetics --- opm/models/richards/richardsmodel.hh | 57 ++++++++++++++++++---------- 1 file changed, 36 insertions(+), 21 deletions(-) diff --git a/opm/models/richards/richardsmodel.hh b/opm/models/richards/richardsmodel.hh index 63fdb9164f..e944a68b40 100644 --- a/opm/models/richards/richardsmodel.hh +++ b/opm/models/richards/richardsmodel.hh @@ -51,25 +51,31 @@ #include namespace Opm { + template class RichardsModel; + } namespace Opm::Properties { // Create new type tags namespace TTag { + //! The type tag for problems discretized using the Richards model struct Richards { using InheritsFrom = std::tuple; }; + } // end namespace TTag //! By default, assume that the first phase is the liquid one template -struct LiquidPhaseIndex { static constexpr int value = 0; }; +struct LiquidPhaseIndex +{ static constexpr int value = 0; }; //! By default, assume that the non-liquid phase is gaseos template -struct GasPhaseIndex { static constexpr int value = 1 - getPropValue(); }; +struct GasPhaseIndex +{ static constexpr int value = 1 - getPropValue(); }; /*! * \brief By default, assume that component which the liquid is made of has @@ -81,47 +87,58 @@ struct GasPhaseIndex { static constexpr int value = 1 - * prefer Ethanol of H2O??) */ template -struct LiquidComponentIndex { static constexpr int value = getPropValue(); }; +struct LiquidComponentIndex +{ static constexpr int value = getPropValue(); }; //! By default, assume that the gas component is the other than the liquid one template -struct GasComponentIndex { static constexpr int value = 1 - getPropValue(); }; +struct GasComponentIndex +{ static constexpr int value = 1 - getPropValue(); }; //! The local residual operator template -struct LocalResidual { using type = Opm::RichardsLocalResidual; }; +struct LocalResidual +{ using type = RichardsLocalResidual; }; //! The global model used template -struct Model { using type = Opm::RichardsModel; }; +struct Model +{ using type = RichardsModel; }; //! the RateVector property template -struct RateVector { using type = Opm::RichardsRateVector; }; +struct RateVector +{ using type = RichardsRateVector; }; //! the BoundaryRateVector property template -struct BoundaryRateVector { using type = Opm::RichardsBoundaryRateVector; }; +struct BoundaryRateVector +{ using type = RichardsBoundaryRateVector; }; //! the PrimaryVariables property template -struct PrimaryVariables { using type = Opm::RichardsPrimaryVariables; }; +struct PrimaryVariables +{ using type = RichardsPrimaryVariables; }; //! The class for the intensive quantities template -struct IntensiveQuantities { using type = Opm::RichardsIntensiveQuantities; }; +struct IntensiveQuantities +{ using type = RichardsIntensiveQuantities; }; //! The class for the quantities required for the flux calculation template -struct ExtensiveQuantities { using type = Opm::RichardsExtensiveQuantities; }; +struct ExtensiveQuantities +{ using type = RichardsExtensiveQuantities; }; //! The class of the Newton method template -struct NewtonMethod { using type = Opm::RichardsNewtonMethod; }; +struct NewtonMethod +{ using type = RichardsNewtonMethod; }; //! The class with all index definitions for the model template -struct Indices { using type = Opm::RichardsIndices; }; +struct Indices +{ using type = RichardsIndices; }; /*! * \brief The wetting phase used. @@ -140,7 +157,7 @@ private: using Scalar = GetPropType; public: - using type = Opm::LiquidPhase >; + using type = LiquidPhase>; }; /*! @@ -158,7 +175,7 @@ private: using Scalar = GetPropType; public: - using type = Opm::GasPhase >; + using type = GasPhase>; }; /*! @@ -179,7 +196,7 @@ private: using NonWettingFluid = GetPropType; public: - using type = Opm::TwoPhaseImmiscibleFluidSystem; + using type = TwoPhaseImmiscibleFluidSystem; }; @@ -265,7 +282,6 @@ class RichardsModel static const unsigned liquidCompIdx = getPropValue(); static const unsigned gasCompIdx = getPropValue(); - // some consistency checks static_assert(numPhases == 2, "Exactly two fluids are required for this model"); @@ -381,12 +397,11 @@ public: { return phaseIdx == liquidPhaseIdx; } void registerOutputModules_() - { - ParentType::registerOutputModules_(); - } + { ParentType::registerOutputModules_(); } - mutable Scalar referencePressure_; + Scalar referencePressure_{}; }; + } // namespace Opm #endif