Skip to content

Deterministic transport pre-pass for inter-material cross-talk (MGXS) - #114

Open
jon-proximafusion wants to merge 5 commits into
convert-to-multigroup-transport-freefrom
convert-to-multigroup-deterministic-transport
Open

Deterministic transport pre-pass for inter-material cross-talk (MGXS)#114
jon-proximafusion wants to merge 5 commits into
convert-to-multigroup-transport-freefrom
convert-to-multigroup-deterministic-transport

Conversation

@jon-proximafusion

@jon-proximafusion jon-proximafusion commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

Builds on #113 (pure transport-free MGXS). Adds an optional, fully deterministic (no Monte Carlo) transport pre-pass to capture inter-material cross-talk — the one place the per-material transport-free collapse loses to stochastic_slab (resonant metals in a deep stack, e.g. Fe-56).

The full plan is in the first comment below.

Branches from convert-to-multigroup-transport-free. Will add an optional,
fully-deterministic (no Monte Carlo) transport pre-pass that computes a
cross-talk-aware weighting flux over all model materials, then collapses each
material against its local flux -- the noise-free analog of stochastic_slab.
Plan in the PR.
@jon-proximafusion

Copy link
Copy Markdown
Collaborator Author

Plan: deterministic transport pre-pass for inter-material cross-talk

