I have implemented two source terms using the FLUKA’s source_newgen.f file. However, I have encountered an issue with the energy spectrum sampling of one of them. In my configuration, I intended to set up a continuous sampling for neutrons at 4-5MeV and 5-6MeV, but the results are showing an unexpected range of 0-1MeV (as shown in the figure). I would be grateful if you could kindly review the issue. I have attached all the files that I have modified for your reference.
The old version of the source_library.inc you modified cannot handle multiple histogram files at the same time. This was added in a later version.
I would suggest that not to use a modified version of source_library.inc, instead you can put any customized function (with a different name) at the end of the source routine file (or even in a separate file).
Edit: I just noticed, that you duplicated the history sampling routine, which should make it work. However, I can’t compile your routine, since you didn’t remove the [ and ] brackets from the arguments.
Thank you very much. I truly appreciate your guidance. Would updating the FLUKA version alone be sufficient to resolve the issue, without the need to alter the source_library.inc file? Your expertise is invaluable, and I’m grateful for the assistance you’ve provided.
yes, upgrading FLUKA to the latest release will give you also the latest version of source_library.inc. It is always recommended to update as support is only provided for the latest release.
The cause of you issue is that you didn’t enable the line energy_logical_flag = .true., so the values in the histogram files vere interpreted as particle momentum, not kinetic energy.
Thank you! I will adjust my program according to your suggestions and will continue to communicate with you. I am extremely grateful for your detailed and prompt response.