How to define the source strength and unit circle source region in fixed source mode

Hi all,

In the fixed source mode, I have tried to define a unit strength fixed neutron source within a 2D circle with r=1. However, I have no idea how to define the source strength, and how to define the unit circle source region, since the existing examples are only point and box. Could you give me some advice? Thank you all.

Sincerely yours,
Yahui Wang

The source strength is specified with the strength= argument to Source(). Since it defaults to 1, if you want a unit strength source you don’t need to specify it. To do a unit circle source in the x-y plane at z=0, the following should work:

r = openmc.stats.PowerLaw(0.0, radius, 1.0)
phi = openmc.stats.Uniform(0.0, 2*pi)
z = openmc.stats.Discrete([1.0], [0.0])
spatial_dist = openmc.stats.CylindricalIndependent(r, phi, z)
source = openmc.Source(space=spatial_dist, ...)

Right now, it’s only possible to do this in the x-y plane unless you wanted to write your own custom source routine.

Thank you paul. I will try it.