Continuity equation


A continuity equation or transport equation is an equation that describes the transport of some quantity. It is particularly simple and powerful when applied to a conserved quantity, but it can be generalized to apply to any extensive 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, a weak version of the law of conservation of energy states that energy can neither be created nor destroyed—i.e., the total amount of energy in the universe is fixed. This statement does not rule out the possibility that a quantity of energy could disappear from one point while simultaneously appearing at another point. 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. For example, the continuity equation for electric charge states that the amount of electric charge in any volume of space can only change by the amount of electric current flowing into or out of that volume through its boundaries.
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 people alive; it has a "source term" to account for people being born, and a "sink term" to account for people dying.
Any continuity equation can be expressed in an "integral form", which applies to any finite region, or in a "differential form" 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.
Flows governed by continuity equations can be visualized using a Sankey diagram.

General equation

Definition of flux

A continuity equation is useful when a flux can be defined. To define flux, first there must be a quantity which can flow or move, such as mass, energy, electric charge, momentum, number of molecules, etc. Let be the volume density of this quantity, that is, the amount of per unit volume.
The way that this quantity is flowing is described by its flux. The flux of is a vector field, which we denote as j. Here are some examples and properties of flux:
  • The dimension of flux is "amount of flowing per unit time, through a unit area". For example, in the mass continuity equation for flowing water, if 1 gram per second of water is flowing through a pipe with cross-sectional area 1 cm2, then the average mass flux inside the pipe is, and its direction is along the pipe in the direction that the water is flowing. Outside the pipe, where there is no water, the flux is zero.
  • If there is a velocity field which describes the relevant flow—in other words, if all of the quantity at a point is moving with velocity —then the flux is by definition equal to the density times the velocity field:
  • In a well-known example, the flux of electric charge is the electric current density.
  • If there is an imaginary surface, then the surface integral of flux over is equal to the amount of that is passing through the surface per unit time:

    Integral form

The integral form of the continuity equation states that:
  • The amount of in a region increases when additional flows inward through the surface of the region, and decreases when it flows outward;
  • The amount of in a region increases when new is created inside the region, and decreases when is destroyed;
  • Apart from these two processes, there is no other way for the amount of in a region to change.
Mathematically, the integral form of the continuity equation expressing the rate of increase of within a volume is:
where
  • is any imaginary closed surface, that encloses a volume,
  • denotes a surface integral over that closed surface,
  • is the total amount of the quantity in the volume,
  • is the flux of,
  • is time,
  • is the net rate that is being generated inside the volume per unit time. When is being generated, the region is called a source of, and it makes more positive. When is being destroyed, the region is called a sink of, and it makes more negative. The term is sometimes written as or the total change of from its generation or destruction inside the control volume.
In a simple example, could be a building, and could be the number of living people in the building. The surface would consist of the walls, doors, roof, and foundation of the building. Then the continuity equation states that the number of living people in the building increases when living people enter the building, decreases when living people exit the building, increases when someone in the building gives birth to new life, and decreases when someone in the building no longer lives. In conclusion, in this example there are four distinct ways that the net rate may be altered.

Differential form

By the divergence theorem, a general continuity equation can also be written in a "differential form":
where
  • is divergence,
  • is the density of the amount ,
  • is the flux of ,
  • is time,
  • is the generation of per unit volume per unit time. Terms that generate or remove are referred to as 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 referred to by the term "continuity equation", because in those cases does not represent the flow of a real physical quantity.
In the case that is a conserved quantity that cannot be created or destroyed, and the equations become:

Electromagnetism

In electromagnetic theory, the continuity equation is an empirical law expressing 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 is equal to the negative rate of change of the charge density ,
Current is the movement of charge. The continuity equation says that if charge is moving out of a differential volume 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 the rate at which mass enters a system is equal to the rate at which mass leaves the system plus the accumulation of mass within the system.
The differential form of the continuity equation is:
where
The time derivative can be understood as the accumulation of mass in the system, while the divergence term represents the difference in flow in versus flow out. In this context, this equation is also one of the Euler equations. The Navier–Stokes equations form a vector continuity equation describing the conservation of linear momentum.
If the fluid is incompressible, the mass continuity equation simplifies to a volume continuity equation:
which means that the divergence of the velocity field is zero everywhere. Physically, this is equivalent to saying that the local volume dilation rate is zero, hence a flow of water through a converging pipe will adjust solely by increasing its velocity as water is largely incompressible.

Computer vision

In computer vision, optical flow is the pattern of apparent motion of objects in a visual scene. Under the assumption that brightness of the moving object did not change between two image frames, one can derive the optical flow equation as:
where
  • is time,
  • coordinates in the image,
  • is the image intensity at image coordinate and time,
  • is the optical flow velocity vector at image coordinate and time

    Energy and heat

says that energy cannot be created or destroyed. Therefore, there is a continuity equation for energy flow:
where
An important practical example is the flow of heat. When heat flows inside a solid, the continuity equation can be combined with Fourier's law to arrive at the heat equation. The equation of heat flow may also have source terms: Although energy cannot be created or destroyed, heat can be created from other types of energy, for example via friction or joule heating.

Probability distributions

If there is a quantity that moves continuously according to a stochastic process, like the location of a single dissolved molecule with Brownian motion, then there is a continuity equation for its probability distribution. The flux in this case is the probability per unit area per unit time that the particle passes through a surface. According to the continuity equation, the negative divergence of this flux equals the rate of change of the probability density. The continuity equation reflects the fact that the molecule is always somewhere—the integral of its probability distribution is always equal to 1—and that it moves by a continuous motion.