Questions about source_newgen.f and time

Dear FLUKA experts,
I am learning source_newgen.f . I am trying to relate the position of the source to the time with source_newgen.f . I know that IRRPROFIle can define the irradiation time and particle intensity and DCYTIMES can define the decay time. But I would like to associate the position of the source with the irradiation time. For example, total irradiation time is N secondsin, the first second, the position of the source is A; in the second second, the position of the source is B; in the third second, the position of the source is C. I would like to realize this with source_newgen.f. But I don’t see a function in source_newgen.f that relates to time. So, I don’t know how to implement it. Sorry, I am just learning source_newgen.f , so there is a lot I don’t understand.
Thank you very much for your help and answer! Looking forward to your reply. Wish you the best of luck in everything.
Lin

Dear FLUKA experts,
Is this right?


With this method, the results are not right.

Hi Lin,

You can control all variables of the primary particles with the source routine (either newgen or the older one). I see that you are using DCYTIMES, so we have to be careful. There are two ways to simulate radioactive decays:

  1. Activation study mode: FLUKA scores your desired quantities at fixed times, as defined in the IRRPROFIle card. Internally, the evolution of the daughter species is not explicitly simulated but evaluated via the solution of the Bateman equation. In this case, your approach will fail. The time set in the source user routine is not effectively taken into account when considering the irradiation and cooling times. All scorings are to be interpreted as per unit time here.
  2. Semi-analogue mode: For each primary particle, all decay chains of the produced nuclides are simulated. Therefore, the appropriate timing variable is propagated during the simulation.

To answer your question, yes, you can define the time information at the user routine level. However, if I were you, I would still split the simulation into several runs and use the activation study mode for simplicity.

In any case, I’ve attached a minimal working example where I control the position and time information at the source level. Let’s consider a beam moving uniformly in time from x=−250 cm to x = -250 cm. The total movement (and irradiation) takes 1E5 seconds to occur. I want to study the DOSE-EQ after 10 seconds since the end of the irradiation.

I need the following:

  • A source routine to specify the position and time of the primary particles.
  • A user routine to specify the limit of integration for the USRBIN (fluscw.f).
  • The input file containing everything.

source_newgen.f (20.9 KB)
fluscw.f (4.2 KB)
test_decay.inp (1.6 KB)

With the files I attached, I was able to produce this plot (with very low statistics): at higher x, the cooling time is less, and therefore there is a higher dose integrated in the time window I requested.

Let me know if anything is unclear.

1 Like

Dear @dcalzola
Thank you very much for your reply and help. I will study your example file carefully.
Thank you very much.

Lin