Appearance
Rayleigh–Taylor
| ID | Group | Milestone | Backends | Figure | Regression |
|---|---|---|---|---|---|
| GV-4 (G3) | External gravity | M7 (#73); symmetry study #83 | CPU, FNL | yes | — |
Case and scope
Rayleigh–Taylor is the gravity test of the literature, and there it is compared by eye (Liska & Wendroff 2003; Stone et al. 2008, §8.3; Almgren et al. 2010, §8.3): its nonlinear stage has no converged solution. Its linear stage has one, the growth rate of the seeded mode, and GV-4 asserts it against the linearised compressible Euler equations of the exact equilibrium profile (owner decision: B, with the nonlinear stage as figures, C). The incompressible sharp-interface formula
What the case catches:
- a wrong equilibrium or
hydrostaticghosts of the two layers (GV-4a), and a spurious flow on the unseeded layers (GV-4b); - a wrong linear growth rate (GV-4c): the fitted rate against the oracle's eigenvalue to
, at two resolutions; - backend divergence amplified by the instability (GV-7).
The nonlinear stage, hydro and MHD, is shown as figures without an oracle. The mirror symmetry of the MHD run is the subject of a study (#83), at the end of the Results: a symmetry that the equations keep and the scheme loses is either physics (an unstable mode of the flow, fed by round-off) or numerics, and a user who reads the asymmetry needs to know which.
Models and numerics
| Item | Choice | Code |
|---|---|---|
| Equations | compressible Euler, ideal gas, rt2d-mhd: ideal MHD, EGLM (glm_ch = 3, glm_alpha = 0.18, glm_damping_length = 1, glm_ch_check = warning); the #83 runs also glm and none | models, EGLM, GLM; set_glm_damping, adam_flume_mhd_object.F90 |
| Equilibrium | two isothermal layers joined by a tanh in temperature at equal pressure, closed-form hydrostatic pressure; divergence-free single-mode seed with a Gaussian envelope | atmosphere_state, set_initial_conditions, adam_flume_ic_object.F90 |
| Gravity sources | momentum | add_gravity_sources, compute_gravity_correction, adam_flume_cpu_object.F90 |
| Well-balanced mode | GV-4b balanced leg only (equilibrium = atmosphere) | refresh_equilibrium_residual, subtract_equilibrium_residual, adam_flume_cpu_object.F90 |
| Space | WENO5 (weno-u-5) flux splitting on characteristic variables (weno); one #83 comparison with weno-riemann HLLD | compute_residuals_weno, compute_residuals_riemann, adam_flume_cpu_object.F90; adam_flume_cpu_mhd_eglm_kernels.F90, adam_flume_cpu_mhd_glm_kernels.F90, adam_flume_cpu_mhd_kernels.F90; numerics |
| Time | SSP Runge–Kutta, 3 stages (runge-kutta-ssp-33), CFL 0.4 | adam_rk_object.F90 |
| Boundaries | x periodic, y hydrostatic (exact on isothermal layers) | hydrostatic_ghost, adam_flume_bc_object.F90 |
| FNL backend | the same kernels on the device | adam_flume_fnl_object.F90 |
| Oracle | linearised compressible Euler about the closed-form profile, RK4 shooting with bisection on | growth_rate, src/tests/flume/verification/gravity/rt_oracle.py |
The equilibrium (rayleigh-taylor): two isothermal layers, cold and dense over hot and light, joined by a tanh in temperature at equal pressure. Isothermal layers are stably stratified, so the interface is the only instability, and the hydrostatic boundary is exact on them. Two layers of uniform density would not do: under gravity a uniform-density layer has entropy falling with height and is convectively unstable, a second instability competing with the first.
The oracle (gravity/rt_oracle.py). With perturbations rt_oracle.py selftest,
| Check | Bound | Result |
|---|---|---|
| closed-form pressure against quadrature of | ||
| incompressible ( | ||
| light over heavy | no growing mode | no growing mode |
| 2000 against 4000 RK4 steps |
Initial and boundary conditions
| Item | rt2d (GV-4) | rt2d-nl | rt2d-mhd |
|---|---|---|---|
| Domain | as rt2d-nl | ||
| Grid | quadtree, 4×4 blocks of ngc = 4 | 4×4 blocks of | as rt2d-nl |
| Ranks | 2 | 2 | 2 |
| Gravity | as rt2d | as rt2d | |
| Layers | density ratio 2:1, light layer | as rt2d | as rt2d |
| Interface width | 0.05 | 0.01 | 0.01 |
| Seed | wavelength 0.5, amplitude | amplitude | amplitude |
| Field | — | — | |
| Linear rate (oracle) | — | ||
| Boundaries | x periodic, y hydrostatic | as rt2d | as rt2d |
| CFL | 0.4 | 0.4 | 0.4 |
| Final time | GV-4a one step at CFL | as rt2d-nl |
The #83 runs are rt2d-mhd with one cleaning parameter changed at a time: divergence_control = none, glm; EGLM with glm_ch = 1.5, 6; glm_alpha = 0, 1, 5; glm_damping_length = min-cell.
Input files
| File | Role |
|---|---|
src/tests/flume/verification/gravity/make_atmosphere.py | writes rt2d, rt2d-nl, rt2d-mhd (--seed, --cells, --it-save, --balanced, --divergence-control, --glm-ch, --glm-alpha, --glm-damping-length) |
src/tests/flume/verification/gravity/check.sh | runs GV-4a, GV-4b, GV-4c with the force legs (--legs gv4a,gv4b,gv4c); --agree TAG adds GV-7 on rt-8 |
src/tests/flume/verification/gravity/rt_oracle.py | the linear growth rate (sigma <input.ini>) and its self-test (selftest) |
src/tests/flume/verification/gravity/atmosphere_oracle.py | profile (GV-4a, rest (GV-4b, --max 1e-12), growth (GV-4c, --t0 2 --t1 4 --tol 1e-3), agree (GV-7), symmetry (#83) |
src/tests/flume/verification/gravity/glm_linear.py | #83: the spectrum of the linearised GLM and EGLM systems about a magnetised double shear layer |
src/tests/flume/verification/make_doc_runs.sh (groups gravity, rt, rt-sym) | rt-{8,16}; rt2d-nl, rt2d-mhd; the eight rt-sym-* runs |
src/tests/flume/verification/make_doc_figures.py (fig_gravity_rt_linear, fig_gravity_rt, fig_gravity_rt_symmetry) | draws the three figures |
bash
cd src/tests/flume/verification/gravity
./rt_oracle.py selftest # the oracle
./check.sh --np 2 --cases iso2d --keep # CPU (GV-4 runs with the force legs)
FLUME_EXE=$PWD/../../../../../exe/adam_flume_fnl ./check.sh --np 2 --cases iso2d --keep \
--agree adam_flume_cpu # FNL, and GV-7 on rt-8
cd .. && ./make_doc_runs.sh <dir> rt # the nonlinear runs
FLUME_EXE=$PWD/../../../../exe/adam_flume_fnl ./make_doc_runs.sh <dir> rt-sym # the #83 runsResults
Linear stage (GV-4)

The seeded mode against time, its local growth rate, and its vertical profile at
Left, the mode grows from
| Leg | Asserted | Bound | CPU | FNL |
|---|---|---|---|---|
| GV-4a unseeded, one negligible step | the layers and their hydrostatic ghosts against the closed form | interior | the same | |
| GV-4b unseeded to | balanced $\max | \mathbf u | /c$; unbalanced reported | |
| GV-4c seeded, | the slope of | 1.522543 ( | the same | |
| GV-7 FNL against CPU | rt-8 ( | — |
Nonlinear stage (figures, no oracle)

Density of rt2d-nl (top, hydro) and rt2d-mhd (bottom,
Hydro (top): the spikes roll up through secondary Kelvin–Helmholtz instabilities by
Both runs are periodic with two identical wavelengths, each mirror-symmetric about its own axis. Hydro keeps both symmetries to round-off, which grows with the flow to weno-riemann with HLLD delays it by about one time unit,
The mirror symmetry of the MHD run (#83)
The measure is atmosphere_oracle.py symmetry, with its mean growth rate over rt2d-mhd at make_doc_runs.sh <dir> rt-sym, the FNL build, about 2 min each on two A30 GPUs); the hydro reference ran on the CPU. No pass/fail bound: a report.

Left, the mirror asymmetry per divergence control; centre, per EGLM damping; right, its growth rate against
| Run (rt2d-mhd, rt2d-nl, CPU) | 1.78 | divergence_control = none | 2.04 | glm, glm_ch = 3 | 3.27 | eglm, glm_ch = 1.5 | 4.38 | eglm, glm_ch = 3 (the case's default) | 6.25 | eglm, glm_ch = 6 | 10.91 | eglm, glm_ch = 3, glm_alpha = 0 | 6.87 | eglm, glm_ch = 3, glm_alpha = 1 | 2.91 | eglm, glm_ch = 3, glm_alpha = 5 | 4.85 | eglm, glm_ch = 3, glm_damping_length = min-cell | 4.09 |
Related cases: the well-balanced mode (the GV-4b balanced leg); EGLM cleaning and GLM divergence cleaning without gravity; MHD blast symmetry (#77, the other symmetry loss, of a different cause).
Findings
- The seed must be divergence-free. A seed in
alone starts sound waves that beat against the mode; with one the fitted rate was 0.28 % to 0.92 % off depending on the window ( , ). - GV-4c runs unbalanced. The unbalanced scheme's stationary flow (GV-4b) is as large as the seed but uniform in x: its content at the seeded wavenumber is
. - The residual of GV-4c is the fit window, not the discretisation. The two resolutions agree more closely than either agrees with the theory, and the error falls as the window starts later (
, , for = 1.5, 2, 2.5 at ): the residual is the seed's transient decaying in the window, not the discretisation, which is below with three cells across the interface width. - #83: the cleaning drives the MHD asymmetry. Without cleaning, the MHD run keeps its symmetry about as well as hydro does (rate 2.04 against 1.78). GLM raises the rate to 3.27, and EGLM to 4.4, 6.3 and 10.9 at
glm_ch= 1.5, 3 and 6. The excess over the uncleaned run grows by about 1.5glm_ch. It is first seen on the shear flanks between bubble and spike. - It is not a time-stepping artefact. At CFL 0.2, which takes 2.5 times the steps, the EGLM rate at
glm_ch= 3 is 5.31, against 6.25 at CFL 0.4. A fixed gain per step would have doubled the excess. - It is not in the cleaned equations.
gravity/glm_linear.pylinearises the GLM and EGLM systems about an exact, divergence-free double shear layer (, width 0.05, field 0.3 along the flow) and solves the spectrum by Fourier collocation. At the largest growth rate is 1.008 ( ) for both systems and for every from 0.75 to 6 (right panel). Damping ( ) and a sheared field leave it independent of . At it is 0.52 at and 0.40 at , independent of at both: the critical layer is under-resolved there, so the value itself is not converged. The -proportional growth is therefore a property of the discretised cleaning. It acts where the discrete is not small: max , so per cell. The GLM system without cleaning ( , conservative MHD without the Powell terms) is the negative control: it is not hyperbolic, and its rate rises with (1.6 at , 3.2 at ). - The damping does not cure it.
glm_alphafrom 0 to 5, or, moves at within a factor of about 40, with no monotone trend. Every glm_ch= 3 run ends with the same jump betweenand 5, to . The glm_ch= 1.5, GLM and uncleaned runs show a smaller late jump instead, to about: a current sheet on the spike's stem that narrows to 2 cells at . It is a grid-scale effect, common to every run. - The cleaning still does its job on
: 0.8–1.0 at under every cleaning, against 8.6 without. - Guidance. For a magnetised run whose symmetry matters (mirror-symmetric instabilities, convergence studies of the small scales), set
glm_chonly just above the fastest signal speed.glm_ch_check = errorstops the run if the flow outruns it. Here 1.5 is enough: the check never fired in theglm_ch= 1.5 run. Preferglmtoeglm: at the same speed EGLM's excess is about three times GLM's (4.2 against 1.2).nonekeeps the symmetry best but letsgrow tenfold, so use it only as a diagnostic. With EGLM at glm_ch= 3, take the asymmetry above aboutafter as numerical, not physical. Run at a second glm_chto check: a physical asymmetry does not depend on it.