7.7: Conservation of Mass: The Continuity Equation
- Page ID
- 30092
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)
( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\id}{\mathrm{id}}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\kernel}{\mathrm{null}\,}\)
\( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\)
\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\)
\( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)
\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)
\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)
\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vectorC}[1]{\textbf{#1}} \)
\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)
\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)
\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)Now let’s derive the equation for the conservation of mass in a fluid. We begin by writing down the flow of mass into and out of a small box (figure \(\PageIndex{1}\)).

\[\begin{align*} \text{Mass flow in} &= \rho u \ \delta z \ \delta y \\ \text{Mass flow out} &= (\rho + \delta rho)(u + \delta u) \delta z \ \delta y \end{align*} \]
The mass flux into the volume must be \((\text{mass flow out}) - (\text{mass flow in})\). Therefore, \[\text{Mass flux} = (\rho \ \delta u + u \ \delta \rho + \delta \rho \ \delta u) \delta z \ \delta y \nonumber \]
But \[\delta u = \frac{\partial u}{\partial x} \delta x ; \quad \delta \rho = \frac{\partial \rho}{\partial x} \delta x \nonumber \]
Therefore \[\text{Mass flow} = \left(\rho \frac{\partial u}{\partial x} + u \frac{\partial \rho}{\partial x} + \frac{\partial \rho}{\partial x} \frac{\partial u}{\partial x} \delta x\right) \delta x \ \delta y \ \delta z \nonumber \]
The third term inside the parentheses becomes much smaller than the first two terms as \(\delta x \rightarrow 0\), and \[\text{Mass flux} = \frac{\partial (\rho u)}{\partial x} \delta x \ \delta y \ \delta z \nonumber \]
In three dimensions: \[\text{Mass flux} = \left( \frac{\partial (\rho u)}{\partial x} + \frac{\partial (\rho v)}{\partial y} + \frac{\partial (\rho w)}{\partial z} \right) \delta x \ \delta y \ \delta z \nonumber \]
The mass flux must be balanced by a change of mass inside the volume, which is: \[\frac{\partial \rho}{\partial t} \delta x \ \delta y \ \delta z \nonumber \]
and conservation of mass requires: \[\frac{\partial \rho}{\partial t} + \frac{\partial (\rho u)}{\partial x} + \frac{\partial (\rho v)}{\partial y} + \frac{\partial (\rho w)}{\partial z} = 0 \nonumber \]
This is the continuity equation for compressible flow, first derived by Leonhard Euler (1707–1783).
The equation can be put in an alternate form by expanding the derivatives of products and rearranging terms to obtain: \[\frac{\partial \rho}{\partial t} + u \frac{\partial \rho}{\partial x} + v \frac{\partial \rho}{\partial y} + w \frac{\partial \rho}{\partial z} + \rho \frac{\partial u}{\partial x} + \rho \frac{\partial v}{\partial y} + \rho \frac{\partial w}{\partial z} = 0 \nonumber \]
The first four terms constitute the total derivative of density \(D\rho/Dt\) from \((7.5.3)\), and we can write \((\PageIndex{1})\) as: \[\boxed{\frac{1}{\rho} \frac{D \rho}{D t} + \frac{\partial u}{\partial x} + \frac{\partial v}{\partial y} + \frac{\partial w}{\partial z} = 0} \nonumber \]
This is the alternate form for the continuity equation for a compressible fluid.
The Boussinesq Approximation
Density is nearly constant in the ocean, and Joseph Boussinesq (1842–1929) noted that we can safely assume density is constant except when it is multiplied by \(g\) in calculations of pressure in the ocean. The assumption greatly simplifies the equations of motion.
Boussinesq’s assumption requires that:
- Velocities in the ocean must be small compared to the speed of sound \(c\). This ensures that velocity does not change the density. As velocity approaches the speed of sound, the velocity field can produces large changes of density such as shock waves.
- The phase speed of waves or disturbances must be small compared with \(c\). Sound speed in incompressible flows is infinite, and we must assume the fluid is compressible when discussing sound in the ocean. Thus the approximation is not true for sound. All other waves in the ocean have speeds small compared to sound.
- The vertical scale of the motion must be small compared with \(c^{2}/g\), where \(g\) is gravity. This ensures that as pressure increases with depth in the ocean, the increase in pressure produces only small changes in density.
The approximations are true for oceanic flows, and they ensure that oceanic flows are incompressible. See Kundu (1990: 79 and 112), Gill (1982: 85), Batchelor (1967: 167), or other texts on fluid dynamics for a more complete description of the approximation.
Compressibility
The Boussinesq approximation is equivalent to assuming sea water is incompressible. Now let’s see how the assumption simplifies the continuity equation. We define the coefficient of compressibility \[\beta \equiv -\frac{1}{V} \frac{\partial V}{\partial p} = -\frac{1}{V} \frac{dV/dt}{dp/dt} \nonumber \]
where \(V\) is volume, and \(p\) is pressure. For incompressible flows, \(\beta = 0\), and: \[\frac{1}{V} \frac{dV}{dt} = 0 \nonumber \]
because \(dp/dt \neq 0\). Remembering that density is mass \(m\) per unit volume \(V\), and that mass is constant: \[\frac{1}{V} \frac{dV}{dt} = -V \frac{d}{dt} \left(\frac{1}{V}\right) = -\frac{V}{m} \frac{d}{dt} \left(\frac{m}{V}\right) = -\frac{1}{\rho} \frac{d \rho}{dt} = -\frac{1}{\rho} \frac{D\rho}{Dt} = 0 \nonumber \]
If the flow is incompressible, \((\PageIndex{2})\) becomes: \[\boxed{\frac{\partial u}{\partial x} + \frac{\partial v}{\partial y} + \frac{\partial w}{\partial z} = 0} \nonumber \]
This is the Continuity Equation for Incompressible Flows.