Simulating a GCR event

Dear FLUKA experts,

I want to simulate a GCR event but I am getting a bit lost in all the information and terms. I want to assess the dose of a phantom inside a simple geometry as a result of such an event.

There are two possible situations I am considering for this:

  1. From SPENVIS, one can download the integral flux in a .txt file
  2. from OLTARIS, one can download the differential flux in a .dat file

(1) Does FLUKA/flair use integral and/or differential flux to simulate a GCR flux?
(2) How are the .txt and/or .dat file read into FLUKA (and consequently simulations can be run)?

  • Is this by the SOURCE card? If yes, I am confused as to what to do with the sdum and WHATs of this card.
  • There is also something with using a (source).f file. But I don’t know how to get such a file starting from .txt or .dat. (2.1) How should the content of the .f file be structured or look like (i.e. its format)?
  • (2.2) Should these .f files also be converted to .exe prior to running the simulations?

For HZE energies higher other executable files (rQMD for 130 MeV/n - 5 GeV/n and DPMJET for 5 GeV/n and higher) should be used. (3) How should this be defined when dealing with a range of energies requiring different executable files?

I believe using these cards will overwrite the BEAM and BEAMPOS card. However, how can I still configure that the GCR flux is isotropic with respect to the defined geometry. (4) How is this defined for this situation where I want to use the GCR flux?

My apologies for the many questions. I hope these questions are clear as I am very confused what things have to be done for this situation.

Thank you in advance.

With kind regards,

Dear @kjohnson ,

The FLUKA distribution comes with a series of tools and particle spectra that can be used out-of-the-box for GCR simulations. The key ingredients are the usage of the SPECSOUR and GCR-SPE cards, in addition with the provided spectra. Please have a look to Chapter 16 of the manual, where you can finds all the info.

If you aim to use external particle spectra, you might want to use a dedicated source routine that samples directly from your auxiliary file. The source routine can be modified to fit your needs. However, please keep in mind that some parameters of the BEAM/BEAMPOS cards might be overwritten, depending on how you code the source routine. There are a number of posts in the forum with regard to this topic. I link the following which looks to me a similar post to your problem. Anyway I invite you also to make use the search function of the forum to access similar or other topics that might be of help.

Once you have the routine, you have to link to the executable and call the routine from the inp file via the SOURCE card. For cosmic ray applications I suggest to link to DPMJET.



Dear Angelo,

Thank you for your reply. The reason I am opting for external particle spectra is because I want to assess a GCR event outside of Earth’s influence (however from your link to the similar article this should also be possible by omitting the GCR-SPE but it comes with cautions as mentioned by you). In OLTARIS for example, one can select the Mars Surface environment which is where I want to assess the GCR event. Furthermore, several GCR models (e.g. Badhwar-O’Neill 2020) can also be selected here.

Following the Sampling from energy spectra post from Chris and its included files, I found the README and the example (Spec01) files.

However, I still have a question. The OLTARIS .dat file provides the energy spectrum and differential flux but for different particle species (Z from 1 and beyond), from your link, it still wasn’t clear how to deal with energy spectra and differential flux for several particle species. If only one particle species is used, then it is clear to use the Emin in the first column, Emax in the second column and the differential flux in the third column. However, if one wishes to add more particle species to this .dat file, how should this be done exactly?

Thank you kindly,

Hi Kim,

I am afraid that in the current implementation the routines do not support multiple particle types. One would have to adapt the code for this, which requires some work.

Another option would be to do a simulation per particle type and add up the results with a weighted sum, where the weight corresponds to the integral fluence of this particle divided by the total integral fluence of all particle types.

Best regards

Hi Chris,

Thank you for you reply. Unfortunately, OLTARIS does not output integral flux. SPENVIS however does include differential and integral flux as output. Following your great suggestion, I wanted to double check the following with you:

  • You mentioned “where the weight corresponds to the integral fluence of this particle divided by the total integral fluence of all particle types”. Since an integral flux value per particle type per energy level (of the energy spectrum) is given, do you mean with the “integral fluence of this particle” the total sum of the integral fluxes per energy level for a specific particle?

If yes, I will try this out and will update this post in due time.

Kind regards,


do you mean with the “integral fluence of this particle” the total sum of the integral fluxes per energy level for a specific particle?

yes, exactly. Let’s call this quantity A.

If you then do this for each particle type you might get W = A + B + C + …

This will allow you to define the weight (= importance) of each particle type as A/W, B/W, C/W, … and these weights can be used in the weighted sum to determine the final result of multiple particle types.


Perfect, thank you for the confirmation and your help!

I will try it out this way :slight_smile: