Importing a 2D COMSOL Simulation to Garfield++

Hi there,

I am trying to import the three required files (dielectrics.dat, mesh.mphtxt, and field.txt) into Garfield++ from COMSOL. My simulation is in 2D. I believe I am currently having trouble reading the mesh file, as I receive the error that says “ComponentComsol::ElectricField: Field map not yet initialised”, and it looks like it is unable to parse the mesh file. I am able to run the GEM COMSOL example in the Gitlab, which is in 3D.

At first I was wondering if it was the way I was defining my mesh, because there seem to be a few difference between my mesh file and the one on Gitlab. For example, the type names for the GEM file are “3 vtx”, “4 edg2”, “4 tri2”, and “4 tet2”, whereas the corresponding type names for my files are the same as the first three, but I do not have the fourth type name, so I am wondering if my COMSOL simulation must be in 3D. I’ve also tried to define a simple 3D geometry that has the type names “3 vtx”, “3 edg”, “3 tri”, and “3 tet”, even after I tried to use the same meshing parameters as the example, which also results in an uninitialised field map.

I am wondering if the meshing is the issue, or if there is something else that could be causing me errors. I would also be curious in knowing if I can import a 2D geometry from COMSOL into Garfield++, or if it has to be in 3D. As a final, unrelated question, I was wondering if there was an exact definition for “endpoint” in Garfield++. Any insight would be greatly appreciated.

Hi,

unfortunately Garfield++ does not have an interface to read 2D Comsol files. @djjansse did have a chance to give it a try to implement this?

The name “endpoint” is indeed a bit misleading; the method GetElectronEndpoint allows you to retrieve the start and end point of an electron in the avalanche and a flag indicating why it stopped.

Hi,

Heinrich is correct. Currently ComponentComsol can only read in 3D meshes. The ability to read in 2D maps will be something we will need to add in the near future.

Kind regards,

Djunes

Hi Heinrich and Djunes,

Thank you very much for your response. Is there any specific way I must define my 3D mesh in COMSOL in order to be able to import it into Garfield++? For example, what parameters would I have to choose to have a mesh shape that includes the “4 tet2” type name?

Hi Heinrich and Djunes,

Thank you very much for your response. Is there any specific way I must define my 3D mesh in COMSOL in order to be able to import it into Garfield++? For example, what parameters would I have to choose to have a mesh shape that includes the “4 tet2” type name?

Hi Chamilton,

A second-order tetrahedral mesh should be used. Typically the order of this mesh is already set correctly for the calculations, but for exporting the data you would need to set the resolution to
“custom” and Lagrange order “2”.

To export the mesh the option for exporting second-order elements must be enabled (see attached image).

Just to add: if you have a 2D map with eight-node curved quadrilateral mesh elements (not sure how you would need to specify this in Comsol), I can give it a shot to implement an interface…

Hi Djunes and Heinrich,

Thank you both very much for the help! It is greatly appreciated.

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