Cannot open file He.gas

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

    Cannot open file He.gas.
    Read properties of 2 materials from file MPLIST.lis.
    Read 2159067 elements from file ELIST.lis,
    highest node number: 3124105,
    background elements skipped: 0
    Read 3124105 nodes from file NLIST.lis.
    Read 3124105 potentials from file PRNSOL.lis.
    Caching the bounding boxes of all elements... done.
ComponentAnsys123::InitializeTetrahedralTree: Success.
        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.
            x: none
            y: none
            z: none
    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?

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.

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.

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

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.

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.);

  // 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.
  // Save the table. 

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.

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.

1 Like

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.