Skip to content

Compute_Currents divides bu0 by shalf(js+1) in the asymmetric branch #23

Description

@CharlesCNorton

In the lasym branch of Compute_Currents (read_wout_mod.f:788), bu0 is taken at the wrong half-grid surface:

bu0 = bsubumns_i(:,js  )/shalf(js+1)
bu1 = bsubumns_i(:,js+1)/shalf(js+1)
t2  = ohs*(bu1-bu0)*sfull(js) + 0.25_dp*(bu0+bu1)/sfull(js)
bv0 = bsubvmns_i(:,js  )/shalf(js)
bv1 = bsubvmns_i(:,js+1)/shalf(js+1)

bv0 two lines below, and bu0 in the stellarator-symmetric branch above, both divide by shalf(js). ORNL-Fusion/LIBSTELL read_wout_mod.f90 carries shalf(js) here; the copy vendored in this repository predates that.

bu0 enters t2, and t2 enters only currvmns_o(:,js) = xm_nyq_i(:)*t1 + t2, so the odd-m asymmetric toroidal current harmonics are the only quantity affected. Two builds differing in nothing but this index, on input.cth_like_fixed_bdy_asym: currvmns in the wout changes by 0.72 of its own maximum, and every other variable in the file is unchanged.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions