Flows and fields

A rate of change that will not hold still

Three boxes drawn in one flow at one instant give three different answers to how fast the dye inside them is changing — one falling, one falling twice as fast, one rising. All three reconcile with a single material rate, and that rate is zero.

Worth reading first: Mass has nowhere to go · Steady does not mean nothing is happening.

Almost every reliable result in this subject is an accounting over a control volume, and every one of them opens with a step that ordinary notation writes twice in the same symbols and means differently each time.

For a quantity of density ff and a material volume V(t)V(t) — the same fluid, always, however it is being pulled about —

ddtV(t)fdV  =  V0ftdV  +  S0f(un)dS,\frac{\mathrm d}{\mathrm dt}\int_{V(t)} f\,\mathrm dV \;=\; \int_{V_0}\frac{\partial f}{\partial t}\, \mathrm dV \;+\; \oint_{S_0} f\,(\mathbf u\cdot\mathbf n)\,\mathrm dS,

where V0V_0 is the fixed region the material volume happens to occupy at that instant. The left side follows the fluid. The first term on the right is what an observer watching a fixed box measures. The second is what crosses its faces.

Put f=ρf = \rho and it is continuity. Put f=ρuf = \rho\mathbf u and it is the momentum theorem every force on this site is computed with. Put f=ρ(e+12u2)f = \rho(e + \tfrac12u^2) and it is the energy equation. The three founding accountings of fluid mechanics are one identity with three integrands.

One identity, four integrands. The transport theorem relates the rate of change of a quantity following the fluid to the rate an observer at a fixed box measures plus what crosses its faces. Putting the density in it gives continuity; the momentum density gives the theorem every force on this site is computed with; the energy density gives the energy equation. The three founding accountings of the subject are one statement with three integrands, and the only thing that changes between them is what is being counted.
Fig. 1 One identity, four integrands. Nothing changes between the rows except what is being counted.

The thing that is not in the flow

The identity is usually presented as a derivation, and the derivation obscures what it is for. The rule the essays around this one are written to asks each to name the piece of information its answer needs which the velocity field does not contain, and here it is unusually blunt: the volume.

The material rate on the left is a property of the fluid. Every other rate on the page is a property of a region somebody chose. A control volume moving at any velocity w\mathbf w gives

ddtVw(t)fdV  =  ftdV  +  f(wn)dS,\frac{\mathrm d}{\mathrm dt}\int_{V_w(t)} f\,\mathrm dV \;=\; \int\frac{\partial f}{\partial t}\, \mathrm dV \;+\; \oint f\,(\mathbf w\cdot\mathbf n)\,\mathrm dS,

so the same quantity in the same flow is increasing, decreasing or constant depending on how the box is moved. That is not a subtlety about signs. It is the difference between an experiment that reports a loss and one that reports a gain.

A flow to measure it in

The demonstration wants a flow that is genuinely unsteady and a quantity that is exactly conserved, so that nothing on the page has to be trusted.

Take a straining flow u=(α(t)x,α(t)y)\mathbf u = (\alpha(t)x, -\alpha(t)y) with α\alpha oscillating by eighty per cent about its mean. It is incompressible, it is unsteady rather than steady in disguise, and its displacement is available in closed form. Put a blob of dye in it, defined as a Gaussian in the initial coordinates, so that Dc/Dt=0\mathrm Dc/\mathrm Dt = 0 by construction rather than by a solver.

A material region, and the dye that stays inside it. The same fluid at four times, carried by an unsteady straining flow whose strain rate oscillates. The outline is a circle of the fluid at the first instant, tracked by integrating the velocity field; the shading is a blob of passive dye. The region is stretched to nearly seven to one and its area is unchanged to fifteen decimal places, because the flow is incompressible. The amount of dye inside it is unchanged to thirteen, because the dye is carried by the same fluid.
Fig. 2 The same fluid at four times. The outline is a circle of the fluid at the first instant, tracked by integrating the velocity field; the shading is the dye. The region reaches an aspect ratio of nearly seven to one and its area does not move.

What a material region keeps

Carry the quadrature nodes of a disc through the field with a fourth-order Runge–Kutta step and sample the dye wherever they arrive. Track the boundary the same way and measure the area it encloses with the shoelace formula. Neither computation is told the answer.

The dye inside drifts by one part in ten million million. The area drifts by seven parts in a thousand million million. And the region has been stretched to 6.65 to 1 over the same interval, so neither number is flat because nothing happened.

