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
R12_R113.cpp
Go to the documentation of this file.
1 #include "CoolProp.h"
2 #include <vector>
3 #include "CPExceptions.h"
4 #include "FluidClass.h"
5 #include "R12_R113.h"
6 
8 {
9  double n[] = {0, 2.075343402E+00, -2.962525996E+00, 1.001589616E-02, 1.781347612E-02, 2.556929157E-02, 2.352142637E-03, -8.495553314E-05, -1.535945599E-02, -2.108816776E-01, -1.654228806E-02, -1.181316130E-02, -4.160295830E-05, 2.784861664E-05, 1.618686433E-06, -1.064614686E-01, 9.369665207E-04, 2.590095447E-02, -4.347025025E-02, 1.012308449E-01, -1.100003438E-01, -3.361012009E-03, 3.789190008E-04};
10  double t[] = {0, 0.5, 1, 2, 2.5, -0.5, 0, 0, -0.5, 1.5, 2.5, -0.5, 0, 0.5, -0.5, 4, 4, 2, 4, 12, 14, 0, 14};
11  double d[] = {0, 1, 1, 1, 2, 4, 6, 8, 1, 1, 5, 7, 12, 12, 14, 1, 9, 1, 1, 3, 3, 5, 9};
12  double c[] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 3, 4};
13 
14  //Critical parameters
15  crit.rho = 565; //[kg/m^3]
16  crit.p = PressureUnit(4136.1, UNIT_KPA); //[kPa]
17  crit.T = 385.12; //[K]
18  crit.v = 1/crit.rho;
19 
20  // Other fluid parameters
21  params.molemass = 120.913;
22  params.Ttriple = 116.099;
23  params.accentricfactor = 0.17947831734355124;
24  params.R_u = 8.314471;
25  params.ptriple = 0.000242549651843;
26 
27  // Limits of EOS
28  limits.Tmin = params.Ttriple;
29  limits.Tmax = 500.0;
30  limits.pmax = 100000.0;
31  limits.rhomax = 1000000.0*params.molemass;
32 
33  phirlist.push_back(new phir_power(n,d,t,c,1,22,23));
34 
35  const double a0[] = {0, 0.100100905e2, -0.466434985e1, 0.300361975e1, 0.316062357e1, 0.371258136, 0.356226039e1, 0.212152336e1};
36  const double n0[] = {0, 0, 0, 0, 0.372204562e1, 0.630985083e1, 0.178037889e1, 0.107087607e1};
37  phi0list.push_back(new phi0_lead(a0[1],a0[2]));
38  phi0list.push_back(new phi0_logtau(a0[3]));
39  phi0list.push_back(new phi0_Planck_Einstein(a0,n0,4,7,8));
40 
41  name.assign("R12");
42  REFPROPname.assign("R12");
43 
44  ECSReferenceFluid = "R134a";
45 
46  BibTeXKeys.EOS = "Marx-BOOK-1992";
47  BibTeXKeys.SURFACE_TENSION = "Mulero-JPCRD-2012";
48 }
49 double R12Class::psat(double T)
50 {
51 // Max error is 0.183805186373 % between 116.099 and 385.119999 K
52 
53  const double t[]={0, 0.061, 0.39599999999999996, 0.39949999999999997, 0.5, 1.1666666666666667, 4.5};
54  const double N[]={0, 0.0045343799045095765, -176.10634960801124, 186.36514355948748, -12.261063583187864, -4.3088070968281045, -3.2069974876341432};
55  double summer=0,theta;
56  theta=1-T/reduce.T;
57  for (int i=1;i<=6;i++)
58  {
59  summer += N[i]*pow(theta,t[i]);
60  }
61  return reduce.p.Pa*exp(reduce.T/T*summer);
62 }
63 
64 double R12Class::rhosatL(double T)
65 {
66  // Maximum absolute error is 0.161217 % between 116.099001 K and 385.119990 K
67  const double t[] = {0, 0.5, 0.6666666666666666, 0.8333333333333334, 1.0, 1.1666666666666667, 1.3333333333333333, 1.6666666666666667, 1.8333333333333333};
68  const double N[] = {0, -15.83265376429673, 293.31579672214946, -1480.3857720260487, 3652.8805027085969, -4786.5713610565572, 2926.1361104385555, -923.27691484452203, 336.57663013621755};
69  double summer=0,theta;
70  theta=1-T/reduce.T;
71  for (int i=1; i<=8; i++)
72  {
73  summer += N[i]*pow(theta,t[i]);
74  }
75  return reduce.rho*(summer+1);
76 }
77 
78 double R12Class::rhosatV(double T)
79 {
80  // Maximum absolute error is 0.273246 % between 116.099001 K and 385.119990 K
81  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, 2.8333333333333335};
82  const double N[] = {0, 5.1535942287482994, -181.88689154055641, 2234.5003934456213, -14430.538256207248, 55957.145780671788, -138171.17272878395, 219037.45896919936, -212488.7912512334, 104039.14478204225, -19890.345389677819, 4094.3597114320387, -214.43675518312637};
83  double summer=0,theta;
84  theta=1-T/reduce.T;
85  for (int i=1; i<=12; i++)
86  {
87  summer += N[i]*pow(theta,t[i]);
88  }
89  return reduce.rho*exp(reduce.T/T*summer);
90 }
91 
93 {
94  double n[] = {0, 8.432092286E-01, -2.019185967E+00, 2.920612996E-01, 5.323107661E-02, 3.214971931E-03, 4.667858574E-05, -1.227522799E-06, 8.167288718E-01, -1.340790803E+00, 4.065752705E-01, -1.534754634E-01, -2.414435149E-02, -2.113056197E-02, -3.565436205E-02, 1.364654968E-03, -1.251838755E-02, -1.385761351E-03, 7.206335486E-04};
95  double t[] = {0, 0.5, 1.5, 1.5, -0.5, 2, 0, 3, -0.5, 0, 2, 1.5, 6, 2, 10, 6, 18, 15, 33};
96  double d[] = {0, 1, 1, 2, 3, 4, 8, 8, 3, 3, 3, 5, 1, 2, 2, 9, 3, 7, 8};
97  double c[] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 4};
98 
99  //Critical parameters
100  crit.rho = 560; //[kg/m^3]
101  crit.p = PressureUnit(3.3922e+006, UNIT_PA); //[Pa]
102  crit.T = 487.21; //[K]
103  crit.v = 1/crit.rho;
104 
105  // Other fluid parameters
106  params.molemass = 187.375;
107  params.Ttriple = 236.93;
108  params.accentricfactor = 0.252535;
109  params.R_u = 8.314471;
110  params.ptriple = 1.87;
111 
112  // Limits of EOS
113  limits.Tmin = params.Ttriple;
114  limits.Tmax = 500.0;
115  limits.pmax = 100000.0;
116  limits.rhomax = 1000000.0*params.molemass;
117 
118  phirlist.push_back(new phir_power(n,d,t,c,1,18,19));
119 
120 
121  const double a0[] = {0, 0.131479282e2, -0.540537150e1, 0.299999660e1, 0.124464495e2, 0.272181845e1, 0.692712415, 0.332248298e1};
122  const double n0[] = {0, 0, 0, 0, 0.104971737e1, 0.329788641e1, 0.862650812e1, 0.329670446e1};
123  phi0list.push_back(new phi0_lead(a0[1],a0[2]));
124  phi0list.push_back(new phi0_logtau(a0[3]));
125  phi0list.push_back(new phi0_Planck_Einstein(a0,n0,4,7,8));
126 
127  name.assign("R113");
128  REFPROPname.assign("R113");
129 
130  ECSReferenceFluid = "R134a";
131 
132  BibTeXKeys.EOS = "Marx-BOOK-1992";
133  BibTeXKeys.SURFACE_TENSION = "Mulero-JPCRD-2012";
134 }
135 double R113Class::psat(double T)
136 {
137  // Max error is 0.00128904261907 % between 236.93 and 487.2099 K for R113
138  const double t[]={0, 0.355, 0.3655, 0.37949999999999995, 0.38349999999999995, 0.38799999999999996, 1.0, 3.5, 5.333333333333333};
139  const double N[]={0, -3646.3118537142432, 16570.730897402966, -98171.161964374915, 129366.66532534534, -44120.515841660555, -5.7968125449420569, -2.5886120102205661, -2.0563715554268542};
140  double summer=0,theta;
141  theta=1-T/reduce.T;
142  for (int i=1; i<=8; i++)
143  {
144  summer += N[i]*pow(theta,t[i]);
145  }
146  return reduce.p.Pa*exp(reduce.T/T*summer);
147 }
148 
149 double R113Class::rhosatL(double T)
150 {
151  // Maximum absolute error is 0.043960 % between 236.930001 K and 487.209990 K
152  const double t[] = {0, 0.6666666666666666, 0.8333333333333334, 1.0, 1.1666666666666667, 1.3333333333333333, 1.6666666666666667, 2.0};
153  const double N[] = {0, 178.98095062724852, -1130.7872484737015, 3081.8200478483832, -4230.0445838570422, 2591.7469721955208, -602.56423497728849, 114.08084768423475};
154  double summer=0,theta;
155  theta=1-T/reduce.T;
156  for (int i=1; i<=7; i++)
157  {
158  summer += N[i]*pow(theta,t[i]);
159  }
160  return reduce.rho*(summer+1);
161 }
162 
163 double R113Class::rhosatV(double T)
164 {
165  // Maximum absolute error is 0.228945 % between 236.930001 K and 487.209990 K
166  const double t[] = {0, 0.5, 0.6666666666666666, 0.8333333333333334, 1.0, 1.1666666666666667, 1.3333333333333333, 1.6666666666666667, 2.0};
167  const double N[] = {0, 24.762566760651598, -431.27133184173249, 2284.6772084467916, -6030.4478775727466, 8441.9421957649065, -5424.8443870386272, 1453.4553856467098, -328.27673845437351};
168  double summer=0,theta;
169  theta=1-T/reduce.T;
170  for (int i=1; i<=8; i++)
171  {
172  summer += N[i]*pow(theta,t[i]);
173  }
174  return reduce.rho*exp(reduce.T/T*summer);
175 }
176 
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 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
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
double rhosatL(double)
Definition: R12_R113.cpp:64
std::string REFPROPname
The name of the fluid.
Definition: FluidClass.h:152
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
R12Class()
Definition: R12_R113.cpp:7
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 rhosatV(double)
Definition: R12_R113.cpp:163
double psat(double)
Definition: R12_R113.cpp:135
double Tmin
Definition: FluidClass.h:54
double rhosatV(double)
Definition: R12_R113.cpp:78
double rhomax
Definition: FluidClass.h:54
double rhosatL(double)
Definition: R12_R113.cpp:149
double psat(double)
Definition: R12_R113.cpp:49