Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]Alphaj becomes negative, giving error in Wilson bootstrap routine #3341

Open
mkovari opened this issue Oct 7, 2024 · 1 comment
Open
Labels
Physics Relating to the physics models

Comments

@mkovari
Copy link
Collaborator

mkovari commented Oct 7, 2024

This was observed by Jon in #213, and leads to error 76 in bootstrap_fraction_wilson. This is because iprofile=1 and qstar has dropped below q0 in routine culcur; so alphaj becomes negative, eventually leading to aj being NaN. I suggest that alphaj is prevented from becoming negative at the point at which it is set in routine culcur:

        if iprofile == 1:
            # Ensure current profile consistency, if required
            # This is as described in Hartmann and Zohm only if icurr = 4 as well...

            # Tokamaks 4th Edition, Wesson, page 116
            alphaj = qstar / q0 - 1.0

Note that the Wilson bootstrap routine is always run, even if it is not selected in the input file:

# Calculate bootstrap current fraction using various models

James claimed to have fixed this problem but it seems to have come back.

Steps to reproduce

Pirizad IN.DAT.txt

Expected behaviour

alphaj should remain positive somehow.

Evidence

image

@chris-ashe chris-ashe added the Physics Relating to the physics models label Oct 8, 2024
@chris-ashe
Copy link
Collaborator

This was something I cam across doing #3263. The definition for alphaj above is from Wesson and assumes a circular cross-section plasma using $q_{cyl}$ or qstar in this case. Which is hardly a case used for normal PROCESS runs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Physics Relating to the physics models
Projects
None yet
Development

No branches or pull requests

2 participants