12 static const double M = 28.01348,
19 R = 2.96790515164171e2,
20 Gamma = 7.13602531283233e-6,
27 static const double Ann[] = {
28 1.75889959256970e-1, 1.38197604384933e1, -3.14918412133921e2,
29 4.40300150239380e3, -5.45358971644916e5, 4.84413320182919e-4,
30 -5.18964416491365e-2, 6.57265859197103e-4 ,8.51299771713314e4 ,
31 1.33459405162578e-8, 3.83381319826746e-4, -8.35421151028455e-2,
33 -2.38296116270360e-7, -1.48321912935764e-4, 5.62605853190540e-10,
34 -2.98201050924595e-13, 9.85319087685241e-11, -1.92002176056468e-14,
35 -7.82250103373122e4, -5.51801778744598e5, -5.72781957607352e-1,
36 3.25760529488327e2, -1.34659309828737e-6, -1.92036423064911e-5,
37 -3.94564337674524e-12,-2.44388245328965e-9, -1.50970602460077e-18,
38 1.25854885346038e-16,-8.34271144923969e-24, -1.17299202018417e-22,
42 static const double Fnn[]= {
43 8.3944094440e3, -1.8785191705e3, -7.2822291650,
44 1.0228509660e-2, 5.5560638250e-4,
45 -5.9445446620e-6, 2.7154339320e-8,
46 -4.8795359040e-11, 5.0953608240e2
49 static const double Dnn[] = {
50 3.1402991e2, 4.4111015e2, 9.4622994e2 ,
51 -2.9067111e3, 4.4785979e3, -2.2746914e3
54 static const double Gnn[] = {
55 -2.18203473713518e5, 1.01573580096247e4, -1.65504721657240e2,
56 7.43175999190430e2, -5.14605623546025e-3,
57 5.18347156760489e-6, -1.05922170493616e-9, 2.98389393363817e2
62 double nitrogen::C(
int i,
double rt,
double rt2)
66 return Ann[0] * T + Ann[1] * sqrt(T)
67 + Ann[2] + (Ann[3] + Ann[4] * rt) * rt;
69 return Ann[5] * T + Ann[6] + rt * (Ann[7] + Ann[8] * rt);
71 return Ann[9] * T + Ann[10] + Ann[11] * rt;
75 return rt*(Ann[13] + Ann[14]*rt);
79 return rt*(Ann[16] + Ann[17]*rt);
83 return rt2*(Ann[19] + Ann[20]*rt);
85 return rt2*(Ann[21] + Ann[22]*rt2);
87 return rt2*(Ann[23] + Ann[24]*rt);
89 return rt2*(Ann[25] + Ann[26]*rt2);
91 return rt2*(Ann[27] + Ann[28]*rt);
93 return rt2*(Ann[29] + Ann[30]*rt + Ann[31]*rt2);
99 double nitrogen::Cprime(
int i,
double rt,
double rt2,
double rt3)
103 return Ann[0] + 0.5*Ann[1]/sqrt(T) - (Ann[3] + 2.0*Ann[4]*rt)*rt2;
105 return Ann[5] - rt2*(Ann[7] + 2.0*Ann[8]*rt);
107 return Ann[9] - Ann[11]*rt2;
111 return -rt2*(Ann[13] + 2.0*Ann[14]*rt);
115 return -rt2*(Ann[16] + 2.0*Ann[17]*rt);
117 return -2.0*Ann[18]*rt3;
119 return -rt3*(2.0*Ann[19] + 3.0*Ann[20]*rt);
121 return -rt3*(2.0*Ann[21] + 4.0*Ann[22]*rt2);
123 return -rt3*(2.0*Ann[23] + 3.0*Ann[24]*rt);
125 return -rt3*(2.0*Ann[25] + 4.0*Ann[26]*rt2);
127 return -rt3*(2.0*Ann[27] + 3.0*Ann[28]*rt);
129 return -rt3*(2.0*Ann[29] + 3.0*Ann[30]*rt + 4.0*Ann[31]*rt2);
135 double nitrogen::W(
int n,
double egrho)
137 return (n == 0 ? (1.0 - egrho)/(2.0*Gamma) :
138 (n*W(n-1, egrho) - 0.5*pow(Rho,2*n)*egrho)/Gamma);
141 double nitrogen::H(
int i,
double egrho)
143 return (i < 8 ? pow(Rho,i+2) : pow(Rho,2*i-13)*egrho);
146 double nitrogen::I(
int i,
double egrho)
148 return (i < 8 ? pow(Rho,i+1)/
double(i+1) : W(i-8, egrho));
151 double nitrogen::up()
156 double egrho = exp(-Gamma*Rho*Rho);
159 for (
int i=0; i<14; i++) {
160 sum += (C(i,rt,rt2) - T*Cprime(i,rt,rt2,rt3))*I(i,egrho);
163 sum += (((0.25*Gnn[6]*T + Gnn[5]/3.0)*T
164 + 0.5*Gnn[4])*T + Gnn[3])*T + Gnn[2]*log(T)
165 - (Gnn[1] + 0.5*Gnn[0]*rt)*rt
166 + Gnn[7]*beta/(exp(beta*rt) - 1.0) + u0
173 double nitrogen::sp()
178 double egrho = exp(-Gamma*Rho*Rho);
181 sum = s0 + m_entropy_offset - R*log(Rho);
182 for (
int i=0; i<14; i++) {
183 sum -= Cprime(i,rt,rt2,rt3)*I(i,egrho);
186 sum += (((Gnn[6]/3.0)*T + 0.5*Gnn[5])*T + Gnn[4])*T + Gnn[3]*log(T)
187 -((Gnn[0]*rt/3.0 + 0.5*Gnn[1])*rt + Gnn[2])*rt
188 + Gnn[7]*(beta*rt + beta*rt/(exp(beta*rt) - 1.0)
189 - log(exp(beta*rt) - 1.0));
193 double nitrogen::Pp()
197 double egrho = exp(-Gamma*Rho*Rho);
200 for (
int i=0; i<14; i++) {
201 P += C(i,rt,rt2)*H(i,egrho);
207 double nitrogen::Psat()
211 if ((T < Tmn) || (T > Tc)) {
214 for (i=0, lnp=0; i<=7; i++) {
216 lnp+=Fnn[i]*pow(Tc-T, alpha);
218 lnp+=Fnn[i]*pow(T,i-1);
226 double nitrogen::ldens()
228 double xx=1-T/Tc, sum=0;
229 if ((T < Tmn) || (T > Tc)) {
232 for (
int i=0; i<=5; i++) {
233 sum+=Dnn[i]*pow(xx,
double(i)/3.0);
238 double nitrogen::Tcrit()
242 double nitrogen::Pcrit()
246 double nitrogen::Vcrit()
250 double nitrogen::Tmin()
254 double nitrogen::Tmax()
258 char* nitrogen::name()
260 return (
char*) m_name.c_str();
262 char* nitrogen::formula()
264 return (
char*) m_formula.c_str();
266 double nitrogen::MolWt()