Skip to content

BAL - FEATURE - Port Julia GPEC local ballooning stability - #362

Open
jmlmir369 wants to merge 6 commits into
developfrom
feature/julia-ballooning-local-stability
Open

jmlmir369 wants to merge 6 commits into
developfrom
feature/julia-ballooning-local-stability

Conversation

@jmlmir369

Copy link
Copy Markdown
Collaborator

Ports the local ballooning-stability solver from Julia GPEC into Fortran DCON, RDCON, and STRIDE, consolidating the local stability evaluations into a unified bal_scan routine.

Control Flags

  • mer_flag = t: Evaluates the Mercier and resistive interchange indices ($D_I, D_R, H$).
  • bal_flag = t: Additionally solves the high-$n$ ballooning ODE and searches the marginal pressure-gradient boundary:
    • ballooning_Delta_prime: High-$n$ ballooning matching index ($\Delta' > 0$ is unstable).
    • alpha and alpha_critical: Equilibrium pressure-gradient parameter and the first infinite-$n$ ballooning stability boundary ($\alpha > \alpha_{\mathrm{critical}}$ is unstable).

Validation

  1. Legacy Fortran Consistency (mercier.f vs bal.f):
    • Compared on the DIII-D-like ideal equilibrium (33 radial surfaces).
    • $D_I, D_R, H$ signs agree 100% across all surfaces.
    • Median relative differences: $1.77 \times 10^{-5}$ ($D_I$), $7.78 \times 10^{-5}$ ($D_R$); $H$ is identical ($\Delta H \equiv 0$).
    • Core behavior remains physically consistent ($D_I, D_R < 0$, stable).
legacy_mercier_profile_comparison
  1. Julia JPEC Cross-Check (Ballooning Solver):
    • Ballooning $\Delta'$: 100% sign agreement across all 33 surfaces; median relative difference is $1.24 \times 10^{-5}$.
    • Boundary $\alpha_{\mathrm{critical}}$: Evaluated on the same 13 surfaces ($0.22 \le \psi_N \le 0.77$) with 100% sign agreement; median relative difference is $1.20 \times 10^{-4}$ (max absolute error $0.041$).
    • Equilibrium $\alpha$: Median relative difference $7.15 \times 10^{-7}$ across common finite surfaces.
ballooning_julia_fortran_symlog

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant