Skip to content

Fix field_eq flux gauge and translated wall stretching - #403

Merged
krystophny merged 3 commits into
mainfrom
fix/field-eq-flux-units-401
Jul 26, 2026
Merged

Fix field_eq flux gauge and translated wall stretching#403
krystophny merged 3 commits into
mainfrom
fix/field-eq-flux-units-401

Conversation

@krystophny

Copy link
Copy Markdown
Member

Summary

  • normalize field_eq poloidal-flux state to one shifted gauge and one cgs unit
  • make convex-wall stretching invariant under rigid vertical translation
  • add focused native regressions for both defects

Root causes

field_eq converted and shifted psif and psi_sep to G cm²/rad while leaving psi_axis in the GEQDSK input unit and absolute gauge. Downstream normalized-flux expressions then subtracted incompatible quantities.

Separately, stretch_coords inferred a radial wall center but hard-coded the vertical center to Z=0 in its polar map. A vertically displaced equilibrium could therefore map interior points outside and change under a rigid Cartesian translation.

Changes

  • serialize psi_axis=0, psif=(PSIRZ-SIMAG)*1e8, and psi_sep=(SIBRY-SIMAG)*1e8
  • retain the existing magnetic-field components while making normalized flux gauge invariant
  • infer both R0 and Z0 from the convex wall and consistently use local (R-R0,Z-Z0) coordinates
  • regress axis/LCFS flux endpoints and an additive GEQDSK flux-gauge shift
  • regress a translated circular wall, including interior/exterior classification and ray preservation

Validation

  • all 10 field-labelled native tests pass
  • the translated-wall oracle fails on the old hard-coded-Z=0 implementation and passes after the fix
  • the flux-endpoint regression verifies one shifted G cm²/rad gauge at the magnetic axis and LCFS

Relationships

Fixes #401.
Fixes #402.

This is a stacked dependency of itpplasma/NEO-RT#80. It changes flux metadata/state and translated-wall geometry; it does not infer COCOS, flip a field component, or fit a cross-code sign, phase, gain, or radius.

@krystophny krystophny left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed latest b5272f4d after merging current main. The shifted G cm^2/rad flux gauge is consistent at axis and LCFS, while wall stretching now derives both R and Z centers and is translation invariant. These are behavioral endpoint/translation oracles and do not infer COCOS or flip field components. Native suite: 95/95 passed. No blocking finding.

@krystophny
krystophny marked this pull request as ready for review July 26, 2026 17:46
@krystophny
krystophny merged commit f73c6de into main Jul 26, 2026
6 checks passed
@krystophny
krystophny deleted the fix/field-eq-flux-units-401 branch July 26, 2026 17:47
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.

stretch_coords is not invariant under vertical translation field_eq mixes Wb psi_axis with shifted G cm² psif and psi_sep

1 participant