PE - FEATURE - Port Fortran sing_spot / use_res_spot for the resonant jump radius (and try layer-width spots for kinetic cases)

Đang mở
#427 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

@matt-pharr đang làm issue này rồi.

Từ ngày 22/8/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

Problem

The PE singular-coupling jump is evaluated at ψ_s ± spot_psi with a hard-coded numerator (SingularCoupling.jl:378):

spot_psi = 5e-4 / (abs(nn) * abs(sing_surf.q1))

annotated "spot = 5e-4 matches Fortran default singfac_min". That annotation is wrong on both counts: the Fortran quantity is sing_spot, its own namelist knob (default 5e-4, gpec.f:123), unrelated to singfac_min. So the Julia port reproduces the Fortran default but drops the knob — and drops a second capability entirely.

What Fortran actually does

gpec.f:486-508 builds a per-surface sing_spots(ising) array:

  • default: sing_spots(ising) = sing_spot (5e-4);
  • with use_res_spot = .TRUE. (requires gal_flag): sing_spots(ising) = sing_resspot·(n·|q′|)·sfac^(−1/3) + sing_spot, i.e. the matching radius is set by the resistive resonant-layer width (the S^(−1/3) scaling from singtype(ising)%restype), floored at sing_spot.

Consumed as lpsi/rpsi = respsi ∓ spots(ising)/(nn·|q1|) (gpout.f:598-603, and the same in gpout_singfld:1658-1663). The netCDF output even ships them as sing_spots ("Sweet spots used for calculating resonant jump quantities").

Proposed work

  1. Baseline fidelity: expose sing_spot as a control ([PerturbedEquilibrium]), replace the literal, and fix the misleading annotation. Default 5e-4 keeps current behaviour bit-identical.
  2. Per-surface resistive spot: port the use_res_spot branch — matching radius from the resistive layer width per surface, floored at sing_spot. The ingredients exist on the Julia side (ForceFreeStates/Resist.jl, the Galerkin Δ′ path, the inner-layer solvers).
  3. New work — kinetic cases: try a resonant-layer-width-based spot for kinetic runs, where the relevant layer is not the resistive one. Motivation from issue #376 (handoff/issue376/RESULTS.md §36): on a DIII-D kinetic-calculated case, the resonant-layer surface term is ~20% of the total NTV torque and the PE-vs-NTV comparison agrees to 0.8% only once that layer window is excluded — so the choice of matching radius is not cosmetic there. Related: #375 (Riccati + kinetic) and #423 (torque cross-check).

Also worth noting: a matching-radius bias of exactly this kind was already found and fixed on the Riccati side (#412), which is precedent that the radius choice materially moves Δ′-family numbers.

Ngôn ngữ chính
Julia
Star
11
Fork
7
Merge trung bình
4 ngày 3 giờ
Pull request đã merge (30 ngày)
70

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của OpenFUSIONToolkit/GPEC

Tất cả issue của OpenFUSIONToolkit/GPEC

Issue tương tự

Thêm issue về Julia

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.