Tutorials › Calculus III › Divergence Tests for Incompressible Flow

Flux and Circulation Applications · Tutorial 978 of 999

Divergence Tests for Incompressible Flow

Compute divergence to test incompressibility, then use the Divergence Theorem to interpret the net flux through a closed boundary.

Advanced 10 min read

What You'll Learn

  • Compute the divergence of a three-dimensional velocity field.
  • State the pointwise condition for incompressibility in constant-density flow.
  • Use the Divergence Theorem to connect divergence with outward flux across a closed boundary.
  • Distinguish zero divergence from zero net flux on one particular region.
  • Check flux calculations directly on box boundaries.
  • Recognize common errors involving velocity components and their derivatives.

From Local Flow to Boundary Flux

A velocity field describes the motion of fluid at each point. Its divergence measures a local tendency for flow to spread outward or converge inward. This gives a precise test for incompressibility: in the usual constant-density setting, an incompressible velocity field has zero divergence at every point in the region of interest.

The same local quantity also determines the total outward flux through a closed boundary. The Divergence Theorem converts the flux across that boundary into a volume integral of divergence. Thus a pointwise condition on the velocity field has a direct consequence for the net flow across any suitable closed surface surrounding a fluid region.

Definition: For a differentiable velocity field \(\mathbf{v}(x,y,z) = \langle P(x,y,z),Q(x,y,z),R(x,y,z)\rangle\), its divergence is
$$ \nabla\cdot\mathbf{v} = \frac{\partial P}{\partial x} + \frac{\partial Q}{\partial y} + \frac{\partial R}{\partial z}. $$
The field is called incompressible on a region if \(\nabla\cdot\mathbf{v}=0\) at every point of that region.

Each derivative pairs a component with the coordinate in its own direction: the \(x\)-component is differentiated with respect to \(x\), the \(y\)-component with respect to \(y\), and the \(z\)-component with respect to \(z\). Divergence is a scalar field, so its value may vary from point to point.

What the Zero-Divergence Condition Says

Incompressibility is a local, pointwise condition. At each point, the sum of the three indicated partial derivatives must be zero. A positive divergence indicates a local outward tendency; a negative divergence indicates a local inward tendency. Zero divergence means there is no net local source or sink of volume flow.

This statement concerns the velocity field, not whether the fluid is stationary. A fluid can move rapidly while having zero divergence. Nor does zero divergence require each derivative in the sum to vanish separately: nonzero contributions can cancel.

Important: A velocity field is incompressible on a region when its divergence vanishes throughout that region, not merely at one point or on average over the region.

Why Divergence Determines Closed-Boundary Flux

For a closed surface \(S\) bounding a solid region \(E\), let \(\mathbf{n}\) denote the outward-pointing unit normal. The outward flux of \(\mathbf{v}\) across \(S\) is the surface integral of \(\mathbf{v}\cdot\mathbf{n}\). If \(\mathbf{v}\) has continuous first partial derivatives on an open set containing \(E\), and \(S\) is a piecewise-smooth closed boundary, the Divergence Theorem applies:

$$ \iint_S \mathbf{v}\cdot\mathbf{n}\,dS = \iiint_E \nabla\cdot\mathbf{v}\,dV. $$

The theorem explains the connection: the total outward flow across the boundary equals the accumulated divergence throughout the enclosed volume. If divergence is zero everywhere in \(E\), the volume integral is zero, so the net outward flux is zero. Individual parts of the boundary can still have nonzero flux; the positive and negative contributions balance.

1
Compute divergence.
Differentiate each component with respect to its matching coordinate and add the results.
2
Test the field.
Check whether the resulting scalar is zero at every point of the region.
3
Relate to a closed boundary.
When the Divergence Theorem hypotheses hold, integrate divergence over the enclosed volume to obtain net outward flux.

This implication also has a useful local converse. Suppose a continuously differentiable field has zero net outward flux across the boundary of every sufficiently small subregion around each interior point. By the Divergence Theorem, the integral of its divergence over each such subregion is zero. If divergence were positive at some point, continuity would make it positive in a small neighborhood, giving a positive integral there; negative divergence would similarly give a negative integral. Both contradict zero integral. Therefore the divergence must vanish at every interior point.

Worked Examples

Worked Example: A Linear Incompressible Field

Test \(\mathbf{v}(x,y,z)=\langle 2x,-2y,3\rangle\) for incompressibility, then determine its net outward flux across the box \(E=[0,1]\times[0,2]\times[0,3]\).

Here \(P=2x\), \(Q=-2y\), and \(R=3\). Differentiate in the matching coordinates:

$$ \nabla\cdot\mathbf{v} = \frac{\partial (2x)}{\partial x} + \frac{\partial (-2y)}{\partial y} + \frac{\partial 3}{\partial z} = 2-2+0 = 0. $$

The divergence vanishes everywhere, so the field is incompressible. The box has a piecewise-smooth closed boundary, and the field is continuously differentiable there. Its volume is \(1\cdot2\cdot3=6\), so the Divergence Theorem gives

$$ \iint_{\partial E}\mathbf{v}\cdot\mathbf{n}\,dS = \iiint_E 0\,dV = 0. $$

Check by adding the face fluxes. On \(x=1\), the outward flux is \(2\) times the face area \(2\cdot3=6\), giving \(12\); on \(x=0\), it is \(0\). On \(y=2\), the \(y\)-component is \(-4\), and the outward normal points in the positive \(y\)-direction, giving flux \(-4(1\cdot3)=-12\); on \(y=0\), it is \(0\). On \(z=3\), the flux is \(3(1\cdot2)=6\); on \(z=0\), it is \(-3(1\cdot2)=-6\). The total is \(12-12+6-6=0\), as predicted.

Worked Example: A Nonlinear Incompressible Field

Test \(\mathbf{v}(x,y,z)=\langle x^2,-2xy,0\rangle\) on the unit cube \(E=[0,1]^3\), and find the net outward flux through its boundary.

The components are \(P=x^2\), \(Q=-2xy\), and \(R=0\). Thus

$$ \nabla\cdot\mathbf{v} = \frac{\partial (x^2)}{\partial x} + \frac{\partial (-2xy)}{\partial y} + \frac{\partial 0}{\partial z} = 2x-2x+0 = 0. $$

The field is incompressible throughout the cube. Since the cube has volume \(1\), the Divergence Theorem gives net outward flux \(\iiint_E0\,dV=0\).

For a direct check, on \(x=1\) the outward flux is \(\int_0^1\int_0^1 1\,dy\,dz=1\); on \(x=0\), it is \(0\). On \(y=1\), the outward flux is \(\int_0^1\int_0^1(-2x)\,dx\,dz=-1\); on \(y=0\), it is \(0\). The field has zero \(z\)-component, so both \(z\)-face fluxes are zero. Adding gives \(1-1=0\), confirming the theorem’s result.

Worked Example: Nonzero Divergence and Positive Net Flux

For \(\mathbf{v}(x,y,z)=\langle x,y,z\rangle\), determine the divergence and net outward flux from the unit cube.

Each component differentiates to \(1\) in its matching coordinate:

$$ \nabla\cdot\mathbf{v} = \frac{\partial x}{\partial x} + \frac{\partial y}{\partial y} + \frac{\partial z}{\partial z} = 1+1+1 = 3. $$

The field is not incompressible. The Divergence Theorem gives

$$ \iint_{\partial E}\mathbf{v}\cdot\mathbf{n}\,dS = \iiint_E 3\,dV = 3(1) = 3. $$

Check directly: the face \(x=1\) contributes \(1\), while \(x=0\) contributes \(0\). The faces \(y=1\) and \(z=1\) each contribute \(1\), and the faces \(y=0\) and \(z=0\) each contribute \(0\). Their sum is \(1+1+1=3\), matching the volume calculation.

Zero Net Flux Does Not Always Mean Incompressibility

It is important not to reverse the main implication carelessly. Zero divergence throughout a region guarantees zero net flux through its closed boundary. But zero net flux for one particular region does not guarantee zero divergence throughout that region. Divergence can take both positive and negative values whose volume integrals cancel.

Worked Example: Zero Net Flux with Nonzero Divergence

Consider \(\mathbf{v}(x,y,z)=\langle x^2/2,0,0\rangle\) on \(E=[-1,1]\times[0,1]\times[0,1]\). Its divergence is

$$ \nabla\cdot\mathbf{v} = \frac{\partial (x^2/2)}{\partial x} = x. $$

This is not identically zero, so the field is not incompressible on \(E\). Nevertheless, its volume integral is

$$ \iiint_E x\,dV = \int_0^1\int_0^1\int_{-1}^1 x\,dx\,dy\,dz = 0, $$

because \(\int_{-1}^1x\,dx=0\). The Divergence Theorem therefore gives net outward flux zero. Directly, the face \(x=1\) contributes \(1/2\), and \(x=-1\) contributes \(-1/2\), since its outward normal points in the negative \(x\)-direction. The other four faces contribute zero because their normal directions are perpendicular to the field. The total is \(1/2-1/2=0\), even though divergence is nonzero at most points in the region.

A Common Error: Adding Components Instead of Derivatives

Divergence is not the sum of the velocity components. For example, take \(\mathbf{v}(x,y,z)=\langle x,-x,0\rangle\). A mistaken calculation might add the component expressions and conclude \(x+(-x)+0=0\). But that is not the definition of divergence. The correct calculation is

$$ \nabla\cdot\mathbf{v} = \frac{\partial x}{\partial x} + \frac{\partial (-x)}{\partial y} + \frac{\partial 0}{\partial z} = 1+0+0 = 1. $$

The field is not incompressible. The correction is to differentiate each component with respect to its own coordinate before adding. The \(y\)-component \(-x\) has no dependence on \(y\), so its contribution is zero, even though its value is not generally zero.

Why the Test Matters

The divergence test translates the qualitative idea of an incompressible flow into a calculation that can be checked point by point. Once zero divergence is established, the Divergence Theorem immediately supplies the net-flux result for every appropriate closed boundary in the region. Conversely, a computed net flux can reveal the accumulated divergence inside a solid, while not by itself proving that the field is incompressible at every point.

Takeaway: Incompressibility is the pointwise condition \(\nabla\cdot\mathbf{v}=0\). For a smooth velocity field on a region with a suitable closed boundary, the Divergence Theorem then implies zero net outward boundary flux. The converse from one zero-flux calculation alone is not valid.

Check Your Understanding

Use the definition of divergence and the closed-boundary flux connection to answer these questions.

  1. Compute the divergence of \(\mathbf{v}(x,y,z)=\langle 3x,-y,2z\rangle\). Is the field incompressible?
  2. If a continuously differentiable field has zero divergence everywhere inside a box, what is its net outward flux across the box boundary, and which theorem justifies the conclusion?
  3. For \(\mathbf{v}(x,y,z)=\langle x^2,-2xy,0\rangle\), show which two terms cancel in the divergence calculation.
  4. Why does zero net flux across one closed boundary fail to prove that divergence vanishes at every point inside?
  5. For \(\mathbf{v}(x,y,z)=\langle x,-x,0\rangle\), identify the incorrect component-sum calculation and compute the correct divergence.