virial coefficients using different equations of state

4

Click here to load reader

Upload: constance

Post on 08-Dec-2016

227 views

Category:

Documents


9 download

TRANSCRIPT

Page 1: Virial Coefficients Using Different Equations of State

Information • Textbooks • Media • Resources

JChemEd.chem.wisc.edu • Vol. 77 No. 10 October 2000 • Journal of Chemical Education 1371

Inexpensive desktop computers and powerful computeralgebra software packages have made it possible for students andfaculty to look at problems unthinkable a few years past becauseof the intensive algebra involved. One such problem is thederivation of expressions for the first three virial coefficientswhen using different equations of state. Using Mathematica,expressions for the virial coefficients at constant volume,constant pressure, and the fugacity have been derived forseveral equations of state. Our purpose is to illustrate the actualMathematica instructions that lead to the virial coefficients forthe well-known van der Waals equation of state. The set ofMathematica instructions for this equation of state will serveas a model for other more sophisticated equations of state. Weselected the Redlich–Kwong and the Gibbons–Laughton modi-fication to the Redlich–Kwong equations of state.

We will use the abbreviations “vdw” for the van der Waalsequation (1), “RK” for the Redlich–Kwong equation (2), and“GLRK” for Gibbons–Laughton modification to the Redlich–Kwong equation (3) as suffixes for the different equations ofstate. The virial coefficients will be designated as usual withthe above suffixes to differentiate between the equations ofstate. For example, BVvdw represents the second virial coef-ficient at constant volume for the van der Waals equation ofstate. CpRK is the third virial constant at constant pressurefor the Redlich–Kwong equation of state. The constants forthe different equations of state are also distinguished by theappropriate suffix. Therefore, the “a” in the van der Waalsequation is written as “avdw”.

We performed the derivation with the van der Waalsequation of state. We thought that most physical chemistrystudents would be familiar with this equation and couldtherefore pay more attention to the instructions to the com-puter algebra program. Also, the output from the computeralgebra system would look familiar, thus giving a sense ofconfidence in the program and the method.

Development

The well-known van der Waals equation for one moleis written as follows:

P = RTV – b

– a

V 2(1)

To transform the equation into a form compatible with thevirial equation expressed in terms of the volume, we mustmultiply by V/RT. This gives the following:

Zvdw = PVRT

= VV – b

– aRTV

(2)

This compares to the temperature dependent virial equationin terms of volume, which is:

Z = PVRT

= 1 +BV T

V+

CV T

V 2+

DV T

V 3+ … (3)

The instructions to Mathematica are indicated in bold type (4).A semicolon at the end of a Mathematica instruction willsuppress the output for that instruction. This was desirablefor some instructions because the algebraic results were solong. The output will follow the bold typed instruction unlessa semicolon was used to suppress the output. What appearsin the bold type is exactly the instruction given to and thenexecuted by Mathematica.

The following is the instruction set for determiningthe virial coefficients and the fugacity for the van der Waalsequation that will serve as a model for our other two equationsof state.

Zvdw[v_ ] = v/(v - bvdw) - avdw(RTv)

�avdwRTv + V

�bvdw + V

seriesvdw = Normal[Series[Zvdw[v], {v, Infinity, 4}]]

1 + bvdw

4

v4+bvdw3

v3+bvdw2

v2+bvdw – avdw

RTv

BVvdw[T_] := Coefficient[seriesvdw, 1/v]

CVvdw[T_] := Coefficient[seriesvdw, 1/v^2]

DVvdw[T_] := Coefficient[seriesvdw, 1/v^3]

Print[“BVvdw(T) = “, BVvdw[T]]

Print[“CVvdw(T) = “, CVvdw[T]]

Print[“DVvdw(T) = “, DVvdw[T]]

BVvdw(T) = bvdw – avdwRT

CVvdw(T) = bvdw2

DVvdw(T) = bvdw3

The BVvdw result is found in most physical chemistrytextbooks (5); however, the terms for CVvdw and DVvdwhave little meaning because they are not functions of thetemperature but are constants for the van der Waals equation.They would appear as lines, which cut through the center ofthe virial data with no curvature, giving a kind of averagevalue. This is not true for the more sophisticated equationsof state.

