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
Ether.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 "Ether.h"
6 #include "REFPROP.h"
7 
9 {
10  double n[] = {0.0, 0.029814139, 1.43517, -2.64964, -0.29515532, 0.17035607, -0.94642918, -0.099250514, 1.1264071, -0.76936548, -0.020717696, 0.24527037, 1.1863438, -0.49398368, -0.16388716, -0.027583584};
11  double t[] = {0, 1, 0.4366, 1.011, 1.137, 0.45, 2.83, 1.5, 1.235, 2.675, 0.7272, 1.816, 1.783, 3.779, 3.282, 1.059};
12  double d[] = {0, 4, 1, 1, 2, 3, 1, 3, 2, 2, 7, 1, 1, 1, 3, 3};
13  double c[] = {0, 0, 0, 0, 0, 0, 2, 2, 1, 2, 1, 1, 0, 0, 0, 0};
14  double eta[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.965336, 1.50858, 0.963855, 9.72643};
15  double beta[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.28719, 0.806235, 0.777942, 197.681};
16  double gamma[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.27772, 0.43075, 0.429607, 1.13849};
17  double epsilon[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.672698, 0.924246, 0.750815, 0.800022};
18 
19  //Critical parameters
20  crit.rho = 5.940*46.06844; //[kg/m^3]
21  crit.p = PressureUnit(5336.8, UNIT_KPA); //[kPa]
22  crit.T = 400.378; //[K]
23  crit.v = 1/crit.rho;
24 
25  // Other fluid parameters
26  params.molemass = 46.06844;
27  params.Ttriple = 131.66;
28  params.accentricfactor = 0.196;
29  params.R_u = 8.314472;
30  params.ptriple = 0.0022;
31 
32  // Limits of EOS
33  limits.Tmin = params.Ttriple;
34  limits.Tmax = 500.0;
35  limits.pmax = 100000.0;
36  limits.rhomax = 1000000.0*params.molemass;
37 
38  phirlist.push_back(new phir_power( n,d,t,c,1,11,16));
39  phirlist.push_back(new phir_gaussian( n,d,t, eta, epsilon, beta, gamma, 12,15,16));
40 
41  const double a1 = -1.980976, a2 = 3.171218, c0 = 4.039;
42  phi0list.push_back(new phi0_lead(a1,a2));
43  phi0list.push_back(new phi0_logtau(c0-1));
44 
45  const double u0[] = {0, 361/crit.T, 974/crit.T, 1916/crit.T, 4150/crit.T};
46  const double v0[] = {0, 2.641, 2.123, 8.992, 6.191};
47  std::vector<double> u0_v(u0,u0+sizeof(u0)/sizeof(double));
48  std::vector<double> v0_v(v0,v0+sizeof(v0)/sizeof(double));
49 
50  phi0list.push_back(new phi0_Planck_Einstein(v0_v,u0_v,1,4));
51 
52  EOSReference.assign("Jiangtao Wu, Yong Zhou, Eric W. Lemmon, \"An Equation of State for the Thermodynamic Properties of Dimethyl Ether\", J. Phys. Chem. Ref. Data, Vol. 40, No. 2, 2011");
53  TransportReference.assign("Viscosity: Xianyang Meng, Jianbo Zhang, Jiangtao Wu, and Zhigang Liu, \" Experimental Measurement and Modeling of the Viscosity of Dimethyl Ether\" J. Chem. Eng.Data 2012, 57, 988-993\n\nErratum: Limits for deltaeta_r sums should be 0-3 and 4-9. The correct order of terms based on the original indices are 0,1,7,9,2,3,4,5,6,8\n\n"
54  "Using ECS in fully predictive mode for viscosity\n\n"
55  "Lennard-Jones parameters from Chichester NISTIR 6650");
56  name.assign("DimethylEther");
57  aliases.push_back(std::string("DIMETHYLETHER"));
58  REFPROPname.assign("DME");
59 
60  BibTeXKeys.EOS = "Wu-JPCRD-2011";
61  BibTeXKeys.VISCOSITY = "Meng-JCED-2012";
62  BibTeXKeys.ECS_LENNARD_JONES = "Chichester-NIST-2008";
63  BibTeXKeys.SURFACE_TENSION = "Mulero-JPCRD-2012";
64 }
65 
66 double DimethylEtherClass::psat(double T)
67 {
68  const double ti[]={0,1.0,1.5,2.5,5};
69  const double Ni[]={0, -7.112782, 1.971239, -2.276083, -2.215774};
70  double summer=0,theta;
71  int i;
72  theta=1-T/reduce.T;
73  for (i=1;i<=4;i++)
74  {
75  summer=summer+Ni[i]*pow(theta,ti[i]);
76  }
77  return reduce.p.Pa*exp(reduce.T/T*summer);
78 }
80 {
81  const double ti[]={0,0.54,0.74,0.95,11.43};
82  const double Ni[]={0, 7.884834, -10.516328, 5.39142, 0.404890};
83  double summer=0;
84  int i;
85  double theta;
86  theta=1-T/reduce.T;
87  for (i=1;i<=4;i++)
88  {
89  summer+=Ni[i]*pow(theta,ti[i]);
90  }
91  return reduce.rho*(summer+1);
92 }
94 {
95  // Maximum absolute error is 0.161887 % between 87.800001 K and 419.289990 K
96  const double ti[]={0,1.467/3.0,4.2/3.0,8.0/3.0,17.0/3.0,36.0/3.0};
97  const double Ni[]={0, -4.136444, -4.302025, -12.032140, -39.527936, -89.476860};
98  double summer=0,theta;
99  int i;
100  theta=1.0-T/reduce.T;
101  for (i=1;i<=5;i++)
102  {
103  summer=summer+Ni[i]*pow(theta,ti[i]);
104  }
105  return reduce.rho*exp(summer);
106 }
107 
108 double DimethylEtherClass::conductivity_Trho(double T, double rho)
109 {
110  long iPropane = get_Fluid_index(std::string("Propane"));
111  // Calculate the ECS
112  double lambda = conductivity_ECS_Trho(T, rho, get_fluid(iPropane));
113  return lambda;
114 }
115 //double DimethylEtherClass::viscosity_Trho(double T, double rho)
116 //{
117 // long iPropane = get_Fluid_index(std::string("Propane"));
118 // // Calculate the ECS
119 // double mu = viscosity_ECS_Trho(T, rho, get_fluid(iPropane));
120 // return mu;
121 //}
122 void DimethylEtherClass::ECSParams(double *e_k, double *sigma)
123 {
124  *e_k = 395; *sigma =0.4307;
125 }
126 double DimethylEtherClass::viscosity_Trho(double T, double rho)
127 {
128  //return REFPROP(std::string("V"),std::string("T"),T,std::string("D"),rho,std::string("REFPROP-DME"));
129 
130  double sigma = 0.446704; //[nm]
131  double M = 46.06844; //[kg/kmol]
132  double tau = T/reduce.T;
133  double delta = rho/reduce.rho;
134  double Tstar = T/317.937;
135  double log_Tstar = log(Tstar);
136  double log_theta_star = 0.294261-0.377826*log_Tstar-0.491673*log_Tstar*log_Tstar;
137  double eta_0 = 0.021375*sqrt(M*T)/(sigma*sigma*exp(log_theta_star)); //[uPa-s]
138 
139  double n[] = {-2.70002,4.44583,0.21302,6.50681,-104.998,78.27474,41.3751,-175.055,62.81975,112.3219};
140  double t[] = {-5.92,-4.36,-5.87,-0.45,-2.93,-1.64,-7.86,-4.25,-4.79,-3.11};
141  double d[] = {3,3,5,1,3,4,5,2,2,2};
142  double p[] = {0,0,0,0,1,1,2,1,1,2};
143 
144  double eta_r = n[0]*pow(tau,t[0])*pow(delta,d[0])+n[1]*pow(tau,t[1])*pow(delta,d[1])+n[2]*pow(tau,t[2])*pow(delta,d[2])+n[3]*pow(tau,t[3])*pow(delta,d[3]);
145  for (unsigned int i = 4; i<=9; i++)
146  {
147  eta_r += n[i]*pow(tau,t[i])*pow(delta,d[i])*exp(-pow(delta,p[i]));
148  }
149  return (eta_r+eta_0)/1e6;
150 }
151 
153 {
154  return 0.063157*pow(1-T/reduce.T,1.2595);
155 }
Fluid * get_fluid(long iFluid)
Definition: CoolProp.cpp:236
void ECSParams(double *e_k, double *sigma)
Definition: Ether.cpp:122
std::vector< phi_BC * > phirlist
Definition: FluidClass.h:178
long get_Fluid_index(std::string FluidName)
Definition: CoolProp.cpp:239
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 psat(double)
Definition: Ether.cpp:66
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 viscosity_Trho(double T, double rho)
Definition: Ether.cpp:126
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
double rhosatL(double)
Definition: Ether.cpp:79
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 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
struct CriticalStruct crit
Definition: FluidClass.h:218
BibTeXKeysStruct BibTeXKeys
Definition: FluidClass.h:175
double surface_tension_T(double T)
Definition: Ether.cpp:152
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 conductivity_ECS_Trho(double T, double rho, Fluid *ReferenceFluid)
double rhosatV(double)
Definition: Ether.cpp:93
double Tmin
Definition: FluidClass.h:54
double rhomax
Definition: FluidClass.h:54
double conductivity_Trho(double T, double rho)
Definition: Ether.cpp:108