Maybe a bug for Electric field

Versions

Please provide the used software versions.

FLUKA:3.4-5.2
Flair:4-5.1

Description

Dear FLUKA developers and experts,
I am attempting to simulate electrons and protons passing through an electric field of a defined intensity. The particle energy is expected to increase, but the energy gain calculated by FLUKA is inconsistent with theoretical results—it is only about 70% of the theoretically predicted value. This issue occurs consistently across different field strengths. Have I missed any conditions, or is there a bug in the code?

Initial Electron Energy 1MeV Electron Accelerated in Electric Field Initial Proton Energy 10MeV Proton Accelerated in Electric Field
E strength [kV/cm] E [kV] Eenrgy Increased Analytic [MeV] Eenrgy Increased FLUKA [MeV] Ratio Eenrgy Increased Analytic [MeV] Eenrgy Increased FLUKA [MeV] Ratio
10 1000 1 0.6 0.6 1 0.6 0.6
20 2000 2 1.4 0.7 2 1.4 0.7
30 3000 3 2.1 0.7 3 2.1 0.7
40 4000 4 2.8 0.7 4 2.8 0.7
50 5000 5 3.5 0.7 5 3.5 0.7
80 8000 8 5.6 0.7 8 5.6 0.7

Input files

Electric.inp (2.0 KB)

For EZ=-10 kV/cm, Elength=100cm, through this field electron increased Energy should be 1MeV, and detector 2 should be 2MeV. While it’s ~1.6MeV.

Hello,

Thanks for this question, this is indeed a valid point. It is indeed a bug, which we have fixed and which will be solved in the upcoming release.

Without going into technicalities, the tracking algorithm was sometimes going into a different branch of the code that incorrectly calculated the particle energy while traveling in the electric field. As a result, only a fraction of the energy the particle was supposed to gain was actually accounted for.

Worry not, we will fix this issue in the upcoming release. I attach here the plot you would obtain after the next update:

Nice catch! Have a nice day.
Cheers,
Daniele

Thank you very much for your explanation, Daniele. We look forward to the release of updated versions.