Problems with DriftLineRKF and AvalancheMicroscopic

Hello,
I have two problems when simulating electron avalanches in my geometry:

  1. The avalanche size is very different from DriftLineRKF (~10^5) to AvalancheMicroscopic (~10^2).

  2. When I enhance the field (boundary condition 2, cathode, in sif file), I get the error:
    DriftLineRKF::DriftLine: Step size has become smaller than int. accuracy. Stop.
    DriftLineRKF::AddIonTail:
    Unable to obtain an ion tail; tail not added.
    For weaker fields like -550 V, this error does not occur. I enhanced the accuracy using the statement (also with lower numbers):
    void SetIntegrationAccuracy(const double eps = 1.e-4);

There are similar topics in the forum, but they didn’t help.
Does someone has an idea what is happening here or see a problem in my code? It is attached. I use Gmsh+Elmer+Garfield++.

Thank you!

aval.zip (14.5 KB)

Hello,

Adding @hschindl in the loop!

D

Dear @VictorM

I am missing a couple of files to compile your code. Could you maybe upload a new version that includes the following:

THGEM/mesh.header does not exist.
THGEM/mesh.elements does not exist.
THGEM/mesh.nodes does not exist.
THGEM/THGEM.result does not exist.
THGEM/THGEM_WTlel.result does not exist.

I ll try to install gmesh and elmer in the meanwhile and see if I can calculate those files.
Thanks
Piet

Hi,

if there is a discrepancy between DriftLineRKF and AvalancheMicroscopic, it could be due to the low pressure. Can you try switching on RKN steps in AvalancheMicroscopic (EnableRKNSteps)? Also, the avalanche size that you get from AvalancheMicroscopic will fluctuate from avalanche to avalanche; the average gain should be consistent with DriftLineRKF though.

Regarding the message Unable to obtain an ion tail; tail not added.: was the ion mobility imported successfully? Can you show the output log?

I also noticed a couple of things reading through the code:

  • The lines
 const size_t nMaterials = elm.GetNumberOfMaterials();
  for (size_t i = 0; i < nMaterials; ++i) {
    const double eps = elm.GetPermittivity(i);
    if (fabs(eps - 1.) < 1.e-3) elm.SetMedium(i, &gas);
  }

and

  elm.SetGas(&gas);

are redundant, i. e. do the same thing (associate regions with ε = 1 with the gas medium).

  • The lines
void SetIntegrationAccuracy(const double eps = 1.e-4);
void EnableSignalCalculation(const bool on = true);
void GetGain(const double eps = 1.e-4);
void GetEndPoint(double& x, double& y, double& z, double& t, int& st);

are probably left-overs that you copy+pasted into the code? You should remove them.

Thank you for your reply! The files are too large for uploading them here. I try to share them with you, I’ll let you know asap.

Thank you for reviewing the code! Yes, it requires some clean-up…

I now used EnableRKNSteps for AvalancheMicroscopic and will check whether the avalanches are now similar in size to those calculated using RKF. Thank you for this hint! I did not find it in the documentation, is it described somewhere what this is?

The output is attached. The IonMobility was imported successfully.
I couldn’t get rid of the accuracy problem when playing around with SetIntegrationAccuracy.

nohup.zip (3.2 KB)

There is a (very brief) description of the method on page 85 of the user guide:

PS: you did not set the integration accuracy explicitly in the program you sent.

(post deleted by author)

Thanks again.

I added something like

drift.SetIntegrationAccuracy(1.e-3);

Then, the error

DriftLineRKF::AddIonTail:
Unable to obtain an ion tail; tail not added.

disappears. The error

DriftLineRKF::DriftLine: Step size has become smaller than int. accuracy. Stop.

persists. Only for really high values like 10, this error disappears. What is a reasonable value for the accuracy?
I also tried to set a maximum step size of 1e-3, but that doesn’t help here.
As said, for lower fields, this problem does not occur.

Regarding AvalancheMicroscopic: Using

aval.EnableRKNSteps(true);

on the first look. the avalanches are still underestimated, compared the DriftLineRKF result, by a factor of about 3 to 10 - depending on the fields. I will have a closer look at it.

@Piet, in case you still want to try to run the code, here are the mesh files: mesh – Google Drive

Thank you!