Next, we will derive the pressure-dependent coefficientsfrom the volume-dependent coefficients. To do this, we solvethe volume-dependent virial equation for the pressure P. Then,after substituting the results into the pressure-dependent virial

Virial Coefficients Using Different Equations of StateCharles B. Wakefield* and Constance PhillipsDepartment of Science, Mathematics and Computer Science, University of Texas of the Permian Basin,Odessa, TX 79762; *[email protected]

Computer Bulletin Boardedited by

Steven D. GammonUniversity of Idaho

Moscow, ID 83844

Page 2: Virial Coefficients Using Different Equations of State

Information • Textbooks • Media • Resources

1372 Journal of Chemical Education • Vol. 77 No. 10 October 2000 • JChemEd.chem.wisc.edu

equations, we obtain the coefficients of the volume terms,all of which is done in the following segment of Mathematicacode. This approach gives us the expressions of the coefficientsin the virial equation for pressure in terms of the volumeequation coefficients. While we carry the calculation only upto the Dp coefficient, the process could easily be extendedto higher terms if needed. Though the terms above BVvdware not useful, we include them here because the same methodcould be used for more sophisticated equations of state inthe same manner as illustrated below. For several of theinstructions below the output is excessive, it is suppressedwith a semicolon at the end of the Mathematica instruction.The constant-pressure virial coefficient Bvdw should berecognizable to the physical chemical student. It is includedin most physical chemistry texts. The other coefficients aremuch more algebra intensive but are found with ease usingMathematica.

psub = {p -> RT/v + BvRT/v^2 + CvRT/v^3 + DvRT/v^4}

p → DvRTv4

+ CvRTv3

+ BvRTv2

+ RTv

Zp = 1 + Bpp + Cpp^2 + Dpp^3

1 + Bpp + Cpp2 + Dpp

3

fun = Zp/.psub//Expand;

sol1 = Solve[Coefficient[fun, 1/v] = = Bv, Bp]//Flatten

sol2 = Solve[Coefficient[fun, 1/v^2] = =

Cv, Cp]/.sol1//Flatten

sol3 = Solve[Coefficient[fun, 1/v^3] = =

Dv, Dp]/.sol1/.sol2//Flatten

Bp → BvRT

Cp → �Bv2 – Cv

R2 T2

Dp → ��2Bv Bv2 – Cv + BvCv – Dv

R3T3

Bpvdw[T_] = BVvdw[T]/(RT)

Cpvdw[T_] = -(BVvdw[T]^2 - CVvdw[T])/(RT)^2//Expand;

