Skip to content

evaluate_solovev writes the poloidal field in the opposite orientation family from the rest of the module #600

Description

@HongSik-Yun-Fusion

`evaluate_solovev` in `vaft/process/_equilibrium_parametric.py` returns `b_r = -dpsi_dz/R` and `b_z = +dpsi_dr/R`, which is the `k = +1` form, the orientation family with a positive product of the toroidal and poloidal sign conventions (COCOS 1/4/5/8).

Everywhere else in the module the poloidal field comes from `_bp_factor`, whose fallback for an unidentified convention is `k = -1` (COCOS 2/3/6/7). So the analytic Solovev field is in the opposite family from every numerically derived one.

`solovev_to_equilibrium` reconciles the two only on the 2pi axis: its docstring and its code handle the full-weber scaling and say nothing about the sign. A round trip through `solovev_to_equilibrium(convention=11)` into `derive_global_descriptors` gets the factor of 2pi right and, if the declared index is honoured for the sign, can invert the field relative to the analytic `b_r` and `b_z` it came from.

Decide which family the analytic model is in, state it, and make the export reconcile both halves rather than one.

Found while documenting the equilibrium layer under the process documentation contract (#419). Filed rather than fixed, per that issue's rule that a convention applied inconsistently is a numerical-correctness bug with its own review.

🤖 Generated with Claude Code

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

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions