## Troubleshooting Models & Simulations

About the development of the FEM module/workbench.

Moderator: bernd

FemUser
Posts: 133
Joined: Wed Aug 23, 2017 6:45 pm

### Troubleshooting Models & Simulations

I am studying various geometries, some built in FreeCAD, others imported to understand what type of errors I get.

Remember I am not an expert in FreeCAD geometry modelling, however since I am beginning I think I will stumble upon many of the difficulties that new comers will find.

One of my geometries presented a challenge and thus I would like to discuss with the community to figure out what is wrong with it and what are the typical errors those problems can generate.

The geometry is a sunbech structure, those types that we can relax by the pool
SunChairMesh.jpg (649.46 KiB) Viewed 1507 times
Going direct to the case:

- Can mesh with NetGen
- Can't mesh with Gmsh
- Can't solve with Calculix

https://we.tl/z3T2N5Rayt

My guess is that these are bad elements either from the beginning or due to excessive deformation.
acobian determinant in element 311025
How would you troubleshoot this issue?
What can I do to make the solid work with gmsh?
How do I locate the bad elements on my solid?
How can I avoid the bad geometry from when I am building the CAD model?

Any help is much appreciated.

I checked the geometry:
SunBenchPartial2.Fusion002:
VERTEX : 56
EDGE : 84
WIRE : 44
FACE : 36
SHELL : 3
SOLID : 1
COMPSOLID : 0
COMPOUND : 1
SHAPE : 225

Calculix gives some feedback:
0.0: Check dependencies... 108.3: Write completed. 0.0: CalculiX binary: /usr/local/Cellar/calculix-ccx/2.12/bin/ccx_2.12 0.0: Run CalculiX... 0.1: Starting CalculiX... 0.2: CalculiX is running... 28.2: CalculiX stopped. 28.3: ************************************************************ CalculiX Version 2.12, Copyright(C) 1998-2015 Guido Dhondt CalculiX comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions, see gpl.htm ************************************************************ You are using an executable made on Tue Jul 4 17:04:04 BST 2017 The numbers below are estimated upper bounds number of: nodes: 424365 elements: 361926 one-dimensional elements: 0 two-dimensional elements: 0 integration points per element: 4 degrees of freedom per node: 3 layers per element: 1 distributed facial loads: 0 distributed volumetric loads: 0 concentrated loads: 83224 single point constraints: 204 multiple point constraints: 1 terms in all multiple point constraints: 1 tie constraints: 0 dependent nodes tied by cyclic constraints: 0 dependent nodes in pre-tension constraints: 0 sets: 5 terms in all sets: 1492583 materials: 1 constants per material and temperature: 2 temperature points per material: 1 plastic data points per material: 0 orientations: 0 amplitudes: 2 data points in all amplitudes: 2 print requests: 2 transformations: 0 property cards: 0 *INFO reading *STEP: nonlinear geometric effects are turned on *WARNING reading *STATIC: a nonlinear analysis is requested but no time increment nor step is specified the defaults (1,1) are used STEP 1 Static analysis was selected Newton-Raphson iterative procedure is active Nonlinear geometric effects are taken into account Decascading the MPC's Determining the structure of the matrix: number of equations 1272891 number of nonzero lower triangular matrix elements 43464747 increment 1 attempt 1  increment size= 1.000000e+00 sum of previous increments=0.000000e+00 actual step time=1.000000e+00 actual total time=1.000000e+00 iteration 1 Using up to 1 cpu(s) for the stress calculation. Using up to 1 cpu(s) for the symmetric stiffness/mass contributions. *ERROR in e_c3d: nonpositive jacobian determinant in element 153031 *ERROR in e_c3d: nonpositive jacobian determinant in element 157660 *ERROR in e_c3d: nonpositive jacobian determinant in element 166063 *ERROR in e_c3d: nonpositive jacobian determinant in element 205046 *ERROR in e_c3d: nonpositive jacobian determinant in element 219980 *ERROR in e_c3d: nonpositive jacobian determinant in element 262854 *ERROR in e_c3d: nonpositive jacobian determinant in element 278807 *ERROR in e_c3d: nonpositive jacobian determinant in element 284306 *ERROR in e_c3d: nonpositive jacobian determinant in element 287731 *ERROR in e_c3d: nonpositive jacobian determinant in element 287812 *ERROR in e_c3d: nonpositive jacobian determinant in element 287822 *ERROR in e_c3d: nonpositive jacobian determinant in element 311025 *ERROR in e_c3d: nonpositive jacobian determinant in element 313616 *ERROR in e_c3d: nonpositive jacobian determinant in element 338044 *ERROR in e_c3d: nonpositive jacobian determinant in element 338371 *ERROR in e_c3d: nonpositive jacobian determinant in element 343540 28.3: CalculiX done! 28.3: Loading result sets...
Worufu
Posts: 40
Joined: Wed Jan 13, 2016 10:44 am
Location: Italy

### Re: Troubleshooting Models & Simulations

I think the problem is the source bad geometry. As you see in the screen below, there are multiple faces due to this "artifacts" in the viewport (selected face with strange shading).
Usually Jacoban error is related to a geometry misunderstand; I say this based on my experience (error in matrix construction or other similar problems).

Try to solve these geometry problem with a better model, use refine function in Part Workbench.
FemError.png (96.24 KiB) Viewed 1458 times
FemError2.png (119.68 KiB) Viewed 1458 times
UR_
Posts: 1016
Joined: Tue Jan 03, 2017 8:42 pm

### Re: Troubleshooting Models & Simulations

Attached you can find an example solution