This branch builds on convert-to-multigroup-transport-free (PR #113). That base branch is the pure transport-free method — each material is collapsed in isolation against an assumed weighting flux (narrow-resonance + URR probability-table self-shielding + exact elastic/inelastic kernels). No Monte Carlo, no transport solve. It already matches or beats stochastic_slab on most materials and metrics (scatter-matrix shape solved on all 10 test materials; total XS competitive 7/10; deterministic, noise-free, fast at any group count).

Why this branch exists — the one residual gap

The single place the base method loses to stochastic_slab is resonant materials in a deep multi-material stack (Fe-56: ~3.3 % at CCFE-709 / ~1.9 % at UKAEA-1102 on total + scatter row-sum, vs slab ~1.4 % / ~0.8 %; reference noise ~0.5 %, so the gap is real).

Root cause, established conclusively on the base branch:

  • The total collapse Σ_t,g = ∫φΣ_t/∫φ differs from material_wise only through φ (the pointwise Σ_t is identical).
  • Every transport-free single-material weighting fails or is equivalent: NR ≈ exact 0-D slowing-down flux (≤0.02 %), crude IR (+0.3 %), a global spectral tilt (inert), and a homogenized-material-mix flux (worse, +1.1 %). First-flight upstream attenuation is also worse (+2 %).
  • The missing physics is inter-material cross-talk: the flux reaching a deep material carries the resonance imprint of the upstream materials, partially filled back in by scattering. stochastic_slab captures this because convert_to_multigroup loads all materials into one (MC, randomized-slab) transport solve. A per-material isolated collapse structurally cannot — and at fine groups the imprint is within-group, so it is not even recoverable from random ray's group fluxes.

So the gap is a genuine transport effect. The base method deliberately avoids transport; this branch adds it back — deterministically (the user's constraint is no Monte Carlo, not no transport).

Goal

An optional, fully deterministic transport pre-pass that computes a cross-talk-aware weighting flux over all the model's materials (the noise-free analog of stochastic_slab), then collapses each material against its local flux. Target: match or beat stochastic_slab on Fe-56 and the resonant metals — deterministically, noise-free, and cheaply.

Approach (SCALE CENTRM/PMC-style)

  1. 1D geometry reduction — auto-build a layered slab/sphere from the model's material adjacency (analogous to how stochastic_slab auto-builds its randomized slab, but using the real ordering — no randomization).
  2. Fixed-source deterministic transport on a fine pointwise / ultra-fine-energy mesh, with scattering (the scatter fill-in is what the cheap shortcuts missed). Solver options, cheapest first: collision-probability (CPM) → 1D Sₙ / MOC.
  3. Collapse each material against its local φ(region, E). Cross-talk now represented.

Design constraints (carried from the base method)

  • No Monte Carlo — fully deterministic, reproducible (bit-identical), noise-free.
  • Knob-free / most-accurate-by-default — the solver's discretization parameters (energy mesh, spatial mesh, Sₙ/Pₙ order, source-iteration tolerance) are auto-set to converged values, not user accuracy knobs. Unlike MC nparticles (statistical noise ∝ 1/√N, "always converged" unaffordable), deterministic discretization converges monotonically to the exact answer and is cheap in 1D, so "fully converged" can simply be pinned internally. (Being verified against how CENTRM/APOLLO pin these — finding will be appended.)
  • Optional / layered — the base transport-free method stays the default; this pre-pass is an opt-in enhancement for cross-talk-sensitive deep multi-material problems.

Phases

  1. Minimal 1D CPM fixed-source solver on the pointwise grid (scatter-iterated); validate its flux shape against a material_wise flux tally.
  2. Wire φ(region, E) into the per-material collapse.
  3. Validate on Fe-56, steel, SiC, and the full 10-material stack at CCFE-709 + UKAEA-1102: deterministic-pre-pass vs material_wise vs stochastic_slab (total + scatter row-sum + shape). Target: ≤ slab, noise-free.
  4. RR-vs-CE shielding benchmark — the decisive arbiter of whether the cross-talk correction matters at the flux/dose level.
  5. API integration into convert_to_multigroup, keeping it knob-free.

Open questions

  • The 1D geometry-reduction heuristic (layer ordering/thickness from an arbitrary model).
  • CPM vs Sₙ vs MOC accuracy/cost trade-off for deep penetration + anisotropy.
  • Default vs opt-in, and how the option surfaces in convert_to_multigroup.

@jon-proximafusion

Copy link
Copy Markdown
Collaborator Author

Proof of concept — deterministic 1D transport cracks Fe-56 (beats stochastic_slab, noise-free)

A working prototype of the planned deterministic transport pre-pass is validated. It closes the one gap the pure transport-free method had (resonant metals in a deep stack) and does so deterministically — no Monte Carlo.

Method (prototype)

1D slab Sₙ (S8) slowing-down transport along the cross-talk path (source → upstream shells → target material), on the fine pointwise energy grid:

  • Neutrons enter at x=0 (14 MeV muir), slow down (isotropic-CM elastic kernel) and attenuate through the upstream layers; the flux reaching the target carries the upstream resonance imprint (the inter-material cross-talk stochastic_slab gets by loading all materials at once).
  • On a fine energy point grid elastic scatter is strictly down in energy ⇒ a single high→low energy sweep, each energy one Sₙ spatial pass (no within-energy scatter, no iteration).
  • Collapse the target against its local (layer-averaged) flux.

Result — total XS, % error vs material_wise

material det-NR (isolated, base branch) det-TRANSPORT stochastic_slab ref-noise
Fe-56 @ CCFE-709 3.26 0.60 1.39 0.46
Fe-56 @ UKAEA-1102 1.88 0.35 0.81 0.52
steel @ CCFE-709 0.57 0.47 0.48 1.40
SiC @ CCFE-709 0.12 0.08 0.06 0.86

Fe-56 is cracked: det-transport beats slab by ~2× and lands at the material_wise noise floor — i.e. as accurate as the MC reference can be measured — with zero stochastic noise. Steel/SiC tie or improve (already within reference noise). The cross-talk hypothesis is confirmed: every isolated weighting (NR, IR, exact 0-D slowing-down, tilt, homogenized-mix) failed because none carries the upstream imprint; a real (deterministic) transport solve does.

Performance & knobs

  • ~7 s/material (CCFE-709, after thinning the grid to ~32k points by min-lethargy spacing Δu=4e-4 — identical result to the full 466k-point grid, which took 756 s) and fully vectorized. Scales fine to UKAEA-1102.
  • No accuracy knobs exposed. Discretization is pinned to converged defaults (S8, Δu=4e-4 energy mesh, 1 cell/cm, single energy sweep). These converge monotonically/deterministically (unlike MC nparticles), so "converged" is cheap to hardcode — the API stays a single knob-free call.

Honest caveats / next steps

  • Prototype uses a slab approximation of the spherical reference and elastic-only down-scatter; despite both, it nails Fe-56 (the imprint is dominated by attenuation, which the full Σ_t carries). A spherical solver / inelastic source are refinements, likely marginal.
  • Next: (1) integrate into a clean, self-contained module routine (auto-derive the 1D path from the model geometry, like slab auto-builds its slab); (2) extend the scatter-matrix collapse (not just total); (3) the decisive random-ray-vs-CE benchmark.

shimwell added 2 commits June 27, 2026 18:48
Proof-of-concept for the cross-talk pre-pass: 1D slab Sn (S8) slowing-down
transport on the fine energy grid -> local flux -> collapse. Fe-56 total XS vs
material_wise: 0.60% (CCFE-709) / 0.35% (UKAEA-1102), beating stochastic_slab
(1.39 / 0.81) and at the MC reference noise floor, deterministically. ~7 s/material.
Depends on the scratchpad test harness (mats.py, scatref refs) -- to be refactored
into a self-contained module routine next.
… scatter too)

Total AND scatter matrix now via the 1D Sn transport local flux. Scatter matrix
built the SCALE/AMPX way: kernel SHAPE (weighting-insensitive) renormalised to the
transport-flux scatter XS (direct group collapse). Fe-56 vs material_wise:
  total  0.60% (CCFE-709) / 0.35% (UKAEA-1102)  -- slab 1.39 / 0.81
  scatter rowsum 1.04 / 0.60                     -- slab 1.45 / 0.86
  scatter shape  0.011 / 0.008                   -- slab 0.010 / 0.008
det-TRANSPORT beats stochastic_slab on total and scatter, deterministically. The
scatter_matrix phi_ext path has a separate normalisation bug (direct collapse is
correct, 1.04%); using the shape x rowsum recipe sidesteps it -- to fix at module
integration.
@jon-proximafusion

Copy link
Copy Markdown
Collaborator Author

Update — deterministic transport now cracks the SCATTER MATRIX too (commit bc779b5)

RR needs the group-to-group scatter matrix, not just the vector total. Extended the prototype: the scatter matrix is built the SCALE/AMPX way — kernel shape (weighting-insensitive) renormalised to the transport-flux scatter cross section (direct group collapse of the 1D-transport local flux). Fe-56 vs material_wise:

Fe-56 det-NR (isolated) det-TRANSPORT stochastic_slab
total @ CCFE-709 3.26 0.60 1.39
total @ UKAEA-1102 1.88 0.35 0.81
scatter row-sum @ CCFE-709 3.40 1.04 1.45
scatter row-sum @ UKAEA-1102 1.96 0.60 0.86
scatter shape (leth) 0.011 / 0.008 0.011 / 0.008 0.010 / 0.008

det-TRANSPORT beats stochastic_slab on total and scatter row-sum, and ties on shape — deterministically, noise-free. Both total and scatter are at/near the material_wise reference noise floor.

Note: a separate scatter_matrix builder bug

The direct group-collapse of the scatter XS with the transport flux is correct (1.04%). The scatter_matrix(phi_ext=…) path gives a wrong row-sum (4.68%) — a normalisation bug in that path. Sidestepped here by the shape×rowsum recipe (which is the principled SCALE approach anyway); to be fixed properly at module integration.

Geometry decision (from discussion)

  • 1D slab chosen over sphere/cylinder: faster, far simpler (no curvilinear angular-redistribution term), and for a fusion blanket — a thin shell on a large radius — slab is actually the more faithful local model. Curvature barely affects the spectral weighting (slab nailed a spherical reference at 0.60%).
  • Geometry → 1D: read the radial material build from the geometry layers (source-outward order); for complex 3D, harvest material paths from random-ray's source-sampled rays. Volumetric (plasma) source = just a distributed inner-region source term; the shield sees ~14 MeV at its inner face either way.
  • Sparse materials are the easy case (dilute → flux set by surroundings → clean local flux; deterministic has no MC-noise failure mode where material_wise would).

…er flux)

