12.9 Ideal Gas Law, Gas Mixtures, and the Real Gas Law

Key Takeaways

  • NCEES lists the ideal gas law with nonreactive gas mixtures and the real gas law with the z factor as two separate Fluid Mechanics sub-topics.
  • The ideal gas law in specific-gas form is Pv = RT, where R is the universal gas constant divided by the molar mass, and absolute temperature is mandatory.
  • Dalton's law of partial pressures makes each component's partial pressure equal to its mole fraction times the total pressure.
  • The compressibility factor z corrects the ideal gas law to Pv = zRT and is read from a generalized chart using reduced pressure and reduced temperature.
  • Gases behave nearly ideally at low reduced pressure and high reduced temperature, so z approaches 1 far from the critical point.
Last updated: August 2026

12.9 Ideal Gas Law, Gas Mixtures, and the Real Gas Law

The NCEES Fluid Mechanics specification ends with two gas sub-topics: "Ideal gas law (e.g., mixtures of nonreactive gases)" and "Real gas law (e.g., z factor)." They sit in Fluid Mechanics rather than Thermodynamics because they supply the density that every fluid calculation needs when the working fluid is a gas.

The Ideal Gas Law in Its Several Forms

PV=nRuT(molar form)PV = nR_uT \qquad\text{(molar form)} PV=mRTandPv=RT(specific form, v=V/m)PV = mRT \qquad\text{and}\qquad Pv = RT \qquad\text{(specific form, } v = V/m) ρ=PRT(the form fluid mechanics actually uses)\rho = \frac{P}{RT} \qquad\text{(the form fluid mechanics actually uses)}

ConstantValue
Universal gas constant $R_u$8.314 J/mol·K = 8{,}314 J/kmol·K = 1{,}545 ft·lbf/(lbmol·°R) = 10.73 psia·ft³/(lbmol·°R)
Specific gas constant$R = R_u/M$
Air ($M = 28.97$)$R = 287$ J/kg·K = 53.35 ft·lbf/(lbm·°R)
Nitrogen ($M = 28.01$)$R = 297$ J/kg·K
Oxygen ($M = 32.00$)$R = 260$ J/kg·K
Carbon dioxide ($M = 44.01$)$R = 189$ J/kg·K
Helium ($M = 4.003$)$R = 2{,}077$ J/kg·K
Water vapor ($M = 18.02$)$R = 462$ J/kg·K

Two non-negotiable rules. Temperature must be absolute — kelvin or degrees Rankine, never Celsius or Fahrenheit. And pressure must be absolute, not gauge: $P_{\text{abs}} = P_{\text{gauge}} + P_{\text{atm}}$. These two substitutions account for more wrong answers on gas problems than any conceptual error, and both produce results that look plausible.

Worked Example: Gas Density for a Fluid Calculation

Air at 350 kPa gauge and 40 °C flows in a duct. Local atmospheric pressure is 101 kPa. Find the density.

Pabs=350+101=451 kPa,T=40+273=313 KP_{\text{abs}} = 350 + 101 = 451\ \text{kPa}, \qquad T = 40 + 273 = 313\ \text{K}

ρ=PRT=451,000287(313)=451,00089,831=5.02 kg/m3\rho = \frac{P}{RT} = \frac{451{,}000}{287(313)} = \frac{451{,}000}{89{,}831} = \boxed{5.02\ \text{kg/m}^3}

Compare with air at standard conditions, 1.20 kg/m³ — 4.2 times denser. Since dynamic pressure is $\tfrac{1}{2}\rho V^2$, every velocity head, pressure drop, and drag force in this duct is 4.2 times larger than the standard-air value. Using 1.20 kg/m³ out of habit understates the pressure drop by a factor of four.

Mixtures of Nonreactive Gases

Dalton's Law of Partial Pressures

Ptotal=Pi,Pi=yiPtotalP_{\text{total}} = \sum P_i, \qquad P_i = y_i P_{\text{total}}

where $y_i$ is the mole fraction. For ideal gases, mole fraction equals volume fraction, so the composition of air by volume is directly its composition by moles.

Apparent (Average) Molar Mass and Mixture Constant

Mmix=yiMi,Rmix=RuMmixM_{\text{mix}} = \sum y_i M_i, \qquad R_{\text{mix}} = \frac{R_u}{M_{\text{mix}}}

Converting between mass and mole fractions:

yi=wi/Mi(wj/Mj),wi=yiMiMmixy_i = \frac{w_i/M_i}{\sum(w_j/M_j)}, \qquad w_i = \frac{y_iM_i}{M_{\text{mix}}}

Worked Example: Mixture Properties

A nonreactive mixture is 70% nitrogen and 30% carbon dioxide by volume at 500 kPa absolute and 300 K. Find the partial pressures, apparent molar mass, mixture gas constant, and density.

Partial pressures (Dalton, with mole fraction = volume fraction):

PN2=0.70(500)=350 kPa,PCO2=0.30(500)=150 kPaP_{\text{N}_2} = 0.70(500) = 350\ \text{kPa}, \qquad P_{\text{CO}_2} = 0.30(500) = 150\ \text{kPa}

Apparent molar mass:

Mmix=0.70(28.01)+0.30(44.01)=19.61+13.20=32.81 kg/kmolM_{\text{mix}} = 0.70(28.01) + 0.30(44.01) = 19.61 + 13.20 = 32.81\ \text{kg/kmol}

