feat: spherical (radial) geometry for VFP-1D + SNB/Spitzer/kinetic heat-flux comparison#312
Merged
Conversation
…ux diagnostics Adds a radial-coordinate mode to the vfp-1d solver for spherically symmetric heat-flow problems, plus everything needed to compare kinetic vs SNB vs Spitzer-Harm heat flow on tabulated ne/Te/rho profiles. - grid.geometry: "cartesian" | "spherical". For nl=1 the only PDE change is the f0 spatial term becoming the radial divergence (v/3)(1/r^2) d(r^2 f10)/dr, discretized in conservative finite-volume form with exact cell volumes; velocity space and all collision operators are unchanged. Requires xmin=0 and reflective boundaries (f10 = E = 0 at r=0 by symmetry and at the outer wall). - density basis "file": two-column CSV/text profiles for n and T, interpolated onto the grid with pint unit handling. - density.ion block: ion mass-density profile + A sets ni(r) and a spatially varying Z(r) = ne/ni in the state. - adept/vfp1d/heat_flux.py: post-processing diagnostics computing the local Spitzer-Harm(-Epperlein-Haines) flux and the multigroup SNB flux (Schurtz 2000; separated variant of Brodrick 2017 with r=2), geometry aware, using the same normalized collision rates as the kinetic solver. A comparison plot/netCDF and q-ratio metrics are produced on every run. - tests: spherical uniform preservation, central-hotspot outward heat flow + volume-weighted energy conservation, SNB local limit -> SH and nonlocal flux inhibition, file-basis + ion-block normalization, and config validation. - docs: vfp1d config reference updated; example config configs/vfp-1d/spherical-heatflow.yaml. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- units.logLambda: "lee-more" implements Lee & More 1984: lnLambda = max(2, 0.5*ln(1 + bmax^2/bmin^2)) with Debye-Huckel screening (electron + ion) floored at the ion-sphere radius, and bmin = max(classical closest approach, thermal de Broglie). - density.ion.mixture: atomic mixtures (e.g. fully ionized CD, 40% C / 60% D) represented by a single effective ion preserving both quasineutrality (Z*ni = ne) and e-i collisionality (Z^2*ni = sum n_i Z_i^2 = Zeff*ne) with Zeff = <Z^2>/<Z>; units.Z is the transport Zeff. Mass-density profile cross-checks full-ionization quasineutrality against ne(r) and warns on >5% mismatch. - example config updated for the CD conduction zone (Zbar=3, Zeff=5, A=6.304, lee-more); docs and tests added. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…vity clamp Shakeout fixes from running a real conduction-zone profile: - spherical geometry now allows xmin > 0 (annular shell with a reflecting inner wall) so the domain can start outside an ablation front; Grid.dx is now (xmax - xmin)/nx. - profile files with more than two columns use the last two, so a leading row-index column (common in exported CSVs) is ignored. - the local big-dt f10 initialization is clamped to the P1 positivity bound |f10| <= f0: in strongly nonlocal regions (mfp >> gradient length) the local solve overshoots into free-streaming and would immediately drive f0 negative. Co-Authored-By: Claude Fable 5 <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
Adds a radial-coordinate (spherically symmetric) mode to the
vfp-1dsolver, file-based profile initialization, and Spitzer-Härm / SNB heat-flux diagnostics — so a kinetic vs SNB vs Spitzer heat-flow calculation can be run directly on tabulated ne(r), Te(r), and mass-density profiles.Physics
For
nl=1(f0, f10), expanding the Vlasov equation in spherical symmetry gives exactly the Cartesian system except the f0 spatial term becomes the radial divergence:The angular coupling term$\propto (1-\mu^2)/r$ only feeds $f_2$ into the $f_{10}$ equation, which is dropped at $(r_+^3 - r_-^3)/3$ , so volume-weighted conservation telescopes; the flux through $r=0$ vanishes identically. Spherical geometry requires $f_{10} = E = 0$ at $r = 0$ by symmetry and at the outer wall), which the existing reflective BC machinery already provides.
nl=1— velocity space and all collision operators are untouched. The divergence is discretized in conservative finite-volume form with exact cell volumesxmin: 0andboundary: reflective(Changes
grid.geometry: cartesian | spherical— newGridfield with validation;OSHUN1D.div_e2capplies the radial divergence in the f0 equation.basis: fileprofiles — two-column (coordinate, value) CSV/text files fornandT, unit-converted with pint and interpolated onto the grid (clamped outside the tabulated range).density.ionblock — a tabulated mass-density profile plus the ion mass numberAsetsunits.Z, consistent with theFLMCollisionsconvention).adept/vfp1d/heat_flux.py— post-processing (pure numpy) diagnostics:kappametric;r=2,plots/fields/heat-flux-comparison.png) andq_ratio_kinetic_over_sh,q_ratio_snb_over_shmetrics on every vfp-1d run.configs/vfp-1d/spherical-heatflow.yamlset up for the profile-driven comparison (fill in the three CSV paths, reference units, andA).CD plasma specifics (second commit)
units.logLambda: lee-more— Lee & More 1984 Coulomb logarithm:density.ion.mixture— atomic mixtures represented by one effective ion preserving quasineutrality (units.Zis the transportTests
New
tests/test_vfp1d/test_spherical.py(all pass on CPU):Existing Cartesian benchmarks
test_kappa_eh[False-1]andtest_kappa_eh_reflective[False-1]still pass (and now exercise the heat-flux diagnostic path).🤖 Generated with Claude Code