Skip to content

Utilities - BUGFIX! - Use the Lin-Liu & Miller upper bound in trapped_fraction - #670

Closed
logan-nc wants to merge 1 commit into
developfrom
bugfix/trapped-fraction
Closed

logan-nc wants to merge 1 commit into
developfrom
bugfix/trapped-fraction

Conversation

@logan-nc

Copy link
Copy Markdown
Collaborator

Utilities.NeoclassicalResistivity.trapped_fraction cites 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):

ε exact develop this PR
0.001 0.0462 0.0670 (+45 %) 0.0474 (+2.6 %)
0.05 0.3228 0.4489 (+39 %) 0.3290 (+1.9 %)
0.2 0.6129 0.7745 (+26 %) 0.6184 (+0.9 %)
0.4 0.8035 0.9248 (+15 %) 0.8060 (+0.3 %)

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, whose f_trap sets 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_min stays 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, ResistEval could switch to it in a follow-up.

Release note

  • Audience: users
  • Numerical impact: SLAYER and critical-resonant-field outputs change. In diiid_slayer_n1 the relative changes are S 29 %, γ 30 %, Q roots 15 %, critical b_r 17 %, P_perp 60 %. diiid_n1, gal_resistive_diiid and solovev_n1 are unchanged (harness @ 77807c6 vs develop f11d75a, matching environments)
  • Migration: none

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.

…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
@logan-nc logan-nc self-assigned this Nov 12, 2026
@github-actions github-actions Bot added the bugfix Something was wrong and now is not label Nov 12, 2026
@logan-nc logan-nc changed the title Utilities - BUGFIX - Use the Lin-Liu & Miller upper bound in trapped_fraction Utilities - BUGFIX! - Use the Lin-Liu & Miller upper bound in trapped_fraction Nov 13, 2026
@github-actions github-actions Bot added the changed-results Results move or an interface breaks - read before upgrading label Nov 13, 2026
@logan-nc

Copy link
Copy Markdown
Collaborator Author

Folded into #665 (the modified Rutherford PR), which carries this change as 17cb9bf and reports its numerical impact in its release note, so the whole branch is reviewed at once.

@logan-nc logan-nc closed this Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Something was wrong and now is not changed-results Results move or an interface breaks - read before upgrading

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant