I am trying a few things out for my project and need to define a neutron source which has the shape of a spherical shell. I am also wondering what the difference is between openmc.stats.CartesianIndependent and openmc.stats.Point, if I can only specify cartesian point coordinates in both? Is it possible to use CartesianIndependent to put in a formula for a volume (like x^2 + y^2 + z^2 = r^2, separately defining radius and origin)? If I can make a sphere that way, I am hoping I could make a shell too. Or is there some way of defining surfaces and instead of filling them with a material, I can fill them with a source? Help would be greatly appreciated!
openmc.stats.Point() class is used for point source definition or delta function by giving Cartesian coordinates whereas openmc.stats.CartesianIndependent() is used for spatial distribution of x,y,z coordinates independently.
x = openmc.stats.Uniform(-10., 10.)
y = openmc.stats.Uniform(-10., 10.)
z = openmc.stats.Uniform(0., 20.)
d = openmc.stats.CartesianIndependent(x, y, z)
@Pranto thank you. I have not used a custom source before, in the example you provided in the link I can only see how to specify the radius in the x,y,z direction. How do I specify the shell source to have a certain width? I basically want to simulate a D-T plasma neutron source but in a purely spherical shape with a thickness that I can change.
@SophiaVT To have a shell source, you’ll also need to sample the radius in between a minimum and maximum radius. The appropriate PDF for the radius is uniform in r², as explained in arguments here. Thus, your sampling scheme will look something like: