Skip to content

Production deterministic-transport MGXS (switch-free, real geometry + thermal in-kernel) - #117

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

Production deterministic-transport MGXS (switch-free, real geometry + thermal in-kernel)#117
jon-proximafusion wants to merge 4 commits into
convert-to-multigroup-transport-freefrom
convert-to-multigroup-deterministic-transport-prod

Conversation

@jon-proximafusion

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

Copy link
Copy Markdown
Collaborator

Builds on #113. One clean module routine for a switch-free deterministic-transport weighting (real layered geometry + free-gas thermal folded into the transport). Distils #114/#115/#116. Plan in the first comment.

Off the transport-free base (#113). Single clean module routine: run one deterministic
1D transport on the model's REAL layered geometry with the free-gas thermal kernel
folded into the transport -> per-region local flux at all energies -> collapse each
material against its region's flux. NO switching (geometry gives near-source vs deep;
thermal in-kernel). Distils the learnings from the #114/#115/#116 investigations.
Plan in PR.
@jon-proximafusion

Copy link
Copy Markdown
Collaborator Author

Plan: production switch-free deterministic-transport MGXS

Distils the #114/#115/#116 investigations into one clean module routine, off the
transport-free base (#113). Adds convert_to_multigroup(method="deterministic_transport")
alongside material_wise / stochastic_slab.

Why (what we learned)

  • Pure transport-free NR (Convert to multigroup transport free #113) wins or ties slab on ~9/10 materials; the one clear,
    above-noise loss is Fe-56
    (and the resonant metals generally) — the inter-material
    cross-talk a per-material collapse can't see.
  • A deterministic transport pass supplies that cross-talk: slab transport + thermal-NR
    gives Fe-56 total 0.60 / scatter 0.69, both beating slab (1.39 / 1.45).
  • "Switching" (NR near-source / transport deep; NR thermal / transport fast) is NOT
    fundamental — it was a crutch for two prototype approximations (slab-vs-sphere test
    geometry; no thermal in the transport). The production version removes both.

Design (no switches)

  1. Read the model's real layered geometry (material order + thicknesses) from
    model.geometry — like stochastic_slab reads materials, but keeping the real order.
  2. One 1D transport solve with the free-gas thermal kernel folded into the scatter
    source
    -> phi(region, E) for every region at every energy.
  3. Collapse each material against its region's local flux (reusing Convert to multigroup transport free #113's
    collapse_material / scatter_matrix with the kernel scatter XS incl. multiplicity).
  4. No region switch (geometry gives near-source=hard vs deep=degraded automatically);
    no energy switch (thermal handled in-kernel). Knob-free.

Geometry

1D slab in the model's layer coordinate is the right model for a fusion shield (thin shell
on a large radius, surface plasma source). Curvilinear (spherical/cyl) only if a problem
truly needs it; #116 shows it is numerically harder with little gain.

Validation

Full 10-material stack (CCFE-709 + UKAEA-1102): total + scatter row-sum + shape, vs
material_wise and converged stochastic_slab -> the definitive all-materials win-count.
Then the decisive random-ray-vs-CE downstream check.

shimwell added 3 commits June 28, 2026 00:44
Full-stack transport + correct kernel scatter XS + thermal-NR at fixed free-gas threshold.
CRACKS Fe-56 (total 0.32 / scatter 0.40 vs slab 1.41/1.47) and the deep/cross-talk materials
(TOTAL 7/10). Near-source metals (tungsten 3.79/5.26) REGRESS -- verified vs both sphere AND
slab1d refs, so NOT a geometry artifact: the innermost-shell (source-adjacent) flux is wrong
(incident-boundary vs volumetric source). Next: volumetric source treatment, or NR-source-
region + transport-deep division. See FINDING_production.md.
…ource form)

Byte-identical to incident-boundary. Confirms near-source error is the transport's
slowing-down physics, not the source (and not geometry, per slab1d). Root cause:
ELASTIC-ONLY down-scatter source -- tungsten's strong inelastic missing -> source-region
flux too hard. Fix = add inelastic/(n,2n) to the transport source, or NR for the
source-adjacent region. Method already cracks Fe-56 + deep materials. See FINDING_production.md.
Transport down-scatter source was elastic-only; added inelastic + (n,xn) via a
coarse per-material transfer matrix applied in an outer iteration (inel_source.py).
Fixes steel (total 0.70->0.25, scatter 0.89->0.42, both now beat slab). Fe-56/
Zircaloy/deep materials all win -> 9/10 total. Tungsten unchanged: confirmed its
inelastic matrix builds & is applied, so its error is source-region geometry (front
wall under-sees the equilibrium 1/E spectrum), not slowing-down physics -- NR is the
right tool for the first wall. Committed inel_source/sd_flux/scatter_det/mats so the
prototype is self-contained.
@jon-proximafusion

jon-proximafusion commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator Author

Inelastic + (n,2n) down-scatter added → TOTAL 7/10 → 9/10

The transport down-scatter source was elastic-only. Added inelastic + (n,xn) via a coarse
per-material transfer matrix M[out,in] (incl. multiplicity; the inelastic outgoing is smooth,
so a coarse grid + interpolation is accurate), applied in an outer iteration (elastic solve →
add inelastic source from that flux → re-solve, ×2). +71 s. New file prototype/inel_source.py
(commit 28313c375).

Result (CCFE-709, vs converged stochastic_slab)

material TOTAL det/slab scatter ROWSUM det/slab vs elastic-only
steel 0.25 / 0.48 0.42 / 0.51 0.70 / 0.89 → now beats slab on both
Fe-56 0.44 / 1.41 0.51 / 1.47 0.32 / 0.40 (still crushes slab)
Zircaloy 0.57 / 0.91 0.94 / 1.00 win
tungsten 3.79 / 2.57 5.26 / 2.34 unchanged

Inelastic fixed steel (the win) and took TOTAL to 9/10. Tungsten is the lone holdout.

Why tungsten is immune — it's geometry, not physics

M_inel[tungsten] builds correctly (all 5 W isotopes' MT51–91 + (n,2n)) and is applied to the
W cells, yet the collapse doesn't move. So tungsten's error is source-region geometry:

  • In material_wise (the truth) tungsten is mixed through the whole domain → it sees the
    fully built-up equilibrium (~1/E) slowing-down spectrum.
  • In the slab it sits only at the front 6 cm → its flux is the 14 MeV source lightly
    self-slowed → too hard. Deep materials don't have this (they sit where a slowed spectrum
    is physical, which is exactly why inelastic fixed steel).
  • NR assumes that equilibrium 1/E, so NR is better for the first wall (1.96 vs 3.79).

Clean switch-free rule (no arbitrary threshold)

NR for the source layer (no upstream material → flux is the source spectrum → NR exact)
+ transport for everything downstream. The geometry itself defines the rule — it's "use NR
where there's nothing upstream to slow neutrons down," not a tuned cutoff.

Bottom line: #117 delivers the deep-penetration goal — 9/10 on total, the deep/cross-talk
resonant metals (Fe-56, steel, Zircaloy) all cracked vs slab. The remaining holdout is the first
wall, where NR is the correct tool anyway.

@jon-proximafusion

jon-proximafusion commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator Author

Cross-talk benchmarks refine where deterministic transport earns its place

Companion to the cross-talk comment on #113. Controlled 2-material adjacency tests (W│H₂O, steel│Fe-56) vs material_wise, both orderings. Two findings that sharpen #117's scope:

1. Transport's value is intra-region spatial-spectral resolution for resolved-resonance metals — not inter-material cross-talk. Fe-56: NR ~3% → transport ~0.8%, and this holds whether Fe-56 is behind steel (3.01 → 0.66) or at the front (3.25 → 0.90). The neighbour's identity barely moves it (≲ MC noise). What transport fixes is the depth-varying slowing-down spectrum through the thick resonant region that a single 0-D flux cannot represent.

2. Transport is WORSE than NR for tungsten — even when W is deep. W behind 12 cm of water: NR 1.06 vs transport 3.26 (and W at the front: 1.30 vs 2.91). So #117's tungsten regression is not merely the near-source artifact — the 1D slab transport is genuinely the wrong tool for W (URR-dominated; NR+URR is excellent at ~1%). This generalizes the source-layer-NR recommendation to "NR for URR-dominated metals (W), transport for resolved-resonance metals (Fe-56)."

Net: #117's deterministic transport pays off on exactly the materials where the NR method (#113) has its only real gap — thick resolved-resonance metals (Fe-56-like). For moderators and URR metals, #113's NR+URR is as good or better, and transport should defer to it.

@jon-proximafusion

Copy link
Copy Markdown
Collaborator Author

How the four MGXS methods compare (reference, fusion shield, VITAMIN-J-175)

A head to head of all four generation methods on one fusion shield, scored as the mean
absolute % difference versus material_wise (the reference). Kept here as a durable
reference for how these methods stack up.

Geometry (point 14 MeV Muir source in the plasma, concentric shells):
50 cm DT plasma, 1 mm tungsten, 3 cm 50/50 water+steel, 60 cm 80/20 lithium-lead+helium,
5 cm graphite, 2 cm steel, 1 m void, 2 m concrete.

Methods: slab = stochastic_slab (Monte Carlo). css = collapsed_self_shielding
(PR #118, deterministic collapse against an assumed NR flux). det = deterministic_transport
(this PR, 1D Sn transport solve giving a cross-talk-aware local flux). material_wise is the
reference and is run with two seeds so its own Monte Carlo noise is shown.

All numbers are % difference vs material_wise; lower is closer. Ref noise is the
reference's seed-1 vs seed-2 difference (how trustworthy the reference itself is).

Material Ref noise (tot / scat) Total: slab / css / det Scatter: slab / css / det
plasma 0.00 / 100 0.03 / 0.80 / 0.77 100 / 0.07 / 0.10
tungsten 0.13 / 0.23 5.91 / 8.90 / 12.79 5.30 / 7.60 / 10.73
water_steel 0.02 / 0.03 0.08 / 0.96 / 0.91 0.08 / 1.07 / 1.03
lipb_he 0.01 / 0.23 0.62 / 1.06 / 1.03 0.62 / 0.25 / 0.22
graphite 0.05 / 0.05 0.07 / 0.70 / 0.54 0.07 / 1.12 / 0.98
steel 0.10 / 0.17 0.23 / 3.30 / 1.17 0.27 / 3.10 / 0.98
concrete 0.04 / 0.06 0.21 / 0.85 / 0.92 0.22 / 1.26 / 1.32

(plasma scatter 100 % is near-void DT, physically meaningless; note it is the noisy one for
Monte Carlo slab, while the deterministic methods are clean.)

How they compare

  • material_wise is well converged (seed to seed noise at most 0.23 %), so every
    difference is a real method difference, not noise.
  • stochastic_slab is closest to the reference on every material except the thin near-source
    tungsten.
    It is itself Monte Carlo, so it shares the reference's transport physics and its
    mixed-material spectrum resembles the true degraded in-place spectra.
  • collapsed_self_shielding (Add collapsed_self_shielding MGXS generation method #118) is competitive (sub-% to a few %) but trails on the deep
    resonant metal steel (3.3 %) and near-source tungsten. Its value is determinism, zero noise,
    and a valid positive cross section in every group, not accuracy on this metric.
  • deterministic_transport (this PR) beats css on the deep resonant metal steel by about
    3x
    (total 1.17 vs 3.30, scatter 0.98 vs 3.10), the cross-talk win it was built for, and is
    modestly better or tied on most other materials. But it regresses on the thin near-source
    tungsten
    (12.8 vs 8.9), and it does not beat stochastic_slab anywhere. It is also much
    heavier (a 1D transport solve plus a geometry reduction).

Takeaway

On this collapse vs material_wise metric, stochastic_slab is closest overall; the
deterministic-transport method fixes collapsed_self_shielding's deep resonant metal weakness
at the cost of the near-source first wall. material_wise as the truth structurally favors the
other Monte Carlo method, so the decisive test of whether the deep-metal win matters is
downstream transport (random ray or Sn vs continuous energy), not this table.

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