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

General discussion about Elmer
Post Reply
Basilisvirus
Posts: 2
Joined: 14 Apr 2024, 22:01
Antispam: Yes

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

Post 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 6 times
1.png
(143.21 KiB) Not downloaded yet
2.png
(96.71 KiB) Not downloaded yet
Last edited by Basilisvirus on 15 Apr 2024, 20:55, edited 4 times in total.
kevinarden
Posts: 2319
Joined: 25 Jan 2019, 01:28
Antispam: Yes

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

Post 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.
Basilisvirus
Posts: 2
Joined: 14 Apr 2024, 22:01
Antispam: Yes

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

Post 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 6 times
-Why I have 3 bodies in Elmer, while I specified only two?
kevinarden
Posts: 2319
Joined: 25 Jan 2019, 01:28
Antispam: Yes

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

Post 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.
Post Reply