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
R744.cpp
Go to the documentation of this file.
1 /* Properties of Carbon Dioxide (R744)
2 by Ian Bell
3 
4 Themo properties from
5 "A New Equation of State for Carbon Dioxide Covering the Fluid Region from the
6 Triple Point Temperature to 1100 K at Pressures up to 800 MPa",
7 R. Span and W. Wagner, J. Phys. Chem. Ref. Data, v. 25, 1996
8 
9 */
10 
11 #if defined(_MSC_VER)
12 #define _CRTDBG_MAP_ALLOC
13 #define _CRT_SECURE_NO_WARNINGS
14 #define _USE_MATH_DEFINES
15 #include <stdlib.h>
16 #include <crtdbg.h>
17 #else
18 #include <stdlib.h>
19 #endif
20 
21 #include "math.h"
22 #include "stdio.h"
23 #include <string.h>
24 #include "CoolProp.h"
25 #include <vector>
26 #include "FluidClass.h"
27 #include "R744.h"
28 
30 {
31 
32  static double alpha[40],beta[43],GAMMA[40],epsilon[40],a[43],b[43],A[43],B[43],C[43],D[43],a0[9],theta0[9];
33  static double n[]={0,
34  0.388568232032E+00,
35  0.293854759427E+01,
36  -0.558671885350E+01,
37  -0.767531995925E+00,
38  0.317290055804E+00,
39  0.548033158978E+00,
40  0.122794112203E+00,
41 
42  0.216589615432E+01,
43  0.158417351097E+01,
44  -0.231327054055E+00,
45  0.581169164314E-01,
46  -0.553691372054E-00,
47  0.489466159094E-00,
48  -0.242757398435E-01,
49  0.624947905017E-01,
50  -0.121758602252E+00,
51  -0.370556852701E+00,
52  -0.167758797004E-01,
53  -0.119607366380E+00,
54  -0.456193625088E-01,
55  0.356127892703E-01,
56  -0.744277271321E-02,
57  -0.173957049024E-02,
58  -0.218101212895E-01,
59  0.243321665592E-01,
60  -0.374401334235E-01,
61  0.143387157569E-00,
62  -0.134919690833E-00,
63  -0.231512250535E-01,
64  0.123631254929E-01,
65  0.210583219729E-02,
66  -0.339585190264E-03,
67  0.559936517716E-02,
68  -0.303351180556E-03,
69 
70  -0.213654886883E+03,
71  0.266415691493E+05,
72  -0.240272122046E+05,
73  -0.283416034240E+03,
74  0.212472844002E+03,
75 
76  -0.666422765408E+00,
77  0.726086323499E+00,
78  0.550686686128E-01};
79 
80  static double d[]={0,
81  1,
82  1,
83  1,
84  1,
85  2,
86  2,
87  3,
88  1,
89  2,
90  4,
91  5,
92  5,
93  5,
94  6,
95  6,
96  6,
97  1,
98  1,
99  4,
100  4,
101  4,
102  7,
103  8,
104  2,
105  3,
106  3,
107  5,
108  5,
109  6,
110  7,
111  8,
112  10,
113  4,
114  8,
115  2,
116  2,
117  2,
118  3,
119  3};
120 
121  static double t[]={0.00,
122  0.00,
123  0.75,
124  1.00,
125  2.00,
126  0.75,
127  2.00,
128  0.75,
129  1.50,
130  1.50,
131  2.50,
132  0.00,
133  1.50,
134  2.00,
135  0.00,
136  1.00,
137  2.00,
138  3.00,
139  6.00,
140  3.00,
141  6.00,
142  8.00,
143  6.00,
144  0.00,
145  7.00,
146  12.00,
147  16.00,
148  22.00,
149  24.00,
150  16.00,
151  24.00,
152  8.00,
153  2.00,
154  28.00,
155  14.00,
156  1.00,
157  0.00,
158  1.00,
159  3.00,
160  3.00};
161 
162  static double c[]={0,0,0,0,0,0,0,0,
163  1,
164  1,
165  1,
166  1,
167  1,
168  1,
169  1,
170  1,
171  1,
172  2,
173  2,
174  2,
175  2,
176  2,
177  2,
178  2,
179  3,
180  3,
181  3,
182  4,
183  4,
184  4,
185  4,
186  4,
187  4,
188  5,
189  6};
190 
191  alpha[35]=25.0;
192  alpha[36]=25.0;
193  alpha[37]=25.0;
194  alpha[38]=15.0;
195  alpha[39]=20.0;
196 
197  beta[35]=325.0;
198  beta[36]=300.0;
199  beta[37]=300.0;
200  beta[38]=275.0;
201  beta[39]=275.0;
202 
203  GAMMA[35]=1.16;
204  GAMMA[36]=1.19;
205  GAMMA[37]=1.19;
206  GAMMA[38]=1.25;
207  GAMMA[39]=1.22;
208 
209  epsilon[35]=1.00;
210  epsilon[36]=1.00;
211  epsilon[37]=1.00;
212  epsilon[38]=1.00;
213  epsilon[39]=1.00;
214 
215  a[40]=3.5;
216  a[41]=3.5;
217  a[42]=3.0;
218 
219  b[40]=0.875;
220  b[41]=0.925;
221  b[42]=0.875;
222 
223  beta[40]=0.300;
224  beta[41]=0.300;
225  beta[42]=0.300;
226 
227  A[40]=0.700;
228  A[41]=0.700;
229  A[42]=0.700;
230 
231  B[40]=0.3;
232  B[41]=0.3;
233  B[42]=1.0;
234 
235  C[40]=10.0;
236  C[41]=10.0;
237  C[42]=12.5;
238 
239  D[40]=275.0;
240  D[41]=275.0;
241  D[42]=275.0;
242 
243  //Constants for ideal gas expression
244  a0[1]=8.37304456;
245  a0[2]=-3.70454304;
246  a0[3]=2.500000;
247  a0[4]=1.99427042;
248  a0[5]=0.62105248;
249  a0[6]=0.41195293;
250  a0[7]=1.04028922;
251  a0[8]=0.08327678;
252 
253  theta0[4]=3.15163;
254  theta0[5]=6.11190;
255  theta0[6]=6.77708;
256  theta0[7]=11.32384;
257  theta0[8]=27.08792;
258 
259  std::vector<double> a_v(a,a+sizeof(a)/sizeof(double));
260  std::vector<double> b_v(b,b+sizeof(b)/sizeof(double));
261  std::vector<double> A_v(A,A+sizeof(A)/sizeof(double));
262  std::vector<double> B_v(B,B+sizeof(B)/sizeof(double));
263  std::vector<double> C_v(C,C+sizeof(C)/sizeof(double));
264  std::vector<double> D_v(D,D+sizeof(D)/sizeof(double));
265 
266  phirlist.push_back(new phir_power(n,d,t,c,1,34,35));
267  phirlist.push_back(new phir_gaussian(n,d,t,alpha,epsilon,beta,GAMMA,35,39,40));
268  phirlist.push_back(new phir_critical(n,d,t,a,b,beta,A,B,C,D,40,42,43));
269 
270  std::vector<double> a0_v(a0,a0+sizeof(a0)/sizeof(double));
271  std::vector<double> theta0_v(theta0,theta0+sizeof(theta0)/sizeof(double));
272 
273  phi0list.push_back(new phi0_lead(a0[1],a0[2]));
274  phi0list.push_back(new phi0_logtau(a0[3]));
275  phi0list.push_back(new phi0_Planck_Einstein(a0,theta0,4,8,9));
276 
277  // Critical parameters
278  crit.rho = 44.0098*10.6249063;
279  crit.p = PressureUnit(7377.3, UNIT_KPA);
280  crit.T = 304.1282;
281  crit.v = 1.0/crit.rho;
282 
283  // Other fluid parameters
284  params.molemass = 44.0098;
285  params.Ttriple = 216.592;
286  params.ptriple = 517.996380545;
287  params.R_u = 8.31451;
288  params.accentricfactor = 0.22394;
289 
290  // Limit parameters
291  limits.Tmin = 216.592;
292  limits.Tmax = 2000.0;
293  limits.pmax = 800000.0;
294  limits.rhomax = 37.24 * params.molemass;
295 
296  EOSReference.assign("\"A New Equation of State for Carbon Dioxide Covering the Fluid Region from the "
297  "Triple Point Temperature to 1100 K at Pressures up to 800 MPa\", "
298  "R. Span and W. Wagner, J. Phys. Chem. Ref. Data, v. 25, 1996");
299 
300  TransportReference.assign("\"The Transport Properties of Carbon Dioxide\","
301  " V. Vesovic and W.A. Wakeham and G.A. Olchowy and "
302  "J.V. Sengers and J.T.R. Watson and J. Millat"
303  "J. Phys. Chem. Ref. Data, v. 19, 1990");
304 
305  name.assign("CarbonDioxide");
306  aliases.push_back("R744");
307  aliases.push_back("co2");
308  aliases.push_back("CO2");
309  aliases.push_back("carbondioxide");
310  aliases.push_back(std::string("CARBONDIOXIDE"));
311  REFPROPname.assign("CO2");
312 
313  // Adjust to the IIR reference state (h=200 kJ/kg, s = 1 kJ/kg for sat. liq at 0C)
314  params.HSReferenceState = "IIR";
315 
316  BibTeXKeys.EOS = "Span-JPCRD-1996";
317  BibTeXKeys.SURFACE_TENSION = "Mulero-JPCRD-2012";
318  BibTeXKeys.VISCOSITY = "Vesovic-JPCRD-1990";
319  BibTeXKeys.CONDUCTIVITY = "Vesovic-JPCRD-1990";
320 }
321 double R744Class::conductivity_Trho(double T, double rho)
322 {
323  double e_k=251.196,Tstar;
324  //double a[]={0.235156,-0.491266,5.211155e-2,5.347906e-2,-1.537102e-2};
325  double b[]={0.4226159,0.6280115,-0.5387661,0.6735941,0,0,-0.4362677,0.2255388};
326  double c[]={0,2.387869e-2,4.350794,-10.33404,7.981590,-1.940558};
327  double d[]={0,2.447164e-2,8.705605e-5,-6.547950e-8,6.594919e-11};
328  //double e[]={0,3.635074e-3,7.209997e-5, 0,0,0,0,3.00306e-20};
329 
330  //Vesovic Eq. 31 [no units]
331  double summer = 0;
332  for (int i=1; i<=5; i++)
333  summer += c[i]*pow(T/100.0, 2-i);
334  double cint_k = 1.0 + exp(-183.5/T)*summer;
335 
336  //Vesovic Eq. 12 [no units]
337  double r = sqrt(2.0/5.0*cint_k);
338 
339  Tstar=T/e_k;
340  //Vesovic Eq. 30 [no units]
341  summer = 0;
342  for (int i=0; i<=7; i++)
343  summer += b[i]/pow(Tstar, i);
344  double Gstar_lambda = summer;
345 
346  //Vesovic Eq. 29 [mW/m/K]
347  double lambda_0 = 0.475598*sqrt(T)*(1+r*r)/Gstar_lambda;
348 
349  //Vesovic Eq. 63 [mW/m/K]
350  summer = 0;
351  for (int i=1; i<=4; i++)
352  summer += d[i]*pow(rho, i);
353  double delta_lambda = summer;
354 
355  // Use the simplified cross-over critical enhancement term
356  double delta_c = conductivity_critical(T,rho,1/4e-10,0.052,1.50e-10)*1e3; //[mW/m/K]
357 
358  return (lambda_0+delta_lambda+delta_c)/1e3; //[W/m/K]
359 }
360 double R744Class::viscosity_Trho(double T, double rho)
361 {
362  int i;
363  double e_k=251.196,Tstar,sumGstar=0.0,Gstar,eta0;
364  double a[]={0.235156,-0.491266,5.211155e-2,5.347906e-2,-1.537102e-2};
365  double e[]={0,3.635074e-3,7.209997e-5, 0,0,0,0,3.00306e-20};
366 
367  //double d11=0.4071119e-2,d21=0.7198037e-4,d64=0.2411697e-16,d81=0.2971072e-22,d82=-0.1627888e-22;
368 
369  Tstar=T/e_k;
370  for (i=0;i<=4;i++)
371  {
372  sumGstar += a[i]*pow(log(Tstar),(int)i);
373  }
374  Gstar=exp(sumGstar);
375  eta0=1.00697*sqrt(T)/Gstar; //[mW/m/K]
376 
377  double summer=0;
378  for (i=1;i<=7;i++)
379  summer += e[i]*pow(rho,(int)i);
380  double delta_eta_g = summer; // [mW/m/K]
381 
382  // No critical enhancement in viscosity
383  //double delta_eta_c = 0.0;
384 
385  //double B = 18.56 + 0.014*T;
386  //double V0 = 7.41e-4 - 3.3e-7*T;
387  //double eta_l = delta_eta_c+1/(B*(1/rho-V0));
388 
389  return (eta0+delta_eta_g)/1e6;
390 }
391 double R744Class::psat(double T)
392 {
393  const double ti[]={0,1.0,1.5,2.0,4.0};
394  const double ai[]={0,-7.0602087,1.9391218,-1.6463597,-3.2995634};
395  double summer=0;
396  int i;
397  for (i=1;i<=4;i++)
398  {
399  summer=summer+ai[i]*pow(1-T/crit.T,ti[i]);
400  }
401  return crit.p.Pa*exp(crit.T/T*summer);
402 }
403 double R744Class::rhosatL(double T)
404 {
405  const double ti[]={0,0.340,1.0/2.0,10.0/6.0,11.0/6.0};
406  const double ai[]={0,1.9245108,-0.62385555,-0.32731127,0.39245142};
407  double summer=0;
408  int i;
409  for (i=1;i<=4;i++)
410  {
411  summer=summer+ai[i]*pow(1.0-T/crit.T,ti[i]);
412  }
413  return crit.rho*exp(summer);
414 }
415 double R744Class::rhosatV(double T)
416 {
417  const double ti[]={0,0.340,1.0/2.0,1.0,7.0/3.0,14.0/3.0};
418  const double ai[]={0,-1.7074879,-0.82274670,-4.6008549,-10.111178,-29.742252};
419  double summer=0;
420  int i;
421  for (i=1;i<=5;i++)
422  {
423  summer=summer+ai[i]*pow(1.0-T/crit.T,ti[i]);
424  }
425  return crit.rho*exp(summer);
426 }
double conductivity_Trho(double, double)
Definition: R744.cpp:321
double viscosity_Trho(double, double)
Definition: R744.cpp:360
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
double psat(double)
Definition: R744.cpp:391
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
double conductivity_critical(double T, double rho, double qd=2e9, double GAMMA=0.0496, double zeta0=1.94e-10)
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 Tmax
Definition: FluidClass.h:54
R744Class()
Definition: R744.cpp:29
std::string EOSReference
The critical qd parameter for the Olchowy-Sengers cross-over term.
Definition: FluidClass.h:157
std::string REFPROPname
The name of the fluid.
Definition: FluidClass.h:152
std::string SURFACE_TENSION
Definition: FluidClass.h:126
double rhosatL(double)
Definition: R744.cpp:403
double pmax
Definition: FluidClass.h:54
params
struct CriticalStruct crit
Definition: FluidClass.h:218
BibTeXKeysStruct BibTeXKeys
Definition: FluidClass.h:175
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 rhosatV(double)
Definition: R744.cpp:415
double Tmin
Definition: FluidClass.h:54
double rhomax
Definition: FluidClass.h:54
std::string CONDUCTIVITY
Definition: FluidClass.h:123