# Continuity equation

A continuity equation in physics is an equation that describes the transport of a conserved quantity. Since mass, energy, momentum, electric charge and other natural quantities are conserved under their respective appropriate conditions, a variety of physical phenomena may be described using continuity equations.

Continuity equations are a stronger, local form of conservation laws. For example, it is true that "the total energy in the universe is conserved". But this statement does not immediately rule out the possibility that energy could disappear from Earth while simultaneously appearing in another galaxy. A stronger statement is that energy is locally conserved: Energy can neither be created nor destroyed, nor can it "teleport" from one place to another—it can only move by a continuous flow. A continuity equation is the mathematical way to express this kind of statement.

Continuity equations more generally can include "source" and "sink" terms, which allow them to describe quantities that are often but not always conserved, such as the density of a molecular species which can be created or destroyed by chemical reactions. In an everyday example, there is a continuity equation for the number of living humans; it has a "source term" to account for people giving birth, and a "sink term" to account for people dying.

Any continuity equation can be expressed in an "integral form" (in terms of a flux integral), which applies to any finite region, or in a "differential form" (in terms of the divergence operator) which applies at a point.

Continuity equations underlie more specific transport equations such as the convection–diffusion equation, Boltzmann transport equation, and Navier–Stokes equations.

## General equation

### Preliminary description

Illustration of how flux j passes through open curved surfaces S (dS is differential vector area).
Illustration of how flux j passes through closed surfaces S1 and S2. The surface area elements shown are dS1 and dS2, and the flux is integrated over the whole surface. Yellow dots are sources, red dots are sinks, the blue lines are the flux lines of q.

As stated above, the idea behind the continuity equation is the flow of some property, such as mass, energy, electric charge, momentum, and even probability, through surfaces from one region of space to another. The surfaces, in general, may either be open or closed, real or imaginary, and have an arbitrary shape, but are fixed for the calculation (i.e. not time-varying, which is appropriate since this complicates the maths for no advantage). Let this property be represented by just one scalar variable, q, and let the volume density of this property (the amount of q per unit volume V) be ρ, and the union of all surfaces be denoted by S. Mathematically, ρ is a ratio of two infinitesimal quantities:

$\rho = \frac{d q}{d V},$

which has the dimension [quantity][L]−3 (where L is length).

There are different ways to conceive the continuity equation:

1. either the flow of particles carrying the quantity q, described by a velocity field v, which is also equivalent to a flux j of q (a vector function describing the flow per unit area per unit time of q), or
2. in the cases where a velocity field is not useful or applicable, the flux j of the quantity q only (no association with velocity).

In each of these cases, the transfer of q occurs as it passes through two surfaces, the first S1 and the second S2.

Illustration of q, ρ, and j, and the effective flux due to carriers of q. ρ is the amount of q per unit volume (in the box), j represents the flux (blue flux lines) and q is carried by the particles (yellow).

The flux j should represent some flow or transport, which has dimensions [quantity][T]−1[L]−2. In cases where particles/carriers of quantity q are moving with velocity v, such as particles of mass in a fluid or charge carriers in a conductor, j can be related to v by:

$\mathbf{j} = \rho \mathbf{v} .$

This relation is only true in situations where there are particles moving and carrying q - it can't always be applied. To illustrate this: if j is electric current density (electric current per unit area) and ρ is the charge density (charge per unit volume), then the velocity of the charge carriers is v. However - if j is heat flux density (heat energy per unit time per unit area), then even if we let ρ be the heat energy density (heat energy per unit volume) it does not imply the "velocity of heat" is v (this makes no sense, and is not practically applicable). In the latter case only j (with ρ) may be used in the continuity equation.

### Elementary vector form

Consider the case when the surfaces are flat and planar cross-sections. For the case where a velocity field can be applied, dimensional analysis leads to this form of the continuity equation:

$\rho_1 \mathbf{v}_1 \cdot \mathbf{S}_1 = \rho_2 \mathbf{v}_2 \cdot \mathbf{S}_2$

where

• the left hand side is the initial amount of q flowing per unit time through surface S1, the right hand side is the final amount through surface S2,
• S1 and S2 are the vector areas for the surfaces S1 and S2 respectively.

Notice the dot products $\mathbf{v}_1 \cdot \mathbf{S}_1, \, \mathbf{v}_2 \cdot \mathbf{S}_2 \,\!$ are volumetric flow rates of q. The dimension of each side of the equation is [quantity][L]−3•[L][T]−1•[L]2 = [quantity][T]−1. For the more general cases, independent of whether a velocity field can be used or not, the continuity equation becomes:

