I’m a beginner to OpenMC, and now I’ve built a model of my own.But an error occurred while I was running it.
I want to evaluate the absorbing properties of a new material with boron for different (discrete) neutron energies. When compiling the source with, open the openmc.Source() and openmp.statistics.Discrete () error: “There are no division points tilted by MPI of rank 0”.
When using fixed source, another error is “Could not find the cell containing particle 5001”.
How to correctly set the source for such a task? I think that using a openmc.Source() is wrong. In my opinion, it is correct to use custom source . But how can I fix a compilation error?
Hi @markin.ns and welcome to the forum. If you want to create a monoenergetic neutron source, you are on the right track. You should be using the Source and Discrete classes:
# For example, neutrons at 1 MeV
E = 1.0e6
energy_dist = openmc.stats.Discrete([E], [1.0])
space_dist = openmc.stats.Point() # <-- point source at the origin, change as needed
source = openmc.Source(space=space_dist, energy=energy_dist)
settings = openmc.Settings()
settings.source = source
...
Regarding the errors you are seeing: the first error looks to be related to MPI, which is used for distributed-memory parallelism, and seems unrelated to the source definition. The second error regarding not being able to find a cell means that the code is sampling source particles, but based on their location it can’t find a corresponding cell. Take a close look at your geometry definition to see if there are any issues with it. Note that if you have a void region that you expect particles to be sourced in or travel through, you still need to have a cell assigned to it.
Hello @paulromano! Thank you for your answer! I created the source as you advised and corrected the geometry - I created an empty cell in which I placed the source. But the same error appears again.