
86 Programming for Chemical Engineers
double rho_v(double sat_temp)
{
double ans, temp_var, theta, tau, lntau;
theta = sat_temp/Tc;
tau = 1 - theta;
lntau=log(tau);
temp_var = c[0]*exp(lntau/3.0) +
c[1]*exp(2.0*lntau/3.0) +
c[2]*exp(4.0*lntau/3.0) +
c[3]*exp(3.0*lntau) +
c[4]*exp(37.0*lntau/6.0) +
c[5]*exp(71.0*lntau/6.0);
ans = rho_c* exp(temp_var*1.0);
return ans;
}
double sp_vol_l(double sat_temp)
{
double ans;
ans = 1/rho_l(sat_temp);
return ans;
}
double sp_vol_v(double sat_temp)
{
double ans;
ans = 1/rho_v(sat_temp);
return ans;
}
double alpha(double sat_temp)
{
double ans, temp_var, theta;
theta = sat_temp/Tc;
temp_var ...