Simple 2D multibody FEA

About the development of the FEM module/workbench.

Moderator: bernd

kdarte
Posts: 9
Joined: Fri Nov 11, 2022 7:47 pm

Simple 2D multibody FEA

Post by kdarte »

Dear Community,

I started working with FreeCAD / Elmer / gmsh a week ago and got stuck with this simple test-problem in 2D:

Two boxes adjacent to each other which are made out of two different materials. The boxes should share a common edge, such that heat could be exchanged.
However, I am not able to create a conformal mesh in 2D which also allows me to set different materials for the two boxes when I import the mesh to Elmer.

What I found is that in 3D you would probably go for the "BooleanFragments"-Option and set "Mode" to "CompSolid". But it seems not work with 2D faces / surfaces / sketches as for all my attempts get the error "No solids in the result. Can't make CompSolid."

I think this thread here is rather close to what I'm trying.
https://forum.freecadweb.org/viewtopic.php?t=30375
However, exporting the mesh as *.unv and reading it with Elmer results in one single body, instead of different parts.

Could someone give me a hint on how to do this in 2D? Eventually I want to solve the heat equation for a cylinder made out of steel which is wrapped in a heating tape. Because of computing resources, I want to do this in a 2D axisymmeric simulation.

Thanks a lot for your help! FreeCAD is really a great tool, especially with all the tutorials out there.

Best regards

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.1.29410 (Git)
Build type: Release
Branch: releases/FreeCAD-0-20
Hash: f5d13554ecc7a456fb6e970568ae5c74ba727563
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: German/Germany (de_DE)
User avatar
NewJoker
Veteran
Posts: 3017
Joined: Sun Oct 11, 2020 7:49 pm

Re: Simple 2D multibody FEA

Post by NewJoker »

Try using other boolean tools in the Part workbench like Part Compound.
kdarte
Posts: 9
Joined: Fri Nov 11, 2022 7:47 pm

Re: Simple 2D multibody FEA

Post by kdarte »

Hi NewJoker,

thanks for the suggestion. I'm not sure if I got it correctly - at which point should I use "Compount"? It sounds to me that this would do the opposite of what I want: making one body out of several single bodies?

I added a file to show what I tried - unfortunately without success:
Making two rectangles, turning them into faces and generate a mesh. However, in Elmer they are still recognized as a single body.
Attachments
two_squares.FCStd
(19.73 KiB) Downloaded 35 times
kdarte
Posts: 9
Joined: Fri Nov 11, 2022 7:47 pm

Re: Simple 2D multibody FEA

Post by kdarte »

so, it seems that this not something commonly done in freecad? I'm kind of surprised as I would have thought that this is a pretty standard thing to do..
thschrader
Veteran
Posts: 3129
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Simple 2D multibody FEA

Post by thschrader »

Here is a 2D multibody example with 3 different materials/thicknesses.
You can extract the 2D shapes from the solids by using the "facebinder" tool from
the arch-workbench. You can put multiple faces into 1 facebinder and adress every face
with a specific material/thickness in FEM. (Select the faces, then press "facebinder")
I used ccx because elmer does not run on my laptop (driver problem, elmer is ok).
And I did a static analysis. Thermodynamics was not my first love in school... ;)
File with cleared mesh:
3_Cubes.FCStd
(14.67 KiB) Downloaded 28 times
2D_example.JPG
2D_example.JPG (77.65 KiB) Viewed 1267 times
Done with:

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.21.30669 (Git)
Build type: Release
Branch: master
Hash: 48b4eed55c05452d2cbabb9a8ba4c75e1a54481e
Python 3.10.6, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: German/Germany (de_DE)
Installed mods: 
  * BIM
  * CfdOF-master 1.19.4
  * Curves 0.5.8
  * Defeaturing 1.2.0
  * dodo
  * fasteners 0.4.4
  * Manipulator 1.4.9
  * Plot 2022.4.17
  * Reinforcement
  * WorkFeature
User avatar
-alex-
Veteran
Posts: 1856
Joined: Wed Feb 13, 2019 9:42 pm
Location: France

Re: Simple 2D multibody FEA

Post by -alex- »

thschrader wrote: Wed Nov 16, 2022 4:39 pm Thermodynamics was not my first love in school... ;)
Neither me :?
But I'm afraid that's the point, I suspect Elmer is the point I mean.
The file provided by @kdarte seems quite good for Ccx mechanical analysis. It includes 2 faces, 2 wires and 9 edges. Edge 1 is sharing both faces.
I have no trouble to perform a multi-material/thikness with his two_square file:
two_squares_Ccx.gif
two_squares_Ccx.gif (537.48 KiB) Viewed 1232 times

