Skip to content

Global radial knot floor (MIN_KNOT_SPACING = 1e-4) prevents δW convergence when the truncation is within ~1e-3 of the separatrix #687

Open

Description

@d-burg

Summary

On diverted H-mode equilibria with finite edge current, the free-boundary energy does not converge with mpsi once
psilim ≳ 0.9995. Lowering MIN_KNOT_SPACING (src/Equilibrium/Grid/GridRefinement.jl) from 1e-4 to 1e-9, with nothing
else changed, restores convergence. Stock code on a TokaMaker i-file with grid_type = "original", which skips the floor,
gives the same values.

Figure 1 (attached below): n = 1 W_t at q_lim = 5.2 against mpsi for four cases,
floor 1e-4 and 1e-9, with the i-file results. Three runs at mpsi = 256 lie far off the axes and are not drawn (case C:
−1419 with the floor, −153 without; case D: −1627 without).

image

Figure 2 (attached below): edge dW scans with stock code. The grids agree up to just past
q = 5 and separate between there and psilim.

image

Setup

  • Commit 9b43744 (develop) plus the growth-rate change of ForceFreeStates - FEATURE! - Add perpendicular inertia and an ELITE-style growth-rate solve #663.
  • eq_type = "efit" (TokaMaker 513² g-file), jac_type = "hamada", grid_type = "core_edge_packed", psilow = 1e-4,
    psihigh = 0.9995–0.9999, mtheta = 256, flux_surface_rtol = 1e-10; Riccati, vac_flag = true, qlow = 1.02,
    delta_mlow = delta_mhigh = 12, truncate_at_rational_offset = true, rational_offset_fraction = 0.2. Only mpsi varies.
  • q = 5 sits at ψ_N 0.9984–0.9995, so 3–8 × 10⁻⁴ in ψ_N separates the last rational surface from psilim.

Reading

With a 1e-4 floor only a few knots fit between the last rational surface and psilim, whatever mpsi is; raising mpsi
changes which knots survive, not how many. The scatter is non-monotonic, also appears for pow1 and auto, and changes
the sign of the result in case D.

With the floor at 1e-9, a wider set (57 equilibria, n = 1, 2, 3, psilim 0.997–0.9999) gives 171 of 171 mpsi 1024 vs
2048 pairs within 0.05 + 2 %; the largest differences (up to 0.05) are at psilim > 0.9997.

Did not change the result with the floor on: g-file resolution 513² → 2049², i-files read on a GPEC-generated grid,
mtheta 256 → 1024, mtheta_vacuum 480 → 1920, delta_m 12 → 24, singfac_min 1e-3 → 1e-6.

Proposal

Happy to open a PR if this direction is acceptable:

  1. Expose the floor as an [Equilibrium] option, default 1e-4 (no behavior change), and warn when fewer than ~10 knots
    lie between the outermost rational surface and psilim.
  2. Then consider an edge-relative default: spacing floor = min(1e-4, c·(1 − ψ)) with c ≈ 0.02–0.05, bounded below by a
    hard noise floor (~1e-6, or tied to the input equilibrium's resolution). The fixed spacing near rational surfaces
    (RATIONAL_RES_SPACING) stays as is.

Questions

  1. Is the 1e-4 floor needed at the edge, or only where Δ′ is extracted?
  2. Which diagnostic do you want checked before step 2 (force-balance residual, Δ′ at an outer rational surface)?
  3. Kinetic.jl uses the same constant for its knot insertion: should it follow the option?

Not tested

Force-balance residual and Δ′ with the floor lowered; the Forward integrator; kinetic runs; equilibria outside this
family. One n = 3 result at high pressure changes with mtheta (256 vs 512) with the floor lowered; not diagnosed.

Related: #511 noted that GPEC's own radial grid, not the file type, was the larger error near the edge; #525 touched the knot floor for the auto grid; #349.

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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions