30#include <opm/common/TimingMacros.hpp>
52template <
class Scalar>
60 static const Scalar brineSalinity;
65 static std::string_view
name()
78 {
return 273.15 + 30.95; }
90 {
return 273.15 - 56.35; }
134 template <
class Evaluation>
137 static constexpr Scalar a[4] =
138 { -7.0602087, 1.9391218, -1.6463597, -3.2995634 };
139 static constexpr Scalar t[4] =
140 { 1.0, 1.5, 2.0, 4.0 };
143 Evaluation exponent = 0;
145 for (
int i = 0; i < 4; ++i)
146 exponent += a[i]*pow(1 - Tred, t[i]);
147 exponent *= 1.0/Tred;
168 template <
class Evaluation>
170 const Evaluation& pressure,
171 bool extrapolate =
false)
173 return tabulatedEnthalpy.
eval(temperature, pressure, extrapolate);
179 template <
class Evaluation>
181 const Evaluation& pressure,
182 bool extrapolate =
false)
184 const Evaluation h =
gasEnthalpy(temperature, pressure, extrapolate);
185 const Evaluation rho =
gasDensity(temperature, pressure, extrapolate);
187 return h - (pressure / rho);
193 template <
class Evaluation>
195 const Evaluation& pressure,
196 bool extrapolate =
false)
198 return tabulatedDensity.
eval(temperature, pressure, extrapolate);
207 template <
class Evaluation>
209 const Evaluation& pressure,
210 bool extrapolate =
false)
212 OPM_TIMEFUNCTION_LOCAL();
213 constexpr Scalar a0 = 0.235156;
214 constexpr Scalar a1 = -0.491266;
215 constexpr Scalar a2 = 5.211155e-2;
216 constexpr Scalar a3 = 5.347906e-2;
217 constexpr Scalar a4 = -1.537102e-2;
219 constexpr Scalar d11 = 0.4071119e-2;
220 constexpr Scalar d21 = 0.7198037e-4;
221 constexpr Scalar d64 = 0.2411697e-16;
222 constexpr Scalar d81 = 0.2971072e-22;
223 constexpr Scalar d82 = -0.1627888e-22;
225 constexpr Scalar ESP = 251.196;
227 if(temperature < 275.)
229 Evaluation TStar = temperature/ESP;
232 const Evaluation logTStar = log(TStar);
233 Evaluation SigmaStar = exp(a0 + logTStar*(a1 + logTStar*(a2 + logTStar*(a3 + logTStar*a4))));
235 Evaluation mu0 = 1.00697*sqrt(temperature) / SigmaStar;
237 const Evaluation rho =
gasDensity(temperature, pressure, extrapolate);
243 + d64*pow(rho, 6.0)/(TStar*TStar*TStar)
245 + d82*pow(rho, 8.0)/TStar;
247 return (mu0 + dmu)/1.0e6;
260 template <
class Evaluation>
261 static Evaluation
gasHeatCapacity(
const Evaluation& temperature,
const Evaluation& pressure)
263 OPM_TIMEFUNCTION_LOCAL();
264 constexpr Scalar eps = 1e-6;
269 const Evaluation h1 =
gasEnthalpy(temperature - eps, pressure);
270 const Evaluation h2 =
gasEnthalpy(temperature + eps, pressure);
272 return (h2 - h1) / (2*eps) ;
Abstract base class of a pure chemical species.
A central place for various physical constants occuring in some equations.
Relations valid for an ideal gas.
A class for the CO2 fluid properties.
Definition CO2.hpp:54
static Scalar criticalTemperature()
Returns the critical temperature [K] of CO2.
Definition CO2.hpp:77
static bool gasIsCompressible()
Returns true iff the gas phase is assumed to be compressible.
Definition CO2.hpp:156
static Evaluation gasHeatCapacity(const Evaluation &temperature, const Evaluation &pressure)
Specific isobaric heat capacity of the component [J/kg] as a liquid.
Definition CO2.hpp:261
static Scalar criticalPressure()
Returns the critical pressure [Pa] of CO2.
Definition CO2.hpp:83
static Evaluation gasViscosity(Evaluation temperature, const Evaluation &pressure, bool extrapolate=false)
The dynamic viscosity [Pa s] of CO2.
Definition CO2.hpp:208
static std::string_view name()
A human readable name for the CO2.
Definition CO2.hpp:65
static Evaluation vaporPressure(const Evaluation &T)
Returns the pressure [Pa] at CO2's triple point.
Definition CO2.hpp:135
static Scalar triplePressure()
Returns the pressure [Pa] at CO2's triple point.
Definition CO2.hpp:95
static Scalar tripleTemperature()
Returns the temperature [K]at CO2's triple point.
Definition CO2.hpp:89
static Evaluation gasEnthalpy(const Evaluation &temperature, const Evaluation &pressure, bool extrapolate=false)
Specific enthalpy of gaseous CO2 [J/kg].
Definition CO2.hpp:169
static bool gasIsIdeal()
Returns true iff the gas phase is assumed to be ideal.
Definition CO2.hpp:162
static Scalar molarMass()
The mass in [kg] of one mole of CO2.
Definition CO2.hpp:71
static Evaluation gasInternalEnergy(const Evaluation &temperature, const Evaluation &pressure, bool extrapolate=false)
Specific internal energy of CO2 [J/kg].
Definition CO2.hpp:180
static Evaluation gasDensity(const Evaluation &temperature, const Evaluation &pressure, bool extrapolate=false)
The density of CO2 at a given pressure and temperature [kg/m^3].
Definition CO2.hpp:194
Abstract base class of a pure chemical species.
Definition Component.hpp:44
A central place for various physical constants occuring in some equations.
Definition Constants.hpp:41
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30