Warn when a material spans multiple cells in material_wise MGXS - #109
Open
jon-proximafusion wants to merge 1 commit into
Open
Warn when a material spans multiple cells in material_wise MGXS#109jon-proximafusion wants to merge 1 commit into
jon-proximafusion wants to merge 1 commit into
Conversation
jon-proximafusion
force-pushed
the
warn-convert-mgxs-material-wise-averaging
branch
from
June 25, 2026 14:44
1db3819 to
6b9d78e
Compare
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
force-pushed
the
warn-convert-mgxs-material-wise-averaging
branch
from
June 25, 2026 15:35
6b9d78e to
f4f684d
Compare
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
material_wiseconvert_to_multigroupmethod 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.