Fixed a bug in charged particle energy deposition.#3416
Fixed a bug in charged particle energy deposition.#3416paulromano merged 13 commits intoopenmc-dev:developfrom
Conversation
|
For a change of this kind to how tallies function I think this should also be documented in the theory manual. Along those lines I'm having trouble with understanding how these tallies should be behaving? Could you write up the math of what is happening with this change? Possibly including the theory from the HEATR module of module of NJOY so we can see how this tally derives from the "base" nuclear data? |
I have improved the documentation of energy deposition from photons and charged particles in general and this feature specifically. I also refactored the logic for scoring heat in general to avoid code repitition. Now this pull request is ready for review. |
|
I've not looked through the PR in much detail, I've just run the script in issue #3317 and I think this PR doesn't change the situation of individual heating not adding up to total heating. I will double check I'm running the |
That's weird. I changed the code so that this problem does not appear in a test that contain a simpler incident photon source. I think I will add your original minimal working example as another regression test and I will try to make it work. Maybe there is another problem in heating calculations. |
|
Might be user error on my side. I shall try again for a docker container soon |
|
This is fab it certainly does fix the error, for some reason I had compiled your tff branch instead of this one. Sorry my my mistake there. This does fix the issue I raised. By the way thanks for all the PRs fixing bugs, really useful work. Sorry for the slower than typical reviews the OpenMC conference is on at the moment and I think we will be back to normal next week. I see you have
Let us try to get this merged early next week once the conference is finished |
Co-authored-by: Jonathan Shimwell <drshimwell@gmail.com>
shimwell
left a comment
There was a problem hiding this comment.
Many thanks for the fix,
Will merge on Tuesday if there are no objections
paulromano
left a comment
There was a problem hiding this comment.
Just putting a placeholder review -- I'm making some updates on this branch and should have those in shortly.
paulromano
left a comment
There was a problem hiding this comment.
Thanks for this fix @GuySten! I made a few updates on this branch:
- Precomputed the total charge density so that it doesn't have to be computed each time a tally is made
- Use
mat_nuclide_index_to get the index of a nuclide for the atom density vector without a linear search - Changed the regression test to a unit test where the sum of the by-nuclide heating is checked against the total.
- Updated documentation
Head branch was pushed to by a user without write access
|
I've added a fix to stop openmc from crashing in mg mode. waiting for the tests to pass. One more fix was needed... |



Description
Currently, OpenMC deposit charged particle energy without specifying event_nuclide.
This means that when calculating heating per nuclide and total heating the sum of heating per nuclide is not equal the total heating. This pull request divide the energy deposited by charged particles in a material to be proportional to the fractional nuclide charge density.
.
Fixes #3317
Checklist