I am modelling a rather inefficient process (x-rays through a partial transmission target). I know I can use biasing, and I do, but the statistics are still lower than I would like for reasonable run time. As such, I want to use the two-step method, i.e. collect a phase space immediately after the transmission target and then use that phase space as the input for the rest of the geometry. From other forum posts I have gathered from other posts
that
- I need to kill particles crossing my phase space boundary so I don’t double count backscatter particles.
- A good approach is to generate multiple phase space files (through Cycles and Spawns) and then use each phase space file as the source of its own run. For example, step one would produce a phase space file “Transmission_Target_PhaseSpace_Write_001_phsspc” and the second step would use “Transmission_Target_PhaseSpace_Read_001.inp” as the input file for the corresponding phase space.
Are the input file name and run cycle number available in FLUKA user routines?
I would like to programmatically choose a phase space to read for the second step based on which input file that wrote it for the first step. Since FLUKA prepends any file I open in the user-routines with the input file name, all my phase space files get prepended as well. I thought that if I had the input file name, I could do some simple string replacement to read the corresponding phase space file.