$\mathbf{j}_1 \cdot \mathbf{S}_1 = \mathbf{j}_2 \cdot \mathbf{S}_2$

This has exactly the same dimensions as the previous version. The relation between j and v allows us to pass from the velocity version to this flux equation, but not always the other way round (as explained above - velocity fields are not always applicable). These results can be generalized further to curved surfaces by reducing the vector surfaces into infinitely many differential surface elements (that is S → dS), then integrating over the surface:

$\int\!\!\!\!\int_{S_1} \rho_1\mathbf{v}_1 \cdot d\mathbf{S}_1 = \int\!\!\!\!\int_{S_2} \rho_2\mathbf{v}_2 \cdot d\mathbf{S}_2$

more generally still:

 $\int\!\!\!\!\int_{S_1} \mathbf{j}_1 \cdot d\mathbf{S}_1 = \int\!\!\!\!\int_{S_2} \mathbf{j}_2 \cdot d\mathbf{S}_2$

in which

• $\int\!\!\!\!\int_S d\mathbf{S} \equiv \int\!\!\!\!\int_S \mathbf{\hat{n}}dS$ denotes a surface integral over the surface S,
• $\mathbf{\hat{n}}$ is the outward-pointing unit normal to the surface S

N.B: the scalar area S and vector area S are related by $d\mathbf{S} = \mathbf{\hat{n}}dS$. Either notations may be used interchangeably.

### Differential form

The differential form for a general continuity equation is (using the same q, ρ and j as above):

 $\frac{\partial \rho}{\partial t} + \nabla \cdot \mathbf{j} = \sigma\,$

where

• ∇• is divergence,
• t is time,
• σ is the generation of q per unit volume per unit time. Terms that generate (σ > 0) or remove (σ < 0) q are referred to as a "sources" and "sinks" respectively.

This general equation may be used to derive any continuity equation, ranging from as simple as the volume continuity equation to as complicated as the Navier–Stokes equations. This equation also generalizes the advection equation. Other equations in physics, such as Gauss's law of the electric field and Gauss's law for gravity, have a similar mathematical form to the continuity equation, but are not usually called by the term "continuity equation", because j in those cases does not represent the flow of a real physical quantity.

In the case that q is a conserved quantity that cannot be created or destroyed (such as energy), this translates to σ = 0, and the continuity equation is:

$\frac{\partial \rho}{\partial t} + \nabla \cdot \mathbf{j} = 0\,$

### Integral form

In the integral form of the continuity equation, S is any imaginary closed surface that fully encloses a volume V, like any of the surfaces on the left. S can not be a surface with boundaries that do not enclose a volume, like those on the right. (Surfaces are blue, boundaries are red.)

By the divergence theorem (see below), the continuity equation can be rewritten in an equivalent way, called the "integral form":

 $\frac{d q}{d t} +$$\scriptstyle S$$\mathbf{j} \cdot d\mathbf{S} = \Sigma$

where

• S is a surface as described above - except this time it has to be a closed surface that encloses a volume V,
• $\scriptstyle S$$d\mathbf{S}$ denotes a surface integral over a closed surface,
• $\int\!\!\!\int\!\!\!\int_V \, dV$ denotes a volume integral over V.
• $q = \int\!\!\!\!\int\!\!\!\!\int_V \rho \, dV$ is the total amount of ρ in the volume V;
• $\Sigma = \int\!\!\!\!\int\!\!\!\!\int_V \sigma \, dV$ is the total generation (negative in the case of removal) per unit time by the sources and sinks in the volume V,

In a simple example, V could be a building, and q could be the number of people in the building. The surface S would consist of the walls, doors, roof, and foundation of the building. Then the continuity equation states that the number of people in the building increases when people enter the building (an inward flux through the surface), decreases when people exit the building (an outward flux through the surface), increases when someone in the building gives birth (a "source" where σ > 0), and decreases when someone in the building dies (a "sink" where σ < 0).

### Derivation and equivalence

The differential form can be derived from first principles as follows.

#### Derivation of the differential form

Suppose first an amount of quantity q(t) at time t is contained in a region of volume V, bounded by a closed surface S, as described above. The surface and volume of the region can be taken to be independent of time t. Denoting the volume density of q by ρ(r, t), then q(t) can be written as the volume integral of ρ in the region:

$q(t) = \int\!\!\!\!\int\!\!\!\!\int_V \rho(\mathbf{r},t) dV.$

