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
R134a.cpp
Go to the documentation of this file.
1 /*
2 Properties for R134a.
3 by Ian Bell
4 
5 Thermo props from
6 "A International Standard Formulation for the Thermodynamic Properties of 1,1,1,2-Tetrafluoroethane
7 (HFC-134a) for Temperatures from 170 K to 455 K and Pressures up to 70 MPa"
8 by Reiner Tillner-Roth and Hans Dieter Baehr, J. Phys. Chem. Ref. Data, v. 23, 1994, pp 657-729
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 <cmath>
22 #include "string.h"
23 #include "stdio.h"
24 #include "CoolProp.h"
25 #include "FluidClass.h"
26 #include "R134a.h"
27 
29 {
30 
31  static const double n[]={
32  0.0, //[0]
33  0.5586817e-1, //[1]
34  0.4982230e0, //[2]
35  0.2458698e-1, //[3]
36  0.8570145e-3, //[4]
37  0.4788584e-3, //[5]
38  -0.1800808e1, //[6]
39  0.2671641e0, //[7]
40  -0.4781652e-1, //[8]
41  0.1423987e-1, //[9]
42  0.3324062e0, //[10]
43  -0.7485907e-2, //[11]
44  0.1017263e-3, //[12]
45  -0.5184567e+0, //[13]
46  -0.8692288e-1, //[14]
47  0.2057144e+0, //[15]
48  -0.5000457e-2, //[16]
49  0.4603262e-3, //[17]
50  -0.3497836e-2, //[18]
51  0.6995038e-2, //[19]
52  -0.1452184e-1, //[20]
53  -0.1285458e-3, //[21]
54  };
55 
56  static const double d[]={
57  0, //[0]
58  2, //[1]
59  1, //[2]
60  3, //[3]
61  6, //[4]
62  6, //[5]
63  1, //[6]
64  1, //[7]
65  2, //[8]
66  5, //[9]
67  2, //[10]
68  2, //[11]
69  4, //[12]
70  1, //[13]
71  4, //[14]
72  1, //[15]
73  2, //[16]
74  4, //[17]
75  1, //[18]
76  5, //[19]
77  3, //[20]
78  10 //[21]
79  };
80 
81  static const double t[]={
82  0.0, //[0]
83  -1.0/2.0, //[1]
84  0.0, //[2]
85  0.0, //[3]
86  0.0, //[4]
87  3.0/2.0, //[5]
88  3.0/2.0, //[6]
89  2.0, //[7]
90  2.0, //[8]
91  1.0, //[9]
92  3.0, //[10]
93  5.0, //[11]
94  1.0, //[12]
95  5.0, //[13]
96  5.0, //[14]
97  6.0, //[15]
98  10.0, //[16]
99  10.0, //[17]
100  10.0, //[18]
101  18.0, //[19]
102  22.0, //[20]
103  50.0 //[21]
104  };
105 
106  static const double c[]={
107  0.0, //[0]
108  0.0, //[1]
109  0.0, //[2]
110  0.0, //[3]
111  0.0, //[4]
112  0.0, //[5]
113  0.0, //[6]
114  0.0, //[7]
115  0.0, //[8]
116  1.0, //[9]
117  1.0, //[10]
118  1.0, //[11]
119  2.0, //[12]
120  2.0, //[13]
121  2.0, //[14]
122  2.0, //[15]
123  2.0, //[16]
124  2.0, //[17]
125  3.0, //[18]
126  3.0, //[19]
127  3.0, //[20]
128  4.0 //[21]
129  };
130 
131  static const double a0[]={
132  0.0, //[0]
133  -1.019535, //[1]
134  9.047135, //[2]
135  -1.629789, //[3]
136  -9.723916, //[4]
137  -3.927170 //[5]
138  };
139  static const double t0[]={
140  0.0, //[0]
141  0.0, //[1]
142  0.0, //[2]
143  0.0, //[3]
144  -1.0/2.0, //[4]
145  -3.0/4.0 //[5]
146  };
147 
148  phirlist.push_back(new phir_power(n,d,t,c,1,21,22));
149 
150  // phi0=log(delta)+a0[1]+a0[2]*tau+a0[3]*log(tau)+a0[4]*pow(tau,-1.0/2.0)+a0[5]*pow(tau,-3.0/4.0);
151  phi0list.push_back(new phi0_lead(a0[1],a0[2]));
152  phi0list.push_back(new phi0_logtau(a0[3]));
153  phi0list.push_back(new phi0_power(a0,t0,4,5,6));
154 
155  // Other fluid parameters
156  params.molemass = 102.032;
157  params.Ttriple = 169.85;
158  params.ptriple = 0.3896;
159  params.accentricfactor = 0.32684;
160  params.R_u = 8.314471;
161 
162  // Critical parameters
163  crit.rho = 5.017053*params.molemass;
164  crit.p = PressureUnit(4059.28, UNIT_KPA);
165  crit.T = 374.21;
166  crit.v = 1.0/crit.rho;
167 
168  // Reducing parameters used in EOS
169  reduce.p = PressureUnit(4059.28, UNIT_KPA);
170  reduce.T = 374.18;
171  reduce.rho = 4.978830171*params.molemass;
172  reduce.v = 1.0/reduce.rho;
173 
174  preduce = &reduce;
175 
176  // Limits of EOS
177  limits.Tmin = 169.85;
178  limits.Tmax = 455.0;
179  limits.pmax = 70000.0;
180  limits.rhomax = 15.60*params.molemass;
181 
182  EOSReference.assign("\"A International Standard Formulation for the Thermodynamic Properties of 1,1,1,2-Tetrafluoroethane"
183  "(HFC-134a) for Temperatures from 170 K to 455 K and Pressures up to 70 MPa\""
184  "by Reiner Tillner-Roth and Hans Dieter Baehr, J. Phys. Chem. Ref. Data, v. 23, 1994, pp 657-729");
185  TransportReference.assign("Viscosity: Marcia L. Huber, Arno Laesecke, and Richard A. Perkins, "
186  "\"Model for the Viscosity and Thermal Conductivity of Refrigerants,"
187  "Including a New Correlation for the Viscosity of R134a\"A Reference "
188  "Ind. Eng. Chem. Res. 2003, 42, 3163-3178\n\n"
189  "Conductivity: McLinden, M.O., and S.A. Klein and R.A. Perkins, \"An extended corresponding states model for the thermal conductivity of refrigerants and refrigerant mixtures\", International Journal of Refrigeration, 23 (2000) 43-63.\nSeveral typos: Table A1- a1 should be 8.00892e-5, R0 should be 1.03 . Eqn A5 - chi*(Tref,rho) should be multiplied by Tref/T. Eqn A4 - epsilon should be eta (viscosity)\n\n"
190  "Surface Tension: Mulero, JPCRD, 2012");
191 
192  name.assign("R134a");
193  aliases.push_back("R134A");
194 
195  BibTeXKeys.EOS = "TillnerRoth-JPCRD-1994";
196  BibTeXKeys.VISCOSITY = "Huber-IECR-2003";
197  BibTeXKeys.CONDUCTIVITY = "McLinden-IJR-2000";
198  BibTeXKeys.ECS_LENNARD_JONES = "Huber-IECR-2003";
199  BibTeXKeys.SURFACE_TENSION = "Mulero-JPCRD-2012";
200 }
202 {
203  // Typo in McLinden, 1999. a1 should be x10-5
204  double a0=-1.05248e-2, //[W/m/K]
205  a1=8.00982e-5; //[W/m/K^2]
206  double lambda = (a0+a1*T); //[W/m/K]
207  return lambda; //[W/m/K]
208 }
209 double R134aClass::conductivity_residual(double T, double rho)
210 {
211  double b1=1.836526,
212  b2=5.126143,
213  b3=-1.436883,
214  b4=0.626144,
215  lambda_reducing=2.055e-3; //[W/m/K]
216  double delta = rho/(5.049886*params.molemass); // Does not use either the reduce.rho value or crit.rho value !!! Or the value listed in Huber, 2003 either
217  double lambda_r = lambda_reducing*(b1*delta+b2*pow(delta,2)+b3*pow(delta,3)+b4*pow(delta,4)); //[W/m/K]
218  return lambda_r; //[W/m/K]
219 }
220 double R134aClass::conductivity_background(double T, double rho)
221 {
222  return conductivity_residual(T,rho);
223 }
224 double R134aClass::conductivity_Trho(double T, double rho)
225 {
226  return conductivity_dilute(T)+conductivity_residual(T,rho)+Fluid::conductivity_critical(T,rho,1.89202e9,0.0496,1.94e-10);
227 }
228 void R134aClass::ECSParams(double *e_k, double *sigma)
229 {
230  // Huber, 2003
231  *e_k = 299.363; *sigma = 0.468932;
232 }
234 {
235  double eta_star, a[]={0.355404,-0.464337,0.257353e-1};
236  double e_k = 299.363, sigma = 0.468932, theta_star, Tstar;
237  Tstar = T/e_k;
238  theta_star = exp(a[0]*pow(log(Tstar),0)+a[1]*pow(log(Tstar),1)+a[2]*pow(log(Tstar),2));
239  eta_star = 0.021357*sqrt(params.molemass*T)/(pow(sigma,2)*theta_star)/1e6;
240  return eta_star;
241 }
242 double R134aClass::viscosity_residual(double T, double rho)
243 {
244  double sum=0,delta_0,DELTA_H_eta,B_eta_star,B_eta,N_A=6.02214129e23,tau,delta;
245  double e_k = 299.363 /* K */, sigma = 0.468932/* nm */, Tstar, eta_r;
246  double b[]={-19.572881,219.73999,-1015.3226,2471.0125,-3375.1717,2491.6597,-787.26086,14.085455,-0.34664158};
247  double t[]={0,-0.25,-0.50,-0.75,-1.00,-1.25,-1.50,-2.50,-5.50};
248  double c[]={0,
249  -0.206900719e-1, //[1]
250  0.356029549e-3, //[2]
251  0.211101816e-2, //[3]
252  0.139601415e-1, //[4]
253  -0.456435020e-2, //[5]
254  -0.351593275e-2, //[6]
255  0.214763320, //[7]
256  -0.890173375e-1, //[8]
257  0.100035295, //[9]
258  3.163695636 //[10]
259  };
260  tau = T / 374.21;
261  /* From Huber (2003):
262  The higher-density terms of eq 11, ∆Hη(F,T), were
263  formulated in terms of the reduced density δ = F/Fc and
264  the reduced temperature τ ) T/Tc with the critical
265  parameters of R134a from the equation of state of
266  Tillner-Roth and Baehr as reducing parameters, rhoc=
267  511.9 kg/m3 */
268  delta = rho / 511.9;
269 
270  Tstar = T / e_k;
271  for (unsigned int i=0;i<=8;i++){
272  sum += b[i]*pow(Tstar,t[i]);
273  }
274  B_eta_star = sum; //[no units]
275  B_eta = N_A*pow(sigma/1e9,3)*B_eta_star; //[m3/mol]
276 
277  delta_0=c[10]/(1+c[8]*tau+c[9]*pow(tau,2)); //[no units]
278  DELTA_H_eta = c[1]*delta + (c[2]/pow(tau,6)+c[3]/pow(tau,2)+c[4]/sqrt(tau)+c[5]*pow(tau,2))*pow(delta,2)
279  +c[6]*pow(delta,3)+c[7]/(delta_0-delta)-c[7]/delta_0; //[mPa-s]
280  // B_eta*rho needs to be non-dimensional [m3/mol]*[kg/m3] so need divide by mole mass and multiply by 1000
281  eta_r = viscosity_dilute(T)*B_eta*rho/params.molemass*1000+DELTA_H_eta/1e3;
282  return eta_r;
283 }
284 double R134aClass::viscosity_background(double T, double rho)
285 {
286  return viscosity_residual(T,rho);
287 }
288 double R134aClass::viscosity_Trho(double T, double rho)
289 {
290  double v = viscosity_dilute(T)+viscosity_residual(T,rho);
291  return v;
292 }
293 double R134aClass::psat(double T)
294 {
295  const double ti[]={0,1,1.5,2.3,3.6,5.2,7.3};
296  const double Ni[]={0,-7.6896400207782598, 2.0859760566425463, -2.6755347075503888, 0.3010493765467589, -5.8583601582059233, 3.4788072104059631};
297  double summer=0,theta;
298  int i;
299  theta=1.0-T/reduce.T;
300  for (i=1;i<=6;i++)
301  {
302  summer=summer+Ni[i]*pow(theta,ti[i]);
303  }
304  return crit.p.Pa*exp(summer*crit.T/T);
305 }
306 double R134aClass::rhosatL(double T)
307 {
308  const double ti[]={0,0.30476365788328746, 1.3693916347775943, 1.47181218204009};
309  const double Ni[]={0,1.4547755306897099, -1.8409578717703114, 1.7741041693195705};
310  double summer=0,theta;
311  int i;
312  theta=1.0-T/reduce.T;
313  for (i=1;i<=3;i++)
314  {
315  summer=summer+Ni[i]*pow(theta,ti[i]);
316  }
317  return reduce.rho*exp(summer);
318 }
319 double R134aClass::rhosatV(double T)
320 {
321  const double ti[]={0,0.36671869805172808, 0.90909437225529799, 3.8975848316804713};
322  const double Ni[]={0,-2.5530620653554106, -3.260103853948312, -5.5500764019235618};
323  double summer=0,theta;
324  int i;
325  theta=1.0-T/reduce.T;
326  for (i=1;i<=3;i++)
327  {
328  summer=summer+Ni[i]*pow(theta,ti[i]);
329  }
330  return reduce.rho*exp(summer*crit.T/T);
331 }
333 {
334  return 0.05801*pow(1-T/crit.T,1.241);
335 }
336 
337 
341  //From "A Reference Multiparameter Viscosity Equation for R134a
342  //with an Optimized Functional Form"
343  //by G. Scalabrin and P. Marchi, R. Span
344  //J. Phys. Chem. Ref. Data, Vol. 35, No. 2, 2006
345  //*/
346  //double sum=0, Tr,rhor;
347  //int i;
348  //double g[]={0.0,0.0,0.0,1.0,1.0,2.0,2.0,4.0,0.0,2.0,5.0};
349  //double h[]={0.0,2.0,20.0,0.0,3.0,0.0,4.0,14.0,1.0,1.0,3.0};
350  //double n[]={0.0,0.6564868,0.6882417e-10,0.5668165,-0.2989820,-0.1061795,
351  // 0.6245080e-1,0.2758366e-6,-0.1621088,0.1675102,-0.9224693e-1};
352 
353  //Tr=T/crit.T;
354  //rhor=rho/crit.rho;
355 
356  //for (i=1;i<=7;i++)
357  //{
358  // sum += n[i]*pow(Tr,g[i])*pow(rhor,h[i]);
359  //}
360  //for (i=8;i<=10;i++)
361  //{
362  // sum += exp(-2*rhor*rhor)*n[i]*pow(Tr,g[i])*pow(rhor,h[i]);
363  //}
364  //return (exp(sum)-1.0)*25.17975/1e6;
365 
367 // From "A multiparameter thermal conductivity equation
368 // for R134a with an optimized functional form"
369 // by G. Scalabrin, P. Marchi, F. Finezzo,
370 // Fluid Phase Equilibria 245 (2006) 37-51
371 // */
372 // int i;
373 // double sum=0, Tr,rhor,alpha,lambda_r_ce,lambda_r,num,den;
374 // double g[]={0.0,0.0,0.5,1.0,1.5,4.0,5.5,6.0,0.0};
375 // double h[]={0.0,1.0,1.0,6.0,0.0,3.0,0.0,0.0,1.0};
376 // double n[]={0.0,23.504800,-15.261689,0.064403724,7.9735850,0.28675949,
377 // 8.1819842,-6.4852285,-4.8298888};
378 // double nc=1.2478242;
379 // double a[]={0.0,1.0,0.0,0.0,0.30,0.30,0.36525,
380 // 0.61221,0.94930,0.92162,0.15,0.08,0.14};
381 //
382 // Tr=T/crit.T;
383 // rhor=rho/crit.rho;
384 // alpha=1.0-a[10]*acosh(1+a[11]*pow((1-Tr)*(1-Tr),a[12]));
385 // num=rhor*exp(-pow(rhor,a[1])/a[1]-powInt(a[2]*(Tr-1.0),2)-powInt(a[3]*(rhor-1.0),2));
386 // den=pow(pow(powInt((1.0-1.0/Tr)+a[4]*pow((rhor-1.0)*(rhor-1.0),1.0/(2.0*a[5])),2),a[6])+pow(a[7]*a[7]*(rhor-alpha)*(rhor-alpha),a[8]),a[9]);
387 // lambda_r_ce=num/den;
388 // for(i=1;i<=7;i++)
389 // {
390 // sum+=n[i]*pow(Tr,g[i])*pow(rhor,h[i]);
391 // }
392 // lambda_r=sum+n[8]*exp(-5.0*rhor*rhor)*pow(Tr,g[8])*pow(rhor,h[8])+nc*lambda_r_ce;
393 // return 2.0547*lambda_r/1e6;
double viscosity_Trho(double, double)
Definition: R134a.cpp:288
std::vector< phi_BC * > phirlist
Definition: FluidClass.h:178
double surface_tension_T(double T)
Definition: R134a.cpp:332
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
double conductivity_background(double T, double rho)
Definition: R134a.cpp:220
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 psat(double)
Definition: R134a.cpp:293
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
struct CriticalStruct * preduce
Definition: FluidClass.h:221
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 pmax
Definition: FluidClass.h:54
params
double rhosatV(double)
Definition: R134a.cpp:319
struct CriticalStruct crit
Definition: FluidClass.h:218
double viscosity_residual(double T, double rho)
Definition: R134a.cpp:242
double viscosity_background(double T, double rho)
Definition: R134a.cpp:284
double rhosatL(double)
Definition: R134a.cpp:306
BibTeXKeysStruct BibTeXKeys
Definition: FluidClass.h:175
double viscosity_dilute(double T)
Definition: R134a.cpp:233
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 conductivity_Trho(double, double)
Definition: R134a.cpp:224
void ECSParams(double *e_k, double *sigma)
Definition: R134a.cpp:228
R134aClass()
Definition: R134a.cpp:28
double conductivity_residual(double T, double rho)
Definition: R134a.cpp:209
double Tmin
Definition: FluidClass.h:54
double rhomax
Definition: FluidClass.h:54
double conductivity_dilute(double T)
Definition: R134a.cpp:201
std::string CONDUCTIVITY
Definition: FluidClass.h:123