Apply virtual material densities to microscopic tally results - #4029
Apply virtual material densities to microscopic tally results#4029paulromano wants to merge 2 commits into
Conversation
|
Ok this PR is clearly much more concise than #4027 which I think we all like 👍 It does appear to me at least to come at a small cost:
So it comes down to in this case we value simplicity, maintainability and clean tally inputs over exact covariance-aware collapsed sigma and slightly less user effort. If it suits we can leave these open for a while to give us a chance to discuss them at the next F4E UKAEA Proxima fusion meeting |
Related to this, one downside to #4027 is that it misses out on the ability to break down the response by nuclide. |
|
What do you think about a keyword argument that decide if we collapse along the nuclide axis or not? |
Description
This PR is an alternative to #4027. It adds an in-place
Tally.apply_virtual_material()method for applying thenuclide atom densities of an
openmc.Materialto tally results generated withmultiply_density=False. This supports calculations such as determining dose in silicon when silicon is not present in the transport model. The method preserves the tally's nuclide dimension, scales all statistical moments consistently, and assigns zero density to tally nuclides absent from the virtual material. The new method only requires 60 lines of code, most of which is just documentation/error checks; the actual implementation is ~15 lines.I've also added a section in the user's guide discussing the use of virtual materials, showing an example of computing dose in Si.
Checklist
I have run clang-format (version 18) on any C++ source files (if applicable)