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

オープン
#500 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
julia
領域
backend

調査の方向性

Read _solve_dc_tmp in src/InnerLayer/SLAYER/LayerParameters.jl and the existing SLAYER parameter test in test/runtests_slayer_params.jl. Decide how to handle the lar name, then update its normalization and test it against rfitzp; done means the two values satisfy the stated relation and the tests pass.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Julia
スター
11
フォーク
7
平均マージ
4日 3時間
マージ済み PR(30日)
70

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

OpenFUSIONToolkit/GPEC のほかの issue

OpenFUSIONToolkit/GPEC の issue をすべて見る

似ている issue

Julia の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。