-
Notifications
You must be signed in to change notification settings - Fork 510
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
Implementation of Shannon Entropy for Random Ray #3030
Conversation
…nd performance improvement.
…sion source, resulting in nan entropy values.
This PR has a known issue where Shannon entropy is not calculated correctly for problems with flat source regions (FSRs) of uneven volume. The regression test, While calculating the "correct" value of Shannon entropy is not particularly useful, this issue may result in inaccurate convergence diagnostics for problems with large FSR volume differences. Essentially, the smaller FSRs may dominate the calculation of Shannon entropy, which would result in perceived convergence even if the larger FSRs have yet to converge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @ethankrammer! This appears to be working nicely. I've made a few minor comments and requests for small changes, and then this should be in good shape to go in.
The changes all look good -- thanks @ethankrammer, and congrats on your first OpenMC PR! |
Co-authored-by: Ethan Krammer <ethan@DESKTOP-MGFGK9N> Co-authored-by: John Tramm <john.tramm@gmail.com>
Description
Shannon entropy is a method of diagnosing convergence for Monte Carlo eigenvalue problems. Prior to this PR, the Shannon entropy was only being computed in multigroup MC and not Random Ray. Since Random Ray also needs to converge the scattering source in addition to the eigenvalue, there is additional need for computing Shannon entropy in the Random Ray method.
Since the Random Ray implementation in OpenMC uses Flat Source Regions, we use these instead of a user-defined mesh to compute Shannon entropy. The implementation otherwise follows the same methodology for calculating Shannon entropy as other MC applications.
A regression test directory,
random_ray_entropy
, was also developed for this PR. Based on the cross-sections and geometry mesh given by Nowak et al., the Shannon entropy is calculated exactly as 9.0 and the eigenvalue as 1.0.Small edits to the documentation were also made to reflect Shannon entropy being implemented into the Random Ray method in OpenMC.
The 2D C5G7 Random ray example was used for validation of the Shannon entropy implementation. Below is a plot of the eigenvalue and Shannon entropy calculated at each batch.
Fixes #2868
Checklist