Repository navigation
Integrate collisionless resonances along pitch with an error budget shared over harmonics - #266
Merged
Merged
Conversation
krystophny
enabled auto-merge
November 9, 2026 13:13
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 9, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 9, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 9, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 9, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With
vtol > 0the thermal velocity integral of each resonance component (one poloidal harmonicmthof one orbit class: co-passing, counter-passing or trapped) was refined until its own error estimate was belowvtolof its own value. Strongly cancelling high harmonics sit at the noise floor of the bounce integral, never reach that, and each ran to the 4000-panel limit. On the ripple-plateau case (test/ripple_plateau, harmonics up to |m| = 41) a run did not finish in 300 s, against 10 s with the midpoint rule. This is why #265, which makesvtol = 1e-3the default, timed out in the merge queue.Two changes:
max(vtol*|I_c|, vtol*sum_k |I_k| / N), whereI_kis the coarse value of component k and N is the species' component count.mph*Om_ph + mth*Om_thbe the resonance function, u = v/vth and eta the pitch variable. At fixed eta, R is a quadratic in u, because the frequencies are splines in eta times v and v**2. So the integral over u of the eta-roots weighted by 1/|dR/deta| equals the integral over eta of the closed-form u-roots weighted by 1/|dR/du|. The eta range of the component is split where two u-roots merge or a root crosses the speed limitsvmin/vmax, all found from the splines alone. The substitution eta = m - h*cos(theta) on a piece [m - h, m + h] removes the 1/sqrt singularity where roots merge. Adaptive Gauss-Kronrod then runs in theta, starting with four panels per piece. Where R is not quadratic in u (e.g.supban), with a resonance cutout, or with the resonance ledger, the u-adaptive integral is used.Ripple-plateau case, 4 threads. D11 and D12 are compared to the values on which the u-adaptive and pitch integrals agree at
vtol = 1e-5(D11 = 2.158387e-2, to 2e-6). Both use the same orbit physics, so this checks the quadrature, not the model.vtol = 1e-3(main)vtol = 1e-3vtol = 1e-3vtol = 1e-4ASDEX Upgrade 30835 deuterons, magnetic drift on, 32 threads. Toroidal torque on flux surfaces s = 0.105 and 0.302 (normalised toroidal flux), at the physical temperature and at temperature / 10:
vtol = 1e-3vtol = 1e-5(NEO-RT torque output units.)
The serial driver used when no profile splines are loaded (
test/ripple_plateauinput withvthgiven, 8 threads) gets the same two-pass budget. It took over 20 minutes atvtol = 1e-3. It now takes 54 s, against 50 s for the midpoint rule, and agrees withvtol = 1e-5to 2e-6, while the midpoint rule is off by 1.3e-3 (D11) and 2.3e-3 (D12).Every run takes about 5 s. The pitch values agree with the earlier u-adaptive ones to about 1e-5 in these dominant components, and the midpoint rule is off by 1.4 % and 7.5 %.
test/adaptive_velocitygains a test that runs the ripple-plateau case atvtol = 1e-3within a 120 s timeout and checks D11 to 1e-5; on main it times out. The circular-tokamak convergence test passes. Of the CTest suite 149 of 154 pass. The other five (test_profile_probe,test_species_mixture_output,test_species_mixture_cli,test_collisional_layer_table,test_collisional_layer_generator) stop with "No module named 'numpy'" in the interpreter CMake found here, and fail the same way on a main build.vtol = 0stays the default, so golden records are unchanged.Chris&AI