Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve clipping of Mixture distributions #3154

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

paulromano
Copy link
Contributor

Description

This PR adds an additional check in the Mixture.clip method for when the probability of one of the contained distributions is negligibly small. I've run into this when running shutdown dose rate calculations where an isotope at an extremely low concentration produces discrete lines in a photon spectrum that can safely be ignored.

Checklist

  • I have performed a self-review of my own code
  • I have run clang-format (version 15) 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)

@shimwell
Copy link
Member

shimwell commented Oct 4, 2024

This looks very handy for speeding up the shut down dose simulations. If I've understood this correctly then clip previously removed just gamma energies that were low probability. Now it removes two slightly different things, low probability gamma energies and low probability distributions. Perhaps the check for removing the distribution should not be on the probability of the distribution itself but if all the gamma probabilities (perhaps scaled by distribution probability) within the distribution are below the threshold? Then we have a single value that controls things consistently instead of a value that could apply to gamma probabilities or distribution probabilities. I might have got lost here with all the probabilities.

@paulromano
Copy link
Contributor Author

@shimwell Correct, two slightly different things. The latter case (low probability distribution) is really targeted to handle the case where the distribution is not discrete and so it's not just a matter of checking the intensity. I ran into this where you can have a mixture of a Discrete and Tabular distributions. This was the best way I could think of to handle that but let me know if you have a better idea.

@shimwell
Copy link
Member

shimwell commented Oct 4, 2024

Perhaps just adding two args, one for distribution clipping one for probability clipping. Not sure if it helps but perhaps worth considering

@openmc-dev openmc-dev deleted a comment from cjie33311001 Oct 4, 2024
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