2.2.11 · D3Fluid Mechanics

Worked examples — Stream function, velocity potential

2,466 words11 min readBack to topic

This page is the worked-example workout for the parent topic. We will not re-derive the theory — instead we hunt down every kind of situation the topic can throw at you and solve one representative problem for each. If a symbol looks unfamiliar, the parent note builds it; here we use it and always say why.

Before anything, a one-line reminder of the two toolkits we will keep reaching for:

Recall The two definitions (needed on every line below)
  • Stream function: , — from incompressibility.
  • Velocity potential: , — from irrotationality.
  • Both exist together ⇒ Cauchy–Riemann links them and both obey Laplace's equation.

The scenario matrix

Here is the full landscape of cases. Every cell below is covered by an example further down.

# Case class What makes it special Example
A Both exist (ideal flow) positive uniform stream, all signs Ex 1
B Sign flip / direction flow pointing in , negative velocity Ex 2
C Combined field (linear) flow at an angle, both Ex 3
D Rotational flow — degenerate for cannot exist; still does Ex 4
E Zero-divergence check — is even allowed? a given field that fails/passes Ex 5
F Polar / singular point (source, origin) blows up, all-quadrant angles, branch cut Ex 6
G Limiting behaviour (vortex as ) irrotational everywhere except a singularity Ex 7
H Real-world word problem — flux/lane counting numbers, units, per-unit-depth Ex 8
I Exam twist — recover the other scalar & test orthogonality integrate mixed partials, check Ex 9

We work them in order. Every numeric result is machine-checked at the bottom.


Ex 1 — Cell A: both scalars, all signs positive

Forecast: guess first — will the streamlines be horizontal or vertical? Will const lines be the same set or perpendicular?

  1. Check divergence and curl. and . Why this step? Both scalars are only legal when their existence conditions hold. Divergence-free ⇒ allowed; curl-free ⇒ allowed. Both are zero, so both exist.
  2. Build . From , integrate in : (constant absorbed). Why this step? is defined by ; undoing the derivative means integrating.
  3. Build . From , integrate in : . Check ✓. Why this step? uses the cross index (), so integrate in , not .

Verify: const ⇒ horizontal lines (streamlines along the flow). const ⇒ vertical lines. They cross at . Recompute ✓, ✓.


Ex 2 — Cell B: negative velocity (sign flip)

Forecast: the streamlines are still horizontal — but which way does the flux count? Positive or negative?

  1. Build . . Why this step? Same recipe; the sign of carries straight into .
  2. Flux between two streamlines with : . Why this step? measures volume flow between streamlines; the difference is the flux (per unit depth).

Verify: magnitude ✓. The minus sign correctly reports that fluid crosses from high- to low- as seen against the standard orientation — a sign flip in flips the flux sign, exactly as it must.


Ex 3 — Cell C: flow at an angle (both components nonzero)

Forecast: streamlines should tilt. What slope do you predict from ?

  1. Streamline slope. . Why this step? Velocity is tangent to streamlines, so the slope is .
  2. Build . . Then . So . Why this step? When both components live, integrate one, then use the other equation to pin the integration "constant" .
  3. Build . ; . So .

Verify: streamline , slope ✓ matches step 1. Orthogonality: , ; dot product ✓ — perpendicular grid.


Ex 4 — Cell D: rotational flow (degenerate for )

Forecast: whirlpool alarm — will the potential survive?

  1. Curl test. . Why this step? exists only if curl is zero. Here it is — the flow spins — so no single-valued . Cell D is genuinely degenerate.
  2. Divergence test. . Why this step? needs only incompressibility, which does hold. So still exists.
  3. Build . ; . So .

Verify: at , ; streamlines const ⇒ circles const ✓ (spinning fluid moves in circles). Recompute ✓, ✓. Lesson: not every flow has a — the first common mistake, made concrete.


Ex 5 — Cell E: is even allowed? (divergence gate)

Forecast: will the divergence be zero?

  1. Divergence. . Why this step? No with the flux property exists unless divergence is zero. Here it's — fluid is being created everywhere. illegal.
  2. Fix the sign of one component: try , . Now divergence ✓. Why this step? Flipping makes what flows out in get sucked in through — a valid stagnation-point flow.
  3. Build for the fixed field. ; . So .

Verify: streamlines const ⇒ hyperbolas — the classic corner/stagnation flow. Recompute ✓, ✓, divergence ✓. Moral: always run the divergence gate first.


Ex 6 — Cell F: polar source, singular origin, all quadrants

Figure — Stream function, velocity potential

Read the figure first: the magenta arrows are the streamlines — they shoot straight out from the origin like the spokes of a wheel, one for each angle . The violet dashed circles are the equipotentials const. Notice that every spoke pierces every circle at a perfect right angle: that crossing pattern is the flow net you should extract. The orange dot at the centre is the singular source point.

