ITPA TAE with ShearAlfven: magnetic field in H(curl) vs H(div)¶
2026-11-12 · b93810444 · Struphy 3.6.1 · media folder · study folder
Description¶
Question. The ShearAlfven model has two discretizations of the magnetic field: in H(curl) (b_space="Hcurl",
implicit curl-curl solve for the magnetic field, preconditioned by Hiptmair-Xu; not exactly energy conserving) and in
H(div) (b_space="Hdiv", implicit Schur solve for the velocity, Kronecker preconditioner with E x B correction;
exactly energy conserving). Do both give the toroidal Alfvén eigenmode (TAE) of the ITPA benchmark, at which
resolution, and how do they differ in energy behaviour and mode structure? The runs are the physics check of the
strong-scaling profiling cases of the same example (struphy#932, submit_ShearAlfven_scaling.py), which time the
same setup with several preconditioners per space.
Setup (examples/ShearAlfven/itpa_tae_benchmark, Koenies et al., Nucl. Fusion 58, 126027 (2018)).
Large-aspect-ratio tokamak with circular flux surfaces (AdhocTorus): R0 = 10, a = 1, B0 = 3,
q(r) = 1.71 + 0.16 r², flat hydrogen density 2e19 m⁻³, beta 0.0018. Only n = 6 is computed, on a sixth of the torus
(HollowTorus, tor_period = 6, hole of radius a1 = 0.1; the default of the example is now 0.01, so the runs pass
--a1 0.1). The TAE sits in the gap of the m = 10 and m = 11 continua at q = 1.75, r = 0.5, with
omega_TAE = n / (2m + 1) v_A / R0 = 0.0859 (Alfvén units; 4.2e5 rad/s) at the center of the gap; the ITPA ideal
MHD frequency is 4.07e5 rad/s (mean of CAS3D 4.01e5 and GYGLES 4.13e5). The TAE is excited by an initial velocity
with m = 10 and 11 harmonics around r = 0.5; no energetic particles. Cubic splines, dt = 0.2, T = 500 (about 6.8
periods), 4 MPI ranks. Grids: 24 x 88 x 8
(8 elements per poloidal wavelength of m = 10) and the default 24 x 44 x 8 of the example (4.4). With H(div),
Dirichlet conditions at both radial walls; with H(curl), free conditions (u.n = 0 weakly).
Analysis (pproc_ShearAlfven.py, compare.py, see struphy.post_processing.mode_analysis). The radial velocity
is Fourier-transformed in the poloidal and toroidal angles at all saved times; the coefficients c_m(r, t) of n = 6
are transformed in time (Hann window). The pproc measures the frequency as the refined spectral peak of the
(m = 10, n = 6) coefficient at r = 0.5, projected on its initial phase; compare.py gives the FFT peak at r = 0.5
(on the zero-padded frequency grid), the (r, omega) maps with the cylindrical continua and the mode structure
|c_m(r, omega)| at the TAE frequency. The frequency resolution 2 pi / T is 0.0126. The 3D views
show the flux surface r = 0.5 of the gap.
Main findings¶
| run | magnetic field | grid | omega (pproc) | omega [rad/s] | dev. from ITPA | energy at t = 300 / at T |
|---|---|---|---|---|---|---|
| hcurl_24x88x8 | H(curl), Hiptmair-Xu | 24 x 88 x 8 | 0.0855 | 4.17e5 | +2.5% | 0.99 / 0.896 |
| hdiv_24x88x8 | H(div), Kronecker | 24 x 88 x 8 | 0.0846 | 4.13e5 | +1.4% | 1.000 / 1.000 |
| hcurl_24x44x8 | H(curl), Hiptmair-Xu | 24 x 44 x 8 | 0.0862 | 4.20e5 | +3.2% | 0.56 / 0.273 |
| hdiv_24x44x8 | H(div), Kronecker | 24 x 44 x 8 | 0.136 (no TAE) | 6.6e5 | +63% | 1.000 / 1.000 |
- Three runs have the TAE. H(curl) on both grids and H(div) on 24 x 88 x 8 give omega = 0.0846 - 0.0862, within 1.5% of the center of the gap and 1.4 - 3.2% above the ITPA value; the differences between the runs are far below the frequency resolution 0.0126 (the FFT peak is 0.0831 for all three). The (r, omega) maps show the mode in the gap at the crossing of the m = 10 and m = 11 continua.
- The mode structure is the same in H(curl) and H(div) on 24 x 88 x 8: m = 10 dominant, m = 11 at about 60%, both localized in 0.4 < r < 0.6, with small m = 9 and m = 12 sidebands. H(curl) has a small m = 11 background (about 5%) inside r < 0.4 that H(div) does not have.
- H(div) needs the finer poloidal grid. On 24 x 44 x 8 (4.4 elements per poloidal wavelength), the commuting projection of B0 x u in the induction equation makes the poloidal mode number effectively 2-3% too small; near the gap, where n q - m nearly cancels, this shifts the continua so much that there is no TAE: the spectrum peaks at 0.136. H(curl) has no such error (weak products with mass matrices) and gives the TAE on both grids.
- Energy. H(div) conserves the total energy exactly. The H(curl) step damps numerically, and the damping falls strongly with the poloidal resolution (the resolution along the background field): 44% of the energy is lost up to t = 300 on 24 x 44 x 8, 1% on 24 x 88 x 8 (10% up to T = 500, faster after t = 300, when phase mixing of the continuum oscillations creates finer radial structure). The frequency is not affected.



Comparison figures¶







Videos¶
hcurl_24x88x8: magnetic field in H(curl) (Hiptmair-Xu preconditioner), 24 x 88 x 8

















































hdiv_24x88x8: magnetic field in H(div) (Kronecker preconditioner), 24 x 88 x 8

















































hcurl_24x44x8: magnetic field in H(curl) (Hiptmair-Xu preconditioner), 24 x 44 x 8

















































hdiv_24x44x8: magnetic field in H(div) (Kronecker preconditioner), 24 x 44 x 8 (no TAE); re-run up to T = 500 on Struphy 3726838be (ShearAlfven and the example unchanged since b93810444)

















































Reproduce¶
Install the Struphy version of the study (in a fresh virtual environment) and compile the kernels:
pip install "struphy @ git+https://github.com/struphy-hub/struphy@b93810444da2d0fbcfb2232365a2c0df3daa5c6c"
struphy compile
The parameter and post-processing files are in studies/2026-11-itpa-tae-shear-alfven/params/. Run each command in that folder:
| run | description | params |
|---|---|---|
| hcurl_24x88x8 | magnetic field in H(curl) (Hiptmair-Xu preconditioner), 24 x 88 x 8 | params_ShearAlfven.py |
| hdiv_24x88x8 | magnetic field in H(div) (Kronecker preconditioner), 24 x 88 x 8 | params_ShearAlfven.py |
| hcurl_24x44x8 | magnetic field in H(curl) (Hiptmair-Xu preconditioner), 24 x 44 x 8 | params_ShearAlfven.py |
| hdiv_24x44x8 | magnetic field in H(div) (Kronecker preconditioner), 24 x 44 x 8 (no TAE); re-run up to T = 500 on Struphy 3726838be (ShearAlfven and the example unchanged since b93810444) | params_ShearAlfven.py |
hcurl_24x88x8
mpirun -n 4 python params_ShearAlfven.py --sim-folder hcurl_24x88x8 --num-elements 24 88 8 --b-space Hcurl --a1 0.1
bash pproc_case.sh hcurl_24x88x8 --num-elements 24 88 8 --b-space Hcurl --a1 0.1
hdiv_24x88x8
mpirun -n 4 python params_ShearAlfven.py --sim-folder hdiv_24x88x8 --num-elements 24 88 8 --b-space Hdiv --a1 0.1
bash pproc_case.sh hdiv_24x88x8 --num-elements 24 88 8 --b-space Hdiv --a1 0.1
hcurl_24x44x8
mpirun -n 4 python params_ShearAlfven.py --sim-folder hcurl_24x44x8 --num-elements 24 44 8 --b-space Hcurl --a1 0.1
bash pproc_case.sh hcurl_24x44x8 --num-elements 24 44 8 --b-space Hcurl --a1 0.1
hdiv_24x44x8
mpirun -n 4 python params_ShearAlfven.py --sim-folder hdiv_24x44x8 --num-elements 24 44 8 --b-space Hdiv --a1 0.1
bash pproc_case.sh hdiv_24x44x8 --num-elements 24 44 8 --b-space Hdiv --a1 0.1
