Skip to content

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

Open
@mkovari

Description

@mkovari

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    PhysicsRelating to the physics models

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions