Page 1 of 1

FreeCad FEM mesh: boundary, region and group. Which one and when?

Posted: 14 Apr 2024, 23:45
by Basilisvirus
I am trying to use FreeCad to differentiate the Body and boundary elements on a mesh ( A PCB I design)
I use KiCad to export the PCB.
I use FreeCad to create the mesh, then the GMSH groups/faces
And then I import them to ElmerGUI.

I try to understand how to handle Body and boundary properties. If the mesh is simple/doesnt have a lot of edges/solid components its easier to select the faces/solids. Now I try to use a more complex mesh and when I manage to differentiate the solids shown in Elmer, my boundaries go "bad" and vise versa. I have questions in order to generate my mesh more professionally and correctly:
-in FreeCad there are FEM mesh boundary, region and group options and in each of them I can select either Face or Solid parts of my mesh. Which one creates the body and which the boundary for Elmer?
-Say I make a FEM mesh group. When and should(?) I put both a solid and face(s) in the same group?
-Can the GMSH element size negatively affect the body/boundaries set? (aka can there be a bug if the element size of the mesh is too big, and two bodies unite for example?)

Image (image link: https://i.sstatic.net/jtEPKG4F.png)

For now I try to use only FEM mesh group, as it looks like it can generate both body and boundaries for elmer. I do some trial and error for now, I think Im getting there, but I am unable to find a proper tutorial for elmer+KiCad about this specific topic, for -more-complex meshes.

I attach the step, the FreeCad project and the .unv export if someone needs to take a look at the shape/play around with it or show me something. I try to make the antenna and GND place as one body, and the FR4 as a second body. At the same time I need boundary for antenna signal input and boundary for the GND/bottom layer.
TestMesh.zip
(369.28 KiB) Downloaded 9 times
1.png
(143.21 KiB) Not downloaded yet
2.png
(96.71 KiB) Not downloaded yet

Re: FreeCad FEM mesh: boundary, region and group. Which one and when?

Posted: 15 Apr 2024, 11:59
by kevinarden
In 3d groups of solid elements become bodies, groups of plate elements become boundary surfaces. 1D elements are eliminated if you use -autoclean. ElmerGUI uses -autoclean by default.

In 2D models groups of plate elements become bodies, groups of 1D elements become boundaries.

Re: FreeCad FEM mesh: boundary, region and group. Which one and when?

Posted: 15 Apr 2024, 21:01
by Basilisvirus
Lets start with this:
In 3d groups of solid elements become bodies
I selected two parts of my mesh and made them two bodies:
1.png
(86.05 KiB) Not downloaded yet
I export to .unv
But when I import them to Elmer I see 3 bodies, where when I select them I do not see anything selected on the visual mesh/model and when I select the one boundary it has, the whole mesh is selected.:
2.png
(489.2 KiB) Not downloaded yet
I attach you the files I used. (I redid the mesh to be smaller in size so I can upload it)
test.zip
(378.47 KiB) Downloaded 8 times
-Why I have 3 bodies in Elmer, while I specified only two?

Re: FreeCad FEM mesh: boundary, region and group. Which one and when?

Posted: 16 Apr 2024, 00:18
by kevinarden
Depending on how the mesh gets saved out of gmsh (all elements or just grouped elements) , elmer makes each group a body, but any solid elements not grouped are sent to the additional group/body of everything not grouped. However, there are flags in gmsh to save all, or just save groups.