Skip to content

Fix IMAS sign of B0 and v_loop in core_profiles I/O - #2933

Open
MireilleSchneider wants to merge 1 commit into
mainfrom
fix/imas_b0_vloop_sign
Open

MireilleSchneider wants to merge 1 commit into
mainfrom
fix/imas_b0_vloop_sign

Conversation

@MireilleSchneider

Copy link
Copy Markdown
Collaborator

TORAX converts its positive internal currents to the IMAS COCOS convention by flipping Ip and the current densities when writing
core_profiles, and the equilibrium writer flips B0. The core_profiles writer did not flip vacuum_toroidal_field.b0 nor global_quantities.v_loop, so for a standard ITER case (Ip < 0, B0 < 0) the output had b0 > 0 and v_loop with the sign of the internal current. This violates the COCOS 17 consistency rule sign(q) = sign(Ip * B0) checked by IMAS-Validator, and gives a loop voltage of the wrong sign relative to Ip (v_loop is an "ip_like" COCOS quantity, independent of B0).

  • output/core_profiles.py: write -B_0 and -v_loop_lcfs.
  • input/core_profiles.py: read v_loop_lcfs as -global_quantities.v_loop,
    consistent with the Ip flip already applied on input (B0 is already
    read as an absolute value).
  • Add test_b0_and_v_loop_signs_follow_imas_cocos.

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