The rate of change of q is simply the time derivative of q, so differentiating under the integral sign with respect to time:

$\frac{dq(t)}{dt} = \frac{d}{dt} \int\!\!\!\!\int\!\!\!\!\int_V \rho(\mathbf{r},t) dV = \int\!\!\!\!\int\!\!\!\!\int_V \frac{\partial \rho(\mathbf{r},t) }{\partial t} dV .$

The derivative is changed from the total to partial as it enters the integral because the integrand (density ρ) is not only a function of time, but also of coordinates. The rate of change of q can also be expressed as a sum of the flow through the surface S taken with the minus sign (the flow is from inside to outside) and the rate of production of q:

$\frac{dq(t)}{dt} =-$$\scriptstyle S$$\mathbf{j}(\mathbf{r},t)\cdot d\mathbf{S} + \Sigma(t).$

Now equating these expressions:

$-$$\scriptstyle S$$\mathbf{j}(\mathbf{r},t)\cdot d\mathbf{S} + \Sigma(t)=\int\!\!\!\!\int\!\!\!\!\int_V \frac{\partial \rho(\mathbf{r},t)}{\partial t} dV,$

Using the divergence theorem on the left-hand side:

$-\int\!\!\!\!\int\!\!\!\!\int_V \nabla\cdot\mathbf{j}(\mathbf{r},t) dV + \int\!\!\!\!\int\!\!\!\!\int_V \sigma(\mathbf{r},t) dV = \int\!\!\!\!\int\!\!\!\!\int_V \frac{\partial \rho(\mathbf{r},t)}{\partial t} dV.$

Since the volume V is arbitrary chosen this is only true if the integrands are equal, which directly leads to the differential continuity equation:

\begin{align} & \nabla\cdot\mathbf{j}(\mathbf{r},t) = - \frac{\partial \rho(\mathbf{r},t)}{\partial t} + \sigma(\mathbf{r},t), \\ & \nabla\cdot\mathbf{j} + \frac{\partial \rho}{\partial t} = \sigma \quad \rightleftharpoons \quad \nabla\cdot(\rho \mathbf{v}) + \frac{\partial \rho}{\partial t} = \sigma.\\ \end{align}

Either form may be useful and quoted, both can appear in hydrodynamics and electromagnetism, but for quantum mechanics and energy conservation, only the first is used. Therefore the first is more general.

#### Equivalence between differential and integral form

Starting from the differential form which is for unit volume, multiplying throughout by the infinitesimal volume element dV and integrating over the region gives the total amounts quantities in the volume of the region (per unit time):

\begin{align} & \int\!\!\!\!\int\!\!\!\!\int_V \frac{\partial \rho(\mathbf{r},t)}{\partial t} dV + \int\!\!\!\!\int\!\!\!\!\int_V \nabla \cdot \mathbf{j}(\mathbf{r},t) dV = \int\!\!\!\!\int\!\!\!\!\int_V \sigma(\mathbf{r},t) dV \\ & \frac{d}{d t} \int\!\!\!\!\int\!\!\!\!\int_V \rho(\mathbf{r},t)dV + \int\!\!\!\!\int\!\!\!\!\int_V \nabla \cdot \mathbf{j}(\mathbf{r},t) dV = \Sigma(t) \end{align} \,\!

again using the fact that V is constant in shape for the calculation, so it is independent of time and the time derivatives can be freely moved out of that integral, ordinary derivatives replace partial derivatives since the integral becomes a function of time only (the integral is evaluated over the region - so the spatial variables become removed from the final expression and t remains the only variable).

Using the divergence theorem on the left side

$\frac{d q(t)}{d t} +$$\scriptstyle S$$\mathbf{j}(\mathbf{r},t)\cdot d\mathbf{S} = \Sigma(t)$

which is the integral form.

#### Equivalence between elementary and integral form

Starting from

$\int\!\!\!\!\int_{S_1} \mathbf{j}_1(\mathbf{r},t) \cdot d\mathbf{S}_1 = \int\!\!\!\!\int_{S_2} \mathbf{j}_2(\mathbf{r},t) \cdot d\mathbf{S}_2$

the surfaces are equal (since there is only one closed surface), so S1 = S2 = S and we can write:

$\int\!\!\!\!\int_{S} \mathbf{j}_1(\mathbf{r},t) \cdot d\mathbf{S} = \int\!\!\!\!\int_{S} \mathbf{j}_2(\mathbf{r},t) \cdot d\mathbf{S}$

The left hand side is the flow rate of quantity q occurring inside the closed surface S. This must be equal to

