from collections import defaultdict
import matplotlib.pyplot as plt
import openmc.deplete
import openmc.data
chain = openmc.deplete.Chain.from_xml('/home/romano/openmc-data/depletion/chain_casl_pwr.xml')
u235 = chain['U235']
u235.yield_data
<FissionYieldDistribution with 155 products at 3 energies>
The yield data is organized by incident neutron energy
u235.yield_data.energies
(0.0253, 500000.0, 14000000.0)
You can index the yield data by energy:
thermal_yield = u235.yield_data[0.0253]
thermal_yield
<FissionYield containing 155 products and yields>
And then by a product:
thermal_yield['I135']
0.0628187
thermal_yield
will act as a dictionary, so you can use methods like items()
on it:
list(thermal_yield.items())
[('Ag109', 0.0), ('Ag109_m1', 0.0), ('Ag110', 1.00993e-14), ('Ag110_m1', 2.27984e-14), ('Ag111', 0.000173788), ('Ba134', 5.25963e-12), ('Ba137', 5.42962e-07), ('Ba140', 0.0621448), ('Br81', 0.00203666), ('Br82', 5.41962e-07), ('Cd110', 0.0), ('Cd111', 5.200000000000018e-07), ('Cd113', 0.00014038), ('Ce140', 1.14992e-09), ('Ce141', 0.0584699), ('Ce142', 0.0584879), ('Ce143', 0.0595576), ('Ce144', 0.0549956), ('Cs133', 7.91944e-09), ('Cs134', 3.85473e-08), ('Cs135', 2.45483e-06), ('Cs136', 2.7688e-05), ('Cs137', 0.000599988), ('Dy160', 1.92986e-14), ('Dy161', 2.50982e-13), ('Dy162', 1.58989e-07), ('Dy163', 6.10957e-08), ('Dy164', 1.87987e-08), ('Dy165', 9.39934e-09), ('Eu151', 2.48982e-12), ('Eu153', 2.32984e-09), ('Eu154', 9.69931e-10), ('Eu155', 2.62981e-08), ('Eu156', 0.00014853), ('Eu157', 6.14957e-05), ('Gd154', 1.11992e-13), ('Gd155', 4.07971e-12), ('Gd156', 1.4299e-10), ('Gd157', 1.4799e-09), ('Gd158', 3.28577e-05), ('Gd159', 1.00893e-05), ('Gd160', 3.18977e-06), ('Gd161', 8.5194e-07), ('Ho165', 1.03377726e-10), ('I127', 0.0), ('I128', 9.681748300000001e-09), ('I129', 0.004531414), ('I130', 2.11985e-06), ('I131', 0.0289069), ('I132', 9.13085e-05), ('I135', 0.0628187), ('In115', 0.000121551), ('Kr82', 4.2466880000000005e-09), ('Kr83', 0.00536203), ('Kr84', 0.0100192), ('Kr85', 0.00283404), ('Kr86', 0.0196497), ('La139', 0.0641343), ('La140', 5.21563e-05), ('Mo100', 0.0629233), ('Mo92', 0.0), ('Mo94', 2.99979e-14), ('Mo95', 1.389193165e-08), ('Mo96', 5.440152962e-06), ('Mo97', 0.059968), ('Mo98', 0.0578989), ('Mo99', 0.0610873), ('Nb95', 1.2940250079999999e-06), ('Nd142', 0.0), ('Nd143', 4.79966e-14), ('Nd144', 9.56932e-11), ('Nd145', 0.0393337), ('Nd146', 0.029969), ('Nd147', 0.0224673), ('Nd148', 0.0167354), ('Nd149', 0.0108162), ('Nd150', 0.00653249), ('Nd151', 0.00418124), ('Pd104', 0.0), ('Pd105', 0.0), ('Pd106', 0.0), ('Pd107', 0.00146192), ('Pd108', 0.000541252), ('Pd109', 0.000312199), ('Pm147', 2.48982e-11), ('Pm148', 4.44969e-11), ('Pm148_m1', 8.09943e-11), ('Pm149', 3.86973e-08), ('Pm150', 2.99979e-07), ('Pm151', 6.41955e-06), ('Pr141', 4.68967e-13), ('Pr142', 2.31484e-11), ('Pr143', 4.49968e-09), ('Pr144', 1.4299e-08), ('Rh102', 5.90958e-12), ('Rh102_m1', 4.72967e-12), ('Rh103', 6.37955e-13), ('Rh103_m1', 4.2697e-12), ('Rh104', 4.88965e-11), ('Rh105', 0.0), ('Rh105_m1', 0.0), ('Rh106', 0.0), ('Rh106_m1', 0.0), ('Ru100', 2.11985e-12), ('Ru101', 0.0517255), ('Ru102', 0.0429847), ('Ru103', 0.0303093), ('Ru104', 0.0188069), ('Ru105', 0.0096416), ('Ru106', 0.00401548), ('Sb121', 0.000130461), ('Sb123', 0.000156569), ('Sb125', 0.000340196), ('Sb127', 0.00156958), ('Sm147', 0.0), ('Sm148', 1.63988e-14), ('Sm149', 1.70988e-12), ('Sm150', 1.21991e-10), ('Sm151', 4.74966e-09), ('Sm152', 0.00266913), ('Sm153', 0.00158279), ('Sm154', 0.000744337), ('Sm155', 0.000321327), ('Sr89', 0.0473274), ('Sr90', 0.0578194), ('Tb159', 1.69988e-11), ('Tb160', 2.8398e-10), ('Tb161', 5.95958e-10), ('Tc100', 5.5896e-08), ('Tc99', 1.22991e-09), ('Tc99_m1', 2.8898e-10), ('Te127', 9.9193e-11), ('Te127_m1', 2.42983e-10), ('Te129_m1', 0.000902066), ('Te132', 0.042948), ('Xe128', 8.32941e-13), ('Xe130', 1.96986e-10), ('Xe131', 1.4199e-09), ('Xe132', 4.2197e-07), ('Xe133', 0.0669909), ('Xe134', 0.0787208), ('Xe135', 0.000785125), ('Xe135_m1', 0.00178122), ('Xe136', 0.0631272), ('Xe137', 0.0612832), ('Y89', 4.39969e-10), ('Y90', 4.48468e-08), ('Y91', 0.0582783), ('Zr90', 2.09485e-12), ('Zr91', 4.41969e-10), ('Zr92', 0.0602125), ('Zr93', 0.0634629), ('Zr94', 0.064722), ('Zr95', 0.0650274), ('Zr96', 0.0633924)]
chain_yields = defaultdict(float)
for nucname, y in thermal_yield.items():
z, a, m = openmc.data.zam(nucname)
chain_yields[a] += y
mass, yields = zip(*sorted(chain_yields.items()))
plt.plot(mass, yields)
plt.xlabel('Mass number')
plt.ylabel('Chain yield')
Text(0, 0.5, 'Chain yield')