Skip to content

Alfven perturbation from a FAX eigenmode (builds on #196) - #235

Open
rogeriojorge wants to merge 14 commits into
feat/analytical-alfven-perturbationsfrom
feat/fax-alfven-modes
Open

rogeriojorge wants to merge 14 commits into
feat/analytical-alfven-perturbationsfrom
feat/fax-alfven-modes

Conversation

@rogeriojorge

Copy link
Copy Markdown
Member

Builds on #196 (the slimmed #177, current main merged), so the diff against #177 includes that slimming; this PR itself adds the last commit only: FaxEigenmode, its example, README/docs text and three tests. If #196 is merged into #177 first, the diff reduces to those files.

What

  • essos.perturbations.FaxEigenmode: a BoozerPerturbation built from a FAX v0.0.2 global eigenmode. FaxEigenmode.from_fax(directory, amplitude) reads global_eigenmodes.csv (omega^2) and global_mode_structures.csv (amplitude of each (m, n) Boozer harmonic on the radial grid). Phi is the sum over harmonics of the interpolated profile times sin(m theta - n zeta + omega t + phase); alpha follows (n - m iota) Phi / (omega (G + iota I)) per harmonic, as in AnalyticalAlfvenMode. FAX uses the same cos(m theta - n zeta) convention with n a full-torus integer, so nothing is converted. Amplitude is an input; FAX supplies structure and frequency.
  • No dependency on FAX: the CSV files are the interface. A 4-harmonic, 24-surface mode computed by FAX on the reactor-scale QA wout is committed in examples/input_files/fax_mode (8.5 kB) and the example docstring lists the FAX calls that regenerate it.
  • examples/particle_tracing/fax_alfven_mode.py: 64 3.5 MeV alphas, 0.5 ms, amplitude 2e4 V (22 kHz, m = 3..6, n = 2): loss 9.4% without the wave and 15.6% with it, max |dE/E| 6e-2 with it.
  • README paragraph and a short docs section.

Tests (tests/test_fax_eigenmode.py, 15 s CPU)

  • CSV round trip: potential at an off-grid point equals an independent np.interp/arctan2 evaluation of the stored structure; zero outside the FAX grid; omega = sqrt(omega^2); invalid input rejected.
  • B0.E = 0 for the multi-harmonic mode, and zero amplitude gives the unperturbed RHS to 2e-13 (as in Bierwage, White and Matsuyama 2022 for the analytical mode).
  • Energy change equals the work q(dPhi/dt - d_t alpha B0.xdot) integrated along the orbit to 2e-3 of its peak, with mu constant (White, Theory of Toroidally Confined Plasmas). A Doppler-resonant marker is not used: the ideal wave does no work there.

Checks

JAX_ENABLE_X64=1 pytest tests/test_fax_eigenmode.py: 3 passed. The example ran to completion (100 CPU s). CI not yet run on this branch.

Core: one Perturbation base (potentials/derivatives/axis stop) shared by the
Boozer and native classes, a single envelope(), shorter mode validation and
trace_boozer docstring. Traces are bitwise identical to before.

Examples: the two analytical/VMEC paper benchmarks, their launcher, comparison
and plotting scripts, conventions, sampling and saved reference data become one
paul_alfven_benchmark.py (Boozer and VMEC backgrounds, --historical for the 2023
conventions) plus a short alfven_perturbation.py. The physics verification
lives in the tests instead of a separate benchmark.

Tests: the Boozer, axis-stop and electromagnetic-verification files are merged
into test_perturbations.py, the VMEC map tests into test_native_gc_perturbations.py;
tests of benchmark-script plumbing are dropped.

Docs: shorter page, one figure regenerated by the benchmark script.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant