The continuity equation is the mass-balance equation. Let $\Omega\subseteq\mathbb{R}^3$ be an open subset, $\rho$ a density, and $\mathbf{j}$ the corresponding flux density. Then, by Gauss's theorem and with a source density $Q$,
\[ \begin{align} \frac{\partial}{\partial t}\int_\Omega\rho d^3r &= -\int_{\partial \Omega}\mathbf{j}\cdot d\mathbf{n} + \int_\Omega Qd^3r = -\int_\Omega\nabla\cdot\mathbf{j} - Q d^3r\nonumber\\ \Rightarrow \int_\Omega\frac{\partial\rho}{\partial t} + \nabla\cdot\mathbf{j} - Qd^3r &= 0.\tag{7.1}\label{eq:deriv_cont_1} \end{align} \]
Since the integrand is continuous, it must in fact be uniformly zero. For if $\left|\frac{\partial\rho}{\partial t} + \nabla\cdot\mathbf{j} - Q\right|>\epsilon>0$ held at some point $\mathbf{r}_0\in\Omega$, there would exist an open neighborhood $\omega\subseteq\Omega$ with $\mathbf{r}_0\in\omega$ and $\int_\omega\frac{\partial\rho}{\partial t} + \nabla\cdot\mathbf{j} - Qd^3r \not= 0$, contradicting Eq. (7.1). Hence,
\[ \begin{align} \frac{\partial\rho}{\partial t} + \nabla\cdot\mathbf{j} = Q.\tag{7.2}\label{eq:cont_general} \end{align} \]
In terms of the specific volume $\alpha$, this may be written as
\[ \begin{align} -\frac{1}{\alpha^2}\frac{\partial\alpha}{\partial t} - \frac{1}{\alpha^2}\mathbf{v}\cdot\nabla\alpha + \frac{1}{\alpha}\nabla\cdot\mathbf{v} = 0 & {} & \Leftrightarrow \frac{\partial\alpha}{\partial t} = \alpha\nabla\cdot\mathbf{v} - \mathbf{v}\cdot\nabla\alpha.\tag{7.3}\label{eq:cont_spec_volume} \end{align} \]
This relation is now written separately for all components of air:
\[ \begin{align} \frac{\partial\rho_d}{\partial t} + \nabla\cdot\mathbf{j}_d &= Q_d\tag{7.4}\label{eq:kont_d_pre}\\ \frac{\partial\rho_v}{\partial t} + \nabla\cdot\mathbf{j}_v &= Q_v\tag{7.5}\label{eq:kont_v_pre}\\ \frac{\partial\rho_i}{\partial t} + \nabla\cdot\mathbf{j}_i &= Q_i\tag{7.6}\label{eq:kont_i_pre} \end{align} \]
Here,
\[ \begin{align} \mathbf{j}_d = \rho_d\mathbf{v} - D_d\nabla\rho_d, & {} & \mathbf{j}_v = \rho_v\mathbf{v} - D_v\nabla\rho_v. \end{align} \]
Here $D_d$ and $D_v$ denote the diffusion coefficients for dry air and water vapor, respectively. One may initially set
\[ \begin{align} Q_d = 0. \end{align} \]
The $Q_x$ terms in Eqs. (7.4) - (7.6) are now specified in greater detail. Five processes contribute:
Diffusion
Phase transitions
Collisions
Decays
for gases, ions, and electrons, additionally chemical reactions and radiation interactions
The last point is excluded in the remainder of this section; here, the focus is exclusively on condensates. Diffusion occurs only in the gaseous components, so $Q_d$ contains a term $D_d\Delta\rho_d$ and $Q_v$ contains a term $D_v\Delta\rho_v$, where $D_d$ and $D_v$ are the diffusion coefficients of dry air and water vapor in air, respectively. Dry air is unaffected by the remaining processes, so
\[ \begin{align} Q_d = D_d\Delta\rho_d \end{align} \]
holds.
If two particles of condensate classes $j$ and $k$ meet, one can assign a probability $0\leq P_{j, k}\leq 1$ that they subsequently form a single particle. This product has a well-defined class $R_{j, k}$. Let $\sigma_{j, k}$ denote the collision cross section for particles of classes $j$ and $k$. For example, if $j$ are spheres of radius $r_j$ and $k$ are spheres of radius $r_k$, then $\sigma_{j, k} = \pi\left(r_j + r_k\right)^2$. Let the mean relative velocity between particles of classes $j$ and $k$ be $\newoverline{v_{\text{rel}}}\left(j, k\right)$. Then, in time $t$, a particle of class $j$ sweeps out a volume $\sigma_{j, k}\newoverline{v_{\text{rel}}}\left(j, k\right)t$ relative to particles of class $k$. The mean collision time $\tau_{j, k}$ is defined by requiring that this volume contains exactly one particle of class $k$, i.e.
\[ \begin{align} n_k\sigma_{j, k}\newoverline{v_{\text{rel}}}\left(j, k\right)\tau_{j, k} &\hastobe 1. \end{align} \]
All particles of group $j$ participate in collision processes; therefore, the total collision rate of particles $j$ with particles $k$ is given by
\[ \begin{align} \frac{n_j}{\tau_{j, k}} &= n_jn_k\sigma_{j, k}\newoverline{v_{\text{rel}}}\left(j, k\right). \end{align} \]
If $\newtilde{m}_i$ is the mass of particles in group $i = R_{j, k}$, this yields a corresponding source strength
\[ \begin{align} \newtilde{m}_i\sigma_{j, k}n_jn_k\newoverline{v_{\text{rel}}}\left(j, k\right)P_{j, k}. \end{align} \]
In addition, a negative contribution to the source term must be included, since particles are removed from their original condensate class when they merge with other particles. This leads to
\[ \begin{align} Q_i^{(\text{collisions})} = \newtilde{m}_i\sum_{j}\sum_{k\leq j}^{}\sigma_{j, k}n_jn_k\newoverline{v_{\text{rel}}}\left(j, k\right)P_{j, k}\left(\delta_{i, R_{j, k}} - \delta_{j, i} - \delta_{k, i}\right). \end{align} \]
By mass conservation, this requires the particle masses $\newtilde{m}_i$ to be integer multiples of a minimum mass, so that no mass is artificially lost or created in collisions.
We now consider decay processes. The following holds for the change in particle density $n_j$ due to decay:
\[ \begin{align} dn_j = -n_j\lambda_jdt\Leftrightarrow\frac{dn_j}{dt} = -\lambda_j n_j, \end{align} \]
Here $\lambda_j$ is the decay constant. Let the decay product be, with probability $Z_{j, k, l}$, one particle of class $k$ and one particle of class $l$; the normalization is
\[ \begin{align} 1 = \sum_{k}\sum_{l\leq k}^{}Z_{j, k, l}, \end{align} \]
where $Z_{j, j, l} = Z_{j, k, j} = 0$, i.e. the product of a decay must not be identical to the reactant. For each condensate class $i$, positive and negative terms must again be included, so that
\[ \begin{align} Q_i^{\left(\text{decays}\right)} = \newtilde{m}_i\sum_{j}\sum_{k}\sum_{l\leq k}^{}\lambda_j n_j Z_{j, k, l}\left(\delta_{i, k} + \delta_{i, l} - \delta_{j, i}\right). \end{align} \]
Finally, phase transitions are discussed. These can occur in two ways.
First, condensation and resublimation can directly produce new particles of class $i$, while evaporation and sublimation can destroy them. The corresponding mass flux densities are denoted by $\newtilde{q}_{v, i}'$ in the first case and $\newtilde{q}_{i, v}'$ in the second. This process yields the terms
\[ \begin{align} Q_v^{\left(\pm\text{formation}\right)} &= \sum_{j}^{}\newtilde{q}_{j, v}' - \newtilde{q}_{v, j}',\\ Q_i^{\left(\pm\text{formation}\right)} &= \newtilde{q}_{v, i}' - \newtilde{q}_{i, v}'. \end{align} \]
Large condensate particles such as hailstones do not form instantaneously; instead, they grow, among other mechanisms, by condensation or resublimation of water vapor onto smaller particles. In the reverse process, they can also diminish again. During a time interval $\Delta t$, let a mass $m_i$ condense or resublimate onto particles of class $i$ within a volume $\Delta V$. This makes those particles larger and heavier; however, Chap. 6 specified that all particles of class $i$ should have the same mass $\newtilde{m}_i$. If this is the only process taking place, mass conservation implies
\[ \begin{align} \rho_{g\left(i\right)}\left(t\right)\Delta V + m_i = \rho_{g\left(i\right)}\left(t + \Delta t\right)\Delta V. \end{align} \]
Here $g\left(i\right)$ denotes the condensate class that arises from $i$ through growth. It follows that
\[ \begin{align} \frac{\partial\rho_{g\left(i\right)}}{\partial t} = \frac{1}{\Delta V}\frac{dm_i}{dt}\eqqcolon \newtilde{q}_{v, i}''. \end{align} \]
At first sight this is confusing, because condensation onto particles $i$ changes the density $\rho_{g\left(i\right)}$; this results from the fact that this type of phase transition does not create new particles of class $i$. In the case of evaporation or sublimation, one obtains
\[ \begin{align} \frac{\partial\rho_{d\left(i\right)}}{\partial t}\eqqcolon\newtilde{q}_{i, v}'', \end{align} \]
where $d\left(i\right)$ is the condensate class formed from $i$ by shrinkage.
Third, condensates can be transformed into one another by freezing or melting; let the corresponding source strengths be denoted by $\newtilde{q}_{j, k}'''$. One obtains
\[ \begin{align} Q_i^{\left(\text{transformation}\right)} = \sum_{j}\newtilde{q}_{j, i}''' - \newtilde{q}_{i, j}'''. \end{align} \]
The source strengths can be summarized as follows:
\[ \begin{align} Q_d &= D_d\Delta\rho_d\tag{7.23}\label{eq:quelle_trocken_masse}\\ Q_v &= \sum_{i}^{}\left(\newtilde{q}_{i, v}' - \newtilde{q}_{v, i}' + \newtilde{q}_{i, v}'' - \newtilde{q}_{v, i}''\right) + D_v\Delta\rho_v\tag{7.24}\label{eq:quelle_wasserdampf_masse}\\ Q_i &= \newtilde{m}_i\sum_{j}\sum_{k\leq j}^{}\sigma_{j, k}n_jn_k\newoverline{v_{\text{rel}}}\left(j, k\right)P_{j, k}\left(\delta_{i, R_{j, k}} - \delta_{j, i} - \delta_{k, i}\right) + \newtilde{q}_{v, i}' - \newtilde{q}_{i, v}'\nonumber\\ & + \newtilde{m}_i\sum_{j}\sum_{k}\sum_{l\leq k}^{}\lambda_j n_j Z_{j, k, l}\left(\delta_{i, k} + \delta_{i, l} - \delta_{j, i}\right) + \left(\newtilde{q}_{g\left(i\right), v}'' + \newtilde{q}_{v, d\left(i\right)}''\right) + \sum_{j}\newtilde{q}_{j, i}''' - \newtilde{q}_{i, j}'''\tag{7.25}\label{eq:quelle_kondensat_masse} \end{align} \]
Further concretization of the cloud-microphysical source terms is provided in Chap. 23, even though the exact computation of $P_{j, k}$, $\lambda_j$, and $Z_{j, k, l}$ would only be possible with elaborate numerical methods and is not covered in this book.
The mass flux densities $\mathbf{j}_i$ still need to be specified. Let $v_i$ denote the equilibrium settling velocity of particles of class $i$; then one may write
\[ \begin{align} \mathbf{j}_i = \rho_i\mathbf{v} - \mathbf{k}\rho_iv_i \end{align} \]
For the precipitation $P_i$ of condensate class $i$, one has
\[ \begin{align} P_i = -j_i\left(z_{\text{SFC}}\right), \end{align} \]
where SFC refers to the Earth's surface. These equations are also applicable to aerosols.
Specific humidity $q = \rho_i/\rho$ is also frequently used (definition, see Eq. (5.167)), since for a component $i$ advected by the wind field it is a conserved quantity:
\[ \begin{align} \md{q} = -\frac{q}{\rho}\md{\rho} + \frac{1}{\rho}\md{\rho_i} = q\nabla\cdot\mathbf{v} - q\nabla\cdot\mathbf{v} = 0\tag{7.28}\label{eq:q_conservative} \end{align} \]
The source terms of $q$ are those of $\rho_i$ divided by the density of the medium, $\rho$.