Jean Richard Lllnas and Richard Freze Centre Universitaire de St. Jerome rue Henri Poincare 13397 Marseille Cedex 4. FRANCE
I
I
Computer Estimation of Thermodynamic Properties of Real Gases
A large number of papers dealing with the computer estimation of thermodynamic properties of real fluids have appeared recently (1-5). Generally; the predicting methods which yield accurate results over a wide range of conditions are quite complex to use and need lengthy calculations on large core memory computers. They are often limited to the prediction of the departure functions. Our purpose was to provide the students and the research staff of our school with a simple and efficient means to evaluate some properties of real gases for computer calculations in applied thermodynamics and chemical engineering. We set up on a small computer, a package of FUNCTION subroutines written in Fortran IV, which were able to calculate separately specific volumes, heat capacities, enthalpy and entropy of a large number of compounds fur a given pressure and temperature. The characteristic ptoperties of these compounds, used in these functions, are stored in a permanent file on disc memory. Principle of Computation The method we used involved, first the estimation of the value of the thermodynamic function for the compound in the ideal gas state, and second, the associated isothermal function departure which was derived from a generalized equation of state. Several types of correlations have been used (6-9,24) to obtain analytical expressions for the ideal gas heat capacity ( C p o ) enthalpy , (Ho), and entropy (So). Passut and Danner (8)and Huang and Dauhert (9) used a set of thermodynamically consistent equations ((1)-(3)), based on a polynomial development of the fifth degree for the enthalpy H"=A+BT+CT2+DT3+ET4+FT5
(1)
+ 2CT + 3 D P + 4ET3 + 5 F P So = BlnT + 2CT + 312DP + 413 E F + 514 FT4 + G
(7)
CPD= B
(3)
(Ho = 0 kJ kg-' a t O°K, S o = 0 kJ kg-lK-' at ODKand 1atm)
These equations produce values which fit well with the values calculated by statistical mechanical procedures for 146 gases. Among the numerous generalized equations of state (10-17) which we have tested, we selected the three parameters model of Lee and Edmister (16): This equation (4) was initially intended for the calculation of fugacity coefficients and enthalpy departure of gases. This model gives a good representation of PVT data in a wide pressure and temperature range. I t is very simple to use and can readily he extended to gas mixtures.
where
T, = critical temperature (OK), PC = critical 'pressure (atm), w = acentric factor, and R = gas constant (82.05606 em3 atm mole-' K-'1. To obtain the specific volume, the compressibility factor (Z = PVIRT) is computed fur each value of P and T by solving the cubic eqn. (14) derived from eqn. (4). In all cases the largest real root was retained. Z3- ZZ- Z[P2b2/R2T2+ PbIRT - o P / R 2 P ] + (ab - e ) P2/R3T3 = 0 (14)
The basic expressions (15)-(19) for the departure functions (6) have been developed from the equation of state (4). The resulting equations (see Appendix) allow us to calculate the isothermal variations of the thermodynamic properties studied. H-H" (T)T=-Ac[g-($)v]Td~+m-l
PV
( v ) T - l n ( k )
- 1 n ~
?+IT=
(16)
I ~ ( & ) = ~ [ ~ - & ] ~ ~ v + z (17) -~-I~z
(x d) (zE ) L[E + R R
T
=
~
TR
v
=
e
T
(Z - i ) I v
(19)
Program Description Four FUNCTION subroutines have been written in Fortran IV on a Hewlett Packard H P 2100 computer with 16k of core memory.' Each one evaluates a particular property VOLU CP ENTHA ENTRO
(NOM,P,TK.IUNIT) : Specific Volume (NOM,P,TK,IUNIT) : Heatcapacity (NOM.P,TK,IUNIT) : Enthalpy (NOM,P,TK,IUNIT) : Entropy
NOM is a chain of 20 characters which represent the name of the gas. This name allows the program to identify the compound in the permanent data file which contains for every gas, the following information: name, molecular weight, critical properties PC, T,, Z,,2 the acentric f a ~ t o r , ~ and the numerical constants of the expressions (I),(2), (3), with their temperature range of validity. P is the pressure in atm. TK is the temperature in K. IUNIT is an integer variable which allows the user to select the desired unit system (Table 1).These functions may be easily included in a Fortran IV program. Their core requirement does not exceed 2100 words. They can he readily modified for gas
' The listing of the functions is available upon request The values used are from ref (171, (18). The values used are from ref (191, (20). 288 / Journal of Chemical Education
(15)
Table 1. Different U n i t Systems Used in the Functions
Specific Volume
IUNIT 1 2
ft'
Heat
Capacity
lb-'
B p lb,-' R-
m 3 kg-'
kcal kg-'
Enfhalpy
Entropy
8tu l b '
B:t
-'
k w l kg-'
kcal kg-%
k J kg-' kcal mole-!
k J kg-' K: kcal male-
K
K KJ kg-' K'; kcal mole-
lb-' R
-'
TEWERATURE - M) Figure 2. Isobaric enthalpy change of (11 oxygen, (2) hydrogen sulfide, and (3) propane. at P = 10 atm. The ast6rlsks mark the data from (23).while the continuous graphs represent the calculated values.
Table 3.
Comparison Between Experimental and Predicted Valuer of Cp for Ten Gases Abro~ lure AverPressure
Temperature Compound Interval ('K)
lnrervsl (Bar)
N u m age ber of D e v i ~ Pointr ation Reference
Figure 1. Heat Capacity of oxygen at (11 P = 1 aim. (2) P = 40 atm. and (3) P = 70 am. The asterisks mark the experimental data while me cominuous graphs represent the calculated values.
mixtures. Actually, the data file contains the physical properties of 46 gases commonly used (diatomic, triatomic, and hydrocarbons). Analysis of Results
We checked the subroutines on ten different compounds in a wide range of temperatures and pressures. The results are illustrated by Figures 1 and 2, and the mean errors in percent are given in Tables 2 and 3. The errors observed are eenerallv