next-exp / nexus

Geant4 simulation framework of the NEXT Collaboration
5 stars 55 forks source link

Add SS hexagonal mesh for NEXT100 #187

Closed kvjmistry closed 8 months ago

kvjmistry commented 1 year ago

This PR adds the option of stainless steel hexagonal meshes to the NEXT100 geometry. The SS hexagonal mesh is set by default, however, we can switch to the fake grid by setting the useDielectricGrid_ bool.

Below is a picture of the cathode mesh (for the drawing, I blow up the hex size by a factor of 10 so we can draw them without causing the drawer to hang. By default, the visibility of drawing the meshes is turned off.

image

This PR needs to be benchmarked for memory and speed in NEXT100 before merging so I mark it as a draft until this is complete.

paolafer commented 11 months ago

Do we want to include this code in the next productions of NEXT-100? Has it been benchmarked?

kvjmistry commented 11 months ago

@paolafer

I have made some updates since this PR that fixes a memory leak and so it renders properly in the interactive display. I will make these changes to this PR and perform some tests as soon as I can.

kvjmistry commented 9 months ago

I have rebased to the latest commit, the branch is ready for review. Some notes:

I did not notice much slow down in running with the SS meshes, but it is worth a check on the speed and memory use.

paolafer commented 9 months ago

A test is failing, because one of the example macros simulates photons in (0, 0, 0), which now belongs to a volume made of stainless steel, which doesn't have optical properties. Can you simply change the specific vertex to one inside the EL region, for instance? The macro which gives the error is NEXT100_S2_table.config.mac.

paolafer commented 9 months ago

Is the grid thickness measured? Right now we are using an arbitrary value, set in the Next100 class, but it can be changed.

paolafer commented 9 months ago

I noticed that the ionization electrons that hit the gate grid continue their path to the EL gap: is that the intended behaviour? Because of that, the lifetime value for this ionization electrons in the EL gap is assigned erroneously, because stainless steel does not have the attachment property. That property is read from the first material after the cathode, which is now stainless steel, because the cathode is defined at z == 0, exactly between the active volume and the grid volume.

kvjmistry commented 9 months ago

Is the grid thickness measured? Right now we are using an arbitrary value, set in the Next100 class, but it can be changed.

The grid thickness is 0.13 microns. I have updated the code.

kvjmistry commented 9 months ago

I noticed that the ionization electrons that hit the gate grid continue their path to the EL gap: is that the intended behaviour? Because of that, the lifetime value for this ionization electrons in the EL gap is assigned erroneously, because stainless steel does not have the attachment property. That property is read from the first material after the cathode, which is now stainless steel, because the cathode is defined at z == 0, exactly between the active volume and the grid volume.

This is a good question. From my simulations, almost all the electrons should reach the EL region. See e.g. https://arxiv.org/abs/2311.03528 Fig 13 where the electrons follow the electric field lines and get funneled into the center of the hexagons.

paolafer commented 9 months ago

Is the grid thickness measured? Right now we are using an arbitrary value, set in the Next100 class, but it can be changed.

The grid thickness is 0.13 microns. I have updated the code.

Do you mean 0.13 millimetres, right?

paolafer commented 9 months ago

I noticed that the ionization electrons that hit the gate grid continue their path to the EL gap: is that the intended behaviour? Because of that, the lifetime value for this ionization electrons in the EL gap is assigned erroneously, because stainless steel does not have the attachment property. That property is read from the first material after the cathode, which is now stainless steel, because the cathode is defined at z == 0, exactly between the active volume and the grid volume.

This is a good question. From my simulations, almost all the electrons should reach the EL region. See e.g. https://arxiv.org/abs/2311.03528 Fig 13 where the electrons follow the electric field lines and get funneled into the center of the hexagons.

In that case, we should give the attachment optical property to the stainless steel. One way to do that would be to create a special item of the OpticalMaterialProperty functions with only that property and attach it to the material. I think that a consequence of that is that any volume made of stainless steel would have that property (not 100% sure, but I remember that we had an issue like this in the past and we had to duplicate the definition of a material). However, I think that there's no harm in having an attachment value in the vessel volume, for instance, since no ionization electrons end up there and, even if they did, they would not create scintillation light.

paolafer commented 9 months ago

Running /geometry/test/run in the interactive mode several overlap warnings are raised, have you checked that? It doesn't happen with all the holes, only a few of them.

kvjmistry commented 9 months ago

Is the grid thickness measured? Right now we are using an arbitrary value, set in the Next100 class, but it can be changed.

The grid thickness is 0.13 microns. I have updated the code.

Do you mean 0.13 millimetres, right?

Yes!

paolafer commented 8 months ago

Just a detail: my compiler gives a warning about the different order in which grid_thickn_ and cathode_mesh_diam_ are declared and initialized. Could you just swap them in either place?