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
R32.cpp
Go to the documentation of this file.
1 /*
2 Properties for R32.
3 by Ian Bell
4 
5 
6 Thermo props from
7 Tillner-Roth, R. and Yokozeki, A.,
8 "An international standard equation of state for difluoromethane (R-32)
9 for temperatures from the triple point at 136.34 K to 435 K and pressures
10 up to 70 MPa,"
11 J. Phys. Chem. Ref. Data, 26(6):1273-1328, 1997.
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 "R32.h"
31 #include "R290.h"
32 
34 {
35  static const double n[]={
36  0.0, //[0]
37  0.1046634e+1, //[1]
38  -0.5451165, //[2]
39  -0.2448595e-2, //[3]
40  -0.4877002e-1, //[4]
41  0.3520158e-1, //[5]
42  0.1622750e-2, //[6]
43  0.2377225e-4, //[7]
44  0.29149e-1, //[8]
45  0.3386203e-2, //[9]
46  -0.4202444e-2, //[10]
47  0.4782025e-3, //[11]
48  -0.5504323e-2, //[12]
49  -0.2418396e-1, //[13]
50  0.4209034, //[14]
51  -0.4616537, //[15]
52  -0.1200513e+1, //[16]
53  -0.2591550e+1, //[17]
54  -0.1400145e+1, //[18]
55  0.8263017 //[19]
56  };
57 
58  static const double d[]={
59  0, //[0]
60  1, //[1]
61  2, //[2]
62  5, //[3]
63  1, //[4]
64  1, //[5]
65  3, //[6]
66  8, //[7]
67  4, //[8]
68  4, //[9]
69  4, //[10]
70  8, //[11]
71  3, //[12]
72  5, //[13]
73  1, //[14]
74  1, //[15]
75  3, //[16]
76  1, //[17]
77  2, //[18]
78  3 //[19]
79  };
80 
81  static const double t[]={
82  0.0, //[0]
83  1.0/4.0, //[1]
84  1.0, //[2]
85  -1.0/4.0, //[3]
86  -1.0, //[4]
87  2.0, //[5]
88  2.0, //[6]
89  3.0/4.0, //[7]
90  1.0/4.0, //[8]
91  18.0, //[9]
92  26.0, //[10]
93  -1.0, //[11]
94  25.0, //[12]
95  7.0/4.0, //[13]
96  4.0, //[14]
97  5.0, //[15]
98  1.0, //[16]
99  3.0/2.0, //[17]
100  1.0, //[18]
101  1.0/2.0 //[19]
102  };
103 
104  static const double c[]={
105  0, //[0]
106  0, //[1]
107  0, //[2]
108  0, //[3]
109  0, //[4]
110  0, //[5]
111  0, //[6]
112  0, //[7]
113  0, //[8]
114  4, //[9]
115  3, //[10]
116  1, //[11]
117  4, //[12]
118  1, //[13]
119  2, //[14]
120  2, //[15]
121  1, //[16]
122  1, //[17]
123  1, //[18]
124  1 //[19]
125  };
126 
127  static const double a0[]={
128  -8.258096, //[0]
129  6.353098, //[1]
130  3.004486, //[2]
131  1.160761, //[3]
132  2.645151, //[4]
133  5.794987, //[5]
134  1.129475 //[6]
135  };
136  static const double n0[]={
137  0.0, //[0]
138  0.0, //[1]
139  0.0, //[2]
140  2.2718538, //[3]
141  11.9144210, //[4]
142  5.1415638, //[5]
143  32.7682170 //[6]
144  };
145 
146  std::vector<double> a0_v(a0,a0+sizeof(a0)/sizeof(double));
147  std::vector<double> n0_v(n0,n0+sizeof(n0)/sizeof(double));
148 
149  phirlist.push_back(new phir_power(n,d,t,c,1,19,20));
150 
151  // return log(delta)+a0[0]+a0[1]*tau+a0[2]*log(tau)+a0[3]*log(1-exp(-n0[3]*tau))+a0[4]*log(1-exp(-n0[4]*tau))+a0[5]*log(1-exp(-n0[5]*tau))+a0[6]*log(1-exp(-n0[6]*tau));
152  phi0list.push_back(new phi0_lead(a0[0],a0[1]));
153  phi0list.push_back(new phi0_logtau(a0[2]));
154  phi0list.push_back(new phi0_Planck_Einstein(a0_v,n0_v,3,6));
155 
156  // Critical parameters
157  crit.rho = 8.1500846*52.024;
158  crit.p = PressureUnit(5782, UNIT_KPA);
159  crit.T = 351.255;
160  crit.v = 1.0/crit.rho;
161 
162  // Other fluid parameters
163  params.molemass = 52.024;
164  params.Ttriple = 136.34;
165  params.ptriple = 0.0480073825051;
166  params.accentricfactor = 0.2769;
167  params.R_u = 8.314471;
168 
169  // Limits of EOS
170  limits.Tmin = params.Ttriple;
171  limits.Tmax = 435.0;
172  limits.pmax = 70000.0;
173  limits.rhomax = 27.4734*params.molemass;
174 
175  EOSReference.assign("Tillner-Roth, R. and Yokozeki, A.,"
176  " \"An international standard equation of state for difluoromethane (R-32)"
177  " for temperatures from the triple point at 136.34 K to 435 K and pressures"
178  " up to 70 MPa,\""
179  " J. Phys. Chem. Ref. Data, 26(6):1273-1328, 1997.");
180  TransportReference.assign("Surface Tension: R. Heide, \"The surface tension of HFC refrigerants and mixtures\", Int J. Refrig. Vol. 20, No. 7, pp. 496-503, 1997");
181 
182  name.assign("R32");
183 
184  ECSReferenceFluid = "Propane";
185 
186  BibTeXKeys.EOS = "TillnerRoth-JPCRD-1997";
187  BibTeXKeys.ECS_LENNARD_JONES = "Huber-IECR-2003";
188  BibTeXKeys.ECS_FITS = "Huber-IECR-2003";
189  BibTeXKeys.SURFACE_TENSION = "Mulero-JPCRD-2012";
190 }
191 double R32Class::psat(double T)
192 {
193  const double ti[]={0,1,1.5,2.3,3.6,5.2,7.3};
194  const double Ni[]={0,-7.4655606703362523, 1.804181047910655, -1.5910694825428875, -0.72617761983564866, -3.0701624093185873, 1.4422289706087676};
195  double summer=0,theta;
196  int i;
197  theta=1.0-T/reduce.T;
198  for (i=1;i<=6;i++)
199  {
200  summer=summer+Ni[i]*pow(theta,ti[i]);
201  }
202  return crit.p.Pa*exp(summer*crit.T/T);
203 }
204 
205 double R32Class::rhosatL(double T)
206 {
207  double theta, phi;
208  phi=T/crit.T;
209  theta=1-phi;
210 
211  return 424.0+434.55*pow(theta,1.0/4.0)+1296.53*pow(theta,2.0/3.0)-777.49*theta+366.84*pow(theta,5.0/3.0);
212 }
213 double R32Class::rhosatV(double T)
214 {
215  const double ti[]={0,0.30280531791334198, 0.7420002747530019, 3.8727512808619684};
216  const double Ni[]={0,-1.6156590624508722, -3.8438826469427365, -4.429417770439076};
217  double summer=0,theta;
218  int i;
219  theta=1.0-T/reduce.T;
220  for (i=1;i<=3;i++)
221  {
222  summer=summer+Ni[i]*pow(theta,ti[i]);
223  }
224  return reduce.rho*exp(summer*crit.T/T);
225 }
226 double R32Class::ECS_psi_viscosity(double rhor)
227 {
228  return 0.7954+5.426580e-2*rhor;
229 }
230 double R32Class::ECS_f_int(double T)
231 {
232  return 0.000436654+0.00000178134*T;
233 }
235 {
236  return 1.2942-0.0924549*rhor;
237 }
238 void R32Class::ECSParams(double *e_k, double *sigma)
239 {
240  *e_k = 289.65;
241  *sigma = 0.4098;
242 }
244 {
245  // From Mulero, 2012, JPCRD
246  return 0.07147*pow(1-T/reduce.T,1.246);
247 }
std::vector< phi_BC * > phirlist
Definition: FluidClass.h:178
struct FluidLimits limits
Definition: FluidClass.h:219
std::string EOS
Definition: FluidClass.h:120
R32Class()
Definition: R32.cpp:33
PressureUnit p
Definition: FluidClass.h:50
std::string ECSReferenceFluid
A list of aliases of names for the Fluid, each element is a std::string instance. ...
Definition: FluidClass.h:154
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: R32.cpp:213
struct CriticalStruct reduce
A pointer to the point that is used to reduce the T and rho for EOS.
Definition: FluidClass.h:222
double surface_tension_T(double T)
Definition: R32.cpp:243
double Tmax
Definition: FluidClass.h:54
std::string ECS_FITS
Definition: FluidClass.h:125
double ECS_f_int(double T)
Definition: R32.cpp:230
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
struct CriticalStruct crit
Definition: FluidClass.h:218
void ECSParams(double *e_k, double *sigma)
Definition: R32.cpp:238
BibTeXKeysStruct BibTeXKeys
Definition: FluidClass.h:175
double ECS_chi_conductivity(double rhor)
Definition: R32.cpp:234
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 ECS_psi_viscosity(double rhor)
Definition: R32.cpp:226
double Tmin
Definition: FluidClass.h:54
double rhomax
Definition: FluidClass.h:54
double rhosatL(double)
Definition: R32.cpp:205
double psat(double)
Definition: R32.cpp:191