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
R23.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 "R23.h"
6 
8 {
9  double n[] = {0.0, 7.041529, -8.259512, 0.008053040, -0.08617615, 0.006333410, -0.1863285, 0.3280510, 0.5191023, 0.06916144, -0.005045875, -0.01744221, -0.05003972, 0.04729813, -0.06164031, 0.01583585, -0.001795790, -0.001099007};
10  double t[] = {0, 0.744, 0.94, 4.3, 1.46, 0.68, 4.8, 1.5, 2.07, 0.09, 9.6, 0.19, 11.2, 0.27, 1.6, 10.3, 14.0, 15.0};
11  double d[] = {0, 1, 1, 1, 2, 5, 1, 2, 3, 5, 1, 2, 2, 4, 4, 4, 2, 2};
12  double c[] = {0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 4};
13 
14  //Critical parameters
15  crit.rho = 7.52*70.01385; //[kg/m^3]
16  crit.p = PressureUnit(4832, UNIT_KPA); //[kPa]
17  crit.T = 299.293; //[K]
18  crit.v = 1/crit.rho;
19 
20  // Other fluid parameters
21  params.molemass = 70.01385;
22  params.Ttriple = 118.02;
23  params.accentricfactor = 0.262964892496154;
24  params.R_u = 8.314472;
25  params.ptriple = 0.058;
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,17,18));
34 
35  const double a1 = 2.999, a2 = -8.31386064, a3 = 6.55087253;
36  phi0list.push_back(new phi0_lead(a2,a3));
37  phi0list.push_back(new phi0_logtau(a1));
38 
39  const double u0[] = {0, 744/crit.T, 1459/crit.T, 2135/crit.T, 4911/crit.T};
40  const double v0[] = {0, 2.371, 3.237, 2.610, 0.8274};
41  std::vector<double> u0_v(u0,u0+sizeof(u0)/sizeof(double));
42  std::vector<double> v0_v(v0,v0+sizeof(v0)/sizeof(double));
43 
44  phi0list.push_back(new phi0_Planck_Einstein(v0_v,u0_v,1,4));
45 
46  EOSReference.assign("Steven G. Penoncello,Eric W. Lemmon,Richard T Jacobsen,Zhengjun Shan, \"A Fundamental Equation for Trifluoromethane (R-23)\", J. Phys. Chem. Ref. Data, Vol. 32, No. 4, 2003");
47  TransportReference.assign("Using ECS in fully predictive mode");
48 
49  name.assign("R23");
50  REFPROPname.assign("R23");
51 
52  BibTeXKeys.EOS = "Penoncello-JPCRD-2003";
53  BibTeXKeys.ECS_LENNARD_JONES = "Shan-ASHRAE-2000";
54  BibTeXKeys.SURFACE_TENSION = "Mulero-JPCRD-2012";
55  BibTeXKeys.CONDUCTIVITY = "Shan-ASHRAE-2000";
56  BibTeXKeys.VISCOSITY = "Shan-ASHRAE-2000";
57 }
58 
59 double R23Class::psat(double T)
60 {
61  const double ti[]={0,1.0,1.5,2.4,3.9};
62  const double Ni[]={0,-7.2631,1.3140,-0.78507,-3.1991};
63  double summer=0,theta;
64  int i;
65  theta=1-T/reduce.T;
66  for (i=1;i<=4;i++)
67  {
68  summer=summer+Ni[i]*pow(theta,ti[i]);
69  }
70  return reduce.p.Pa*exp(reduce.T/T*summer);
71 }
72 double R23Class::rhosatL(double T)
73 {
74  const double ti[]={0,0.37,0.94,3.1};
75  const double Ni[]={0,2.2636,0.47007,0.28660};
76  double summer=0;
77  int i;
78  double theta;
79  theta=1-T/reduce.T;
80  for (i=1;i<=3;i++)
81  {
82  summer+=Ni[i]*pow(theta,ti[i]);
83  }
84  return reduce.rho*(summer+1);
85 }
86 double R23Class::rhosatV(double T)
87 {
88  // Maximum absolute error is 0.872847 % between 277.060001 K and 557.375990 K
89  const double ti[]={0,0.43,1.4,3.7,8.0};
90  const double Ni[]={0,-3.5136,-7.7491,-24.871,-65.637};
91  double summer=0,theta;
92  int i;
93  theta=1.0-T/reduce.T;
94  for (i=1;i<=4;i++)
95  {
96  summer=summer+Ni[i]*pow(theta,ti[i]);
97  }
98  return reduce.rho*exp(summer);
99 }
100 
101 double R23Class::viscosity_Trho(double T, double rho)
102 {
103  double C1 = 1.3163, //
104  C2 = 0.1832,
105  DeltaGstar = 771.23,
106  rhoL = 32.174,
107  rhocbar = 7.5114,
108  DELTAeta_max = 3.967,
109  k = 1.380658e-23,
110  N_A = 6.022137e23,
111  pi = 3.141592654,
112  Ru = 8.31451;
113 
114  double a[] = {0.4425728, -0.5138403, 0.1547566, -0.02821844, 0.001578286};
115  double e_k, sigma;
116  this->ECSParams(&e_k,&sigma);
117  double Tstar = T/e_k;
118  double logTstar = log(Tstar);
119  double Omega = exp(a[0]+a[1]*logTstar+a[2]*pow(logTstar,2)+a[3]*pow(logTstar,3)+a[4]*pow(logTstar,4));
120  double eta_DG = 5.0/16.0*sqrt(params.molemass*k*T/(1000*pi*N_A))*1e24/(sigma*sigma*Omega); // uPa-s
121 
122  double rhobar = rho/params.molemass; // [mol/L]
123  double eta_L = C2*(rhoL*rhoL)/(rhoL-rhobar)*sqrt(T)*exp(rhobar/(rhoL-rhobar)*DeltaGstar/(Ru*T));
124 
125  double chi = rhobar - rhocbar;
126  double tau = T - reduce.T;
127 
128  double DELTAeta_c = 4*DELTAeta_max/((exp(chi)+exp(-chi))*(exp(tau)+exp(-tau)));
129 
130  return (pow((rhoL-rhobar)/rhoL,C1)*eta_DG+pow(rhobar/rhoL,C1)*eta_L+DELTAeta_c)/1e6;
131 }
132 
133 double R23Class::conductivity_Trho(double T, double rho)
134 {
135  double B1 = -2.5370, //
136  B2 = 0.05366,
137  C1 = 0.94215,
138  C2 = 0.14914,
139  DeltaGstar = 2508.58,
140  rhoL = 68.345,
141  rhocbar = 7.5114,
142  DELTAlambda_max = 25,
143  Ru = 8.31451;
144 
145  double lambda_DG = B1 + B2*T;
146 
147  double rhobar = rho/params.molemass; // [mol/L]
148  double lambda_L = C2*(rhoL*rhoL)/(rhoL-rhobar)*sqrt(T)*exp(rhobar/(rhoL-rhobar)*DeltaGstar/(Ru*T));
149 
150  double chi = rhobar - rhocbar;
151  double tau = T - reduce.T;
152 
153  double DELTAlambda_c = 4*DELTAlambda_max/((exp(chi)+exp(-chi))*(exp(tau)+exp(-tau)));
154 
155  return (pow((rhoL-rhobar)/rhoL,C1)*lambda_DG+pow(rhobar/rhoL,C1)*lambda_L+DELTAlambda_c)/1e3;
156 }
std::vector< phi_BC * > phirlist
Definition: FluidClass.h:178
R23Class()
Definition: R23.cpp:7
struct FluidLimits limits
Definition: FluidClass.h:219
std::string EOS
Definition: FluidClass.h:120
std::string VISCOSITY
Definition: FluidClass.h:122
PressureUnit p
Definition: FluidClass.h:50
std::string name
A container to hold the cache for residual Helmholtz derivatives.
Definition: FluidClass.h:151
double rhosatL(double)
Definition: R23.cpp:72
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
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
void ECSParams(double *e_k, double *sigma)
Definition: R23.h:19
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 conductivity_Trho(double, double)
Definition: R23.cpp:133
double rhosatV(double)
Definition: R23.cpp:86
double pmax
Definition: FluidClass.h:54
params
struct CriticalStruct crit
Definition: FluidClass.h:218
BibTeXKeysStruct BibTeXKeys
Definition: FluidClass.h:175
double psat(double)
Definition: R23.cpp:59
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 viscosity_Trho(double, double)
Definition: R23.cpp:101
double Tmin
Definition: FluidClass.h:54
double rhomax
Definition: FluidClass.h:54
std::string CONDUCTIVITY
Definition: FluidClass.h:123