Repository navigation
InnerLayer.SLAYER - API! - Default the layer radial label to the toroidal-flux label - #599
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.
…er the flux label, and pin it in the layer-input test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he flux label in the rs output Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdRsGGg4YRG6E9fgLGbpdF
|
@d-burg I pushed |
…ux-radial-label # Conflicts: # test/runtests_layer_overlap_fitzpatrick.jl
249f268 to
0049f1e
Compare
Keep both the derived toroidal geometric factor's description and the flux-label note on theta_sample in the SLAYER control docstring. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0186CLfjeJeSusNTva5RMfGU
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 68 % (coupled: 44 %) and the real frequency by ≤ 0.12 %. The critical resonant field moves on the 3/1 surface (br_crit−5.8 %,Q_peak+41 %,Q0+30 %) and appears on the 4/1 surface, which has none on develop (br_critNaN → 1.6e-4,Q_peakNaN → 0.40) because the largertau_kraises itsQ0from 0.21 to 0.34; 2/1 has none on either. Ideal DCON, perturbed-equilibrium and layer-overlap truncation quantities are untouched (harness @ bcec399)build_slayer_inputs,radial_labelorresistive_layer_overlapthat want the old outboard-midplane chord must now passrs_method=:midplaneexplicitly. The[SLAYER] theta_samplekey is still accepted but now has no effect from TOML (the flux label does not depend on poloidal angle) and warns when nonzero. The HDF5Tearing/PerSurface/rsdataset is now the toroidal-flux minor radius √(2ψ_t/B₀).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 = √(2ψ_t/B₀), the coordinate the Fitzpatrick layer formalism is derived in, instead of the outboard midplane chord.
Closes #417.
Changes
rs_methoddefaults (radial_label,build_slayer_inputs,resistive_layer_overlap) flipped from:midplaneto:flux, with their docstrings. No formula changed.SLAYERControlvalidation warns whentheta_sampleis nonzero; thethetadocstrings ofbuild_slayer_inputsandresistive_layer_overlapnow say it is used only byrs_method=:midplane.PerSurface/rslong name and the layer-overlap table indocs/src/stability.mdname the label: minor radius √(2ψ_t/B₀).runtests_slayer_inputs.jlpins the expectedrstors_method=:fluxwhile building with the default, so a future default change fails the test.runtests_layer_overlap_fitzpatrick.jlexpects thetheta_samplewarning.Regression report
Run on alfven (3 threads, Julia 1.11.7, pinned manifest) at
bcec3990a, the branch with developb6a28892dmerged (after #441 and #581), against that develop:--cases diiid_slayer_n1,diiid_slayer_n1_coupled,diiid_slayer_n1_chi_perp_e,diiid_slayer_n1_winding,diiid_truncation_n1,diiid_n1 --refs origin/develop,bcec3990a; no stale-baseline banner. The percentages are those of the earlier run against develop5b2258e5ato within rounding, and #441's newD_georow moves with the r-based shear (57 %), as the flux label implies. The SLAYER and CRF rows are expected to move. The CRF rows readN/Abecause develop has NaN on the 2/1 and 4/1 surfaces; the per-surface values are:br_critbr_critQ_peakQ_peakQ0Q0(The table's per-surface values are from the run against develop
5b2258e5a; the rerun after #441 shows the same rows changed, with the sameN/Apattern.)diiid_truncation_n1(12 unchanged) confirms the layer-overlap cut does not move, anddiiid_n1is 53 unchanged.Full regression report
Notes for reviewers
runtests_slayer_inputs.jl,runtests_layer_overlap_fitzpatrick.jl,runtests_innerlayer.jl,runtests_critical_resonant_field.jl,runtests_slayer_runner.jl,runtests_slayer_params.jl,runtests_slayer_riccati.jl,runtests_dispersion_winding.jl.bcec3990a. On that merged treeruntests_slayer_runner.jl,runtests_slayer_inputs.jl,runtests_slayer_params.jl,runtests_layer_overlap_fitzpatrick.jl,runtests_critical_resonant_field.jlandruntests_dispersion_coupled.jlall pass (562 assertions, alfven, 3 threads), and the harness above carries InnerLayer.SLAYER - FEATURE! - 🚨 Derive the toroidal critical-Δ geometric factor in the r_s reference #441'sD_georow.🤖 Generated with Claude Code
https://claude.ai/code/session_01VdRsGGg4YRG6E9fgLGbpdF