det-TRANSPORT vs material_wise/slab, CCFE-709. Big wins on the deep/cross-talk
materials (Fe-56 total 0.32 vs slab 1.39; Helium scatter rowsum 0.05 vs 9.66;
Li4SiO4 0.14 vs 3.26; concrete/H2O also win on all 3 metrics). Near-source metals
(tungsten/steel/CuCrZr) lose -- slab over-softens innermost shells (slab vs sphere
backscatter); confirmed by a spherical-volume-weight test. NR already excellent
there. Uniform fix = 1D spherical Sn.
@jon-proximafusion

Copy link
Copy Markdown
Collaborator Author

Full 10-material sweep — one full-stack 1D Sₙ solve, each material collapsed against its own layer flux

Replaced the per-target truncated path with a single transport solve through the whole stack (source → all shells → outer vacuum), so every layer has its real upstream and downstream. CCFE-709, total + scatter row-sum + scatter shape, det-TRANSPORT vs material_wise vs stochastic_slab:

material TOTAL NR / TR / slab ROWSUM NR / TR / slab SHAPE TR / slab
tungsten 1.96 / 5.51 / 2.56 3.60 / 6.29 / 2.36 0.004 / 0.006
steel 0.57 / 0.70 / 0.48 0.75 / 1.19 / 0.56 0.008 / 0.008
Fe-56 3.26 / 0.32 / 1.39 3.40 / 0.76 / 1.45 0.011 / 0.010
CuCrZr 0.85 / 1.06 / 1.02 1.34 / 1.71 / 1.12 0.017 / 0.017
Zircaloy 0.79 / 0.56 / 0.91 1.02 / 1.45 / 0.99 0.014 / 0.014
SiC 0.12 / 0.06 / 0.06 0.40 / 0.09 / 0.06 0.023 / 0.018
Li₄SiO₄ 0.06 / 0.06 / 0.42 0.39 / 0.14 / 3.26 0.041 / 0.218
concrete 0.05 / 0.05 / 0.09 0.29 / 0.06 / 0.10 0.035 / 0.106
H₂O 0.03 / 0.02 / 0.05 0.17 / 0.03 / 0.05 0.016 / 0.041
Helium 0.04 / 0.04 / 0.39 0.17 / 0.05 / 9.66 0.117 / 0.529

