Translated from the author's Korean original. Read the original (한국어)
Where the Ideal Gas Starts to Lie — Compressibility Factor Z and the van der Waals Equation
At the same speed, momentum flux scales with density squared. A 26 percent density error becomes about 60 percent in rho u squared.
Nitrogen at 100 bar and 200 K, run through the ideal gas law, misses the real density by about a quarter. Same pressure. Same temperature. The molecules pull on each other and occupy volume of their own.
The mismatch is one number, the compressibility factor . van der Waals mimics the gas with two constants, and below the critical point an S-shaped loop splits liquid from vapor.
Drop the reduced-temperature slider below 1 and turn the Maxwell check on. The loop grows, and a horizontal saturation line appears where the two areas match.
Z(sat. vapor) = 0.633 · Z(sat. liquid) = 0.163
Near 0.85 the saturated-liquid falls below 0.1. Push the slider onto 1 and the liquid and vapor values of meet at one point. That is where the distinction disappears.
Nitrogen at 100 bar is heavier than an ideal gas#
treats molecules as points and drops the forces between them. It holds when the gas is dilute. The molecules sit far apart.
Raise the pressure and the gaps shrink. A weak attraction (the van der Waals force) reduces the volume. The molecules' own volume remains.
The two effects oppose each other. Attraction shrinks volume. Finite size inflates it. Temperature and pressure decide the winner. So a real gas can be heavier or lighter than an ideal gas, and the ranking flips with the conditions. When that density ranking flips, the threshold where light fluid on the bottom turns convection on moves with it.
The compressibility factor Z — one number for the mismatch#
Bundled into one number, the mismatch is the compressibility factor.
is pressure, molar volume, the gas constant, and temperature. is an ideal gas. Farther from 1 means a larger miss.
means attraction wins. The real volume is smaller than the ideal one. means finite volume wins. Molecules push the volume up. In the nitrogen example, means the real density is times the ideal value.
The principle of corresponding states: where every gas looks alike#
Each gas has its own curve. Divide pressure and temperature by that gas's critical values and the curves nearly stack.
and are the critical pressure and temperature. The principle of corresponding states says that equal reduced pressure and reduced temperature give nearly the same .
Nitrogen, methane, or carbon dioxide: at and the values sit close together. The position relative to the critical point sets the behavior, not the name of the molecule. One generalized chart covers a lot of gases.
The nitrogen in the code sits in a different cell from that example. and , so . and , so . Turning the printed back into a reduced volume gives . Put that point back on the reduced isotherm and returns as 2.95. The printed is a point on that supercritical isotherm.
van der Waals: mimicking molecules with two constants#
In 1873 van der Waals put two corrections on the ideal gas.
is the pressure the attraction removes. It grows as the volume shrinks. is the volume the molecules occupy, so the free space is .
The two constants are fixed at the critical point. There the – isotherm has an inflection, and the slope and curvature are both zero.
Solving those conditions gives the constants and the critical compressibility.
does not depend on which gas. Real gases have from 0.27 to 0.29. 0.375 is about one third above a value near 0.28. Quantitatively high. The picture of the loop and the critical point is right.
In reduced variables, and drop out.
That line is the equation form of corresponding states. The critical point is fixed at . The denominator is zero at . To the left of that, the volume is smaller than the molecular volume , and the isotherm is not drawn.
The S-curve below the critical point and the Maxwell construction#
For the isotherm falls monotonically. Raise the pressure and the volume drops.
For an S-shaped loop appears. The middle has . Pressure up, volume up. Mechanically unstable. A real substance skips that interval.
A single horizontal line joins liquid and vapor instead. Its height is the saturation pressure. The Maxwell equal-area construction picks the height where the areas cut above and below the line are equal. That is the same statement as equal Gibbs free energy for liquid and vapor. Only one pressure lets the two phases coexist.
Solving for Z in Python#
Rearranged for , van der Waals is a cubic. With the critical constants, any and has a .
import numpy as np
R = 8.314 # J/(mol·K)
def vdw_constants(Tc, Pc):
"""van der Waals a, b from the critical constants."""
a = 27.0 * R**2 * Tc**2 / (64.0 * Pc)
b = R * Tc / (8.0 * Pc)
return a, b
def vdw_compressibility(P, T, Tc, Pc):
"""Physical root of Z^3 - (1+B)Z^2 + A Z - A B = 0."""
a, b = vdw_constants(Tc, Pc)
A = a * P / (R * T)**2 # dimensionless size of the attraction term
B = b * P / (R * T) # dimensionless size of the finite-volume term
coeffs = [1.0, -(1.0 + B), A, -A * B]
roots = np.roots(coeffs)
real = roots[np.abs(roots.imag) < 1e-8].real
real = real[real > B] # only v > b ⇒ Z > B is physical
return real.max(), real.min(), real.size
# Nitrogen: Tc = 126.2 K, Pc = 3.39 MPa, M = 28 g/mol
Tc, Pc, M = 126.2, 3.39e6, 0.028
P, T = 1.0e7, 200.0 # 100 bar, 200 K
Z_gas, Z_liq, n = vdw_compressibility(P, T, Tc, Pc)
rho_ideal = P * M / (R * T) # ideal-gas density
rho_real = rho_ideal / Z_gas # real density
print(f"roots = {n}, Z = {Z_gas:.4f}")
print(f"ideal density = {rho_ideal:6.1f} kg/m^3")
print(f"real density = {rho_real:6.1f} kg/m^3 ({100*(rho_real/rho_ideal-1):+.0f}%)")Three lines come back.
roots = 1, Z = 0.7905
ideal density = 168.4 kg/m^3
real density = 213.0 kg/m^3 (+27%). The increase is 26.5 percent, and the printed is that value rounded to an integer. , so the state is supercritical. One real root means no liquid-vapor split. The ideal-gas density is still about a quarter lighter than the real one.
Supercritical injection and CFD — why the equation of state shakes the grid#
A liquid-rocket chamber usually runs above the propellant's critical pressure. LOX (liquid oxygen) or cryogenic nitrogen entering that chamber does not form the familiar droplets.
Surface tension is gone. Past the critical point the liquid-vapor boundary collapses. The jet does not break into drops. Density gradients fray like a comb and mix with the surroundings. Supercritical, or transcritical, injection.
The equation of state shakes the grid because density is tied to pressure and temperature nonlinearly. An ideal-gas solver misses the jet density by tens of percent, and the momentum flux and the mixing length move with it. Production codes use a cubic EOS (Peng–Robinson, SRK) or NASG (Noble–Abel Stiffened Gas). is the quantity that model solves in every cell.
Writing a 27 percent density error as a 27 percent momentum error is a failure#
At the same speed, scales with the square of the density ratio. , so a 26.5 percent density error is about 60 percent in the momentum flux. Writing "density is 27 percent off, so the flux is 27 percent off" drops the square.
If that pressure is inserted raw as a force, does the interface on Maxwell's horizontal line stay still? The nonideal lattice Boltzmann run where a raw pressure made a resting interface tremble leaves open whether that force has to be rewritten as a free energy before the interface settles.
Related
Share if you found it helpful.