Difference Calculix & Ansys for static simulation under thermal load

About the development of the FEM module/workbench.

Moderator: bernd

Post Reply
jan_11
Posts: 2
Joined: Mon Mar 20, 2023 2:24 pm

Difference Calculix & Ansys for static simulation under thermal load

Post by jan_11 »

Hello,

i am currently investigating the deformation of a part under a thermal load e.g. a temperature distribution. As both Ansys 2023 R1 and FreeCAD 0.20.2 are available for me I tried simulating with both. The results I would say are "mixed" while I expected them both to be very similar for a static simulation like this. Maybe I am missing something?

My Approach: I used the same geometry and meshed it in each program with close matching match granularity (at least to my knowledge there is no way to import a fem mesh from ansys into FreeCAD/other way around?). In both programs I used the same Material constants as well as boundary conditions like displacement constraints, initial temperature, etc. For FreeCAD I wrote a script that edits the .inp File for Calculix to do a static simulation under a specific thermal distribution. In Ansys i imported the same temperature distribution but applied it to that mesh using the Distance based mapping and used a Static Structural Simulation. After simulating both i wrote another script to measure diameters etc of each.
In the following picture you can see the model I used as well as the temperature distribution i worked with:
Model Temperature.jpg
Model Temperature.jpg (97.08 KiB) Viewed 1056 times
Visually, both show a similar kind of deformation (both here scaled x3000). Note: I fixed the whole bottom face in the z Direction as well as the short edge on the bottom right in x,y direction, that's why the color gradient for the total deformation is looking like this.
Ansys:
Ansys_deformation.jpg
Ansys_deformation.jpg (106.84 KiB) Viewed 1056 times
FreeCAD:
FreeCAD_deformation.jpg
FreeCAD_deformation.jpg (333.23 KiB) Viewed 1056 times
For a higher detailed comparison i exported both results and calculated a few measurements like diameter/differences of nodes at specific geometric positions. For example, the 4 corner nodes of the geometry form 2 horizontal (-> diameter) and 2 vertical differences i looked up.
For those 4 measurements I got the following results:
lower diameter: Ansys: + 384 μm; FreeCAD: + 382 μm; (reference at 20°C is 1366 mm)
upper diameter: Ansys: + 146 μm; FreeCAD: + 223 μm; (reference at 20°C is 1292 mm)
vertical measurement left: Ansys: + 194 μm; FreeCAD: + 198 μm; (reference at 20°C is 1181 mm)
vertical measurement right: Ansys: + 101 μm; FreeCAD: + 112 μm; (reference at 20°C is 1181 mm as well)

As one can see both Ansys and FreeCAD have really similar results aside from the upper diameter, which is what i would expected. However, the deformation of the upper diameter is 50% higher in FreeCAD than in Ansys, which i currently can't explain. I also tried a few different mesh granularities, but the differences were < 1 μm and therefore could not explain this for me. This upper part is the most interesting as it's warping a lot due to the inhomogeneous temperature distribution as well as the complex geometry. I didn't expect such high differences in a static simulation as the math should be quite similar in both cases?

If anybody has some input on why the results differ so much for the upper part I would be happy for any suggestions on what may cause this.
Thanks in advance!
Jan
User avatar
NewJoker
Veteran
Posts: 3018
Joined: Sun Oct 11, 2020 7:49 pm

Re: Difference Calculix & Ansys for static simulation under thermal load

Post by NewJoker »

Such comparisons are hard because you need to make sure that everything is the same for both models. Did you compare the plots of the applied temperature field in Ansys and FreeCAD ? Is geometric nonlinearity enabled or disable in both cases ? Are meshes really similar ? You haven't shown the one from Ansys. Also, compare the number of elements/nodes.
User avatar
gabokamaze
Posts: 19
Joined: Thu Feb 10, 2022 3:12 pm

Re: Difference Calculix & Ansys for static simulation under thermal load

Post by gabokamaze »

Hi @jan_11 ,

Do not expect response(s) from myself, but questions ... ;) as I never used FreeCAD/Calculix nor Ansys/Mechanical.

The first thing to do if you want to compare 2 computations from 2 software is to make efforts from both sides to obtain the most similar mesh (in density but also type of cells : tetra does not give same results than hexa for example). This can be verified by comparing (at least) number of nodes/cells and density (=number of nodes/cells) along curved part (like holes for examples) :
  • Can you add comparison of number of nodes/cells and also at least one picture of the Ansys/Mechanical mesh (I suspect mesh is finner for Ansys/Mechanical model) ?