Forecast: what happens to the speed as ? Are streamlines circles or spokes?

  1. Build . . Why this step? In polar coordinates has radial component ; integrate it.
  2. Build . The polar Cauchy–Riemann relation ties the radial velocity to the angular derivative of : . Setting this equal to gives . Why this step? We use the polar definition of (its -derivative supplies ), not the generic " is constant along a streamline." Here each streamline is a ray of fixed , so actually labels rays by their angle — it changes from ray to ray, and is constant only along one given spoke.
  3. All-quadrant behaviour (from the figure). increases smoothly through quadrant I (), II, III, IV as you sweep the spokes anticlockwise; ignores so its equipotential circles const are valid in all four quadrants. Singular origin: as , and — the source point is a genuine singularity, excluded from the domain.
  4. The branch-cut (multi-valuedness of ). Because itself jumps by every time you cross a chosen ray (say the negative- axis), jumps by across that ray. So is not single-valued on a loop around the origin — it is defined up to a branch cut, a line we agree not to cross so that (and hence ) stays single-valued on the rest of the plane. Why this step? Ignoring the cut would let you "prove" returns to itself after a full loop, contradicting the flux result below.
  5. Flux over a full loop. . Why this step? Flux between streamlines is the difference; over a whole circle that difference is exactly the source strength — and it is nonzero precisely because jumps by across the cut.

Verify: with : , , and . Check ✓. Circles (equipotentials) meet radial spokes (streamlines) at — orthogonality holds in every quadrant, and the -jump of across the cut matches the total outflow.


Ex 7 — Cell G: irrotational vortex, limiting behaviour

Figure — Stream function, velocity potential

Read the figure first: now the magenta circles are the streamlines — fluid swirls round and round — and the violet dashed spokes are the equipotentials. It is the exact mirror image of the source: what were streamlines there are equipotentials here, and vice versa. The small arrows on the circles show the swirl sense; the orange core at the centre is where the speed blows up.

Forecast: it swirls — surely it has vorticity? (Watch the surprise.)

  1. Build . Here . Why this step? Now the angular velocity component is nonzero, so depends on .
  2. Build . . Why this step? The polar relation for the swirl component carries a minus, mirroring .
  3. Vorticity — the twist (shown, not asserted). In polar coordinates the out-of-plane vorticity of a purely azimuthal field is With and (a constant in ), we get , so for every . It is irrotational everywhere except the origin, where all the circulation is concentrated. This is the opposite of Ex 4's solid-body rotation, which was rotational everywhere. Why this step? It exposes the subtlety: swirling flow can still be irrotational — and now we've earned it with the polar curl formula.
  4. The branch-cut (multi-valuedness of ). Here it is that carries the : it jumps by across the chosen cut. So the potential is multi-valued, defined up to a branch cut, exactly mirroring in the source case. That jump is the circulation around the origin.
  5. Limits (from the figure). As , the circles grow huge and (fluid barely moves far out). As , — the singular core marked in orange.

Verify: with : , . Circulation around any loop enclosing the origin ✓, matching the -jump across the cut. Note equipotentials const are radial spokes and streamlines const are circles — exactly swapped vs the source (Ex 6). This source↔vortex swap is a favourite flow-net duality.


Ex 8 — Cell H: real-world flux word problem

Forecast: guess the number from "speed × width" before using .

  1. Identify the speed. , . Why this step? Differentiate to recover the actual velocity — that's what the water is doing.
  2. Flux . (per unit depth). Why this step? The whole point of : the difference between two streamline values is the volumetric flow between them — no integration needed.

Verify (units + physics): ✓. Units are area/time (2D "flow rate per unit depth") — consistent. Multiply by a channel depth of, say, to get a true volume rate .


Ex 9 — Cell I: exam twist — recover the other scalar & prove orthogonality

Forecast: does a even exist here? What velocity does hide?

  1. Extract velocity. , . Why this step? always encodes velocity via the cross-with-minus recipe.
  2. Check both conditions. Divergence ✓ ( guarantees this). Curl ✓ ⇒ exists. Why this step? You must earn the right to a before hunting for it.
  3. Build . ; . So . Why this step? Integrate one C–R equation, fix the leftover with the other.
  4. Orthogonality at . ; . Dot product ✓. Why this step? Zero dot product ⇒ the -line and -line cross at there.

Verify: recompute from : ✓, ✓ — matches step 1. Both scalars satisfy Laplace: , ✓. Every cell of the matrix is now covered.


Recall One-line summary of the matrix

Run divergence gate (→ ) and curl gate (→ ) first; integrate the surviving scalar with the cross/straight recipe; sign of a component flips the flux sign; polar singularities blow up at ; the -carrying scalar jumps by its strength across a branch cut; source and vortex are mirror images of each other.

Answer these before moving on:

Which test gates the existence of ?
The divergence test .
Which test gates the existence of ?
The curl (vorticity) test .
Flux between streamlines
(sign included).
Source vs vortex — what swaps?
Streamlines and equipotentials swap roles (spokes ↔ circles).
Why is the source multi-valued?
Because jumps by across a branch cut, so jumps by — that jump equals the total outflow.