csg2csg
csg2csg copied to clipboard
`OpenMCMaterial::zaid_to_name` doesn't work with decay-only isotopes from Serpent material input
I'm trying to convert this material file from Serpent to OpenMC:
mat fuel -4.69
.
.
.
120230 -0.00000000000000E+00
.
.
.
The dotted lines are filled in with other nuclides.
Running csg2csg -i test_mat.ini -f serpent -o openmc
gives me the following error:
File "/home/ooblack/miniconda3/envs/saltproc-env/lib/python3.9/site-packages/csg2csg/OpenMCMaterial.py", line 41, in zaid_to1_name
name = name_zaid[zz]
KeyError: 120
Using pdb
to get the state before the exception gets thrown, I find that zaid_string
is 120230
.
Now, the serpent input file syntax for the material card specifies:
The nuclide identifier for nuclides with associated cross-sections corresponds to ZZAAA.ID and, for nuclides without associated cross-sections, e.g., decay nuclides, to ZZAAAI. The identifiers include Z, the atomic number; A, the mass number of the nuclide; I, the isomeric state (0 = ground state, 1 = metastable state); and ID, the library identifier. For nuclides without associated cross-sections, include the fix option to indicate the library and temperature of the given nuclides.
There are many more decay-only nuclides in my material file, and I believe many of them are processed incorrectly but no error is thrown because the (potentially incorrect) element numbers that get sent as a key to the name_zaid
dictionary have associated values.
I think this issue could be fixed by adding some lines to SerpentInput.__get_material_card
to detect nuclides in this format.