# Accessing Townsend coefficients (alpha, gamma)

Hi!

I was wondering whether there is a way to get the first Townsend ionisation coefficient (alpha) from the simulations. In the user manual in section 2.5.1 on the drift tube it is stated:

First, we prepare a table of transport parameters (drift velocity, diffusion coefficients, Townsend
coefficient, and attachment coefficient) as a function of the electric field E (and, in general, also
the magnetic field B as well as the angle between E and B).

So it appears that in creating the gas files with gas.GenerateGasTable(ncoll) the Townsend coefficients should be calculated. How can I find these coefficients? I have looked at the gas files but am a bit confused because I did not find this information.

Is there also a way to get the Townsend coefficients for ions (gamma)?

Thank you very much for your help!

Hi,

after generating the gas file (or loading an existing one), you can retrieve the Townsend coefficient at a given electric (and magnetic) field using something like this:

``````// E = 20 kV/cm
double ex = 20.e3, ey = 0, ez = 0.;
double bx = 0., by = 0., bz = 0.;
double alpha = 0.;
gas.ElectronTownsend(ex, ey, ez, bx, by, bz, alpha);
std::cout << "Townsend coefficient at E = " << ex * 1.e-3 << " kV/cm: " << alpha << " / cm";
``````

This function will interpolate between the values stored in the gas table.
If instead you want to get the values at the exact electric field that was used in Magboltz, you can do something like this:

``````// Take the first entry in the list of electric fields.
int ie = 0;
// Take the first entry in the list of magnetic fields and angles.
int ib = 0;
int ia = 0;
gas.GetElectronTownsend(ie, ib, ia, alpha);
alpha = exp(alpha);
``````

The last line is needed because itâ€™s log(alpha) thatâ€™s stored in the table not alpha itself.

I should add a little example for this to the repositoryâ€¦

There is no analogous function for ions, because they donâ€™t contribute to the multiplication in a gas.

1 Like

I have attached a short working example of the Townsend coefficient calculation, in case other users stumble upon the same question. Thank you again for your help!

Townsend_Coefficients.cpp (2.0 KB)

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