Cannot open file He.gas

I have generated a gas file, then When I want to use it , I type the code "
MediumMagboltz gas;
gas.LoadGasFile(“He.gas”);"
but the running results notice that:Cannot open file He.gas.

MediumMagboltz::LoadGasFile:
    Cannot open file He.gas.
ComponentAnsys123::Initialise:
    Read properties of 2 materials from file MPLIST.lis.
ComponentAnsys123::Initialise:
    Read 2159067 elements from file ELIST.lis,
    highest node number: 3124105,
    background elements skipped: 0
ComponentAnsys123::Initialise:
    Read 3124105 nodes from file NLIST.lis.
ComponentAnsys123::Initialise:
    Read 3124105 potentials from file PRNSOL.lis.
ComponentAnsys123::Prepare:
    Caching the bounding boxes of all elements... done.
ComponentAnsys123::InitializeTetrahedralTree: Success.
ComponentAnsys123::PrintRange:
        Dimensions of the elementary block
                  -0.167044 < x < -0.0670436      cm,
                   0.172927 < y < 0.205927        cm,
                  -0.115321 < z < -0.0353211      cm,
                          0 < V < 1500            V.
        Periodicities
            x: none
            y: none
            z: none
ComponentAnsys123::PrintMaterials:
    Currently 2 materials are defined.
      Index Permittivity  Resistivity Notes
          0            1           -1 (drift medium)
          1         4.25        1e+10



Are you sure that there is a file “He.gas” in the directory from which you run this program?

Hi,
thanks for your reply, I put the He.gas in the GasFile directory, and didn’t run the example in the directory. That would be the reason. Besides, I changed the gas pressure from 760 Torr to 10 Torr, then the generation of the gas became so slow, and always stopped like the screen shot in the below, and maybe suddenly it moved on.

Hi,
after several hours generating the gas file, it stopped. I inputted the “ulimit -s unlimited”. It still didn’t proceed.

You need to execute ulimit -s unlimited BEFORE you start your executable.

Hi,
ah, thanks for your help, my misunderstanding, I have tried again.

Hi,
I have executed “ulimit -s unlimited” before I started my executable for hours. Is that normal?

Magboltz can take quite a long time to run, especially if you have many electric fields (or many combinations of electric fields, magnetic fields, and angles) and/or if the Townsend coefficient is high.

You mentioned in an earlier post that you changed the gas pressure from 760 Torr to 10 Torr. Did you also change the range of electric fields accordingly? If not the reduced electric field E/p will be very (unrealistically) high.

Hi,
I didn’t change the range of electric fields accordingly, are the two related with each other? I will try to modify again,Thanks again. that’s my code in the below.

int main(int argc, char * argv[]) {

  const double pressure = 10.;
  const double temperature = 293.15;
 
  // Setup the gas.
  MediumMagboltz gas;
  gas.SetComposition("N2", 100.);
  gas.SetTemperature(temperature);
  gas.SetPressure(pressure);
  //gas.Initialise(true);

  // Set the field range to be covered by the gas table. 
  const size_t nE = 20;
  const double emin =    100.;
  const double emax = 100000.;
  // Flag to request logarithmic spacing.
  constexpr bool useLog = true;
  gas.SetFieldGrid(emin, emax, nE, useLog); 

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

If you change the pressure, you normally also need to adjust of range of electric fields (and in general you should choose a range of fields that is realistic for the detector you are simulating). 100 kV/cm at 10 Torr is extremely high.

Hi,
Thanks for your reply. my realistic range of field in my detector is about 0.05-0.03V/mm/mbar.
I have changed the code to these data in the below.
const double emin = 0.005;
const double emax = 0.05;
Besides, what’s the meaning about const size_t nE = 20;?

Number of electric field points.

https://garfieldpp.web.cern.ch/garfieldpp/examples/gasfiles/

1 Like

Hi,
Thanks a lot for your reply.Now I have solved the problem with your help.I generated the gas file I wanted, and can loaded it when I needed it. Next step I want to gain some plots about the field lines ,the track of protons , and drift of the electronics etc.
Thanks for your help again.

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