Implement surface flux tallies#3742
Conversation
|
The tests does not pass because of #3743. |
|
This PR is ready for review. |
|
Thanks for the PR @GuySten! I'm wondering what your thoughts are on providing the Given that the score requires a tally have a Let me know what you think! |
|
If I remember correctly there is a case when there are only CellFrom and Cell filters without surface filters. I think if there is interest we can add in a subsequent PR attributes to the Surface objects themselves that will override the defaults in the setting object. |
Ah, yes, right you are. Part of the motivation for my comment was that we avoid additional global settings, but in light of the |
|
Haven't forgotten about this. Will give it another look tomorrow |
|
@pshriwise, are you reviewing this PR? |
paulromano
left a comment
There was a problem hiding this comment.
Thanks a lot for implementing this @GuySten! A few comments below that shouldn't be too difficult to address:
|
I thought about another problem. I will think about a way to fix that so particles in the other direction will also score. EDIT: |
|
@paulromano, I addressed all your concerns. |
paulromano
left a comment
There was a problem hiding this comment.
@GuySten Thanks so much for your work on this feature. After your latest updates, I did some more refactoring to simplify the implementation, notably:
- Eliminated the need for
CombFilterBinIterand the mirrored particle inscore_surface_tally - Made it so that
SurfaceFilteris independent of the score; it always assigns a filter weight of 1.0 and the direction for current is now handled as part ofscore_surface_tally
Take a look and let me know if you're OK with the updates!
|
My changes made that surface flux from cell1 to cell2 will be identical to surface flux from cell1 to cell2, both of them will have the meaning of flux averaged over the surface between cell1 and cell2. |
|
I understand the motivation behind wanting the flux from cell1 -> cell2 to be equivalent to the flux from cell2 -> cell1, but to me that behavior would be surprising and inconsistent with how the tally system in OpenMC works. With a few exceptions, filters are intended to limit the events that score to a tally. If a user adds a CellFromFilter, my expectation is that only particles originating "from that cell" should score to the tally. By allowing it to have the double meaning of also "cell to", it becomes confusing as to what the filter is really indicating. Another concern I have is that it creates dependencies between filters, which again makes it hard to reason about the overall behavior. |
|
As long as this decision is made knowingly I am okay with it. |
Description
This PR enable openmc to calculate surface flux tallies.
Fixes #2.
Theory
https://www.tandfonline.com/doi/pdf/10.13182/NSE09-72
Checklist