$\int\!\!\!\!\int_{S} \mathbf{j}_1(\mathbf{r},t) \cdot d\mathbf{S} = \Sigma(t) - \frac{dq(t)}{dt}$

since some is produced by sources, hence the positive term Σ, but some is also leaking out by passing through the surface, implied by the negative term -dq/dt. Similarly the right hand side is the amount of flux passing through the surface and out of it, so

$\int\!\!\!\!\int_S \mathbf{j}_2(\mathbf{r},t) \cdot d\mathbf{S} =$$\scriptstyle S$$\mathbf{j}(\mathbf{r},t) \cdot d\mathbf{S}$

Equating these:

$\Sigma(t) - \frac{dq(t)}{dt} =$$\scriptstyle S$$\mathbf{j}(\mathbf{r},t) \cdot d\mathbf{S}$
$\frac{dq}{dt}+$$\scriptstyle S$$\mathbf{j} \cdot d\mathbf{S} =\Sigma$

which is the integral form again.

### Four-current formulation

The density ρ and current j as above can be combined into a general four-dimensional current (not necessarily an electromagnetic 4-current);

$J^\mu = \left(c \rho, \mathbf{j} \right)$

where c is the speed of light and μ is an index labelling the spacetime dimension.

The four-divergence of this current is:

$\partial_\mu J^\mu = \frac{\partial \rho}{\partial t} + \nabla \cdot \mathbf{j}$

where ∂μ is the four-gradient, so the continuity equation becomes:

$\partial_\mu J^\mu = \sigma$

which is simpler to write and is Lorentz invariant.

## Electromagnetism

In electromagnetic theory, the continuity equation is an empirical law expressing (local) charge conservation. Mathematically it is an automatic consequence of Maxwell's equations, although charge conservation is more fundamental than Maxwell's equations. It states that the divergence of the current density J (in amperes per square meter) is equal to the negative rate of change of the charge density ρ (in coulombs per cubic metre),

$\nabla \cdot \mathbf{J} = - {\partial \rho \over \partial t}$

Current is the movement of charge. The continuity equation says that if charge is moving out of a differential volume (i.e. divergence of current density is positive) then the amount of charge within that volume is going to decrease, so the rate of change of charge density is negative. Therefore the continuity equation amounts to a conservation of charge.

If magnetic monopoles exist, there would be a continuity equation for monopole currents as well, see the monopole article for background and the duality between electric and magnetic currents.

## Fluid dynamics

In fluid dynamics, the continuity equation states that, in any steady state process, the rate at which mass enters a system is equal to the rate at which mass leaves the system.[1][2]

The differential form of the continuity equation is:[1]

${\partial \rho \over \partial t} + \nabla \cdot (\rho \mathbf{u}) = 0$

where

In this context, this equation is also one of Euler equations (fluid dynamics). The Navier–Stokes equations form a vector continuity equation describing the conservation of linear momentum.

If ρ is a constant, as in the case of incompressible flow, the mass continuity equation simplifies to a volume continuity equation:[1]

$\nabla \cdot \mathbf{u} = 0,$

which means that the divergence of velocity field is zero everywhere. Physically, this is equivalent to saying that the local volume dilation rate is zero.

## Thermodynamics

Conservation of energy (which, in non-relativistic situations, can only be transferred, and not created or destroyed) leads to a continuity equation, an alternative mathematical statement of energy conservation to the thermodynamic laws.

Letting

• u = local energy density (energy per unit volume),
• q = energy flux (transfer of energy per unit cross-sectional area per unit time) as a vector,

the continuity equation is:

$\frac{ \partial u}{\partial t} + \nabla \cdot \mathbf{q} = 0$

Baryon number conservation is more fundamental than the first and second laws of thermodynamics.[3] If

then the 4-baryon number flux vector is Sα = nUα, satisfying the continuity equation:

$\partial_\alpha S^\alpha = \partial_\alpha (nU^\alpha) = 0$

## Quantum mechanics

In quantum mechanics, the conservation of probability also yields a continuity equation. The terms in the equation require the following definitions, and are slightly less obvious than the other forms of volume densities, currents, current densities etc., so they are outlined here:

$\rho(\mathbf{r},t) = \Psi^{*}(\mathbf{r},t) \Psi(\mathbf{r},t) = |\Psi(\mathbf{r},t)|^2 \,\!$
• The probability of finding the particle within V at t is denoted and defined by:
$P=P_{\mathbf{r} \in V}(t) = \int_V \Psi^{*} \Psi d V = \int_V |\Psi|^2 d V \,$
$\mathbf{j}(\mathbf{r},t) = \frac{\hbar}{2mi} \left [ \Psi^{*} \left ( \nabla \Psi \right ) - \Psi \left ( \nabla \Psi^{*} \right ) \right ].$

