Skip to content

Tighten POTATO low-energy resonance handling - #162

Draft
krystophny wants to merge 5 commits into
mainfrom
fix/potato-box-count-hang
Draft

Tighten POTATO low-energy resonance handling#162
krystophny wants to merge 5 commits into
mainfrom
fix/potato-box-count-hang

Conversation

@krystophny

Copy link
Copy Markdown
Member

This draft PR publishes the existing committed state of fix/potato-box-count-hang so the local branch/worktree can be retired after review.

Checks were not run in this cleanup operation; the branch-specific CI should provide validation.

krystophny and others added 5 commits June 22, 2026 16:59
Add the orbit-side support for guiding-center bananas whose tips cross the
last closed flux surface, complementing the libneo field_eq_mod::allow_sol
flag.

- potato.in gains edge_extension (default .false.); tt.f90 sets allow_sol
  from it, so orbits may enter the scrape-off layer in the extended
  equilibrium field.
- New itest_type=4 single-orbit trace: starts one guiding-center orbit from
  (orbit_Rstart, orbit_Zstart) with pitch orbit_lambda and integrates it over
  one bounce via find_bounce with write_orb, writing the trajectory to fort.100.
  This is the minimal check that an edge banana now closes (ierr=0).
- CMakeLists: drop the global -std=f2008/-Wfatal-errors, which leaked into the
  fetched fortplot (needs F2018 assumed-rank) and vode (legacy DO termination),
  breaking the build. The deps now compile with the default standard; POTATO
  sources are unaffected.
Scan freq_n midplane start radii from freq_Rmin to freq_Rmax at fixed pitch
orbit_lambda; at each, trace one bounce via find_bounce and record the bounce
frequency omega_b = 2 pi v0 / taub and toroidal precession omega_phi =
delphi v0 / taub against the flux label rho_pol (from psi at the start point).
Writes freq_scan.dat. With edge_extension the scan extends across the
separatrix into the near-SOL where banana tips still turn.

This is the POTATO side of the rung-2 frequency benchmark against thin-orbit
NEO-RT.
test_freq_scan loops the flux surface s, calling neort init at each, and writes
the bounce frequency Om_th and toroidal precession Om_ph at fixed pitch
(eta = (1-lambda^2)/Bmin, i.e. v_par/v=0.4 at the midplane) and fixed energy
(10 keV D) to freq_scan_neort.dat, with E x B set to zero. This is the
thin-orbit reference curve compared against POTATO itest_type=5.
Emit iota per surface so the rho_pol map can be built from NEO-RT's own
q (q = 1/iota) instead of a gfile q-profile, and densify the scan to 60
flux surfaces for a smoother edge curve.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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