Skip to content

Utilities - FEATURE - Add the Redl bootstrap current as TokaMaker computes it - #667

Open
logan-nc wants to merge 4 commits into
developfrom
feature/bootstrap-current
Open

logan-nc wants to merge 4 commits into
developfrom
feature/bootstrap-current

Conversation

@logan-nc

@logan-nc logan-nc commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Adds Utilities.BootstrapCurrent: the flux-surface-averaged bootstrap current ⟨j_bs·B⟩ from the Redl et al. (2021) closure, assembled the way OpenFUSIONToolkit TokaMaker assembles it, so that a GPEC calculation and a TokaMaker equilibrium carry the same bootstrap current.

What is added

  • bootstrap_current(equil, kinetic=equil.kinetic; psi_N, Z_dom) returns ⟨j_bs·B⟩, j_φ,bs = ⟨j_bs·B⟩ F⟨1/R⟩/⟨B²⟩ (the field-aligned part; TokaMaker's jphi_bs adds the pressure-driven P′(⟨R⟩ − F²⟨1/R⟩/⟨B²⟩)), and the intermediates (f_t, ν*_e, ν*_i, ε, R_geo, q, F, ⟨B²⟩, ⟨1/R⟩, ⟨1/R²⟩, L31, L32, L34, α) on a ψ_N grid.
  • The pieces are public:
    • redl_coefficients (Redl Eqs. 10–21, L34 = L31);
    • jdotB_bootstrap;
    • circulating_fraction (Sauter's ¾ f_tu + ¼ f_tl from surface moments of |B|);
    • surface_moments;
    • coulomb_log_i, nu_star_e_floored and nu_star_i_koh.
  • Z_eff comes from the kinetic zeff profile, or else from the same quasineutral closure the inner layers use.
  • Docs: a "Bootstrap current" section in docs/src/utilities.md and the two citations.
  • Nothing in the existing pipeline calls it yet, so no output changes. It is meant to feed the bootstrap term of the modified Rutherford equation (#665: MRE with saturated-island roots, applied-field forcing and a Callen preset) on one normalization with the curvature term, and the bootstrap-current change across a flattened island.

Verification

  • Unit tests against TokaMaker (test/runtests_bootstrap_current.jl, 60 tests):
    • coefficients and assembly match TokaMaker's redl_bootstrap (OFT 637ddb5) to 1e-12 at six points spanning f_t, Z_eff and both collisionalities;
    • the Coulomb logarithms match calculate_ln_lambda;
    • the circulating fraction matches its definition, converges with grid, has the 1.46√ε limit, and agrees with the exact pitch-angle integral to 2 %;
    • end to end on the DIII-D-like SLAYER example, the result is co-directed with the equilibrium ⟨j·B⟩.
  • End to end against TokaMaker on its public ITER H-mode example: TokaMaker solve, then gEQDSK, then GPEC, with the same kinetic arrays. The figure is in the review package: https://claude.ai/artifact/FyFtgZ1oZw9civQiBEiutm
    • ⟨j·B⟩ agrees to 0.48 % over ψ_N 0.1–0.9, independent of resolution.
    • Passing TokaMaker's intermediates through these functions agrees to 4e-16. q, f_t, F, ⟨1/R⟩ and ⟨B²⟩ agree to ≤ 0.02 %.
    • The 0.48 % comes entirely from the ε and R definitions. The installed reference (OFT 26.6 Python) uses ε = ⟨a⟩/⟨R⟩ and ⟨R⟩. This PR uses (R_max − R_min)/(R_max + R_min) and R_geo, which are the current TokaMaker defaults (use_sauter_eps = True at 637ddb5). Substituting the 26.6 values closes the gap to 0.024 %.

Question for @d-burg: is (R_max − R_min)/(R_max + R_min) with R_geo the convention TokaMaker will keep? If not, the change is one line in surface_moments.

Release note

  • Audience: users
  • Numerical impact: none (harness @ e0467b7; the later 6f8ae85 only adds input checks to a function no pipeline stage calls)
  • Migration: none

GPEC can compute the bootstrap current ⟨j_bs·B⟩ from kinetic profiles with the Redl 2021 closure, matching OpenFUSIONToolkit TokaMaker, via Utilities.bootstrap_current.

Part of #630 (general MRE).

logan-nc and others added 2 commits November 8, 2026 22:17
…putes it

Add the BootstrapCurrent utilities: exact Redl 2021 coefficients with L34 = L31, Koh ion collisionality, floored NRL Coulomb logarithms, the Sauter circulating fraction from surface moments of |B|, the jboot1 assembly of the flux-surface-averaged bootstrap current, and a profile-level entry point on a PlasmaEquilibrium with kinetic profiles. Tests compare against reference values from the OpenFUSIONToolkit TokaMaker Python implementation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BgNxCBwLNHQmVq7iXMCTae
…trap_current, as the inner layers do

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 10, 2026
@github-actions github-actions Bot added the feature New capability label Nov 10, 2026
@logan-nc
logan-nc marked this pull request as ready for review November 14, 2026 03:47
logan-nc and others added 2 commits November 14, 2026 00:15
… state its jphi_bs convention

bootstrap_current now rejects a psi_N grid with fewer than three points, out of order, or outside (0, 1), and rejects zeff or impurity_charge below 1, as the inner layers do. The docstring says jphi_bs is the field-aligned part, without TokaMaker's pressure-driven term. Tests add the gradient stencil on a non-uniform quadratic and the rejected grids.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BgNxCBwLNHQmVq7iXMCTae

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant