7.5. Time stepping for weakly turbulent flows

The comparisons in Stiff solvers, Jacobians and automatic differentiation were made at a large viscosity, \(\nu = 1\), where the flow converges to a steady state and the time step is limited by the viscous term. Here we look at the opposite regime: a small viscosity and a multi-mode forcing, which sustain a seemingly weakly turbulent, chaotic flow, where advection is the dominant term. We compare explicit, exponential and implicit-explicit (IMEX) methods by the cost of computing the statistics of the flow.

The results come from a single experiment, run once on a 4-core Linux machine, and are reported as static tables and figures; nothing is executed when this page is built. The scripts that reproduce them are in the folder benchmarks/turbulence/ of the repository.

Which term limits the time step?

In spectral space, the viscous term \(\nu\Delta\omega\) is diagonal, with real eigenvalues down to \(-\nu k_{\max}^2\), while the advection term has nearly imaginary eigenvalues of size up to about \(k_{\max}(|u|_{\max} + |v|_{\max})\), where \(k_{\max}\) is the largest retained wavenumber. For an explicit or exponential scheme, the step is limited by whichever of the two rates

\[ \nu k_{\max}^2 \qquad \text{and} \qquad k_{\max}\left(|u|_{\max} + |v|_{\max}\right) \]

is larger. For the setup of the earlier pages (\(N = 128\), Nsub = 84, so \(k_{\max} = 41\), the same initial condition and single-mode forcing), the ratio between the viscous and the advective rates is:

\(\nu\)\(t = 0\)\(t = 1\)\(t = 10\)
10.67180180
0.10.0670.661.5
0.010.00670.0070.011

So, for \(\nu = 1\), after a short transient, the problem is stiff because of the viscous term, and implicit and exponential methods pay off. For small \(\nu\), advection is about a hundred times faster than viscous decay, the problem is not stiff, and the step is limited by a CFL-type condition

\[ \Delta t \lesssim \frac{c}{k_{\max}\left(|u|_{\max} + |v|_{\max}\right)}, \]

where \(c\) is the extent of the stability region of the method along the imaginary axis (\(c = 2\sqrt{2} \approx 2.8\) for the classical fourth-order Runge-Kutta method, \(\sqrt{3} \approx 1.7\) for the three-stage strong-stability-preserving method SSPRK33).

Consequences, to be checked by the experiment below:

The experiment

\[ \kappa_\sigma^2 = \frac{\langle\|\Delta\mathbf{u}\|_{L^2}^2\rangle}{\langle\|\nabla\mathbf{u}\|_{L^2}^2\rangle} = \frac{\langle P\rangle}{\langle Z\rangle}, \]

a Taylor-like wavenumber (squared) for the dissipation of enstrophy.

The warm-up

Starting from \((1/\nu)A^{-1}g\), which has a lot of energy, the flow takes about 1000 time units, several times the viscous time scale \(1/(2\nu) = 125\) of the largest scales, to reach a statistically steady regime. In that regime, most of the energy (85% to 97%) is in the \(|\mathbf{k}| = 1\) modes, a condensate fed by the inverse energy cascade, with intermittent bursts in which the condensate loses part of its energy to the smaller scales.

Warm-up

This regime is, seemingly, weakly turbulent: \(\kappa_\sigma \approx 2.5\) lies inside the forcing band, so there is no range of scales between forcing and dissipation, and the spectrum is steep, with no enstrophy-cascade range. The flow is nonetheless irregular and chaotic, i.e. sensitive to small perturbations: runs of different methods started from the same state, whose energies first differ by less than \(10^{-6}\), differ by 1% after about 70 to 110 time units and by 10% after about 90 to 140 time units. Small differences thus grow at a rate of roughly 0.2 to 0.3 per time unit, a rough estimate of the leading Lyapunov exponent. The spectrum is very well resolved, decaying by about eight orders of magnitude up to \(k_{\max}\).

Results

