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
R1234yf.cpp
Go to the documentation of this file.
1 /*
2 Properties for R1234yf
3 by Ian Bell
4 
5 Thermo props from
6 M. Richter and M.O. McLinden and E.W. Lemmon, "Thermodynamic Properties of 2,3,3,3-Tetrafluoroprop-1-ene
7 (R1234yf): Vapor Pressure and p-rho-T Measurements and an Equation of State"
8 by Reiner Tillner-Roth and Hans Dieter Baehr, J. Chem. Eng. Data, v. 56, 2011, pp 3254-3264
9 */
10 
11 #if defined(_MSC_VER)
12 #define _CRTDBG_MAP_ALLOC
13 #define _CRT_SECURE_NO_WARNINGS
14 #include <stdlib.h>
15 #include <crtdbg.h>
16 #else
17 #include <stdlib.h>
18 #endif
19 
20 #include <math.h>
21 #include "string.h"
22 #include "stdio.h"
23 #include "CoolProp.h"
24 #include "FluidClass.h"
25 #include "R1234yf.h"
26 
28 {
29  static const double n[]={
30  0, //[0]
31  0.04592563, //[1]
32  1.546958, //[2]
33  -2.355237, //[3]
34  -0.4827835, //[4]
35  0.1758022, //[5]
36  -1.210006, //[6]
37  -0.6177084, //[7]
38  0.6805262, //[8]
39  -0.6968555, //[9]
40  -0.02695779, //[10]
41  1.389966, //[11]
42  -0.4777136, //[12]
43  -0.1975184, //[13]
44  -1.147646, //[14]
45  0.0003428541 //[15]
46  };
47 
48  static const double d[]={
49  0, //[0]
50  4, //[1]
51  1, //[2]
52  1, //[3]
53  2, //[4]
54  3, //[5]
55  1, //[6]
56  3, //[7]
57  2, //[8]
58  2, //[9]
59  7, //[10]
60  1, //[11]
61  1, //[12]
62  3, //[13]
63  3, //[14]
64  2, //[15]
65  };
66 
67  static const double t[]={
68  0, //[0]
69  1, //[1]
70  0.32, //[2]
71  0.929, //[3]
72  0.94, //[4]
73  0.38, //[5]
74  2.28, //[6]
75  1.76, //[7]
76  0.97, //[8]
77  2.44, //[9]
78  1.05, //[10]
79  1.4, //[11]
80  3, //[12]
81  3.5, //[13]
82  1, //[14]
83  3.5 //[15]
84  };
85 
86  static const double c[]={
87  0, //[0]
88  0, //[1]
89  0, //[2]
90  0, //[3]
91  0, //[4]
92  0, //[5]
93  2, //[6]
94  2, //[7]
95  1, //[8]
96  2, //[9]
97  1, //[10]
98  };
99 
100  static const double alpha[]={
101  0, //[0]
102  0, //[1]
103  0, //[2]
104  0, //[3]
105  0, //[4]
106  0, //[5]
107  0, //[6]
108  0, //[7]
109  0, //[8]
110  0, //[9]
111  0, //[10]
112  1.02, //[11]
113  1.336, //[12]
114  1.055, //[13]
115  5.84, //[14]
116  16.2, //[15]
117  };
118 
119  static const double beta[]={
120  0, //[0]
121  0, //[1]
122  0, //[2]
123  0, //[3]
124  0, //[4]
125  0, //[5]
126  0, //[6]
127  0, //[7]
128  0, //[8]
129  0, //[9]
130  0, //[10]
131  1.42, //[11]
132  2.31, //[12]
133  0.89, //[13]
134  80, //[14]
135  108, //[15]
136  };
137 
138  static const double gamma[]={
139  0, //[0]
140  0, //[1]
141  0, //[2]
142  0, //[3]
143  0, //[4]
144  0, //[5]
145  0, //[6]
146  0, //[7]
147  0, //[8]
148  0, //[9]
149  0, //[10]
150  1.13, //[11]
151  0.67, //[12]
152  0.46, //[13]
153  1.28, //[14]
154  1.2 //[15]
155  };
156 
157  static const double epsilon[]={
158  0, //[0]
159  0, //[1]
160  0, //[2]
161  0, //[3]
162  0, //[4]
163  0, //[5]
164  0, //[6]
165  0, //[7]
166  0, //[8]
167  0, //[9]
168  0, //[10]
169  0.712, //[11]
170  0.91, //[12]
171  0.677, //[13]
172  0.718, //[14]
173  1.64 //[15]
174  };
175 
176  static const double v0[]={
177  0.0, //[0]
178  7.549, //[1]
179  1.537, //[2]
180  2.030, //[3]
181  7.455, //[4]
182  };
183  static const double u0[]={
184  // each of the ui terms are divided by the critical temp {fie on you Mr. EOS-maker}
185  0.0, //[0]
186  718/367.85, //[1]
187  877/367.85, //[2]
188  4465/367.85,//[3]
189  1755/367.85,//[4]
190  };
191 
192  std::vector<double> u0_v(u0,u0+sizeof(u0)/sizeof(double));
193  std::vector<double> v0_v(v0,v0+sizeof(v0)/sizeof(double));
194 
195  phirlist.push_back(new phir_power(n,d,t,c,1,10,11));
196  phirlist.push_back(new phir_gaussian(n,d,t,alpha,epsilon,beta,gamma,11,15,16));
197 
198  phi0list.push_back(new phi0_lead(-12.837928,8.042605));
199  phi0list.push_back(new phi0_logtau(4.944));
200  phi0list.push_back(new phi0_Planck_Einstein(v0_v,u0_v,1,4));
201 
202  // Critical parameters
203  crit.rho = 475.553441976;
204  crit.p = PressureUnit(3382.2, UNIT_KPA);
205  crit.T = 367.85;
206  crit.v = 1.0/crit.rho;
207 
208  // Other fluid parameters
209  params.molemass = 114.0415928;
210  params.Ttriple = 220;
211  params.ptriple = 31.5093083629;
212  params.accentricfactor = 0.276;
213  params.R_u = 8.314472;
214 
215  // Limits of EOS
216  limits.Tmin = 220;
217  limits.Tmax = 410.0;
218  limits.pmax = 30000.0;
219  limits.rhomax = 11.64*params.molemass;
220 
221  EOSReference.assign("Richter, M. and M.O. McLinden and E.W. Lemmon, \"Thermodynamic Properties of 2,3,3,3-Tetrafluoroprop-1-ene"
222  "(R1234yf): Vapor Pressure and p-rho-T Measurements and an Equation of State\""
223  ", J. Chem. Eng. Data, v. 56, 2011, pp 3254-3264");
224  TransportReference.assign("Surface Tension: Katsuyuki Tanaka, Yukihiro Higashi, \"Thermodynamic properties of HFO-1234yf (2,3,3,3-tetrafluoropropene)\", International Journal of Refrigeration 33 (2010) 474-479");
225 
226  name.assign("R1234yf");
227  aliases.push_back("R1234YF");
228 
229  BibTeXKeys.EOS = "Richter-JCED-2011";
230  BibTeXKeys.SURFACE_TENSION = "Mulero-JPCRD-2012";
231  BibTeXKeys.CONDUCTIVITY = "Perkins-JCED-2011";
232 
233 }
234 double R1234yfClass::psat(double T)
235 {
236  // Maximum absolute error is 0.012005 % between 220.000001 K and 367.849999 K
237  const double ti[]={0,1.0,1.5,2.3,3.6,5.2,7.3};
238  const double Ni[]={0,-7.4299777557954254, 1.9583865741838868, -2.4230509106877167, 1.4167726905491065, -9.6120250676570098, 15.003017622880735 };
239  double summer=0,theta;
240  int i;
241  theta=1-T/reduce.T;
242  for (i=1;i<=6;i++)
243  {
244  summer=summer+Ni[i]*pow(theta,ti[i]);
245  }
246  return crit.p.Pa*exp(crit.T/T*summer);
247 }
248 double R1234yfClass::rhosatL(double T)
249 {
250  // Maximum absolute error is 0.320186 % between 220.000001 K and 367.849999 K
251  const double Ni[]={0,1.4756519570309901, -0.57454181759520018, 0.76682587551792647, -0.510882068727329, 0.66112133039760046};
252  const double ti[]={0,0.31104118625261612, 1.1997863650360587, 1.8936812371106437, 3.0633279469212082, 6.4584770277609298};
253  double summer=0;
254  int i;
255  double theta;
256  theta=1-T/reduce.T;
257  for (i=1;i<=5;i++)
258  {
259  summer+=Ni[i]*pow(theta,ti[i]);
260  }
261  return crit.rho*exp(summer);
262 }
263 double R1234yfClass::rhosatV(double T)
264 {
265  // Maximum absolute error is 0.189556 % between 220.000001 K and 367.849999 K
266  const double Ni[]={0,-2.4937203841988023, -4.0958221912377883, 2.598118460659435, -4.9686143098130451, -4.0779557647493059};
267  const double ti[]={0,0.36409300811029677, 0.99593569215609024, 1.8193545503400304, 3.0060054082610717, 7.955467733338411};
268  double summer=0,theta;
269  int i;
270  theta=1.0-T/reduce.T;
271  for (i=1;i<=5;i++)
272  {
273  summer=summer+Ni[i]*pow(theta,ti[i]);
274  }
275  return crit.rho*exp(crit.T/T*summer);
276 }
278 {
279  // From Mulero, 2012, JPCRD
280  return 0.06274*pow(1-T/reduce.T,1.394);
281 }
282 double R1234yfClass::conductivity_Trho(double T, double rho)
283 {
284  double sumresid = 0;
285  double A[] = {-0.0102778, 0.0291098, 0.000860643};
286  double B1[] = {0, -0.0368219, 0.0883226, -0.0705909, 0.0259026, -0.00322950};
287  double B2[] = {0, 0.0397166, -0.0772390, 0.0664707, -0.0249071, 0.00336228};
288 
289  double lambda_0 = A[0]*pow(T/reduce.T,0)+A[1]*pow(T/reduce.T,1)+A[2]*pow(T/reduce.T,2);
290 
291  for (int i = 1; i <= 5; i++)
292  {
293  sumresid += (B1[i]+B2[i]*T/reduce.T)*pow(rho/reduce.rho,i);
294  }
295  double lambda_r = sumresid;
296 
297  double lambda_c = this->conductivity_critical(T,rho,1/(0.585e-9));
298 
299  return lambda_0+lambda_r+lambda_c;
300 }
double rhosatV(double)
Definition: R1234yf.cpp:263
std::vector< phi_BC * > phirlist
Definition: FluidClass.h:178
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 psat(double)
Definition: R1234yf.cpp:234
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
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 EOSReference
The critical qd parameter for the Olchowy-Sengers cross-over term.
Definition: FluidClass.h:157
std::string SURFACE_TENSION
Definition: FluidClass.h:126
double pmax
Definition: FluidClass.h:54
params
struct CriticalStruct crit
Definition: FluidClass.h:218
BibTeXKeysStruct BibTeXKeys
Definition: FluidClass.h:175
double conductivity_Trho(double T, double rho)
Definition: R1234yf.cpp:282
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 rhosatL(double)
Definition: R1234yf.cpp:248
double surface_tension_T(double T)
Definition: R1234yf.cpp:277
double Tmin
Definition: FluidClass.h:54
double rhomax
Definition: FluidClass.h:54
std::string CONDUCTIVITY
Definition: FluidClass.h:123