Inclusion of thermal effects in Garfield++

I am using Garfield++ to generate gas tables. I set the gas temperature to 20 degrees centigrade and let the code run, but I notice the following in the terminal output-

THERMAL MOTION OF GAS NOT INCLUDED

I looked at the Garfield++ user manual to find that thermal effects are turned OFF by default since the gas is assumed to be at 0 K, and there is a function called EnableThermalMotion() to turn it on.

However, I was hoping that setting the gas to a temperature greater than 0 K would override the default value and generate a gas file that has thermal motion included. Could someone please clarify this for me?

Additionally, if the thermal motion is turned off in the gas, what is causing the diffusion? My understanding was that thermal motion contributes to the diffusion of an electron cloud.

Dear @Aneesha6

When you set the temperature to let’s say 293.15K (20*C) that is used for the calculation of the transport parameters of the gas that depend on the pressure and temperature (actually they depend on the number density of the gas: the number of gas molecules or atoms / cm3).

For the computation of the gas tables Magboltz calculates the scattering of electrons on gas molecules. The electrons have energy from the electric field, they are light and they quickly gain speed. Instead by default the gas molecules are considered at rest (so not moving / vibrating => at 0K). Consider that 293K is 0.025eV, so this thermal motion of the gas is way lower than the few eV that the electrons gain in typical electric fields in gaseous detectors. So by default the impact of the thermal motion of the atoms/molecules is negligible and does not justify the additional computation time and is turned off. And results obtained like this agree with the measurements.

If you are curious, you can calculate two gas tables, one with thermal motion ON and one with thermal motion OFF and compare the results. I would think that the differences would be smaller than the uncertainty on the observables calculated by Magboltz, but you can check.

Diffusion of the electrons is due to the scattering on gas molecules, where the outgoing electron has different speed and velocity (direction).

Thank you for your detailed response. It was beneficial.
I am trying to create gas files with the default option and one without it. I have a question about how to override the default option.
My generate.c file is as follows:

#include <iostream>
#include "Garfield/MediumMagboltz.hh"
#include "Garfield/FundamentalConstants.hh"
using namespace Garfield;

int main(int argc, char * argv[]) {
  const double pressure = 1 * AtmosphericPressure;
  const double temperature = 293.15;
 
  // Setup the gas.
  MediumMagboltz gas("CH4", 100.);
  gas.SetTemperature(temperature);
  gas.SetPressure(pressure);
void EnableThermalMotion(const bool on);

  // Set the field range to be covered by the gas table. 
  std::vector<double> efields = {6250., 12500., 25000., 50000.,100000.};
  std::vector<double> bfields = {0.};
  std::vector<double> angles = {0.};
  gas.SetFieldGrid(efields, bfields, angles);

  const int ncoll = 10;
  // Run Magboltz to generate the gas table.
  gas.GenerateGasTable(ncoll);
  // Save the table. 
  gas.WriteGasFile("ch4.gas");

}

When I ran the generate.c executable, I notice that the terminal output still says that ‘THERMAL MOTION IS NOT INCLUDED.’ Am I setting the flag correctly?

You need to replace the line

void EnableThermalMotion(const bool on);

by

gas.EnableThermalMotion(true);

and recompile.

I compared the generated gas files with thermal motion toggled and found that the diffusion coefficients increased by about 2% for all the electric fields I tried, which is within the uncertainty given by Magboltz.

I appreciate your help!

Great! If you like you can also share here some plots.
Let us know if you need further help.
greets
Piet

I did not make plots but I am sharing my terminal output for anyone who would like to look at the numbers.