fix(vfp1d): SNB heat-flux diagnostic on a global absolute-energy grid#315
Open
jpbrodrick89 wants to merge 1 commit into
Open
fix(vfp1d): SNB heat-flux diagnostic on a global absolute-energy grid#315jpbrodrick89 wants to merge 1 commit into
jpbrodrick89 wants to merge 1 commit into
Conversation
snb_heat_flux discretized the energy groups on a per-cell beta = v^2/(2T) grid, so a group's absolute energy (and hence its mean free path lambda ~ eps^2) varied from cell to cell. Because the SNB multigroup diffusion transports each group at fixed kinetic energy (energy is conserved as electrons stream, which is what lets the groups decouple in energy and couple only in space), the per-cell beta grid made the spatial stencil couple different absolute energies between neighbouring cells -- a spurious energy advection -- and dropped the suprathermal carriers that stream from hot to cold and set the preheat. The peak flux was only mildly affected but the cold-side preheat was under-predicted by ~25% (mild gradients) to ~5x (steep gradients). Rewrite to a global absolute-energy grid eps = v^2/2 (uniform in space, spanning [0, beta_max * max(T)]) with the local Spitzer-Harm group weight W_g(x) = int beta^4 e^-beta/24 dbeta over beta = eps/T(x). This matches the validated reference SNB implementation. Defaults ngroups 32 -> 300 and beta_max 30 -> 20 (the global-energy grid needs a few hundred groups since cold cells sample beta coarsely; beta_max ~ 20 keeps the beta ~ 16 flux carriers on-grid at the hottest cell). Verified against the reference on the Z=7 Gaussian problem: q_snb/q_sh reproduces the reference to ~1e-5 in local, mild, and steep regimes. (The electric-field / l_s stopping term in the effective diffusion mfp is a separate, second-order refinement and is intentionally still omitted.) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The VFP-1D SNB nonlocal-heat-flux diagnostic (
adept/vfp1d/heat_flux.py:snb_heat_flux, added in #312) discretized its energy groups on a per-cellbeta = v^2/(2T)grid, so each group's absolute energyeps = beta*T(x)— and hence its mean free pathlambda ~ eps^2— varied from cell to cell.This is physically inconsistent: the SNB multigroup diffusion transports each group at fixed kinetic energy (energy is conserved as electrons stream, which is exactly what lets the groups decouple in energy and couple only in space). Gridding on the local
betamakes the spatial stencil couple different absolute energies between neighbouring cells — a spurious energy advection (the dropped-beta d(lnT)/dx d/dbetaJacobian term of theeps -> betachange of variable) — and drops the suprathermal carriers that stream from hot to cold and set the preheat.Effect: peak flux only mildly affected, but cold-side preheat under-predicted by ~25% (mild gradients) to ~5x (steep gradients). A
beta_maxsweep (20->160) and group sweep (32->128) left it unchanged, confirming it is structural, not a truncation.Fix
Rewrite to a global absolute-energy grid
eps = v^2/2(uniform in space, spanning[0, beta_max * max(T)]) with the local Spitzer-Harm group weightW_g(x) = integral of beta^4 e^-beta / 24overbeta = eps/T(x). Each group is now one fixed energy band across all cells, so the plain spatial stencil is the fixed-energy transport and the suprathermal carriers stay on-grid everywhere. This matches the validated reference SNB implementation.Defaults changed:
ngroups32 -> 300,beta_max30 -> 20 (the global-energy grid needs a few hundred groups because cold cells samplebetacoarsely;beta_max ~ 20keeps thebeta ~ 16flux-carrying groups on-grid at the hottest cell).Verification
Driven with coefficients that map exactly onto the reference (
nuee_coeff=1, logLam_ratio=4/Z, ni=n/Z) on the reference's Z=7 Gaussian problem,q_snb/q_shreproduces the validated reference:The only residual vs the full reference is the electric-field /
l_sstopping term in the effective diffusion mfp (2nd-order; ~3% at the steep peak, ~0 in the local limit) — a separate refinement that is intentionally still omitted here and left for follow-up.Tests
tests/test_vfp1d/test_spherical.py::test_snb_local_limit— passestests/test_vfp1d/test_spherical.py::test_spherical_hotspot(full-sim end-to-end) — passesDocs (
docs/source/solvers/vfp1d/config.md) and the example config (configs/vfp-1d/spherical-heatflow.yaml) updated for the new grid semantics and defaults.🤖 Generated with Claude Code