MaximaLabs
All equations

Rachford-Rice flash

Phase equilibrium

The vapor-fraction objective every isothermal two-phase flash solves — one nonlinear equation in the vapor fraction ψ, monotonic so Newton always converges.

Governing equation

izi(Ki1)1+ψ(Ki1)=0\sum_{i} \frac{z_i\,(K_i - 1)}{1 + \psi\,(K_i - 1)} = 0
ψ\psi
Vapor fraction (mol vapor / mol feed) — the unknown.
ziz_i
Feed mole fraction of component i.
KiK_i
Vapor-liquid equilibrium ratio y_i/x_i of component i (fixed for this flash).

Derivation

  1. 1
    zi=xi(1ψ)+yiψz_i = x_i\,(1-\psi) + y_i\,\psi

    Component material balance: the feed splits into liquid (fraction 1−ψ) and vapor (fraction ψ).

  2. 2
    xi=zi1+ψ(Ki1)x_i = \frac{z_i}{1 + \psi\,(K_i - 1)}

    Substitute the equilibrium relation y_i = K_i x_i and solve the balance for the liquid mole fraction x_i.

  3. 3
    iyiixi=i(Ki1)xi=0\sum_i y_i - \sum_i x_i = \sum_i (K_i - 1)\,x_i = 0

    Both phase mole fractions must sum to one; subtracting the two summation constraints removes the trivial ψ-independent root and leaves a monotonic function.

  4. 4
    F(ψ)=izi(Ki1)1+ψ(Ki1)=0F(\psi) = \sum_{i} \frac{z_i\,(K_i - 1)}{1 + \psi\,(K_i - 1)} = 0

    Insert x_i to obtain the Rachford-Rice form — strictly decreasing in ψ, so a single root is bracketed and Newton converges globally.

Jacobian

The matrix Jij=Fi/xjJ_{ij} = \partial F_i / \partial x_j of the residual vector with respect to the unknowns, at the representative operating point. Every value below is computed by the exact forward-mode autodiff engine the solver uses — click a non-zero cell to see the symbolic derivative, each one verified against that engine in our test suite. This is the block a Newton step factorizes.

∂/∂psi
Rachford-Rice objective

Shaded cells are non-zero (the sparsity pattern); blanks are structural zeros.

Symbolic derivative
F1psi=\dfrac{\partial F_{1}}{\partial\, \mathrm{psi}} =
izi(Ki1)2[1+ψ(Ki1)]2-\sum_i \frac{z_i\,(K_i - 1)^2}{\left[1 + \psi\,(K_i - 1)\right]^2}
Evaluated at the operating point: -1.1653

For the residual Rachford-Rice objective with respect to psi. This exact expression is asserted equal to the autodiff value in the test suite.

Operating point

Representative operating point — a real solution of this instance.

psi = 0.45466z1 = 0.3z2 = 0.3z3 = 0.4K1 = 4K2 = 1.5K3 = 0.2

References

  • Rachford, H.H. & Rice, J.D. (1952). Procedure for use of electronic digital computers in calculating flash vaporization hydrocarbon equilibrium. J. Petroleum Technology 4(10).
  • Smith, Van Ness & Abbott, Introduction to Chemical Engineering Thermodynamics, 7th ed., §10.4.

Stop fighting legacy software. Build your first flowsheet in 60 seconds.