Properties & State of a Substance
Before we can balance energy, we need to know what state our substance is in. Is the water a liquid, a vapour, or a boiling mixture of both? How much does it weigh per cubic metre? Answering these questions is the job of property relations — and getting them right is the difference between a turbine that works and one that floods with liquid droplets.
In this lesson, we'll map out how a pure substance behaves and build Python tools to compute its properties.
Pure Substances and Phases
A pure substance has a fixed chemical composition throughout — water, nitrogen, and refrigerant R-134a are examples. A substance can exist in three phases: solid, liquid, and gas (vapour). The phases are separated by phase-change processes:
Sponsored
70% of India's auto industry trusts Skill-Lync
For training their engineers in CAD, CAE & simulation
- Melting / freezing (solid ↔ liquid)
- Vaporization / condensation (liquid ↔ vapour)
- Sublimation (solid ↔ vapour)
Saturation and Phase Change
At a given pressure, a liquid boils at a fixed temperature called the saturation temperature $T_\text{sat}$. The corresponding pressure is the saturation pressure $p_\text{sat}$. Water boils at 100 °C only because the pressure is 1 atm; lower the pressure and it boils colder.
During boiling, temperature stays constant while the substance absorbs the latent heat of vaporization $h_{fg}$. The states are named:
| State | Meaning |
|---|
| Compressed (subcooled) liquid | Below $T_\text{sat}$ at that pressure |
| Saturated liquid ($f$) | About to start boiling, $x = 0$ |
| Saturated mixture | Liquid + vapour coexisting, $0 < x < 1$ |
| Saturated vapour ($g$) | Just finished boiling, $x = 1$ |
| Superheated vapour | Above $T_\text{sat}$ at that pressure |
Property Diagrams
Engineers visualize phase change on T–v, p–v, and p–T diagrams.
Sponsored
Srinithin now works at Xitadel as Design Engineer
Mechanical engineering graduate turned automotive designer
- On T–v and p–v diagrams, the saturated-liquid and saturated-vapour lines join at the critical point to form the saturation dome. Inside the dome, the substance is a two-phase mixture.
- On a p–T diagram, the phases appear as regions separated by lines; the liquid–vapour line ends at the critical point, and all three lines meet at the triple point.
For water, the critical point is at $T_c = 647.1$ K, $p_c = 22.06$ MPa.
Quality of a Two-Phase Mixture
Inside the dome, pressure and temperature are not independent (they're linked by $p_\text{sat}$–$T_\text{sat}$), so we need another property to fix the state. That property is quality $x$:
$$x = \frac{m_\text{vapour}}{m_\text{total}}$$
Sponsored
175+ hours of industry projects & 12 IIT faculty sessions
Master CATIA, NX, LS-DYNA, HyperMesh and more
Quality ranges from 0 (saturated liquid) to 1 (saturated vapour). Any specific property of the mixture is a mass-weighted average of the saturated-liquid value ($_f$) and saturated-vapour value ($_g$):
$$v = v_f + x\,(v_g - v_f), \qquad h = h_f + x\,h_{fg}, \qquad s = s_f + x\,(s_g - s_f)$$
where $h_{fg} = h_g - h_f$ is the latent heat.
Equations of State vs Property Tables
Two approaches give us properties:
- Property tables (steam tables) — tabulated measured data, interpolated by hand. CoolProp automates this with high accuracy.
- Equations of state (EOS) — algebraic relations between $p$, $v$, and $T$. The simplest is the ideal gas law.
The Ideal Gas Law
$$pv = RT \qquad\text{or}\qquad pV = mRT$$
It works well when the gas is far from condensing — high temperature and low pressure relative to the critical point.
Compressibility Factor
Real gases deviate from ideal behaviour. We measure the deviation with the compressibility factor $Z$:
$$Z = \frac{pv}{RT}$$
For an ideal gas $Z = 1$. Near the critical point or at high pressure, $Z$ can fall well below 1.
Van der Waals Equation
A classic real-gas EOS adds corrections for molecular volume ($b$) and intermolecular attraction ($a$):
$$\left(p + \frac{a}{v^2}\right)(v - b) = RT$$
with constants from the critical point:
$$a = \frac{27 R^2 T_c^2}{64\,p_c}, \qquad b = \frac{R T_c}{8\,p_c}$$
Building the Saturation Dome in Python
Let's plot water's saturation dome on a T–s diagram using CoolProp.
import numpy as np
import matplotlib.pyplot as plt
from CoolProp.CoolProp import PropsSI
Tc = PropsSI('Tcrit', 'Water') # critical temperature, K
# Sweep temperature from 280 K up to just below critical
T = np.linspace(280, Tc - 0.5, 200)
s_liq = np.array([PropsSI('S', 'T', t, 'Q', 0, 'Water') for t in T]) # sat. liquid
s_vap = np.array([PropsSI('S', 'T', t, 'Q', 1, 'Water') for t in T]) # sat. vapour
plt.figure(figsize=(9, 6))
plt.plot(s_liq/1e3, T, 'b-', lw=2, label='Saturated liquid (x=0)')
plt.plot(s_vap/1e3, T, 'r-', lw=2, label='Saturated vapour (x=1)')
plt.scatter([PropsSI('S', 'T', Tc-0.5, 'Q', 0, 'Water')/1e3], [Tc],
color='k', zorder=5, label='Critical point')
plt.xlabel('Specific entropy s (kJ/kg.K)')
plt.ylabel('Temperature T (K)')
plt.title('Saturation Dome for Water (T-s diagram)')
plt.legend(); plt.grid(True, alpha=0.3)
plt.show()
The blue and red lines meet at the top — the critical point — enclosing the two-phase dome.
Quality and Enthalpy of a Wet Mixture
Suppose we have a wet steam mixture at 1 bar with quality $x = 0.85$. Let's find its enthalpy and specific volume both from the mixing rule and directly from CoolProp.
from CoolProp.CoolProp import PropsSI
P = 1e5 # Pa (1 bar)
x = 0.85 # quality
# Saturated-liquid and saturated-vapour properties at this pressure
hf = PropsSI('H', 'P', P, 'Q', 0, 'Water')
hg = PropsSI('H', 'P', P, 'Q', 1, 'Water')
vf = 1.0 / PropsSI('D', 'P', P, 'Q', 0, 'Water') # v = 1/density
vg = 1.0 / PropsSI('D', 'P', P, 'Q', 1, 'Water')
# Mixing rule
h_mix = hf + x * (hg - hf)
v_mix = vf + x * (vg - vf)
# Direct CoolProp lookup using quality
h_direct = PropsSI('H', 'P', P, 'Q', x, 'Water')
print(f"hf = {hf/1e3:.1f} kJ/kg, hg = {hg/1e3:.1f} kJ/kg, hfg = {(hg-hf)/1e3:.1f} kJ/kg")
print(f"Mixture enthalpy (rule): {h_mix/1e3:.1f} kJ/kg")
print(f"Mixture enthalpy (CoolProp):{h_direct/1e3:.1f} kJ/kg")
print(f"Mixture specific volume: {v_mix:.4f} m^3/kg")
Output:
hf = 417.4 kJ/kg, hg = 2674.9 kJ/kg, hfg = 2257.5 kJ/kg
Mixture enthalpy (rule): 2336.3 kJ/kg
Mixture enthalpy (CoolProp):2336.3 kJ/kg
Mixture specific volume: 1.4393 m^3/kg
The mixing rule and CoolProp agree perfectly — a good check that you understand quality.
Ideal Gas vs Van der Waals
Let's compare the pressure of CO₂ predicted by both equations at a moderately high density, where real-gas effects matter.
import numpy as np
Ru = 8.314 # J/(mol K)
M = 0.04401 # kg/mol, CO2
R = Ru / M # specific gas constant
Tc, pc = 304.13, 7.377e6 # critical point of CO2 (K, Pa)
a = 27 * R**2 * Tc**2 / (64 * pc)
b = R * Tc / (8 * pc)
T = 320.0 # K
v = 0.003 # m^3/kg (fairly dense)
p_ideal = R * T / v
p_vdw = R * T / (v - b) - a / v**2
Z = p_vdw * v / (R * T)
print(f"van der Waals constants: a = {a:.2f}, b = {b:.5f}")
print(f"Ideal gas pressure: {p_ideal/1e6:.3f} MPa")
print(f"van der Waals pressure: {p_vdw/1e6:.3f} MPa")
print(f"Compressibility factor Z:{Z:.3f}")
Output:
van der Waals constants: a = 188.92, b = 0.00097
Ideal gas pressure: 4.838 MPa
van der Waals pressure: 4.469 MPa
Compressibility factor Z:0.924
The ideal gas law overpredicts the pressure by about 8% here; $Z = 0.92$ confirms the gas is noticeably non-ideal at this density.
Common Pitfalls
- Using $p$ and $T$ to fix a state inside the dome: they are not independent during phase change. Use $T$ (or $p$) together with quality $x$ instead.
- Forgetting $v = 1/\rho$: CoolProp returns density
D; invert it to get specific volume.
- Applying the ideal gas law near saturation: it fails badly when the gas is close to condensing — check $Z$.
- Mixing units in van der Waals: keep everything in SI (Pa, m³/kg, K) so the constants $a$ and $b$ stay consistent.
Key Takeaways
- A pure substance changes phase at the saturation temperature/pressure, absorbing latent heat $h_{fg}$.
- The saturation dome on T–s, T–v, and p–v diagrams separates liquid, mixture, and vapour regions.
- Quality $x$ fixes the state of a two-phase mixture; properties follow $y = y_f + x(y_g - y_f)$.
- The ideal gas law $pv = RT$ holds far from saturation; the compressibility factor $Z$ measures deviation.
- Real-gas EOS like van der Waals correct for molecular size and attraction.
Next, we'll put these states to work and track energy with the first law of thermodynamics.