With these definitions the continuity equation reads:

$\nabla \cdot \mathbf{j} + \frac{\partial \rho}{\partial t} = 0 \rightleftharpoons \nabla \cdot \mathbf{j} + \frac{\partial |\Psi|^2}{\partial t} = 0.$

Either form may be quoted. Intuitively; the above quantities indicate this represents the flow of probability. The chance of finding the particle at some position r and time t flows like a fluid; hence the term probability current, a vector field. The particle itself does not flow deterministically in this vector field.

## General relativity

The stress–energy tensor is a second-order tensor field containing energy–momentum densities, energy–momentum fluxes, and shear stresses, of a mass-energy distribution. The divergence of this tensor vanishes:[5]

$\frac{\partial T^{\alpha\beta}}{\partial x^\beta}=0$

because energy and momentum are conserved. This is an important constraint on the form the Einstein field equations take in general relativity.[6]

## Quantum chromodynamics

Quarks and gluons have color charge, which is much more complicated to describe mathematically than those described above. Nevertheless, color charge is conserved as well, so there is a continuity equation for color currents:

$\partial_\nu j^\nu = 0$

See gluon field strength tensor for explicit expressions.

## Conserved currents from Noether's theorem

If a physical field described by a function of space and time, ϕ(r, t), is varied by a small amount;

$\phi \rightarrow \phi + \delta\phi$

then Noether's theorem states the Lagrangian L, or rather the Lagrangian density ℒ for fields, is invariant (does not change):

$\mathcal{L} \rightarrow \mathcal{L} + \delta\mathcal{L}, \ \delta\mathcal{L}=0$

under a continuous symmetry, in which the field is a continuous variable. The field ϕ(r, t) can be a scalar field, often a scalar potential like the classical gravitational potential ζ(r, t) or electric potential ϕ(r, t), or a vector field like the Newtonian gravitational field g(r, t) or vector potentials like the magnetic potential A(r, t), or a tensor field of any order such as the electromagnetic tensor F(r, t), or even a spinor field which arise in describing particles as quantum fields. The Lagrangian density is a function of the field and its space and time derivatives: ℒ[ϕ(r, t), ϕ(r, t)/t, ∇ϕ(r, t)].

The above considerations leads to conserved current densities in a completely general form:[7]

$J^\mu (\mathbf{r},t) = \frac{\partial \mathcal{L}}{\partial [\partial_\mu \phi(\mathbf{r},t)]}\delta\phi(\mathbf{r},t)$

because they satisfy the continuity equation

$\partial_\mu J^\mu = 0$

Integrating the density of the conserved quantity J0/c, over a spacelike region of volume V, gives the total amount of conserved quantity within that volume:

$q(t) = \int_V \frac{1}{c} J^0(\mathbf{r},t) \, dV$

Equivalently, integrating the current density of the conserved quantity j = (J1, J2, J3), through a closed spacelike surface S (see above descriptions) over some time duration, also gives the conserved quantity flowing through that surface in that time duration:

$q(t_2 - t_1) = \int_{t_1}^{t_2} \iint_S \mathbf{j}(\mathbf{r},t) \cdot d\mathbf{S} \,dt\,$

## References

1. ^ a b c Pedlosky, Joseph (1987). Geophysical fluid dynamics. Springer. pp. 10–13. ISBN 978-0-387-96387-7.
2. ^ Clancy, L.J.(1975), Aerodynamics, Section 3.3, Pitman Publishing Limited, London
3. ^ J.A. Wheeler, C. Misner, K.S. Thorne (1973). Gravitation. W.H. Freeman & Co. pp. 558–559. ISBN 0-7167-0344-0.
4. ^ Quantum Mechanics Demystified, D. McMahon, Mc Graw Hill (USA), 2006, ISBN(10) 0 07 145546 9
5. ^ J.A. Wheeler, C. Misner, K.S. Thorne (1973). Gravitation. W.H. Freeman & Co. ISBN 0-7167-0344-0.
6. ^ D. McMahon (2006). Relativity DeMystified. Mc Graw Hill (USA). ISBN 0-07-145545-0.
7. ^ D. McMahon, Mc Graw Hill (USA) (2008). Quantum Field Theory. ISBN 978-0-07-154382-8.