-
Notifications
You must be signed in to change notification settings - Fork 598
Resolve conflict with weight windows and global russian roulette #3751
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
base: develop
Are you sure you want to change the base?
Conversation
pshriwise
left a comment
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.
Thanks @GuySten! You are a machine. Some thoughts to consider here in the comments.
| } | ||
| } | ||
| // Play russian roulette if there are no weight windows | ||
| if (!settings::weight_windows_on || |
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.
I think we may want to limit this to only the first condition. In the case that the weight window check points at collisions are disabled, I expect we'd see the same aggressive rouletting cited in #2773.
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.
The problem is that without that check we will not have global rouletting when we are outside the mesh boundary when collision checkpoints are disabled and surface checkpoints are enabled.
EDIT:
Maybe further restructure is needed.
I will think about that.
What do you think?
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.
If I'm understanding right, with weight windows on we'll still check for a valid weight window bin in apply_weight_windows and in the absence of a valid bin (i.e. if the particle is outside the mesh).
It could be that particles exceed the lower or upper energy bounds of the weight windows rather than, but in essence I'd say this is equivalent to the argument about particles leaving the mesh -- if the user is interested in this energy space then it should be part of the weight windows definition.
Now, hypothetically, we could run into a problem where weight windows are enabled in the settings but all checkpoints are turned off, then no rouletting would apply. Maybe an extra initialization check/warning to address this would be a good idea.
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.
If I understand correctly, If weight windows are on and collision checkpoints are off we will have global rouletting when outside of mesh only in surface checkpoints which is weird behavior.
Usually we use global rouletting only in collisions.
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.
It's different, true. Though the purpose of rouletting is that we address low-weight particles at some point in the simulation so they don't run for an exceedingly long amount of time, but I don't see a reason that this must occur during a collision event.
For infinite media problems we may never hit a surface to roulette these particles, but I also don't think we'd see application of weight windows in those cases.
That said, if you have a way of restructuring things so it aligns better with the current rouletting check points, I'm game! Main thing I'm watching out for is that we avoid an additional weight window look-up or additional particle state if possible, which your PR does well now.
Description
Currently the global neutron russian roulette (which is used when survival biasing is turned on) conflicts with the application of weight windows.
As suggested in #2773 (comment), this PR makes global neutron russian roulette apply only when neutrons are outside of the weight windows mesh boundaries.
Fixes #2773
Checklist
I have followed the style guidelines for Python source files (if applicable)I have made corresponding changes to the documentation (if applicable)