rxmc smith triskathe reaction ensemble method for the computer simulation of chemical and ...

9
The reaction ensemble method for the computer simulation of chemical and phase equilibria. I. Theory and basic examples W. FL Smith and B. Triskaa) Department of Mathematics and Statistics, College of Physical and Engineering Science, University of.. Guelph, Guelph Ontario NIG 2 WI, Canada (Received 1 October 1993; accepted 26 October 1993) We present a new efficient Monte Carlo method for the molecular-based computer simulation of chemical systems undergoing any combination of reaction and phase equilibria. The method requires only a knowledge of the species intermolecular potentials and their ideal-gas properties, in addition to specification of the system stoichiometry and thermodynamic constraints. It avoids the calculation of chemical potentials and fugacities, as is similarly the case for the Gibbs ensemble method for phase equilibrium simulations. The method’s simplicity allows it to be easily used for situations involving any number of simultaneous chemical reactions, reactions that do not conserve the total number of molecules, and reactions occurring within or between phases. The basic theory of the method is presented, its relationship to other approaches is discussed, and applications to several simple example systems are illustrated. I. INTRODUCTION The numerical calculation of compositions of complex chemical systems undergoing multiphase reaction equilib- ria is an important problem in chemistry and chemical engineering. Although the basic principles were essentially formulated long ago by Gibbs, the problem continues to attract interest, due both to its practical importance and to its interesting theoretical* and computational features.24 A statement of the general phase and reaction equilib- rium problem at specified temperature T. and pressure P is3 min G(n) = i$ n?&< T,P,na) (1) subject to i!, ajinp=bj; j= 1,2,..., m, (2) ItaO. (3) G is the system Gibbs free energy, n? is the molar amount of species i in phase a, whose chemical potential is pg. The latter quantity is a~ function of T,P, and the composition of the phase a in which the species is present. aji is the num- ber of atoms of element j per molecule of species i, and bj is the total amount of element j in the system. The total number of species is s and the number of elements is m. To avoid unnecessary complications, we assume that Eqs. (2) are linearly independent and that there exists more than one feasible solution. It is important to note that we define a species as a substance whose molecules consist of specified numbers of atomic elements, and which exists in a specified phase. For example, H20( I) and H,O(g) are considered to be differ- ent species. This allows the above formulation to subsume ‘)On leave of absence from E. H&la Laboratory of Thermodynamics, Institute of Chemical Process Fundamentals, AV CR, 165 02 Prague 6, Suchdol, Czech Republic. the problem of phase equilibrium since this problem results when the elements aji comprise the identity matrix. Fi- nally, we remark that the formulation of the equilibrium problem at specified ( T, V) is identical to the above ( T,P) formulation, except for the fact that the objective function is the Hehnholtz free energy A, the chemical potentials must be expressed as functions of ( T, V,n), and each phase must be at the same pressure. Numerical calculations of chemical and phase equilib- ria require the specification of chemical potential models for the species in each phase. In practice, most such models are semiempirical, being based typically on either empirical equations of state, or assumed simple analytical forms (for a general discussion of such models, see, e.g., Sandler5). Although chemical potentials may be viewed as mac- roscopic consequences of the microscopic interactions be- tween the constituent molecules of the phase at the molec- ular level, their calculation using a molecular-based approach has not been employed extensively due to the inherent difficulty of this statistical mechanical problem. Although recent progress has been made for pure fluids using integral equation theories,6 the techniques are still too numerically unwieldy and inaccurate for-mixtures of any complexity. Attempts have also been made to use in- tegral equations to model simple chemical equilibria di- rectly using specially chosen intermolecular potential mod- els.7 Computer simulation techniques provide, in principle, a powerful experimental tool for the calculation of macro- scopic fluid properties in terms of their molecular proper- ties. However, although there is much current interest in directly calculating chemical potentials using such tech- niques,* these approaches are currently not feasible except for the simplest of chemical systems.’ Three previous groups of researchers have attempted to directly study relatively simple chemical reacting sys- tems (those involving a single chemical reaction) using molecular-based computer simulation techniques. Coker and Watts9 performed a Monte Carlo simulation of equi- J. Chem. Phys. 100 (4), 15 February 1994 0021-9606/94/100(4)/3019/9/$6.00 @ 1994 American Institute of Physics 3019 Downloaded 21 Jun 2001 to 152.1.75.231. Redistribution subject to AIP license or copyright, see http://ojps.aip.org/jcpo/jcpcr.jsp

Upload: vrimanek

Post on 13-May-2017

220 views

Category:

Documents


1 download

TRANSCRIPT

The reaction ensemble method for the computer simulation of chemical and phase equilibria. I. Theory and basic examples

W. FL Smith and B. Triskaa) Department of Mathematics and Statistics, College of Physical and Engineering Science, University of.. Guelph, Guelph Ontario NIG 2 WI, Canada

(Received 1 October 1993; accepted 26 October 1993)

We present a new efficient Monte Carlo method for the molecular-based computer simulation of chemical systems undergoing any combination of reaction and phase equilibria. The method requires only a knowledge of the species intermolecular potentials and their ideal-gas properties, in addition to specification of the system stoichiometry and thermodynamic constraints. It avoids the calculation of chemical potentials and fugacities, as is similarly the case for the Gibbs ensemble method for phase equilibrium simulations. The method’s simplicity allows it to be easily used for situations involving any number of simultaneous chemical reactions, reactions that do not conserve the total number of molecules, and reactions occurring within or between phases. The basic theory of the method is presented, its relationship to other approaches is discussed, and applications to several simple example systems are illustrated.

