Go to the documentation of this file.
27#ifndef OPM_IAPWS_REGION1_HPP
28#define OPM_IAPWS_REGION1_HPP
49template < class Scalar>
60 template < class Evaluation>
61 static bool isValid( const Evaluation& temperature, const Evaluation& pressure)
63 return temperature <= 623.15 && pressure <= 100e6;
82 template < class Evaluation>
83 static Evaluation tau( const Evaluation& temperature)
84 { return 1386.0 / temperature; }
92 template < class Evaluation>
93 static Evaluation dtau_dT( const Evaluation& temperature)
94 { return - 1386.0 / (temperature*temperature); }
101 template < class Evaluation>
102 static Evaluation pi( const Evaluation& pressure)
103 { return pressure / 16.53e6; }
111 template < class Evaluation>
113 { return 1.0 / 16.53e6; }
121 template < class Evaluation>
135 template < class Evaluation>
136 static Evaluation gamma( const Evaluation& temperature, const Evaluation& pressure)
138 const Evaluation tau_ = tau(temperature);
139 const Evaluation pi_ = pi(pressure);
141 Evaluation result = 0;
142 for ( int i = 0; i < 34; ++i) {
143 result += n(i)* pow(7.1 - pi_, I(i))* pow(tau_ - 1.222, J(i));
161 template < class Evaluation>
162 static Evaluation dgamma_dtau( const Evaluation& temperature, const Evaluation& pressure)
164 const Evaluation tau_ = tau(temperature);
165 const Evaluation pi_ = pi(pressure);
167 Evaluation result = 0.0;
168 for ( int i = 0; i < 34; i++) {
171 pow(7.1 - pi_, static_cast<Scalar >(I(i))) *
172 pow(tau_ - 1.222, static_cast<Scalar >(J(i)-1)) *
190 template < class Evaluation>
191 static Evaluation dgamma_dpi( const Evaluation& temperature, const Evaluation& pressure)
193 const Evaluation tau_ = tau(temperature);
194 const Evaluation pi_ = pi(pressure);
196 Evaluation result = 0.0;
197 for ( int i = 0; i < 34; i++) {
201 pow(7.1 - pi_, static_cast<Scalar >(I(i) - 1)) *
202 pow(tau_ - 1.222, static_cast<Scalar >(J(i)));
220 template < class Evaluation>
221 static Evaluation ddgamma_dtaudpi( const Evaluation& temperature, const Evaluation& pressure)
223 const Evaluation tau_ = tau(temperature);
224 const Evaluation pi_ = pi(pressure);
226 Evaluation result = 0.0;
227 for ( int i = 0; i < 34; i++) {
232 pow(7.1 - pi_, static_cast<Scalar >(I(i) - 1)) *
233 pow(tau_ - 1.222, static_cast<Scalar >(J(i) - 1));
251 template < class Evaluation>
252 static Evaluation ddgamma_ddpi( const Evaluation& temperature, const Evaluation& pressure)
254 const Evaluation tau_ = tau(temperature);
255 const Evaluation pi_ = pi(pressure);
257 Evaluation result = 0.0;
258 for ( int i = 0; i < 34; i++) {
263 pow(7.1 - pi_, I(i) - 2) *
264 pow(tau_ - 1.222, J(i));
281 template < class Evaluation>
282 static Evaluation ddgamma_ddtau( const Evaluation& temperature, const Evaluation& pressure)
284 const Evaluation tau_ = tau(temperature);
285 const Evaluation pi_ = pi(pressure);
287 Evaluation result = 0.0;
288 for ( int i = 0; i < 34; i++) {
291 pow(7.1 - pi_, I(i)) *
294 pow(tau_ - 1.222, J(i) - 2);
301 static Scalar n( int i)
303 static const Scalar n[34] = {
304 0.14632971213167, -0.84548187169114, -0.37563603672040e1,
305 0.33855169168385e1, -0.95791963387872, 0.15772038513228,
306 -0.16616417199501e-1, 0.81214629983568e-3, 0.28319080123804e-3,
307 -0.60706301565874e-3, -0.18990068218419e-1, -0.32529748770505e-1,
308 -0.21841717175414e-1, -0.52838357969930e-4, -0.47184321073267e-3,
309 -0.30001780793026e-3, 0.47661393906987e-4, -0.44141845330846e-5,
310 -0.72694996297594e-15,-0.31679644845054e-4, -0.28270797985312e-5,
311 -0.85205128120103e-9, -0.22425281908000e-5, -0.65171222895601e-6,
312 -0.14341729937924e-12,-0.40516996860117e-6, -0.12734301741641e-8,
313 -0.17424871230634e-9, -0.68762131295531e-18, 0.14478307828521e-19,
314 0.26335781662795e-22,-0.11947622640071e-22, 0.18228094581404e-23,
315 -0.93537087292458e-25
320 static Scalar I( int i)
322 static const short int I[34] = {
339 static Scalar J( int i)
341 static const short int J[34] = {
Implements the equations for region 1 of the IAPWS '97 formulation. Definition: Region1.hpp:51
static Evaluation ddgamma_ddpi(const Evaluation &temperature, const Evaluation &pressure) The second partial derivative of the Gibbs free energy to the normalized pressure for IAPWS region 1 ... Definition: Region1.hpp:252
static Evaluation dtau_dT(const Evaluation &temperature) Returns the derivative of the reduced temperature to the temperature for IAPWS region 1 in . Definition: Region1.hpp:93
static Evaluation tau(const Evaluation &temperature) Returns the reduced temperature for IAPWS region 1. Definition: Region1.hpp:83
static Evaluation ddgamma_ddtau(const Evaluation &temperature, const Evaluation &pressure) The second partial derivative of the Gibbs free energy to the normalized temperature for IAPWS region... Definition: Region1.hpp:282
static Scalar dp_dpi(const Evaluation &) Returns the derivative of the pressure to the reduced pressure for IAPWS region 1 in . Definition: Region1.hpp:122
static Evaluation pi(const Evaluation &pressure) Returns the reduced pressure for IAPWS region 1. Definition: Region1.hpp:102
static Evaluation gamma(const Evaluation &temperature, const Evaluation &pressure) The Gibbs free energy (dimensionless) for IAPWS region 1 (i.e. liquid) Definition: Region1.hpp:136
static Evaluation dgamma_dtau(const Evaluation &temperature, const Evaluation &pressure) The partial derivative of the Gibbs free energy to the normalized temperature for IAPWS region 1 (i.... Definition: Region1.hpp:162
static bool isValid(const Evaluation &temperature, const Evaluation &pressure) Returns true if IAPWS region 1 applies for a (temperature in , pressure in ) pair. Definition: Region1.hpp:61
static Evaluation ddgamma_dtaudpi(const Evaluation &temperature, const Evaluation &pressure) The partial derivative of the Gibbs free energy to the normalized pressure and to the normalized temp... Definition: Region1.hpp:221
static Scalar dpi_dp(const Evaluation &) Returns the derivative of the reduced pressure to the pressure for IAPWS region 1 in . Definition: Region1.hpp:112
static Evaluation dgamma_dpi(const Evaluation &temperature, const Evaluation &pressure) The partial derivative of the Gibbs free energy to the normalized pressure for IAPWS region 1 (i.... Definition: Region1.hpp:191
Definition: Air_Mesitylene.hpp:34
ReturnEval_< Evaluation1, Evaluation2 >::type pow(const Evaluation1 &base, const Evaluation2 &exp) Definition: MathToolbox.hpp:416
|