MethodParameter\(\Delta t\)Typical CFLMax CFLStable\(\langle E\rangle\)\(\langle Z\rangle\)\(\langle P\rangle\)\(\kappa_\sigma^2\)Nonlinear evaluations per time unit
Tsit5reltol = 0.01–––yes3.53 ± 0.365.41 ± 1.0734.3 ± 6.56.39 ± 0.48537
Tsit5reltol = 0.001–––yes5.52 ± 1.289.66 ± 3.3054.6 ± 19.05.71 ± 0.40748
Tsit5reltol = 0.0001–––yes3.44 ± 0.225.01 ± 0.5732.5 ± 3.46.50 ± 0.28534
RK4σ = 0.50.000610.200.42yes3.93 ± 0.576.17 ± 1.3739.2 ± 8.16.41 ± 0.426560
RK4σ = 10.001220.380.80yes3.68 ± 0.455.53 ± 1.1836.0 ± 7.26.54 ± 0.483280
RK4σ = 20.002440.701.28yes3.32 ± 0.194.64 ± 0.4731.7 ± 2.46.85 ± 0.341640
RK4σ = 30.003651.132.40yes3.89 ± 0.946.35 ± 2.3441.4 ± 13.26.67 ± 0.461096
RK4σ = 40.004851.503.54yes3.64 ± 0.535.61 ± 1.2335.9 ± 6.96.48 ± 0.51824
RK4σ = 60.007252.365.24blew up at t = 1409––––552
RK4σ = 80.009622.684.74blew up at t = 1363––––416
ETDRK4σ = 0.50.000610.220.44yes4.33 ± 0.966.92 ± 2.1742.8 ± 11.26.37 ± 0.616560
ETDRK4σ = 10.001220.381.01yes3.86 ± 0.836.14 ± 2.6038.6 ± 15.76.38 ± 0.573280
ETDRK4σ = 20.002440.751.63yes3.79 ± 0.635.78 ± 1.4736.4 ± 9.56.35 ± 0.551640
ETDRK4σ = 30.003651.213.03yes4.44 ± 1.147.45 ± 2.7244.2 ± 14.16.19 ± 0.661096
ETDRK4σ = 40.004851.474.12yes3.81 ± 1.256.61 ± 3.4242.7 ± 19.16.71 ± 0.43824
ETDRK4σ = 60.007252.615.15blew up at t = 1683––––552
ETDRK4σ = 80.009622.745.22blew up at t = 1364––––416
SSPRK33σ = 0.50.000610.220.40yes4.18 ± 0.496.70 ± 1.3540.5 ± 7.36.12 ± 0.534920
SSPRK33σ = 10.001220.370.91yes3.99 ± 0.746.22 ± 1.7938.7 ± 9.16.40 ± 0.532460
SSPRK33σ = 20.002441.072.07yes5.74 ± 1.429.51 ± 3.0752.0 ± 15.55.60 ± 0.541230
SSPRK33σ = 30.003651.052.16yes3.43 ± 0.475.00 ± 0.9832.4 ± 4.76.58 ± 0.43822
SSPRK33σ = 40.004851.382.70yes3.06 ± 0.164.47 ± 0.3630.7 ± 2.86.89 ± 0.40618
SSPRK33σ = 60.007252.013.55blew up at t = 1302––––414
CNAB2σ = 0.250.000310.090.21yes3.77 ± 0.495.48 ± 1.0434.7 ± 7.26.34 ± 0.463280
CNAB2σ = 0.50.000610.190.49yes3.97 ± 1.156.79 ± 3.0143.6 ± 17.16.62 ± 0.491640
CNAB2σ = 0.750.000910.300.64yes4.00 ± 0.656.53 ± 1.9740.6 ± 13.26.22 ± 0.551094
CNAB2σ = 10.001220.350.89blew up at t = 1546––––820
CNAB2σ = 20.002440.681.00blew up at t = 1352––––410

"Stable" means that the run lasted the full 1000 time units; the runs that blew up did so during a burst.

Statistics

