Skip to content

DCON, RDCON, STRIDE - BUGFIX - Keep the dmlim qlim within qhigh - #328

Merged
matt-pharr merged 1 commit into
developfrom
bugfix/sas-qlim-within-qhigh
Oct 23, 2026
Merged

matt-pharr merged 1 commit into
developfrom
bugfix/sas-qlim-within-qhigh

Conversation

@StuartBenjamin

Copy link
Copy Markdown
Collaborator

With sas_flag = t, sing_lim moves qlim to (INT(nn*qlim)+dmlim)/nn and then steps it back only while it exceeds qmax. A qhigh below qmax therefore does not bound the domain: qhigh = 3.1 with dmlim = 0.2 integrates to q = 3.2 and keeps the 3/1 surface. This PR steps back while qlim exceeds MIN(qmax,qhigh), in DCON, RDCON and STRIDE, as Julia GPEC does since OpenFUSIONToolkit/GPEC#298.

DIII-D examples with qhigh = 3.1:

code (example, dmlim) develop: qlim, psilim, rational q this PR
DCON (DIIID_ideal, 0.2) 3.20, 0.802 2.20, 0.585
RDCON (DIIID_resistive, 0.15) 3.15, 0.794, q = 2, 3 2.15, 0.569, q = 2
STRIDE (DIIID_resistive, 0.2) 3.20, 0.802, q = 2, 3 2.20, 0.585, q = 2

The DIII-D, Solov'ev and a10 example decks use qhigh = 1e3, above qmax, so nothing changes for them: DIIID_ideal (DCON) and DIIID_resistive (RDCON) give identical netcdf variables, and delta_gw.out is identical.


🤖 Generated with Claude Code

With sas_flag, sing_lim moves qlim to (INT(nn*qlim)+dmlim)/nn and steps it back only while it exceeds qmax, so qhigh = 4 with dmlim 0.2 integrates to q = 4.2. Step back while qlim exceeds MIN(qmax,qhigh), as Julia GPEC does since OpenFUSIONToolkit/GPEC#298.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
StuartBenjamin added a commit to StuartBenjamin/GPEC-1 that referenced this pull request Oct 18, 2026
@StuartBenjamin
StuartBenjamin marked this pull request as draft October 19, 2026 07:57
@logan-nc logan-nc mentioned this pull request Oct 21, 2026
27 tasks done
@StuartBenjamin
StuartBenjamin marked this pull request as ready for review October 23, 2026 02:13

@matt-pharr matt-pharr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense, I will merge it.

@matt-pharr
matt-pharr merged commit 61a8c2a into develop Oct 23, 2026
5 checks passed
StuartBenjamin pushed a commit to StuartBenjamin/GPEC-1 that referenced this pull request Oct 23, 2026
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.

2 participants