Time accuracyPass

Stokes’ second problem

A viscous layer driven by an oscillating wall, a classical unsteady benchmark for the accuracy of the time integration.

UnsteadySelf-convergenceTime integration

The problem

Stokes’ second problem describes the flow above a flat wall that oscillates in its own plane. The wall drags the fluid with it, and viscosity carries that motion outward as a damped, phase-shifted wave, the Stokes layer, whose amplitude falls off exponentially with distance from the wall.

Where the other cases refine the mesh to probe spatial accuracy, this one refines the timestep. Because the flow varies only with distance from the wall and with time, it isolates a single question: how accurately does the solver advance the solution forward in time?

In an unbounded fluid the Stokes layer has the simple closed form below. In a finite domain the exact solution is considerably more involved, a larger combination of complex sinusoidal modes fixed by the far boundary, so this study measures self-convergence rather than comparing against any closed form.

Infinite-domain (half-space) solution

u(y,t)=U0ey/δcos ⁣(ωty/δ)u(y,t) = U_{0}\, e^{-y/\delta}\cos\!\left(\omega t - y/\delta\right)
δ=2ν/ω\delta = \sqrt{2\nu/\omega}

What we measured

The mesh is held fixed and the timestep is refined across a sweep of ten levels. Comparing against the analytic profile cannot isolate the time error here, because it is masked by the fixed spatial error of the mesh, so the study measures self-convergence instead: how much the solution stops changing as the step shrinks, which cancels the common spatial error and leaves the time-integration error alone.

A second-order time integrator shrinks that change by roughly a factor of four for every halving of the step, which appears as a slope of two on log axes. The rate is read over a six-interval clean window at the coarse end of the sweep, before accumulated per-step solver noise sets a floor.

Results

As the timestep is refined, the solution self-converges at order 1.99 across a six-interval clean window — essentially the textbook 2.00. At the finest steps the change stops falling and ticks back up. That is the noise floor: each timestep’s internal iterative solve is converged only to a fixed tolerance, leaving a tiny residual that, unlike the time-discretization error, does not shrink as the step shrinks. Once the genuine step-to-step change drops below that fixed residual, the comparison is measuring the solver’s tolerance rather than the time scheme. It is a known solver-side limit, so the order is read from the coarser clean window above it.

Temporal orderTarget

Accuracy of the solver’s time integration

expected 2.001.99

10⁻⁷10⁻⁶10⁻⁵slope 2finecoarsetimestep dtchange between steps
Timestep dtChange between stepsWindow
0.1677.81 × 10⁻⁶clean
0.1253.87 × 10⁻⁶clean
0.09092.07 × 10⁻⁶clean
0.06258.43 × 10⁻⁷clean
0.04554.81 × 10⁻⁷clean
0.03233.18 × 10⁻⁷clean
0.02273.73 × 10⁻⁷noise floor
0.01616.73 × 10⁻⁷noise floor
0.01141.23 × 10⁻⁶noise floor

Across the six clean rows the change falls at order 1.99. Below dt ≈ 0.03 the per-step solver residual dominates and the change rises again; that floor is excluded from the fit.

Time integration converges at order 1.99 over a six-interval clean window, confirming the second-order time scheme.