Skip to content

GPEC - NEW FEATURE - Emit optional perturbed Boozer and Hamada field strength - #344

Closed
krystophny wants to merge 5 commits into
PrincetonUniversity:developfrom
krystophny:feat/pmodb-lagb-perp-20261019
Closed

krystophny wants to merge 5 commits into
PrincetonUniversity:developfrom
krystophny:feat/pmodb-lagb-perp-20261019

Conversation

@krystophny

Copy link
Copy Markdown
Collaborator

With pmodb_flag=t and reg_flag=f, add b_lag_perp to NetCDF. With pmodb_gauge_flag=t, additionally solve the field-line gauge equation and emit b_lag_boozer or b_lag_hamada, according to the matching working chart. The gauge and output harmonic coordinates are recorded separately. Existing ASCII columns retain their format.

The target equation is D w=-(div xi_X+a delta B_X/B), a=2 for Boozer and 0 for Hamada, with angles in turns and delta B_target=delta B_X+w partial_theta B. docs/pmodb_target_gauge.rst and native FortSym Q1-Q8 derive it. The real/complex leaves are proved and emitted by gen/pmodb_gauge/generate.py; ordinary builds require no CAS. Only unregularized solutions in a matching Boozer/Hamada working chart are accepted. Nonzero resonant sources fail explicitly; finite spectral/spline resolution remains.

Validation: native Make build; generated code reproduces; the actual operator passes parallel-displacement cancellation, zero-source and resonant-source tests. Hamada-to-Boozer output agrees with the unchanged rmp_torque c3614334 kernel. An end-to-end Boozer run writes finite correctly tagged NetCDF output; exact labels are absent for regularized output. Native operator tests are wired into GNU CI. This is independent of the radial-derivative fix topic: its gauge source uses the derivative selected by gpeq_sol directly.

Chris&AI

… b_lag_perp with pmodb

pmodb_flag now also writes b_lag_perp and b_lag_perp_fun to the profile
NetCDF output: the Lagrangian field strength of the perpendicular
displacement alone,

  b_lag_perp = lagb + (xi_perp^zeta/q) d_theta B
             = eulb + xi_perp.grad B,

the gauge-invariant input that NTV consumers in perturbed Boozer or Hamada
coordinates need. It is the quantity gpdiag_pmodb already prints as llagb;
lagb itself is the xi^zeta = 0 gauge and is unchanged. The ASCII
gpec_pmodb file keeps its format.
@krystophny

Copy link
Copy Markdown
Collaborator Author

Closing: new features now go to the Julia code (OpenFUSIONToolkit/GPEC), and Fortran GPEC receives bug fixes only. The Boozer/Hamada field-line gauge work continues in OpenFUSIONToolkit/GPEC#560, building on the perpendicular-gauge output of OpenFUSIONToolkit/GPEC#543. The derivation and generated kernels on this branch remain the reference for the port.

Chris&AI

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