The intervals of \(\langle E\rangle\), \(\langle Z\rangle\) and \(\langle P\rangle\) are wide, about 5% to 50%, because of the slow, intermittent dynamics of the condensate. The ratio \(\kappa_\sigma^2 = \langle P\rangle/\langle Z\rangle\) is much more robust, with intervals of about 4% to 11%, and most runs give \(\kappa_\sigma^2 \approx 6.2\) to \(6.9\), i.e. \(\kappa_\sigma \approx 2.5\).

The stable runs agree within their 95% confidence intervals, with two exceptions: Tsit5 with reltol = 1e-3 and SSPRK33 with \(\sigma = 2\), whose trajectories had more bursts, give higher \(\langle E\rangle\), \(\langle Z\rangle\) and \(\langle P\rangle\) and a lower \(\kappa_\sigma^2 \approx 5.6\) to \(5.7\), which does not overlap with the interval of, say, RK4 with \(\sigma = 2\). These deviations are not related to the step size or tolerance, since the neighbouring parameters of the same methods agree with the other runs; they indicate that the confidence intervals from 10 batches underestimate the uncertainty, because the bursts are correlated over times comparable to the batch length.

κσ²

Energy

The time-averaged spectra coincide at all but the largest scales, \(k \leq 4\), where the fluctuations of the condensate dominate:

Spectra

No systematic bias due to the time discretization can be detected: over a factor of 8 in the time step for RK4 and ETDRK4, and over the whole range of tolerances for Tsit5, the differences show no trend with the step size and are of the size of the sampling fluctuations. Detecting a smaller bias would require much longer runs. The runs all start from the same state, so their first part is correlated; they then diverge, since the flow is chaotic, within about 100 time units (see the warm-up section), a tenth of the length of each run.

Stability limits

MethodLargest σ stable for 1000 time unitsBlew up atMax CFL observed in the largest stable run
RK44σ = 63.5
ETDRK44σ = 64.1
SSPRK334σ = 62.7
CNAB20.75σ = 10.64

Cost

The cost of one step, measured on its own (single-threaded, with no other process competing), and the resulting cost per time unit:

MethodCost per step (ms)Steps per time unitCost per time unit (s)
one evaluation of the nonlinear term0.144
Tsit5, reltol = 0.01 or 0.00011.50890.13
Tsit5, reltol = 0.0011.501250.19
SSPRK33, σ = 40.582060.12
SSPRK33, σ = 30.582740.16
RK4, σ = 40.822060.17
RK4, σ = 30.822740.23
ETDRK4, σ = 41.132060.23
ETDRK4, σ = 31.132740.31
CNAB2 (hand-written), σ = 0.750.2210940.24
CNAB2 (hand-written), σ = 0.50.2216400.36

Recommendation

For weakly turbulent, advection-dominated flows like this one, and, we expect, for more turbulent flows as well:

Choosing the step for ETDRK4

ETDRK4 in OrdinaryDiffEq uses a fixed step, and it cannot change the step during a run: it caches the exponential coefficients for that step and throws an error if the step changes, even by round-off, so the step cannot be adapted to the CFL number on the fly. The step must therefore be chosen in advance:

  1. Run a long warm-up (with Tsit5(), for instance) until the statistics settle, and record \(|u|_{\max} + |v|_{\max}\); take \(U_*\) slightly above its maximum, since the bursts set the limit.

  2. Take \(\Delta t = \sigma/(k_{\max}U_*)\) with \(\sigma \approx 2\) to 3 (here, stability was lost at \(\sigma = 6\)).

  3. Check the statistics against a run with \(\Delta t/2\), comparing the confidence intervals of \(\langle E\rangle\), \(\langle Z\rangle\), \(\kappa_\sigma^2\) and the spectrum.

  4. Monitor the CFL number during the run, e.g. with a callback, to detect an unexpectedly strong burst.

Implementation notes

Caveats

Reproducing the results

From the folder benchmarks/turbulence/ of the repository, bash run_all.sh runs the warm-up, all the methods, the timings and the analysis, writing the tables and figures to figs/. It takes about 1.5 hours on 4 cores.



Last modified: November 21, 2026. Built with Franklin.jl, using the Book Template.