Repository navigation
fast_particles_profiles!: optional soft cap of the fast-ion density - #320
StuartBenjamin wants to merge 3 commits into
Conversation
…fast_density_knee; 1.0 is the hard clamp) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nanshi1177
left a comment
There was a problem hiding this comment.
Looks good. The tanh knee keeps the slope continuous at knee·limit and saturates at the limit, so a partially engaged cap no longer leaves a kink in the thermal density (and a jump in the bootstrap current). knee ≥ 1 keeps today's hard clamp.
While reviewing this I found a related issue in the same function. It's not introduced here, and I'll fix it in a separate PR once this one is merged, to avoid conflicts.
density_thermal is reset to the total ion density once, before the loop over sources. But at the end of each source, density_thermal is reduced by the fast density added so far. So for the second and later sources, limit = max_fast_frac .* cion.density_thermal is computed from the already-reduced thermal density, not from the total.
Motivation: eliminate discontinuities in the density gradient, and thus bootstrap current -> bad for stability calculations
fast_particles_profiles!caps the fast-ion density atmax_fast_frac× the thermal density with a hardmin. Where the cap engages over part of the radius, the thermal density gets a slope break at each edge of that region, and the bootstrap current (∝ dp/dψ) jumps there.A new keyword
fast_density_knee(also onintrinsic_sources!) makes the cap soft: the density is unchanged belowknee× the limit and saturates smoothly towards the limit above it. The default, 1.0, is today's hard clamp. FUSE sets it fromact.ActorSources.fast_density_knee(ProjectTorreyPines/FUSE.jl#1203).Derivation. With L the limit, x = n_fast / L and knee k < 1, the capped density is n_fast for x ≤ k and L·[k + (1 − k)·tanh((x − k)/(1 − k))] for x > k.
Diff: master...StuartBenjamin:IMAS.jl:fast_ion_soft_cap
🤖 Generated with Claude Code