Skip to content

InnerLayer.SLAYER - BUGFIX - Normalize the :lar critical Δ by r_s like the other models #500

Description

@d-burg

Summary

dc_type = "lar" returns the SLAYER critical Δ in m⁻¹. The other two models, "rfitzp" and "toroidal", return it dimensionless, in the r_s reference, and the dispersion relation subtracts it from the dimensionless r_s·Δ′. So the "lar" offset is too large by a factor 1/r_s.

Detail

In _solve_dc_tmp (src/InnerLayer/SLAYER/LayerParameters.jl):

dc_type value units
lar ½ (−D_R) π^{3/2} (χ∥/χ⊥)^{1/4} · √(n·abs(s) / (R₀ r_s)) m⁻¹
rfitzp −√2 π^{3/2} D_R / W_d, with W_d = √8 (χ⊥/χ∥)^{1/4} / √(n·abs(s) r_s / R₀) dimensionless

Substituting W_d, rfitzp = ½ (−D_R) π^{3/2} (χ∥/χ⊥)^{1/4} · √(n·abs(s) r_s / R₀). The two are the same formula, and lar = rfitzp / r_s exactly.

Measured on develop with slayer_parameters (n_e = 3e19 m⁻³, T = 1.5 keV, q = 2, s = 1.2, R₀ = 1.7 m, D_R = −0.05):

r_s [m] lar rfitzp lar·r_s / rfitzp
0.30 38.22 11.47 1 + 6e-12
0.45 33.25 14.96 1 + 6e-12
0.60 30.10 18.06 1 + 6e-12

The residual 6e-12 is the W_d iteration tolerance.

Who is affected

Only runs that set dc_type = "lar". The default is "none", the shipped SLAYER deck uses "none", and no regression case uses "lar". The value reaches the dispersion relation through surface_coupling(...; dc=params.dc_tmp) and the output through PerSurface/D_c_offset.

Proposed fix

Multiply the lar branch by r_s. It then equals rfitzp, so one of the two names is redundant. The open question is which to keep:

  • keep both names as aliases of one formula, or
  • remove "lar" and reject it with a message pointing to "rfitzp".

Either way the unit test in test/runtests_slayer_params.jl that only checks lar is finite should assert the relation to rfitzp.

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