Dear Riya,
the issue is the missing line
WEIPRI = WEIPRI + WTFLK (NPFLKA)
FLUKA stores the total primary weight in the WEIPRI
variable.
However, looking at your source routine I have some pointers:
-
It’s a bit confusing, that you are calculating the area of a circle, using it to set probabilities and weights, but you sample location is a sphere.
-
You are using the
FLRNDM(XDUMMY)
function without the XDUMMY variable. (Any double precision variable is acceptable as argument) -
I couldn’t figure out why did you set the probabilities / weights as you did, but I think the probabilities needs to be independent from the system. Setting all probabilities to 1.0 is ok.
-
You used an old source.f template. You can find the current one in
/usr/local/fluka/scr/user
directory. -
You can use a USRBIN scoring to plot a weighted source distribution. For this trick, you need to:
- Assign to all regions a non VACUUM material.
- Set a photon transport threshold higher that the source energy. This will force all photon primaries stop immediately after they are created and deposit their energy on the spot.
- Score ENERGY with USRBIN
If the weighted sampling work correctly, each bin should have the same value (depending on the statistics).
-
You coded the direction and spherical sampling by hand. There are build in FLUKA function to take care of this.
Based on these points, I reworked your source routine with the new template. This should work correctly: cloud_source_v4.f (11.3 KB)
Cheers,
David