Mixture gas constant:

Rmix=8,31432.81=253.4 J/kgKR_{\text{mix}} = \frac{8{,}314}{32.81} = 253.4\ \text{J/kg}\cdot\text{K}

Density:

ρ=PRmixT=500,000253.4(300)=500,00076,020=6.58 kg/m3\rho = \frac{P}{R_{\text{mix}}T} = \frac{500{,}000}{253.4(300)} = \frac{500{,}000}{76{,}020} = \boxed{6.58\ \text{kg/m}^3}

Mass fractions, for completeness:

wN2=0.70(28.01)32.81=0.598,wCO2=0.30(44.01)32.81=0.402w_{\text{N}_2} = \frac{0.70(28.01)}{32.81} = 0.598, \qquad w_{\text{CO}_2} = \frac{0.30(44.01)}{32.81} = 0.402

Note the divergence: 30% CO₂ by volume is 40% by mass, because CO₂ is 57% heavier than N₂. Confusing mass and mole fractions is the standard mixture error, and problems deliberately state one and ask for the other.

The Real Gas Law and the Compressibility Factor

Real gases deviate from ideal behavior when molecules are close enough for their finite volume and intermolecular attraction to matter — that is, at high pressure and low temperature. The correction is a single multiplicative factor:

Pv=zRTρ=PzRT\boxed{Pv = zRT} \qquad\Longrightarrow\qquad \rho = \frac{P}{zRT}

z=vactualvidealz = \frac{v_{\text{actual}}}{v_{\text{ideal}}}

$z$Meaning
$z = 1$Ideal behavior
$z < 1$Attractive forces dominate; the gas occupies less volume than ideal (the common case at moderate pressure)
$z > 1$Repulsion / finite molecular volume dominates; more volume than ideal (very high pressure)

Reduced Properties and the Generalized Chart

The principle of corresponding states says that $z$ is nearly the same function of reduced properties for all gases:

Pr=PPc,Tr=TTcP_r = \frac{P}{P_c}, \qquad T_r = \frac{T}{T_c}

Enter the generalized compressibility chart with $P_r$ and $T_r$, and read $z$.

Gas$T_c$ (K)$P_c$ (MPa)
Air132.53.77
Nitrogen126.23.39
Oxygen154.65.04
Carbon dioxide304.17.38
Methane190.64.60
Water647.122.06
Helium5.190.227

Rules of thumb worth memorizing:

  • $P_r \ll 1$ (say $P_r < 0.1$): ideal behavior is excellent regardless of temperature
  • $T_r > 2$: nearly ideal even at moderate pressure
  • Near the critical point ($T_r \approx 1$, $P_r \approx 1$): $z$ can fall to 0.2–0.3 — errors of 70%+ from assuming ideality
  • $T_r$ between about 1 and 1.5 with $P_r$ near 1 is the danger zone

Worked Example: When Ideality Fails

Carbon dioxide at 8.0 MPa and 320 K. Assess whether the ideal gas law is acceptable, given $z = 0.32$ from the generalized chart at these conditions.

Reduced properties:

Pr=8.07.38=1.08,Tr=320304.1=1.05P_r = \frac{8.0}{7.38} = 1.08, \qquad T_r = \frac{320}{304.1} = 1.05

Both near unity — this is essentially at the critical point, the worst case for ideal-gas assumptions.

Ideal prediction:

ρideal=PRT=8.0×106189(320)=8.0×10660,480=132.3 kg/m3\rho_{\text{ideal}} = \frac{P}{RT} = \frac{8.0\times10^6}{189(320)} = \frac{8.0\times10^6}{60{,}480} = 132.3\ \text{kg/m}^3

Real density:

ρreal=PzRT=132.30.32=413 kg/m3\rho_{\text{real}} = \frac{P}{zRT} = \frac{132.3}{0.32} = \boxed{413\ \text{kg/m}^3}

The ideal gas law understates the density by a factor of 3.1 — a 68% error. Any pressure drop, mass flow, or vessel-inventory calculation based on it would be badly wrong. This is not a contrived case: it is ordinary supercritical CO₂ service in enhanced oil recovery and supercritical extraction.

Contrast with air at 200 kPa and 300 K:

Pr=0.203.77=0.053,Tr=300132.5=2.26P_r = \frac{0.20}{3.77} = 0.053, \qquad T_r = \frac{300}{132.5} = 2.26

Low $P_r$ and high $T_r$ give $z \approx 1.00$, and the ideal gas law is accurate to a fraction of a percent. This is why ordinary air-handling problems never need $z$ — ambient air sits far from its critical point on both axes.

Test Your Knowledge

Air at 620 kPa absolute and 50 degrees C fills a tank. Using R = 287 J/kg-K, what is its density?

A
B
C
D
Test Your Knowledge

A nonreactive mixture contains 60% methane and 40% nitrogen by volume. What is its apparent molar mass?

A
B
C
D
Test Your Knowledge

A compressibility factor of z = 0.65 is read from a generalized chart. Compared with the ideal gas prediction, what is the actual gas density?

A
B
C
D
Test Your Knowledge

Under which conditions is the ideal gas law most likely to fail badly?

A
B
C
D