Skip to content

Viscous waves ​

IDGroupMilestoneBackendsFigureRegression
VV-1, VV-2Dissipative terms (M4)M4 (#65)CPU, FNLyesshear-viscous

Case and scope ​

A small sine wave on a gas at rest is one Fourier mode of the linearised compressible Navier–Stokes equations. The oracle (viscous/waves.py) integrates that mode exactly, exp⁡(Mt) of the 3×3 system for (ρ′,un,T′) plus the decoupled transverse velocity, from the Fourier coefficients of the initial state, so it holds every mode the start excites (the acoustic pair and the entropy mode), not only a decay rate. The error is the RMS over the cells of the point values (FLUME is a finite-difference scheme).

  • VV-1, the shear wave: the transverse velocity ut=Asin⁡(kn⋅x)e−νk2t; the error is measured on ut. It pins the order of the viscous flux.
  • VV-2, the right-running acoustic wave with a conductivity as well, so μ and k act together; the error is measured on ρ′.

What the case catches: a dissipative flux that is consistent and still wrong in its order (a missing correction term), its coefficient (a missing 4/3, a conductivity without R) or its direction (a cross derivative read with the wrong stencil, exercised by the diagonal leg).

Models and numerics ​

ItemChoiceCode
Equationscompressible Navier–Stokes, ideal gas, γ=1.4, R=1, constant μ and kmodels
Dissipative fluxesdissipative_order = 4 (conservative fourth-order flux with the Shu–Osher correction) or 2 (compact central)add_dissipative_fluxes, adam_flume_cpu_object.F90; add_dissipative_fluxes_o4, add_dissipative_fluxes_o2, adam_flume_cpu_dissipation_kernels.F90; compute_dissipative_flux, adam_flume_dissipation_library.F90; numerics
Inviscid fluxesWENO5 (weno-u-5) flux splitting on characteristic variables (scheme_space = weno)compute_residuals_weno, adam_flume_cpu_object.F90; numerics
TimeSSP Runge–Kutta, 5 stages, 4th order (runge-kutta-ssp-54), CFL 0.2, the diffusive limit includedadam_rk_object.F90; compute_lambda_max_dissipative, adam_flume_cpu_euler_kernels.F90
Boundariesperiodic in x and y, extrapolation on the null zset_boundary_conditions, adam_flume_cpu_object.F90
FNL backendthe same fluxes as device kernelsadd_dissipative_fluxes_dev, adam_flume_fnl_object.F90; add_dissipative_fluxes_o4_dev, adam_flume_fnl_dissipation_kernels.F90

Initial and boundary conditions ​

ItemValue
Domain[0,1]2, z null
Gridquadtree, 4×4 blocks, N/4 cells per block along the active axes, ngc = 3. A wave along an axis keeps the other in-plane axis: active and thin for the shear wave (4 blocks of 6 cells across it, because FLUME freezes the momentum normal to a null direction, which would freeze the shear), null (1 cell) for the acoustic wave
Ranks2
Initial conditionsine-wave, ρ0=p0=1, u=0; wavelength 1 along an axis, 1/2 along the diagonal
Boundariesperiodic on the x and y faces, extrapolation on the z faces
LegModeDirectiondissipative_orderAμ, kNt
VV-1 shear xshearx410−40.01, 032 / 64 / 1280.5
VV-1 shear ysheary410−40.01, 032 / 64 / 1280.5
VV-1 shear x, order 2shearx210−40.01, 032 / 64 / 1280.5
VV-1 shear diagonalshear45° (both directions active: the cross terms ∂iud and the tangential derivatives)410−40.01, 024 / 48 / 960.1
VV-2 acousticacoustic, and its −A twinx410−50.01, 0.0232 / 64 / 1280.5

A sound wave steepens at O(A2): at A=10−4 that residue (10−8) flattened the error at every resolution. VV-2 therefore runs the twin with amplitude −A and judges the odd part (f(+A)−f(−A))/2, whose residue is O(A3), at A=10−5.

Input files ​

FileRole
src/tests/flume/verification/viscous/waves.pymake writes each input; oracle integrates the linear mode exactly and judges the ladder
src/tests/flume/verification/viscous/check.sh --legs vv1,vv2runs the ladders (--np N; FLUME_EXE selects the backend)
src/tests/flume/regression/shear-viscous/input.inithe frozen diagonal shear wave, 482, t=0.05
make_doc_figures.py (fig_viscous, fig_viscous_fields, fig_viscous_ladders)the figures, from the CPU (and, for the ladders, FNL) work directories of viscous/check.sh
bash
cd src/tests/flume/verification/viscous && ./check.sh --legs vv1,vv2             # CPU
FLUME_EXE=$PWD/../../../../../exe/adam_flume_fnl ./check.sh --legs vv1,vv2       # FNL

Results ​

VV-1 to VV-5: convergence, and Becker's shock against the exact profile

Left: the Navier–Stokes ladders (VV-1 to VV-4), each normalised by its coarsest error, against the order-2 and order-4 slopes; middle: the Ohmic ladders (VV-5); right: Becker's shock (VV-4).

VV-1, VV-2 and VV-5: absolute errors on CPU and FNL, and the Ohmic decay

Absolute RMS errors of the VV-1 and VV-2 legs (left) and of the VV-5 legs (centre), CPU (filled, solid) and FNL (open, dotted), which coincide; right, the Ohmic decay: the measured amplitude of the mode over the exact one.

VV-1 and VV-8 in 2-D: the shear wave and its error on a uniform grid; the shear and Ohmic errors with the centre refined 2:1

Top row: the diagonal shear wave on the uniform 962 grid at t=0.1 and its pointwise error, smooth and spread over the domain. The bottom row belongs to VV-8.

Oracle: the observed order of the finest pair ≥3.8 at order 4, ≥1.9 at order 2.

LegNRMS error (CPU)Order (CPU)FNL
shear x, order 432 / 64 / 1283.64⋅10−10 / 2.29⋅10−11 / 1.43⋅10−12+3.99, +4.00the same to the printed digits
shear y, order 432 / 64 / 128identical to x, bit for bit+3.99, +4.00the same
shear x, order 232 / 64 / 1283.68⋅10−8 / 9.20⋅10−9 / 2.30⋅10−9+2.00, +2.00the same
shear diagonal, order 424 / 48 / 966.72⋅10−10 / 1.16⋅10−11 / 2.43⋅10−13+5.86, +5.57the same
acoustic, order 432 / 64 / 1288.20⋅10−11 / 1.69⋅10−12 / 2.18⋅10−14+5.60, +6.288.20⋅10−11 / 1.69⋅10−12 / 2.21⋅10−14, +5.60, +6.26 (at 32 cells 8.196853⋅10−11 against the CPU's 8.196891⋅10−11)

Every leg passes on both backends (2 ranks). On FNL the numbers are the same to the printed digits except where the round-off of the run itself shows: the acoustic odd part, whose ±A difference amplifies the round-off of a 10−5 wave.

Related cases: the same oracle drives Ohmic decay and the Alfvén wave; the diagonal waves cross 2:1 seams in VV-7 and VV-8; the run-by-run backend comparison is in CPU and FNL agree.

Findings ​

  • The measured decay rate of the shear wave is νk2 to 2⋅10−8 relative at 128 cells.
  • The diagonal wave converges faster than its design order: on the diagonal the leading truncation errors of the x and y fluxes appear to cancel.
  • On the acoustic wave the error is dominated by the inviscid WENO part, not by the viscous one. VV-2 therefore checks that μ and k enter with the right coefficients (the measured amplitude equals the exact one to 6⋅10−10 relative), and VV-1 pins the order of the dissipative flux.
  • The measured acoustic rate, 0.29576, differs by 4% from the first-order Kirchhoff–Stokes rate k2/(2ρ0)(43μ+(γ−1)k/cp)=0.30831: here νk/a=0.053, and the exact linear oracle carries that correction.
  • #85 lists absolute shear and acoustic ladders (RMS error against N with reference slopes) as a figure still to extend fig_viscous with; the published figure shows the ladders normalised by their coarsest error.