Verdict

  • Deep / cross-talk-dominated materials → big wins on all three metrics: Fe-56, Li₄SiO₄, concrete, H₂O, Helium (e.g. Helium row-sum 0.05 vs slab 9.66; Li₄SiO₄ 0.14 vs 3.26), plus Zircaloy (total) and SiC (tie). These are exactly where a single NR weighting and slab both struggle, and where the inter-material cross-talk matters most. Deterministic, noise-free, one ~30 s solve for the whole stack.
  • Near-source structural metals → TR loses (tungsten, steel, CuCrZr). Root cause is the slab vs sphere geometry: a slab over-reflects backscatter toward the centre (a sphere subtends less solid angle there), so the innermost shells' flux is over-softened. Confirmed by a spherical-volume-weight test (made tungsten worse, isolating it to the transport, not the averaging).

Why this is fine, and the fix

  • The near-source metals are precisely where NR is already excellent (≤ 2 %). Practical recipe: NR near the source, transport for the depth — and the transport flux itself signals which regime a region is in.
  • It is also partly a test-geometry artifact: the reference is a centre-point-source sphere. Real fusion has a surface/volumetric plasma source with a thin-shell blanket on a large radius → locally planar → the first-wall artifact wouldn't appear.
  • Clean uniform fix: 1D spherical Sₙ (matches the reference geometry; correct near-source backscatter). The slab prototype already proves the physics and the deep-material wins.

jon-proximafusion pushed a commit that referenced this pull request Jun 27, 2026
phi_X = q_mix/Sigma_t,X reproduces NR, not slab, because the mix slowing-down source
is ~1/E asymptotically. Slab's edge over NR is the sigma0-dilution of its finite mixed
cells (equivalence-theory artifact), not a spectral effect. The order-free/geometry-free
improvement over NR is impossible; the physical version is real-geometry transport (#114).
jon-proximafusion pushed a commit that referenced this pull request Jun 27, 2026
…ivity open)

sphere_sn.py: weighted-diamond curvilinear Sn, central point source, VALIDATED vs
analytic point-source-in-absorber (0.9% mean). det_realgeom.py: uses it for the real
concentric-sphere geometry. OPEN: diamond negativity on the resonant problem (steel
7.37; naive clamp breaks conservation) -> needs positivity-preserving curvilinear scheme
(step characteristic). Deep materials already won by the slab transport (#114); spherical
only needed for near-source shells where NR is already excellent. See FINDING_realgeom.md.
@jon-proximafusion

Copy link
Copy Markdown
Collaborator Author

Root cause of the scatter-matrix "phi_ext bug": there isn't one — it was a cross-section-definition mismatch + invalid thermal flux

No phi_ext/grid_ext bug. Passing the internal NR flux through phi_ext reproduces the default NR scatter matrix exactly (max row-sum diff 0.00 %); grid_ext matches the default grid. The mechanism is bit-correct.

The "4.68 vs 1.04" was me comparing two different cross sections. scatter_matrix's row-sum uses the kernel scatter XS with (n,2n)/(n,3n) multiplicity — which is what the MC reference tallies (outgoing neutrons). My "direct collapse" used total−absorption (no multiplicity). The kernel definition is the correct one (it matches NR's validated 3.40 % vs material_wise).

Why the correct number (4.63 %) looked worse than NR — the thermal flux. Per incoming-energy decade vs material_wise:

decade NR err transport err
1–20 MeV 2.1 % 1.2 %
10 keV–1 MeV 13.7 % 2.2 %
100 eV–10 keV 0.0 % 0.0 %
1–100 eV 0.0 % 0.0 %
< 1 eV (75 rows) (ok) 23.9 %

The transport flux is better than NR in every decade above 1 eV (the cross-talk win: epithermal 13.7 %→2.2 %), but the 1D transport flux is invalid in the thermal range (no thermal scattering treatment; this single-target path also lacks the downstream moderators), corrupting 75 thermal rows at 23.9 % and dragging the naive average to 4.63 %.

Fix — thermal-NR fallback. Weight the scatter collapse by the transport flux above the thermal cutoff and by NR below (NR is exact in the thermal). Result for Fe-56 scatter row-sum:

  • pure NR 3.40, pure transport 4.63, hybrid 0.69, slab 1.45.

So the transport beats slab on both total (0.60) and scatter row-sum (0.69) for Fe-56, once the thermal range falls back to NR. The recipe: transport flux for fast/epithermal, NR (or proper thermal) below the free-gas threshold.

jon-proximafusion pushed a commit that referenced this pull request Jun 27, 2026
Set-to-zero & re-solve; validated best on smooth (0.74% vs diamond 0.89, step 1.17),
positive flux. BUT on the resonant stack the set-to-zero clamp accumulates more error
than step (Fe-56 2.06 vs step 1.08) -- many resonance negativities. Conclusion: no
spherical scheme beats the robust 1D-slab transport (#114, Fe-56 0.60) on deep resonant
materials; spherical only helps near-source. Recommend the #113+#114+NR-near-source
hybrid. See FINDING_realgeom.md.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants