Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Problem] FreeCAD produce different results under the same input parameters #7818

Closed
2 tasks done
SYehChen opened this issue Nov 17, 2022 · 9 comments
Closed
2 tasks done
Labels
Bug This issue or PR is related to a bug Missing: feedback If feedback is requested WB FEM Related to the FEM Workbench WB Spreadsheet Related to the Spreadsheet Workbench

Comments

@SYehChen
Copy link

SYehChen commented Nov 17, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Version

0.20 (Release)

Full version info

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: Chinese/Taiwan (zh_TW)
Installed mods: 
  * CfdOF 1.16.1

Subproject(s) affected?

No response

Problem description

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.

model01.zip

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@ghost
Copy link

ghost commented Nov 17, 2022

I can not confirm it, the result is still absolute the same when i edit the Spreadsheet and rerun the calculation. But there are some questions in it.

Do you recalculate the mesh after the editing? I did not for testing purposes. But when you do it, gmsh can have randoms in the mesh in it. When you rerun gmsh, you will see very little differences. I am sure they are intent (start at random point), also i am sure there is also a difference when you use different amount of CPUs.

Also note, the real difference of the value of the result is the minimal value. Since the shape have discontinuous (rectangle corners), a very little difference of the shape seems to have a impact, but the value are still low and neglectable. In the maximal value the discontinuous shape have also a little bit of impact, but is in the tolerance of a FEM calculation.

@SYehChen
Copy link
Author

As I have stated above, the paraemeters were changed several times, and changed back to the original. So naturally everytime the model was remeshed and rerun. The problem is if you do something to the mode and changed back to the original state, FreeCAD can not give the original results. The can cause serious problems.

In meshing programs there are certainly radom seeds, especially for freee meshing. But the random number is usually psuedo, not really random. This is to ensure persistent results. So if Gmsh will produce different results every time even when the inputs are the same, then maybe we should notify the developer of Gmsh.

Another possibility is the inside parameter of CAD may be different. Either way, the discrepency is not permissible. In some industries, there are even regulations enforcing the consistency of results from FEA program. The bottom line is, an engineer program should produce the same result when then inputs are the same. Otherwise it will be considered as "unstable".

I really don't think this prblem can be ignored. In fact we have tried to use FreeCAD FEM for testing some design algorithms, and it produces different result everytime, even with the same input, on the same computer.

@ghost
Copy link

ghost commented Nov 17, 2022

In meshing programs there are certainly radom seeds, especially for freee meshing. But the random number is usually psuedo, not really random.

Then it is not random. Random means not reproduceable at all for the usecase.

So if Gmsh will produce different results every time even when the inputs are the same, then maybe we should notify the developer of Gmsh.

They are, look at the documentaion, see https://gmsh.info/doc/texinfo/gmsh.html#index-Mesh_002eRandomSeed. Gmsh is a beast. and offers many function.

In some industries, there are even regulations enforcing the consistency of results from FEA program.

True.

The bottom line is, an engineer program should produce the same result when then inputs are the same.

Also the will be always a tolerance in computation, especially in FEM.

@SYehChen
Copy link
Author

SYehChen commented Dec 7, 2022

In meshing programs there are certainly radom seeds, especially for freee meshing. But the random number is usually psuedo, not really random.

Then it is not random. Random means not reproduceable at all for the usecase.

So if Gmsh will produce different results every time even when the inputs are the same, then maybe we should notify the developer of Gmsh.

They are, look at the documentaion, see https://gmsh.info/doc/texinfo/gmsh.html#index-Mesh_002eRandomSeed. Gmsh is a beast. and offers many function.

In some industries, there are even regulations enforcing the consistency of results from FEA program.

True.

The bottom line is, an engineer program should produce the same result when then inputs are the same.

Also the will be always a tolerance in computation, especially in FEM.

I have been using commercial FEA for about 30 years, but never seen this situation before. Netgen doesn't seem to have this problem either (or the discrepency is much much smaller)

@luzpaz
Copy link
Contributor

luzpaz commented Dec 21, 2022

@grubertechnic when you report your findings trying to reproduce bugs, please always post your full About info or else your feedback is severely lacking important data.

@luzpaz luzpaz added Bug This issue or PR is related to a bug WB FEM Related to the FEM Workbench WB Spreadsheet Related to the Spreadsheet Workbench Missing: feedback If feedback is requested labels Dec 21, 2022
@adrianinsaval
Copy link
Member

how much difference are we talking about here?

@SYehChen
Copy link
Author

SYehChen commented Jun 9, 2023

Usually 1%~2%. Sometimes it can be 5%.

@FEA-eng
Copy link
Contributor

FEA-eng commented Feb 18, 2024

@luzpaz or @maxwxyz I don't think there's anything that could be fixed in FreeCAD itself here so I would close this issue.

@maxwxyz
Copy link
Collaborator

maxwxyz commented Feb 19, 2024

Closed

@maxwxyz maxwxyz closed this as completed Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This issue or PR is related to a bug Missing: feedback If feedback is requested WB FEM Related to the FEM Workbench WB Spreadsheet Related to the Spreadsheet Workbench
Projects
None yet
Development

No branches or pull requests

5 participants