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
R290.cpp
Go to the documentation of this file.
1 /*
2 Properties of Propane (R290)
3 by Ian Bell
4 */
5 
6 #define _CRT_SECURE_NO_WARNINGS
7 #include <stdlib.h>
8 #include "math.h"
9 #include "stdio.h"
10 #include <string.h>
11 #include "CoolProp.h"
12 #include "FluidClass.h"
13 #include "R290.h"
14 
15 
16 //
18 //static const double tv[]={
19 // 0.0, //[0]
20 // 0.0, //[1]
21 // 0.0, //[2]
22 // 0.0, //[3]
23 // 0.0, //[4]
24 // 1.0, //[5]
25 // 1.0, //[6]
26 // 2.0, //[7]
27 // 2.0, //[8]
28 // 2.0, //[9]
29 // 3.0, //[10]
30 // 4.0, //[11]
31 // 1.0, //[12]
32 // 2.0 //[13]
33 //};
34 //
35 //static const double dv[]={
36 // 0.0, //[0]
37 // 1.0, //[1]
38 // 2.0, //[2]
39 // 3.0, //[3]
40 // 13.0, //[4]
41 // 12.0, //[5]
42 // 16.0, //[6]
43 // 0.0, //[7]
44 // 18.0, //[8]
45 // 20.0, //[9]
46 // 13.0, //[10]
47 // 4.0, //[11]
48 // 0.0, //[12]
49 // 1.0 //[13]
50 //};
51 //
52 //static const double nv[]={
53 // 0.0, //[0]
54 // -0.7548580e-1, //[1]
55 // 0.7607150, //[2]
56 // -0.1665680, //[3]
57 // 0.1627612e-5, //[4]
58 // 0.1443764e-4, //[5]
59 // -0.2759086e-6, //[6]
60 // -0.1032756, //[7]
61 // -0.2498159e-7, //[8]
62 // 0.4069891e-8, //[9]
63 // -0.1513434e-5, //[10]
64 // 0.2591327e-2, //[11]
65 // 0.5650076, //[12]
66 // 0.1207253 //[13]
67 //};
68 
70 {
71 
72  static const double n[]={0,
73  0.042910051,
74  1.7313671,
75  -2.4516524,
76  0.34157466,
77  -0.46047898,
78  -0.66847295,
79  0.20889705,
80  0.19421381,
81  -0.22917851,
82  -0.60405866,
83  0.066680654,
84  0.017534618,
85  0.33874242,
86  0.22228777,
87  -0.23219062,
88  -0.09220694,
89  -0.47575718,
90  -0.017486824};
91 
92  static const double d[]={0,
93  4, //[ 1]
94  1, //[ 2]
95  1, //[ 3]
96  2, //[ 4]
97  2, //[ 5]
98  1, //[ 6]
99  3, //[ 7]
100  6, //[ 8]
101  6, //[ 9]
102  2, //[10]
103  3, //[11]
104  1, //[12]
105  1, //[13]
106  1, //[14]
107  2, //[15]
108  2, //[16]
109  4, //[17]
110  1 //[18]
111  };
112 
113  static const double t[]={0.00, //offset for natural indices
114  1.00,
115  0.33,
116  0.80,
117  0.43,
118  0.90,
119  2.46,
120  2.09,
121  0.88,
122  1.09,
123  3.25,
124  4.62,
125  0.76,
126  2.50,
127  2.75,
128  3.05,
129  2.55,
130  8.40,
131  6.75};
132 
133  static const double c[]={
134  0,0,0,0,0,0, // indices [0-5]
135  1,
136  1,
137  1,
138  1,
139  2,
140  2,
141  0,0,0,0,0,0,0 // indices [12-18]
142  };
143 
144  // alpha instead of eta is used here for consistency with the definitions in R744.c upon which R290.c is based
145  static const double alpha[]={
146  0,0,0,0,0,0,0,0,0,0,0,0, // indices [0-11]
147  0.963,
148  1.977,
149  1.917,
150  2.307,
151  2.546,
152  3.28,
153  14.6};
154 
155  static const double beta[]={
156  0,0,0,0,0,0,0,0,0,0,0,0, // indices [0-11]
157  2.33,
158  3.47,
159  3.15,
160  3.19,
161  0.92,
162  18.8,
163  547.8};
164 
165  static const double GAMMA[]={
166  0,0,0,0,0,0,0,0,0,0,0,0, // indices [0-11]
167  0.684,
168  0.829,
169  1.419,
170  0.817,
171  1.5,
172  1.426,
173  1.093};
174 
175  static const double epsilon[]={
176  0,0,0,0,0,0,0,0,0,0,0,0, // indices [0-11]
177  1.283,
178  0.6936,
179  0.788,
180  0.473,
181  0.8577,
182  0.271,
183  0.948};
184 
185  //Constants for ideal gas expression
186  static const double a0[]={0.0,
187  -4.970583,
188  4.29352,
189  3.043,
190  5.874,
191  9.337,
192  7.922
193  };
194 
195  static const double b0[]={0.0,
196  0,0, //[1 and 2 are not used]
197  1.062478,
198  3.344237,
199  5.363757,
200  11.762957
201  };
202 
203  std::vector<double> a0_v(a0,a0+sizeof(a0)/sizeof(double));
204  std::vector<double> b0_v(b0,b0+sizeof(b0)/sizeof(double));
205 
206  phirlist.push_back(new phir_power(n,d,t,c,1,11,12));
207  phirlist.push_back(new phir_gaussian(n,d,t,alpha,epsilon,beta,GAMMA,12,18,19));
208 
209  /* phi0=log(delta)+3*log(tau)+a0[1]+a0[2]*tau
210  +a0[3]*log(1-exp(-b0[3]*tau))
211  +a0[4]*log(1-exp(-b0[4]*tau))
212  +a0[5]*log(1-exp(-b0[5]*tau))
213  +a0[6]*log(1-exp(-b0[6]*tau));
214  */
215 
216  phi0list.push_back(new phi0_lead(a0[1],a0[2]));
217  phi0list.push_back(new phi0_logtau(3.0));
218  phi0list.push_back(new phi0_Planck_Einstein(a0_v,b0_v,3,6));
219 
220  // Critical parameters
221  crit.rho = 220.4781;
222  crit.p = PressureUnit(4251.2, UNIT_KPA);
223  crit.T = 369.89;
224  crit.v = 1.0/crit.rho;
225 
226  // Other fluid parameters
227  params.molemass = 44.09562;
228  params.Ttriple = 85.525;
229  params.ptriple = 1.71314090116e-07;
230  params.accentricfactor = 0.1521;
231  params.R_u = 8.314472;
232 
233  // Limits of EOS
234  limits.Tmin = 85.525;
235  limits.Tmax = 625.0;
236  limits.pmax = 1000000.0;
237  limits.rhomax = 20.6*params.molemass;
238 
239  EOSReference.assign("Lemmon, E.W., McLinden, M.O., Wagner, W., "
240  "\"Thermodynamic Properties of Propane. III. A Reference Equation of State"
241  "for Temperatures from the Melting Line to 650 K and Pressures up to 1000 MPa,\""
242  "J. Chem. Eng. Data, 54:3141-3180, 2009");
243  TransportReference.assign("Viscosity: E. Vogel, C. Kuchenmeister, and E. Bich, A. Laesecke,"
244  "\"Reference Correlation of the Viscosity of Propane\""
245  "J. Phys. Chem. Ref. Data, Vol. 27, No. 5, 1998\n\n"
246  "Conductivity: Kenneth N. Marsh, Richard A. Perkins, and Maria L. V. Ramires "
247  "\"Measurement and Correlation of the Thermal Conductivity of"
248  "Propane from 86 K to 600 K at Pressures to 70 MPa\","
249  "J. Chem. Eng. Data 2002, 47, 932-940 (Olchowy-Sengers)\n\n"
250  "Surface Tension: A. Mulero and I. Cachadi�a and M. I. Parra"
251  "\"Recommended Correlations for the Surface Tension of Common Fluids\""
252  ", J. Phys. Chem. Ref. Data, Vol. 41, No. 4, 2012");
253 
254  name.assign("n-Propane");
255  aliases.push_back("Propane");
256  aliases.push_back("propane");
257  aliases.push_back("R290");
258  aliases.push_back("C3H8");
259  aliases.push_back(std::string("PROPANE"));
260  aliases.push_back(std::string("N-PROPANE"));
261  REFPROPname.assign("PROPANE");
262 
263  BibTeXKeys.EOS = "Lemmon-JCED-2009";
264  BibTeXKeys.VISCOSITY = "Vogel-JPCRD-1998";
265  BibTeXKeys.CONDUCTIVITY = "Marsh-JCED-2002";
266  BibTeXKeys.SURFACE_TENSION = "Mulero-JPCRD-2012";
267  BibTeXKeys.ECS_LENNARD_JONES = "Chichester-NIST-2008";
268 }
269 double R290Class::conductivity_background(double T, double rho)
270 {
271  double sum=0, delta, tau;
272  int i;
273  double rhoc = reduce.rho;
274  double Tc = 369.85;
275  //Set constants required
276  double B1[]={
277  0.0, //[0]
278  -3.69500e-2, //[1]
279  1.48658e-1, //[2]
280  -1.19986e-1, //[3]
281  4.12431e-2, //[4]
282  -4.86905e-3 //[5]
283  };
284  double B2[]={
285  0.0, //[0]
286  4.82798e-2, //[1]
287  -1.35636e-1, //[2]
288  1.17588e-1, //[3]
289  -4.36911e-2, //[4]
290  6.16079e-3 //[5]
291  };
292  delta=rho/rhoc;
293  tau=Tc/T;
294  for(i=1;i<=5;i++)
295  {
296  sum+=(B1[i]+B2[i]/tau)*pow(delta,(double)i);
297  }
298  return sum; //[W/m/K]
299 }
300 double R290Class::conductivity_Trho(double T, double rho)
301 {
302  /*Properties taken from "Measurement and Correlation of the Thermal Conductivity of
303  Propane from 86 K to 600 K at Pressures to 70 MPa"
304  by Kenneth N. Marsh, Richard A. Perkins, and Maria L. V. Ramires
305  J. Chem. Eng. Data 2002, 47, 932-940
306 
307  The empirical critical enhancement is implemented
308  */
309 
310  // output in W/m-K
311 
312  double lambda0,lambdar,lambdac,tau = 369.85/T;
313 
314  // The dilute gas contribution [W/m/K]
315  double A[]={0.0, -1.24778e-3, 8.16371e-3, 1.99374e-2};
316  lambda0 = A[1]+A[2]/tau+A[3]/(tau*tau);
317 
318  // The background contribution [W/m/K]
319  lambdar = this->conductivity_background(T,rho);
320 
321  // Critical term from Olchowy and Sengers using the value of qd^-1 from Marsh [W/m/K]
322  lambdac = this->conductivity_critical(T,rho,1/7.16635e-10);
323 
324  return lambda0+lambdar+lambdac;
325 }
326 
327 void R290Class::ECSParams(double *e_k, double *sigma)
328 {
329  *e_k = 263.88; *sigma = 0.49748;
330 }
332 {
333  double eta_star, a[]={0.25104574,-0.47271238,0,0.060836515,0};
334  double e_k = 263.88 /* K */, sigma = 0.49748, /* nm */ theta_star, Tstar;
335 
336  Tstar = T/e_k;
337  theta_star = exp(a[0]*pow(log(Tstar),0)+a[1]*pow(log(Tstar),1)+a[3]*pow(log(Tstar),3));
338  eta_star = 0.141824*sqrt(T)/(pow(sigma,2)*theta_star)/1e6;
339  return eta_star;
340 }
341 double R290Class::viscosity_dilute2(double T, double rho)
342 {
343  double e_k = 263.88 /* K */, sigma = 0.49748, /* nm */ Tstar, rhobar;
344  double B_eta_star,B_eta,eta_1,sum=0;
345  Tstar = T/e_k;
346  double b[]={-19.572881,219.73999,-1015.3226,2471.01251,-3375.1717,2491.6597,-787.26086,14.085455,-0.34664158};
347  for (unsigned int i=0;i<=6;i++){
348  sum += b[i]*pow(Tstar,-0.25*i);
349  }
350  B_eta_star = sum+b[7]*pow(Tstar,-2.5)+b[8]*pow(Tstar,-5.5); //[no units]
351  B_eta = 0.602214129*pow(sigma,3)*B_eta_star; //[L/mol]
352  rhobar = rho/params.molemass;
353  eta_1 = viscosity_dilute(T) * B_eta;
354  // B_eta*rho needs to be non-dimensional [m3/mol]*[kg/m3] so need divide by mole mass and multiply by 1000
355  return eta_1*rhobar;
356 }
357 double R290Class::viscosity_higher_order(double T, double rho)
358 {
359  double sum=0,delta_0,DELTA_H_eta,tau,delta,eta_r;
360  double g1 = 2.50053938863, g2 = 0.860516059264,f1 = 1616.88405374;
361 
362  double e[6][3];
363  e[2][0] = 35.9873030195; e[2][1] = -180.512188564; e[2][2] = 87.7124888223;
364  e[3][0] = -105.773052525; e[3][1] = 205.319740877; e[3][2] = -129.210932610;
365  e[4][0] = 58.9491587759; e[4][1] = -129.740033100; e[4][2] = 76.6280419971;
366  e[5][0] = -9.59407868475; e[5][1] = 21.0726986598; e[5][2] = -14.3971968187;
367 
368  tau = T / 369.825;
369  delta = rho / (44.09562*5);
370 
371  delta_0=g1*(1+g2*sqrt(tau)); //[no units]
372  sum=0;
373  for (int i=2;i<=5;i++){
374  for (int j=0;j<=2;j++){
375  sum+=e[i][j]*pow(delta,i)/pow(tau,j);
376  }
377  }
378  DELTA_H_eta = sum + f1*(delta/(delta_0-delta)-delta/delta_0);
379 
380  eta_r = DELTA_H_eta/1e6;
381  return eta_r;
382 }
383 double R290Class::viscosity_residual(double T, double rho)
384 {
385  return viscosity_background(T,rho);
386 }
387 double R290Class::viscosity_background(double T, double rho)
388 {
389  return viscosity_dilute2(T,rho)+viscosity_higher_order(T,rho);
390 }
391 double R290Class::viscosity_Trho(double T, double rho)
392 {
393  // inputs in T [K], and p [kPa]
394  // output in Pa-s
395 
396  return viscosity_dilute(T)+viscosity_background(T,rho);
397 }
398 double R290Class::psat(double T)
399 {
400  // Max error is 0.130389086256 % between 85.525 and 369.889999 K
401 
402  const double ti[]={0,0.09, 1.0, 2.1666666666666665, 2.5, 3.5, 6.666666666666667};
403  const double Ni[]={0, -0.0036326603098915731, -6.4417163271195328, 4.2879114303836188, -4.3361540375495373, -1.5330938298966583, -0.8380028193117014};
404  double summer=0,theta;
405  int i;
406  theta=1-T/reduce.T;
407  for (i=1;i<=6;i++)
408  {
409  summer += Ni[i]*pow(theta,ti[i]);
410  }
411  return reduce.p.Pa*exp(reduce.T/T*summer);
412 }
413 double R290Class::rhosatL(double T)
414 {
415  // Max error is 0.0403333824779 % between 85.525 and 369.889999 K
416  const double ti[]={0, 0.3665, 0.3695, 0.39199999999999996, 0.39749999999999996, 1.5, 3.8333333333333335};
417  const double Ni[]={0, -2544.5789267169393, 3262.5780670317858, -2279.9253725524513, 1564.3230394188856, 0.17057178175644663, 0.1801528182529071};
418  double summer=0;
419  int i;
420  double theta;
421  theta=1-T/reduce.T;
422  for (i=1;i<=6;i++)
423  {
424  summer += Ni[i]*pow(theta,ti[i]);
425  }
426  return reduce.rho*(summer+1);
427 }
428 double R290Class::rhosatV(double T)
429 {
430  // Max error is 0.119794943361 % between 85.525 and 369.889999 K
431  const double ti[]={0,0.353, 0.374, 1.0, 2.0, 3.6666666666666665, 21.333333333333332};
432  const double Ni[]={0,1.3470928285341803, -3.9397785053443175, -2.9376522081571999, 1.277500738496856, -4.2937206644727439, -2.2870921292077298};
433  double summer=0,theta;
434  int i;
435  theta=1.0-T/reduce.T;
436  for (i=1;i<=6;i++)
437  {
438  summer=summer+Ni[i]*pow(theta,ti[i]);
439  }
440  return reduce.rho*exp(reduce.T/T*summer);
441 }
443 {
444  return 0.05334*pow(1-T/reduce.T,1.235)-0.01748*pow(1-T/reduce.T,4.404);
445 }
std::vector< phi_BC * > phirlist
Definition: FluidClass.h:178
double psat(double)
Definition: R290.cpp:398
double viscosity_dilute(double T)
Definition: R290.cpp:331
void ECSParams(double *e_k, double *sigma)
Definition: R290.cpp:327
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
double viscosity_higher_order(double T, double rho)
Definition: R290.cpp:357
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
R290Class()
Definition: R290.cpp:69
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
double conductivity_Trho(double, double)
Definition: R290.cpp:300
double surface_tension_T(double T)
Definition: R290.cpp:442
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 ECS_LENNARD_JONES
Definition: FluidClass.h:124
std::string SURFACE_TENSION
Definition: FluidClass.h:126
double rhosatV(double)
Definition: R290.cpp:428
double viscosity_Trho(double, double)
Definition: R290.cpp:391
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 viscosity_residual(double T, double rho)
Definition: R290.cpp:383
double viscosity_dilute2(double T, double rho)
Definition: R290.cpp:341
double Tmin
Definition: FluidClass.h:54
double conductivity_background(double T, double rho)
Definition: R290.cpp:269
double rhomax
Definition: FluidClass.h:54
double viscosity_background(double T, double rho)
Definition: R290.cpp:387
std::string CONDUCTIVITY
Definition: FluidClass.h:123
double rhosatL(double)
Definition: R290.cpp:413