Flows and fields

The one number that runs out at three dimensions

A stream function is one function where the velocity is two, and four essays here are built on it. It exists because the divergence vanishes, it is single-valued only if nothing inside is making fluid, and in three dimensions it is not one function at all.

Worth reading first: One function instead of two · The number on a streamline is a flow rate.

A plane incompressible flow can be described by a single scalar ψ\psi with

u=(ψ/y, ψ/x).\mathbf u = (\partial\psi/\partial y,\ -\partial\psi/\partial x).

One function instead of two. Streamlines for free, as its level sets. The difference between two of its values is the volume flux between them, by any route. It is the most economical object in the subject and this collection has four essays built on it.

It is also the one piece of machinery here that does not survive contact with three dimensions, and this essay is the three ways it fails — each of which is a hypothesis that is usually left unstated.

It exists because the divergence vanishes

ψ\psi is built by integrating

ψ(B)ψ(A)=AB(udyvdx)\psi(B) - \psi(A) = \int_A^B (u\,\mathrm dy - v\,\mathrm dx)

along a path. That is a definition only if the answer does not depend on the path, and the difference between two paths is exactly the divergence enclosed between them — Green’s theorem, with nothing else in it.

So the existence of a stream function is the statement that the flow is incompressible, and it fails the moment the flow is not. Take a smooth source in a uniform stream and walk two routes between the same two points: they differ by 1.09711.0971, and the area integral of u\nabla\cdot\mathbf u over the rectangle between them is 1.09711.0971. The same pair of routes in the divergence-free flow past a cylinder differ by 4×10154\times10^{-15}.

Two routes to the same point, and the divergence between them. The stream function is built by integrating a line integral of the velocity from one point to another, and it is only a function of position if the answer does not depend on the route. The two routes drawn here differ by exactly the divergence enclosed between them: 1.0971 by the line integrals, 1.0971 by an area quadrature of ∇·u over the rectangle. Where the field has no divergence the two routes agree to 10⁻¹⁵ and the stream function exists; where it has one, there is no such function.
Fig. 1 Two routes between the same two points, with the divergence between them shaded. They differ by exactly the enclosed divergence, and where there is none they agree to 10⁻¹⁵.

A point source, incidentally, makes the wrong demonstration: the two routes differ by exactly the source strength while the area integral of the divergence comes out at 10510^{-5}, because a point source has zero divergence everywhere the quadrature looks and all of it at one point the quadrature never lands on. That is the sort of trap smoothness assumptions set for a grid, and the blob used here exists to avoid it.

And it is single-valued only if nothing inside is making fluid

There is a second hypothesis, and it is about the shape of the region rather than the field in it.

A flow can be divergence-free everywhere in the fluid and still have a source inside a body. Walk once round the body and ψ\psi does not return to where it started: it has risen by the strength of the source, because that is the volume of fluid being made inside per unit time and all of it has to cross the loop.

Measured for a source of strength 1.31.3 in a stream, the jump round a loop of radius 1.41.4 is 1.30000001.3000000. A loop enclosing nothing closes to 2×10142\times10^{-14}.

The stream function walked once round a source. The value of ψ accumulated along a loop enclosing a source, against the angle round the loop. It does not return to where it started: it has risen by exactly the source's strength, because that is the volume of fluid being made inside per unit time and all of it has to cross the loop. So even where a stream function exists locally, it is single-valued only if the region has no hole with a net flux through it — and a body that emits fluid is such a hole. A loop enclosing nothing closes to 10⁻¹⁴.
Fig. 2 ψ accumulated along a loop enclosing a source. It does not come back, and the discrepancy is the source strength — the same number whatever the radius of the loop.

A contour plot of such a ψ\psi has a branch cut in it, and no amount of care in the plotting removes it. This is not an exotic case: the half-body and the Rankine oval are built from sources, and their stream functions are single-valued only because the total source strength inside any closed streamline is zero.

The multivalued case that matters

The version of this that is not about sources is the one this collection has already spent a field on.

On a domain with a hole, the harmonic freedom helmholtz identifies is one number per hole, and for a divergence-free flow that number is the circulation. So the same jump appears for a vortex: ψ\psi is single-valued but ϕ\phi is not, and walking round a lifting body changes the velocity potential by Γ\Gamma.

That is why the circulation round a wing is not settled by anything local: it is a topological freedom of the domain, and no amount of interior physics fixes it. The stream function and the potential swap roles between the source case and the vortex case, and which of them is multivalued is decided by whether the hole is emitting fluid or circulating it.

The version that survives compressibility, and what it costs

The existence argument above is that ψ\psi can be integrated because u=0\nabla\cdot\mathbf u = 0, so a compressible flow appears to have none. It has one, and the exchange it makes is instructive because it breaks the same reading in a third way.

