Dear FLUKA experts,
I have recently been researching how to use the phase-space sampling feature in source_newgen.f. I would like to know if the phase-space file requires knowing the exact energy values for each particle, and how to use the phase-space function to set the energy spectrum for particles in each coordinate.
Dear Yingming,
the phase-space file should have a momentum/energy value for each line, but it is possible to override it in the user routine:
Instead of the line:
momentum_energy = phase_space_entry%m_e
you can use a standard sampling function, for example:
momentum_energy = sample_spectrum_momentum_energy( [filename], [unit] )
Cheers,
David
Dear David,
Thank you for your reply, but I have another question.
If I can only determine the energy spectrum within a range and cannot obtain the exact information of individual particles required by the phase space file format, such as coordinates and cosines, what should I do?
If I directly set the coordinate range of the energy spectrum as shown in the figure, is it still necessary to include x, y, z in the phase space file?
Many thanks,
Yingming
Dear Yingming,
the phase-space sampling requires all the numbers present, but it is up to you if you put dummy values for some parameters and don’t use them in the routine.
It is perfectly fine to use standard sampling in place of phase-space sampling (if it describes your case adequately).
Cheers,
David