Closed RemDelaporteMathurin closed 2 years ago
Yep you currently need openmc 0.11for this to work, the readme has an example
Ok, is it because the current version doesn't write "initial_source.h5"? if so, why is the settings.write_initial_source attribute not deprecated?
openmc 0.13.0 doesn't write the initial_source.h5 for fixed source simulations despite their being an attribute Related issue https://github.com/openmc-dev/openmc/issues/1537
The source sampling feature in the next release of openmc (that FLF funded) will help obtain the information required without the need to write a initial_source file
Ok I see. I shall close this now :-)
For those who are interested, my workaround was:
import matplotlib.pyplot as plt
import numpy as np
E = my_source.energy
n_samples = 20000
std_dev = np.sqrt(4.*E.e0*E.kt/E.m_rat)
energy = np.random.normal(E.e0, std_dev, n_samples)
energy *=
plt.hist(energy, bins="auto", alpha=0.8)
plt.savefig("out.png")
For a source with a Muir energy spectrum
MWE:
Produces:
openmc_source_plotter version: current openmc version 0.13.0
Should I use openmc 0.11 to have this work?