Hello, I am trying to plot the neutron flux distribution per energy unit using the TRIGA reactor model provided by OpenMC. I am new to OpenMC and keep getting a problem where the flux_mean value always doubles itself based on the energies value, which eventually makes the plot impossible. Here is my tally configuration
tallies = openmc.Tallies()
energies = np.logspace(-3,7,50)
e_filter = openmc.EnergyFilter(energies)
tally = openmc.Tally(name='energy')
tally.filters = [e_filter]
tally.scores = ['flux', 'fission']
tallies.append(tally)
tallies.export_to_xml()
flux_mean
sp = openmc.StatePoint('statepoint.100.h5')
flux = sp.get_tally(scores=['flux'])
flux_mean = flux.mean.ravel()
And the plot
plt.figure()
plt.plot(energies[:-1], flux_mean/np.diff(energies))
plt.grid()
plt.show()
Please help me. I’m stuck on this problem for over a week.
Thank you. Also sorry for my very bad english (i’m using google translate)