Skip to content

Restrict Arnoldi solver to global route#136

Open
krystophny wants to merge 17 commits into
mainfrom
fix/flux-pumping/arnoldi-global-route
Open

Restrict Arnoldi solver to global route#136
krystophny wants to merge 17 commits into
mainfrom
fix/flux-pumping/arnoldi-global-route

Conversation

@krystophny

Copy link
Copy Markdown
Member

Summary

  • factor the existing one-propagator routing predicate
  • reject ArnoldiO2 mode 3 before solve when geometry requires local propagator composition
  • cover axisymmetric tokamak, homogeneous-field, and general-geometry routing cases

Stack dependency: #135 at 6e30459047a026f52da453eb9af59889107647a6. This PR remains pointed at main and must not merge before its dependency.

ArnoldiO2 is a periodic global qflux solver. Existing mode-3 golden records all use the one-propagator route; the solver directly imposes endpoint phase conditions and never defines local transfer/source/flux outputs. Historical transfer construction was unreachable from the initial import and was deleted as dead code in 2019. Sending mode 3 through the all-propagator route therefore has no defined numerical meaning.

The patch preserves the existing routing predicate and every supported mode-3 calculation. It does not change the kinetic operator, periodic boundary conditions, sparse solver, tolerances, discretization, convergence, output layout, ABI, or any supported result. Mode 1 remains the local propagator solver for general geometry.

Closes #134.

Verification

Failing before (6e30459), mode 3 with general helical geometry:

join_ripples: normalization direction=p
join_ripples: normalization column=2
join_ripples: normalization factor=0
Error from Joining, ierr=5

The earlier unguarded stack performed 0/0 at the same undefined local column.

Passing after (37d7076):

ripple_solver_route_test ... Passed
100% tests passed, 0 tests failed out of 1
Static analysis passed (337 Fortran files checked)
Build passed
Tests passed
Lint passed

The same trapped Debug run now exits before ArnoldiO2 or join_ripples:

ERROR STOP isw_ripple_solver=3 requires the single-propagator global route

It produces no qflux output and reports no IEEE exception, NaN, SIGFPE, DGBSV failure, or partial transport result. This is configuration rejection, not a completed physics run.

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.
The zero-source guard added upstream rejects isw_qflux_NA=1 with
in_file_pert='none'. With the misalignment drive, that configuration is
valid: the drive supplies the non-axisymmetric source. Relax the guard
so it fires only when the drive is off or all its amplitudes are zero.
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.

QL: Lorentz join normalizes an exact-zero propagator column

1 participant