Phase Envelope Generator
Generate rigorous Pressure-Temperature (PT) phase envelopes using Peng-Robinson or SRK Equations of State to identify retrograde regions, cricondentherms, and cricondenbars.
Project Data
Gas Comp.
| Total | |||
Solving Flash Equations...
PT Diagram & Critical Points
Engineering Reference & Technical Basis
1. Equations of State (EOS) & Mixing Rules
This application implements two foundational cubic equations of state: Peng-Robinson (PR, 1978) and Soave-Redlich-Kwong (SRK, 1972). The generalized cubic EOS form is:
Where for PR: $u = 2, w = -1$ and for SRK: $u = 1, w = 0$.
The mixture parameters $a_{mix}$ and $b_{mix}$ are calculated using the classical van der Waals one-fluid mixing rules with binary interaction parameters ($k_{ij}$):
2. Supercritical Extrapolation (Boston-Mathias)
Standard EOS alpha functions ($\alpha$) decay incorrectly at high temperatures, which causes severe inaccuracies and solver collapse when computing mixtures with highly supercritical components like Hydrogen ($H_2$), Helium ($He$), or Nitrogen ($N_2$).
To resolve this, the Boston-Mathias (1980) extension is used for components where the reduced temperature $T_r > 1$. It forces the $\alpha$-function to extrapolate exponentially, preserving thermodynamic stability:
Where $d_i = 1 + m_i / 2$ and $c_i = 1 - 1/d_i$. This ensures both the function and its first derivative match the standard subcritical formulation perfectly at $T_r = 1$.
3. Phase Envelope Construction (Michelsen Continuation)
Traditional pressure-sweep algorithms fail at the cricondenbar (maximum pressure) and cricondentherm (maximum temperature) because the curve tangent becomes infinite relative to the search axis. This engine utilizes Michelsen's (1980) Arc-Length Continuation method. The phase boundary is treated as a continuous mathematical curve defined by a system of $N+2$ equations solved simultaneously via a multidimensional Newton-Raphson technique:
- Fugacity Equality ($N$ equations): $\ln K_i + \ln \hat{\phi}_i^V(\vec{y}, T, P) - \ln \hat{\phi}_i^L(\vec{x}, T, P) = 0$
- Rachford-Rice Mass Balance (1 eq): $\sum_{i} \frac{z_i (K_i - 1)}{1 + \beta (K_i - 1)} = 0 \quad$ (where $\beta=0$ for bubble, $\beta=1$ for dew)
- Arc-length Step (1 eq): $X_{spec} - X_{spec}^{old} - \Delta S = 0$
The solver dynamically switches the independent specification variable ($X_{spec}$) between $\ln P$ and $\ln T$ depending on the tangential trajectory, allowing it to seamlessly navigate around the critical point without numerical discontinuities.
4. Operating Point Flash Calculation
The operating point state is determined using a rigorous isothermal (PT) flash algorithm. It solves the Rachford-Rice objective function for the vapor fraction ($\beta$) coupled with successive substitution (SS) of K-values.
The flash limits the solution bounds mathematically to accurately detect sub-cooled liquids ($\beta \le 0$) and superheated vapors ($\beta \ge 1$), ensuring reliable phase identification even outside the two-phase dome.
5. Literature References
- Peng, D. Y., & Robinson, D. B. (1976). "A New Two-Constant Equation of State." Industrial & Engineering Chemistry Fundamentals, 15(1), 59-64.
- Soave, G. (1972). "Equilibrium constants from a modified Redlich-Kwong equation of state." Chemical Engineering Science, 27(6), 1197-1203.
- Michelsen, M. L. (1980). "Calculation of phase envelopes and critical points for multicomponent mixtures." Fluid Phase Equilibria, 4(1-2), 1-10.
- Boston, J. F., & Mathias, P. M. (1980). "Phase equilibria in a third-generation process simulator." Proceedings of the 2nd International Conference on Phase Equilibria and Fluid Properties in the Chemical Industry, Berlin.
- Søreide, I., & Whitson, C. H. (1992). "Peng-Robinson predictions for hydrocarbons, CO2, N2, and H2S with ties to water." Fluid Phase Equilibria, 77, 217-240.