From e42bb116f859adaf9dd0181cf442cbb6ceb3d763 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 2 Aug 2022 09:39:42 +0200 Subject: [PATCH] Brine: some modernization - use constexpr --- opm/material/components/Brine.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opm/material/components/Brine.hpp b/opm/material/components/Brine.hpp index eb5695fec..3ad522367 100644 --- a/opm/material/components/Brine.hpp +++ b/opm/material/components/Brine.hpp @@ -80,7 +80,7 @@ public: static Scalar molarMass() { const Scalar M1 = H2O::molarMass(); - const Scalar M2 = 58e-3; // molar mass of NaCl [kg/mol] + constexpr Scalar M2 = 58e-3; // molar mass of NaCl [kg/mol] const Scalar X2 = salinity; // mass fraction of salt in brine return M1*M2/(M2 + X2*(M1 - M2)); } @@ -149,12 +149,12 @@ public: const Evaluation& pressure) { // Numerical coefficents from Palliser and McKibbin - static const Scalar f[] = { + static constexpr Scalar f[] = { 2.63500e-1, 7.48368e-6, 1.44611e-6, -3.80860e-10 }; // Numerical coefficents from Michaelides for the enthalpy of brine - static const Scalar a[4][3] = { + static constexpr Scalar a[4][3] = { { -9633.6, -4080.0, +286.49 }, { +166.58, +68.577, -4.6856 }, { -0.90963, -0.36524, +0.249667e-1 },