A cubic equation of state is a compact way to estimate fluid pressure, density and phase behavior from a small set of pure-component data. PR and SRK are useful starting points for hydrocarbon mixtures; choosing one does not guarantee accurate liquid densities or strongly polar-mixture behavior. Compare with measurements in your temperature, pressure and composition range.
Think of the model as a balance between molecules taking up space and molecules attracting one another. The first term below accounts for excluded volume; the second reduces pressure because of attraction. Here is pressure, is absolute temperature, is the gas constant, and is molar volume. The covolume has units L/mol, the critical attraction parameter has units bar L²/mol², and , and the temperature correction are dimensionless. Reduced temperature is , where is the pure-component critical temperature. The generic pure-fluid equation [1] is
For a mixture, the mixing rule combines pure-component parameters. The alpha function first adjusts each pure component’s attraction with temperature: these are different jobs. PR, SRK and RKPR default to quadratic mixing with zero binary corrections unless supplied; PSRK uses an excess-Gibbs mixing rule instead.
For PR and SRK, supply arrays tc (K), pc (bar), and w (dimensionless
acentric factor). The acentric factor summarizes pure-fluid vapor-pressure
behavior; it is not a composition. Every array must use the same component
order. Optional kij and lij are dimensionless square matrices in that order,
normally symmetric with zero diagonals. They require a suitable parameter source
or fitting; zero is a baseline, not a universal fit.
This complete program uses methane then n-butane. It evaluates a specified
homogeneous state without asking an equilibrium solver to find a state.
The API takes mole amounts n (mol) and total V (L), not molar volume.
Here the one-mole basis makes their numerical values coincide.
program cubic_pressure
use yaeos, only: pr, R, CubicEoS, PengRobinson76
implicit none
type(CubicEoS) :: model
real(pr) :: tc(2)
real(pr) :: pc(2)
real(pr) :: w(2)
real(pr) :: n(2)
real(pr) :: T
real(pr) :: V
real(pr) :: P
real(pr) :: Pideal
tc = [190.564_pr, 425.12_pr]
pc = [45.99_pr, 37.96_pr]
w = [0.0115478_pr, 0.200164_pr]
model = PengRobinson76(tc, pc, w)
n = [0.3_pr, 0.7_pr]
T = 300.0_pr
V = 10.0_pr
call model%pressure(n, V, T, P)
Pideal = sum(n)*R*T/V
print *, "Pressure [bar]: ", P
print *, "Ideal-gas pressure [bar]: ", Pideal
print *, "Compressibility Z [-]: ", P/Pideal
end program cubic_pressure
Link this program with yaeos and its dependencies in your configured Fortran/fpm
environment. pr is the library’s real kind; _pr literals avoid rounding inputs
to default real precision. The dimensionless compressibility factor
should approach one at small density. Scaling both n and V
by the same positive factor should leave pressure unchanged.
Below, is critical pressure and is acentric factor.
The dimensionless alpha coefficient is a pure-component quantity,
not a binary interaction . The b listed for each model is the
pure-component covolume; for PR and SRK it is also what the quadratic mixing
rule combines.
Fortran definition: SoaveRedlichKwong. The SoaveRedlichKwong EoS uses the following function and its respective correlation for .
Fortran definition: PengRobinson76. The Peng-Robinson EoS uses the following function and correlation for k.
Fortran definition: PengRobinson78. The Peng-Robinson (1978) EoS is an variant of the original Peng-Robinson (1976) equation with a different high-acentric-factor correlation. It uses the following function and correlation for k.
The RKPR EoS [2] extends the classical formulation of Cubic Equations of State by freeing the parameter and setting [1]. This extra degree provides extra ways of implementing the equation in comparison of other Cubic EoS (like PR and SRK) which are limited to definition of their critical constants.
Besides that extra parameter, the RKPR includes another function:
Its constructor is RKPR(tc, pc, w, zc, kij, lij, delta_1, k); arguments after
zc are optional. Here zc is the experimental critical compressibility
, with the critical molar volume. RKPR needs
this additional pure-component information. Optional delta_1 and k arrays
each have one entry per component.
The implementation uses an effective critical compressibility 1.168*zc in
its default shape correlation and numerically readjusts unspecified k values
to match the acentric-factor definition at . This numerical fit is
not an unconditional convergence guarantee. The implemented correlations are
documented with RKPR; do not substitute experimental zc directly into an
unrelated published correlation. Check that correlated parameters are finite,
particularly near the fractional-power correlation’s domain boundary.
Because the refit solves a saturation condition per component, building
an RKPR model is noticeably more expensive than building PR or SRK, and it can
be sensitive to the input zc values.
The PSRK EoS [3,4] (Predictive Soave-Redlich-Kwong) is a Soave-Redlich-Kwong
cubic equation of state that uses the MHV mixrule and a PSRK-UNIFAC model.
The alpha function is Soave by default, or AlphaMathiasCopeman when the
optional c1, c2, and c3 parameters are provided.
PSRK additionally needs one group decomposition per component, using the PSRK-UNIFAC group definitions and available interaction parameters. It does not infer molecular structure from critical constants. Supply all three alpha coefficient arrays together if overriding its default. See the group-contribution guide.
pressure evaluates a mathematical homogeneous state. It does not decide
whether that state will separate into liquid and vapor.Continue with mixing rules, alpha functions, and phase equilibrium. The EOS property guide explains the shared API, and thermodynamic fundamentals covers amounts, compositions, units and the difference between a model and a solver.
[1] Michelsen, M. L., & Mollerup, J. M. (2007). Thermodynamic models: Fundamentals & computational aspects (2. ed). Tie-Line Publications.
[2] M. Cismondi, J. Mollerup, Development and application of a three-parameter RK–PR equation of state, Fluid Phase Equilibria 232 (2005) 74–89. https://doi.org/10.1016/j.fluid.2005.03.020.
[3] Holderbaum, T., & Gmehling, J. (1991). PSRK: A Group Contribution Equation of State Based on UNIFAC. Fluid Phase Equilibria, 70(2-3), 251-265. https://doi.org/10.1016/0378-3812(91)85038-V
[4] Horstmann, S., Jabłoniec, A., Krafczyk, J., Fischer, K., & Gmehling, J. (2005). PSRK group contribution equation of state: Comprehensive revision and extension IV, including critical constants and α-function parameters for 1000 components. Fluid Phase Equilibria, 227(2), 157-164. https://doi.org/10.1016/j.fluid.2004.11.002