I. INTRODUCTION

The numerical calculation of compositions of complex chemical systems undergoing multiphase reaction equilib- ria is an important problem in chemistry and chemical engineering. Although the basic principles were essentially formulated long ago by Gibbs, the problem continues to attract interest, due both to its practical importance and to its interesting theoretical* and computational features.24

A statement of the general phase and reaction equilib- rium problem at specified temperature T. and pressure P is3

min G(n) = i$ n?&< T,P,na) (1)

subject to

i!, ajinp=bj; j= 1,2 ,..., m, (2)

ItaO. (3)

G is the system Gibbs free energy, n? is the molar amount of species i in phase a, whose chemical potential is pg. The latter quantity is a~ function of T,P, and the composition of the phase a in which the species is present. aji is the num- ber of atoms of element j per molecule of species i, and bj is the total amount of element j in the system. The total number of species is s and the number of elements is m. To avoid unnecessary complications, we assume that Eqs. (2) are linearly independent and that there exists more than one feasible solution.

It is important to note that we define a species as a substance whose molecules consist of specified numbers of atomic elements, and which exists in a specified phase. For example, H20( I) and H,O(g) are considered to be differ- ent species. This allows the above formulation to subsume

‘)On leave of absence from E. H&la Laboratory of Thermodynamics, Institute of Chemical Process Fundamentals, AV CR, 165 02 Prague 6, Suchdol, Czech Republic.

the problem of phase equilibrium since this problem results when the elements aji comprise the identity matrix. Fi- nally, we remark that the formulation of the equilibrium problem at specified ( T, V) is identical to the above ( T,P) formulation, except for the fact that the objective function is the Hehnholtz free energy A, the chemical potentials must be expressed as functions of ( T, V,n), and each phase must be at the same pressure.

Numerical calculations of chemical and phase equilib- ria require the specification of chemical potential models for the species in each phase. In practice, most such models are semiempirical, being based typically on either empirical equations of state, or assumed simple analytical forms (for a general discussion of such models, see, e.g., Sandler5).

Although chemical potentials may be viewed as mac- roscopic consequences of the microscopic interactions be- tween the constituent molecules of the phase at the molec- ular level, their calculation using a molecular-based approach has not been employed extensively due to the inherent difficulty of this statistical mechanical problem. Although recent progress has been made for pure fluids using integral equation theories,6 the techniques are still too numerically unwieldy and inaccurate for-mixtures of any complexity. Attempts have also been made to use in- tegral equations to model simple chemical equilibria di- rectly using specially chosen intermolecular potential mod- els.7

Computer simulation techniques provide, in principle, a powerful experimental tool for the calculation of macro- scopic fluid properties in terms of their molecular proper- ties. However, although there is much current interest in directly calculating chemical potentials using such tech- niques,* these approaches are currently not feasible except for the simplest of chemical systems.’

Three previous groups of researchers have attempted to directly study relatively simple chemical reacting sys- tems (those involving a single chemical reaction) using molecular-based computer simulation techniques. Coker and Watts9 performed a Monte Carlo simulation of equi-

J. Chem. Phys. 100 (4), 15 February 1994 0021-9606/94/100(4)/3019/9/$6.00 @ 1994 American Institute of Physics 3019 Downloaded 21 Jun 2001 to 152.1.75.231. Redistribution subject to AIP license or copyright, see http://ojps.aip.org/jcpo/jcpcr.jsp

3020 W. R. Smith: Reaction ensemble method. I

librium for the liquid-phase chemical reaction L

Br,+ ClZ=2BrC1 (4)

using a modification of the grand canonical ensemble in conjunction with specific models for the intermolecular po- tential functions. Kofke and Glandt” later showed that this approach contained some errors, and they suggested an alternative method involving a semigrand ensemble and requiring the calculation of a single species chemical po- tential in the course of the simulations. Their approach was also applicable in principle to systems undergoing phase, as well as chemical reaction equilibria,- although it is limited to the case of a reaction in which the total -number of molecules is conserved. They applied their method to re- action (4). Finally, in recent important work, Shawl’-I3 has developed a simulation algorithm to study chemical equilibrium and applied it to the gas-phase reaction

N2 + 02z+2N0. (5)

Shaw’s approach proceeds by implementing a Markov chain derived from the microscopic viewpoint of indistin- guishability of the particles in the simulations, resulting in a set of rather complex formulas. Possible extensions were briefly discussed13 to the cases of multiple reactions and phases, and of reactions which do not conserve the total number of molecules (the latter requiring the artificial con- cept of a “null particle”). However, no calculations were presented for any of these more complex systems.

The purpose of this series of papers is to derive and apply a new and simple Monte Carlo statistical mechanical algorithm for the study of general chemically reacting sys- tems based on a knowledge of the underlying molecular interactions, which we call the reaction ensemble method. The method is applicable to calculations at either fixed ( T, V) or (P, T) , and to systems undergoing any number of simultaneous reactions occurring in any distribution of phases. The reaction ensemble method employs a Markov chain sampling procedure based on the viewpoint of the distinguishability of molecules in the simulations. The method exploits the direct link between the-reaction stoi- chiometry and the elemental abundance constraints of Eq. (2), and its resulting simplicity contrasts with the more complex procedures required by the algorithm of Shaw.“-‘3 No direct calculation of either chemical poten- tials or fugacities is required. The method’s simp,licity al- lows its straightforward generalization and application to many cases of chemical interest not considered previously, including situations when the reactions do not conserve the total number of molecules, and to situations involving mul- tiple reactions and multiple phases.

