The Continuity Equation
Statement
For a continuum of mass density \(\rho(\mathbf{x},t)\) moving with velocity field \(\mathbf{u}(\mathbf{x},t)\), the requirement that the mass of every material volume be constant in time is equivalent, at every interior point where the fields are differentiable, to the local conservation law \(\dfrac{\partial \rho}{\partial t} + \nabla\cdot(\rho\,\mathbf{u}) = 0\). This is obtained by applying the Reynolds transport theorem to the total mass and demanding that its material derivative vanish for an arbitrary volume.
Why it matters
The continuity equation is the first and most rigid of the conservation laws of fluid mechanics: it is a pure kinematic statement of mass bookkeeping, containing no dynamics, no forces and no constitutive assumptions. Every governing equation of a moving continuum — the Euler equations, the Navier–Stokes equations, the equations of gas dynamics and of magnetohydrodynamics — carries it as a constraint that the velocity and density fields must satisfy simultaneously.
Its structure is the template for all local conservation laws: a time derivative of a density plus the divergence of the corresponding flux equals the source. Here the source is zero because mass is neither created nor destroyed. Recognising this "\(\partial_t(\text{density}) + \nabla\cdot(\text{flux}) = \text{source}\)" form lets you read charge conservation, energy conservation and probability conservation in quantum mechanics as the same equation with different densities.
Assumptions
Derivation
Result
Reading. At a fixed point in space, the density rises exactly as fast as mass is carried inward by the flow. The vector \(\mathbf{j}=\rho\mathbf{u}\) is the mass flux (mass per unit area per unit time); its divergence measures the net outflow per unit volume, and any net outflow must be paid for by a local drop \(\partial\rho/\partial t<0\). Expanding the divergence gives the material-derivative form \(\dfrac{\mathrm{D}\rho}{\mathrm{D}t} = -\rho\,\nabla\cdot\mathbf{u}\): following a parcel, its density changes only through the local volumetric expansion rate \(\nabla\cdot\mathbf{u}\).
Units check. With \([\rho]=\mathrm{kg\,m^{-3}}\), the first term \(\partial\rho/\partial t\) has units \(\mathrm{kg\,m^{-3}\,s^{-1}}\). For the second, \([\rho\mathbf{u}]=\mathrm{kg\,m^{-3}}\cdot\mathrm{m\,s^{-1}}=\mathrm{kg\,m^{-2}\,s^{-1}}\) (a flux), and \(\nabla\cdot(\cdot)\) divides by a length, giving \(\mathrm{kg\,m^{-2}\,s^{-1}}\cdot\mathrm{m^{-1}}=\mathrm{kg\,m^{-3}\,s^{-1}}\). Both terms match, and the sum vanishes dimensionally consistently.
Limiting cases
- Incompressible flow (\(\mathrm{D}\rho/\mathrm{D}t=0\), e.g. a constant-density liquid): the law collapses to the solenoidal condition \(\nabla\cdot\mathbf{u}=0\) — the velocity field is divergence-free.
- Steady flow (\(\partial\rho/\partial t=0\)): reduces to \(\nabla\cdot(\rho\mathbf{u})=0\), so the mass flux is a divergence-free field and mass-flux streamtubes conserve \(\rho\,u\,A\).
- One-dimensional steady duct flow: \(\nabla\cdot(\rho\mathbf{u})=0\) integrates over a streamtube to \(\rho u A = \text{const}\), the elementary "\(\dot m = \text{const}\)" mass-flow relation.
- Uniform density in space, spatially varying \(\mathbf u\): \(\partial_t\rho = -\rho\,\nabla\cdot\mathbf u\), so a uniform gas compresses at a rate fixed entirely by the divergence of its velocity.
Breaks when
- Across a shock or contact discontinuity. The fields are not differentiable, step 5 (Gauss) and step 7 (fundamental lemma) both fail; the pointwise PDE is replaced by the integral jump condition \([\rho(\mathbf{u}-\mathbf{u}_s)\cdot\hat{\mathbf{n}}]=0\), i.e. mass flux relative to the moving front is continuous across it.
- In rarefied / free-molecular flow. When the Knudsen number is not small the continuum hypothesis fails, \(\rho\) and \(\mathbf{u}\) are not smooth fields, and one must use the Boltzmann equation; the continuity equation appears only as the zeroth velocity moment of that equation.
- With mass sources or sinks. Ablation, condensation modelled as a sink, injection, or relativistic mass–energy exchange add \(\sigma\neq0\) on the right; \(\mathrm{D}M/\mathrm{D}t\neq0\) in step 2 and the homogeneous law no longer holds.
- In multi-stream / caustic regions of collisionless flow. When particle trajectories cross, no single-valued \(\mathbf{u}(\mathbf{x},t)\) exists, the diffeomorphism assumption breaks, and the Eulerian form is undefined (though the Lagrangian mass measure is still conserved).
Failure modes
- Dropping the \(\rho\) inside the divergence. Writing \(\partial_t\rho + \mathbf{u}\cdot\nabla\rho = 0\) and calling it "the continuity equation" — that is the advection equation, valid only when \(\nabla\cdot\mathbf{u}=0\). The correct term is \(\nabla\cdot(\rho\mathbf{u})=\mathbf{u}\cdot\nabla\rho + \rho\,\nabla\cdot\mathbf{u}\).
- Confusing \(\partial/\partial t\) with \(\mathrm{D}/\mathrm{D}t\). Using the material derivative in the Eulerian (fixed-point) form gives the wrong equation; the two are related by \(\mathrm{D}/\mathrm{D}t=\partial_t+\mathbf{u}\cdot\nabla\).
- Assuming \(\nabla\cdot\mathbf{u}=0\) means incompressible. It means the flow is locally volume-preserving; a compressible gas can be momentarily solenoidal without being an incompressible fluid. Incompressibility is \(\mathrm{D}\rho/\mathrm{D}t=0\).
- Applying the pointwise PDE across a shock. Students integrate the differential form through a discontinuity; only the integral (control-volume) form survives there.
- Sign error on the flux. Forgetting that outward flux (\(\mathbf{u}\cdot\hat{\mathbf{n}}>0\)) must decrease density, i.e. missing the minus sign in \(\mathrm{D}\rho/\mathrm{D}t=-\rho\nabla\cdot\mathbf{u}\).
Discussion
The continuity equation is the archetype of a conservation law in local form. Its content is entirely captured by the pairing of a conserved density \(\rho\) with its flux \(\mathbf{j}=\rho\mathbf{u}\): the statement \(\partial_t\rho + \nabla\cdot\mathbf{j}=0\) says that the only way the amount of stuff in a region can change is by transport across the boundary. Integrating over any fixed region and using Gauss's theorem returns the global balance \(\mathrm{d}/\mathrm{d}t\int_V\rho\,\mathrm{d}V = -\oint_S\mathbf{j}\cdot\hat{\mathbf{n}}\,\mathrm{d}A\), which is simply the integral statement we started from, read the other way. This equivalence between a global conservation statement and a local differential law is the single most reused idea in continuum and field physics.
The derivation cleanly separates physics from kinematics. Only step 2 — \(\mathrm{D}M/\mathrm{D}t=0\) — is a physical postulate; steps 3–8 are pure calculus (Reynolds transport, Gauss, the fundamental lemma). This is why the same manipulation, with \(\rho\) replaced by charge density, momentum density, energy density, or the quantum probability density \(|\psi|^2\), generates charge continuity, the Cauchy momentum balance, energy conservation, and the Schrödinger probability current. Continuity is the noun; the conserved quantity is the adjective.
There is a deeper reason the equation exists at all. By Noether's theorem, every continuous symmetry of an action yields a conserved current \(\partial_\mu j^\mu=0\); mass (or, at the relativistic level, baryon/particle number) continuity is the current associated with the internal phase symmetry of the matter field, and \(\partial_t\rho+\nabla\cdot(\rho\mathbf u)=0\) is precisely the non-relativistic \(c\to\infty\) limit of the covariant statement \(\partial_\mu(\rho_0 U^\mu)=0\) with four-velocity \(U^\mu\). Written as a differential form, \(\mathrm{d}\!\star\! j=0\), the same law is metric-independent, which is why it survives unchanged into curved spacetime as \(\nabla_\mu(\rho U^\mu)=0\). The homely bookkeeping of fluid mass and the conservation laws of field theory are one structure seen at two altitudes.
Common misconceptions. The continuity equation is not a dynamical law — it contains no forces and cannot by itself predict how a fluid moves; it is a constraint that any admissible \((\rho,\mathbf{u})\) must respect alongside the momentum equation. And "incompressible" is a property of the flow, not merely of the fluid: it is the condition \(\mathrm{D}\rho/\mathrm{D}t=0\), equivalent to \(\nabla\cdot\mathbf{u}=0\), and a compressible fluid can flow incompressibly at low Mach number.
Worked examples
Reading. Because both the area and the density fall, the flow must accelerate to keep the mass flux \(\dot m=\rho u A = 2.40\ \mathrm{kg\,s^{-1}}\) constant; the area reduction dominates the density drop.
Units check. \(\mathrm{kg\,m^{-3}\cdot m\,s^{-1}\cdot m^2}=\mathrm{kg\,s^{-1}}\) top and bottom for \(\dot m\); dividing leaves \(\mathrm{m\,s^{-1}}\) for \(u_2\).
Reading. A convergent velocity field (\(\nabla\cdot\mathbf u<0\)) packs mass inward, so the uniform density grows exponentially with e-folding time \(1/|k|=0.50\ \mathrm{s}\); at \(t=0.50\ \mathrm{s}\), \(\rho\approx2.7\ \mathrm{kg\,m^{-3}}\).
Units check. \([k]=\mathrm{s^{-1}}\) makes \(kt\) dimensionless, so the exponential is pure number and \(\rho\) keeps units \(\mathrm{kg\,m^{-3}}\).
Problems
- A steady incompressible flow has velocity field \(\mathbf{u}=(a x)\hat{\mathbf{x}} + (b y)\hat{\mathbf{y}} + (c z)\hat{\mathbf{z}}\) with \(a=3.0\ \mathrm{s^{-1}}\) and \(b=-1.0\ \mathrm{s^{-1}}\). What must \(c\) be?
Solution
Incompressible \(\Rightarrow\nabla\cdot\mathbf u=a+b+c=0\). So \(c=-(a+b)=-(3.0-1.0)=-2.0\ \mathrm{s^{-1}}\). The three normal strain rates must sum to zero for volume preservation. - Water (\(\rho=1000\ \mathrm{kg\,m^{-3}}\)) flows steadily through a pipe that narrows from diameter \(D_1=0.10\ \mathrm{m}\) to \(D_2=0.050\ \mathrm{m}\). If the inlet speed is \(u_1=2.0\ \mathrm{m\,s^{-1}}\), find the outlet speed and the mass flow rate.
Solution
Incompressible steady \(\Rightarrow u_1A_1=u_2A_2\), with \(A=\tfrac{\pi}{4}D^2\). Thus \(u_2=u_1(D_1/D_2)^2=2.0\times(0.10/0.050)^2=2.0\times4=8.0\ \mathrm{m\,s^{-1}}\). Mass flow \(\dot m=\rho u_1 A_1=1000\times2.0\times\tfrac{\pi}{4}(0.10)^2=1000\times2.0\times7.85\times10^{-3}=15.7\ \mathrm{kg\,s^{-1}}\). - Show that for an incompressible flow the material derivative of density vanishes, and hence that constant-density fluid elements remain constant-density. Start from \(\partial_t\rho+\nabla\cdot(\rho\mathbf u)=0\).
Solution
Expand: \(\nabla\cdot(\rho\mathbf u)=\mathbf u\cdot\nabla\rho+\rho\nabla\cdot\mathbf u\). Continuity becomes \(\partial_t\rho+\mathbf u\cdot\nabla\rho+\rho\nabla\cdot\mathbf u=0\), i.e. \(\mathrm{D}\rho/\mathrm{D}t=-\rho\nabla\cdot\mathbf u\). Incompressible means \(\nabla\cdot\mathbf u=0\), so \(\mathrm{D}\rho/\mathrm{D}t=0\): following any parcel, its density is constant in time. A parcel that starts at density \(\rho_0\) keeps it. - A compressible gas has \(\rho(x,t)=\rho_0\big(1+\varepsilon\sin(kx-\omega t)\big)\) with a velocity \(u(x,t)=U\sin(kx-\omega t)\) in one dimension. To first order in the small amplitude \(\varepsilon\) (and with \(U\) also small), find the relation between \(U\), \(\omega\), \(k\) and \(\varepsilon\rho_0\) required by continuity.
Solution
\(\partial_t\rho=-\rho_0\varepsilon\omega\cos(kx-\omega t)\). To first order, \(\partial_x(\rho u)\approx\rho_0\partial_x u=\rho_0 U k\cos(kx-\omega t)\) (the \(\varepsilon U\) product is second order). Continuity \(\partial_t\rho+\partial_x(\rho u)=0\) gives \(-\rho_0\varepsilon\omega\cos(\cdot)+\rho_0 Uk\cos(\cdot)=0\), so \(U k=\varepsilon\omega\), i.e. \(U=\varepsilon\,\omega/k=\varepsilon\,c\) with phase speed \(c=\omega/k\). This is the acoustic relation between velocity amplitude and density (condensation) amplitude. - A spherically symmetric radial outflow has \(\mathbf u = u(r)\hat{\mathbf r}\) and is steady. Show that mass conservation forces \(\rho u r^2=\text{const}\), and for constant density find how \(u\) scales with \(r\).
Solution
Steady \(\Rightarrow\nabla\cdot(\rho\mathbf u)=0\). In spherical coordinates for a radial field, \(\nabla\cdot(\rho\mathbf u)=\tfrac{1}{r^2}\tfrac{\mathrm d}{\mathrm dr}\!\big(r^2\rho u\big)=0\), so \(r^2\rho u=\text{const}\) (equivalently the mass flux through any sphere, \(4\pi r^2\rho u=\dot m\), is fixed). For constant \(\rho\): \(u\propto r^{-2}\) — the radial speed falls off as the inverse square of the radius, since the same volume flux spreads over a surface \(\propto r^2\).