Dpvdw[T_] = -(-2BVvdw[T](BVvdw[T]^2 - CVvdw[T]) +

BVvdw[T]CVvdw[T] - DVvdw[T]/(RT)^3//Expand;

Print[“Bpvdw(T) = “, Bpvdw[T]]

Print[“Cpvdw(T) = “, Cpvdw[T]]

Print[“Dpvdw(T) = “, Dpvdw[T]]

Bpvdw(T) =

bvdw – avdwRT

RT

Cpvdw(T) =avdw2

R4 T4+ 2 avdw bvdw

R3 T3

Dpvdw(T) = –2 avdw3

R6 T6+6 avdw2 bvdw

R5 T5–3 avdw bvdw2

R4 T4

Fugacity (vdw)

Now we illustrate how to arrive at an expression for thefugacity assuming the gas behaves according to the van derWaals equation. In most physical chemistry texts we have thefollowing relation for the fugacity:

RT ln

f

P= V – RT

PdP

P= 0

P= P

(4)

If we divide eq 4 by RT we have

ln

f

P= V

RT– 1

PdP

P= 0

P= P

(5)

Now we solve the virial equation in terms of pressure for V/RTand substitute into eq 5 to get

ln

f

P= 1

P+ BP + CPP + DP P2 + … – 1

PdP

P= 0

P= P

(6)

Equation 6 is easily integrated to give

lnfP

= BP P + 12

CP P2 + 13

DP P3 + … (7)

If we convert this to the exponential form we have

f = P exp BP + 12

CP P2 + 13

DP P 3(8)

Now we can express f for the van der Waals equation as follows:

fvdw = p Exp Bpvdw T p +Cpvdw T

2p2 +

Dpvdw T3

p3

E^�13 p3 –

2 avdw3

R6T6+6 avdw2 bvdw

R5T5–3 avdw bvdw2

R4T4+

12p2 –

avdw2

R4T4+2 avdw bvdw

R3T3+p bvdw – avdw

RTRT �p

This same derivation process using Mathematica can beused for other equations of state. We will now apply the abovemodel to the other two equations of state discussed in thispaper. For these cases we will show only the pertinent outputfrom the Mathematica instructions.

Results for Other Equations of State

In this section we will give the results for the other equa-tions of state for the virial coefficients and the fugacity. Theseresults were obtained using the same approach as for the vander Waals equation. The expression for DP for GLRK is toolong to include here, but it can be derived with no difficultyusing the method outlined above.

Redlich–Kwong (RK)The RK equation (2) is

PRK = RTV – b

– aV – b V T

(9)

where

a = 0.472R 2Tc

2.5

Pc and

b = 0.867RTc

Pc.

Page 3: Virial Coefficients Using Different Equations of State

Information • Textbooks • Media • Resources

JChemEd.chem.wisc.edu • Vol. 77 No. 10 October 2000 • Journal of Chemical Education 1373

Figure 1. This plot, generated using Mathematica, shows that theresults obtained by using the Mathematica-derived BvRK coefficientsgive reasonable results when compared to the data for (◊) H2, (�)CO2, and (�) CH4.

Figure 2. This plot shows that the results for BvGLRK coefficientsalso give reasonable results when compared to the data for (◊) H2,(�) CO2, and (�) CH4.

All the expressions that follow are determined in the samemanner as was illustrated for the van der Waals example. Firstwe give the virial form.

1 +bRK4 +

aRK bRK3

RT3/2

v4+

bRK3 –aRK bRK2

RT3/2

v3+

bRK2 +aRK bRK

RT3/2

v2+

bRK – aRKRT3/2

v

Next we show the results for the virial coefficients at con-stant volume.

BVRK(T) = bRK – aRKRT3/2

CVRK(T) = bRK2 + aRK bRKRT3/2

DVRK(T) = bRK3 –aRK bRK2

RT3/2

The following are the coefficients at constant pressure.

BpRK(T) =

bRK – aRKRT3/2

RT

CpRK(T) = –aRK2

R4T5+ 3aRK bRK

R3T7/2

DpRK(T) = –2aRK3

R6T15/2

+9 aRK2 bRK

R5T6–7 aRK bRK2

R4T9/2

Finally, we have the expression for the fugacity for theRedlich–Kwong equation of state.

13p3 –

2aRK3

R6T15/2

+9 aRK2 bRK

R5T6–7 aRK bRK2

R4T9/2+

E^ 12p2 –

aRK2

R4T5+ 3aRK bRK

R3T7/2+

p bRK – aRKRT3/2

RT p

Gibbons–Laughton (GLRK)The GLRK (3) is as follows:

PGLRK = RTV – b

– aαTV V + b

(10)

where

a =R2Tc

2

9KPc

, b =KRTc

3Pc

, and K = 20.3 – 1.

The primary difference between these two equations isthe function of temperature. The Redlich–Kwong simply usesthe inverse of the square root of the temperature, whereasthe Gibbons–Laughton uses the temperature as a functionof their α expression, where α = X(TR – 1) + Y(TR

0.5 – 1).For this expression TR = T/Tc and Tc is the critical temperatureof the gas. The values of the constants X and Y are considered tobe “substance-dependent parameters” with Soave’s “m” factor,which is based on the Pitzer acentric factor ω2.

First we give the virial form.

�1 +bGLRK –

aGLRK 1.+ – 1.+ TTc X+ –1.+ T

Tc0.5

Y

RTv +

bGLRK2 +aGLRKbGLRK 1.+ – 1.+ T

Tc X+ –1.+ TTc

0.5Y

RTv2

+

bGLRK3 –aGLRKbGLRK2 1.+ – 1.+ T

Tc X+ –1.+ TTc

0.5Y

RTv3

+

bGLRK4 +aGLRKbGLRK3 1.+ – 1.+ T

Tc X+ –1.+ TTc

0.5Y

RTv4

�Shown next are the expressions for the virial coefficients

at constant volume.

BVGLRK = �bGLRK – 1.aGLRKRT + 1.aGLRK X

RT–

aGLRK XRTc + 1.aGLRK Y

RT–aGLRK T

Tc0.5Y

RT �

Page 4: Virial Coefficients Using Different Equations of State

Information • Textbooks • Media • Resources

1374 Journal of Chemical Education • Vol. 77 No. 10 October 2000 • JChemEd.chem.wisc.edu

CVGLRK = �bGLRK2 + 1.aGLRK bGLRKRT

– 1.aGLRK bGLRK XRT +

aGLRK bGLRK XRTc

– 1.aGLRK bGLRK YRT +

aGLRK bGLRK TTc

0.5Y

RT �

DVGLRK = �bGLRK3 – 1.aGLRK bGLRK2

RT+1.aGLRK bGLRK2X

RT –

aGLRKbGLRK2XRTc

+1.aGLRKbGLRK2Y

RT –aGLRKbGLRK2 T

Tc0.5Y

RT �We show here only the expression for BpGLRK—the expres-sions for CpGLRK and DpGLRK are excessively long.

BpGLRK =

�bGLRK– 1.aGLRKRT +1.aGLRK X

RT– aGLRK X

RTc + 1.aGLRK YRT

–aGLRK T

Tc0.5Y

RTRT

�The expression for the fugacity for GLRK is also omitted

because of its length. However, having expressions for thepressure coefficients we can find an expression for the fugacityas was carried out for the van der Waals equation. The instruc-tion sent to Mathematica needed to retrieve the expressionfor the fugacity for GLRK is as follows:

fGLRK= p Exp[BpGLRK[T]p+CpGLRK[T]

2p2+

DpGLRK[T]3

p3]

Expression Confirmation Graphics

We have included two graphics (Figs. 1 and 2) to showthat the expressions derived for the Redlich–Kwong and theGibbons–Laughton equations of state return some reasonableresults. The fit of the Cv data was about as good as the resultsshown for Bv (6 ).

Conclusion

We see that Mathematica is a powerful tool that can beused to do the extensive algebra inherent in these types ofderivations and calculations. As the speed and sophisticationof computers and the computer algebra systems increase andtheir cost decreases, it will become increasingly important toteach our students how to utilize these powerful tools. Withthe click of a mouse we can retrieve algebraic expressions thatcould never be derived by hand. We can make calculationsfor different values of an independent variable using very longcomplicated expressions, and with the help of the plottingroutines, we can instantly view the effect of making changesin an equation. These activities have in the past been reservedfor the large computers that were out of the reach of mostundergraduate students. This is no longer the case. Manystudents have their own computers with Mathematica.

Our work also supports the claim that the two-parameterRedlich–Kwong equation fits the virial coefficient data betterthan the van der Waals equation (7 ).

Literature Cited

1. Atkins, P. Physical Chemistry, 5th ed.; Freeman: New York,1994; Chapter 1.

2. Shah, K. K.; Thodos, G. Ind. Eng. Chem. 1956, 57 (3), 30–37.

3. Gibbons, R. M.; Laughton, A. P. J. Chem. Soc, Faraday Trans.2 1984, 80, 10119–10138.

4. Wolfram, S. The Mathematica Book, 4th ed.; Cambridge Uni-versity Press: New York, 1999.

5. Barrow, G. M. Physical Chemistry, 5th ed.; McGraw-Hill: NewYork, 1988; Chapter 2.

6. Dymond, J. H.; Smith, E. B. The Virial Coefficients of PureGases and Mixtures; Clarendon Press: Oxford, 1980.

7. Andrews, F. C. Thermodynamics; Wiley: New York, 1971; p118.