AvalancheMC - error with SetDistanceSteps

I would like to simulate an avalanche in a Ar-CO2 gas (file attached) with an electric field of 22800 V/cm and the attached arco2 file (taken rom the exemple), within garfield6. With the commands:
AvalancheMC aval;
I obtain reasonable results, but not converged (if I increase the step, the number of electrons produced decreases). If I try to go below 1 um step, I have en error (error 9 on mac, bad alloc on a linux cluster).
Any idea why, and how can I solve the issue?
arco2.txt (3.6 KB)
ar_90_co2_10.txt (56.4 KB)

Maybe @hschindl can help with that.


thanks for your message! I can’t say off-hand why the error occurs, but I think there might be a mistake in your program regarding the electric field.
The variable field is set to 570 × 40 = 22800 which I understand is the value in V/cm. But then when calling SetElectricField this value is multiplied by 1000, so what you are simulating is not 22.8 kV/cm but 22800 kV/cm which is an enormously high value.

Indeed, thanks :smiling_face:
Now I manage to run the simulation for DistanceStep < 1um, but the number of electrons produced still changes with the DistanceStep, so don’t manage to find a value for which the number of electrons is converged.
Eventually, what I would like to do is to simulate the avalanche in a preamplification gap of ~250 um, and estimate the multiplication factor as a function of the depth in the gap. Is this way with AvalancheMC the proper way to do so?
Best regards

it’s indeed a bit of an issue with AvalancheMC that the results depend to some extent on the chosen step size. Just to be sure it’s really a dependence on the step size and not just statistical fluctuations: how many avalanches did you simulate to compute the mean gain?

Unless it’s computationally prohibitive, I would rather recommend AvalancheMicroscopic if you want an accurate simulation of electron transport (including fluctuations).
On the other hand, if the electric field in your preamplification gap is (to good approximation) uniform, then you can just use the Townsend coefficient at this field and compute the expected average gain directly.

I see. I run AvalancheMC with 1000 electrons but I see the mean number of electrons (gain) after multiplication is similar to the rms.
I tried with AvalancheMicroscopic, but now I’m a bit perplex about the meaning of SetCollisionSteps. Its arguments should be “number of collisions to be skipped for plotting” according to the manual but actually its value affects the gain!
I think Townsend coefficients may work for me, and I try to follow the instructions to plot them but without success (nothing happens):
ViewMedium view;
Is there an exemple I can follow?
Thanks and cheers

Yes, a lot to moderate field, the avalanche size follows an exponential distribution.

Are you sure? In the HEAD version of the code, the function SetCollisionSteps should not affect the results at all.

Yes, you can have a look at the “read” example in Examples/GasFile (C++ version, Python version).

I took Garfiled from here: garfield / garfieldpp · GitLab, it is labeled garfield6. The average numbers of electrons produced over a 200u gap is ~10 with CollisionStep(1), ~20 with CollisionStep(10). BTW, the first case is consistent with what I get using the Townsend coeff (thank for the macro!).

that’s indeed the correct repository (I’m not sure what you mean by “garfield6” though).

Thanks for reporting this, very strange, there should really be no effect of the number of “collision steps” on the avalanche size. I’ll give it a try if I can reproduce it and get back to you.

Sorry for the delay in getting back to you. Unfortunately I can’t reproduce this issue; with the HEAD version of the project, I don’t see a statistically significant difference in the avalanche size distribution when I change the number of “collision steps”.

Just to be sure, is your testing code is similar to the attached one, and how can I make sure I have the HEAD version of the project?

micro_arco2.C (3.7 KB)

yes, it’s very similar (see the attached file).
test.C (1.8 KB)

You need to do a git pull and rerun make; make install in the Garfield++ build folder.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.