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
R124.cpp
Go to the documentation of this file.
1 #include "CoolProp.h"
2 #include "FluidClass.h"
3 #include "R124.h"
4 
6 {
7  double n[] = {0.0, -0.1262962e-1, 0.2168373e1, -0.3330033e1, 0.1610361e0, -0.9666145e-4, 0.1191310e-1, -0.2880217e-2, 0.1681346e-2, 0.1594968e-4, 0.1289674e0, 0.1182213e-4, -0.4713997e0, -0.2412873e0, 0.6868066e0, -0.8621095e-1, 0.4728645e-5, 0.1487933e-1, -0.3001338e-1, 0.1849606e-2, 0.4126073e-3};
8  double t[] = {0, 2, 0.5, 1, 0.5, 2.5, -1, 1, 0, -0.5, 1.5, 1, 2.5, -0.25, 1, 5, 2, 15, 20, 15, 45};
9  double d[] = {0, 1, 1, 1, 2, 2, 3, 5, 6, 8, 2, 12, 1, 1, 1, 1, 15, 3, 3, 4, 9};
10  double c[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 2, 3, 3, 4, 4};
11 
12  //Critical parameters
13  crit.rho = 560; //[kg/m^3]
14  crit.p = PressureUnit(3624.295, UNIT_KPA); //[kPa]
15  crit.T = 395.425; //[K]
16  crit.v = 1/crit.rho;
17 
18  // Other fluid parameters
19  params.molemass = 136.4762;
20  params.Ttriple = 75;
21  params.accentricfactor = 0.28809508422142915;
22  params.R_u = 8.314471;
23  params.ptriple = 2.67380659624e-05;
24 
25  // Limits of EOS
26  limits.Tmin = 120;
27  limits.Tmax = 500.0;
28  limits.pmax = 100000.0;
29  limits.rhomax = 1000000.0*params.molemass;
30 
31  phirlist.push_back(new phir_power( n,d,t,c,1,20,21));
32 
33  double a0[] = {0, -11.669406, 9.8760443, 2.175638, -7.389735, 0.8736831, -0.1115133};
34  double t0[] = {0, 0, 0, 0, -1, -2, -3};
35  phi0list.push_back(new phi0_lead(a0[1],a0[2]));
36  phi0list.push_back(new phi0_logtau(a0[3]));
37  phi0list.push_back(new phi0_power(a0,t0,4,6,7));
38 
39  name.assign("R124");
40  REFPROPname.assign("R124");
41 
42  ECSReferenceFluid = "Propane";
43 
44  BibTeXKeys.EOS = "deVries-ICR-1995";
45  BibTeXKeys.ECS_FITS = "Huber-IECR-2003";
46  BibTeXKeys.ECS_LENNARD_JONES = "Huber-IECR-2003";
47  BibTeXKeys.SURFACE_TENSION = "Mulero-JPCRD-2012";
48 }
49 double R124Class::psat(double T)
50 {
51  // Max error is 0.0279351679648 % between 120.0 and 395.424999 K
52 
53  const double t[]={0, 1.0, 1.1666666666666667, 2.1666666666666665, 4.0, 0.10300000000000001, 20.5};
54  const double N[]={0, -8.2641394088060451, 1.9700771584419117, -0.68404895752825745, -3.8373863290050365, 0.0010940746131683551, -5.7602251358930756};
55  double summer=0,theta;
56  int i;
57  theta=1-T/reduce.T;
58  for (i=1; i<=6; i++)
59  {
60  summer += N[i]*pow(theta,t[i]);
61  }
62  return reduce.p.Pa*exp(reduce.T/T*summer);
63 }
64 double R124Class::rhosatL(double T)
65 {
66  // Maximum absolute error is 0.047253 % between 120.000001 K and 395.424990 K
67  const double t[] = {0, 0.16666666666666666, 0.3333333333333333, 0.6666666666666666, 0.8333333333333334, 1.0, 1.1666666666666667, 1.3333333333333333, 1.5, 1.8333333333333333};
68  const double N[] = {0, 0.54460398539271582, -4.4987463762100068, 251.49391057033526, -1397.1450617052847, 3683.0652090962581, -5428.9802833050198, 4444.2844628889843, -1678.1869995481597, 132.34762851690652};
69  double summer=0,theta;
70  theta=1-T/reduce.T;
71  for (int i=1; i<=9; i++)
72  {
73  summer += N[i]*pow(theta,t[i]);
74  }
75  return reduce.rho*(summer+1);
76 }
77 double R124Class::rhosatV(double T)
78 {
79  // Maximum absolute error is 0.238754 % between 120.000001 K and 395.424990 K
80  const double t[] = {0, 0.16666666666666666, 0.3333333333333333, 0.5, 0.6666666666666666, 0.8333333333333334, 1.0, 1.1666666666666667, 1.3333333333333333, 1.5, 1.8333333333333333, 2.1666666666666665};
81  const double N[] = {0, -3.3190002541376638, 98.066603725937682, -1099.3702782361622, 6474.8477240028406, -23329.943477608645, 54044.724766470717, -80717.214878933504, 73706.624741330088, -33782.751910421401, 5453.4809807406809, -855.85806906737628};
82  double summer=0,theta;
83  theta=1-T/reduce.T;
84  for (int i=1; i<=11; i++)
85  {
86  summer += N[i]*pow(theta,t[i]);
87  }
88  return reduce.rho*exp(reduce.T/T*summer);
89 }
std::vector< phi_BC * > phirlist
Definition: FluidClass.h:178
R124Class()
Definition: R124.cpp:5
struct FluidLimits limits
Definition: FluidClass.h:219
std::string EOS
Definition: FluidClass.h:120
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
double Pa
Definition: Units.h:22
double psat(double)
Definition: R124.cpp:49
double rhosatV(double)
Definition: R124.cpp:77
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 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 pmax
Definition: FluidClass.h:54
params
double rhosatL(double)
Definition: R124.cpp:64
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 Tmin
Definition: FluidClass.h:54
double rhomax
Definition: FluidClass.h:54