Solution (source code)

= Solution

<gas> heats when compression, <shocks> or absorbed radiation increase its <internal energy>. Important sources include <accretion> <shocks>, <stellar winds>, <supernovae>, <photoionization>, photoelectric emission from <interstellar dust>, <cosmic rays> and <energy> deposited by <active galactic nuclei>. <photoionization> heating uses the photoelectron <energy> above the <ionization> threshold; compression contributes mechanical work rather than <photon> <absorption>.

For specific <internal energy> $u$, an idealized thermal balance is
$$
\rho\frac{Du}{Dt}=-P\nabla\cdot\mathbf v+\mathcal H-\mathcal C,
\qquad
\mathcal C=n_en_H\Lambda(T,Z).
$$
Here $\mathcal H,\mathcal C$ are powers per volume and $Z$ describes abundances. The <electron-hydrogen normalization of the cooling function> must be specified: some conventions instead factor out $n_H^2$. For a monatomic <gas> with total particle <density> $n$,
$$
\boxed{t_{\rm cool}=\frac{3nk_BT}{2n_en_H\Lambda}}
$$
when heating is negligible. Compare this with the dynamical time: rapid cooling permits loss of <pressure> support, whereas long cooling times allow a hot atmosphere to persist.

<collisional excitation> followed by <spontaneous emission> cools partially ionized <gas>; <radiative recombination> also produces continuum cooling. <metal> lines enhance cooling over substantial intermediate-temperature ranges, while <thermal bremsstrahlung> gives a roughly $\Lambda\propto T^{1/2}$ high-temperature tail. Atomic <hydrogen> cooling becomes inefficient below roughly $10^4\,\mathrm K$, where <molecular line cooling> and <interstellar dust> can be important. <inverse Compton scattering> cools hot <electrons> against a colder radiation field. A tabulated cooling curve assumes a composition and <ionization> model; <photoionization> or nonequilibrium <ionization> can change it.<Thermal radiation processes by Jelle S. Kaastra and others>[2008, §§5 and 8: emission mechanisms, cooling normalization, cooling time and limits of collisional-ionization-equilibrium curves]{ref}

<X-ray> line ratios and continuum shape constrain <temperature> and <ionization>, while the <emission measure> constrains $\int n_en_H\,dV$. Turning that into a <density> and <radiative gas cooling time> also requires a geometry; unresolved clumping, foreground <absorption> and multiphase <gas> are important controls.