Screenshot:
ScreenShot.png (207.36 KiB) Viewed 1453 times

File:
SunBench-UR.FCStd

Done with:
OS: Windows 10
Word size of OS: 64-bit
Version: 0.17.11958 (Git)
Build type: Release
Branch: master
Hash: c9957b8a98e71b2a69c71b9f92acf1cf01afcc35
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: German/Germany (de_DE)
gmsh-3.0.4

Last, but not least, some hints in general:
- use symmetry, if there is one
- use shell elements, if there is a bad length/thickness ratio (approx. > 5:1) (here tube's thickness is 1 mm!)
- use nonlinear analysis only, if linear one works, mostly necessary only for huge deflections (!!!)
- don't restrict deflections in artificial way, otherwise you will get abnormal stresses

For sure, this list is not complete
FemUser
Posts: 133
Joined: Wed Aug 23, 2017 6:45 pm

### Re: Troubleshooting Models & Simulations

Thanks for your replies!!! I made one leg then copied to have two but the copied version was offset. After I made the tubes such that they would contact the opposing leg, then finally I fused everything together. The objective was to test if simple contact and fuse would produce usable meshes. Gmsh didn't like, NetGen meshed it without any effort.

The image you showed was due to not having hidden Part4 in the model. For the meshing I only considered the fused part.
Figure2.png (31.55 KiB) Viewed 1421 times
Figure1.png (79.96 KiB) Viewed 1421 times
Figure3.png (558.23 KiB) Viewed 1421 times
Just like you all said, the error must be coming from a bad geometry. And typically results into an improper element that can be distorted in some way. Would Gmsh or Netgen give any information regarding element quality? Aspect ratio? Skewness? And is there any way to find the location of the respective element?
Figure4.png (319.76 KiB) Viewed 1421 times
You showed me that part of the model works I am thinking that the tube connection to the copied leg is the problem. Since I fused objects together why didn't it produce a proper solid?

On a normal work I would redo de geometric model as all of you suggested and well. But my interest is really to investigate the bad geometry and go a bit deeper with your help.
FemUser
Posts: 133
Joined: Wed Aug 23, 2017 6:45 pm

### Re: Troubleshooting Models & Simulations

After some fighting I finally found the reason why the example model I brought here wasn't working.

Recap of problem:

- Produced a tubular geometry with rectangle cross section and circular cross sections
- Combined separated objects together (fused)

Problems:
- Meshing warnings and errors
- When meshing was more fine the error wan in the solver when calculix ruined.

In the beginning i thought the problem was due to a bad geometry, I produced the geometry with other sources and imported in step format to just get the same problem.

I noticed that the mesher has a few options that don't appear in the first menu when we mesh the body and we can see them when we select the FEMMeshGMSH on the project tree.
GMSHConfiguration.png (66.14 KiB) Viewed 1339 times
I activated High Order Optimize, Optimize Netgen, Optimize std and recombine all. (All true)

After that I got no problems with calculix and the geometry.

Looking at the work flow it seems that when we produce the mesh not all options are available which took me into the direction that I could not do anything else regarding meshing, after a bit of discovering the GUI, i found a new set of options that helped me solve my problem.

Here is the result:
Results.jpeg (70.36 KiB) Viewed 1339 times
Worufu
Posts: 40
Joined: Wed Jan 13, 2016 10:44 am
Location: Italy

### Re: Troubleshooting Models & Simulations

Uh sorry, I missed the post. However the solution seems good. I think these tools work like mesh refinement and delete the mesh error. Good work, in future I hope this can help the wiki.
FemUser
Posts: 133
Joined: Wed Aug 23, 2017 6:45 pm

### Re: Troubleshooting Models & Simulations

Here is a new problem let's see if we can make it work ! I bring a truss. In this case I have imported a step file externally from FreeCAD.
TheTruss.jpeg (82.64 KiB) Viewed 1215 times
The difficulty in this case is to produce a mesh that again will yield a solution in calculix.

Using the default options in gmsh result in a bad mesh, even changing a bit the menu options.
badMesh2.jpeg (139.05 KiB) Viewed 1215 times
Also I noticed that I do not produce a volume. So this case is new to me. Also I get intersecting elements.
badMesh.jpeg (137.12 KiB) Viewed 1215 times
If I try to make the mesh finer I solve the intersection problem but continue without volume elements. I must be doing something wrong.

The CAD I used is here:
I tried NetGen and I get the same no generation of volumes.
FemUser
Posts: 133
Joined: Wed Aug 23, 2017 6:45 pm

### Re: Troubleshooting Models & Simulations

Here are 0 volumes
trussvolumes.png (44.5 KiB) Viewed 1206 times
Posts: 1431
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

### Re: Troubleshooting Models & Simulations

the truss has a length of 3 m, the tube thickness is 5 mm.
If I assume a refinement-level of 2 cells to simulate the thickness, I need
120 cells at 2,5 mm tube lenghts. For the chord-members alone you need approx 550000
elements. Adding the other members, I get more than 1 Megacells. Can GMSH handle this?
(btw: I dont know any structural engineer who calculates a complete truss with FEM-volume-elements)
Thomas
UR_
Posts: 1016
Joined: Tue Jan 03, 2017 8:42 pm

### Re: Troubleshooting Models & Simulations

Fri Sep 29, 2017 2:13 pm
I dont know any structural engineer who calculates a complete truss with FEM-volume-elements
Yesterday on ccx forum:
226000 S8R element ship cargo area model with 15 million nodes model exists with the following error;
Determining the structure of the matrix:
*ERROR in u_realloc: error allocating memory