heating and cooling balance in the interstellar medium depends on density, ionization, radiation and shielding. Write net cooling per volume as . Ultraviolet grain photoelectric heating is important in diffuse neutral gas; photoionization heats ionized regions, cosmic rays penetrate shielded gas, and shock waves from stellar winds and supernovae supply hot gas. Cooling includes collisionally excited atomic lines, fine-structure metal lines at lower temperatures, molecular lines in shielded clouds, and continuum radiation and dust emission where appropriate. The heating efficiency and cooling abundances matter as much as a nominal temperature.
A multiphase interstellar medium can contain a cold neutral medium near , a warm neutral medium and warm ionized medium near , a hot ionized medium near , and still colder molecular clouds. Cold and warm atomic equilibrium branches can coexist at similar thermal pressure over a finite pressure interval; this is a calculated heating/cooling balance, not a requirement that all galactic gas have the same pressure.[ref]
The Neutral Atomic Phases of the ISM in the Galaxy by Mark G. Wolfire and others. Abstract: cold and warm neutral equilibrium temperatures and coexistence between minimum and maximum pressures
For net cooling per unit mass , an isobaric perturbation at equilibrium obeys . Thus a negative constant-pressure cooling derivative is thermally unstable: a cool perturbation cools further and condenses. Sound crossing must be fast enough to maintain pressure balance; thermal conduction suppresses sufficiently short wavelengths. Supernova-driven motions, magnetic pressure, finite cooling times and interfaces make the actual medium dynamic, so equilibrium branches describe useful phases rather than a static collection of perfectly separated components.
For a monatomic ideal gas, write the thermal energy density as . At low optical depth, radiative loss uses an astrophysical cooling function, often written , while contains heating. At fixed density the net radiative gas cooling time is approximately when the denominator is positive; a cooling flow closer to constant pressure must include enthalpy and compressional work. Comparing this time with the free-fall time of a uniform sphere determines whether pressure can be lost during gravitational contraction.
Hot ionized gas cools by bremsstrahlung and recombination; collisional excitation followed by photon escape supplies atomic and metal-line cooling at lower temperatures. molecular line cooling through rotational or vibrational lines and dust thermal emission become important in cold dense gas. Abundances, ionization state, density-dependent collisional de-excitation, and photon trapping all change the cooling function. Optically thick gas requires radiative transfer, not a simple local density-squared loss law.
Heating comes from photoionization, grain photoelectric heating driven by ultraviolet light, cosmic rays, shocks, turbulent dissipation and compression. photoionization heating deposits the photon energy above the ionization threshold as electron kinetic energy. A thermal equilibrium satisfies ; its stability depends on how the net loss changes under the relevant pressure or density constraint, not merely on equality. Different stable balances permit a multiphase interstellar medium. Spectral-line ratios constrain temperature and ionization, but interpreting them requires density diagnostics, interstellar extinction corrections and a radiation-field model.