Skip to content

DCON/RDCON/STRIDE - BUGFIX - sing_lim: take qlim from the edge q and psilim from the outermost crossing - #363

Open
StuartBenjamin wants to merge 1 commit into
PrincetonUniversity:developfrom
StuartBenjamin:fix/sing-lim-edge-q-pr
Open

StuartBenjamin wants to merge 1 commit into
PrincetonUniversity:developfrom
StuartBenjamin:fix/sing-lim-edge-q-pr

Conversation

@StuartBenjamin

@StuartBenjamin StuartBenjamin commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Problem. With sas_flag, sing_lim sets qlim from qmax and starts the Newton search for psilim at the grid point whose q is nearest qlim, anywhere in the plasma. When q peaks inside the plasma rather than at the edge (e.g. q ≈ 5.2 at the axis and 4.75 at the edge), qlim lies above every edge q and psilim converges next to the axis (psilim ≈ 2e-5). RDCON and STRIDE then solve on a sliver: the ODE integration fails and no rational surfaces are found.

Fix. Same change in dcon/sing.f, rdcon/sing.f and stride/sing.F: qlim steps down from min(q(psihigh), qhigh) instead of min(qmax, qhigh), and Newton starts in the outermost grid interval that holds qlim. When q peaks at the edge (qmax = q(psihigh)), qlim and the Newton start are unchanged, so normal equilibria give bit-identical results.

Test (vs develop) Result
docs/examples DIIID and solovev resistive examples, RDCON + STRIDE, n = 1–4 (16 runs) all outputs bit-identical
DIII-D equilibrium with edge-peaked q, reversed shear (176008 at 524 ms) bit-identical (300 of 302 netcdf variables; the other two are cpu/wall time)
DIII-D equilibrium with q peaking at the axis (176275 at 1056 ms, two equilibria) psilim 2.2e-5 → 0.989 at n = 2; n = 1–4 now complete

With sas_flag, qlim came from qmax and Newton started at the grid point nearest qlim anywhere. When q
inside is above the edge q (e.g. an i-file q that rises toward the axis), qlim landed above the edge q
and psilim next to the axis (psihigh 2e-5: RDCON/STRIDE on a sliver, ZVODE failures). qlim now steps
from q(psihigh) and Newton starts in the outermost interval holding qlim; unchanged when q peaks at
the edge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@StuartBenjamin StuartBenjamin changed the title BUGFIX sing_lim: qlim from the edge q, psilim at the outermost crossing DCON/RDCON/STRIDE - BUGFIX - sing_lim: take qlim from the edge q and psilim from the outermost crossing Oct 31, 2026
@StuartBenjamin
StuartBenjamin marked this pull request as ready for review October 31, 2026 18:48

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