20 static const double Tmn = 182.56;
21 static const double Tmx = 1000.0;
22 static const double Tc=537.68;
23 static const double Roc=197.60;
24 static const double To=300;
25 static const double R=82.99504;
26 static const double Gamma=9.611604E-6;
27 static const double u0=3.4058439E5;
28 static const double s0=1.1080254E3;
29 static const double Tp=400;
30 static const double Pc=2.6199E6;
31 static const double M=100.20;
36 static const double Ahept[]= {
53 static const double F[]= {
68 static const double D[]= {
81 static const double G[]= {
98 double Heptane::C(
int j,
double Tinverse,
double T2inverse,
double T3inverse,
double T4inverse)
102 return Ahept[0] * R * T -
104 Ahept[2] * T2inverse +
105 Ahept[3] * T3inverse -
106 Ahept[4] * T4inverse;
108 return Ahept[5] * R * T -
112 return Ahept[9] * (Ahept[6] + Ahept[7] * Tinverse);
114 return Ahept[8] * T2inverse;
124 inline double Heptane::Cprime(
int j,
double T2inverse,
double T3inverse,
double T4inverse)
128 return Ahept[0] * R -
129 -2 * Ahept[2] * T3inverse +
130 -3 * Ahept[3] * T4inverse -
131 -4 * Ahept[4] * pow(T, -5.0);
133 return Ahept[5] * R -
134 -1 * Ahept[7] * T2inverse;
136 return Ahept[9] * (-1 * Ahept[7] * T2inverse);
138 return -2 * Ahept[8] * T3inverse;
149 inline double Heptane::I(
int j,
double ergho,
double Gamma)
155 return Rho * Rho / 2;
157 return pow(Rho, 5.0)/ 5;
159 return 1 / Gamma - (Gamma * Rho * Rho + 2) * ergho / (2 * Gamma);
173 double Heptane::H(
int i,
double egrho)
180 return pow(Rho,3) * (1 + Gamma * Rho * Rho) * egrho;
195 double Tinverse = 1.0/T;
196 double T2inverse = pow(T, -2);
197 double T3inverse = pow(T, -3);
198 double T4inverse = pow(T, -4);
199 double egrho = exp(-Gamma*Rho*Rho);
203 for (i=1; i<=5; i++) {
204 sum += G[i]*(pow(T,i) - pow(To,i))/
double(i);
207 sum += G[0]*log(T/To);
209 for (i=0; i<=6; i++) {
210 sum += (C(i, Tinverse, T2inverse, T3inverse, T4inverse) - T*Cprime(i,T2inverse, T3inverse, T4inverse))*I(i,egrho, Gamma);
215 return sum + m_energy_offset;
225 double T2inverse = pow(T, -2);
226 double T3inverse = pow(T, -3);
227 double T4inverse = pow(T, -4);
228 double egrho = exp(-Gamma*Rho*Rho);
232 for (
int i=2; i<=5; i++) {
233 sum += G[i]*(pow(T,i-1) - pow(To,i-1))/
double(i-1);
236 sum += G[1]*log(T/To);
237 sum -= G[0]*(1.0/T - 1.0/To);
239 for (
int i=0; i<=6; i++) {
240 sum -= Cprime(i,T2inverse, T3inverse, T4inverse)*I(i,egrho, Gamma);
243 sum += s0 - R*log(Rho);
245 return sum + m_entropy_offset;
256 double Tinverse = pow(T,-1);
257 double T2inverse = pow(T, -2);
258 double T3inverse = pow(T, -3);
259 double T4inverse = pow(T, -4);
260 double egrho = exp(-Gamma*Rho*Rho);
264 for (
int i=0; i<=3; i++) {
265 P += C(i,Tinverse, T2inverse, T3inverse, T4inverse)*H(i,egrho);
276 double Heptane::Psat()
279 if ((T < Tmn) || (T > Tc)) {
283 for (
int i=1; i<=8; i++) {
284 sum += F[i-1] * pow((T/Tp -1),
double(i-1));
287 log = ((Tc/T)-1)*sum;
298 double Heptane::ldens()
300 double xx=1-(T/Tc), sum=0;
301 if ((T < Tmn) || (T > Tc)) {
304 for (
int i=1; i<=6; i++) {
305 sum+=D[i-1]*pow(xx,
double(i-1)/3.0);
317 double Heptane::Tcrit()
321 double Heptane::Pcrit()
325 double Heptane::Vcrit()
329 double Heptane::Tmin()
333 double Heptane::Tmax()
337 char* Heptane::name()
339 return (
char*) m_name.c_str();
341 char* Heptane::formula()
343 return (
char*) m_formula.c_str();
345 double Heptane::MolWt()