Skip to content

Addition of Phi_res_crit_callen#274

Open
priyanshlunia wants to merge 1 commit into
developfrom
add_phi_crit_callen
Open

Addition of Phi_res_crit_callen#274
priyanshlunia wants to merge 1 commit into
developfrom
add_phi_crit_callen

Conversation

@priyanshlunia

@priyanshlunia priyanshlunia commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Closes #240.

Summary

Adds the Callen critical resonant flux — the vacuum resonant flux Phi_res_v at which the vacuum
island width equals the Callen critical width (w_vac = w_v_crit) — to gpout_singfld
(gpec/gpout.f). This is the Callen-model analog of the SLAYER Phi_res_crit already output by
GPEC, enabling a Callen-vs-SLAYER threshold comparison (the motivation in #240 / #237).

What it does

The vacuum island scales as w_vac ∝ sqrt(Phi_res), so the flux required to reach the critical
width is

Phi_res_crit_callen = |Phi_res_v| * (w_v_crit / w_vac)^2      [Tesla]

which reuses the existing Callen machinery (hw_v, hw_v_crit, vsingfld) — both widths are in
psi_n at the point of use, so the ratio is clean. The |Phi_res_v| magnitude cancels
analytically, making this a true, drive-independent threshold (verified below).

Outputs added

Mirrors the existing b_crit / Phi_res_crit plumbing, so it appears alongside the other Callen
quantities in all three places:

Output Name
netCDF gpec_profile_output_n*.nc Phi_res_crit_callen (units T)
ASCII gpec_singfld_n*.out Phi_crit_callen column
verbose stdout table Phi_crit_cal column

Verification (DIII-D ideal example)

  • Builds cleanly (gfortran); baseline Phi_res_crit_callen = [8.74e-4, 1.01e-3, 7.33e-4, 8.18e-4] T
    across the four rational surfaces — consistent across netCDF, ASCII, and stdout, and comparable in
    magnitude to SLAYER's Phi_res_crit (the intended cross-model comparison).
  • Validation: scanning the coil current (0.5×–8×) shows Phi_res_crit_callen stays exactly
    constant
    over the full 16× drive range (a genuine drive-independent threshold), while the measured
    w_vac (∝√Φ) crosses the constant measured w_v_crit precisely at Phi_res_v = Phi_res_crit_callen.
    Normalized across all surfaces, every curve collapses onto y = √x through (1, 1). The measured
    widths come from GPEC's own island-width computation while the threshold comes from the new ratio
    formula, so their coincidence is an independent check.
phi_crit_callen_validation

Notes

  • Single-file change (gpec/gpout.f, gpout_singfld); no changes to inputs or the shipped example.
  • The ASCII gpec_singfld row/header widths were incremented for the new column.

Compute the resonant flux at which the vacuum island width equals the
Callen critical width (w_vac = w_v_crit), as Phi_res*(w_crit/w_vac)^2 in
gpout_singfld. This is the Callen analog of the SLAYER Phi_res_crit,
enabling direct model comparison (issue #240). Output alongside the other
Callen quantities: netCDF (Phi_res_crit_callen), the singfld ASCII table
(Phi_crit_callen), and the verbose stdout table (Phi_crit_cal).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

Add Phi_crit_callen

2 participants