What a material region keeps while it is being torn apart. The dye inside a material region and the area of that region, both divided by their values at the start. The region's aspect ratio reaches nearly seven to one over the same interval. Both curves are flat to within a part in a million, and neither is arranged to be: the contents are computed by carrying quadrature nodes through the velocity field and sampling the dye wherever they arrive, and the area by the shoelace formula on the tracked boundary.
Fig. 3 The dye and the area, each divided by its value at the start. Both flat to within a part in a million, while the region’s aspect ratio rises through seven.

Those are two different statements and it is worth keeping them apart. The area is constant because the flow is incompressible — it is the determinant of the flow map, and it is one. The dye is constant because the dye is carried and the area is constant; a scalar with a source in it would not be, and neither would a passive scalar in a compressible flow.

A material region, and the dye that stays inside it. The same fluid at four times, carried by an unsteady straining flow whose strain rate oscillates. The outline is a circle of the fluid at the first instant, tracked by integrating the velocity field; the shading is a blob of passive dye. The region is stretched to nearly seven to one and its area is unchanged to fifteen decimal places, because the flow is incompressible. The amount of dye inside it is unchanged to thirteen, because the dye is carried by the same fluid.
Fig. 4 A smaller material region in the same flow, at the same four times. It reaches the same aspect ratio, because the stretching is a property of the flow rather than of the patch.

The theorem, measured

Now draw a circle and hold it still. The dye inside it is falling. The material rate is zero. So the theorem, in this case, says

dIdt  =  c(un)ds,\frac{\mathrm dI}{\mathrm dt} \;=\; -\oint c\,(\mathbf u\cdot\mathbf n)\,\mathrm ds,

and the two sides share no arithmetic whatever. The left is a finite difference in time of an area integral over a disc; the right is a line integral round a circle.

The rate comes out at 0.35636022-0.35636022 and the flux at +0.35636022+0.35636022, leaving seven parts in a thousand million.

What the box loses, and what crosses its edge. A fixed circular region in the flow, with the dye shaded and the flux of dye across the boundary drawn as arrows — outward where the flow carries dye out, inward where it carries it in. The rate at which the dye inside the circle is falling and the net flux out of it are computed by routes that share no arithmetic: one is a difference in time of an area integral over a disc, the other a line integral round a circle. They sum to seven parts in a thousand million, which is the material rate, and it is zero.
Fig. 5 The fixed circle, with the dye shaded and the flux across the boundary drawn as arrows — outward where dye is leaving, inward where it is arriving. The net is the difference between two much larger numbers.

The arrows are worth looking at, because they say why the line integral has to be done rather than estimated. Dye is leaving over one arc and arriving over another, and the two nearly cancel: the net flux is a small residue of two large opposing flows, which is exactly the situation in which an argument by inspection goes wrong.

Three boxes, three answers

Now move the box. Three control volumes of the same size, at the same place, at the same instant, in the same flow, carried at three different velocities:

  • held still, the dye inside falls at 0.3560.356;
  • carried up and to the left, it falls at 0.5400.540;
  • carried down and to the right, it rises at 0.1570.157.

Each rate reconciles with the flux of the relative velocity uw\mathbf u - \mathbf w across its own boundary, to two parts in a hundred million. All three reconcile with one material rate, which is zero.

Three boxes in one flow, and three different answers. The same dye, the same flow, the same instant, and three control volumes moved three different ways. In the fixed box the dye is falling; in the box carried up and to the left it is falling nearly twice as fast; in the box driven down and to the right it is rising. Each rate reconciles with the flux of the relative velocity through its own boundary to within two parts in a hundred million, and all three reconcile with one material rate, which is zero. Whether the dye in the box is increasing is a question about the box.
Fig. 6 Three boxes in one flow. The arrow on each is the velocity it is being carried at. Two of them report that the dye is disappearing and one reports that it is accumulating.

The three numbers differ in sign, not merely in size, and that is the point. Is the dye in the box increasing? is not a question about the fluid.

Why the three answers are not a contradiction

It is worth being explicit about what reconciles them, because the arithmetic is where the intuition usually fails.

The material rate is zero: no dye is being made or destroyed anywhere, and a region made of the same fluid keeps the same amount for ever. The fixed box loses dye because the flow carries dye out of it faster than it carries dye in. The box carried up and to the left loses faster because it is moving away from the densest part of the blob, so it is emptying by its own motion as well as by the flow. And the box carried down and to the right gains, because it is moving into the blob faster than the blob is leaving it.

Each of those sentences is a statement about the box’s velocity relative to the fluid, and the identity is the statement written as an integral: what a box gains is what crosses its boundary at uw\mathbf u - \mathbf w, and nothing else. Set w=u\mathbf w = \mathbf u on the whole surface and the flux term vanishes identically, which is the material volume and is why its rate is the simple one.

There is no frame in any of this. All three boxes are drawn in one frame and the flow field is the same field for all three; what differs is only which fluid each of them contains from one instant to the next. That distinguishes this from the change of observer, where the field itself changes and the boxes could all be at rest.

What the mean of a rate is not

There is a habit this makes visible, and it is one this collection has already met from the other side.

An instrument at a fixed point records f/t\partial f/\partial t; an instrument riding with the fluid records Df/Dt\mathrm Df/\mathrm Dt; and the difference between them is uf\mathbf u\cdot\nabla f, which is not small and is not zero in a steady flow. That is exactly the observation acceleration opens with, applied to an integral rather than to a point: a steady flow past a cylinder has u/t=0\partial\mathbf u/\partial t = 0 everywhere and every parcel in it being violently accelerated.

The integral version has a further trap the point version does not. Averaging a flow produces a new object with its own properties, and averaging a rate produces a new rate whose meaning depends on which box the average was taken over. Two experiments reporting “the mean rate of change of scalar inside the measurement volume” have reported two different quantities if their volumes were mounted differently, and neither has reported the material rate.

A material region, and the dye that stays inside it. The same fluid at four times, carried by an unsteady straining flow whose strain rate oscillates. The outline is a circle of the fluid at the first instant, tracked by integrating the velocity field; the shading is a blob of passive dye. The region is stretched to nearly seven to one and its area is unchanged to fifteen decimal places, because the flow is incompressible. The amount of dye inside it is unchanged to thirteen, because the dye is carried by the same fluid.
Fig. 7 The same material region, started larger. The aspect ratio it reaches is the same, because the stretching is a property of the flow rather than of the patch, and the dye it keeps is again constant.

The identity that is really being used

One more reading, and it is the one that makes the theorem worth the trouble.

Almost every result on this site of the form “the force on this body is such and such” has the same shape: an unknown interior, a surface nobody needs to go near, and a conservation law that survives not knowing what is inside. Betz’s limit does not know what the turbine is. The Borda–Carnot loss does not know how the flow separates. The lift on a wing from a distant contour does not know what shape the wing is.

That robustness is the flux term. The material rate of a conserved quantity is zero or is a stated force, the interior contributes f/t\partial f/\partial t which vanishes in steady flow, and what is left is an integral over a surface the analyst chose. The theorem’s value is that it lets the analyst choose the surface, and the price is that the choice is then part of the answer — which is the whole content of the three boxes above.

The integrand of the flux, round the circle. The dye flux per unit length of boundary, against the angle round the fixed circle. It is positive where dye is leaving and negative where it is arriving, and the two nearly cancel — the net is the difference between two much larger numbers, which is why the line integral has to be done rather than estimated. Its total is what the area integral inside the circle is losing, and the two agree to seven parts in a thousand million.
Fig. 8 The flux integrand round that larger circle. The cancellation between the outgoing and incoming arcs is sharper still, which is why the net has to be integrated rather than estimated.

Which accounting a real problem wants

This is not a philosophical difficulty; it is a choice made every time somebody draws a box, and the right choice is usually forced.

A fixed box is what a wind tunnel gives, and it is why steady-flow control-volume analysis is so useful: with f/t=0\partial f/\partial t = 0 the first term on the right vanishes and the whole accounting becomes a surface integral. Every force this collection computes by momentum uses that.

A box moving with the body is what an aeroplane gives. The actuator disc is analysed in the disc’s frame, where the flow is steady, and the same problem in the frame of the still air is unsteady and much harder for no physical reason — which is an observation about frames rather than about transport.

A box moving with the fluid — a material volume — is what makes conservation laws simple, and it is almost never what an instrument gives. That mismatch is the reason the theorem exists.

And a box whose shape changes, which is the case a piston, a valve or a deforming blade needs. The identity holds with w\mathbf w varying over the surface; nothing above assumed the box was rigid.

Where the flux term is the whole answer

Two results in this collection are the flux term with everything else zero, and they are worth recognising as such.

The momentum theorem. For steady flow past a body, (ρu)/t=0\partial(\rho\mathbf u)/\partial t = 0, and the material rate of momentum is the force. So the force is entirely ρu(un)\oint\rho\mathbf u(\mathbf u\cdot \mathbf n) plus the pressure — a surface integral over a box that need not go anywhere near the body. That is why a force can be found without touching the surface it acts on, and it is why the sum usually offered for lift is wrong: the usual sum drops the pressure term on the sides of the box, which does not vanish.

