You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
EQUIL/EXAMPLES - Default psihigh_from_layer_overlap on across every deck
Flips EquilibriumConfig.psihigh_from_layer_overlap to true and sets it
explicitly, annotated, in all 17 decks. Kinetic profiles are wired via a
[SLAYER] profile_file entry using each deck's OWN family file -- never a
[KineticForces] block, which would flip needs_kinetic_profiles and change the
auto-grid knot density, an unrelated results channel. A [SLAYER] section
carrying only profile_file is inert: slayer_ctrl.enabled defaults false and the
stage returns before running or writing anything.
Deck sweep, equilibrium stage, all 17:
MOVED DIIID-like_SLAYER 0.9995 -> 0.993281
MOVED DIIID-like_ideal 0.995 -> 0.993281
no-op DIIID gal_resistive, _pe 0.993 (already at the floor)
no-op Solovev x5, LAR x4, a10
n/a DIIID-like_ideal_IMAS needs a runtime dd; flag left off anyway
The analytic decks no-op exactly as predicted: limited plasmas with finite edge
q, so the edge q-law fit is rejected and the two well-separated surfaces never
overlap. LAR has no legitimate kinetic file, so those four no-op on the missing
profiles instead.
NOTE FOR REVIEW: on all four DIII-D decks the psiedge floor OVERRIDES the layer
criterion. Each asks for ~0.9892 and each is held at the q=6 window top. The
feature as configured therefore reduces to "clamp psihigh to the first rational
surface outboard of psiedge"; the layer physics sets the domain nowhere in the
shipped examples.
IMAS deck keeps the flag off with a comment: its rerun path re-runs read_imas and
must resolve the same psihigh on both passes (_validate_psi_nodes errors
otherwise), which is what resolving a new domain changes; "imas" is also outside
EFIT_KINDS so there is no separatrix clamp and no raw psi map.
benchmarks/equil_psihigh_scan.jl now records the structured equilibrium_edge_quality
verdict per point instead of a hand-rolled round-trip, captures et/ep/ev, and adds
a gate-validation pass that fails loudly if any psihigh exists where the gate
passes while the energies are already unusable. It forces the flag off so the
ladder tests the psihigh it sets.
docs: corrects a naming bug I introduced -- workflow.md called the variable
dW_edge_scan_start, but that rename is an unmerged draft (PR #382) and the code
says psiedge. Documents the floor, the cross-section dependency on
[ForceFreeStates] psiedge, and that truncations are reported in mm as well as psi.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PSrf6JCViFfVzqzkQ66o6b
Copy file name to clipboardExpand all lines: docs/src/workflow.md
+19-3Lines changed: 19 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ to different stages and are computed at different times:
52
52
|:--- |:--- |:--- |:--- |
53
53
|`psihigh`|`[Equilibrium]`| The **equilibrium spline domain** — where the ψ grid ends and every spline stops being defined | The deck, then optionally the separatrix clamp and the layer-overlap scan below |
54
54
|`psilim`| internal (`ForceFreeStatesInternal`) | The **stability integration domain** — where the Euler-Lagrange / Δ′ integration stops. Always ≤ `psihigh`|`sing_lim!`, from `qhigh`, `dmlim`, and the equilibrium's `qmax`|
55
-
|`dW_edge_scan_start`|`[ForceFreeStates]`| Start of a**diagnostic** dW(ψ) scan. Moves nothing | The deck |
55
+
|`psiedge`|`[ForceFreeStates]`| Start of the**diagnostic** dW(ψ) scan over `[psiedge, psilim]`. Moves nothing itself, but floors the layer-overlap truncation below| The deck |
56
56
57
57
`psihigh` is chosen before the equilibrium is built; `psilim` is derived from the finished
58
58
equilibrium. Shrinking `psihigh` therefore also pulls `psilim` in, but not the reverse.
@@ -71,6 +71,11 @@ by default:
71
71
`truncate_at_dW_peak` is **not** in this list. It moves `psilim`, not `psihigh`, is documented
72
72
as making Δ′ and δW unreliable, and is retained only for experimental work.
73
73
74
+
!!! note "Pending rename"
75
+
PR #382 proposes renaming `psiedge` to `dW_edge_scan_start`, precisely because it reads like
76
+
the plasma edge when it is only a diagnostic scan start. That PR is still a draft, so the
77
+
name in the code and in every deck today is `psiedge`.
78
+
74
79
### Choosing `psihigh` from resistive-layer physics
75
80
76
81
With `psihigh_from_layer_overlap = true`, the deck's `psihigh` becomes a *first-pass* bound —
@@ -84,7 +89,13 @@ field-line-tracing noise — and the final domain is computed:
84
89
Widths are converted from meters to normalized flux before being compared against surface
85
90
separations.
86
91
3. Where two neighbouring layers overlap, neither surface has a well-separated inner region,
87
-
so the domain is cut at the inner edge of the inner one.
92
+
so the domain is cut at the inner edge of the inner one — **floored** at
93
+
`min(psihigh, top of the rational-q window containing psiedge)`, i.e. the first rational
94
+
surface outboard of `psiedge`. The dW edge scan runs over `[psiedge, psilim]`, so the domain
95
+
has to stay far enough out for its maximum to be findable. When the floor binds, the run
96
+
warns that the retained surfaces are set by `psiedge` rather than by the layer physics.
97
+
Setting `psiedge >= psihigh` (the documented "scan disabled" sentinel) removes the floor.
98
+
The scan also refuses to truncate at all if fewer than two rational surfaces would survive.
88
99
4. If that asks for a larger domain than the first pass, form it and check it with
89
100
[`equilibrium_edge_quality`](@ref Equilibrium.equilibrium_edge_quality); on failure, back off toward the first-pass bound and
90
101
warn, naming the check that failed.
@@ -93,7 +104,12 @@ field-line-tracing noise — and the final domain is computed:
93
104
94
105
The scan needs kinetic profiles, taken from `[SLAYER] profile_file` when present and
95
106
`[KineticForces] kinetic_file` otherwise; with neither configured it is skipped with a message.
96
-
Single-`n` runs only. The domain is chosen once, from the first-pass equilibrium, and the final
107
+
It also reads `psiedge` from `[ForceFreeStates]` for the floor — so although the switch lives in
108
+
`[Equilibrium]`, the behaviour depends on two settings in other sections. Single-`n` runs only.
109
+
110
+
Truncations are reported in millimetres of minor radius as well as in ψ. A cut that reads as
111
+
large in ψ is usually small in physical terms, because ψ is heavily compressed near the edge:
112
+
on the DIII-D-like deck, 0.9995 → 0.98919 removes 3.6 mm, 0.66% of the minor radius. The domain is chosen once, from the first-pass equilibrium, and the final
97
113
equilibrium is re-scanned as a check — it is deliberately not iterated to a fixed point, since
98
114
the auto grid it sits on top of does not itself reach one.
grid_type = "log_asymptotic"# Radial grid packing type
12
12
psilow = 1e-4# Lower limit of normalized flux coordinate
13
13
psihigh = 0.9995# Upper limit of normalized flux coordinate (bounds the equilibrium splines; the integration bound psilim is derived from qhigh/dmlim)
14
-
psihigh_from_layer_overlap = false# Choose the final psihigh from resistive-layer overlap instead of taking it from this file; when true the psihigh above is the first-pass (spline-safe) bound
14
+
psihigh_from_layer_overlap = true# Resolve the final psihigh from resistive-layer overlap; the psihigh above is then the first-pass (spline-safe) bound, floored by the rational-q window psiedge sits in
15
15
mpsi = 0# Number of radial grid points (0 = auto-compute from psi_accuracy)
16
16
psi_accuracy = 0.001# Target absolute error in q for auto-mpsi
psilow = 1e-4# Lower limit of normalized flux coordinate
13
13
psihigh = 0.993# Upper limit of normalized flux coordinate (0.993 stays clear of the separatrix; truncating at ≳0.998 is numerically unreasonable here)
14
+
psihigh_from_layer_overlap = true# Resolve the final psihigh from resistive-layer overlap; the psihigh above is then the first-pass (spline-safe) bound, floored by the rational-q window psiedge sits in
14
15
mpsi = 128# Number of radial grid intervals (0 = two-pass auto grid from psi_accuracy)
15
16
psi_accuracy = 0.001# Target relative accuracy of splined profile derivatives for the auto grid
psilow = 1e-4# Lower limit of normalized flux coordinate
12
12
psihigh = 0.993# Upper limit of normalized flux coordinate (0.993 stays clear of the separatrix; truncating at ≳0.998 is numerically unreasonable here)
13
+
psihigh_from_layer_overlap = true# Resolve the final psihigh from resistive-layer overlap; the psihigh above is then the first-pass (spline-safe) bound, floored by the rational-q window psiedge sits in
13
14
mpsi = 128# Number of radial grid intervals (0 = two-pass auto grid from psi_accuracy)
14
15
psi_accuracy = 0.001# Target relative accuracy of splined profile derivatives for the auto grid
0 commit comments