Optimization of Scintillating simulation

I am implementing a simulation for the generation of scintillation photons in an optical fiber with 1 mm diameter and 1 m long. The scintillating (optical) will be produced by the excitation of an external source. In a first attempt, I am using electrons of 2.28 MeV impinging at a 45º angle laterally.

The fiber is made of polystyrene and is placed in air. The materials have the following optical properties (OPT-PROP):

AIR: n=1, no attenuation

POLYSTR: n=1.59, Attenutaion length = 400 cm (0.0025 cm^-1)

Since the scintillation emission range is between 400 and 600 nm, with a maximum at 450 nm, I placed a card with WV-LIMIT with these parameters for each material. I also introduced a card for quantum efficiency (SENSITIV) of 33% (0.33).

Regarding scintillation production (OPT-PROD/SCINT-WV), I am considering only emission in polystyrene with the following parameters:

Single emission: 450 nm (2.8 eV)

Decay time: 2.8 ns

fraction = 2.8E-6 MeV x 12 000 photons/MeV = 0.033.

The Cerenkov radiation is switched off for the moment.

About scoring, I am only considering now three USERBIN (in bin format) to obtain the spatial distribution of the fluence of electrons, photons, and optical photons in the fiber and around it. I am using PRECISIO defaults and have not implemented any bias or cuts.

Even with only 1000 primaries, the simulation takes a long time and hangs in 1st cycle. With 10 primaries I was able to complete the simulation, but when processing the five cycles I get the message:

At line 239 of file usbsuw.f

Fortran runtime error: Index ‘81000000’ of dimension 1 of array ‘gmstor’ outside of expected range (60000000:1)

When I tried a larger volume of scintillating material (I tried with a 4 cm x 4 cm x 4 cm polystyrene box), it could not even complete the first cycle after 48 hours. I believe I am producing too many scintillating photons and I would like some help on how I can optimize the simulation… (inp file: electronfibre.inp (2.0 KB) )

Thanks in advance,
Jorge Miguel Sampaio

Dear Jorge,

I can answer the issue with the post processing program usbsuw. It has a limitation on how many bins it can process in one file. This limit was set to 60 million in FLUKA 2011-3.0

In FLUKA 4-0.0 this limitation has been removed.


PS.: FLUKA 4 currently has a bug preventing the use of optical photons.

Dear Jorge,

your input file runs at a reasonable speed (1.5 min / 10’000 primaries), so the issue should be with the system you are using.

Could you tell your the operating system, memory size, etc. of your PC?


Dear Dávid,

Thanks for the prompt answer. Indeed the binning was a problem and now I managed to produce plots. Now I am running the same example with 1000 primaries (5 cycles) using the FLUKA-Docker (version 2020.0.3) on my mac osX (2,8 GHz Dual-Core Intel Core i7, 16 GB 1600 MHz DDR3). The speed is about 1 second/primary, which is considerably slower than yours.

I will move the simulation to the FARM of my institute that has several processors with 4 cores (Intel® Xeon® CPU L5420@ 2.50GHz) to see if it improves.

My goal is to use an external LED source to produce the scintillation. In this case, I don’t know if it is possible to use optical photons as primaries, or should I use “normal” photons to ensure that the energy is deposited and the scintillation is produced?


Dear Jorge,

FLUKA 2020.0.3 is not supported on this forum.

We only provide support for FLUKA 4-0.0 distributed at https://fluka.cern