Repository navigation
Conversation
…idal-flux label The Fitzpatrick layer widths are derived in r = sqrt(2 psi_t / B0), so make that label the default for rs, the r-based shear, S, tau_R and the Delta-prime reference length instead of the outboard-midplane chord. The overlap scan already evaluated its criterion in this label; the layer stack now agrees. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0186CLfjeJeSusNTva5RMfGU
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0186CLfjeJeSusNTva5RMfGU
There was a problem hiding this comment.
Thanks @logan-nc. The flip itself looks right to me: the flux label is the coordinate the Fitzpatrick layer formalism is written in, and the change is confined to the three defaults. A few claude things before it can land:
Checked on current develop. I merged develop 0b4b9fbfb into the branch locally (clean) and reran diiid_slayer_n1 on feynman. The shifts are essentially the ones in your report, so #501's P_perp_model=:D_perp default doesn't change the picture. The branch still needs the develop merge and a new stamp for CI.
theta_sample becomes a no-op. TearingProblem passes theta=control.theta_sample to build_slayer_inputs, and :flux ignores θ. Since rs_method isn't in the TOML, no deck can reach a θ-dependent label any more, but the [SLAYER] key is still accepted and its docstring (Tearing/Runner/Control.jl) still says it sets where the minor radius is sampled. So "the TOML interface is unchanged" isn't quite true: either warn when theta_sample is set, or document that it only affects rs_method=:midplane callers of the API.
Stale header. The file comment at the top of LayerInputs.jl still says the minor radius is taken at the outboard midplane from rzphi_rsquared((ψ, 0.0)).
Test. Deriving the expected rs from radial_label(equil) makes the test follow the default, which also means it can't catch the default changing again. Pinning rs_method=:flux explicitly would.
Interaction with #441 and #415. Neither conflicts textually with this branch.
- #441: its toroidal-D_geo wiring test in
runtests_slayer_inputs.jlbuilds its referencek_reffromsurface_minor_radius/surface_da_dpsi, so with this PR merged six assertions fail (dgeo_val,kpar_val,k_ref). The physics is fine:dgeo_valandk_refmove by the same factor (0.811), which is the expected scaling with K. It's a test that hard-codes the midplane label, and I'll make it label-agnostic on #441 so the merge order doesn't matter. - #415: its tests pass on the combined tree, but its harness pins move:
br_crit5.8 %,Q_peak40.8 %,Q029.6 % (throughtauk). Whichever of the two merges second needs a new stamp.
Overall I'm in favor of shipping this in 2.0 for the improved inner layer model accuracy.
Release note
rsmoves by up to 46 %, the r-based shear by 57 %, the Lundquist number by 10 %,D_norm,tau_k,Q_e,Q_iand the Q roots by 17 to 84 %, the growth rate by up to 66 % and the real frequency by 0.05 %. Ideal DCON and perturbed-equilibrium quantities are untouched (harness @ 88a0f1e)build_slayer_inputs,radial_labelorresistive_layer_overlapthat want the old outboard-midplane chord must now passrs_method=:midplaneexplicitly. The TOML interface is unchanged because the label was never exposed there.SLAYER's layer stack (minor radius, r-based shear, Lundquist number, resistive and diffusion times, Delta-prime reference length) is now expressed by default in the toroidal-flux radial label r = sqrt(2 psi_t / B0), the coordinate the Fitzpatrick layer formalism is derived in, instead of the outboard midplane chord.
Regression report
Run from the repo root on feynman,
--cases diiid_slayer_n1,diiid_n1 --refs develop,refactor/slayer-flux-radial-label(4 threads). The SLAYER rows are expected to move; a clean report would have meant the flip did nothing.Notes for reviewers
Refs #417. This is the evidence PR the issue asked for: the three defaults flipped in one place, the harness magnitudes attached, and the decision left to the maintainers. It does not close the issue by itself.
rs_methoddefaults (radial_label,build_slayer_inputs,resistive_layer_overlap) plus their docstrings. No formula changed, so the label comparison testset inruntests_slayer_inputs.jlstill covers every label.rs_method=:fluxexplicitly, so the overlap cut of a default run is unchanged. Only the direct SLAYER stage, which callsbuild_slayer_inputswith the default, moves.runtests_slayer_inputs.jlpreviously pinned the per-surfacersto the midplane helper. It now derives the expectation fromradial_label(equil)so the test follows the default label instead of hard-coding one.runtests_slayer_inputs.jl,runtests_layer_overlap_fitzpatrick.jl,runtests_innerlayer.jl,runtests_slayer_riccati.jl, all passing.Suggested reviewer: @d-burg (Tearing and the layer-overlap evidence behind the issue). Opened as a draft so the maintainers can pick the reviewer and decide whether the flip ships for 2.0.
🤖 Generated with Claude Code
https://claude.ai/code/session_0186CLfjeJeSusNTva5RMfGU