Periodic conditions with MPGD layout in neBEM

Dear Experts,

I’m trying to simulate a simple alternating strips layout (equally spaced field and sense strips) with neBEM.
I would like to implement periodic copies of a basic “cell” to avoid edge effects and reduce computation time of the influence matrix, but haven’t succeeded so far.
Specifically, if the periodic length of the cell set with “SetPeriodicX” falls in the middle of a strip (eg half of the strip is out of the periodic length), this is canceled out of the geometry (at least in the field computation). This same approach works using eg wires instead of strips.
I have then resorted to halving the width of these strips and setting the period such that after applying the periodic condition the strip width is correct again. Still, the field achieved is slightly different from the one computed for a “whole” strip.
Playing around with different Perdiocities didn’t help either.

Is there a solution to this problem?

Thank you in advance!
Bonus issue: i’ve tried using “SetMirrorPeriodicity”, but i keep getting the following message: “Mirror not correctly implemented in this version of neBEM”.

I attach here a basic working example.


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

   

  TApplication app("app", &argc, argv);

  MediumMagboltz gas;
  gas.LoadGasFile("/afs/cern.ch/work/g/gzunica/garfield/Examples/GasFile/ar_93_co2_7.gas");
  gas.LoadIonMobility("/afs/cern.ch/work/g/gzunica/garfield/Data/IonMobility_Ar+_Ar.txt");
  gas.SetPressure(760.);
  gas.SetTemperature(293.15);


  MediumConductor Cu;
  MediumPlastic glass;
  glass.SetDielectricConstant(10.0);
  
  // Geometry.
  GeometrySimple geo;

  double half_tck = 0.00015; 

  const double cat_v=-1500.;
  const double sense_v=+10.;
  const double field_v=-1700.;
  const double backplane_v=-1700.;
  


  SolidBox box1(0, 0, 0.5, 0.4,0.5, 0.0);
  box1.SetBoundaryPotential(cat_v);

  SolidBox box2(0, 0, -0.1000-half_tck, 0.4,0.5, 0.1);
  box2.SetBoundaryDielectric();

  SolidBox box3(0, 0, -0.2000-half_tck, 0.4,0.5, 0.0);
  box3.SetBoundaryPotential(backplane_v);

  geo.AddSolid(&box1, &Cu);
  geo.AddSolid(&box2, &glass);
  geo.AddSolid(&box3, &Cu);


  const double radiusS = 0.0015;
  const double radiusF = 0.005;
  const double halflength = 0.5;

  double xposF = -0.2;
  double xposS = 0.0;
  double passo = 0.4;


// adding sense strips
  xposS=-0.4;
  std::vector<SolidBox*> stripsS(3, nullptr);
  for (int i = 0; i < 3; ++i) {
    std::cout<<"spos::"<<xposS;
    stripsS[i] = new SolidBox(xposS, 0.0, 0.0, radiusS, halflength,half_tck );  // alternate strips
    if(i==0)  stripsS[i] = new SolidBox(xposS+radiusS/2, 0.0, 0.0, radiusS/2, halflength,half_tck );  // alternate strips
    if(i==2)  stripsS[i] = new SolidBox(xposS-radiusS/2, 0.0, 0.0, radiusS/2, halflength,half_tck );  // alternate strips
    stripsS[i]->SetBoundaryPotential(sense_v);
    stripsS[i]->SetLabel("readout");
    geo.AddSolid(stripsS[i], &Cu);
    xposS += passo ;
  }

// adding field strips
  std::vector<SolidBox*> stripsF(2, nullptr);
  for (int i = 0; i < 2; ++i) {
    std::cout<<"sposF::"<<xposF;
  
    stripsF[i] = new SolidBox(xposF, 0.0, 0.0, radiusF, halflength,half_tck); //alternate strips
    stripsF[i]->SetBoundaryPotential(field_v);
    geo.AddSolid(stripsF[i], &Cu);
    xposF += passo ;
  }

  geo.PrintSolids();
  geo.SetMedium(&gas);

  ComponentNeBem3d nebem;
  nebem.SetGeometry(&geo);
  nebem.SetTargetElementSize(0.2);
  nebem.SetMinMaxNumberOfElements(1, 100); 
  nebem.SetPeriodicityX(0.8); 
  nebem.SetPeriodicityY(1.);
  nebem.SetPeriodicCopies(3,5,0);
  nebem.Initialise();

// plot geometry
  ViewGeometry geomView2d2(&geo);
    TCanvas c2("c2", "", 600, 600);
  geomView2d2.SetCanvas(&c2);
  geomView2d2.SetPlaneXY();
  geomView2d2.Plot3d();
  geomView2d2.PlotPanels();

    TCanvas c3("c3", "", 600, 600);
  // Plot field contour
  ViewField fieldView(&nebem);
  fieldView.SetCanvas(&c3);
  fieldView.SetArea(-1.,-0.4,-0.2,1.,0.4,0.5);
  fieldView.SetPlaneXZ();
  fieldView.PlotContour("v");
 

  TCanvas c4("c4", "", 600, 600);
  ViewField fieldView1(&nebem);
  fieldView1.SetCanvas(&c4);
  // Plot field contour
  fieldView1.SetPlaneXY();
  fieldView1.PlotContour("v");

 gSystem->ProcessEvents();
 app.Run(true);
}

Hello,

Adding @hschindl in the loop.

Hi,
many thanks for the working example! I will try to reproduce/look into the issue…

Also looping in @pratikm who is the main author of neBEM and might have some insights…

Hi,
sorry for the delay in getting back to you! Running the example you provided (but limiting the number of periodic copies to one to save time), the contour plot of the potential looks quite symmetric. Is this not what you get? What does it look like for “whole” strips?

PS: mirror symmetries are indeed not implemented at the moment.
one_periodic_copy.pdf (94.6 KB)
test.C (3.2 KB)

Hi,

indeed i am getting your same result now, which means i had some overlooked imprecision in my code previously! Thank you and apologies!

For the records, the other unexpected behavior i had found is that having a full sized strip and “cutting” it in half with the boundary conditions will cause the strips to disappear.
This can be seen if the geometry is changed to have only one sense strip (keeping the two field strips), and the periodicity set to cut the field strips in half (see below the modified relevant lines of test.C).

The best way to confirm this is setting the field strips voltage to the same value as the sense strip and setting the cathode and backplane to 0.

  const double cat_v=0.;
  const double sense_v=+10.;
  const double field_v=+10.;
  const double backplane_v=0.;


// adding sense strips
  double xS = 0.;
  const double rS = 0.0015;
  std::vector<SolidBox*> stripsS(1, nullptr);
  for (int i = 0; i < 1; ++i) {
    stripsS[i] = new SolidBox(xS , 0.0, 0.0, rS, hy, half_tck);
    stripsS[i]->SetBoundaryPotential(sense_v);
    stripsS[i]->SetLabel("readout");
    geo.AddSolid(stripsS[i], &Cu);

  }

  nebem.SetPeriodicityX( hx); 

This is actually the scenario that prompted my topic.

Thank you again!

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