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
DMC.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 "DMC.h"
6 
7 static char EOSstr [] = "Yong Zhou, Jiangtao Wu and Eric W. Lemmon, \"Thermodynamic Properties of Dimethyl Carbonate\", J. Phys. Chem. Ref. Data, Vol. 40, No. 4, 2011";
8 
10 {
11  double n[] = {0.0, 0.00052683187, 1.353396, -2.649283, -0.2785412, 0.1742554, 0.031606252, 0.399866, 1.178144, -0.0235281, -1.015, -0.7880436, -0.12696, 1.2198, -0.4883, -0.0033293, -0.0035387, -0.51172, -0.16882};
12  double t[] = {0, 1, 0.227, 1.05, 1.06, 0.5, 0.78, 1.3, 1.347, 0.706, 2, 2.5, 4.262, 1, 2.124, 0.4, 3.5, 0.5, 2.7};
13  double d[] = {0, 5, 1, 1, 2, 3, 4, 1, 2, 7, 1, 2, 3, 1, 1, 2, 2, 3, 3};
14  double c[] = {0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 0, 0, 0, 0, 0, 0};
15  double eta[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.9667, 1.5154, 1.0591, 1.6642, 12.4856, 0.9662};
16  double beta[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.240, 0.821, 15.45, 2.210, 437.0, 0.743};
17  double gamma[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.2827, 0.4317, 1.1217, 1.1871, 1.1243, 0.4203};
18  double epsilon[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.6734, 0.9239, 0.8636, 1.0507, 0.8482, 0.7522};
19 
20  //Critical parameters
21  crit.rho = 4*90.0779; //[kg/m^3]
22  crit.p = PressureUnit(4908.8, UNIT_KPA); //[kPa]
23  crit.T = 557; //[K]
24  crit.v = 1/crit.rho;
25 
26  // Other fluid parameters
27  params.molemass = 90.0779;
28  params.Ttriple = 277.06;
29  params.accentricfactor = 0.346;
30  params.R_u = 8.314472;
31  params.ptriple = 2.2265237265924869;
32 
33  // Limits of EOS
34  limits.Tmin = params.Ttriple;
35  limits.Tmax = 500.0;
36  limits.pmax = 100000.0;
37  limits.rhomax = 1000000.0*params.molemass;
38 
39  phirlist.push_back(new phir_power( n,d,t,c,1,12,19));
40  phirlist.push_back(new phir_gaussian( n,d,t, eta, epsilon, beta, gamma, 13,18,19));
41 
42  const double n5 = 4.9916462, n6 = -0.1709449, n0 = 9.28421;
43  phi0list.push_back(new phi0_lead(n5,n6));
44  phi0list.push_back(new phi0_logtau(n0-1));
45 
46  const double u0[] = {0, 21/crit.T, 1340/crit.T, 1672/crit.T, 7395/crit.T};
47  const double v0[] = {0, 1.48525, 0.822585, 16.2453, 1.15925};
48  std::vector<double> u0_v(u0,u0+sizeof(u0)/sizeof(double));
49  std::vector<double> v0_v(v0,v0+sizeof(v0)/sizeof(double));
50 
51  phi0list.push_back(new phi0_Planck_Einstein(v0_v,u0_v,1,4));
52 
53  EOSReference.assign(EOSstr);
54  TransportReference.assign("Using ECS in fully predictive mode");
55 
56  name.assign("DimethylCarbonate");
57  aliases.push_back(std::string("DMC"));
58  aliases.push_back(std::string("dimethylcarbonate"));
59  aliases.push_back(std::string("DIMETHYLCARBONATE"));
60  REFPROPname.assign("DMC");
61 
62  ECSReferenceFluid = "Propane";
63 
64  BibTeXKeys.EOS = "Zhou-JPCRD-2011";
65 }
66 
68 {
69  // Maximum absolute error is 0.015238 % between 277.060001 K and 556.999990 K
70  const double ti[]={0,1.0,1.5,2.3,3.6,5.2,7.3};
71  const double Ni[]={0,-8.3202660729706679, 3.4264854309711628, -3.5672563248732438, -0.4374159102683291, -3.895322642705378, 1.5398890451904521 };
72  double summer=0,theta;
73  int i;
74  theta=1-T/reduce.T;
75  for (i=1;i<=6;i++)
76  {
77  summer=summer+Ni[i]*pow(theta,ti[i]);
78  }
79  return reduce.p.Pa*exp(reduce.T/T*summer);
80 }
82 {
83  // Maximum absolute error is 0.652451 % between 277.060001 K and 556.999990 K
84  const double ti[]={0,0.33284736596795433, 1.1366445658032931, 2.7906891264436053, 1.7799430494935189, 2.0875761898754157};
85  const double Ni[]={0,1.7636989589272027, -2.9872459633577173, 2.7945804747539671, 12.18823328946845, -12.277305677322932};
86  double summer=0;
87  int i;
88  double theta;
89  theta=1-T/reduce.T;
90  for (i=1;i<=5;i++)
91  {
92  summer+=Ni[i]*pow(theta,ti[i]);
93  }
94  return reduce.rho*exp(summer);
95 }
97 {
98  // Max error is 0.152889150153 % between 277.06 and 556.999999 K
99  const double ti[]={0, 0.384, 0.38649999999999995, 0.39049999999999996, 1.1666666666666667, 1.6666666666666667, 5.0};
100  const double Ni[]={0, -8046.3851723522694, 13270.96908464885, -5230.1789590545313, 3.5069500792786417, -5.1611358518618955, -5.7960154390551759};
101  double summer=0,theta;
102  int i;
103  theta=1.0-T/reduce.T;
104  for (i=1;i<=6;i++)
105  {
106  summer += Ni[i]*pow(theta,ti[i]);
107  }
108  return reduce.rho*exp(crit.T/T*summer);
109 }
double psat(double)
Definition: DMC.cpp:67
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
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
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 REFPROPname
The name of the fluid.
Definition: FluidClass.h:152
double rhosatV(double)
Definition: DMC.cpp:96
double pmax
Definition: FluidClass.h:54
params
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 rhosatL(double)
Definition: DMC.cpp:81
double rhomax
Definition: FluidClass.h:54