Charging of material

FLUKA: 4-4.1
Flair: 3.3-1
Operating system: macOS Tahoe, version 26.2

Dear FLUKA experts,

I am studying the charging of a small object exposed to a proton beam. The geometry is a copper sphere with a radius of 50 µm. As a first approach, I used USRBDX to score electrons crossing from the material into vacuum, normalized by (1/4π) to account for solid angle.

However, I realized that not every escaping electron necessarily contributes −1e to the net charge of the object. For example, electrons produced in pair production or other processes may be accompanied by a corresponding positive charge (e.g. positrons or ions) that could also escape, partially compensating the charge balance. To investigate this, I implemented a USERDUMP with a custom mgdraw routine to record particles crossing into the VOID region. I also included evtflg.inc and attempted to tag the interaction type using flags such as LPAIRP, LBRMSP, LCMPTN, etc. In addition, I tried to access ISPUSR(1) (via STUPRE) to store the interaction type, but this quantity is always zero in my output.

Any guidance would be greatly appreciated.
Best regards,

David

Input files

plot.pdf (56.1 KB)

mgdraw_test.f (2.5 KB)

cu50.inp (1.3 KB)

Hi @dgancarc

Thank you for your question.
I am not exactly sure if I understand what you are trying to do. Maybe all you need is a USRBIN with NET-CHRG scoring quantity with a Region scoring option?
Could you please also add your version of STUPRE that you were using?
Also, in the mgdraw_test.f file that you posted I cannot see the way you were trying to use the event flags. However, I assume they are not supposed to be used the way you inteded. If you want to get the type of interaction in any of your MGDRAW subroutines, you should refer to ICODE variable. Please have a look at mgdraw routine manual, section USDRAW

Cheers,
Jerzy