Parcel thermodynamics: adiabatic cooling, lifting condensation level, latent heating, droplet-to-rain conversion and a closed water budget.
running...
The science
Air near the surface is lifted by an updraft. Rising air expands and cools with no heat exchange: T/T0 = (p/p0)Rd/cp, about 9.8 K/km while unsaturated. Saturation vapour pressure follows Bolton’s fit of Clausius-Clapeyron, es = 6.112 exp(17.67T/(T+243.5)) hPa, and saturation mixing ratio is qs = 0.622 es/(p−es).
At the lifting condensation level (≈ 125 (T − Td) m) the parcel is saturated. Above it, excess vapour condenses: dq = (qv−qs) / (1 + L2qs/(cpRvT2)) and the latent heat L dq/cp warms the parcel, so the moist lapse rate is only 3-6 K/km. Cloud droplets convert into rain by Kessler autoconversion, dqr/dt = k (ql − q0) with k = 6×10-4 s-1 and q0 = 1 g/kg; rain parcels fall at up to 6 m/s.
Simplifications: a prescribed updraft instead of computed buoyancy, no entrainment, no ice phase, rain does not evaporate below cloud, one air-mass per parcel (4×108 kg) and a hydrostatic pressure profile for a 6.5 K/km environment starting at the surface temperature. The checks recompute the LCL against Bolton's closed-form formula, the equivalent-potential-temperature invariant during moist ascent, and the total water budget.