MATH-209 · Lesson 10 of 12 · 32 min

Vector calculus in fluid mechanics

Fluid mechanics is where vector calculus is most at home. A flowing fluid is described by a velocity field that varies in space and time, and every one of the operators of Lessons 8 and 9 has a direct physical meaning in it: divergence measures expansion, curl measures spin, the gradient of pressure pushes the fluid, and the Laplacian describes viscous diffusion. This lesson shows how the governing equations of fluid flow are built from these operators. It introduces the material derivative, which follows a moving fluid particle; derives the continuity equation from the divergence theorem; describes two-dimensional flows with a stream function and irrotational flows with a velocity potential; combines simple potential flows to model flow around a cylinder, with and without spin; and derives Bernoulli's equation from Euler's equation of motion. Groundwater flow toward a well, governed by the same mathematics, completes the picture.

Velocity fields and the material derivative

In the Eulerian description used throughout fluid mechanics, the velocity \(\mathbf{v}(x, y, z, t)\) is a vector field: at each point and time it gives the velocity of whatever fluid is passing that point. Streamlines are curves everywhere tangent to the velocity; in steady flow they are the paths that particles follow.

A fluid particle moves through the field, so the rate at which a quantity changes for that particle, the material derivative, has two parts: the change at a fixed point, and the change due to moving to a new point. By the chain rule (Lesson 3):

\[\frac{Df}{Dt} = \frac{\partial f}{\partial t} + \mathbf{v} \cdot \nabla f\]

Applied to the velocity itself, it gives the acceleration of a fluid particle, \(D\mathbf{v}/Dt = \partial\mathbf{v}/\partial t + (\mathbf{v} \cdot \nabla)\mathbf{v}\). The second, convective term means that fluid accelerates even in a perfectly steady flow whenever it moves into a region of different velocity.

Worked problem

Acceleration in a nozzle

In a steady flow along a converging nozzle, the velocity on the centreline is \(u = U_0(1 + x/L)\) with \(U_0 = 2\) m/s and L = 0.5 m. Find the acceleration of a fluid particle at the exit, x = L.

Show solution
  1. The flow is steady, so \(\partial u/\partial t = 0\).
  2. Convective acceleration: \(a = u\,\dfrac{du}{dx} = U_0\left(1 + \dfrac{x}{L}\right)\dfrac{U_0}{L}\).
  3. At x = L: \(a = 4 \times 4 = 16\) m/s².

Answer: 16 m/s², more than 1.6g, even though the velocity at every fixed point never changes. This acceleration requires a pressure gradient, which is why pressure falls along a nozzle.

Conservation of mass: the continuity equation

Consider any fixed region E with boundary surface S. The mass inside can change only through flow across S, so the rate of increase of mass equals the inward mass flux. Using the divergence theorem (Lesson 8):

\[\iiint_E \frac{\partial \rho}{\partial t}\,dV = -\iint_S \rho\mathbf{v} \cdot \mathbf{n}\,dS = -\iiint_E \nabla \cdot (\rho\mathbf{v})\,dV\]

Since this holds for every region, the integrands are equal, giving the continuity equation:

\[\frac{\partial \rho}{\partial t} + \nabla \cdot (\rho\mathbf{v}) = 0\]

For liquids, and for gases at speeds well below the speed of sound, the density is nearly constant and the equation reduces to \(\nabla \cdot \mathbf{v} = 0\): an incompressible flow has zero divergence, so whatever flows into any small region must flow out.

Worked problem

Checking a flow field

Is the two-dimensional flow \(\mathbf{v} = (x^2 - y^2)\,\mathbf{i} - 2xy\,\mathbf{j}\) incompressible? Is it irrotational?

Show solution
  1. Divergence: \(\dfrac{\partial}{\partial x}(x^2 - y^2) + \dfrac{\partial}{\partial y}(-2xy) = 2x - 2x = 0\). Incompressible.
  2. Curl (z-component): \(\dfrac{\partial}{\partial x}(-2xy) - \dfrac{\partial}{\partial y}(x^2 - y^2) = -2y + 2y = 0\). Irrotational.

Answer: Both: this is a valid ideal flow, in fact flow in a corner whose walls meet at 60°. Flows that are both incompressible and irrotational can be described entirely by potentials, as the next sections show.

The stream function

For two-dimensional incompressible flow, the condition \(\partial u/\partial x + \partial v/\partial y = 0\) is satisfied automatically if the velocity comes from a stream function \(\psi(x, y)\):

\[u = \frac{\partial \psi}{\partial y}, \qquad v = -\frac{\partial \psi}{\partial x}\]

The stream function is constant along streamlines, so its contour map is a picture of the flow. Better still, the difference in ψ between two streamlines equals the volume flow rate (per unit depth) passing between them. Where streamlines crowd together the flow is fast; where they spread apart it is slow.

Vorticity and the velocity potential

The vorticity \(\boldsymbol{\omega} = \nabla \times \mathbf{v}\) is twice the local angular velocity of fluid elements (Lesson 9). Flow outside thin boundary layers and wakes is often nearly irrotational, \(\boldsymbol{\omega} = \mathbf{0}\), and then the velocity is the gradient of a velocity potential, \(\mathbf{v} = \nabla\phi\). If the flow is also incompressible, \(\nabla \cdot \nabla\phi = 0\):

\[\nabla^2\phi = 0\]

Ideal flow therefore reduces to Laplace's equation, which is linear, so solutions can be added. A few building blocks, written in polar coordinates, cover a remarkable range of flows:

Elementary plane potential flows (Γ positive for anticlockwise circulation).
FlowVelocity potential φStream function ψ
Uniform flow at speed U\(Ur\cos\theta\)\(Ur\sin\theta\)
Source of strength m (m²/s)\(\dfrac{m}{2\pi}\ln r\)\(\dfrac{m}{2\pi}\theta\)
Free vortex of circulation Γ\(\dfrac{\Gamma}{2\pi}\theta\)\(-\dfrac{\Gamma}{2\pi}\ln r\)
Doublet of strength K\(\dfrac{K\cos\theta}{r}\)\(-\dfrac{K\sin\theta}{r}\)

Flow past a cylinder

Adding a uniform flow and a doublet with \(K = Ua^2\) gives

\[\psi = U\left(r - \frac{a^2}{r}\right)\sin\theta\]

On the circle r = a, ψ = 0, so that circle is a streamline and can be replaced by a solid cylinder: this is ideal flow around a cylinder of radius a. The velocity on the surface is purely tangential, with speed \(2U|\sin\theta|\): zero at the front and rear stagnation points, and twice the free-stream speed at the top and bottom.

Streamlines of ideal flow from left to right around a circular cylinder. Far from the cylinder the streamlines are straight and evenly spaced; near it they bend around the cylinder, crowding together above and below it where the flow is fastest, and are symmetric front to back. Stagnation points are marked at the front and rear.
Ideal flow around a cylinder: streamlines crowd together where the flow speeds up.

Bernoulli's equation (below) then gives the pressure on the surface. With the pressure coefficient \(C_p = (p - p_\infty)/(\tfrac{1}{2}\rho U^2)\), the result is \(C_p = 1 - 4\sin^2\theta\): +1 at the stagnation points and −3 at the top and bottom. The pressure distribution is symmetric front to back, so it produces no drag at all, a famous result called d'Alembert's paradox. Real cylinders do feel drag, because the viscous boundary layer separates from the rear surface and leaves a low-pressure wake; ideal flow is accurate over the front of the cylinder and fails behind it. This is a good reminder that every model has a range of validity.

Adding circulation: the Magnus effect

Adding a free vortex of circulation Γ (for example by spinning the cylinder) breaks the top-bottom symmetry. With clockwise circulation and flow from left to right, the flow speeds up over the top and slows underneath, the stagnation points move down to where \(\sin\theta = -\Gamma/(4\pi Ua)\), and the lower pressure on top produces an upward force perpendicular to the flow. The Kutta-Joukowski theorem gives this lift per unit length:

