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
Deuterium.cpp
Go to the documentation of this file.
1 /*
2 Properties of Normal hydrogen
3 by Ian Bell
4 */
5 
6 #define _CRT_SECURE_NO_WARNINGS
7 #include <stdlib.h>
8 #include "math.h"
9 #include "stdio.h"
10 #include <string.h>
11 #include "CoolProp.h"
12 #include "FluidClass.h"
13 #include "Deuterium.h"
14 
16 {
17  double n[] = {0, 0.006267958, 10.53609, -10.14149, 0.356061, 0.1824472, -1.129638, -0.0549812, -0.6791329, 1.347918, -0.8657582, 1.719146, -1.917977, 0.1233365, -0.07936891, 1.686617, -4.240326, 1.857114, -0.5903705, 1.520171, 2.361373, -2.297315};
18  double t[] = {0, 1, 0.462, 0.5584, 0.627, 1.201, 0.309, 1.314, 1.1166, 1.25, 1.25, 1.395, 1.627, 1, 2.5, 0.635, 0.664, 0.7082, 2.25, 1.524, 0.67, 0.709};
19  double d[] = {0, 4, 1, 1, 2, 3, 1, 3, 2, 2, 2, 1, 1, 3, 2, 1, 1, 2, 3, 3, 1, 3};
20  double c[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0};
21  double alpha[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.868, 0.636, 0.668, 0.65, 0.745, 0.782, 0.693}; // phi from paper
22  double epsilon[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.46, 1.7864, 1.647, 0.541, 0.969, 1.892, 1.076}; // D from paper
23  double beta[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.613, 0.584, 0.57, 1.056, 1.01, 1.025, 1.029};
24  double gamma[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.6306, 0.711, 0.6446, 0.8226, 0.992, 1.2184, 1.203};
25 
26  //Constants for ideal gas expression
27  double a0[] = {0, -3.54145, 3.0326, -3.52422, -1.73421, -3.57135, 2.14858, 6.23107, -3.30425, 6.23098, -3.57137, 3.32901, 0.97782};
28  double n0[] = {0, 7174.1/38.34, 8635/38.34, 902.7/38.34, 181.1/38.34, 438.5/38.34, 5034.2/38.34, 269.9/38.34, 229.9/38.34, 666.4/38.34, 452.8/38.34, 192/38.34, 1187.6/38.34};
29 
30  phirlist.push_back(new phir_power(n,d,t,c,1,14,22));
31  phirlist.push_back(new phir_gaussian(n,d,t,alpha,epsilon,beta,gamma,15,21,22));
32 
33  //lead term of the form log(delta)+a1+a2*tau
34  phi0list.push_back(new phi0_lead(-2.0677351753,2.4237151502));
35  phi0list.push_back(new phi0_logtau(1.5));
36  phi0list.push_back(new phi0_Planck_Einstein(a0,n0,1,12,13));
37 
38  // Critical parameters
39  crit.rho = 17.23*4.0282;
40  crit.p = PressureUnit(1679.6, UNIT_KPA);
41  crit.T = 38.34;
42  crit.v = 1.0/crit.rho;
43 
44  // Other fluid parameters
45  params.molemass = 4.0282;
46  params.Ttriple = 18.724;
47  params.ptriple = 17.202;
48  params.accentricfactor = -0.136290274128;
49  params.R_u = 8.3144621;
50 
51  // Limits of EOS
52  limits.Tmin = params.Ttriple;
53  limits.Tmax = 1000.0;
54  limits.pmax = 2000000.0;
55  limits.rhomax = 102.0*params.molemass;
56 
57  name.assign("Deuterium");
58  aliases.push_back("deuterium");
59  aliases.push_back("DEUTERIUM");
60  aliases.push_back("D2");
61  REFPROPname.assign("D2");
62 
63  BibTeXKeys.EOS = "Richardson-JPCRD-2013";
64  BibTeXKeys.SURFACE_TENSION = "Mulero-JPCRD-2012";
65 }
66 
67 double DeuteriumClass::psat(double T)
68 {
69  const double ti[]={0,1.0,1.5,2.83,4.06,5.4};
70  const double Ni[]={0,-5.5706,1.7631,-0.5458,1.2154,-1.1556};
71  double summer=0,theta;
72  int i;
73  theta=1-T/reduce.T;
74  for (i=1;i<=5;i++)
75  {
76  summer += Ni[i]*pow(theta,ti[i]);
77  }
78  return reduce.p.Pa*exp(reduce.T/T*summer);
79 }
80 double DeuteriumClass::rhosatL(double T)
81 {
82  const double ti[]={0,0.512,1.12,1.8,2.55,3.4,4.4};
83  const double Ni[]={0,3.3769,-5.3693,11.943,-17.361,15.170,-6.3079};
84  double summer=0,theta;
85  int i;
86  theta=1-T/reduce.T;
87  for (i=1;i<=6;i++)
88  {
89  summer += Ni[i]*pow(theta,ti[i]);
90  }
91  return reduce.rho*(1+summer);
92 }
93 double DeuteriumClass::rhosatV(double T)
94 {
95  const double ti[]={0,0.528,2.03,3.6,5,6.5,9};
96  const double Ni[]={0,-3.8111,-7.3624,2.2294,-21.443,12.796,-31.334};
97  double summer=0,theta;
98  int i;
99  theta=1-T/reduce.T;
100  for (i=1;i<=6;i++)
101  {
102  summer += Ni[i]*pow(theta,ti[i]);
103  }
104  return reduce.rho*exp(summer);
105 }
107 {
108  // From Mulero, JPCRD, 2012
109  return 0.009376*pow(1-T/reduce.T,1.258);
110 }
111 
113 {
114  double n[] = {0, 0.006267958, 10.53609, -10.14149, 0.356061, 0.1824472, -1.129638, -0.0549812, -0.6791329, 1.347918, -0.8657582, 1.719146, -1.917977, 0.1233365, -0.07936891, 1.686617, -4.240326, 1.857114, -0.5903705, 1.520171, 2.361373, -2.297315};
115  double t[] = {0, 1, 0.462, 0.5584, 0.627, 1.201, 0.309, 1.314, 1.1166, 1.25, 1.25, 1.395, 1.627, 1, 2.5, 0.635, 0.664, 0.7082, 2.25, 1.524, 0.67, 0.709};
116  double d[] = {0, 4, 1, 1, 2, 3, 1, 3, 2, 2, 2, 1, 1, 3, 2, 1, 1, 2, 3, 3, 1, 3};
117  double c[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0};
118  double alpha[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.868, 0.636, 0.668, 0.65, 0.745, 0.782, 0.693}; // phi from paper
119  double epsilon[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.46, 1.7864, 1.647, 0.541, 0.969, 1.892, 1.076}; // D from paper
120  double beta[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.613, 0.584, 0.57, 1.056, 1.01, 1.025, 1.029};
121  double gamma[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.6306, 0.711, 0.6446, 0.8226, 0.992, 1.2184, 1.203};
122 
123  //Constants for ideal gas expression
124  double a0[] = {0, 4.04482, -4.65391, -4.65342, 3.46313, -4.58637, -4.6503, -4.65124, 2.67024, 15.20455, 0.87164, -4.7608, 4.32447};
125  double n0[] = {0, 1591/38.34, 481.6/38.34, 472.4/38.34, 362.2/38.34, 2038/38.34, 463.2/38.34, 491.3/38.34, 2713.4/38.34, 618.6/38.34, 8642/38.34, 961.7/38.34, 253.2/38.34};
126 
127  phirlist.push_back(new phir_power(n,d,t,c,1,14,22));
128  phirlist.push_back(new phir_gaussian(n,d,t,alpha,epsilon,beta,gamma,15,21,22));
129 
130  //lead term of the form log(delta)+a1+a2*tau
131  phi0list.push_back(new phi0_lead(-2.0672670563, 2.4234599781));
132  phi0list.push_back(new phi0_logtau(1.5));
133  phi0list.push_back(new phi0_Planck_Einstein(a0,n0,1,12,13));
134 
135  // Critical parameters
136  crit.rho = 17.23*4.0282;
137  crit.p = PressureUnit(1679.6, UNIT_KPA);
138  crit.T = 38.34;
139  crit.v = 1.0/crit.rho;
140 
141  // Other fluid parameters
142  params.molemass = 4.0282;
143  params.Ttriple = 18.724;
144  params.ptriple = 17.202;
145  params.accentricfactor = -0.136290274128;
146  params.R_u = 8.3144621;
147 
148  // Limits of EOS
149  limits.Tmin = params.Ttriple;
150  limits.Tmax = 1000.0;
151  limits.pmax = 2000000.0;
152  limits.rhomax = 102.0*params.molemass;
153 
154  name.assign("OrthoDeuterium");
155  aliases.push_back("orthodeuterium");
156  aliases.push_back("ORTHODEUTERIUM");
157  REFPROPname = "N/A";
158 
159  BibTeXKeys.EOS = "Richardson-JPCRD-2013";
160 }
161 
163 {
164  const double ti[]={0,1.0,1.5,2.83,4.06,5.4};
165  const double Ni[]={0,-5.5706,1.7631,-0.5458,1.2154,-1.1556};
166  double summer=0,theta;
167  int i;
168  theta=1-T/reduce.T;
169  for (i=1;i<=5;i++)
170  {
171  summer += Ni[i]*pow(theta,ti[i]);
172  }
173  return reduce.p.Pa*exp(reduce.T/T*summer);
174 }
176 {
177  const double ti[]={0,0.512,1.12,1.8,2.55,3.4,4.4};
178  const double Ni[]={0,3.3769,-5.3693,11.943,-17.361,15.170,-6.3079};
179  double summer=0,theta;
180  int i;
181  theta=1-T/reduce.T;
182  for (i=1;i<=6;i++)
183  {
184  summer += Ni[i]*pow(theta,ti[i]);
185  }
186  return reduce.rho*(1+summer);
187 }
189 {
190  const double ti[]={0,0.528,2.03,3.6,5,6.5,9};
191  const double Ni[]={0,-3.8111,-7.3624,2.2294,-21.443,12.796,-31.334};
192  double summer=0,theta;
193  int i;
194  theta=1-T/reduce.T;
195  for (i=1;i<=6;i++)
196  {
197  summer += Ni[i]*pow(theta,ti[i]);
198  }
199  return reduce.rho*exp(summer);
200 }
201 
203 {
204  double n[] = {0, 0.006267958, 10.53609, -10.14149, 0.356061, 0.1824472, -1.129638, -0.0549812, -0.6791329, 1.347918, -0.8657582, 1.719146, -1.917977, 0.1233365, -0.07936891, 1.686617, -4.240326, 1.857114, -0.5903705, 1.520171, 2.361373, -2.297315};
205  double t[] = {0, 1, 0.462, 0.5584, 0.627, 1.201, 0.309, 1.314, 1.1166, 1.25, 1.25, 1.395, 1.627, 1, 2.5, 0.635, 0.664, 0.7082, 2.25, 1.524, 0.67, 0.709};
206  double d[] = {0, 4, 1, 1, 2, 3, 1, 3, 2, 2, 2, 1, 1, 3, 2, 1, 1, 2, 3, 3, 1, 3};
207  double c[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0};
208  double alpha[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.868, 0.636, 0.668, 0.65, 0.745, 0.782, 0.693}; // phi from paper
209  double epsilon[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.46, 1.7864, 1.647, 0.541, 0.969, 1.892, 1.076}; // D from paper
210  double beta[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.613, 0.584, 0.57, 1.056, 1.01, 1.025, 1.029};
211  double gamma[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.6306, 0.711, 0.6446, 0.8226, 0.992, 1.2184, 1.203};
212 
213  //Constants for ideal gas expression
214  double a0[] = {0, 1.28527, 1.11376, -2.491, 6.38763, 6.17406, -3.13698, -3.14254, -2.29511, -3.37, 1.13634, 0.72512};
215  double n0[] = {0, 5068/38.34, 1000.8/38.34, 261.5/38.34, 437.2/38.34, 312.3/38.34, 382.8/38.34, 356.8/38.34, 294.7/38.34, 682.4/38.34, 246/38.34, 277.1/38.34};
216 
217  phirlist.push_back(new phir_power(n,d,t,c,1,14,22));
218  phirlist.push_back(new phir_gaussian(n,d,t,alpha,epsilon,beta,gamma,15,21,22));
219 
220  //lead term of the form log(delta)+a1+a2*tau
221  phi0list.push_back(new phi0_lead(-2.0683998716, 2.4241000701));
222  phi0list.push_back(new phi0_logtau(1.5));
223  phi0list.push_back(new phi0_Planck_Einstein(a0,n0,1,11,12));
224 
225  // Critical parameters
226  crit.rho = 17.23*4.0282;
227  crit.p = PressureUnit(1679.6, UNIT_KPA);
228  crit.T = 38.34;
229  crit.v = 1.0/crit.rho;
230 
231  // Other fluid parameters
232  params.molemass = 4.0282;
233  params.Ttriple = 18.724;
234  params.ptriple = 17.202;
235  params.accentricfactor = -0.136290274128;
236  params.R_u = 8.3144621;
237 
238  // Limits of EOS
239  limits.Tmin = params.Ttriple;
240  limits.Tmax = 1000.0;
241  limits.pmax = 2000000.0;
242  limits.rhomax = 102.0*params.molemass;
243 
244  name.assign("ParaDeuterium");
245  aliases.push_back("paradeuterium");
246  aliases.push_back("PARADEUTERIUM");
247  REFPROPname = "N/A";
248 
249  BibTeXKeys.EOS = "Richardson-JPCRD-2013";
250 }
251 
252 double ParaDeuteriumClass::psat(double T)
253 {
254  const double ti[]={0,1.0,1.5,2.83,4.06,5.4};
255  const double Ni[]={0,-5.5706,1.7631,-0.5458,1.2154,-1.1556};
256  double summer=0,theta;
257  int i;
258  theta=1-T/reduce.T;
259  for (i=1;i<=5;i++)
260  {
261  summer += Ni[i]*pow(theta,ti[i]);
262  }
263  return reduce.p.Pa*exp(reduce.T/T*summer);
264 }
266 {
267  const double ti[]={0,0.512,1.12,1.8,2.55,3.4,4.4};
268  const double Ni[]={0,3.3769,-5.3693,11.943,-17.361,15.170,-6.3079};
269  double summer=0,theta;
270  int i;
271  theta=1-T/reduce.T;
272  for (i=1;i<=6;i++)
273  {
274  summer += Ni[i]*pow(theta,ti[i]);
275  }
276  return reduce.rho*(1+summer);
277 }
279 {
280  const double ti[]={0,0.528,2.03,3.6,5,6.5,9};
281  const double Ni[]={0,-3.8111,-7.3624,2.2294,-21.443,12.796,-31.334};
282  double summer=0,theta;
283  int i;
284  theta=1-T/reduce.T;
285  for (i=1;i<=6;i++)
286  {
287  summer += Ni[i]*pow(theta,ti[i]);
288  }
289  return reduce.rho*exp(summer);
290 }
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 name
A container to hold the cache for residual Helmholtz derivatives.
Definition: FluidClass.h:151
double Pa
Definition: Units.h:22
double rhosatV(double)
Definition: Deuterium.cpp:188
double psat(double)
Definition: Deuterium.cpp:67
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
double rhosatL(double)
Definition: Deuterium.cpp:80
double psat(double)
Definition: Deuterium.cpp:252
std::string REFPROPname
The name of the fluid.
Definition: FluidClass.h:152
double psat(double)
Definition: Deuterium.cpp:162
std::string SURFACE_TENSION
Definition: FluidClass.h:126
double rhosatV(double)
Definition: Deuterium.cpp:93
double pmax
Definition: FluidClass.h:54
params
struct CriticalStruct crit
Definition: FluidClass.h:218
double rhosatL(double)
Definition: Deuterium.cpp:175
double rhosatL(double)
Definition: Deuterium.cpp:265
BibTeXKeysStruct BibTeXKeys
Definition: FluidClass.h:175
double rhosatV(double)
Definition: Deuterium.cpp:278
double surface_tension_T(double)
Definition: Deuterium.cpp:106
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