mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
Don't write reaction targets that are None to XML
This is related to a bug pointed out in the user's group, where writing a ReactionTuple with a None target errors. https://groups.google.com/forum/#!topic/openmc-users/jB_-zEKhF-k The condition appeared when the reaction was a non-fission (n, gamma), but the daughter isotope did not exist in the Chain, represented by None. This issue is resolved by skipping the target only if daughter is None, regardless of reaction. The Nuclide.from_xml can handle a missing target just as it handles a target of "Nothing" [case-insensitive]
This commit is contained in:
parent
173c85c2cb
commit
ea6a069544
1 changed files with 1 additions and 1 deletions
|
|
@ -243,7 +243,7 @@ class Nuclide:
|
|||
rx_elem = ET.SubElement(elem, 'reaction')
|
||||
rx_elem.set('type', rx)
|
||||
rx_elem.set('Q', str(Q))
|
||||
if rx != 'fission' or daughter is not None:
|
||||
if daughter is not None:
|
||||
rx_elem.set('target', daughter)
|
||||
if br != 1.0:
|
||||
rx_elem.set('branching_ratio', str(br))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue