Repository navigation
Conversation
…fraction trapped_fraction used h = B_min/B_max and the inverted ratio <B>^2/<B^2>, which overestimates the effective trapped fraction by 25-40 % (0.7745 vs exact 0.6129 at epsilon = 0.2). It now returns the Lin-Liu & Miller 1995 upper bound f_tu with h = <B>/B_max and <B^2>/<B>^2, within 2 % of the exact value (above it, as an upper bound) for epsilon between 0.05 and 0.4. B_min is kept in the signature but is no longer used. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BgNxCBwLNHQmVq7iXMCTae
Collaborator
Author
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.
Utilities.NeoclassicalResistivity.trapped_fractioncites Lin-Liu & Miller (1995) but evaluates a different expression: it uses h = B_min/B_max and the prefactor ⟨B⟩²/⟨B²⟩, where the paper's upper bound (Eq. 4) has h = ⟨B⟩/B_max and ⟨B²⟩/⟨B⟩². The result runs 15–45 % above the exact effective trapped fraction. This PR evaluates Eq. (4) as written.Effect
f_t for B = 1/(1 + ε cos θ), against the exact pitch-angle integral (Lin-Liu & Miller Eq. 1):
The remaining excess is the bound's own: 1.5√ε against the exact 1.46√ε as ε → 0 (Eqs. 14–16), closing at larger ε.
The function's one caller is
ResistEval, whosef_trapsets the F_33 neoclassical-resistivity correction (Sauter and Redl models, the SLAYER default). A lower f_t raises the parallel conductivity, so η falls and τ_R and S rise on every surface; layer quantities move with them.Changes
trapped_fraction: h = ⟨B⟩/B_max and the ⟨B²⟩/⟨B⟩² prefactor; docstring and file header cite Eq. (4).B_minstays in the signature for the existing call site and is unused.test/runtests_utilities.jl: checks the result against the exact integral (QuadGK) at ε = 0.001–0.4: an upper bound, and within 3 %.Lin-Liu & Miller's recommended estimate, the weighted average ¾ f_tu + ¼ f_tl (Eq. 18), needs one more surface average of |B| than this signature takes. #667 (Redl bootstrap current as TokaMaker computes it) adds it as
circulating_fraction; once that merges,ResistEvalcould switch to it in a follow-up.Release note
The neoclassical trapped-particle fraction behind the Sauter and Redl resistivity models was 15–45 % too high; it now follows Lin-Liu & Miller Eq. (4), so η is lower and S higher on every surface.