FEm with Contact Constrain

About the development of the FEM module/workbench.

Moderator: bernd

Waldschrat
Posts: 10
Joined: Tue Dec 24, 2019 5:58 am

FEm with Contact Constrain

Post by Waldschrat »

Hello all

I'm trying to run a mechanical FEM simulation with a contact constraint, a force and a fixed face, see attached file.
There is a 1 mm distance between the bodies because that was the only way to get the meshes separate.
CalculiX runs generally, but after some calculation fails with "Too many cutbacks".
I've attached the FCStd and the .inp file.

I've also tried all the contact constraints examples I found in the forum. None could just be opened and run, but all converged after I reimplemented them.

So, well, I'm not sure what the problem is and what to do.
I thought that maybe the 1 mm motion before the faces touch is a problem, so I also tried to add a displacement constrain instead of the fixed constrain to move the lower part up by 1 mm to bring the body into contact, similar to one of the examples, but that didn't work, either.
Also moving the cylinder down and then using a compound to merge the two bodies but still have the meshes separate didn't work, either.

Anyone any ideas what did I do wrong?

And, by the way, if you want to answer in German, please go ahead.

cheers, Waldschrat
Attachments
FEMMeshGmsh.inp.txt
(954.71 KiB) Downloaded 85 times
Computerfuß.FCStd
(718.23 KiB) Downloaded 88 times
Waldschrat
Posts: 10
Joined: Tue Dec 24, 2019 5:58 am

Re: FEm with Contact Constrain

Post by Waldschrat »

Ah, forgot to mention, after it didn't work I updated to 0.19_pre, but that didn't help, either.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: FEm with Contact Constrain

Post by Kunda1 »

Mod edit: Moved to FEM subforum
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
fandaL
Posts: 440
Joined: Thu Jul 24, 2014 8:29 am

Re: FEm with Contact Constrain

Post by fandaL »

Waldschrat wrote: Sat Oct 03, 2020 5:48 pm CalculiX runs generally, but after some calculation fails with "Too many cutbacks".
I've attached the FCStd and the .inp file.
Analysis with contact can be sometimes difficult to set.

Your model has 0 friction coefficient, so the cylinder can slip out of the contact surface. You should use non-zero value or prescribe constraints to prevent movement out of the force direction.

I got it converging with the friction coefficient 0.3 and first order mesh (“Element Order” property of the mesh object). CalculiX contacts converge better with first order elements according to the manual. Difficulty is that your geometry with first order mesh and such element size would be probably not much precise.

By the way, convergence log is in *.sta and *cvg files generated by CalculiX
Waldschrat
Posts: 10
Joined: Tue Dec 24, 2019 5:58 am

Re: FEm with Contact Constrain

Post by Waldschrat »

Hi and thanks for your answer.

I set the friction coefficient in the contact constraint to 0.3 and the "Element order" in the mesh object to "1st", but it still did not converge.
Then I tried setting a displacement constraint on the top surface, allowing it to move only in Z direction, but that didn't help, either.
Looks like I'm still missing a magic button you found.