For steady flow the conserved quantity is not the volume flux but the mass flux, and continuity says (ρu)=0\nabla\cdot(\rho\mathbf u) = 0. That is a divergence-free vector field, so it has a stream function of its own:

ρu=ψy,ρv=ψx.\rho u = \frac{\partial\psi}{\partial y},\qquad \rho v = -\frac{\partial\psi}{\partial x}.

Everything formal survives. Level sets are streamlines, the difference between two of them is path-independent, and the compressible field is carried by one scalar exactly as the incompressible one was.

Two things are given up. Steadiness is now a hypothesis, where the incompressible version needed none: an unsteady compressible flow has ρ/t0\partial\rho/\partial t \neq 0, the mass flux is not divergence-free, and no stream function exists at all. And Δψ\Delta\psi is a mass flux, so

ψ=ρq,|\nabla\psi| = \rho q,

and crowded streamlines mean a large mass flux per unit area rather than a large speed.

That reverses the naive reading exactly where the compressible field is most interesting. The mass flux per unit area of an isentropic flow rises with Mach number, reaches its maximum at Mach one, and falls thereafter — which is the same statement as a nozzle choking at its throat, read as a density rather than as an area.

So along a converging–diverging nozzle the streamlines crowd together as the flow accelerates towards sonic, are at their tightest exactly at the throat, and then spread apart again while the flow keeps accelerating. A reader taking spacing for speed would report the supersonic section as decelerating. It is not a small error or a distortion; the derivative has the wrong sign over the whole downstream half.

Which makes three separate ways the same picture misleads, and they are worth keeping distinct. In an axisymmetric plot the offender is the metric — the annulus grows with radius. In a swirling flow the offender is a component the projection cannot hold. In a compressible flow the offender is the density, and the scalar being contoured was never measuring a velocity in the first place.

Only the plane, incompressible, non-swirling case supports the reading everybody makes, and it is the case every textbook figure is drawn in.

The axisymmetric one is a different object

What is usually offered for three dimensions is the Stokes stream function, for axisymmetric flow. For ideal flow past a sphere,

ψ=12Usin2θ(r2a3r),ur=1r2sinθψθ,uθ=1rsinθψr.\psi = \tfrac12 U\sin^2\theta\Big(r^2 - \frac{a^3}{r}\Big),\qquad u_r = \frac{1}{r^2\sin\theta}\frac{\partial\psi}{\partial\theta},\qquad u_\theta = -\frac{1}{r\sin\theta}\frac{\partial\psi}{\partial r}.

Differencing it reproduces the closed-form velocity to 101110^{-11}. It behaves like a stream function in every way a reader expects — its level sets are streamlines, and the difference between two of them is a flux.

But the factors of rsinθr\sin\theta in those relations are not decoration, and they change what the picture means.

Ideal flow past a sphere, drawn in a meridional plane. The Stokes stream function of ideal flow past a sphere, contoured at equal intervals. Its relations to the velocity carry factors of r sin θ that the plane stream function does not have, and differencing it reproduces the closed-form velocity to 10⁻¹¹. The surface speed at the equator is exactly one and a half times the free stream, against twice for a circular cylinder: a three-dimensional body lets the flow past in two directions rather than one.
Fig. 3 Ideal flow past a sphere in a meridional plane, contoured at equal intervals of ψ. The surface speed at the equator is 1.5U, against 2U for a circular cylinder.

That 1.51.5 against 22 is worth noticing on its own: a three-dimensional body lets the flow past in two directions rather than one, so it disturbs it less. It is the same observation axisymmetric makes about drag and separation, in its simplest form.

Reading a speed off the spacing

Here is what the factors cost. In the plane, ψ|\nabla\psi| is the speed, so crowded streamlines mean fast flow and the reading is exact. In an axisymmetric meridional plot,

ψ=qrsinθ,|\nabla\psi| = q\,r\sin\theta,

so the same reading is wrong by the distance from the axis. Measured on ideal flow past a sphere at seven points, the factor runs from 0.7670.767 to 4.0004.000 — and the identity holds to 101010^{-10}, so this is not an approximation being pointed out but a different quantity.

What streamline spacing says about the speed, and what the speed is. In a plane flow the magnitude of the stream function's gradient is the speed, so crowded streamlines mean fast flow and the reading is exact. In an axisymmetric meridional plot it is the speed times the distance from the axis, so the same reading is wrong by that factor — from 0.77 to 4.0 across a single figure of the flow past a sphere. Every one of these rows is the same picture read two ways.
Fig. 4 What streamline spacing says about the speed, and what the speed is. The last two columns agree to 10⁻¹⁰ and the ratio between them spans a factor of five across one figure.

