Closed keckler closed 2 years ago
Happily, I think this can be fixed rather easily via some utilities in the nuclideBases
module: https://terrapower.github.io/armi/.apidocs/armi.nucDirectory.nuclideBases.html#module-armi.nucDirectory.nuclideBases
I can go ahead and get a PR for this.
The
Block.getReactionRates()
method supposedly will allow one to specify an isotope and get the rate of a specified reaction on the given block: https://github.com/terrapower/armi/blob/69c778934b9e0cfe3751f2efde836126889a1902/armi/reactor/blocks.py#L1489-L1520If the user does not specify the
nDensity
argument,Block.getReactionRates()
will attempt to look up the isotope's number density in the block using theBlock.getNumberDensity()
method, which under the hood iteratively calls theComponent.getNumberDensity()
method: https://github.com/terrapower/armi/blob/69c778934b9e0cfe3751f2efde836126889a1902/armi/reactor/components/component.py#L596-L610Of note is that this
Component.getNumberDensity()
method will return0.0
if thenucName
is not found in the dict.This is all fine and dandy.
So if you had a block
blockInstance
, had a properly-loaded ISOTXS file, and calledblockInstance.getReactionRates("U235")
, you would get the result you're looking for:BUT, if you instead called the method for a certain subset of isotopes, you might have problems:
The underlying issue here ends up being that
PU239
in the ISOTXS file is actually shortened to justPU39
. And a variety of other isotopes are like this as well, so that the isotope representations are all only 4 characters long. So basically the any element with a 2-character symbol that has more than 99 nucleons.And then if you think you're clever and you instead supply this shorter isotope representation to
Block.getReactionRates()
, you get this inaccurate result:But it is NOT that there is zero PU239 in the block:
Rather,
0.0
is returned becauseComponent.getNumberDensity()
doesn't know how to handle the shorter isotope representation, so it just returns0.0
because it doesn't know whatPU39
is:So basically, as is currently, you CANNOT get the reaction rates for quite a few very important isotopes using this method.
I have no idea how this went undiscovered for so long. Possibly because the method is more typically used for generating cross-sections, as alluded to in it's docstring? In that case, you won't run into the same problem because the number density is never looked up.