Expand description
Nonlinear plasma source term for the Grad-Shafranov equation.
Port of fusion_kernel.py update_plasma_source_nonlinear() (lines 118-171).
Computes J_phi using:
J_phi = R · p’(ψ_norm) + (1/(μ₀R)) · FF’(ψ_norm)
where ψ_norm = (Ψ - Ψ_axis) / (Ψ_boundary - Ψ_axis).
Structs§
- Profile
Params - mTanh profile parameters used by inverse reconstruction.
- Source
Profile Context - Context passed to profile-driven source update.
Functions§
- mtanh_
profile - mTanh profile: f(psi_n) = 0.5 * h * (1 + tanh(y)) + alpha * core(psi_n) y = (ped_top - psi_n) / ped_width core(psi_n) = max(0, 1 - (psi_n/ped_top)^2)
- mtanh_
profile_ derivatives - Analytical derivatives of mTanh profile with respect to: [ped_height, ped_top, ped_width, core_alpha].
- update_
plasma_ source_ nonlinear - Update the toroidal current density J_phi using the full Grad-Shafranov source term.
- update_
plasma_ source_ with_ profiles - Update toroidal current density using externally provided profile parameters.