Every meridional streamline plot in every textbook invites the plane reading. Near the axis the streamlines are far apart where the flow is fast, and far from it they are close together where the flow is slow, and both are the annulus’s area changing rather than the fluid doing anything.

The component the picture cannot show

The quietest failure is the last one. Take the sphere’s flow and add a line vortex on the axis, so that the fluid swirls as it goes past.

The azimuthal velocity has no component in the meridional plane. So ψ\psi is unchanged — to fifteen decimal places, which is to say identically — every meridional streamline is unchanged, and the picture is the previous figure exactly.

The particle paths are helices with nearly five turns in them.

A swirling flow whose stream function knows nothing about the swirl. Flow past a sphere with a line vortex on the axis. The azimuthal velocity has no component in the meridional plane, so the Stokes stream function is unchanged to fifteen decimal places and the streamline picture is the one on the previous figure, exactly. The particle path is a helix with nearly five turns in it. A meridional streamline plot of a swirling flow is a correct picture of a flow that is not the one being drawn.
Fig. 5 The same sphere with a line vortex on the axis. The meridional streamline is identical to the one in the previous figure; the particle’s own path is drawn beside it.

A meridional streamline plot of a swirling flow is a correct picture of a flow that is not the one being drawn. Nothing in it is wrong and nothing in it says that a third of the kinetic energy is in a component the plot has no way to represent. Every figure of a vortex breakdown, a cyclone separator, a swirl combustor or a turbomachine passage has this property.

Why three dimensions need two scalars

The reason is geometric rather than technical, and it is short.

A streamline is a curve. In the plane a curve is a level set of one function, so one scalar suffices and its level sets are the streamlines. In three dimensions a curve is the intersection of two surfaces, so two scalars are needed and the streamlines are the intersections of their level sets.

That is the Clebsch representation, u=χ×ψ\mathbf u = \nabla\chi\times\nabla\psi, and it exists locally. It does not exist globally in general — the obstruction is the helicity, uω\int\mathbf u\cdot\boldsymbol\omega, which vanishes for any flow with a Clebsch representation and does not vanish for a great many flows, including the exact steady solution the next essay is about.

How far one scalar goes. A stream function is one function where the velocity is two, and that economy is the reason four essays on this site are built on it. It is bought with a symmetry, and each row here spends more of that symmetry than the last. The last row is where it runs out: a curve in three dimensions is the intersection of two surfaces, so two scalars are needed, and the pair exists locally rather than globally.
Fig. 6 How far one scalar goes. Each row spends more of a symmetry than the last, and the last row is where it runs out.

What the economy was bought with

Stepping back: the stream function is one function instead of two, and the discount is paid for with a symmetry.

In the plane the symmetry is that nothing depends on zz and there is no ww. In axisymmetric flow it is that nothing depends on ϕ\phi and there is no uϕu_\phi — and the second half of that is the one the swirl example breaks. A flow can be axisymmetric and still have an azimuthal velocity, and then the Stokes stream function describes two of its three components and is silent about the third.

That is a much weaker statement than the flow is described by ψ, and it is what the phrase axisymmetric flow usually elides. Turbomachinery has a word for the distinction — the meridional flow against the whole flow — and the rest of the subject does not.

The stream function walked once round a source. The value of ψ accumulated along a loop enclosing a source, against the angle round the loop. It does not return to where it started: it has risen by exactly the source's strength, because that is the volume of fluid being made inside per unit time and all of it has to cross the loop. So even where a stream function exists locally, it is single-valued only if the region has no hole with a net flux through it — and a body that emits fluid is such a hole. A loop enclosing nothing closes to 10⁻¹⁴.
Fig. 7 The jump round a source, once more. It is the same failure as the swirl above seen from the other side: there the scalar was silent about a component, here it is not a function at all.

Two scalars, done properly, once

It is worth writing down what the three-dimensional object looks like when it does exist, because it explains why nobody uses it.

For a flow with a Clebsch representation, χ\chi and ψ\psi are both constant along streamlines, so a streamline is the intersection of a χ\chi-surface and a ψ\psi-surface. Both are transported by the flow, both are conserved, and the pair carries the whole field. That is a genuine generalisation and it has genuine uses: the vorticity is χ×ψ\nabla\chi\times\nabla\psi’s curl, which is χ×ψ\nabla\chi\times\nabla\psi differentiated, and several exact results in vortex dynamics are cleanest in these variables.

What kills it in practice is that the two surfaces are not determined by the flow. Any pair of functions of χ\chi and ψ\psi with unit Jacobian gives the same velocity field, so there is a whole infinite-dimensional family of representations of one flow — the same kind of freedom helmholtz finds in the potential-plus-curl split, in a different place. A plane stream function has no such freedom beyond an additive constant, and that uniqueness is most of what makes it useful.