Some software give information about the geometry from the mesh : volume or mass, center of gravity, moments and products of inertia -> if they are not the same for both computations, it indicates that the geometry represented by the mesh for both computations are not the same, so do not expected same results :
  • Do you have this kind of information ?
If the load are not exactly the same for both computations, do not expected same results. It seems that you only deal with thermal load :
  • Can you add a picture of FreeCAD/Calculix temperature distribution ? Try to use the same color legend (color map, number of color discretization and min/max bounds) for both pictures (Ansys/Mechanical and FreeCAD/Calculix) otherwise it is really difficult to compare.
  • Are you sure there is no "side effect" with the thermal distribution treatment (like extrapolation which could lead to nul value or very high value located at one node) ?
In the same manner, can you modify the picture(s) of "deformation" to get same color legend (color map, number of color discretization and min/max bounds) for both pictures (Ansys/Mechanical and FreeCAD/Calculix) otherwise it is really difficult to compare.

I am sorry, but I do not catch where the node you print displacement values are situated :
  • Can you add a picture with a tag/annotation on it to be sure where they are ?
Another remark, which is not really linked to your problem : I suppose that you exploited the symmetry by modeling only half of the structure :
  • If it is the case : why you do not used symmetrical boundary conditions of the 2 faces which are within the symmetrical plan ?
Hopping these additional question could lead you to some answers ...
Regards,
jan_11
Posts: 2
Joined: Mon Mar 20, 2023 2:24 pm

Re: Difference Calculix & Ansys for static simulation under thermal load

Post by jan_11 »

Thanks for your suggestions!

After reading all your points i think the problematic point in my comparison is, that I am not able to use the same mesh and therefore cannot have the exact same temperature distribution (I have to use Ansys Mapping). I don't see any possibility to fix this. I tried various export & import ways as well as converting the meshes from one to another using vtk and meshio, but it seems to me that Ansys and FreeCAD/Calculix work with inherently different mesh/element cells. If anybody knows a way to use the same mesh in both programs, please let me know. Until this is possible i don't see a good way to properly compare both programm. Until then I don't think this is a good approach like you said.

Nevertheless, here is some additional information:
  • applied temperature: As there is no way to compare the temperature (2 different meshes!), I manually compared temperatures at destinct geometric positions e.g. corners, middle of an edge etc. I did this for about 20 Nodes and the temperature was the same or at max. 0.1K different. However these Nodes are pretty often very close in both meshes because the are corners etc, so this is also not a good test.
  • nonlinearity: For the inital experiments, nonlinearity was off. I then tried both nonlinear material as well as nonlinear geometry in Ansys, these however only changed the 4 measurements by at max 0,1 μm, not much at all.'
  • meshes: As said above the meshes are different and even seem to use different elements or different amounts of nodes per element. I tried different meshes in Ansys ranging from extremely coarse (just as an extreme test, 8k Nodes) to decently fine (70k Nodes). Still, the measurements are quite similar with the very coarse one being only a few μm different from the finer meshes. None of this was even close to the 70 μm difference i saw when switching to FreeCAD.
Maybe I will revisit this later, but for now I don't see this being a good idea if we cannot have the same mesh in both programs
User avatar
johnwang
Veteran
Posts: 1345
Joined: Sun Jan 27, 2019 12:41 am

Re: Difference Calculix & Ansys for static simulation under thermal load

Post by johnwang »

Maybe you could try the Elmer solver.
ElmerGrid can convert Ansys mesh into Elmer mesh. So you could solve it directly with Elmer.
ElmerGrid can also convert Ansys mesh into gmsh mesh. With the gmsh mesh, maybe you could solve it In FreeCAD with Elmer or Calculix.
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
User avatar
NewJoker
Veteran
Posts: 3018
Joined: Sun Oct 11, 2020 7:49 pm

Re: Difference Calculix & Ansys for static simulation under thermal load

Post by NewJoker »

@jan_11 Forget about FreeCAD and CalculiX for now and try to find a way to exchange meshes (and maybe also other data) between Ansys and Abaqus. CalculiX uses pretty much the same format as Abaqus with only small differences if you use some advanced functionalities. But it shouldn't be a problem when it comes to meshes. It would be even better if you could use some independent mesher like Hypermesh or Ansa. They support a variety of export formats.
Post Reply