What OS are you using? I found some mentions in the forum that Windows (which I'm using) may not be as good in converging as Linux.
fandaL
Posts: 440
Joined: Thu Jul 24, 2014 8:29 am

Re: FEm with Contact Constrain

Post by fandaL »

For me it works on Linux machine as well as Windows machine, both with CalculiX 2.17 (version is printed in FreeCAD on the beginning of the log when you submit the run the analysis). Check if you really modified the mesh (double click on the mesh object and Apply), so the mesh contains linear elements instead of quadratic (check by right click on the mesh object -> "Display FEM mesh info"). However, if you have thin-walled structure with only one linear element over the thickness, precision can be far from reality. In theory, it would be appropriate to use shell elements for the thin-walled parts, but as far as I'm concerned combination of 2d and 3d elements is not yet fully supported by FreeCAD and I did not try this with contacts in CalculiX.

OS: Linux Mint 19.3 (MATE/mate)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22522 (Git) AppImage
Build type: Release
Branch: master
Hash: d8e476ef428017900dfe0f9359ba448503c216f9
Python version: 3.8.5
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22492 (Git)
Build type: Release
Branch: master
Hash: 621e1d603b2a8d1bcdcd8dc5c34bc8c35d29feb2
Python version: 3.8.5
Qt version: 5.12.6
Coin version: 4.0.0
OCC version: 7.4.0
Locale: Czech/Czech Republic (cs_CZ)
User avatar
EduBambu
Posts: 24
Joined: Sun Jun 14, 2020 8:52 pm
Location: Minas Gerais, Brasil

Re: FEm with Contact Constrain

Post by EduBambu »

Good night!

I think the problem is really the mesh! I built your model with the same measurements, and created a mesh using Netgen (shipped on FreeCad 19), I used the normal program specifications, I only used a maximum size of 100.

Contact01.png
Contact01.png (232.04 KiB) Viewed 2778 times

I also used a different material for both parts; PLA for the spring and steel for the cylinder.

Contact02.png
Contact02.png (54.06 KiB) Viewed 2778 times

I used the same restrictions and values as your model, just added a displacement restriction in "x" and "y" for the cylinder.

Contact03.png
Contact03.png (189.27 KiB) Viewed 2778 times

And it worked.

It takes a little time to complete the calculation, but the result is quite consistent. With 1 N applied to the steel cylinder (in my case), without considering its own weight, the spring deformation was 0.18 mm.

Contact04.png
Contact04.png (259.18 KiB) Viewed 2778 times

Follow the model file made by me, the mesh was cleaned to reduce the size, if it is to be calculated, double-click on FEMMeshNetgen to redo the mesh.

Computerfuß_br2.FCStd
(23.06 KiB) Downloaded 77 times
Waldschrat
Posts: 10
Joined: Tue Dec 24, 2019 5:58 am

Re: FEm with Contact Constrain

Post by Waldschrat »

Hi and thanks for the help.

Sorry for the late answer, I've been on vacation for a few days.

@fandaL: Recreating the mesh after setting the element order to 1st finally made it converge, but the result wasn't exactly useful: The steel cylinder moved down by 1 mm at the end of the simulation time, but the base didn't flex at all. So I brought the cylinder down to just 1 µm of distance and that looked at least more reasonable, i.e. the base flexed. I have to do some more simulations to see if the results make any sense.

With a distance of 0 mm and changing the fusion to a compound it did not converge again.

@EduBambu: I tried your instruction in my model, but no success. Then I opened your model and recreated the mesh, but still no convergence. Can you put your full model including mesh and the inp files somewhere? Maybe OneDrive, Goggle Drive, Dropbox whatever? I'd like to compare them to mine to see if I can find a significant difference.
User avatar
EduBambu
Posts: 24
Joined: Sun Jun 14, 2020 8:52 pm
Location: Minas Gerais, Brasil

Re: FEm with Contact Constrain

Post by EduBambu »

Waldschrat wrote: Fri Oct 09, 2020 6:53 pm Hi and thanks for the help.

Sorry for the late answer, I've been on vacation for a few days.
....

@EduBambu: I tried your instruction in my model, but no success. Then I opened your model and recreated the mesh, but still no convergence. Can you put your full model including mesh and the inp files somewhere? Maybe OneDrive, Goggle Drive, Dropbox whatever? I'd like to compare them to mine to see if I can find a significant difference.
Ok.

https://drive.google.com/drive/folders/ ... sp=sharing

OS: CentOS Linux 7 (Core) (KDE/1-kde-plasma-standard)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22611 (Git) AppImage
Build type: Release
Branch: master
Hash: 7eeec7a5990cc786723225ca8de16ca3186545b3
Python version: 3.8.5
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.4.0
Locale: Portuguese/Brazil (pt_BR)
Waldschrat
Posts: 10
Joined: Tue Dec 24, 2019 5:58 am

Re: FEm with Contact Constrain

Post by Waldschrat »

Hi and thanks,

I'll try it in a bit.

But anyway I noticed one other thing: When using fandaL's solution, it will only converge when I set (what I did randomly) the max length in GMSH to 4 mm. If I make the grid finer (e.g. max length 3, 2 or 1 I tried) it doesn't converge anymore. Feels a bit like you have to have a lot of luck to get it to converge. At least I seem to.
Post Reply