Work related to these chemical reaction simulation studies is the Gibbs ensemble technique of Panagiotopou- 108,~~ which was developed to simulate phase equilibria. As remarked above, phase equilibrium can be regarded as a trivial case of chemical reaction, according to

s’“=sB, (6)

where S denotes a particular substance and a and p denote different phases. The Gibbs ensemble method can thereby

be regarded as a special case of our reaction ensemble ap- proach, in which the only reactions in the system are those of the form of Eq. (6).

In Sec. II of this paper, we describe the basis of the reaction ensemble method. We then apply the method to several model single-phase reacting systems at either fixed ( T,P) or ( T, V) and compare our results to those obtained using accurate semiempirical equation-of-state methods, and to those of Shaw for reaction (5). As demonstrations of the relative simplicity of the method, the examples in- clude systems involving more than one simultaneous reac- tion, and cases in which the total number of molecules is not conserved. The following sections discuss the results of our calculations, and their comparison with those obtained using semiempirical formulas and with those of other workers. In future papers, we intend to demonstrate the use of the approach for more complex systems, including additional model systems and systems of industrial inter- est, and those exhibiting combined phase and chemical re- action equilibria.

II. THE REACTION ENSEMBLE METHOD

‘We first derive the method in the case of a single chem- ical reaction occurring in one phase at specified ( T, V) . We then generalize to allow for specsed (T,P) and/or multi- ple reactions and phases. In Appendix A, we provide a formal derivation using a Legendre transformation ap- proach.

We consider a system of s different chemical species, and begin by writing the usual canonical ensemble parti- tion function function for a nonreacting system. Within the approximation of separable molecular internal degrees of freedom, this is given by15

Q(Nd’L..,Ns,KT)

X s

exp[ -PU( V,zi ,..., z~)]dzr ,..., dz~, (7)

where V is the system volume, qi is the part of the partition function corresponding to an isolated molecule, Ai is the de Broglie thermal wavelength, Ni is the number of molecules of species i, and U( V,q ,..., zN) is the configurational en- ergy expressed in terms of V and the relative coordinates z[ of the molecules, the components of which lie between 0 and 1. The total number of molecules in the system is

N= i Nia r~ (8) 61

In the partition function (7), Ni is fixed. The goal is to devise a scheme to express the analog of

the partition function (7) in the case when the set of sys- tem species undergoes chemical reaction. Formally, this requires the summation of Eq. (7) over all sets of Ni sub- ject to the constraint imposed by the reaction. The problem is to account for this constraint in a’ computationally effi- cient manner, which we will accomplish in the following by

J. Chem. Phys., Vol. 100, No. 4, 15 February 1994 Downloaded 21 Jun 2001 to 152.1.75.231. Redistribution subject to AIP license or copyright, see http://ojps.aip.org/jcpo/jcpcr.jsp

means of a.simple transformation of variables, based on the link between the stoichiometry and the elemental abun- dance constraints of Eq. (2).

Consider a general reacting system in which the mol- ecules are. comprised of m different atomic elements.i6’i7 The quantities aJf; j= 1,2,..., m specify the molecular com- position of each species i, and the vector ai is called the formula vector of species i. The collection of system for- mula vectors define the system formula matrix A, given by

A= (a1,a2 ,..., a,). (9)

We consider here the general chemical ‘reaction

sl V#iLos where {vf) are a set of stoichiometric coefficients and ai is the vector of coefficients of the chemical formula of species i. For a given reaction, we adopt the usual convention that species for which vi-20 are called reactants and those for which vf > O’are calledproducts. The fundamental property of (vi) is the fact that, via the orthogonality relation of Eq. (10); they embody the law of conservation of mass for the system, Eq. (2), which may be expressed on a molecular basis as

f$l a/iNi=Bj; j=1,2 ,..., m, i

’ (11)

where Bi is the total number of -atoms of type j in the system. The set of stoichiometric coefficients obeying Eq. (10) allows all solutions of e;i. ( 11) to be expressible as

Ni’#+Vt62 (12)

where # represents an arbitrary particular system compo- sition satisfying Eq. (11 ), {vi) satisfy E!q. ( 10); and < is a scalar parameter called the extent of reaction. Equation (12) is the transformation that takes into account the re- action, as may be seen by substituting IZq. (12) into Eq. ( 1 1 ), which yields

& ajiUC+Vd3 = zl aj&+i( ‘i$, vPjf);

j=1,2,.:.,m. (13)

The first term on the right-hand side is Bj, and the second term vanishes due to Eq. ( 10). We remark that, in a mac- roscopic system, g is a continuous variable, whereas at a molecular level it must take on only integer values.

For a reacting system, the partition function (7) must be evaluated by summing over all possible sets of Ni that satisfy the conservation of atomic elements for the system. This may be performed efficiently by transforming the vari- ables Nf to the reaction coordinate 6 using Eq. ( 12). The partition function for the reacting system is then obtained by substituting Eq. ( 12) into Eq. (7) and summing over all (integral) values of c that give n,->O, giving

W. Ft. Smith: Reaction ensemble method. I 3021

Q(x,V,T)i~~ jy ( 6 i=l

X s

exp[ -PU( V,zt ,..., z~)]dz~ ,..., dzN,

(14) -’

where ,y denotesthe fl of the reacting system satisfying l$ ( 11) and z are scaled variables in (0,l) . The surnma- tion is over all (integral) values of 5 that permit the mo- lecular amounts Ni to.remain non-negative. Equation ( 14) is the desired partition function for a system at specified ( V,T) undergoing a single chemical reaction.

The Markov chain required to simulate Eq. ( 14) con- sists of two types of state transitions. One consists of par- ticle moves sampling the configurational space for a flxed system composition (the usual (N, V,r> sampling proce- dure), and the other consists of “reaction moves,” sam- pling the g variable.

The latter sampling procedure must ultimately lead to the satisfaction of the reaction equiiibrium conditions . . .~

(15)

We may avoid the calculation of chemical potentials them- selves by instead considering “reaction steps,” consisting of the simultaneous insertion and deletion of all. the particles in the system, according to the stoichiometry of the reac- tion. The precise method of implementing a reaction step must be carefully considered, both to preserve the micro- scopic reversibility condition, and to endow the simulation with reasonable convergence properties. The primary task is to determine the acceptance probability for such’s reac- tion move.

We consider transitions between states k and 1 in which the reaction proceeds either “forwards” (c > 0) or “backwards” (&O) by ICI molecular units from a given initial state. In state k prior to the reaction step, the com- position is denoted by Ns and we set g=O. The final com- positional state I is given by Eq. ( 12).

In the following, we allow a reaction to potentially proceed in either the forward or reverse direction with equal probability 0.5. The implementation of the reaction step must be consistent with microscopic reversibility. Sup- pose, e.g., we wish .to test if thereaction may proceed in a forward direction from a given state k. We first randomly select a particular set of “reactant” molecules (those with vi < 0) from the set of all such reactant molecules in the simulation. State I arises from this state by replacing all molecules in the selected set by a set of “product” mole- cules (those with vi> 0). This must be done in a fixed manner in the course of the simulation, in order to preserve the microscopic reversibility condition. If Y=O, then a nat- ural way to do this is to attempt to .place the product molecules at the positions of the potentially removed reac- tant molecules., Convergence of the simulation is enhanced if molecules are replaced by those of similar sizes. In any

J. Chem. Phys., Vol. 100, No. 4, 15 February 1994 Downloaded 21 Jun 2001 to 152.1.75.231. Redistribution subject to AIP license or copyright, see http://ojps.aip.org/jcpo/jcpcr.jsp

event, the forward and reverse reaction steps must be at- tempted in exactly the same way each time. For example, for the reaction

A+B=C+D (16)

when we consider a forward reaction step, we first ran- domly select a pair of A and B molecules. In the potential iinal state, either A is replaced by C and B is replaced by D, or A is replaced by D and B is replaced by C. The particular choice will affect the convergence of the algo- rithm, but such a choice must be made at the outset of the simulation. Suppose, e.g., we have made the first choice. Then, when we attempt a backwards reaction step, we must always attempt to replace C by A and D by B.

If 7, the change in the total number of molecules per unit of reaction,

f&Z i Vi9 (17) i=l

is nonzero, then there will be a deficit or surplus of mole- cules on either the forward or reverse reaction steps. Sup- pose, e.g., that V > 0, and we are considering a potential forward reaction step. Any additional molelecules are in- serted into the box at random positions. If V<O, some of the formerly occupied positions remain vacant. The best choice of particle correspondence is one when the corre- sponding particles are of similar size and the randomly inserted particles are as small as possible.

Given the above simulation scheme, we show in Ap- pendix B that the required transition probability k-t1 is obtained directly from Eq. ( 14) as the ratio of terms in the partition function:

Pii-min[ 1, IJ [ WYN (v¶i~A?)v’~ exp(-DAUkf) 1 I =h[ l~~‘r’fi [&]e~p(-PAci,,)), (18)

where l? is the ideal-gas quantity

3022 W. R. Smith: Reaction ensemble method. I

To simulate a chemical reaction at specified (P, T), rather than at. ( T, V), we must incorporate a third type of state transition in addition to the particle position and re- action moves, that of trial volume changes, V,--+ VI. These trial moves are implemented in the usual way, and are governed by by19

.

(23) The Gibbs ensemble method can be obtained as a spe-

cial case of the reaction ensemble method by considering a two-phase system undergoing phase equilibrium reactions of the type given by Eq. (6), which can be written as

1 .Sf-l *Sj=O, (24)

where species i and j are in different phases and vi= 1, vj= - 1. Each phase is modeled by a separate simulation box, and the reaction steps take place from one box to another. Thus, for phase equilibrium, I’(T) = 1, V=O, and Eq. ( 18) becomes equivalent to the “particle transfer ac- ceptance probability” in the Gibbs ensemble method. In addition to reaction moves to ensure ultimate equality of chemical potentials, the Gibbs ensemble method ensures equality of pressures in each phase by means of volume change steps for each simulation box, using the appropriate analog of Eq. (23) for the set of simulation boxes. This procedure must also be carried out when the reaction en- semble method is employed for multiphase systems.

Finally, we generalize our procedure to any linearly independent set of R chemical reactions, given by

igl vj$i=O; j= 1,2 ,..., R. (25)

The coordinate transformation from {Ni) to {cjj> is given by

and

Ni=@+ jgl vjt<j 2 i- 1,2 ,..., s; j= I,2 ,..., R. (26)

The resulting reaction partition function that satisfies the equilibrium conditions

Auk,= u*-- u, .

I is related to tabular thermodynamic data” by

(20) 0, j= 1,2 ,..., R (27)

is JY( T) =e-

where

(21) Q(x,KT)

AcO( T) = C ViA@o/i( T) (22) i

.--;...z I”r ( 1 2 ER i=l

and AGOfi( T) is the ideal-gas standard free energy of for- mation of species i at the reference pressure Pe. We remark that cases in which (7#0) are simply and explicitly ac- counted for by the term in Eq. ( 18) involving V.

X s

exp[ -pU( V,zl ,..., zN) ]dz, ,..., dzN (28)

and the transition probability for an individual reaction step cj is

J. Chem. Phys., Vol. 100, No. 4, 15 February 1994 Downloaded 21 Jun 2001 to 152.1.75.231. Redistribution subject to AIP license or copyright, see http://ojps.aip.org/jcpo/jcpcr.jsp

W. R. Smith: Reaction ensemble method. I 3023

$d=min l,j+EjrF fi (~+vj&)! I r=l [ (Ny)! ]e-~u~~)]-

(29) As in the case of systems involving only a single reaction, Eqs. (28) and (29) may be applied to the case of specified (P,T) by the incorporation of volume change moves, and to multiple phases by means of additional simulation boxes and the imposition of the constraint of equal pressures on each such box.

To summarize, the reaction ensemble method (for a singl,lephase system) consists of a combination of the fol- lowing types of steps:

1. Particle displacement (NVT) steps. 2. Reaction steps, consisting of the following:

(a) Randomly select a reaction (if there are more than 1). (b) Randomly select whether the reaction step will

. be forwards or backwards. __ (c) Randomly select a set of reactant land product molecules in the system; * -,,,.“I- (d) Implement the reaction (x, V,T) step accord- ing to Pqs. (29) and (12).

3. In the case of constant pressure simulation, attempt a volume change (NPT) step.

The convergence of the method is affected by the the relative ratios of the three different types of steps, and the optimal choice depends on the system properties. The rel- ative frequency of steps 1 and 3 should be chosen similarly to that used in conventional NPT simulations (i.e., z:N:l, where N is the total number of particles in the system). We have found that it is reasonable to attempt, for each. vol- ume step, a sufficient number of reaction steps so that the number of accepted steps is several percent of the total number of molecules.

III. EXAMPLE SYSTEMS AND COMPUTATIONAL DETAILS

To illustrate the reaction ensemble method, we con- sider five different reacting systems. We include examples of cases considered difficult by previous workers to dem- onstrate the simplicity and flexibility of the method. Thus, two examples illustrate the case G#O, and one considers the case of two simultaneous reactions. The first four ex- amples involve model hard-sphere systems. Although such systems are only tenuously related to real systems, they provide both an illustration and a verification of the method, since the equilibrium compositions may also be calculated independently using accurate semiempirical re- sults for the hard-sphere systems. In fact, our results may be more accurately viewed as providing tests of these semi- empirical equations. The final example is the NO forma- tion reaction (5) considered previously by Shaw.“-I3

The first example system involves the isomerization reaction

where A and B are hard spheres of diameters aA and as. For this system, we considered the case on/a,=O.5. For illustrative purposes, we set I= 1, and performed calcula- tions as a function of overall density p*=N&V, consid- ering reaction at either constant volume or constant pres- sure.

The second example is the hard-sphere pseudodimer- ization system

2AeB.

We set

(31)

(32)

and calculated the equilibrium composition as a function of density p* = ZN*d/ V, for the case I?* = I/d*= 1, and as a function of r* for p*=O.5.

The third example is

A.+B+,’ (33) _ where we chose ” ’ _i _

a,&/3 “.

aA '

ZE3L(3 -- 1 (35)

and calculated the equilibrium composition as a function of overall reduced density for I’*= 1, for an overall composi- tion corresponding to initially equimolar amounts of A and B.

The.fourth example involves a system simultaneously undergoing both reactions (3 1) and (33) with I*= 1 for both reactions, and the final example is the NO formation reaction (5).considered previously by Shaw.“-‘3

We performed all our simulations employing the usual periodic boundary conditions, with spherical cutoffs in the potential for the case of (5). Based on previous experience with similar systems, in each simulation the total numbers of particles were chosen so that the average number of particles of any individual species was at least 30. The calculations were generally carried out so that approxi- mately 30% of the simulation steps were reaction steps, 1% were volume change steps (for the constant P runs), and the remainder were particle translation steps. At high densities, the number of reaction steps was increased up to near 85%. All calculations were programmed in FORTRAN and run on a HP 9000/730 computer.

IV. RESULTS AND DISCUSSION

For the tirst four examples, involving hard-sphere sys- tems, we compared our results with those obtained assum- ing an ideal solution and with results obtained using an equation of state- for hard-sphere mixtures due to Boub- likeZO

Our results for the isomerization system are presented in Fig: 1, where the~equilibi-ium mole fraction of the larger ‘molecule A is shown as a function of overall density. The

(30) results of calculations at constant overall density and con-

J. Chem. Phys., Vol. 100, No. 4, 15 February 1994

AF%,

Downloaded 21 Jun 2001 to 152.1.75.231. Redistribution subject to AIP license or copyright, see http://ojps.aip.org/jcpo/jcpcr.jsp

3024 W. FL Smith: Reaction ensemble method. I

0.6

0.0 - ’ 1 0.0 0.5 1.0 1.5 2.0 2.5

P*

FIG. 1. Equilibrium for the hard-sphere isomerization reaction (30), as a function of overall density, with r= 1. x, is the equilibrium mole frac- tion of hard spheres with diameter a,. Circles denote calculations at constant (VT) and squares denote calculations at constant (PT). The solid curve results from the use of Boublik’s (Ref. 20) equation of state and the dashed curve is the ideal-gas result.

stant pressure are both shown. It is seen that the results obtained numerically using Boublik’s20 equation of state agree excellently with those of the simulations, and that the ideal-gas results are.considerably in error.

Our results for the pseudodimerization system are pre- sented in Fig. 2. In Fig. 2 (a), the equilibrium mole fraction of the monomer is shown as a function of overall density, for calculations at both constant overall density and con- stant pressure. In Fig. 2(b), the dependence on I’* is shown at a constant overall density of p*=OS. Again, the

(4 ‘.2 ?

0.4 -

0.0 0.2 0.4 0.6 0.8

P*

1

0.6

H 0.6

0.4

o,o 0.2 0.4 0.6 0.8 1 .o

P*

EriG. 3. Equilibrium for the hard-sphere reaction (33) as a function of overall density, for I’*= 1, correspondmg to initially equimolar amounts of A and B. x denotes the mole fractions of the three species and the points denote our simulation results. The curves result from the use of Boublik’s (Ref. 20) equation of state.

equation of state results are excellent. The ideal-gas results are erroneous, but not as poor as in the case of the isomer- ization system.

Our results for the reaction of Eq. (33) are presented in Fig. 3, where we show the three equilibrium mole frac- tions as a function of both reduced density and I’* corre- sponding to an equimolar reactant overall composition. The results obtained from the equation of state are excel- lent everywhere, and only slightly in error at the highest density.

Our results for the two-reaction system are presented

(b)

=1 1.0 ideal gas -

___._._.... . ___~_____________.._~.... --..- ____..-

0.6 -

0 2 4 6 6

1/l?*

FIG. 2. Equilibrium for the hard-sphere pseudodimerization reaction (31). (a) Density dependence for I’*= 1, and (b) dependence on r* at fixed overall density. xA is the equilibrium mole fraction of hard spheres with diameter oA. CiicIes denote calculations at constant (VT) and squares denote calculations at constant (PT). The solid curves result from the use of Boublik’s (Ref. 20) equation of state and the dashed curves are the ideal-gas results.

J. Chem. Phys., Vol. 100, No. 4, 15 February 1994 Downloaded 21 Jun 2001 to 152.1.75.231. Redistribution subject to AIP license or copyright, see http://ojps.aip.org/jcpo/jcpcr.jsp

FIG. 4. Equilibrium for the hard-sphere two-reaction system, reactions (31) and (33), for,l?*=l, as a function of overall density and x,,, the overall ratio of amounts of species A and B. xc is the mole fraction of species C, and the points denote our simulation results. The curves result from the use of Boublik’s (Ref. 20) equation of state.

in Fig. 4, where we show the equilibrium mole fractions as a function of reduced density for the case of I’* = 1 for both reactions. The equation of state results are again excellent.

Our results for the system simulated by Shaw”-13 are given in Table I. It is seen that the results at x0=0.5 are in essentially exact agreement. Our more accurate results us- ing larger numbers of molecules than used by Shaw indi- cate his results for the equilibrium NO mole fractions are slightly high.

V. CONCLUSIONS

We have derived a new Monte Carlo simulation method called the reaction ensemble method, that is com- putationally well-suited for the simulation of equilibria in systems involving any number of chemical reactions exist- ing in any number of different phases. This method allows the efficient determination of chemical reaction equilib- rium, including combined reaction and phase equilibrium, directly from a description of the intermolecular interac- tions among the molecules of the system.

TABLE I. Simulation of reaction (5).

The reaction ensemble method is an improvement on the approach of Kofke and Glandt,” due to the fact that chemical potentials and/or fugacities need not be calcu- lated. Previously the most important available method for simulating chemical reactions is that due to Shaw.“-I3 Our method differs from his approach, both in its microscopic viewpoint of particle distinguishability and also in its ex- ploitation of the intrinsic link between the chemical stoi- chiometry and the underlying constraints of conservation of mass. This results in an extremely simple set of compu- tational formulas, which are well-suited to many cases of reaction equilibria considered too complex for straightfor- ward treatment in the past. This includes the cases of mul- tiple reactions and reactions for which the total number of molecules is not conserved, as well as reactions in multi- phase systems.

We have derived the reaction ensemble method here for reacting systems at either fixed ( T, V) or fixed ( T,P), although it may be easily extended to cases of other sets of thermodynamic constraints. The Gibbs- ensemble method may be viewed as a special case of the reaction ensemble method, in which the only “reactions” take place between species in different phases.

We have illustrated the reaction ensemble method for four model systems of reacting hard spheres, for which results may also be obtained using alternative approaches based on semiempirical equations of state. Our calculations may be viewed as tests of the accuracy of these semiempir- ical equations. We have also considered a more realistic system, modeling the formation of NO from O2 and N,, an example that has been considered previously.11-13

In future papers, we plan to use the method to perform calculations for more complex model and realistic systems involving combined phase and reaction equilibria.

APPENDIX A: REACTION ENSEMBLE PARTITION FUNCTION FROM A LEGENDRE TRANSFORMATION

We consider a system undergoing the single chemical reaction of Eq. ( lo), and generalize our results to the case of several simultaneous reactions. Chemical equilibrium occurs when

W. Ft. Smith: Reaction ensemble method. I 3025

Jpo P

l/6 120 l/6 402 l/3 120 l/3 399 l/2 120 l/2 400 2/3 120 2/3 399 5/6 120 5/6 402

This paper

0.1785(04)

0.2522(05) 0.2763(04) 0.2755(04)

0.2543(04)

0.1810(04)

ShawC

0.1789(08)

0.2549( 16)

0.2768( 22)

0.2555( 17)

0.1828(11)

(Al)

Wverall mole fraction of 0.

This condition can be considered as an external constraint imposed on our thermodynamic system and our task is to employ this constraint. Our derivation will show that the fact that the right-hand side of E?q. (Al) is exactly zero is unimportant. Theoretically, it can be held hxed at any con- stant value. (This situation has important applications to some systems of chemical interest.‘l)

%tal number of particles in the simulation. ‘Reference 11. Numbers in parentheses denote pm&ions.

The thermodynamics of a system at constant T, V and total numbers of all types of molecules Ni can be described

J. Chem. Phys., Vol. 100, No. 4, 15 February 1994 Downloaded 21 Jun 2001 to 152.1.75.231. Redistribution subject to AIP license or copyright, see http://ojps.aip.org/jcpo/jcpcr.jsp

3026 W. R. Smith: Reaction ensemble method. I

by a canonical ensemble whose corresponding thermody- given by the usual summation” of the canonical partition namic potential is the Helmholtz free energy A, with the functions (A3) over all possible values of the extensive corresponding fundamental equation variable 5:

dA=-SdT-PdV+ i ,UidNis (A21 L

@=C fi ‘w$y) 61 i=l

where S is the. entropy. The partition function Q of the canonical ensemble is given by X

s e&f -PWI ,...,zivcn) ldz, ,... ,&vcn

Q= i-l m!!?&$ --

XeXPIDC$lVjlJj]- (A81

X exp[ -@UC v,zr ,..., ZN)]dzl ,..., dzN, (A3) If the system is at chemical equilibrium [satisfies Eq. (Al)], then the final exponential term in the partition

where U is the total potential energy, z, are relative coor- function is equal to unity, in which case the potential AX is dinates of the particles in the simulation box, ~7~ are the numerically equal to A. We note, however, that we may, in internal contributions to the partition function, Ai are de principal, perform simulations on systems for which the Broglie thermal wavelengths, and N=ZN,. summation is an arbitrary constant value.

This ensemble is not convenient for the simulation of This reaction ensemble is suitable for simulations when chemical equilibria because the numbers of all the mole- the natural coordinates of the thermodynamic potential AX cules which take part in the chemical reaction (have non- are held constant, which are T and V. The generalization zero Vi) are variable, whereas the intensive variable Zvpi is to the case of constant pressure can be done in the usual constant. We perform a Legendre transformation to create way. A Legendre transformation is made by adding PV to

a new thermodynamic potential whose natural variables AX and integrating the reaction partition function over all include ZV+Li. We first perform a transformation of coor- possible values of the extensive variable V when multiply- dinates in the space of the variables Ni; i= l,...,s. The’most ing each term by exp[-PPVJ suitable form of such a transformation is In the case of more than one chemical reaction, the

only difference is that the number of coordinates explicitly NFV&+ Yi(bl,bz,*..,b,-l), (A4) defined as extents of reactions in I@. (A4) must be identi-

where E is the extent of the chemical reaction and Yi is a cal to the number of reactions, and all these extensive co-

function of (s- 1) auxiliary parameters that depend on the ordinates must be subjected to the Legendre transforma-

overall system composition. In the following, the exact def- tion. The simulation steps will then include changes of all

inition of the quantities Yi is irrelevant, since they will extents of reaction randomly selected.

ultimately be held fixed due to the imposition of the closed system constraint, and they do not need to be subjected to APPiNDlX B: PROOF OF MICROSCbPIC the Legendre transformation. The new form of the funda- REVERSIBILITY FOR THE REACTION ENSEMBLE mental equation, which is exactly equivalent to Eq. (A2) is SIMULATION

dA= -SdT-PdV+- 2. ysLid( F The purpose of this Appendix is to prove that the

i=l proper ratio of forwards and backwards acceptance prob-

+ i ‘$/Li$dbj.

abilities for a trial reaction step from one state to another is

(A51 equal to the ratio of terms that correspond to both states in i=l j=l the partition function for a molecular system represented

Now we may define a new thermodynamic potential by a system of distinguishable particles. The case is quite

AX by the equation similar to that of the grand canonical ensemble.

.We shall suppose that in the simulation algorithm the

AX=A-g i$l v@i probability that the trial step forwards is l/2 and the prob-

fA6) ability that the reaction step backwards is also l/2. The a priori probability that from the present state r the trial

whose infinitesimal change can be written as reaction step will lead to the state s is denoted by pz, The term corresponding to a given state r in the partition func- tion is the term that, after dividing by the partition func- tion Q, becomes the probability density. We shall denote this term by p,,, and the probability of this state W(r) is

(A7)

The variable Zv$Li plays the role of a new natural vari- able of Ax, so it can be held fixed during the simulation. The partition function corresponding to the potential AX is

where 6 is the minimum distinguishable volume element in our unit simulation cube containing the variables zi (given ,

J. Chem. Phys., Vol. 100, No. 4, 15 February 1994 Downloaded 21 Jun 2001 to 152.1.75.231. Redistribution subject to AIP license or copyright, see http://ojps.aip.org/jcpo/jcpcr.jsp

W. R. Smith: Reaction ensemble method. I 3027

by the number of valid digits in our computer) and N is the total number of particles. In the isobaric ensemble an additional & is necessary due to the integration over the extensive variable of volume. The ratio of forwards and backwards acceptance probabilities w~~=P$P;~ of a step in the Markov chain must be given by

W(s) P:?r , W ”=Wopz* U32)

We shall assume in the following that species with indices i=l ,...,I are on the left-hand side of the equation (reactants) and species with indices i=l+ l,...,s are on the right-hand side (products). We shall denote by Ni the numbers of molecules of each species in state r and assume that the reaction step is from the left to the right with the number of product particles greater than or equal to the number of reactants. Other cases are treated similarly.

If we have decided that the reaction step will take place from left to right, we must randomly select 1 Vi1 reactant

molecules (those for which vi<O) of each type i=l,...,Z, and change their identities according to some scheme that we have adopted, to product molecules of types i=l+ 1 ,...,s. If 7 < 0; the remaining particles are inserted into the simulation box at random positions. In the oppo- site case, some of the places previously occupied by reac- tant molecules remain vacant. We have N1 (Nr - 1) * * * (Nr +vl + 1) possible ways to select particle number 1 and analogous numbers of ways for other reactant particles. If we select them and change them to product particles ac- cording to our scheme, the first particle of type s can be assigned any label between 1 and N,+ 1 (because the dis- tinguishable particles form an ordered set). Similarly, the number of possible positions can be calculated for all par- ticles i= I+ 1 ,...,s- 1. If some particles are added at ran- dom, the probability that they will fall exactly in a definite volume element is S, since the volume of the unit cube is unity. The a priori probability that a particular state s will be selected as the result of a reaction step from state r is

U33)

The a priori probability of a reverse step from state s to state r differs only in two aspects. First, particles with labels i- 1,...,1 are created and those with labels i==Z+ l,...,s are destroyed. Second, the numbers of particles of each type are increased by vi from state r. The reverse a priori probability is therefore

Substituting Eqs. (Bl ), (B3), and (B4) into Eq. (B2) we get for w, the result

w --s-G W (s) Ps rs- m=pr- 035)

To preserve microscopic reversibility; it is necessary to carefully consider the particle correspondence in the for- ward and backward reaction step. If in the forward step a particle B is placed at the position of a particle A, then in the backward step particle A must be placed at the former position of a particle B.

‘J. V. Smith, R. W. Missen, and W. R. Smith, AIChE J. 39,707 (1993). ‘A. K. Gupta, P. R. Bishnoi, and N. Kalogerakis, Fluid Phase Equilib.

63, 65 (1991). 3 W. R. Smith and R. W. Missen, Chemical Reaction Equilibrium Anal- ys&: Theory and Algorithms (Krieger, Malabar, FL, 1991); reprint of same title (Wiley-Interscience, New York,. 1982).

4W. R. Smith and R. W. Missen, Can J. Chem. Eng. 66, 591 (1988). sS. I. Sandler, ChemicaI and Engineering Thermodynamics, 2nd ed.

(Wiley, New York, 1988). ‘D. M. Pfund, L. L. Lee, and H. D. Cochran, J. Chem. Phys. 94, 3114,

3207 (1991). ‘P. T. Cummings and G. Stell, Mol. Phys. 55, 33 (1985). ‘0. Attard, J. Chem. Phys. 98, 2225 (1993).

9D. F. Coker and R. 0. Watts, Chem. Phys. Lett. 78, 333 (1981); Mol. Phys. 44, 1303 (1981).

“D. A. Kofke and E. D. Glandt, Mol. Phys. 64, 1105 (1988). “M. S. Shaw, J. Chem. Phys. 94, 7550 (1991). I’M. S. Shaw, in Shock Compression of Condensed Matter 1991, edited by

S. C. Schmidt et al. (EIsevier, Amsterdam, 1992), pp. 131-134. “M S Shaw Proceedings of the 10th Symposium on Detonation (in . . I

press). 14A. 2. PanagiotopouIos, Mol. Simul. 9, 1 (1992). ‘s A. Milnster; Statistical Thermodynamics (Academic, New York, 1989). i6Reference 3, Chap. 2. *‘R. A. Alberty and R. J. Silbey, PhysicaZ Chemistry, 1st ed. (Wiley, New

York, 1992), Sec. 5.13. ‘*M. W. Chase, Jr., C. A. Davies, J. R. Downey, Jr., D. J. Frurip, R. A.

McDonald, and A. N. Syverud, JANAF Thermochemical Tables, 3rd ed. I. Phys. Chem. Ref. Data 14, Suppl. No. 1 (1985).

‘9W. W. Wood, in Physics of SimpIe Liquids, edited by H. N. V. Tem- perley, I. S. Rowlinson, and G. S. Rushbrooke (North-Holland, Am- sterdam, 1968).

“T. Boublik, Mol. Phys. 42, 209 (1981). “G W. Norval, M. J. Phillips, R. W. Missen, and W. R. Smith, Can. J.

&em. Eng. 69, 1184 (1991).

J. Chem. Phys., Vol. 100, No. 4, 15 February 1994 Downloaded 21 Jun 2001 to 152.1.75.231. Redistribution subject to AIP license or copyright, see http://ojps.aip.org/jcpo/jcpcr.jsp