An interactive companion to our paper:
A finite difference, we are all taught, approximates a derivative, and the approximation gets worse as the grid gets coarser. Here is a curve and a grid cell. Make the cell as wide as you like, move it around, and try to catch the finite difference making an error.
Try to make a finite difference wrong
- Difference of u across the cell, divided by h
- −2.96373
- Slope of the average u at x
- −2.96373
- Slope of u itself at x
- −6.86969
The first two are computed separately: one from the two end values of the curve, the other by differentiating the plotted average numerically. Here they differ by less than 10⁻⁹. Analytic demonstration, not experimental data.
The first two numbers agree for every curve, every position, and every cell width. Only the third one wanders off. So the finite difference is wrong about the slope of , as promised. But it is exactly right about something else, the slope of the cell average of :
This is the fundamental theorem of calculus, read from right to left. No is hiding in it, and it asks nothing of : pick the sawtooth, or draw something worse, and it still holds. A finite difference is the correct answer to a question you did not ask.
Schumann noticed this for finite volumes in 1975. I call it the filter-swap: a derivative that the grid cannot compute is traded for a difference that it can, and the price is that the field becomes its average. The grid does not blur the derivative. The grid is a filter.
The finite volume method makes no error
Take a conservation law, , where is the flux. For Burgers’ equation, . Average the equation over a cell and apply the swap:
where is the difference across a cell from the figure above. This is the finite volume method, and nothing has been approximated. The content of a cell changes by what crosses its two faces. The equation is already discrete in space, and still exact.
It is also useless as it stands, because the flux at the faces needs , and a coarse grid only carries . So a code replaces by a numerical flux , built from neighbouring cell averages. That replacement is the only approximation in the method, and what it throws away has a name:
Everything a coarse simulation gets wrong sits in , the residual flux. (In three dimensions it becomes a stress.) Look at what is inside it: , your scheme, interpolations and all. The discretization error is not a separate tax on top of the turbulence closure problem. It is part of the same term.
One residual, three reasons
Add and subtract, and comes apart into three differences, each with its own cause:
- Physics. Averaging does not commute with a nonlinear flux: the average of is not the square of the average. This is the classical subgrid stress, the object that sixty years of closure models, from Smagorinsky to neural networks, are aimed at.
- Your flux. The numerical flux is not the flux. A central scheme and an upwind scheme disagree here, and both disagree with .
- Your divergence. The swap wants the flux at the faces of a cell, and the classical term is built from the flux averaged over a cell width. This bracket is what it costs to replace by .
Classical large-eddy simulation keeps the first bracket and files the other two under numerical error, small if the grid is fine enough. Whether they are small is something you can check.
Watch it be exact
Below, a direct numerical simulation (DNS) of Burgers’ equation runs next to a coarse simulation with 45 times fewer cells. The bars are the cell averages of the DNS, which is the solution the coarse run is supposed to produce. The dots are the coarse run. It uses , and it is handed whichever brackets of you leave switched on, computed from the DNS as it goes.
Round-off only: the coarse run is the filtered DNS.
Changing a bracket or the scheme restarts the coarse run from the filtered DNS at that instant. Live in-browser re-enactment at reduced resolution, not the paper's data.
With all three brackets on, the dots do not approximate the bars. They are the bars: the error sits at , the round-off floor of double precision, for as long as the simulation runs. No closure model can do this, because no model gets to see . The point is that the target a model should aim for exists, and that it is , not its first bracket.
Three things to try:
- Switch off your divergence in the middle of a run. The error leaves the round-off band at once. It jumps about eleven orders of magnitude in a single time step and is at the percent level a moment later.
- Leave only physics on. This is the classical recipe with perfect knowledge of the classical term, and the coarse run still wanders off by tens of percent.
- Switch the coarse scheme to upwind. The flow is the same and so is the target, but the middle bracket changes, and the exact flips from removing energy to handing it back: an upwind scheme already dissipates more than it should. Now feed that run only physics. In most flows it does worse than feeding it nothing at all.
Same flow, two truths
That last experiment is the one I would remember. The residual flux is not a property of the turbulence. It is a property of the turbulence and the scheme used to simulate it. Change the scheme and the right answer for the closure changes with it, down to its sign.
This takes the air out of an old argument. Explicit large-eddy simulation adds a model on top of a scheme that does not dissipate. Implicit large-eddy simulation lets a dissipative scheme do the model’s job. In the figure above these are not rival philosophies. They are one expression, , evaluated with two different , and in both cases says how much is left for a model to do. It also says why a closure calibrated in one code should not be expected to work in another: part of what it was fitted to was the first code’s middle bracket.
How much of your turbulence is your grid?
So far the grid was the only filter. Large-eddy simulation usually thinks of a second, wider filter of width that selects the scales to keep, and nothing stops you from stacking one on top of the grid’s. The three brackets survive, with the bar now meaning both filters. What you cannot do is remove the grid’s filter. You only choose what to put on top of it. (To leading order, the stack acts like a single filter of width .)
How much of is then discretization, meaning the second and third brackets, depends on the ratio :
At the textbook picture is right, and nobody computes there, because it spends a factor 32 in resolution on scales that are then filtered away. Where simulations are actually run, between and , a quarter to nearly three quarters of what a closure is asked to model is the discretization.
What this is good for
Nobody can run a DNS next to every coarse simulation, so the figure above is a certificate, not a method. What it certifies is the target.
In the paper we refit the simplest closure there is, the one-coefficient Smagorinsky model, against instead of against its first bracket. With a central scheme the coefficient comes out larger, because it now carries the dissipation that the discretization asks for, and the coarse simulations improve, most clearly when the grid is the only filter. For closures with thousands of parameters, trained directly on such data, the choice of target matters far more. That was the lesson of an earlier paper.
The price is that is married to your grid and your scheme. Change either and the target has to be computed again, and a closure fitted to it has to be recalibrated. That dependence was there all along. The exact expression only makes it visible.
Two more boxes
Everything here came from one move: integrate a derivative over a cell, and what remains lives on the boundary of the cell. In one dimension that boundary is two points. Two other boxes are worth opening.
- A cube. In three dimensions each face of a cell carries its own average, so two stress components that the textbook calls equal are averaged over different faces, and stop being equal. Add the pressure, and the stress stops being local as well. That is part two.
- A brick in space-time. A forward-Euler time step is the same identity along the time axis, with a one-sided average. That is part three.
The numbers behind this post
- The live figure runs in your browser: a 2025-cell DNS of the viscous Burgers equation, 45 coarse cells, forward Euler for both. It is a re-enactment at reduced resolution, not the paper’s data. New flow draws another random initial condition.
- The paper’s Burgers experiment uses a 13 500-cell DNS, coarse grids of 300, 900 and 2700 cells, and 1000 random initial conditions. With the grid as the only filter, feeding the coarse run only the classical term leaves a 16% error at the end of the run, adding the numerical-flux term leaves 8%, and all three give machine precision. At the first two numbers are 7% and 2%.
- The proofs, the construction that makes all of this exact on two nested grids, and the three-dimensional theory are in the paper. Everything in it is reproducible with ExactClosure.jl.