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
Nitrogen.cpp
Go to the documentation of this file.
1 /* Properties of Nitrogen
2 by Ian Bell
3 
4 Thermo properties from
5 ---------------------
6 "A Reference Equation of State for the Thermodynamic Properties
7 of Nitrogen for Temperatures from 63.151 to 1000 K
8 and Pressures to 2200 MPa",
9 R. Span and E.W. Lemmon and R.T. Jacobsen and W. Wagner and A. Yokozeki,
10 J. Phys. Chem. Ref. Data, v. 29, n. 6, 2000
11 
12 Transport properties from
13 ------------------------
14 "Viscosity and Thermal Conductivity Equations for
15 Nitrogen, Oxygen, Argon, and Air"
16 E. W. Lemmon and R. T Jacobsen
17 International Journal of Thermophysics, Vol. 25, No. 1, January 2004
18 
19 Note: Critical enhancement included
20 
21 */
22 
23 #if defined(_MSC_VER)
24 #define _CRTDBG_MAP_ALLOC
25 #define _CRT_SECURE_NO_WARNINGS
26 #include <stdlib.h>
27 #include <crtdbg.h>
28 #else
29 #include <stdlib.h>
30 #endif
31 
32 #include "math.h"
33 #include "stdio.h"
34 #include <string.h>
35 #include "CoolProp.h"
36 #include "FluidClass.h"
37 #include "Nitrogen.h"
38 
39 
40 
41 
43 {
44 
45  static const double n[]={0,
46  0.924803575275,//[1]
47  -0.492448489428,//[2]
48  0.661883336938,//[3]
49  -1.92902649201,//[4]
50  -0.0622469309629,//[5]
51  0.349943957581,//[6]
52  0.564857472498,//[7]
53  -1.61720005987,//[8]
54  -0.481395031883,//[9]
55  0.421150636384,//[10]
56  -0.0161962230825,//[11]
57  0.172100994165,//[12]
58  0.00735448924933,//[13]
59  0.0168077305479,//[14]
60  -0.00107626664179,//[15]
61  -0.0137318088513,//[16]
62  0.000635466899859,//[17]
63  0.00304432279419,//[18]
64  -0.0435762336045,//[19]
65  -0.0723174889316,//[20]
66  0.0389644315272,//[21]
67  -0.021220136391,//[22]
68  0.00408822981509,//[23]
69  -0.0000551990017984,//[24]
70  -0.0462016716479,//[25]
71  -0.00300311716011,//[26]
72  0.0368825891208,//[27]
73  -0.0025585684622,//[28]
74  0.00896915264558,//[29]
75  -0.0044151337035,//[30]
76  0.00133722924858,//[31]
77  0.000264832491957,//[32]
78  19.6688194015,//[33]
79  -20.911560073,//[34]
80  0.0167788306989,//[35]
81  2627.67566274//[36]
82  };
83 
84  // d used for consistency with CO2 correlation (corresponds to i from Span)
85  static const double d[]={0,
86  1,//[1]
87  1,//[2]
88  2,//[3]
89  2,//[4]
90  3,//[5]
91  3,//[6]
92  1,//[7]
93  1,//[8]
94  1,//[9]
95  3,//[10]
96  3,//[11]
97  4,//[12]
98  6,//[13]
99  6,//[14]
100  7,//[15]
101  7,//[16]
102  8,//[17]
103  8,//[18]
104  1,//[19]
105  2,//[20]
106  3,//[21]
107  4,//[22]
108  5,//[23]
109  8,//[24]
110  4,//[25]
111  5,//[26]
112  5,//[27]
113  8,//[28]
114  3,//[29]
115  5,//[30]
116  6,//[31]
117  9,//[32]
118  1,//[33]
119  1,//[34]
120  3,//[35]
121  2//[36]
122  };
123 
124  // t used for consistency with CO2 correlation (corresponds to j from Span)
125  static const double t[]={0.00,
126  0.25,//[1]
127  0.875,//[2]
128  0.5,//[3]
129  0.875,//[4]
130  0.375,//[5]
131  0.75,//[6]
132  0.5,//[7]
133  0.75,//[8]
134  2,//[9]
135  1.25,//[10]
136  3.5,//[11]
137  1,//[12]
138  0.5,//[13]
139  3,//[14]
140  0,//[15]
141  2.75,//[16]
142  0.75,//[17]
143  2.5,//[18]
144  4,//[19]
145  6,//[20]
146  6,//[21]
147  3,//[22]
148  3,//[23]
149  6,//[24]
150  16,//[25]
151  11,//[26]
152  15,//[27]
153  12,//[28]
154  12,//[29]
155  7,//[30]
156  4,//[31]
157  16,//[32]
158  0,//[33]
159  1,//[34]
160  2,//[35]
161  3//[36]
162  };
163 
164  // c used for consistency with CO2 correlation (corresponds to l from Span)
165  static const double c[]={0,
166  0,//[1]
167  0,//[2]
168  0,//[3]
169  0,//[4]
170  0,//[5]
171  0,//[6]
172  1,//[7]
173  1,//[8]
174  1,//[9]
175  1,//[10]
176  1,//[11]
177  1,//[12]
178  1,//[13]
179  1,//[14]
180  1,//[15]
181  1,//[16]
182  1,//[17]
183  1,//[18]
184  2,//[19]
185  2,//[20]
186  2,//[21]
187  2,//[22]
188  2,//[23]
189  2,//[24]
190  3,//[25]
191  3,//[26]
192  3,//[27]
193  3,//[28]
194  4,//[29]
195  4,//[30]
196  4,//[31]
197  4,//[32]
198  2,//[33]
199  2,//[34]
200  2,//[35]
201  2//[36]
202  };
203 
204  // alpha is used here for consistency with the definitions in R744.c upon which Nitrogen.c is based
205  // is phi_k from Span
206  static const double alpha[]={
207  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // indices [0-32]
208  20,
209  20,
210  15,
211  25
212  };
213 
214  static const double beta[]={
215  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // indices [0-32]
216  325,
217  325,
218  300,
219  275
220  };
221 
222  // epsilon is used here for consistency with the definitions in R744.c upon which Nitrogen.c is based
223  // is the value unity in Span
224  static const double epsilon[]={
225  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // indices [0-32]
226  1,
227  1,
228  1,
229  1
230  };
231 
232 
233  // GAMMA is used here for consistency with the definitions in R744.c upon which Nitrogen.c is based
234  static const double GAMMA[]={
235  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // indices [0-32]
236  1.16,
237  1.16,
238  1.13,
239  1.25
240  };
241 
242  //Constants for ideal gas expression
243  static const double a0[]={0.0,
244  2.5,
245  -12.76952708,
246  -0.00784163,
247  -1.934819e-4,
248  -1.247742e-5,
249  6.678326e-8,
250  1.012941,
251  26.65788
252  };
253 
254 
255  phirlist.push_back(new phir_power(n,d,t,c,1,32,33));
256  phirlist.push_back(new phir_gaussian(n,d,t,alpha,epsilon,beta,GAMMA,33,36,37));
257 
258  // phi0=log(delta)+a0[1]*log(tau)+a0[2]+a0[3]*tau+a0[4]/tau+a0[5]/tau/tau+a0[6]/tau/tau/tau+a0[7]*log(1-exp(-a0[8]*tau));
259  std::vector<double> a0_v(a0,a0+sizeof(a0)/sizeof(double));
260  std::vector<double> n0_v(sizeof(a0)/sizeof(double),0);
261  n0_v[4]=-1.0;
262  n0_v[5]=-2.0;
263  n0_v[6]=-3.0;
264  n0_v[7]=a0[8];
265  phi_BC * phi0_lead_ = new phi0_lead(a0[2],a0[3]);
266  phi_BC * phi0_logtau_ = new phi0_logtau(a0[1]);
267  phi_BC * phi0_power_ = new phi0_power(a0_v,n0_v,4,6);
268  phi_BC * phi0_Planck_Einstein_ = new phi0_Planck_Einstein(a0_v,n0_v,7,7);
269 
270  phi0list.push_back(phi0_lead_);
271  phi0list.push_back(phi0_logtau_);
272  phi0list.push_back(phi0_power_);
273  phi0list.push_back(phi0_Planck_Einstein_);
274 
275  // Critical parameters
276  crit.rho = 313.3;
277  crit.p = PressureUnit(3395.8, UNIT_KPA);
278  crit.T = 126.192;
279  crit.v = 1.0/crit.rho;
280 
281  // Other fluid parameters
282  params.molemass = 28.01348;
283  params.Ttriple = 63.151;
284  params.ptriple = 12.5220865181;
285  params.accentricfactor = 0.0372 ;
286  params.R_u = 8.31451;
287 
288  // Limits of EOS
289  limits.Tmin = 63.151;
290  limits.Tmax = 2000.0;
291  limits.pmax = 2200000.0;
292  limits.rhomax = 53.15*params.molemass;
293 
294  EOSReference.assign("\"A Reference Equation of State for the Thermodynamic Properties"
295  "of Nitrogen for Temperatures from 63.151 to 1000 K "
296  "and Pressures to 2200 MPa\", "
297  "R. Span and E.W. Lemmon and R.T. Jacobsen and W. Wagner and A. Yokozeki, "
298  "J. Phys. Chem. Ref. Data, v. 29, n. 6, 2000");
299  TransportReference.assign("\"Viscosity and Thermal Conductivity Equations for"
300  "Nitrogen, Oxygen, Argon, and Air\""
301  "E. W. Lemmon and R. T Jacobsen"
302  "International Journal of Thermophysics, Vol. 25, No. 1, January 2004");
303 
304  name.assign("Nitrogen");
305  aliases.push_back("nitrogen");
306  aliases.push_back(std::string("NITROGEN"));
307  aliases.push_back("N2");
308 
309  BibTeXKeys.EOS = "Span-JPCRD-2000";
310  BibTeXKeys.VISCOSITY = "Lemmon-IJT-2004";
311  BibTeXKeys.CONDUCTIVITY = "Lemmon-IJT-2004";
312  BibTeXKeys.SURFACE_TENSION = "Mulero-JPCRD-2012";
313  BibTeXKeys.ECS_LENNARD_JONES = "Poling-BOOK-2001";
314 }
315 
316 double NitrogenClass::X_tilde(double T,double tau,double delta)
317 {
318  // X_tilde is dimensionless
319  // Equation 11 slightly rewritten
320  double drho_dp,R_Nitrogen;
321  R_Nitrogen=params.R_u/params.molemass;
322  drho_dp=1.0/(R_Nitrogen*T*(1+2*delta*dphir_dDelta(tau,delta)+delta*delta*d2phir_dDelta2(tau,delta)));
323  return reduce.p.Pa*delta/reduce.rho*drho_dp;
324 }
325 
327 {
328  double e_k=98.94, //[K]
329  sigma=0.3656, //[nm]
330  Tstar, OMEGA, eta0, lambda0, tau;
331 
332  double b[]={0.431,-0.4623,0.08406,0.005341,-0.00331};
333 
334  double N[]={0,1.511,2.117,-3.332,8.862,31.11,-73.13,20.03,-0.7096,0.2672};
335  double t[]={0,0,-1.0,-0.7,0.0,0.03,0.2,0.8,0.6,1.9};
336 
337  tau=reduce.T/T;
338  Tstar=T/(e_k);
339 
340  OMEGA=exp(b[0]*powInt(log(Tstar),0)
341  +b[1]*powInt(log(Tstar),1)
342  +b[2]*powInt(log(Tstar),2)
343  +b[3]*powInt(log(Tstar),3)
344  +b[4]*powInt(log(Tstar),4));
345 
346  eta0=0.0266958*sqrt(params.molemass*T)/(sigma*sigma*OMEGA);
347  lambda0=N[1]*eta0+N[2]*pow(tau,t[2])+N[3]*pow(tau,t[3]);
348  return lambda0/1e3; //[W/m/K]
349 }
350 double NitrogenClass::conductivity_background(double T, double rho)
351 {
352  double tau, delta, lambdar;
353  double N[]={0,1.511,2.117,-3.332,8.862,31.11,-73.13,20.03,-0.7096,0.2672};
354  double t[]={0,0,-1.0,-0.7,0.0,0.03,0.2,0.8,0.6,1.9};
355  double d[]={0,0,0,0,1,2,3,4,8,10};
356  double l[]={0,0,0,0,0,0,1,2,2,2};
357  double g[]={0,0,0,0,0,0,1,1,1,1};
358 
359  delta=rho/reduce.rho;
360  tau=reduce.T/T;
361 
362  lambdar=N[4]*pow(tau,t[4])*pow(delta,d[4])*exp(-g[4]*pow(delta,l[4]))
363  +N[5]*pow(tau,t[5])*pow(delta,d[5])*exp(-g[5]*pow(delta,l[5]))
364  +N[6]*pow(tau,t[6])*pow(delta,d[6])*exp(-g[6]*pow(delta,l[6]))
365  +N[7]*pow(tau,t[7])*pow(delta,d[7])*exp(-g[7]*pow(delta,l[7]))
366  +N[8]*pow(tau,t[8])*pow(delta,d[8])*exp(-g[8]*pow(delta,l[8]))
367  +N[9]*pow(tau,t[9])*pow(delta,d[9])*exp(-g[9]*pow(delta,l[9]));
368  return lambdar/1e3; // [W/m/K]
369 }
370 
371 double NitrogenClass::conductivity_critical(double T, double rho)
372 {
373  double num,delta,
374  cp,cv,OMEGA_tilde,OMEGA_tilde0,zeta,nu,gamma,R0,lambdac,k,
375  pi=3.141592654,mu,
376  Tref=252.384, //[K]
377  zeta0=0.17, //[nm]
378  LAMBDA=0.055,
379  q_D=0.40; //[nm];
380 
381  R0=1.01;
382  nu=0.63;
383  gamma=1.2415;
384  k=1.380658e-23; //[J/K]
385 
386  delta=rho/reduce.rho;
387 
388  num=X_tilde(T,reduce.T/T,delta)-X_tilde(Tref,reduce.T/Tref,delta)*Tref/T;
389 
390  // no critical enhancement if numerator of Eq. 10 is negative
391  if (num<0)
392  return 0;
393 
394  cp = specific_heat_p_Trho(T,rho); //[J/kg/K]
395  cv = specific_heat_v_Trho(T,rho); //[J/kg/K]
396  mu = viscosity_Trho(T,rho)*1e6; //[uPa-s]
397 
398  zeta = zeta0*pow(num/LAMBDA,nu/gamma); //[nm]
399  OMEGA_tilde = 2.0/pi*((cp-cv)/cp*atan(zeta/q_D)+cv/cp*(zeta/q_D));
400  OMEGA_tilde0 = 2.0/pi*(1.-exp(-1./(q_D/zeta+1.0/3.0*(zeta/q_D)*(zeta/q_D)/delta/delta)));
401  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)
402 
403  return lambdac/1e3; //[W/m/K]
404 }
405 double NitrogenClass::conductivity_Trho(double T, double rho)
406 {
407  // Each term in kW/m/K
409 }
411 {
412  double e_k=98.94, //[K]
413  sigma=0.3656; //[nm]
414  double eta0,OMEGA,Tstar;
415  double b[]={0.431,-0.4623,0.08406,0.005341,-0.00331};
416 
417  Tstar=T/(e_k);
418  OMEGA=exp(b[0]*powInt(log(Tstar),0)
419  +b[1]*powInt(log(Tstar),1)
420  +b[2]*powInt(log(Tstar),2)
421  +b[3]*powInt(log(Tstar),3)
422  +b[4]*powInt(log(Tstar),4));
423 
424  eta0=0.0266958*sqrt(params.molemass*T)/(sigma*sigma*OMEGA); //[Pa-s]
425  return eta0/1e6; //[Pa-s]
426 }
427 double NitrogenClass::viscosity_residual(double T, double rho)
428 {
429  return viscosity_background(T,rho);
430 }
431 double NitrogenClass::viscosity_background(double T, double rho)
432 {
433  double etar, tau, delta;
434  delta=rho/reduce.rho;
435  tau=reduce.T/T;
436  double N[]={0,10.72,0.03989,0.001208,-7.402,4.620};
437  double g[]={0,0,1,1,1,1};
438  double t[]={0,0.1,0.25,3.2,0.9,0.3};
439  double d[]={0,2,10,12,2,1};
440  double l[]={0,0,1,1,2,3};
441 
442  etar=N[1]*pow(tau,t[1])*pow(delta,d[1])*exp(-g[1]*pow(delta,l[1]))
443  +N[2]*pow(tau,t[2])*pow(delta,d[2])*exp(-g[2]*pow(delta,l[2]))
444  +N[3]*pow(tau,t[3])*pow(delta,d[3])*exp(-g[3]*pow(delta,l[3]))
445  +N[4]*pow(tau,t[4])*pow(delta,d[4])*exp(-g[4]*pow(delta,l[4]))
446  +N[5]*pow(tau,t[5])*pow(delta,d[5])*exp(-g[5]*pow(delta,l[5]));
447 
448  return etar/1e6; // uPa-s to Pa-s
449 }
450 double NitrogenClass::viscosity_Trho(double T, double rho)
451 {
452  return this->viscosity_dilute(T)+this->viscosity_background(T, rho);
453 }
454 double NitrogenClass::psat(double T)
455 {
456  const double ti[]={0,1.0,1.5,2.5,5.0};
457  const double Ni[]={0,-6.12445284,1.26327220,-0.765910082,-1.77570564};
458  double summer=0;
459  int i;
460  for (i=1;i<=4;i++)
461  {
462  summer=summer+Ni[i]*pow(1-T/reduce.T,ti[i]);
463  }
464  return reduce.p.Pa*exp(reduce.T/T*summer);
465 }
466 double NitrogenClass::rhosatL(double T)
467 {
468  const double ti[]={0,0.3294,2.0/3.0,8.0/3.0,35.0/6.0};
469  const double Ni[]={0,1.48654237,-0.280476066,0.0894143085,-0.119879866};
470  double summer=0;
471  int i;
472  for (i=1;i<=4;i++)
473  {
474  summer=summer+Ni[i]*pow(1.0-T/reduce.T,ti[i]);
475  }
476  return reduce.rho*exp(summer);
477 }
478 double NitrogenClass::rhosatV(double T)
479 {
480  const double ti[]={0,0.34,5.0/6.0,7.0/6.0,13.0/6.0,14.0/3.0};
481  const double Ni[]={0,-1.70127164,-3.70402649,1.29859383,-0.561424977,-2.68505381};
482  double summer=0;
483  int i;
484  for (i=1;i<=5;i++)
485  {
486  summer=summer+Ni[i]*pow(1.0-T/reduce.T,ti[i]);
487  }
488  return reduce.rho*exp(reduce.T/T*summer);
489 }
491 {
492  // From Mulero, 2012, JPCRD
493  return 0.02898*pow(1-T/reduce.T,1.246);
494 }
double rhosatL(double)
Definition: Nitrogen.cpp:466
double surface_tension_T(double T)
Definition: Nitrogen.cpp:490
std::vector< phi_BC * > phirlist
Definition: FluidClass.h:178
virtual double viscosity_Trho(double, double)
Definition: Nitrogen.cpp:450
struct FluidLimits limits
Definition: FluidClass.h:219
std::string EOS
Definition: FluidClass.h:120
std::string VISCOSITY
Definition: FluidClass.h:122
double X_tilde(double T, double tau, double delta)
Definition: Nitrogen.cpp:316
PressureUnit p
Definition: FluidClass.h:50
double conductivity_critical(double T, double rho)
Definition: Nitrogen.cpp:371
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
double viscosity_dilute(double T)
Definition: Nitrogen.cpp:410
double viscosity_background(double T, double rho)
Definition: Nitrogen.cpp:431
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 psat(double)
Definition: Nitrogen.cpp:454
double powInt(double x, int y)
double rhosatV(double)
Definition: Nitrogen.cpp:478
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 conductivity_Trho(double, double)
Definition: Nitrogen.cpp:405
double conductivity_dilute(double T)
Definition: Nitrogen.cpp:326
std::string EOSReference
The critical qd parameter for the Olchowy-Sengers cross-over term.
Definition: FluidClass.h:157
std::string ECS_LENNARD_JONES
Definition: FluidClass.h:124
std::string SURFACE_TENSION
Definition: FluidClass.h:126
double conductivity_background(double T, double rho)
Definition: Nitrogen.cpp:350
double specific_heat_v_Trho(double T, double rho)
Definition: FluidClass.cpp:480
double pmax
Definition: FluidClass.h:54
params
virtual double d2phir_dDelta2(double tau, double delta)
Definition: FluidClass.cpp:276
struct CriticalStruct crit
Definition: FluidClass.h:218
BibTeXKeysStruct BibTeXKeys
Definition: FluidClass.h:175
double viscosity_residual(double T, double rho)
Definition: Nitrogen.cpp:427
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
virtual double dphir_dDelta(double tau, double delta)
Definition: FluidClass.cpp:257
double Tmin
Definition: FluidClass.h:54
double rhomax
Definition: FluidClass.h:54
std::string CONDUCTIVITY
Definition: FluidClass.h:123