So the honest ledger is: one scalar with no freedom in two dimensions; two scalars with an infinite freedom in three; and the discount that made the plane version worth learning does not survive.

What replaces it in practice

Since the object does not generalise, it is worth naming what three-dimensional work uses instead.

The velocity potential, where the flow is irrotational. That one does generalise: ϕ\phi is a single scalar in any number of dimensions, its gradient is the velocity, and the whole of three-dimensional ideal flow is written in it. The asymmetry is worth noticing — irrotationality is a condition on three components and gives one scalar in any dimension; incompressibility is one condition and gives one scalar only in two.

The vector potential, u=×A\mathbf u = \nabla\times\mathbf A, which exists whenever the flow is divergence-free and is three functions with a gauge freedom. It is what a spectral code for incompressible turbulence often works in, and it is the honest three-dimensional counterpart of ψ\psi — three scalars where the plane had one.

And streamtubes, which is what an engineer uses. A streamtube is a surface made of streamlines, and the flux through it is constant whether or not any scalar labels it. That is the property doing the work in every control-volume argument on this site, and it needs no stream function at all.

Ideal flow past a sphere, drawn in a meridional plane. The Stokes stream function of ideal flow past a sphere, contoured at equal intervals. Its relations to the velocity carry factors of r sin θ that the plane stream function does not have, and differencing it reproduces the closed-form velocity to 10⁻¹¹. The surface speed at the equator is exactly one and a half times the free stream, against twice for a circular cylinder: a three-dimensional body lets the flow past in two directions rather than one.
Fig. 8 The same flow at a higher free-stream speed. Every contour value scales and the pattern does not move, because ψ is linear in U — which is a property of the plane version too, and one of the few that survives.

The habit this leaves

Three things to do with a streamline figure, and this collection now does all three.

Say which scalar. Streamlines in a plane figure and meridional streamlines in an axisymmetric one are different objects, and the second is a projection.

Say whether the spacing means anything. In the plane it means the speed; in a meridional plane it means the flux through an annulus. A figure that wants a reader to read a speed off it should say which kind it is, and a figure of a swirling flow should say that the speed is not in the picture at all.

And say what the region is. A stream function on a domain with a hole in it needs the flux through the hole stated, because otherwise the contour values are only locally meaningful, and a reader integrating between two of them across the cut will get an answer that is short by exactly the source strength.

None of this is new physics. It is the same discipline this site applies to naming the model and the regime on every figure, extended to the object the figure is drawn from.

What is not in the velocity field

A symmetry, and where the region ends.

The existence of a stream function is the statement that the flow has enough symmetry for one scalar to carry it. The single-valuedness is a statement about the topology of the region. The reading of the spacing is a statement about the metric — the annulus’s area. None of the three is in the velocity field, and all three change what a streamline plot means.

The practical form: a streamline picture is a statement about a scalar, and which scalar depends on three things the picture does not show. That is the same warning flow-curves gives about streamlines and pathlines, one level up: not only is the curve not what a reader thinks, the spacing is not either.

What still works everywhere

To end on the useful half, because the object is a good one.

The flux interpretation survives all three failures, in the right form. In the plane, Δψ\Delta\psi is the volume flux between two streamlines per unit depth. In axisymmetric flow it is the flux through the annulus, divided by 2π2\pi. In both cases it is a conserved quantity, it is independent of the path taken between the streamlines, and it is what makes a streamtube a useful object at all.

And the level sets are always streamlines, whatever the spacing means. A meridional plot of a swirling flow shows the meridional streamlines correctly; the objection is to reading it as the whole flow, not to the curves in it.

The model limit

The stream function’s existence in the plane needs a simply-connected region and a divergence-free field, and this essay measures the cost of losing either. Its axisymmetric counterpart needs, additionally, an axis on which sinθ\sin\theta vanishes — where every relation above has a removable singularity, and where a numerical scheme built on the Stokes stream function has to be told what to do.

And nothing here says anything about the stability of the interpretation under approximation. A flow that is nearly two-dimensional does not have a nearly-single-valued stream function; it either has one or it does not, and the small out-of-plane component that breaks it may be the one carrying the physics — which is exactly the swirl case, at any swirl strength whatever.

What links here

Computed from the collection rather than written here: the essays that point at this one.

Reads more easily once this is understood

Essays that name this one as worth reading first.

Shares its objects with

Essays naming at least two of the same things, that neither author linked.

Named objects

A dashed tag is an object no other essay names yet.

AxisymmetricBoundary conditionDivergenceFlow visualisationHelmholtz decompositionMass conservationModel limitSourceStreamfunctionStreamlineSymmetryVelocity potential