It seems I can't get Elmer binary on my Raspberry PI4 with RPIOS buster, so I can't help further here.

Code: Select all

OS: Debian GNU/Linux 10 (buster) (LXDE/LXDE-pi)
Word size of FreeCAD: 64-bit
Version: 0.21.30297 (Git)
Build type: Unknown
Branch: master
Hash: 8b4e114b9d381bac271980529164fa3cf33954c6
Python 3.7.3, Qt 5.11.3, Coin 4.0.0a, Vtk 7.1.1, OCC 7.3.0
Locale: French/France (fr_FR)
User avatar
-alex-
Veteran
Posts: 1856
Joined: Wed Feb 13, 2019 9:42 pm
Location: France

Re: Simple 2D multibody FEA

Post by -alex- »

kdarte wrote: Fri Nov 11, 2022 8:17 pm However, exporting the mesh as *.unv and reading it with Elmer results in one single body, instead of different parts.
JFYI, at the moment FEM workbench does not support multi-meshing. That's maybe why you have an issue with .unv mesh in ELMER.
Actually multi-bodies/shells/beams are meshed in one single mesh group.
Just my guess, hope it helps.

IIRC, @bernd has an experimental branch which handles multi-meshing. I don't know if it would handle such 2D multi-faces object though.
Let me find the link of his branch....
kdarte
Posts: 9
Joined: Fri Nov 11, 2022 7:47 pm

Re: Simple 2D multibody FEA

Post by kdarte »

Thanks a lot for the effort!

thschrader wrote: Wed Nov 16, 2022 4:39 pm You can put multiple faces into 1 facebinder and adress every face
with a specific material/thickness in FEM.
When I try to use Elmer with 2D meshes, I cant even assign the region for which the heat equation should be solved for. All I get is an "Selected Object has no Shape" error. This is the reason why I exported the mesh and opened externally in Elmer in the first placed - I was assuming that 2D+Elmer is probably not yet available in the FEM-Workbench.

-alex- wrote: Wed Nov 16, 2022 6:11 pm JFYI, at the moment FEM workbench does not support multi-meshing. That's maybe why you have an issue with .unv mesh in ELMER.
Actually multi-bodies/shells/beams are meshed in one single mesh group.
Just my guess, hope it helps.
I think in 3D it actually works. Following this tutorial on youtube (sorry, it is in German)

https://www.youtube.com/watch?v=T-ggqH3tXHs

I was able to do what I want in 3D by exporting the mesh as .unv and use Elmer externally (some temperature on the left, some cooling on the right face, two different materials)
elmer.PNG
elmer.PNG (726.53 KiB) Viewed 1183 times
However, something goes wrong using Elmer in the workbench (probably the fault is on my side). Seems like the two bodies are not able to exchange heat.
freeCAD.PNG
freeCAD.PNG (71.96 KiB) Viewed 1183 times

(this is my freeCAD-File for those interested)
two_squares_3D.FCStd
(29.81 KiB) Downloaded 32 times


So, after all, to me it seems that the problem of creating meshes for multibody FEM in FreeCAD seems to be specific to 2D
kdarte
Posts: 9
Joined: Fri Nov 11, 2022 7:47 pm

Re: Simple 2D multibody FEA

Post by kdarte »

kdarte wrote: Wed Nov 16, 2022 7:39 pm However, something goes wrong using Elmer in the workbench (probably the fault is on my side). Seems like the two bodies are not able to exchange heat.
Indeed it was my fault: When selecting the regions for the heat equation and the boundary conditions, one should ensure that nothing but the CompSolid is displayed (via toggling with spacebar) so you won't accidentally select some faces from a pad or similar.. Now, it is also working from the FEM Workbench. It remains to achieve the same thing in 2D...
elmer_working.PNG
elmer_working.PNG (298.68 KiB) Viewed 1086 times
For the sake of completeness, here is the corresponding freeCAD file
two_squares_3D_working.FCStd
(29.58 KiB) Downloaded 27 times
User avatar
-alex-
Veteran
Posts: 1856
Joined: Wed Feb 13, 2019 9:42 pm
Location: France

Re: Simple 2D multibody FEA

Post by -alex- »

kdarte wrote: Thu Nov 17, 2022 3:37 pm Indeed it was my fault: When selecting the regions for the heat equation and the boundary conditions, one should ensure that nothing but the CompSolid is displayed (via toggling with spacebar) so you won't accidentally select some faces from a pad or similar.
Selection of relevant element matters ;)
Thanks for your feedback.
Post Reply