Flows and fields

The number on a streamline is a flow rate

Streamlines get drawn as decoration — curves the flow follows, spaced however the plotting looked best. Each one carries a number, the difference between two of those numbers is the volume of fluid passing between them every second, and it does not matter what route the measurement takes.

Worth reading first: Mass has nowhere to go.

A picture of a flow is nearly always a picture of streamlines, and nearly every such picture is drawn with the curves at whatever spacing looked best. That habit throws away the most useful thing about them.

A streamline is a level set of a function, and the value of that function on the curve is not a label chosen for convenience. It is a flow rate. The difference between the numbers on two streamlines is the volume of fluid passing between them every second — exactly, not approximately, and regardless of where between them the measurement is taken.

The number on a streamline is a flow rate. Two streamlines and a crooked line drawn between them. The volume of fluid crossing that line every second, integrated from the velocity field, is the difference between the two streamfunction values at its ends — which is what makes a streamline a label rather than merely a curve.
Fig. 1 Two streamlines and a line drawn between them. The volume crossing that line every second, integrated from the velocity field a point at a time, is 1.56144. The difference between the two streamfunction values at its ends is 1.56144.

What the function is

For a two-dimensional incompressible flow, mass conservation says that u/x+v/y=0\partial u/\partial x + \partial v/\partial y = 0 everywhere. That is one constraint on two functions, and the standard move is to satisfy it identically by writing both velocity components as derivatives of a single scalar:

u=ψy,v=ψxu = \frac{\partial \psi}{\partial y}, \qquad v = -\frac{\partial \psi}{\partial x}

Substituting those into the constraint gives 2ψ/xy2ψ/yx\partial^2\psi/\partial x \partial y - \partial^2\psi/\partial y \partial x, which is zero for any ψ\psi whatever. So the constraint is not solved — it is dissolved. Mass conservation stops being an equation and becomes a property of the representation, which is a large part of why this function is worth having.

The curves of constant ψ\psi are streamlines. That follows in one line: along such a curve dψ=(ψ/x)dx+(ψ/y)dy=vdx+udy=0d\psi = (\partial\psi/\partial x)\,dx + (\partial\psi/\partial y)\,dy = -v\,dx + u\,dy = 0, so dy/dx=v/udy/dx = v/u, which is the definition of a streamline.

Why the value is a flow rate

Take any curve from a point A to a point B and ask how much fluid crosses it. The flux is the integral of the velocity component normal to the curve, and writing the velocity in terms of ψ\psi turns the integrand into an exact differential. The integral collapses to the difference of the endpoint values:

ABunds=ψ(B)ψ(A)\int_A^B \mathbf{u}\cdot\mathbf{n}\,ds = \psi(B) - \psi(A)

Everything about the curve between A and B has vanished from the answer. Only the ends survive.

That is a strong enough claim to be worth testing rather than deriving twice, and it has a consequence a figure can show: since the answer depends only on the endpoints, the route may be as perverse as it likes.

The number on a streamline is a flow rate. Two streamlines and a crooked line drawn between them. The volume of fluid crossing that line every second, integrated from the velocity field, is the difference between the two streamfunction values at its ends — which is what makes a streamline a label rather than merely a curve.
Fig. 2 The same two endpoints, joined by a route that goes down under the cylinder, out to the right, and back over the top. It crosses the flow in three places, in different directions, at different speeds. The flow rate along it is 1.56144.

What the solver computed, and how it was checked

The flux was computed by a midpoint rule: the path is chopped into thousands of pieces, the velocity is evaluated at the centre of each piece, its component along the normal is taken, and the products are added. The streamfunction difference was computed by evaluating a closed-form expression at two points. The two calculations share no line of code, and the second one never touches the field between the ends.

One detail of that check is worth recording, because it is the sort of thing that produces a confident wrong answer. The flux integral needs a normal, and there are two of them: the one to the left of the direction of travel and the one to the right. Taking the left-hand normal makes the identity read ψ(A)ψ(B)\psi(A) - \psi(B) instead of ψ(B)ψ(A)\psi(B) - \psi(A), so the first version of the check compared 2.804444 against −2.804444 and reported the two as 200% apart. That is a kind failure — the numbers were visibly the same up to a sign — but a check with a tolerance of ten per cent rather than a printout would simply have said fail, and a check written the other way round, with the flux taken as an absolute value, would have said pass while measuring nothing.

Three routes were run between the same pair of points: a straight line, a two-leg dog-leg over the top, and a three-leg path around the far side of the body. They give 1.561436, 1.561436 and 1.561436. The build asserts the agreement, and it also asserts the converse: handing the check a streamfunction scaled by 1.02 — still a perfectly good streamfunction, just not for this flow — makes it refuse.

The other quantity worth checking is the body. In this flow ψ\psi is exactly zero on the entire surface of the cylinder, at every angle round it, to the last digit the arithmetic carries. That is not a coincidence and not something the solver was told: the surface is a streamline, and every streamline is a level set. A body in ideal flow is a contour, and the reason nothing flows through it is that no flux can cross a curve on which ψ\psi does not change.

A Rankine oval. A source and a sink of equal strength, set a short distance apart in a uniform stream. Everything the source emits is swallowed by the sink, so the dividing streamline closes on itself and the result is a finite body. Its outline was found by solving for where the streamfunction is zero, not by drawing an oval.
Fig. 3 A source and a sink in a stream, and the closed body they produce. Nothing was placed in the fluid: the outline is where ψ\psi takes one particular value, and it behaves like a wall because the flow rate across it is the difference between that value and itself.

A body whose width is a flow rate

The clearest demonstration that these numbers are flow rates rather than labels is a body whose size can be predicted before it is drawn.

Put a source of strength mm into a uniform stream UU. The source emits mm units of volume per second and has nowhere to put them: the stream carries everything downstream, so far behind the source there is a slab of fluid, all of it having come out of the source, sandwiched between the oncoming stream above and below. That slab has to be wide enough to carry mm per second at speed UU, so its total width is m/Um/U and its half-width is m/2Um/2U.

For m=1m = 1 and U=1U = 1 that is 0.5, and it is a prediction about a picture nobody has drawn yet.

Traced numerically, the surface reaches 0.49984 by the far end of the drawn domain and approaches 0.5 from below thereafter. The nose sits at −0.15915, which is m/2πU-m/2\pi U to five figures. Neither number was put into the construction: the outline is found by solving ψ=0.5\psi = 0.5 for yy, and the agreement is between a root-finder and an argument about flow rates.

Crowded streamlines, and the rule that is nearly right

The schoolroom version of all this is that streamlines close together mean fast flow. That is very nearly true and it is worth being exact about how nearly, because the gap is where the misreadings live.

What is exactly true is that the flow rate between two given streamlines is the same everywhere. Where the pair pinches together, the same volume has to get through a narrower gap per second, so the average speed across the gap must rise. What is not exactly true is that the gap times the speed at the middle of the tube equals the flow rate, because the speed varies across the tube.

A streamtube narrows and the flow speeds up. Two neighbouring streamlines bound a tube that no fluid crosses. Where the tube pinches, the same mass has to pass through a smaller gap every second, so it must move faster — which is mass conservation with no equations in sight.
Fig. 4 Two neighbouring streamlines forming a tube, with the local speed marked at four stations. The tube narrows over the shoulder of the body and the flow inside it speeds up, which is mass conservation with no equation in sight.

Measured on this flow, the streamlines through ψ=0.62\psi = 0.62 and ψ=0.78\psi = 0.78 bound a tube whose exact flow rate is 0.16 by construction. Multiplying the gap by the speed at the centre of the tube gives 0.1609 at two and a half radii upstream, 0.1695 closer in, 0.1658 nearer the shoulder and 0.1599 above it. The rule is good to about six per cent here, and it becomes exact only in the limit of a tube thin enough that the speed does not vary across it.

Two further cautions come with the reading. In three dimensions there is no streamfunction of this kind at all, so the spacing of streamlines in a perspective drawing of a three-dimensional flow carries no such guarantee. And in a compressible flow the conserved quantity is ρu\rho u rather than uu, so streamlines can crowd because the density fell rather than because the speed rose — which is precisely what happens once the Mach number is appreciable.

The other function, and why they come in pairs

For an irrotational flow there is a second scalar, the velocity potential, whose level sets cross the streamlines at right angles. The pair is one analytic function of a complex variable, and that is what makes the whole apparatus of conformal mapping available — the circle that becomes a wing works because the map carries the orthogonal net intact.

But the streamfunction is the more robust of the two. It requires only that mass is conserved. The potential requires that the flow is irrotational as well, which is a much stronger condition and one that fails inside every boundary layer and every wake. A viscous solve of the kind this site runs at Reynolds number 40 has a perfectly good streamfunction — the solver is written in terms of it — and no velocity potential anywhere near the body.

Flow net — a stream past a cylinder. Two families of curves drawn over the same flow: the streamlines, along which the streamfunction is constant, and the equipotentials, along which the velocity potential is constant. They cross at right angles at every point, because they are the two parts of a single analytic function of position.
Fig. 5 The streamlines alone, drawn at equal intervals of ψ\psi. Equal intervals means equal flow rates, so the spacing in this picture carries information: it is the only honest way to draw a set of streamlines, and it is not what most published pictures do.

The function the viscous solver actually advances

Everything so far has been about an exact, inviscid flow, where ψ\psi is a convenience. In the numerical half of this site it is not a convenience: it is the variable being solved for.

The stepper used for every viscous figure here works in vorticity–streamfunction form. It advances the vorticity in time, then recovers the streamfunction by solving a Poisson equation 2ψ=ω\nabla^2\psi = -\omega, and finally reads the velocity off as derivatives of ψ\psi. The reason for that arrangement is exactly the property this essay is about. Because the velocity is constructed as derivatives of a scalar, it is divergence-free by construction — mass is conserved because of the shape of the representation, not because an iteration drove a residual to zero.

The alternative, solving for pressure and velocity directly, spends most of the computer’s time enforcing the very constraint that the streamfunction makes free. On a build that has to render two hundred figures in under a minute, that difference is the difference between a site and a research code.

Reading a published picture

Three questions settle whether a streamline picture in a book or a paper is carrying information or decoration, and all three can be asked from the page.

Are the levels equally spaced? If the caption or the axis says so, the spacing means flow rate, and a narrow gap is a fast region. If the curves were produced by releasing tracers from hand-chosen points — which is what most plotting libraries do by default — the spacing means only where somebody clicked.

Is the flow steady? If it is not, the curves are an instant’s worth of tangents and no particle follows them. A caption that says streamlines over an unsteady flow and then talks about where the fluid goes is describing a curve that does not exist.

Is it two-dimensional and incompressible? If either fails, the flow-rate interpretation fails with it. An axisymmetric picture needs Stokes’ streamfunction and a factor of 2πr2\pi r; a compressible one conserves ρu\rho u and can crowd its streamlines for a reason that has nothing to do with speed.

Streamlines and pathlines are not the same curve. In an unsteady flow the line tangent to the velocity everywhere at one instant, and the track a single particle actually follows, are different curves. They coincide only when the flow is steady, which is the hypothesis most figures forget to state.
Fig. 6 Three families of curve through one unsteady flow, which coincide only when nothing depends on time. The streamline family is the one carrying the flow rate; the other two carry the history of individual particles, and no value of ψ\psi labels them.
The velocity field, arrows all one length. The same flow drawn as arrows. Scaled to the local speed the picture is honest and crowded; drawn all the same length it is legible and hides the very variation the figure is about.
Fig. 7 The same field with the arrows all drawn one length, which is how a great many published flow pictures are drawn. The pattern survives and the speeds do not, so the streamfunction differences this essay is about cannot be recovered from it — a picture of the streamlines is not a picture of the flow rates between them unless the spacing is left honest.

A streamline is a wall, and that has consequences

Read the identity with both endpoints on the same curve and the flow rate is the difference of a number with itself: zero. No fluid crosses a streamline, ever, in a steady flow. That is the reason a level set can serve as a solid body, and it is much stronger than the body case makes it look, because the same statement applies to every streamline in the picture and not only to the one that happens to be drawn as a surface.

So a steady two-dimensional flow is partitioned by its streamlines into regions that never exchange fluid. In the half-body figure the dividing curve separates everything the source ever emitted from everything the free stream brought, permanently: two bodies of fluid sliding past one another with a boundary that no particle crosses, held apart by nothing but arithmetic.

The consequence worth carrying is what happens where a streamline closes on itself. The standing recirculation behind the cylinder at Reynolds number 40 is bounded by the streamline carrying the body’s own value, so in the steady picture that pocket contains the same fluid forever. Whatever is in it arrived during the transient that set the flow up and has no way out.

