GSoC2020, FEM: extend examples

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: GSoC2020, FEM: extend examples

Post by uwestoehr »

OK, we have a regression in master. Once i save the file with master, I get no sensible result anymore.

When I take your file and run it with FC 0.20 final, it works:
Turorial-orig.FCStd
(68.21 KiB) Downloaded 29 times
FreeCAD_dampBcoLj5.png
FreeCAD_dampBcoLj5.png (214.04 KiB) Viewed 1296 times
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: GSoC2020, FEM: extend examples

Post by uwestoehr »

uwestoehr wrote: Sun Jul 31, 2022 5:20 pm OK, we have a regression in master.
Introduced by me this week :oops: . I fixed this now.

However, there is something I don't understand:
- I made the tutorial also directly in Elmer GUI and this is the result:
ElmerGUI_wZvt2Blxek.png
ElmerGUI_wZvt2Blxek.png (147.58 KiB) Viewed 1259 times
- I get almost the same result as with your example, but in your example you use as heat source "10000" while in the tutorial they use "0.01"

here is the .sif Created by Elmer:
Elmer-case.sif.txt
(1.97 KiB) Downloaded 23 times
and here the one from FC:
FC-case.sif.txt
(2.42 KiB) Downloaded 24 times
It is not yet clear to me why both lead to the same result. In the .sif all the material constants and units are the same and in SI units.
-> it seems that FreeCAD does something with the result

And indeed, when I take the case.sif from FC and use this for Elmer (except of the body force and boundary condition):
Elmer-with-FC-input-case.sif.txt
(2.93 KiB) Downloaded 23 times
I also get with 0.01 the correct result when I load the .vtu file to FC.

Where in the code are the Elmer results handled?

(I have the same problem when i perform a frequency analysis with Elmer.)
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: GSoC2020, FEM: extend examples

Post by HoWil »

Please see the explanation in my post (especially the EDIT) after the original post https://forum.freecadweb.org/viewtopic. ... 24#p422624.
The main thing here is that is is W/kg not W/m², so you have to scale it correctly.
BR,
HoWil
ps.: May I do some advertising for the introduction of Elmer-fulltextinputs for boundary-faces which would maybe help here ;)
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: GSoC2020, FEM: extend examples

Post by uwestoehr »

HoWil wrote: Sun Jul 31, 2022 8:51 pm Please see the explanation in my post (especially the EDIT) after the original post https://forum.freecadweb.org/viewtopic. ... 24#p422624.
The main thing here is that is is W/kg not W/m², so you have to scale it correctly.
I don't understand. i need to know what code reads the Elmer vtu result.

When I run Elmer with the FC case.sif and "0.01", I get the correct result. I can import the vtu file to ParaView and get the correct result as well. Even when I only open the vtu file with FC I get the correct result.

So there is a bug that the VTU file is opened but subsequently the results are modified. Therefore my question.

------------

Concerning the units, it is Elmer's choice to use W/kg - which isn sensible for a steady-state analysis: heat per time unit per mass unit. In your post you have by the way a mistake because the unit of W/kg is m^2/s^3 (not m^2/s^2)
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: GSoC2020, FEM: extend examples

Post by uwestoehr »

uwestoehr wrote: Sun Jul 31, 2022 9:23 pm I don't understand. i need to know what code reads the Elmer vtu result.
OK, found it in tasks.py.
uwestoehr wrote: Sun Jul 31, 2022 9:23 pm When I run Elmer with the FC case.sif and "0.01", I get the correct result. I can import the vtu file to ParaView and get the correct result as well. Even when I only open the vtu file with FC I get the correct result.
The interesting thing is that the .vtu file created by Elmer is different. Loading it to FC the temperature is correct.
The .vtu file created by the run via FC is different and has the wrong temperature.
-> tricky stuff!
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: GSoC2020, FEM: extend examples

Post by bernd »

@HoWil

Why did we no add this example to master during GSoC?
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: GSoC2020, FEM: extend examples

Post by bernd »

User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: GSoC2020, FEM: extend examples

Post by uwestoehr »

uwestoehr wrote: Sun Jul 31, 2022 9:48 pm -> tricky stuff!
- this is the case.sif I input to Elmer:
Elmer-input-case.sif.txt
(1.93 KiB) Downloaded 24 times
And this is the diff to the case.sif created by FC:
FC-to-Elmer-case.sif.diff.txt
(1.03 KiB) Downloaded 24 times
- so the only difference is the geometry of the mesh.

- FC's mesh is in mm, if Elmer's mesh would be in m (since its .sif uses pure SI), we would have a factor of 1e9 for the mass. But we see that 1e6 is what we have as factor for the heat.

- When we set in FC the density 1e6 times higher, we get the correct result also with "0.01" input

It turned out that thew trick of scaling the mesh down, send it to Elmer and rescale it, does not work. Elmer obviously checks the mesh length unit. Therefore it calculates another volume and thus weight.

I reverted this scaling: git commit d296732de. Now an input of "0.01" brings the correct temperature.

However, this breaks of course all results with a length unit. Take for example this simple mechanics case to compare Elmer with CCX:
Comparison-CantileverFaceload.FCStd
(171.95 KiB) Downloaded 23 times
We get now as return displacements that are a factor 1000 too small and stresses that are a factor 1e6 too small.
Other results like temperature or voltage are correct.

-> we have to recalculate the result mesh fields.
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: GSoC2020, FEM: extend examples

Post by HoWil »

uwestoehr wrote: Mon Aug 01, 2022 1:53 am -> tricky stuff!
No it is not .... really :D 8-)
uwestoehr wrote: Sun Jul 31, 2022 9:23 pm don't understand. i need to know what code reads the Elmer vtu result.
You used "Surface heat flux in W/m^2" in your model. We need a entry for body heat source with "W/kg" (lets call it energy per mass or density related heat flux *)) to get the correct result (as in the turorial) :!:


*) PLEASE see the tutorial/documentation as described above. Yes this kind of heat flux is a bit unusual but the tutorials are not made by me.
bernd wrote: Sun Jul 31, 2022 10:07 pm @HoWil
Why did we no add this example to master during GSoC?
Maybe this is the reason why we did not merge it... it is a bit confusing.
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: GSoC2020, FEM: extend examples

Post by HoWil »

Watt as dimension is dependent on the mass the length and time see https://de.wikipedia.org/wiki/Watt_(Einheit).

If you insert Watt/m² the dependency on the length is gone and everything is relatively easy.

If you have to use Watt/kg as input the dependency on the length is still present and you have to recalculate to work with the exported mm-based mesh/model.
Post Reply