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
R22.cpp
Go to the documentation of this file.
1 /*
2 Properties for R22.
3 by Ian Bell
4 
5 
6 Thermo props from
7 A. Kamei, S. W. Beyerlein, and R. T Jacobsen
8 "Application of Nonlinear Regression in the
9 Development of a Wide Range Formulation
10 for HCFC-22"
11 International Journal of Thermophysics, Vol 16, No. 5, 1995
12 
13 */
14 
15 #if defined(_MSC_VER)
16 #define _CRTDBG_MAP_ALLOC
17 #define _CRT_SECURE_NO_WARNINGS
18 #include <stdlib.h>
19 #include <crtdbg.h>
20 #else
21 #include <stdlib.h>
22 #endif
23 
24 #include <math.h>
25 #include "string.h"
26 #include "stdio.h"
27 #include <stdlib.h>
28 #include "CoolProp.h"
29 #include "FluidClass.h"
30 #include "R22.h"
31 
33 {
34  static const double n[]={0,
35  0.0695645445236, //[1]
36  25.2275419999, //[2]
37  -202.351148311, //[3]
38  350.063090302, //[4]
39  -223.134648863, //[5]
40  48.8345904592, //[6]
41  0.0108874958556, //[7]
42  0.590315073614, //[8]
43  -0.689043767432, //[9]
44  0.284224445844, //[10]
45  0.125436457897, //[11]
46  -0.0113338666416, //[12]
47  -0.063138895917, //[13]
48  0.00974021015232, //[14]
49  -0.000408406844722, //[15]
50  0.00074194877357, //[16]
51  0.000315912525922, //[17]
52  0.00000876009723338, //[18]
53  -0.000110343340301, //[19]
54  -0.0000705323356879, //[20]
55  0.23585073151, //[21]
56  -0.192640494729, //[22]
57  0.00375218008557, //[23]
58  -0.0000448926036678, //[24]
59  0.0198120520635, //[25]
60  -0.0356958425255, //[26]
61  0.0319594161562, //[27]
62  0.00000260284291078, //[28]
63  -0.00897629021967, //[29]
64  0.0345482791645, //[30]
65  -0.00411831711251, //[31]
66  0.00567428536529, //[32]
67  -0.00563368989908, //[33]
68  0.00191384919423, //[34]
69  -0.00178930036389 //[35]
70  };
71 
72  static const double d[]={0,
73  1, //[1]
74  1, //[2]
75  1, //[3]
76  1, //[4]
77  1, //[5]
78  1, //[6]
79  1, //[7]
80  2, //[8]
81  2, //[9]
82  2, //[10]
83  3, //[11]
84  3, //[12]
85  4, //[13]
86  5, //[14]
87  6, //[15]
88  7, //[16]
89  7, //[17]
90  7, //[18]
91  8, //[19]
92  8, //[20]
93  2, //[21]
94  2, //[22]
95  2, //[23]
96  2, //[24]
97  3, //[25]
98  4, //[26]
99  4, //[27]
100  4, //[28]
101  4, //[29]
102  6, //[30]
103  6, //[31]
104  6, //[32]
105  8, //[33]
106  8, //[34]
107  8, //[35]
108  };
109 
110  static const double t[]={0,
111  -1, //[1]
112  1.75, //[2]
113  2.25, //[3]
114  2.5, //[4]
115  2.75, //[5]
116  3, //[6]
117  5.5, //[7]
118  1.5, //[8]
119  1.75, //[9]
120  3.5, //[10]
121  1, //[11]
122  4.5, //[12]
123  1.5, //[13]
124  0.5, //[14]
125  4.5, //[15]
126  1, //[16]
127  4, //[17]
128  5, //[18]
129  -0.5, //[19]
130  3.5, //[20]
131  5, //[21]
132  7, //[22]
133  12, //[23]
134  15, //[24]
135  3.5, //[25]
136  3.5, //[26]
137  8, //[27]
138  15, //[28]
139  25, //[29]
140  3, //[30]
141  9, //[31]
142  19, //[32]
143  2, //[33]
144  7, //[34]
145  13 //[35]
146  };
147 
148  static const double l[]={0,
149  0, //[1]
150  0, //[2]
151  0, //[3]
152  0, //[4]
153  0, //[5]
154  0, //[6]
155  0, //[7]
156  0, //[8]
157  0, //[9]
158  0, //[10]
159  0, //[11]
160  0, //[12]
161  0, //[13]
162  0, //[14]
163  0, //[15]
164  0, //[16]
165  0, //[17]
166  0, //[18]
167  0, //[19]
168  0, //[20]
169  2, //[21]
170  2, //[22]
171  2, //[23]
172  2, //[24]
173  3, //[25]
174  2, //[26]
175  2, //[27]
176  2, //[28]
177  4, //[29]
178  2, //[30]
179  2, //[31]
180  4, //[32]
181  2, //[33]
182  2, //[34]
183  4 //[35]
184  };
185 
186  static const double B[]={0,
187  4352.3095, //[1]
188  1935.1591, //[2]
189  1887.67936, //[3]
190  1694.88284, //[4]
191  1605.67848, //[5]
192  1162.53424, //[6]
193  857.51288, //[7]
194  605.72638, //[8]
195  530.90982, //[9]
196  5.26140446e-3, //[10]
197  1.20662553e-4 //[11]
198  };
199 
200  std::vector<double> B_v(B,B+sizeof(B)/sizeof(double));
201  std::vector<double> b_v(10,1.0);
202 
203  phirlist.push_back(new phir_power(n,d,t,l,1,35,36));
204 
205  double T0=273.15,
206  p0=1.0,
207  R_=8.31451/86.549,
208  rho0=p0/(R_*T0),
209  m,
210  c,
211  R_u=8.31451,
212  Tc=369.295,
213  H0 = 35874.80,
214  S0 = 205.2925,
215  tau0=Tc/T0,
216  delta0=rho0/523.84216696;
217 
218  // log(delta)+c+m*tau
219 
221  c=-S0/R_u-1+log(tau0/delta0);/*<< from the leading term*/
222 
224  m=H0/(R_u*Tc); /*<< from the leading term */
225 
226  for (unsigned int i=1; i<=9; i++){B_v[i]/=Tc;}
227 
228  phi_BC * phi0_lead_ = new phi0_lead(c,m);
229  phi_BC * phi0_logtau_ = new phi0_logtau(-1.0);
230  phi_BC * phi0_cp0_constant_ = new phi0_cp0_constant(B[10]+4,Tc,T0);
231  phi_BC * phi0_cp0_poly_ = new phi0_cp0_poly(B[11],1,Tc,T0);
232  //phi_BC * phi0_cp0_exponential_ = new phi0_cp0_exponential(b_v,B_v,Tc,T0,1,9);/// checked - good
233 
234  phi0list.push_back(phi0_lead_);
235  phi0list.push_back(phi0_logtau_);
236  phi0list.push_back(phi0_cp0_constant_);
237  phi0list.push_back(phi0_cp0_poly_);
238  //phi0list.push_back(phi0_cp0_exponential_);
239  phi0list.push_back(new phi0_Planck_Einstein(b_v,B_v,1,9));
240 
241 
242  // Other fluid parameters
243  params.molemass = 86.468;
244  params.Ttriple = 115.73;
245  params.ptriple = 0.00037947;
246  params.accentricfactor = 0.22082;
247  params.R_u = 8.314510;
248 
249  // Critical parameters
250  crit.rho = 6.05822*params.molemass;
251  crit.p = PressureUnit(4990, UNIT_KPA);
252  crit.T = 369.295;
253  crit.v = 1.0/crit.rho;
254 
255  // Limits of EOS
256  limits.Tmin = params.Ttriple;
257  limits.Tmax = 550.0;
258  limits.pmax = 60000.0;
259  limits.rhomax = 19.91*params.molemass;
260 
261  EOSReference.assign("Kamei, A., and S. W. Beyerlein, and R. T Jacobsen "
262  "\"Application of Nonlinear Regression in the "
263  "Development of a Wide Range Formulation "
264  "for HCFC-22\""
265  "International Journal of Thermophysics, Vol 16, No. 5, 1995 ");
266  TransportReference.assign("Using ECS");
267  name.assign("R22");
268 
269  BibTeXKeys.EOS = "Kamei-IJT-1995";
270  BibTeXKeys.ECS_LENNARD_JONES = "McLinden-IJR-2000";
271  BibTeXKeys.ECS_FITS = "McLinden-IJR-2000";
272  BibTeXKeys.SURFACE_TENSION = "Mulero-JPCRD-2012";
273 
274 }
275 double R22Class::rhosatL(double T)
276 {
277  const double ti[]={0,0.31192915101182356, 2.8946435869795102, 0.67246871922761298};
278  const double Ni[]={0,1.483021299160145, 0.080969023427476514, -0.20168767717342609};
279  double summer=0,theta;
280  int i;
281  theta=1.0-T/reduce.T;
282  for (i=1;i<=3;i++)
283  {
284  summer=summer+Ni[i]*pow(theta,ti[i]);
285  }
286  return reduce.rho*exp(summer);
287 }
288 double R22Class::rhosatV(double T)
289 {
290  const double ti[]={0,0.34946619849137917, 0.85911512967423576, 4.0559379494670686};
291  const double Ni[]={0,-2.1778924368532797, -3.1490525869084243, -4.5796870359311495};
292  double summer=0,theta;
293  int i;
294  theta=1.0-T/reduce.T;
295  for (i=1;i<=3;i++)
296  {
297  summer=summer+Ni[i]*pow(theta,ti[i]);
298  }
299  return reduce.rho*exp(summer*crit.T/T);
300 }
301 double R22Class::psat(double T)
302 {
303  const double ti[]={0,1,1.5,2.3,3.6,5.2,7.3};
304  const double Ni[]={0,-7.0751284116491497, 1.6540574277960167, -1.6991342890871426, -0.28422811006931187, -3.5966160189328447, 1.217643375964375};
305  double summer=0,theta;
306  int i;
307  theta=1.0-T/reduce.T;
308  for (i=1;i<=6;i++)
309  {
310  summer=summer+Ni[i]*pow(theta,ti[i]);
311  }
312  return crit.p.Pa*exp(summer*crit.T/T);
313 }
314 double R22Class::ECS_f_int(double T)
315 {
316  // McLinden et al., 2000
317  return 7.7817e-4+1.2636e-6*T;
318 }
320 {
321  // McLinden et al, 2000
322  return 1.0750-0.0385740*rhor;
323 }
324 double R22Class::ECS_psi_viscosity(double rhor)
325 {
326  return 1.0272423-0.0198493*rhor;
327 }
328 void R22Class::ECSParams(double *e_k, double *sigma)
329 {
330  *e_k = 284.7242;
331  *sigma = 0.4666;
332 }
double rhosatL(double)
Definition: R22.cpp:275
std::vector< phi_BC * > phirlist
Definition: FluidClass.h:178
double ECS_chi_conductivity(double rhor)
Definition: R22.cpp:319
struct FluidLimits limits
Definition: FluidClass.h:219
std::string EOS
Definition: FluidClass.h:120
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 rhosatV(double)
Definition: R22.cpp:288
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
std::string ECS_FITS
Definition: FluidClass.h:125
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
void ECSParams(double *e_k, double *sigma)
Definition: R22.cpp:328
std::string SURFACE_TENSION
Definition: FluidClass.h:126
double pmax
Definition: FluidClass.h:54
params
struct CriticalStruct crit
Definition: FluidClass.h:218
double ECS_psi_viscosity(double rhor)
Definition: R22.cpp:324
BibTeXKeysStruct BibTeXKeys
Definition: FluidClass.h:175
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 psat(double)
Definition: R22.cpp:301
R22Class()
Definition: R22.cpp:32
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
double Tmin
Definition: FluidClass.h:54
double rhomax
Definition: FluidClass.h:54
double ECS_f_int(double T)
Definition: R22.cpp:314