An unsaturated air parcel forced upward (by a thermal, a hillside, or a front) expands and cools at the dry adiabatic lapse rate, a near-constant rate set by the ideal-gas/first-law relation for rising dry air:
Γd ≈ 9.8 °C / km (parcel temperature)
Γdp ≈ 1.8 °C / km (parcel dew point — falls slower, since the
dew point depends on the mixing ratio, which
is nearly conserved as the parcel rises)
T(z) = T0 − Γd·z
Td(z) = Td0 − Γdp·z
This 2D version finds the altitude where T(z) = Td(z) by numerical bisection on the function f(z) = T(z) − Td(z), evaluating both lapse-rate lines directly rather than jumping to the closed-form shortcut — the crossing point is the Lifting Condensation Level (LCL), the flat base of a cumulus cloud. The bisection result is cross-checked in the console against the well-known approximation zLCL ≈ 125·(T−Td) metres, which the two should agree with to well under a metre since both lines are exactly linear:
z_LCL = (T0 − Td0) / (Γd − Γdp) ≈ 125 m per °C of surface spread
e.g. T0 = 24°C, Td0 = 14°C → spread = 10°C → LCL ≈ 1250 m
Surface relative humidity is computed from temperature and dew point with the Magnus-Tetens approximation for saturation vapor pressure:
es(T) = 6.112 · exp(17.62·T / (243.12+T)) [hPa]
e(Td) = 6.112 · exp(17.62·Td / (243.12+Td)) [hPa]
RH = 100 · e(Td) / es(T)
- T / Td sliders — set the surface temperature and dew point; a wider spread pushes the cloud base higher (drier air needs more cooling to saturate). Td is clamped below T since dew point can never exceed air temperature.
- Updraft speed — how fast the parcel climbs through the diagram, purely a viewing-speed control (it does not change the LCL height).
- Release New Parcel — restarts a fresh parcel from the ground; the LCL itself still updates live from the sliders even mid-flight.
- Real-world relevance: this is exactly why cumulus clouds have a flat, sharp base — every parcel rising through the same surface air saturates at the same altitude.