Skip to content

Enable parent-nuclide tally breakdowns in R2S calculations#4013

Open
paulromano wants to merge 7 commits into
openmc-dev:developfrom
paulromano:r2s-nuclide-breakdown
Open

Enable parent-nuclide tally breakdowns in R2S calculations#4013
paulromano wants to merge 7 commits into
openmc-dev:developfrom
paulromano:r2s-nuclide-breakdown

Conversation

@paulromano

Copy link
Copy Markdown
Contributor

Description

This PR extends R2SManager to support attributing photon tally results to the parent radionuclides that emitted the source photons. It also separates decay photon source preparation from photon transport and prevents R2S calculations from inadvertently running with OpenMC's default neutron source when no decay photon source exists.

The R2S workflow is now organized into four explicit stages: neutron transport, activation, decay photon source creation, and photon transport. step3_photon_source creates each requested source list once and stores the lists in results['photon_sources']. step4_photon_transport then consumes those prepared sources. This separation makes the decay photon source creation a bit more explicit and recognizes it as its own step, which can be useful for profiling purposes.

Passing by_parent_nuclide=True to R2SManager.run or step4_photon_transport automatically adds a ParentNuclideFilter to photon tallies that do not already contain one. Filter bins are determined from the union of radionuclides in the prepared decay photon sources, allowing any photon tally (e.g., a dose tally) to be broken down by its parent radionuclide. This puts R2S on equal footing with D1S in terms of the ease-of-use for getting dose tallies broken down by radionuclide.

Checklist

  • I have performed a self-review of my own code
  • I have run clang-format (version 18) on any C++ source files (if applicable)
  • I have followed the style guidelines for Python source files (if applicable)
  • I have made corresponding changes to the documentation (if applicable)
  • I have added tests that prove my fix is effective or that my feature works (if applicable)

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.

1 participant