-
Notifications
You must be signed in to change notification settings - Fork 509
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
Source rejection by domain (cell, material, universe) #2235
Conversation
@paulromano what would you think of having attributes for each domain type? This would allow rejection on a mixture of domain types if a user wanted to reject source sites for an entire universe and a few specific cells in another universe, for example. |
@pshriwise I did consider that, but it didn't seem to me that it would be worth the extra complexity. The case of combining a universe and some other cells could also be represented by using only cells. |
Hrmmm yeah that's a fair point -- either of the |
Co-authored-by: Jonathan Shimwell <drshimwell@gmail.com>
Co-authored-by: Jonathan Shimwell <drshimwell@gmail.com>
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.
This feature is sure to be a crowd-pleaser 🎉 I believe we've gotten requests for this feature a number of times. Some small comments from me here.
Co-authored-by: Patrick Shriwise <pshriwise@gmail.com>
Thank you @paulromano! |
This PR implements the ability to specify a set of a cells, materials, or universes that are used to "filter" sampled source sites and closes #1829. The way it works is:
Source(..., domains=[...])
, wheredomains
is a list of either cells, materials, or universes that will be used for rejection.openmc.stats.Box
), but then those points will be checked against the list of domains, if present. If a point is not within the specified list of domains, it will be rejected.The attribute handling for the
Source
class follows the same design as for theVolumeCalculation
class. Namely, even though the constructor specifiesdomains
, this is turned intodomain_type
anddomain_ids
attributes. This is done so that aSource
object doesn't have to be inextricably linked to actual geometry objects.@pshriwise and I discussed other overall design alternatives for this feature. In particular, we discussed the possibility of having a much more complex system based on rejection filters, which could be generalized to other uses (for example, rejection based on the energy or angle). We ended up steering away from that idea as it seemed a bit over-engineered, and our guess was that 99% of practical use-cases would just be simple spatial rejection, which is handled by a simpler design here.