Hello everyone,
I am trying to reproduce a customized AmBe neutron source in OpenMC that I previously implemented in MCNP and FLUKA, and I would like to confirm whether my approach is correct.
In MCNP, the source is defined as:
SDEF par=n erg=d1 rad=d2 pos=-15 0 0 ext=d3 axs=1 0 0 vec=1 0 0 dir=d4
where:
d1is the energy distributiond2andd3define a cylindrical spatial distribution (radius and axial extent)d4is the angular distribution (anisotropic along the x-axis, roughly parabolic with a maximum around 90°)
In FLUKA, I implemented the same source via a custom routine, sampling:
- energy from a tabulated spectrum,
- position uniformly in a cylinder aligned with the x-axis,
- direction with a non-isotropic distribution based on cos(θ) with respect to the x-axis.
I translated this into OpenMC as follows:
# Energy distribution
AmBeSource = openmc.IndependentSource()
lstEnergy = np.array([...]) # energy in eV
lstProbability = np.array([...]) # associated probabilities
AmBeSource.energy = openmc.stats.Tabular(lstEnergy,lstProbability,'histogram')
# Cylindrical spatial distribution (aligned along x-axis)
r = openmc.stats.PowerLaw(0.0, r1, 2.0)
phi = openmc.stats.Uniform(0.0, 2*np.pi)
z = openmc.stats.Uniform(xmin, xmax)
AmBeSource.space = openmc.stats.CylindricalIndependent(r=r,phi=phi,z=z,origin=(-15.0, 0.0, 0.0))
AmBeSource.space.reference_uvw = (1.0, 0.0, 0.0) # cylinder axis along x
# Angular distribution
mu_vals = np.array([...])
p_vals = np.array([...])
mu_dist = openmc.stats.Tabular(mu_vals,p_vals,interpolation='linear-linear')
phi_dist = openmc.stats.Uniform(0.0, 2*np.pi)
AmBeSource.angle = openmc.stats.PolarAzimuthal(mu=mu_dist,phi=phi_dist,reference_uvw=(1.0, 0.0, 0.0))
AmBeSource.particle = 'neutron'
# Settings
settings = openmc.Settings()
settings.run_mode = 'fixed source'
settings.source = AmBeSource
settings.export_to_xml()
Does this implementation correctly reproduce the combined energy, spatial, and anisotropic angular distributions of the original MCNP/FLUKA source?
Any feedback or suggestions would be greatly appreciated.
Thank you in advance!
Giorgia