FreeCAD produce different results under the same input parameters

About the development of the FEM module/workbench.

Moderator: bernd

Post Reply
S-Y.Chen
Posts: 63
Joined: Tue Aug 27, 2019 4:33 pm

FreeCAD produce different results under the same input parameters

Post by S-Y.Chen »

I have a very simple testing model here. It shows that FreeCAD FEM will produce different results under the same input parameters

The original model is 01.FCStd. The CAD parameters are linked to the Spreadsheet. After changing the input parameters in the Spreadsheet several times, and changed them back the the original value of 02.FCStd, FreeCAD produce difference results from its FEM result (for example, von Mises stress).

I suspected this behavior long time ago, so I decided to make a simple model to reproduce the problem

Unless I have done something wrong here, this is a serious problem of FreeCAD.

The two models after 7z are about 3MB in size. I have to update to the cloud. The link is proved below.

https://drive.google.com/file/d/1jO5-gc ... sp=sharing
User avatar
NewJoker
Veteran
Posts: 3082
Joined: Sun Oct 11, 2020 7:49 pm

Re: FreeCAD produce different results under the same input parameters

Post by NewJoker »

The geometry is the same but the mesh generated by Gmsh is different. One has 5409 nodes and 3124 elements while the other has 5365 nodes and 3090 elements.
S-Y.Chen
Posts: 63
Joined: Tue Aug 27, 2019 4:33 pm

Re: FreeCAD produce different results under the same input parameters

Post by S-Y.Chen »

This should not happen in an engineering software. an engineer program should produce the same result when then inputs are the same, and on the same computer.

All I do was change parameters, remesh and rerun. Finally I change the parameters to the original, but it produce different results.

I have reported this issue at
https://github.com/FreeCAD/FreeCAD/issues/7818
User avatar
NewJoker
Veteran
Posts: 3082
Joined: Sun Oct 11, 2020 7:49 pm

Re: FreeCAD produce different results under the same input parameters

Post by NewJoker »

It seems to be a fault of Gmsh, it doesn't happen with Netgen. The same behavior can be observed with the newest version of Gmsh (4.11) so maybe this could be reported on their GitLab: https://gitlab.onelab.info/gmsh/gmsh/-/issues
However, I haven't managed to reproduce this using standalone Gmsh yet. Perhaps it's a matter of settings (I used default ones in Gmsh, apart from max element size).
user1234
Veteran
Posts: 3506
Joined: Mon Jul 11, 2016 5:08 pm

Re: FreeCAD produce different results under the same input parameters

Post by user1234 »

NewJoker wrote: Thu Nov 17, 2022 6:52 pm It seems to be a fault of Gmsh, it doesn't happen with Netgen.
It is intended, see https://gmsh.info/doc/texinfo/gmsh.html ... RandomSeed, default is Mesh.RandommSeed = 1. Also it is to expect, when you change the version of gmsh or the numbers of CPU to mesh, that the result can vary.

@bernd: since you are the FEM guru, i have one question. Even when i switch off the Mesh.RandomSeed = 0, this happens sometimes. Could it be that it must somewhere specific in the *.geo file? At least i do not see it in the docs.

branch: https://github.com/grubertechnic/FreeCA ... d_property

Greetings
user1234
Post Reply