Proton flux source through a surface


I’m new to FLUKA and would like to model the spallation of a proton flux through the external surface of an object. The source is spatially and energy-dependent. From reading the documentation it seems that surface sources are not available and so I will need to use the SOURCE card?
I’ve had a look at the forum but I’m struggling to work out how to use the SOURCE card correctly. Is there an example of a SOURCE card with spatially dependent source (x,y,z coordinates) that I can look at.

Thanks in advance,


Dear @e.stewart17,

To define a complex source term, the best way is to write your own source routine. I suggest you to start having a look at the dedicated slides from the last beginners’ course to see how it work. You will also find several thread regarding source_newgen.f on the forum.

Thank you for your help. I have modified the source_newgen.f file to read the source from a phase space file. I have then linked the modified source_newgen.f file using the instructions on Working with user routines | The official CERN FLUKA website. In terms of the FLUKA input file, do I still need the SOURCE card? I don’t need to pass any parameters to the routine as they are defined in the source_newgen.f file.

Yes, you still need it to activate the call to the source routine.

2 posts were split to a new topic: Error when running a compiled executable