Dear Fluka experts,
I want to set up a cylindrical source, and the photon energy is sampled from the spectrum.There are no errors when the two parts run separately，but when I put them together, it turned out to be strange. After adding the SOURCE card, there will be conflicts with the cylindrical source.It seems to have become a point source.
source.inp (1.7 KB) source2.f (8.1 KB) spectrum.dat (82 Bytes)
The volumetric sources specified with the
BEAMPOS card are disregarded if you use the source user routine. You need to implement the cylindrical sampling manually.
as pointed out by David your source routine does not include the volumetric sampling which you have to implement yourself.
Otherwise you can use the package provided in this post:
For more complex simulations one often needs a beam that is not mono-energetic but follows a specific energy distribution. This feature is provided “out-of-the box” for CERN FLUKA by the
CERN-FLUKA-spectra-sampling.tgz (20.9 KB) user routine package that can be fully configured via the input file.
IMPORTANT NOTICE: With the release of FLUKA 4.0.0 the package had to be upgraded. In order to use it with FLUKA version >= 4.0.0 please re-download from the link above.
The provided code also suppo…
It supports all volumetric source definitions of FLUKA via the input file in combination with spectral sampling. Note that you would have to slightly adapt the input format of your spectrum.