Betz’s limit. The most a disc can take is a mass, momentum and energy accounting on one box with nothing assumed about the machine inside it. The whole result is three instances of this identity with three integrands and one control volume.

The general box is a numerical method

The version of the identity with an arbitrary w\mathbf w looks like a generalisation kept for completeness. It is in fact the governing equation of every computation with a moving boundary in it — a flapping wing, a closing valve, a turbomachine rotor passing a stator, a tank of liquid sloshing.

The reasoning is the essay’s own, applied to a mesh. A fixed grid cannot follow a moving wall without cells being destroyed and created at it. A grid carried at the fluid’s velocity follows the wall perfectly and then tangles itself within a few dozen steps, because the flow’s own straining does to the cells what it did to the disc in the figures above — an aspect ratio of seven, and then seventy. So the grid is moved at a velocity w\mathbf w that is neither: it matches the fluid at the moving wall, decays to zero far away, and in between is chosen purely to keep the cells well shaped. That choice has no physics in it whatever, and the identity above is what makes it legitimate: the accounting holds for any w\mathbf w, so the mesh may be moved for the analyst’s convenience provided the flux is taken at uw\mathbf u - \mathbf w.

And there is a trap in the discrete version that this essay has already named. A cell’s volume changes as its faces move, and the flux across each face is computed from the volume that face sweeps. Those are two separate calculations in a program, and if they are not consistent with each other the scheme generates a rate of change out of nothing — a uniform flow, with no gradients anywhere, is no longer preserved, because the cell’s bookkeeping says its contents changed by one amount and its faces say another.

The requirement that they agree is called the geometric conservation law, and it is a condition on the numerics rather than on the physics: it is the discrete statement that setting ff to a constant must return zero, which the continuous identity does identically. Schemes have been published that violate it, and their symptom is the one this essay has been about from the first paragraph — a rate of change that belongs to the box rather than to the fluid, reported as though it belonged to the fluid.

It is a satisfying place for the argument to end up. The theorem’s content is that the observer’s choice of region enters the answer; the corresponding numerical law is that a program which chooses its region carelessly will invent physics. Both are the same sentence, and the second one is testable in one line: run a constant field and see whether it stays constant.

The half that is Leibniz and the half that is not

It is worth separating the two things the identity is doing, because they have different status.

f/t\int\partial f/\partial t over a fixed region is the derivative of the integral, by Leibniz — pure calculus, true of any integrand over any fixed region, with no fluid in it. The flux term is where the physics is: it says that the material volume’s boundary is moving at the fluid’s velocity, which is the definition of a material volume and the only place the flow enters.

So the theorem is one line of calculus and one definition, and its content is the definition. That is worth saying because the derivation is usually presented as the difficult part, and it is not: the difficult part is noticing that two rates written d/dt\mathrm d/\mathrm dt are different rates.

The model limit

Everything above is exact for a smooth field and a smooth integrand, and both hypotheses can fail.

A shock is a surface across which ff jumps, and the area integral of f/t\partial f/\partial t is not defined on it. The identity then has to be stated with the discontinuity’s own velocity in it, which is how the Rankine–Hugoniot conditions are derived: they are this theorem applied to a box shrunk onto a surface across which the integrand is not continuous.

There is a second discontinuity of the same kind at a free surface or at a boundary between two states of matter, where the integrand is one thing on one side and something else on the other, and the boundary is neither material nor fixed but moves at its own kinematic velocity. That case is the reason the identity is stated with a general w\mathbf w rather than only for material and fixed volumes: the interface’s own velocity is what goes in, and it is an unknown of the problem rather than an input to it. A wall that is not quite there is the same difficulty met from the modelling side.

And the numerical demonstration here is only as good as its quadrature. The transport-theorem residual is 7×1097\times10^{-9}, and a midpoint rule at a thousand nodes would have had a quadrature error of the same size — so the check would have been measuring its own arithmetic and reporting it as physics. That is why the disc integrals here are Gauss–Legendre in radius and trapezoidal in angle, which is spectrally accurate for a smooth periodic integrand and is the reason the residual means anything.

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.

ConservationControl volumeDilatationEnergy equationEulerian and LagrangianMass conservationMaterial derivativeMeasurementModel limitMomentum fluxMomentum theoremTransport