Skip to content

QL: single-helicity misalignment drive in ripple_solver_ArnoldiO2#119

Open
krystophny wants to merge 7 commits into
mainfrom
feat/ql-misalignment-drive
Open

QL: single-helicity misalignment drive in ripple_solver_ArnoldiO2#119
krystophny wants to merge 7 commits into
mainfrom
feat/ql-misalignment-drive

Conversation

@krystophny

@krystophny krystophny commented Jul 6, 2026

Copy link
Copy Markdown
Member

Implements #118. This branch is stacked on #124 and #121 and remains open against main. The separate child branch for #122 enables source-only execution when this drive supplies a nonzero source.

Summary

Invariants

Switch-off behavior remains unchanged. The drive preserves the existing Arnoldi O2 discretization, collision-moment storage layout, species ordering, ABI, field-line boundary conditions, and Fourier convention. The source uses CGS/Gaussian units and the CAS-checked exp(+i(m theta + n phi)) phase map. No branch in this stack is authorized to merge before the programme-wide gate.

Verification

Test fails on main

With the source-activation regression applied before the drive implementation:

$ cmake --build --preset default --target test_ntv_hel_drive_input
Error: Symbol ‘has_helical_drive_source’ referenced at (1) not found in module ‘ntv_mod’
Error: Function ‘has_helical_drive_source’ at (1) has no IMPLICIT type
ninja: build stopped: subcommand failed.

Test passes after fix

$ fo
Static: OK
Build: OK
Tests: OK (9/9)
Lint: OK
All stages passed

The full pipeline passed twice consecutively after #124 serialized the duplicate build tests.

$ make test
100% tests passed, 0 tests failed out of 7

$ ctest --test-dir build -R "^ntv_hel_drive_input_test$" --output-on-failure
1/1 Test #...: ntv_hel_drive_input_test ... Passed

$ git diff --check
<no output>

The 16 separately managed external-data regressions remain registered under regression;external-data; this branch does not mark that unavailable-data gate passed.

@krystophny

Copy link
Copy Markdown
Member Author

Additional verification: the rotating aligned-pair regression passes. With Om_tE = 3e5 rad/s (convention Om_tE = c Er/(aiota sqrtg_bctrvr_phi), i.e. the rigid toroidal ExB precession -c dPhi0/dpsi_pol), the corrugation-only drive produces a helical-harmonic current of 46.3 (solver units, electron A1 channel); adding the potential aligned in the solver's rotating frame — the geometric aligned amplitude times -n(iota*B_th + B_ph)/(iota*(m*B_ph - n*B_th)), the correction being the parallel return flow of the ExB rotation — suppresses it to 0.12 (factor ~390), while the sign-flipped control doubles it to 92.7. This exercises the drive calibration, the hatOmegaE rotation-term normalization and the sign conventions in a single test (CAS derivation and run inputs live with the physics programme).

@krystophny

Copy link
Copy Markdown
Member Author

@GeorgGrassler please help Sergei to get this branch working when you have some time.

isw_qflux_NA=1 with in_file_pert='none' assembles an identically zero
non-axisymmetric source. That zero vector is the Arnoldi seed, so its
normalization divides by zero (0/0 -> NaN) and zhseqr then fails to
converge at every step, spinning without qflux output. Reject the
configuration in check() with a clear message instead.
Add an optional right-hand side to the non-axisymmetric solve: the
drive of a single-helicity perturbation given by a radial corrugation
field (delta B^s/B_0^phi)_mn and an electrostatic potential harmonic
Phi_mn. The vpar corrugation piece enters the A1/A2 force channels
with velocity weights a3m and x^2 (sigma-odd), the ExB piece with
weights x^-1 and a1m (sigma-even); the two new velocity moments are
computed in compute_sources. Input via new &ntv_input variables
(isw_hel_drive, m_theta_hel, hel_brad_re/im, hel_phim_re/im), default
off. Band profiles, moments and dimensional prefactors follow a
CAS-checked derivation (see issue #118).

Off by default: golden-record QL summary.h5 is reproduced to 1e-15
against a main build.
Review findings on the drive commit: fold the x^(3k-4) weight into a
single power so the x=0 quadrature node stays finite; skip the moment
quadrature on the precomputed-matrix-element path and reject
isw_hel_drive at run time when the moments are unavailable; reject the
unvalidated relativistic branch, reconstruction mode and unset species
data; deallocate asource_hel in collop_unload.
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