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

Fix TimeFilter for very small time intervals with tracklength estimator #2168

Merged
merged 2 commits into from
Aug 15, 2022

Conversation

paulromano
Copy link
Contributor

This PR fixes #2156. The issue is as follows: if you have a source with a large time specified, e.g., 1.0e8 seconds, the time interval over a single track might be so small that the starting and ending time for that track are effectively the same. This is just a result of floating-point arithmetic because it's possible to have $t + Δt = t$ in if $Δt$ is small relative to $t$. Right now, such tracks will not get marked as match for a time filter even if the starting time is within a specified time bin. This is now fixed in TimeFilter::get_all_bins and for good measure, I've added a test that checks this particular condition.

Thanks to @tibetscarlett for identifying the issue and giving a proposed solution!

@paulromano paulromano added this to the v0.13.1 milestone Aug 11, 2022
Copy link
Contributor

@pshriwise pshriwise left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @paulromano! Changes look good to me. Tried the test out w/o the fix and got a zero tally with the filter applied as described. ( test works with the fix of course 😄 )

@pshriwise pshriwise merged commit 12ced92 into openmc-dev:develop Aug 15, 2022
@paulromano paulromano deleted the time-filter-fix branch August 15, 2022 16:29
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.

TimeFilter reducing flux results
2 participants