Skip to content

Warn when a material spans multiple cells in material_wise MGXS - #109

Open
jon-proximafusion wants to merge 1 commit into
developfrom
warn-convert-mgxs-material-wise-averaging
Open

Warn when a material spans multiple cells in material_wise MGXS#109
jon-proximafusion wants to merge 1 commit into
developfrom
warn-convert-mgxs-material-wise-averaging

Conversation

@jon-proximafusion

Copy link
Copy Markdown
Collaborator

Summary

The material_wise convert_to_multigroup method produces one flux-weighted cross section per material. A material that fills cells with different neutron spectra (e.g. structural steel near the source and deep inside a shield) is collapsed to a single spectrum-averaged cross section, which can be inaccurate.

This adds a warning when a material fills more than one cell, recommending Model.differentiate_mats() to give each location its own material (and hence its own locally-weighted cross section). It is a heads-up only — one cross section per material is the intended multigroup behaviour, so nothing in the output changes.

Companion to the duplicate-name fix in #108 (which is a genuine bug); this PR flags expected-but-easily-overlooked behaviour. Note the warning fires whenever a material fills multiple cells, which is common.

Tests

Added a unit test asserting the warning fires when one material fills multiple cells.

@jon-proximafusion
jon-proximafusion force-pushed the warn-convert-mgxs-material-wise-averaging branch from 1db3819 to 6b9d78e Compare June 25, 2026 14:44
The "material_wise" convert_to_multigroup method produces one flux-weighted
cross section per material. A material that fills cells with different
neutron spectra (for example structural steel near the source and deep
inside a shield) is therefore collapsed to a single spectrum-averaged cross
section, which can be inaccurate. Warn in that case, recommending
Model.differentiate_mats() to give each location its own material and hence
its own cross section.
@jon-proximafusion
jon-proximafusion force-pushed the warn-convert-mgxs-material-wise-averaging branch from 6b9d78e to f4f684d Compare June 25, 2026 15:35
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