From 03685e5bf2256231b0850f39bcf136fa0fcb01f5 Mon Sep 17 00:00:00 2001 From: Trine Mykkeltvedt Date: Tue, 10 May 2022 10:51:37 +0200 Subject: [PATCH] problems with how ideal gas constant R was defined on mac, David helped me fix it --- opm/material/eos/PengRobinson.hpp | 10 +++------- opm/material/eos/PengRobinsonParamsMixture.hpp | 7 +------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/opm/material/eos/PengRobinson.hpp b/opm/material/eos/PengRobinson.hpp index 8559e6be0..46438525d 100644 --- a/opm/material/eos/PengRobinson.hpp +++ b/opm/material/eos/PengRobinson.hpp @@ -55,8 +55,6 @@ namespace Opm { template class PengRobinson { - //! The ideal gas constant [Pa * m^3/mol/K] - static const Scalar R; PengRobinson() { } @@ -168,7 +166,7 @@ public: if (!std::isfinite(scalarValue(b)) || b <= 0) return std::numeric_limits::quiet_NaN(); - const Evaluation& RT= R*T; + const Evaluation& RT= Constants::R*T; const Evaluation& Astar = a*p/(RT*RT); const Evaluation& Bstar = b*p/RT; @@ -253,7 +251,7 @@ public: const Evaluation& p = params.pressure(); const Evaluation& Vm = params.molarVolume(); - const Evaluation& RT = R*T; + const Evaluation& RT = Constants::R*T; const Evaluation& Z = p*Vm/RT; const Evaluation& Bstar = p*params.b() / RT; @@ -417,7 +415,7 @@ protected: Scalar u = 2; Scalar w = -1; - const Evaluation& RT = R*T; + const Evaluation& RT = Constants::R*T; // calculate coefficients of the 4th order polynominal in // monomial basis @@ -541,8 +539,6 @@ protected: */ }; -template -const Scalar PengRobinson::R = Constants::R; /* template diff --git a/opm/material/eos/PengRobinsonParamsMixture.hpp b/opm/material/eos/PengRobinsonParamsMixture.hpp index 962a18e4e..b58876e28 100644 --- a/opm/material/eos/PengRobinsonParamsMixture.hpp +++ b/opm/material/eos/PengRobinsonParamsMixture.hpp @@ -65,9 +65,6 @@ class PengRobinsonParamsMixture typedef MathToolbox Toolbox; - // the ideal gas constant - static const Scalar R; - public: /*! * \brief Update Peng-Robinson parameters for the pure components. @@ -98,7 +95,7 @@ public: Scalar pc = FluidSystem::criticalPressure(i); Scalar omega = FluidSystem::acentricFactor(i); Scalar Tr = temperature/FluidSystem::criticalTemperature(i); - Scalar RTc = R*FluidSystem::criticalTemperature(i); + Scalar RTc = Constants::R*FluidSystem::criticalTemperature(i); Scalar f_omega; @@ -246,8 +243,6 @@ private: Scalar aCache_[numComponents][numComponents]; }; -template -const Scalar PengRobinsonParamsMixture::R = Constants::R; } // namespace Opm