CoolProp  4.2.5
An open-source fluid property and humid air property database
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Oxygen.cpp
Go to the documentation of this file.
1 /* Properties of Oxygen
2 by Ian Bell
3 
4 Thermo properties from
5 ---------------------
6 "Thermodynamic Properties of Oxygen from the Triple point to 300 K with pressures to 80 MPa",
7 Richard B. Stewart, Richard T. Jacobsen, and W. Wagner,
8 J. Phys. Chem. Ref. Data, v. 20, n. 5, 1991
9 
10 Transport properties from
11 ------------------------
12 "Viscosity and Thermal Conductivity Equations for
13 Nitrogen, Oxygen, Argon, and Air"
14 E. W. Lemmon and R. T Jacobsen
15 International Journal of Thermophysics, Vol. 25, No. 1, January 2004
16 
17 Surface Tension
18 ---------------
19 Lemmon, E.W. and Penoncello, S.G.,
20 "The Surface Tension of Air and Air Component Mixtures,"
21 Adv. Cryo. Eng., 39:1927-1934, 1994.
22 */
23 
24 #if defined(_MSC_VER)
25 #define _CRTDBG_MAP_ALLOC
26 #define _CRT_SECURE_NO_WARNINGS
27 #include <stdlib.h>
28 #include <crtdbg.h>
29 #else
30 #include <stdlib.h>
31 #endif
32 
33 #include "math.h"
34 #include "stdio.h"
35 #include <string.h>
36 #include "CoolProp.h"
37 #include "FluidClass.h"
38 #include "Oxygen.h"
39 
40 
41 
43 {
44  static const double n[]={0,
45  0.3983768749, //[1]
46  -1.846157454, //[2]
47  0.4183473197, //[3]
48  0.2370620711e-1, //[4]
49 
50  0.9771730573e-1, //[5]
51  0.3017891294e-1, //[6]
52  0.2273353212e-1, //[7]
53  0.1357254086e-1, //[8]
54 
55  -0.4052698943e-1, //[9]
56  0.5454628515e-3, //[10]
57  0.5113182277e-3, //[11]
58  0.2953466883e-6, //[12]
59 
60  -0.8687645072e-4, //[13]
61  -0.2127082589, //[14
62  0.8735941958e-1, //[15]
63  0.1275509190, //[16]
64 
65  -0.9067701064e-1, //[17]
66  -0.3540084206e-1, //[18]
67  -0.3623278059e-1, //[19]
68  0.1327699290e-1, //[20]
69 
70  -0.3254111865e-3, //[21]
71  -0.8313582932e-2, //[22]
72  0.2124570559e-2, //[23]
73  -0.8325206232e-3, //[24]
74 
75  -0.2626173276e-4, //[25]
76  0.2599581482e-2, //[26]
77  0.9984649663e-2, //[27]
78  0.2199923153e-2, //[28]
79 
80  -0.2591350486e-1, //[29]
81  -0.1259630848, //[30]
82  0.1478355637, //[31]
83  -0.1011251078e-1 //[32]
84 
85  };
86 
87  // d used for consistency (corresponds to i from Stewart)
88  static const double d[]={0,
89  1,//[1]
90  1,//[2]
91  1,//[3]
92  2,//[4]
93 
94  2,//[5]
95  2,//[6]
96  3,//[7]
97  3,//[8]
98 
99  3,//[9]
100  6,//[10]
101  7,//[11]
102  7,//[12]
103 
104  8,//[13]
105  1,//[14]
106  1,//[15]
107  2,//[16]
108 
109  2,//[17]
110  3,//[18]
111  3,//[19]
112  5,//[20]
113 
114  6,//[21]
115  7,//[22]
116  8,//[23]
117  10,//[24]
118 
119  2,//[25]
120  3,//[26]
121  3,//[27]
122  4,//[28]
123 
124  4,//[29]
125  5,//[30]
126  5,//[31]
127  5,//[32]
128  };
129 
130  // t used for consistency (corresponds to j from Stewart)
131  static const double t[]={0.00,
132  0.0,//[1]
133  1.5,//[2]
134  2.5,//[3]
135  -0.5,//[4]
136 
137  1.5,//[5]
138  2.0,//[6]
139  0.0,//[7]
140  1.0,//[8]
141 
142  2.5,//[9]
143  0.0,//[10]
144  2.0,//[11]
145  5.0,//[12]
146 
147  2.0,//[13]
148  5.0,//[14]
149  6.0,//[15]
150  3.5,//[16]
151 
152  5.5,//[17]
153  3.0,//[18]
154  7.0,//[19]
155  6.0,//[20]
156 
157  8.5,//[21]
158  4.0,//[22]
159  6.5,//[23]
160  5.5,//[24]
161 
162  22.0,//[25]
163  11.0,//[26]
164  18.0,//[27]
165  11.0,//[28]
166 
167  23.0,//[29]
168  17.0,//[30]
169  18.0,//[31]
170  23.0,//[32]
171  };
172 
173  // c used for consistency (corresponds to l from Stewart)
174  static const double cv[]={0,
175  0,//[1]
176  0,//[2]
177  0,//[3]
178  0,//[4]
179  0,//[5]
180  0,//[6]
181  0,//[7]
182  0,//[8]
183  0,//[9]
184  0,//[10]
185  0,//[11]
186  0,//[12]
187  0,//[13]
188  2,//[14]
189  2,//[15]
190  2,//[16]
191  2,//[17]
192  2,//[18]
193  2,//[19]
194  2,//[20]
195  2,//[21]
196  2,//[22]
197  2,//[23]
198  2,//[24]
199  4,//[25]
200  4,//[26]
201  4,//[27]
202  4,//[28]
203  4,//[29]
204  4,//[30]
205  4,//[31]
206  4 //[32]
207  };
208 
209  //Constants for ideal gas expression
210  static const double N0[]={0.0,
211  1.06778,
212  3.50042,
213  0.166961e-7,
214  1.01258,
215  0.944365,
216  2242.45,
217  11580.4,
218  };
219 
220  // The residual HE terms
221  phirlist.push_back(new phir_power(n,d,t,cv,1,32,33));
222 
223  // Critical parameters
224  crit.rho = 13.63*31.9988;
225  crit.p = PressureUnit(5043.0, UNIT_KPA);
226  crit.T = 154.581;
227  crit.v = 1.0/crit.rho;
228 
229  // Other fluid parameters
230  params.molemass = 31.9988;
231  params.Ttriple = 54.361;
232  params.ptriple = 0.146323903868;
233  params.accentricfactor = 0.0222;
234  params.R_u = 8.31434;
235 
236  double T0 = 298.15,
237  p0 = 101.325,
238  R_ = 8.31434/params.molemass,
239  rho0 = p0/(R_*T0),
240  m,
241  c,
242  R_u = 8.31434,
243  H0 = 8680.0,
244  S0 = 205.043,
245  Tc = crit.T,
246  tau0 = crit.T/T0,
247  delta0 = rho0/crit.rho;
248 
249  // log(delta)+c+m*tau
250 
252  c=-S0/R_u-1+log(tau0/delta0);/*<< from the leading term*/
253 
255  m=H0/(R_u*Tc); /*<< from the leading term */
256 
257  std::vector<double> N0_v(N0,N0+sizeof(N0)/sizeof(double));
258 
259  phi_BC * phi0_lead_ = new phi0_lead(c,m);
260  phi_BC * phi0_logtau_ = new phi0_logtau(-1);
261 
262  phi_BC * phi0_cp0_poly_1 = new phi0_cp0_poly(N0_v[1],-1.5,Tc,T0);
263  phi_BC * phi0_cp0_constant_ = new phi0_cp0_constant(N0_v[2],Tc,T0);
264  phi_BC * phi0_cp0_poly_2 = new phi0_cp0_poly(N0_v[3],2,Tc,T0);
265 
266  // The next term turns into one of the first form of the phi0_exponential
267  // Term is of the form a_0*log(1-exp(-theta_0*tau))
268  // theta_0 is N[6]/Tc
269  phi_BC * phi0_Planck_Einstein_ = new phi0_Planck_Einstein(N0_v[4],N0_v[6]/Tc);
270 
271  // The last term turns into one of the second form of the phi0_exponential
272  // Term is of the form a_0*log(c+exp(theta_0*tau))
273  // c = 2/3
274  // theta_0 is N[7]/Tc
275  phi_BC * phi0_Planck_Einstein2_ = new phi0_Planck_Einstein2(N0_v[5],N0_v[7]/Tc,2.0/3.0);
276 
277  phi0list.push_back(phi0_lead_);
278  phi0list.push_back(phi0_logtau_);
279  phi0list.push_back(phi0_cp0_poly_1);
280  phi0list.push_back(phi0_cp0_constant_);
281  phi0list.push_back(phi0_cp0_poly_2);
282 
283  phi0list.push_back(phi0_Planck_Einstein_);
284  phi0list.push_back(phi0_Planck_Einstein2_);
285 
286  // Limits of EOS
287  limits.Tmin = params.Ttriple;
288  limits.Tmax = 2000.0;
289  limits.pmax = 2200000.0;
290  limits.rhomax = 53.15*params.molemass;
291 
292  EOSReference.assign("\"Thermodynamic Properties of Oxygen from the Triple point to 300 K with pressures to 80 MPa\", "
293  "Richard B. Stewart, Richard T. Jacobsen, and W. Wagner, "
294  "J. Phys. Chem. Ref. Data, v. 20, n. 5, 1991");
295  TransportReference.assign("Viscosity and Thermal Conductivity: \"Viscosity and Thermal Conductivity Equations for"
296  "Nitrogen, Oxygen, Argon, and Air\""
297  "E. W. Lemmon and R. T Jacobsen"
298  "International Journal of Thermophysics, Vol. 25, No. 1, January 2004");
299 
300  name.assign("Oxygen");
301  aliases.push_back("oxygen");
302  aliases.push_back(std::string("OXYGEN"));
303  aliases.push_back("O2");
304 
305  BibTeXKeys.EOS = "Stewart-JPCRD-1991";
306  BibTeXKeys.VISCOSITY = "Lemmon-IJT-2004";
307  BibTeXKeys.CONDUCTIVITY = "Lemmon-IJT-2004";
308  BibTeXKeys.SURFACE_TENSION = "Mulero-JPCRD-2012";
309 }
310 
311 double OxygenClass::X_tilde(double T,double tau,double delta)
312 {
313  // X_tilde is dimensionless
314  // Equation 11 slightly rewritten
315  double drho_dp,R_Oxygen;
316  R_Oxygen=params.R_u/params.molemass;
317  drho_dp=1.0/(R_Oxygen*T*(1+2*delta*dphir_dDelta(tau,delta)+delta*delta*d2phir_dDelta2(tau,delta)));
318  return reduce.p.Pa*delta/reduce.rho*drho_dp;
319 }
320 
321 double OxygenClass::conductivity_Trho(double T, double rho)
322 {
323  double e_k=118.5, //[K]
324  sigma=0.3428, //[nm]
325  Tref=309.162, //[K]
326  zeta0=0.24, //[nm]
327  LAMBDA=0.055,
328  q_D=0.51; //[nm]
329  double eta0,OMEGA,delta,tau,Tstar,lambda0,lambdar,num,
330  cp,cv,OMEGA_tilde,OMEGA_tilde0,zeta,nu,gamma,R0,lambdac,k,
331  pi=3.141592654,mu;
332  double b[]={0.431,-0.4623,0.08406,0.005341,-0.00331};
333 
334  double N[]={0,1.036,6.283,-4.262,15.31,8.898,-0.7336,6.728,-4.374,-0.4747};
335  double t[]={0,0,-0.9,-0.6,0.0,0.0,0.3,4.3,0.5,1.8};
336  double d[]={0,0,0,0,1,3,4,5,7,10};
337  double l[]={0,0,0,0,0,0,0,2,2,2};
338  double g[]={0,0,0,0,0,0,0,1,1,1};
339 
340  delta=rho/reduce.rho;
341  tau=reduce.T/T;
342  Tstar=T/(e_k);
343 
344  OMEGA=exp(b[0]*powInt(log(Tstar),0)
345  +b[1]*powInt(log(Tstar),1)
346  +b[2]*powInt(log(Tstar),2)
347  +b[3]*powInt(log(Tstar),3)
348  +b[4]*powInt(log(Tstar),4));
349 
350  eta0=0.0266958*sqrt(params.molemass*T)/(sigma*sigma*OMEGA);
351  lambda0=N[1]*eta0+N[2]*pow(tau,t[2])+N[3]*pow(tau,t[3]);
352 
353  lambdar=N[4]*pow(tau,t[4])*pow(delta,d[4])*exp(-g[4]*pow(delta,l[4]))
354  +N[5]*pow(tau,t[5])*pow(delta,d[5])*exp(-g[5]*pow(delta,l[5]))
355  +N[6]*pow(tau,t[6])*pow(delta,d[6])*exp(-g[6]*pow(delta,l[6]))
356  +N[7]*pow(tau,t[7])*pow(delta,d[7])*exp(-g[7]*pow(delta,l[7]))
357  +N[8]*pow(tau,t[8])*pow(delta,d[8])*exp(-g[8]*pow(delta,l[8]))
358  +N[9]*pow(tau,t[9])*pow(delta,d[9])*exp(-g[9]*pow(delta,l[9]));
359 
360  R0=1.01;
361  nu=0.63;
362  gamma=1.2415;
363  k=1.380658e-23; //[J/K]
364 
365  num=X_tilde(T,reduce.T/T,delta)-X_tilde(Tref,reduce.T/Tref,delta)*Tref/T;
366 
367  // no critical enhancement if numerator of Eq. 10 is negative
368  if (num<0)
369  return (lambda0+lambdar)/1e3;
370 
371  cp = specific_heat_p_Trho(T,rho); //[J/kg/K]
372  cv = specific_heat_v_Trho(T,rho); //[J/kg/K]
373  mu = viscosity_Trho(T,rho)*1e6; //[uPa-s]
374 
375  zeta=zeta0*pow(num/LAMBDA,nu/gamma); //[nm]
376  OMEGA_tilde=2.0/pi*((cp-cv)/cp*atan(zeta/q_D)+cv/cp*(zeta/q_D));
377  OMEGA_tilde0=2.0/pi*(1.-exp(-1./(q_D/zeta+1.0/3.0*(zeta/q_D)*(zeta/q_D)/delta/delta)));
378  lambdac=rho*cp*k*R0*T/(6*pi*zeta*mu)*(OMEGA_tilde-OMEGA_tilde0)*1e18; // 1e18 is conversion to W/m-K (not described in paper)
379 
380  return (lambda0+lambdar+lambdac)/1e3; //[W/m/K]
381 }
382 double OxygenClass::viscosity_Trho(double T, double rho)
383 {
384  double e_k=118.5, //[K]
385  sigma=0.3428; //[nm]
386  double eta0,etar,OMEGA,delta,tau,Tstar;
387  double b[]={0.431,-0.4623,0.08406,0.005341,-0.00331};
388 
389  double N[]={0,17.67,0.4042,0.0001077,0.3510,-13.67};
390  double t[]={0,0.05,0.0,2.10,0.0,0.5};
391  double d[]={0,1,5,12,8,1};
392  double l[]={0,0,0,0,1,2};
393  double g[]={0,0,0,0,1,1};
394 
395  delta=rho/reduce.rho;
396  tau=reduce.T/T;
397  Tstar=T/(e_k);
398  OMEGA=exp(b[0]*powInt(log(Tstar),0)
399  +b[1]*powInt(log(Tstar),1)
400  +b[2]*powInt(log(Tstar),2)
401  +b[3]*powInt(log(Tstar),3)
402  +b[4]*powInt(log(Tstar),4));
403 
404  eta0=0.0266958*sqrt(params.molemass*T)/(sigma*sigma*OMEGA);
405  etar=N[1]*pow(tau,t[1])*pow(delta,d[1])*exp(-g[1]*pow(delta,l[1]))
406  +N[2]*pow(tau,t[2])*pow(delta,d[2])*exp(-g[2]*pow(delta,l[2]))
407  +N[3]*pow(tau,t[3])*pow(delta,d[3])*exp(-g[3]*pow(delta,l[3]))
408  +N[4]*pow(tau,t[4])*pow(delta,d[4])*exp(-g[4]*pow(delta,l[4]))
409  +N[5]*pow(tau,t[5])*pow(delta,d[5])*exp(-g[5]*pow(delta,l[5]));
410 
411  return (eta0+etar)/1e6; // uPa-s to Pa-s
412 }
413 double OxygenClass::psat(double T)
414 {
415  const double ti[]={0,1.0,3.0/2.0,3.0,7.0,9.0};
416  const double Ni[]={0,-6.043938,1.175627,-0.994086,-3.456781,3.361499};
417  double summer=0;
418  int i;
419  for (i=1;i<=5;i++)
420  {
421  summer=summer+Ni[i]*pow(1-T/reduce.T,ti[i]);
422  }
423  double p = reduce.p.Pa*exp(reduce.T/T*summer);
424  return p;
425 }
426 double OxygenClass::rhosatV(double T)
427 {
428  const double ti[]={0,1.0/3.0,2.0/3.0,1.0,5.0/3.0,4.0,9.0};
429  const double Ni[]={0,-1.498431,-2.116826,-0.905713,-5.659990,-18.90964,-53.780774};
430  double summer=0;
431  int i;
432  for (i=1;i<=6;i++)
433  {
434  summer=summer+Ni[i]*pow(1.0-T/reduce.T,ti[i]);
435  }
436  double rho = reduce.rho*exp(summer);
437  return rho;
438 }
439 double OxygenClass::rhosatL(double T)
440 {
441  const double ti[]={0,1.0/3.0,2.0/3.0,3.0};
442  const double Ni[]={0,1.507678,0.85810805,0.19035504};
443  double summer=1;
444  int i;
445  for (i=1;i<=3;i++)
446  {
447  summer += Ni[i]*pow(1.0-T/reduce.T,ti[i]);
448  }
449  double rho = reduce.rho*summer;
450  return rho;
451 }
453 {
454  // From Mulero, 2012, JPCRD
455  return 0.03843*pow(1-T/reduce.T,1.225);
456 }
OxygenClass()
Definition: Oxygen.cpp:42
std::vector< phi_BC * > phirlist
Definition: FluidClass.h:178
struct FluidLimits limits
Definition: FluidClass.h:219
std::string EOS
Definition: FluidClass.h:120
std::string VISCOSITY
Definition: FluidClass.h:122
PressureUnit p
Definition: FluidClass.h:50
std::string name
A container to hold the cache for residual Helmholtz derivatives.
Definition: FluidClass.h:151
std::string TransportReference
A std::string that contains a reference for thermo properties for the fluid.
Definition: FluidClass.h:158
double Pa
Definition: Units.h:22
std::vector< std::string > aliases
The REFPROP-compliant name if REFPROP-"name" is not a compatible fluid name. If not included...
Definition: FluidClass.h:153
double powInt(double x, int y)
struct CriticalStruct reduce
A pointer to the point that is used to reduce the T and rho for EOS.
Definition: FluidClass.h:222
double Tmax
Definition: FluidClass.h:54
virtual double viscosity_Trho(double, double)
Definition: Oxygen.cpp:382
double rhosatL(double)
Definition: Oxygen.cpp:439
std::string EOSReference
The critical qd parameter for the Olchowy-Sengers cross-over term.
Definition: FluidClass.h:157
std::string SURFACE_TENSION
Definition: FluidClass.h:126
double specific_heat_v_Trho(double T, double rho)
Definition: FluidClass.cpp:480
double X_tilde(double T, double tau, double delta)
Definition: Oxygen.cpp:311
double pmax
Definition: FluidClass.h:54
params
virtual double d2phir_dDelta2(double tau, double delta)
Definition: FluidClass.cpp:276
virtual double conductivity_Trho(double, double)
Definition: Oxygen.cpp:321
double surface_tension_T(double T)
Definition: Oxygen.cpp:452
struct CriticalStruct crit
Definition: FluidClass.h:218
BibTeXKeysStruct BibTeXKeys
Definition: FluidClass.h:175
double psat(double)
Definition: Oxygen.cpp:413
Term in the ideal-gas specific heat equation that is polynomial term.
Definition: Helmholtz.h:881
std::vector< phi_BC * > phi0list
A vector of instances of the phi_BC classes for the residual Helmholtz energy contribution.
Definition: FluidClass.h:179
double specific_heat_p_Trho(double T, double rho)
Definition: FluidClass.cpp:487
This is the abstract base class upon which each residual Helmholtz energy class is built...
Definition: Helmholtz.h:24
Term in the ideal-gas specific heat equation that is constant.
Definition: Helmholtz.h:792
virtual double dphir_dDelta(double tau, double delta)
Definition: FluidClass.cpp:257
double Tmin
Definition: FluidClass.h:54
double rhomax
Definition: FluidClass.h:54
double rhosatV(double)
Definition: Oxygen.cpp:426
std::string CONDUCTIVITY
Definition: FluidClass.h:123