Open keckler opened 2 months ago
I can't prove it yet, but my guess is that (as in your example above) the normal/combined case will always yield a higher number than the "expandTo" case.
What I expect to see somewhere in the code is...
expandTo: [O16, O17]
O16
and O17
are normalized to the total mass of all types of Oxygen.I can't find (3) anywhere in the code. So, IF that doesn't exist, that would be the problem.
I also do not see a unit test checking the math on this. I would expect it to be here.
@keckler Okay, this seems like the easiest/shortest test I could devise to prove this bug exists: https://github.com/terrapower/armi/commit/84001de02f0c5e17b533077a78fde9715813f69d
This should pass, but it fails with:
AssertionError: 0.06289884851817294 != 0.06290986051086071
Yeesh, it fails even for Carbon, that is damning!
Okay, @keckler , I still don't have a solution. But I used your "Oxygen-only block" example to inform 3 unit tests: https://github.com/terrapower/armi/commit/ff543c3f3d47b492dd13a007002b97f0ffac1264
expandTo
O16 - passesexpandTo
O17 - fails, underpredictsexpandTo
O16 and O17 - fails, underpredictsThis should probably be telling, but so far, no joy.
@keckler I talked to @jakehader , and I am not sure there should be a warning
here. I mean, the feature exists, so it's not "wrong". But what do you think?
My current feeling is that we should beef up some docstrings, to explain to people how potentially strange and non-physical using this nuclide flag can be, but then we close this ticket and focus on the redesign ticket Jake opened over here: https://github.com/terrapower/armi/issues/320
I think the re-design is our endgame here.
I'm just thinking aloud though. Thoughts?
Can somebody give me a good example/reason why it would be a good idea for a user to just zero out a real isotope from all materials in a run? At this point, I cannot understand how that is either (1) reasonable nor (2) safe.
I honestly don't know the use case for this. My only thought is someone might ditch a particular isotope from an element because it isn't present in their XS library. But I have multiple confusions about that:
@keckler My notion was not that I find this feature safe, or comforting. But that I know people are using this in the real world. And Jake already has the "redesign this feature" ticket open: https://github.com/terrapower/armi/issues/320
But to answer your above questions more directly, I can only imagine the problem is common in nuclear engineering that you lack good cross section data sometimes, and dealing with that problem will always be awkward and semi-non-physical. Yuck.
I noticed that the total atom density summed over all isotopes of a given element will be different in the ARMI reactor model depending on if one uses the
expandTo
attribute of thenuclide flags
in the blueprints. I have confirmed this at least for the case of oxygen, though I have not tried any other elements.I have attached two very simple examples that contain only a single block with only oxygen in it. The only difference is that the first case (named "combined") uses elemental oxygen, while the second case (named "expanded") uses the
expandTo
option to break the oxygen into O16 and O17. I would expect that both cases would produce the exact same number density when summed over all nuclides, but they do not.While the difference is small, it is still not expected, and it seems like a bug to me.
expandTo bug.zip