Garfield++ units when importing mesh from COMSOL

Hi.
I am trying to import a mesh file from COMSOL into Garfield++ following the instructions in the manual here .
This (43.7 KB) is the code that I am using.
The mesh file has units of meters, and this is what I set when I define the ComponentComsol object:

cmp_STHWELL.Initialise(“./COMSOL_files/241024_SWELL_Vth1000_Vd150_mesh_second-order.mphtxt”,
“./COMSOL_files/241022_SWELL_Vth1000_Vd150_materials_test_all_eps_to1.txt”,
“./COMSOL_files/241024_SWELL_Vth1000_Vd150_potential.txt”,
“m”)

Also, when I set the coordinates and range for MeshView I use meter units:

meshView.SetPlane(0, 0, -1, 0., 0., 0.0056)
meshView.SetFillMesh(True);
meshView.SetArea(-0.001, -0.001, 0.003, 0.001)

The problem is that the MeshView plot is blank, and it shows cm units.
I could not find in the documentation a clear explanation how the definition of units should work altogether.

Also, following this published topic, I set the epsilon for all the materials in the material file to 1 (attached). Still the plot is blank.
So my questions are

  1. What is the proper way to set units?
  2. Is it possible to check which material is assigned to which domain?
  3. What could be the cause of the plot being blank?
  4. Is there a way to visualize the imported mesh in 3D without too much constraints?

Thank you
Luca Moleri

241022_SWELL_Vth1000_Vd150_materials_test_all_eps_to1.txt (9 Bytes)

Hi,

Adding @hschindl in the loop!

Cheers,
D

Hi @mole.luca

So indeed, when loading the meshfile you have to specify what units you used in your FEM program. Thereafter, inside farfield++ the reference units are cm and you cannot change that. If you call ComponentComsol::EnableDebugging() before the initialization, you can get this information.

cmp_STHWELL = ROOT.Garfield.ComponentComsol()
cmp_STHWELL.EnableDebugging()

You can call also ComponentComsol::PrintRange(), and this gives you the same information about the range of the elementary cell and the range of the voltage:

You can see that your voltage range is from -1150V to 0V, so if you set your voltage range to be plotted as positive, then you would see an empty plot. Moreover, the ranges you provide in ViewField/ViewFEMesh::SetArea() must be defined in cm and not in m. Not specifying any range would result in a plot of the boundingbox of the sensor/component.

Playing a bit I have managed to make a XY and XZ plot of your potential map, however I have not managed to get your FEView working, and I have not quite understood your geometry. Maybe if you could share a screenshot of your geometry in comsol, that could help.


greets
Piet

Hi @Piet. Thank you for the help, I will try to proceed from here.
For the geometry, you can find the cad design here.
Cheers
LM

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