Different results when replaying recorded particles with source routine

Dear Fluka expert!
Could you please help me understand the following.

First simulation case:

I simulated a case whan 22 MeV photon beam interacts with water (using the BEAM and BEAMPOS cards) was calculated the energy depostion in the water along the beam in a volume of 0.1x0.1x0.1 mm3 (using the source USERBIN card).

The output from the source USERBIN card is attached (En_Dep_without_source.dat).

During this simulation, I also get beam parameters that interact with the currently selected value of 0.1x0.1x0.1cm3.

I obtained this data using the mgdraw.f procedure (attached)(1_ResultsPhoton_IN.dat).

Second simulation case:

In the second case, for the simulation I used the sorce.f subroutine (attached), in which the primary ray took into account the data obtained from the mgdraw.f (1_ResultsPhoton_IN.dat) subroutine from the first simulation.

In this case, also calculated the energy depostion in the water along the beam in a volume of 0.1x0.1x0.1 mm3 (output dats En_Dep_with_source.dat).

When I compare these data, I see that these are different amounts of storage energy for the same region.

thanks in advance for any help

Best regards
Zohrab

Could you please look at the attached files and help me find my errors?1_ResultsPhoton_IN.dat (2.7 MB) Dose22Mev.flair (7.9 KB) Dose22Mev.inp (5.7 KB) En_Dep_with_source.dat (721 Bytes) En_Dep_without_source.dat (721 Bytes) mgdraw_bw.f (16.9 KB) source.f (7.4 KB)

Dear Zohrab,

the issue is with the normalization.

In the case without the normalization you run 1e5 primaries, but only approximately 1.5e4 will enter the target depositing a total of X energy in a given region / bin. FLUKA then calculates a the results per primary, i.e. X / 1e5.

In the case with the source routine, you only replay the primaries entering the target. So the total deposited energy remains around X (not exactly the same, because the random number seed is different). However, the FLUKA result will change, now it will be X / 1.5e4, an order or magnitude higher.

In short, you need to take into account the efficiency of the first simulation by normalizing the second step.

One more remark. In your source routine, you load all your primaries stored in a file at once. If you want to simulate more primaries this way, you will reach the maximum number of primaries allowed in the stack at 70000.

You should reorganize your source routine, so it will read the particles parameters to arrays during initialization, and only load one primary to the stack at each call. You can use a counter to keep track of the lines. When the all primaries has been loaded, setting the NOMORE to one will terminate the simulation.

Cheers,
David

1 Like

A post was split to a new topic: Electron beam energy deposition in water