\[L' = \rho U\Gamma\]

The same theorem, applied to an aerofoil whose shape creates circulation, is the foundation of wing theory. Spinning balls curve for the same reason, and rotor ships have used spinning cylinders as sails.

Streamlines of flow from left to right around a spinning cylinder with clockwise circulation. Streamlines crowd together above the cylinder and spread apart below it. The front and rear stagnation points have moved down onto the lower part of the cylinder. An arrow shows the resulting lift force pointing upward.
With clockwise circulation, flow is faster over the top, pressure is lower there, and the cylinder is pushed upward.
Integrating the surface pressure on a spinning cylinder numerically and comparing with the Kutta-Joukowski lift.
import numpy as np

rho, U, a = 1.2, 10.0, 0.1                     # air, 10 m/s, cylinder radius 0.1 m
theta = np.linspace(0, 2 * np.pi, 20001)

for Gamma in [0.0, 2.0, 6.0]:
    # tangential surface speed with clockwise circulation Gamma
    vt = -2 * U * np.sin(theta) - Gamma / (2 * np.pi * a)
    p = 0.5 * rho * (U**2 - vt**2)             # Bernoulli, relative to free stream
    # force per unit length = -integral of p n ds, with n = (cos, sin) and ds = a dtheta
    drag = 0.0 - np.trapezoid(p * np.cos(theta) * a, theta)
    lift = 0.0 - np.trapezoid(p * np.sin(theta) * a, theta)
    s = Gamma / (4 * np.pi * U * a)
    print(f"Gamma = {Gamma:.1f} m2/s: drag {round(drag, 3) + 0.0:.3f} N/m, lift {round(lift, 2) + 0.0:.2f} N/m,"
          f" rho U Gamma = {rho * U * Gamma:.2f} N/m, stagnation at sin(theta) = {round(-s, 3) + 0.0:.3f}")
Output
Gamma = 0.0 m2/s: drag 0.000 N/m, lift 0.00 N/m, rho U Gamma = 0.00 N/m, stagnation at sin(theta) = 0.000
Gamma = 2.0 m2/s: drag 0.000 N/m, lift 24.00 N/m, rho U Gamma = 24.00 N/m, stagnation at sin(theta) = -0.159
Gamma = 6.0 m2/s: drag 0.000 N/m, lift 72.00 N/m, rho U Gamma = 72.00 N/m, stagnation at sin(theta) = -0.477

The numerical integration confirms the theory: zero drag for every circulation, and lift equal to ρUΓ. Once Γ exceeds 4πUa, the stagnation points merge below the cylinder and leave its surface, and a region of fluid circulates with the cylinder.

Euler's equation and Bernoulli's equation

Newton's second law for a fluid particle, with pressure and gravity forces and no viscosity, is Euler's equation:

\[\rho\frac{D\mathbf{v}}{Dt} = -\nabla p + \rho\mathbf{g}\]

The pressure term is a force per unit volume pushing fluid from high to low pressure. Using the identity \((\mathbf{v} \cdot \nabla)\mathbf{v} = \nabla(\tfrac{1}{2}|\mathbf{v}|^2) - \mathbf{v} \times \boldsymbol{\omega}\) and writing \(\mathbf{g} = -\nabla(gz)\), steady incompressible flow gives

\[\nabla\left(p + \tfrac{1}{2}\rho|\mathbf{v}|^2 + \rho gz\right) = \rho\,\mathbf{v} \times \boldsymbol{\omega}\]

The right side is perpendicular to the velocity, so along any streamline the bracketed quantity is constant: this is Bernoulli's equation. In an irrotational flow the right side is zero everywhere, and the same constant applies throughout the flow. Adding viscosity contributes a term \(\mu\nabla^2\mathbf{v}\) to Euler's equation, giving the Navier-Stokes equations, which computational fluid dynamics programs solve numerically.

Worked problem

Pressure on a cylinder

Wind at 20 m/s (ρ = 1.2 kg/m³) blows across a tall chimney. Using ideal flow, find the pressure relative to the free stream at the front stagnation point and at the sides.

Show solution
  1. Dynamic pressure: \(\tfrac{1}{2}\rho U^2 = 0.5 \times 1.2 \times 400 = 240\) Pa.
  2. Front (θ = 180°): \(C_p = 1\), so \(+240\) Pa.
  3. Sides (θ = 90°): \(C_p = -3\), so \(-720\) Pa (suction).

Answer: +240 Pa at the front and −720 Pa at the sides. Measured suctions at the sides of real chimneys are smaller, about half this value, because of separation, but the strong suction is real and governs the design of cladding on round towers.

Groundwater flow toward a well

Water seeping through soil obeys Darcy's law, \(\mathbf{v} = -K\nabla h\), where h is the hydraulic head and K the hydraulic conductivity. Combined with incompressibility, \(\nabla \cdot \mathbf{v} = 0\), this gives \(\nabla^2h = 0\): the same Laplace equation as ideal flow. For a well pumping Q from a confined aquifer of thickness b, the flow is radial, and the cylindrical Laplacian (Lesson 9) gives \(h = A\ln r + B\). Fitting the flow rate \(Q = 2\pi rb\,K\,dh/dr\) gives the Thiem equation for the head difference between two observation wells:

\[h_2 - h_1 = \frac{Q}{2\pi Kb}\ln\frac{r_2}{r_1}\]

Worked problem

Testing an aquifer

A well pumps 0.020 m³/s from a confined aquifer 15 m thick. Observation wells at 10 m and 100 m show a head difference of 1.2 m. Find the hydraulic conductivity.

Show solution
  1. Rearrange: \(K = \dfrac{Q\ln(r_2/r_1)}{2\pi b\,(h_2 - h_1)} = \dfrac{0.020 \times \ln 10}{2\pi \times 15 \times 1.2}\).
  2. \(K = 0.0461/113.1 = 4.1 \times 10^{-4}\) m/s.

Answer: K ≈ 4 × 10⁻⁴ m/s, typical of clean sand. Pumping tests like this are the standard way to characterize aquifers for water supply and for dewatering construction sites.

Common mistakes

  • MistakeAssuming steady flow means zero acceleration.

    InsteadThe convective term (v · ∇)v accelerates fluid moving into faster or slower regions.

  • MistakeMixing up the signs in u = ∂ψ/∂y, v = −∂ψ/∂x.

    InsteadCheck that the divergence of the resulting velocity is zero.

  • MistakeApplying Bernoulli between streamlines in a rotational flow.

    InsteadUse it along a streamline, or across streamlines only if the flow is irrotational.

  • MistakeTrusting ideal flow to predict drag.

    InsteadIdeal flow predicts zero drag; real drag comes from viscosity and separation.

  • MistakeUsing the plane form of Darcy's law for radial flow to a well.

    InsteadRadial flow gives a logarithmic head profile, the Thiem equation.

Summary and key terms

  • The material derivative D/Dt = ∂/∂t + v · ∇ follows a fluid particle; steady flows can still accelerate fluid.
  • The continuity equation ∂ρ/∂t + ∇ · (ρv) = 0 follows from the divergence theorem; incompressible flow has ∇ · v = 0.
  • A 2D stream function makes the flow incompressible; ψ is constant on streamlines and differences give flow rates.
  • Irrotational incompressible flow has a velocity potential satisfying Laplace's equation, so solutions superpose.
  • Uniform flow plus a doublet gives flow past a cylinder, with surface speed 2U sin θ and C_p = 1 − 4 sin²θ.
  • Circulation produces lift ρUΓ (Kutta-Joukowski); ideal flow predicts no drag (d'Alembert's paradox).
  • Euler's equation leads to Bernoulli's equation; groundwater flow obeys Laplace's equation via Darcy's law.
Eulerian description
Describing a flow by fields at fixed points in space.
Material derivative
The rate of change following a fluid particle.
Continuity equation
The differential form of conservation of mass.
Stream function
A function whose contours are streamlines in 2D incompressible flow.
Vorticity
The curl of the velocity field.
Velocity potential
A function whose gradient is the velocity in irrotational flow.
Doublet
A source and sink brought infinitely close together.
Pressure coefficient
Pressure relative to free stream divided by dynamic pressure.
Kutta-Joukowski theorem
Lift per unit length equals ρUΓ.
Darcy's law
Seepage velocity proportional to the gradient of hydraulic head.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. Find Df/Dt for \(f = x + t\) in the flow \(\mathbf{v} = (2, 0, 0)\).

    Show answer

    ∂f/∂t + v · ∇f = 1 + 2 = 3.

  2. Is \(\mathbf{v} = (y, x)\) incompressible? Irrotational?

    Show answer

    Divergence 0: incompressible. Curl 1 − 1 = 0: irrotational.

  3. Is \(\mathbf{v} = (-y, x)\) irrotational?

    Show answer

    No; curl = 1 − (−1) = 2 (rigid rotation).

  4. Find u and v from \(\psi = 3xy\).

    Show answer

    u = 3x, v = −3y.

  5. Two streamlines have ψ = 2 and ψ = 5 m²/s. What flow passes between them per metre depth?

    Show answer

    3 m³/s per metre.

  6. Show that \(\phi = x^2 - y^2\) is a valid velocity potential for incompressible flow.

    Show answer

    ∇²φ = 2 − 2 = 0.

  7. What is the maximum surface speed on a cylinder in a 5 m/s ideal flow?

    Show answer

    10 m/s.

  8. Find the lift per metre on a cylinder with Γ = 3 m²/s in water (ρ = 1000) at U = 2 m/s.

    Show answer

    6000 N/m.

  9. Water at 3 m/s and 200 kPa speeds up to 9 m/s at the same height. Find the new pressure.

    Show answer

    200 − 0.5(1000)(81 − 9)/1000 = 164 kPa.

  10. In the aquifer example, what head difference would occur between wells at 20 m and 200 m?

    Show answer

    The same, 1.2 m, since only the ratio matters.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz