Question when using AvalancheMicroscopic::DriftElectron()

Dear experts

I tried to use AvalancheMicroscopic to simulate the drifting of electrons in some drift chamber. I setup all fields, then:

//setup fields, wires, etc.
AvalancheMicroscopic* drift = new AvalancheMicroscopic();
//some setup
drift->DriftElectron(del_x, del_y, del_z, del_t, 0);

then I got these outputs and simulation never ends.

MediumMagboltz::GetElectronCollisionRate:
    Rate at 40.5373 eV is not included in the current table.
    Increasing energy range to 42.5642 eV.
AvalancheMicroscopic::TransportElectron: Increasing null-collision rate by 5%.
MediumMagboltz::GetElectronCollisionRate:
    Rate at 44.8318 eV is not included in the current table.
    Increasing energy range to 47.0734 eV.
MediumMagboltz::GetElectronCollisionRate:
    Rate at 66.9145 eV is not included in the current table.
    Increasing energy range to 70.2602 eV.
MediumMagboltz::GetElectronCollisionRate:
    Rate at 71.5861 eV is not included in the current table.
    Increasing energy range to 75.1655 eV.
MediumMagboltz::GetElectronCollisionRate:
    Rate at 105.317 eV is not included in the current table.
    Increasing energy range to 110.583 eV.
MediumMagboltz::GetElectronCollisionRate:
    Rate at 112.109 eV is not included in the current table.
    Increasing energy range to 117.714 eV.
MediumMagboltz::GetElectronCollisionRate:
    Rate at 128.653 eV is not included in the current table.
    Increasing energy range to 135.086 eV.
MediumMagboltz::GetElectronCollisionRate:
    Rate at 145.646 eV is not included in the current table.
    Increasing energy range to 152.928 eV.
......

What should I do?

Hello,

Adding @hschindl in the loop.

Best,
D

Dear @Crisps,

If the simulation appears to run unusually long while continuously increasing the computed energy range, it might indicate that the electric field is abnormally strong in a specific region of your detector or that the gas setup is not configured correctly.

Could you share the snippets of code you are using to configure these two aspects of the simulation, along with the corresponding outputs when the script is executed?

Kind regards,
Djunes

Indeed! It could also be that the electron is drifting over a very long distance. What are the dimensions of your chamber?

Thank you all for replies, my chamber is small that 8mm x 8mm, and here is the code that set Wires:

void userCode(){
//something
    wire.AddWire(-0.84, -0.8, d_field, 0, "field");
    wire.AddWire(0., -0.8, d_field, 0, "field");
    wire.AddWire(0.84, -0.8, d_field, 0, "field");
    wire.AddWire(-0.84, 0., d_field, 0, "field");
    wire.AddWire(0.84, 0., d_field, 0, "field");
    wire.AddWire(-0.84, 0.8, d_field, 0, "field");
    wire.AddWire(0., 0.8, d_field, 0, "field");
    wire.AddWire(0.84, 0.8, d_field, 0, "field");
    wire.AddWire(0., 0., d_sense, 1800, "sense");
}

and another piece of code (I tried AvalancheMC this time to speed up):

double del_x = 0.5, del_y = 0.5, del_z = 0., del_t = 0., ke = 0., dummy;
        for(int i=0; i<1; i++){
            drift.DriftElectron(del_x, del_y, del_z, del_t);
            double x0, y0, z0, t0, x1, y1, z1, t1;
            int i_dummy;
            drift.GetElectronEndpoint(0, x0, y0, z0, t0, x1, y1, z1, t1, i_dummy);
            std::cout<<"end point "<<x1<<","<<y1<<std::endl;
            size_t ne = drift.GetNumberOfElectronEndpoints();
            std::cout<<ne<<" electrons!!!!!"<<std::endl;
        }

gives the output that ne is handrads of thouthends. But I only drift 1 electron, why? I didn’t use
AvalancheElectron. My Garfield++ is version 5.0

end point 0.000910321,0.000856642
2404093 electrons!!!!!

Hi,

how did you limit the drift area? Do you have equipotential planes surrounding the wires? Or did you constrain it using SetArea?
The fact that you get a number > 1 for the number of electrons is indeed strange.
Could you provide a minimal (!) working example that reproduces this issue?

Here is a minimal (I believe it’s minimized enough…) example:
minimal.cxx (3.7 KB)
IonMobility_He+_He.txt (513 Bytes)
He_90_iC4H10_10_760Torr_293.15K_10emin_to_500000emax.gas.txt (229.8 KB)
I changed the gas file extension to txt in order to upload it.

Thanks! Your program still had quite a lot of lines that were not really relevant for reproducing the issue that you reported. I trimmed it down further:

minimal.cxx (1.9 KB)

With this program, and using the HEAD version of Garfield, I’m not able to reproduce the problem that you encountered. Both with AvalancheMicroscopic and AvalancheMC it runs reasonably fast and the electron ends up on the central wire.

Could you try with the HEAD version of Garfield? The “v5.0” tag is about a year old; I don’t remember offhand any major bugfix that could explain the problem that you have, but still…


Can I ask that did you used the same gas file that I provided? Just to exclude the potential source of this issue.

Yes, I used the gas file that you sent…

OK, I just tried to run this example by the newest version on GitLab and it works just fine, then it should be some bugs in the old version (tag 5.0). I will use newest version, thank you so much!

Just a small question, I used AvalancheMC and AvalancheMicroscopic to drift electrons, and it’s 0.004s and 0.15s per drifting simulation respectively, are these reasonable values? Especially latter is quite slower (I understand it’s calculating cross section, just wondering if it’s normal value…)

To me these values seems quite reasonable. withAvalancheMicroscopic you do not calculate the cross sections, but you simulate all individual electron gas molecule collisions, which can easily run into millions of steps. AvalancheMC is as you see at least 10x faster.
greets
Piet

Understood, thank you!