Reduced-MHD spectral smoke benchmark¶
The first physical workflow in the rebuilt MHX is a deliberately small periodic 2D reduced-MHD benchmark. It is intended to validate package architecture, spectral operators, time integration, diagnostics, and automatic differentiation. It is not yet a calibrated FKR tearing-growth benchmark.
Equations¶
MHX evolves magnetic flux \(\psi(x,y,t)\) and vorticity \(\omega(x,y,t)\):
with
and periodic boundary conditions. The 2D Poisson bracket is
The implementation uses FFT derivatives and an inverse Laplacian with the zero Fourier mode fixed to zero:
FAST initial condition¶
The current smoke initial condition is
It is chosen because it is periodic, deterministic, smooth, and inexpensive.
Dedicated tearing validation now lives in mhx benchmark fkr-growth,
mhx benchmark linear-tearing-eigenvalue, and
mhx benchmark linear-tearing-timedomain; the smoke initial condition remains
an IO and differentiability fixture.
Diagnostics¶
The active diagnostics are
mhx run examples/linear_tearing.toml --outdir outputs/smoke writes a JSON
manifest and scalar energy diagnostics for this benchmark.
Differentiability check¶
The test suite includes a finite-difference check of
through a three-step RK4 solve using jax.grad. This is intentionally tiny but
establishes the contract that future inverse-design objectives must remain
differentiable unless explicitly documented otherwise.
Mode amplitude and growth rate¶
The first tearing-oriented diagnostic tracks the normalized Fourier amplitude
for a configured mode through the diagnostics registry,
currently (1, 1) in the FAST smoke benchmark. MHX fits
by least squares on \(\log A(t)\). This gamma_fit is useful for plumbing and
regression tests, but it should not be interpreted as an FKR tearing rate until
the eigenfunction, equilibrium, fit window, and parameter regime are validated.
The fit window is an explicit config field:
[diagnostics]
quantities = ["energy", "mode_growth", "divergence_error"]
mode = [1, 1]
fit_time_window = [0.02, 0.1]
MHX records fit_time_window and fit_sample_count in diagnostics.json, so
growth-rate comparisons are auditable and reproducible.