EclThwLaw(Params): some modernization

- typedef -> using
- use constexpr where appropriate
- fix includes
This commit is contained in:
Arne Morten Kvarving 2022-08-03 08:26:43 +02:00
parent e1db0bbb4c
commit 31c7641fac
2 changed files with 7 additions and 7 deletions

View File

@ -29,10 +29,9 @@
#include "EclThcLawParams.hpp" #include "EclThcLawParams.hpp"
#include <opm/material/densead/Math.hpp>
namespace Opm namespace Opm
{ {
/*! /*!
* \ingroup material * \ingroup material
* *
@ -46,8 +45,8 @@ template <class ScalarT,
class EclThcLaw class EclThcLaw
{ {
public: public:
typedef ParamsT Params; using Params = ParamsT;
typedef typename Params::Scalar Scalar; using Scalar = typename Params::Scalar;
/*! /*!
* \brief Given a fluid state, return the total thermal conductivity [W/m^2 / (K/m)] of the porous * \brief Given a fluid state, return the total thermal conductivity [W/m^2 / (K/m)] of the porous
@ -68,7 +67,7 @@ public:
// incorrectness. // incorrectness.
// //
// TODO: also follow their fine leadership in the twophase case. // TODO: also follow their fine leadership in the twophase case.
Scalar numPhases = 3.0; constexpr const Scalar numPhases = 3.0;
Scalar thconAvg = Scalar thconAvg =
poro*(params.thcoil() + params.thcgas() + params.thcwater()) / numPhases poro*(params.thcoil() + params.thcgas() + params.thcwater()) / numPhases
+ (1.0 - poro)*params.thcrock(); + (1.0 - poro)*params.thcrock();
@ -76,6 +75,7 @@ public:
return thconAvg; return thconAvg;
} }
}; };
} // namespace Opm } // namespace Opm
#endif #endif

View File

@ -39,7 +39,7 @@ template <class ScalarT>
class EclThcLawParams : public EnsureFinalized class EclThcLawParams : public EnsureFinalized
{ {
public: public:
typedef ScalarT Scalar; using Scalar = ScalarT;
EclThcLawParams(const EclThcLawParams&) = default; EclThcLawParams(const EclThcLawParams&) = default;