Hi all,
I’m attempting to plot various cross sections for a material I have defined in my materials.xml file as shown below.
<material depletable="true" id="5" name="fuel(0.06896551724137931)-li_salt(0.1896551724137931)-k_salt(0.15517241379310345)-chlor(0.5862068965517242)" temperature="900">
<density units="g/cm3" value="2.3367120000000003" />
<nuclide ao="0.002548104822851506" name="Np237" />
<nuclide ao="0.02591765558141982" name="Am241" />
<nuclide ao="0.00017202307213090836" name="Am242" />
<nuclide ao="0.017968453318747826" name="Am243" />
<nuclide ao="1.3783570234063908e-05" name="Cm242" />
<nuclide ao="0.00011015937937005189" name="Cm243" />
<nuclide ao="0.010559337947889933" name="Cm244" />
<nuclide ao="0.011477494506624643" name="Cm245" />
<nuclide ao="0.00019850504211056688" name="Cm246" />
<nuclide ao="0.17526034482758623" name="Li7" />
<nuclide ao="0.0143948275862069" name="Li6" />
<nuclide ao="0.14472777797760963" name="K39" />
<nuclide ao="0.010444635815493864" name="K41" />
<nuclide ao="0.029310344827586206" name="Cl35" />
<nuclide ao="0.5568965517241379" name="Cl37" />
Then I run my simple python script.
# Define material object
mat = openmc.Material(5)
# Plot reaction for material
fig = openmc.plot_xs(mat, ['fission'])
But I am encountering the following error.
/home/jeickman/.local/lib/python3.8/site-packages/openmc/material.py:1004: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
percent_in_atom = np.all(nuc_density_types == ‘ao’)
Traceback (most recent call last):
File “plot_mat_xs_test.py”, line 11, in
fig = openmc.plot_xs(mat, [‘total’])
File “/home/jeickman/.local/lib/python3.8/site-packages/openmc/plotter.py”, line 122, in plot_xs
E, data = calculate_cexs(this, types, temperature, sab_name,
File “/home/jeickman/.local/lib/python3.8/site-packages/openmc/plotter.py”, line 278, in calculate_cexs
energy_grid, data = _calculate_cexs_elem_mat(this, types, temperature,
File “/home/jeickman/.local/lib/python3.8/site-packages/openmc/plotter.py”, line 527, in _calculate_cexs_elem_mat
nuc_fractions = this.get_nuclide_atom_densities()
File “/home/jeickman/.local/lib/python3.8/site-packages/openmc/material.py”, line 1020, in get_nuclide_atom_densities
density = -density / self.average_molar_mass * 1.e-24
File “/home/jeickman/.local/lib/python3.8/site-packages/openmc/material.py”, line 226, in average_molar_mass
return mass / moles
ZeroDivisionError: float division by zero
Anyone know what the issue is here? I’m using OpenMC v0.13.3