Equilibrium parameters: compute the stubbed flux bookkeeping fields, and collapse the duplicate psi-on-axis variables
Maintainers usually reply within 3 days
@jhalpern30 is already working on this.
Since Aug 15, 2026.
Assessment
This issue has not been assessed yet.
Description
Fallout from the gpec.h5 schema overhaul (#226, PR #364). While giving the Equilibrium/ scalars literature names I audited every field of Equilibrium.EquilibriumParameters against its assignment site, and two related problems turned up. Neither is a regression — both predate the schema work — but the rename made them visible, so they are worth fixing deliberately rather than carrying forward.
1. Several flux-bookkeeping fields are hardcoded constants, not computed
src/Equilibrium/Equilibrium.jl:370-381 is the sole assignment site for the whole flux-bookkeeping family, and most of it is literals:
pe.params.psi0 = psio
pe.params.psi_axis = pe.psio
pe.params.psi_boundary = 1.0
pe.params.psi_boundary_norm = 1.0
pe.params.psi_axis_norm = 0.0
pe.params.psi_norm = 0.0
pe.params.psi_axis_offset = 0.0
pe.params.psi_boundary_offset = 0.0
pe.params.psi_axis_sign = 1
pe.params.psi_boundary_sign = -1
pe.params.psi_boundary_zero = false
Everything from psi_boundary down is a constant independent of the equilibrium being loaded. In normalized-flux terms psi_axis_norm = 0 and psi_boundary_norm = 1 are true by definition of psi_N, so those two are honest tautologies — but psi_boundary = 1.0 is written with units Wb/rad in the schema and is not the boundary poloidal flux of any real equilibrium, and the offsets/signs/psi_boundary_zero look like they were meant to record what the ingest actually did (Fortran GPEC derived the equivalent quantities from the g-file simag/sibry pair and the COCOS handling). The likely story is that the Julia port stubbed them and nothing downstream noticed.
Separately, four fields of the struct are never assigned anywhere in src/ — ro, zo, psio, b_norm. The HDF5 writer works around the first three by pulling them off PlasmaEquilibrium directly (equil.ro, equil.zo, equil.psio) and b_norm is silently skipped because it stays nothing.
Ask: compute these from the ingest rather than hardcoding them — real psi_axis/psi_boundary in Wb/rad, real offsets/signs reflecting the COCOS/normalization actually applied, a decision on b_norm (compute it or delete the field), and either populate params.ro/zo/psio or delete them in favour of the PlasmaEquilibrium fields so there is one source of truth.
2. Three variables are the same number for psi on axis
psi0, psi_axis, and psio all end up holding the total poloidal flux difference. psi_axis in particular is misnamed: it is assigned pe.psio, i.e. the total flux, not the flux at the axis. psi_axis_norm is likewise an exact duplicate of psi_norm (both 0.0).
For the schema overhaul I took the conservative route: Equilibrium/psi_total is written once (from equil.psio) and the duplicates psi0, psi_axis, psi_axis_norm are dropped from the HDF5 output via EQUIL_H5_SKIP in src/HDF5Schema.jl. That fixes the file, not the struct.
Ask: collapse the redundancy in EquilibriumParameters itself — either delete the duplicate fields, or, if each was intended to mean something distinct (axis flux vs. total flux vs. normalization constant), define those meanings and make the assignments match the names. Whatever survives should have a docstring entry stating which of the three it is; today a reader of the struct cannot tell them apart.
Notes
- Fixing (1) will move numbers only if a downstream consumer reads the stubbed values; a regression-harness run (
regress --cases diiid_n1,solovev_n1 --refs develop,local) should confirm the blast radius before merging. - Any change to which fields exist must be mirrored in
EQUIL_H5_NAMES/EQUIL_H5_SKIP(src/HDF5Schema.jl) and the naming rules indocs/development/hdf5-conventions.md.
- Dominant language
- Julia
- Stars
- 11
- Forks
- 7
- Avg merge
- 4d 1h
- Merged PRs (30d)
- 68
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenFUSIONToolkit/GPEC
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
OpenFUSIONToolkit/GPEC#644 ·
Maintainers usually reply within 3 days
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
OpenFUSIONToolkit/GPEC#643 ·
Maintainers usually reply within 3 days
-
PerturbedEquilibrium - FEATURE - Complete the resistive perturbed-equilibrium workflow from Galerkin and matched resultsPossibly taken @matt-pharr claimed this 1 day ago. Openfeature
OpenFUSIONToolkit/GPEC#635 · 1 comment · 1 assignee ·
Maintainers usually reply within 3 days
-
test
Difficulty 4/5 3-5 days Newbie friendliness 25/100
OpenFUSIONToolkit/GPEC#633 · 2 comments ·
Maintainers usually reply within 3 days
-
Tearing - FEATURE - Add a general modified Rutherford equation for island evolutionPossibly taken @StuartBenjamin claimed this 1 day ago. Openfeature
OpenFUSIONToolkit/GPEC#630 · 1 assignee ·
Maintainers usually reply within 3 days
All issues in OpenFUSIONToolkit/GPEC
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Sienna-Platform/InfrastructureSystems.jl#675 ·
Maintainers usually reply within 2 days
-
TargetEncoder reuses the first level's shrinkage factor for all levels when m > 0Possibly taken @parth-patel010 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
JuliaAI/MLJTransforms.jl#95 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
SciML/RecursiveArrayTools.jl#687 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
SciML/Corleone.jl#179 ·
Maintainers usually reply within 1 day
-
Setup Aqua.jlOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
JuliaUQ/UncertaintyQuantification.jl#363 ·
Maintainers usually reply within 1 day