Warn when a material spans multiple cells in material_wise MGXS#3983
Warn when a material spans multiple cells in material_wise MGXS#3983jon-proximafusion wants to merge 1 commit into
Conversation
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.
|
Thanks for putting this in for consideration @jon-proximafusion! I'd say that as the MGXS data will always be shared across multiple locations, the multigroup inaccuracy is pretty inherent in the method. Even if we did make unique MGXS per each cell-material combination there are still lattices or large spatial regions that will be subdivided by the source region mesh - in which case the same problem is present. As such, I don't think it's worth calling out this case of applying the same material to two cells, given that that accuracy differences (especially for weight window generation usage) are likely quite small compared to the difference between multigroup vs. continuous energy. Down the line though - it would definitely be nice to add a "cell-material-wise" option for MGXS generation that does produce MGXS with a little bit more spatial granularity (so as to be uniuque for each cell-material combination rather than for each material). This would still be an approximation compared to continuous energy, but could be useful if you want to squeeze maximum accuracy out of the random ray solver. |
|
Thanks for the feedback, ok I shall close this unnecessary PR and look to add a "cell-material-wise" method in the future to help users who want the even better multigroup cross sections than "material-wise" provides |
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.
Checklist