Spherical shell definition

Dear FLUKA experts,

I am trying to define a spherical shell source with thickness 0 and an isotropic distribution inside it. By looking at other threads I have been able to write something very close to it (I attach my .f file)

My questions are:

1.- If I replace the variables rmin and rmax and just use one variable R, it should be equivalent to a spherical shell with thickness 0?

2.- I am using comparisons of radii to check if my beam directions are going “outside” or “inside” my spherical shell. Is there a better way to do this?

Any input would be appreciated.

Best Regards,
spherical_shell.f (7.1 KB)

Dear Carlos,

  1. Yes, if rmin=rmax, the the line:

    radius =((rmax_cubed-rmin_cubed)*FLRNDM( xdummy )+ rmin_cubed)**(ONETHI)

    turns into

    radius =(rmin_cubed)**(ONETHI)

    which is the fixed radius you specified.

  2. You may calculate the angle between the sampled direction vector, and the vector from the position on the sphere to center of the sphere. If if is less than 90 degrees, then the particle is directed inward.


Dear David,

Thank you for your answer.

Best Regards,