Non-isotropic source and custom source problem

Dear all,

I’m currently trying to create a non-isotropic source for a fusion reactor simulation, so that most of the neutrons are directed towards the outboard first wall.

My initial idea was to model a simple ring source, with the neutron source.angle defined by a normal distribution oriented outward from the ring. Unfortunately i haven’t been able to set up the angle distribution as intended. Currently, I can only set it to a single direction for all the source points in the ring:

mu = openmc.stats.Uniform(cos(aperture/2), 1.0)
phi = openmc.stats.Normal(pi/2,0.001)
ring_source.angle = openmc.stats.PolarAzimuthal(mu, phi, reference_uvw=(0., 0., 1.))
Screenshot 2024-08-18 180912

I suspect the only way to create a source of the desired type would be by compiling a custom source (a process I’m unfamiliar with).
However, I’m currently experiencing some issues with cmake while attempting to compile the source.

I’m working in a WSL environment with OpenMC set up in a Conda environment; when using the “make” command I get the following error:

conda run -n openmc-env make
make[2]: *** No rule to make target ‘/home/conda/feedstock_root/build_artifacts/openmc_1703008636854/_build_env/x86_64-conda-linux-gnu/sysroot/usr/lib/libpthread.so’, needed by ‘libsource.so’. Stop.
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/source.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

ERROR conda.cli.main_run:execute(124): conda run make failed. (See above for error)

It seems that make is looking for libpthread.so in a Conda build environment path that doesn’t exist or is incorrect.

I’ve tried:

  • Verifying Paths and Environment:
    I’ve confirmed that libpthread.so exists at /usr/lib/x86_64-linux-gnu/libpthread.so.0 with a symlink to /lib/x86_64-linux-gnu/libpthread.so.0.
    I’ve also verified that LD_LIBRARY_PATH includes /usr/lib/x86_64-linux-gnu and the Conda environment library path.
  • Clearing CMake Cache and Recreating Build Directory

I would greatly appreciate any advice on resolving the libpthread.so path issue. Additionally, while working on fixing this problem, could you suggest any alternative approach to create a non-isotropic source of the described type?

Thank you!
Alessandro