Skip to content

Real gases ​

Before this page

Standard states, §2, for the reference state of a gas, the pure ideal gas at .

A gas keeps the pure ideal gas at   bar as its standard state whatever its pressure; what departs from the ideal gas is its activity, through a fugacity coefficient given by an equation of state. This page states the equation of Peng and Robinson (1976) and what the equilibrium solver sees of it. How the pressure moves the standard state of the condensed species, the solids, the solutes and the solvent, is in Standard states §1 and Thermochemistry §3.

1. The fugacity coefficient ​

The chemical potential of a gas in a mixture at , and mole fractions is written

the fugacity replacing the partial pressure of the ideal gas, so that the activity is  . The fugacity coefficient measures what the real mixture adds to the ideal one at the same , and composition. With the residual Gibbs energy of the phase, its Gibbs energy minus that of the ideal gas mixture,

Three consequences follow from this one definition and are what the tests of the package check, by automatic differentiation, for any constants:

  • Gibbs–Duhem:   , the fugacity coefficients being the partial molar quantities of one function;

  • the partial molar volume:    , since  ;

  • the ideal limit:   as  , as    for a pure gas, its second virial coefficient.

2. The equation of Peng and Robinson ​

The equation of state relates pressure, temperature and molar volume through two parameters,

the attraction and the covolume , which the critical temperature and pressure set, and a temperature function which the acentric factor shapes:

In the compressibility factor   and the reduced parameters   and  , it is a cubic:

The two constants. At the critical point the vapor and the liquid merge, and the cubic has a triple root :   matched to it coefficient by coefficient gives   ,    , and for the cubic     . Its root is  , and then   and  . Peng and Robinson (1976) give and , the same numbers rounded; the package takes the roots themselves. Rounded, they move the triple root by the cube root of the rounding, about in , so the critical point of the equation would no longer be the one it is given.

The residual energy. Integrated along the isotherm from the ideal gas, the equation gives, per mole of gas,

which is for a pure gas.

3. Which root ​

Below the critical temperature and between the spinodals the cubic has three real roots above : the vapor, the liquid and, between them, a root at which  , a negative compressibility that no phase can have (Richet, 2001; Sec. 4.2, p. 66). The stable phase is the root of least Gibbs energy, and that is the one taken. Where the two energies are equal, the fugacities of the vapor and the liquid are, which is the saturation: for carbon dioxide at 25 °C, with the constants of phreeqc.dat (Parkhurst and Appelo, 2013), the equation places it at 64.4 bar, against 64.35 bar for the reference equation of pure carbon dioxide that Spycher et al. (2003) quote. Across it, the root jumps from the vapor to the liquid and the fugacity stays continuous.

The root is found on plain numbers, in closed form, then lifted into the dual numbers of whatever is being differentiated by two Newton steps on the cubic  . The value does not move, and the derivatives come out as the implicit-function theorem gives them,   , exact to second order. At the critical point itself vanishes and the derivatives are infinite, which is the physics: the compressibility of a fluid diverges there.

4. Mixtures ​

A mixture is described as one fluid whose parameters are those of the van der Waals mixing rules,

the binary parameters correcting the geometric mean of the attractions; they are zero unless given. The simplest mixture of real gases would keep for each gas its fugacity coefficient pure at the same temperature and pressure, the rule of Lewis and Randall (Richet, 2001; Sec. 8.4, p. 185); the mixing rules let the gases act on one another instead. Differentiating with respect to the amount of each gas gives

with   . A gas phase follows the equation as a whole: when some of its gases carry critical constants and others do not, there is no mixing rule between the equation and its absence, and the package refuses the system rather than mix them.

5. What the equilibrium sees ​

The activity of a gas becomes

in every activity model, and the gas phase occupies   instead of . Two consequences for the solver are worth stating.

  • A gas alone is a pure phase whose activity,  , does not depend on its amount: its Gibbs energy is linear in that amount whatever the equation of state, the choice of root having already settled whether it is a vapor or a liquid. The problem keeps the convexity it had, and a certificate can still prove a global minimum (Proving that an answer is the answer).

  • A mixture of real gases can split into two fluids of different compositions, a liquid rich in one gas and a vapor rich in the other. Its energy is not convex in the composition, and a certificate proves no more than a local minimum.

A constraint that counts the volume of the system as , linear in the amounts, has no place for a phase whose molar volume depends on its composition, and refuses a real gas.

Where to go next ​

Carbon dioxide in water under pressure computes the measured solubility of carbon dioxide from 25 to 500 atm with the gas ideal and real, and separates what the fugacity coefficient and the volume of the solute each contribute. The syntax is in Gases under pressure.