# Custom AmBe neutron source implementation

**URL:** <https://openmc.discourse.group/t/custom-ambe-neutron-source-implementation/6369>\
**Category:** User Support\
**Created:** [June 18, 2026, 7:41am UTC](https://openmc.discourse.group/t/custom-ambe-neutron-source-implementation/6369 "2026-06-18T07:41:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giorgia](https://avatars.discourse-cdn.com/v4/letter/g/91b2a8/32.png) [@Giorgia](https://openmc.discourse.group/u/Giorgia)\
**Post date:** [June 18, 2026, 7:41am UTC](https://openmc.discourse.group/t/custom-ambe-neutron-source-implementation/6369/1 "2026-06-18T07:41:32Z")

</div>

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:

```auto
SDEF par=n erg=d1 rad=d2 pos=-15 0 0 ext=d3 axs=1 0 0 vec=1 0 0 dir=d4

```

where:

- `d1` is the energy distribution
- `d2` and `d3` define a cylindrical spatial distribution (radius and axial extent)
- `d4` is 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:

```auto
# 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