That is why a separated region is where heat accumulates, where a contaminant concentrates, and where a reaction runs to completion — the residence time is not set by the flow at all, because nothing is flowing through. Anything entering or leaving must diffuse across the dividing streamline, and diffusion across a length is slow in exactly the way advection is not.

The escape is unsteadiness. A real wake wobbles, the dividing streamline is not the same curve from one instant to the next, and fluid is exchanged briskly — which is invisible in any time-averaged picture, where the bubble reappears looking sealed.

The velocity field, arrows to scale. The same flow drawn as arrows. Scaled to the local speed the picture is honest and crowded; drawn all the same length it is legible and hides the very variation the figure is about.
Fig. 8 And the field itself, for comparison. Everything this essay counts is an integral of these arrows across a line; the streamfunction is a bookkeeping device that makes those integrals differences of a label, and it adds no information the arrows do not already carry.

What the picture cannot show

A streamline picture with equal ψ\psi spacing shows the flow rate faithfully and still hides two things.

It hides direction of travel in time. Streamlines are not the paths particles take unless the flow is steady, and in an unsteady flow the level sets of ψ\psi are an instantaneous snapshot whose curves no particle ever follows.

It hides everything about the pressure. Two flows with identical streamline patterns can have quite different pressure fields if one of them is rotational, because Bernoulli’s constant is then constant only along each streamline rather than throughout. The picture is a statement about mass, and about nothing else.

Where the model stops

The construction assumes two dimensions and constant density, and both restrictions are real.

In axisymmetric flow there is a substitute — Stokes’ streamfunction — but it is not the same function, and the flux it carries has a factor of 2πr2\pi r in it, so the equal-spacing rule reads differently. In a genuinely three-dimensional flow there is no scalar whose level sets are the streamlines at all; the best available object is a pair of functions whose intersection gives the streamlines, and nobody draws those.

For compressible flow the natural object is the mass streamfunction, defined so that ρu=ψ/y\rho u = \partial\psi/\partial y. It still carries a flow rate, but of mass rather than volume, and the spacing then says nothing about speed on its own.

Why nobody quotes it this way

Given that the interpretation is exact, free, and older than aerodynamics, the odd thing is how rarely it is used. Three reasons, and they compound.

The first is that most flow pictures are now made by software that seeds tracers rather than contours a scalar. Seeding is the natural thing to do when the field arrives as a table of velocities from a measurement or a large simulation, and there may be no streamfunction available at all — in three dimensions there is not one to have. What the software then draws is a set of integral curves, correct as curves and carrying nothing in their spacing.

The second is that the quantitative reading is a two-dimensional privilege, and the flows people care about are three-dimensional. It is easier to teach a rule that always half-applies than one that is exact in a special case and absent outside it.

The third is that the exact statement is about a flow rate and the intuition people want is about speed. Those coincide only for a thin tube, as the numbers above show, and the honest version needs the qualification. A rule with a qualification loses to a rule without one, every time, and the cost is a century of pictures whose most informative property was thrown away in the drawing.

Who found it, and when

The streamfunction is Lagrange’s, from 1781, and it was introduced for exactly the purpose it still serves — reducing two unknowns satisfying one constraint to one unknown satisfying none. Rankine gave it its modern prominence in the 1860s while building bodies out of sources and sinks, which is the construction the third figure here shows and the reason the oval carries his name.

The habit of drawing streamlines at equal increments of ψ\psi, so that the picture is quantitative, is also Rankine’s. It has been steadily abandoned since, mostly because plotting software chooses seed points rather than contour levels, and the result is a century of published flow pictures whose line spacing means nothing at all.

Where the ladder goes next

The rung below this is mass having nowhere to go, which is the same conservation law before it has been turned into a function. Beside it sits the flow net, which adds the second scalar and the right-angle property.

Above it, the streamfunction stops being a convenience and becomes the working variable: the viscous solver on this site advances vorticity and recovers velocity by solving a Poisson equation for ψ\psi, which is why circulation and vorticity can be compared against each other on a solved field at all.

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.

ContinuityDivergenceDividing streamlineFlow visualisationIncompressibleMass conservationPotential flowStreamfunctionStreamlineStreamtube