Exploring Calculix

About the development of the FEM module/workbench.

Moderator: bernd

Post Reply
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Exploring Calculix

Post by ulrich1a »

Calculix features are not easy to grasp. So I tried to find out, if it is possible to do some basic physics with it. After some trial and error I got a working bouncing pendulum with just two finite elements. The rigid body concept is used to fix the two bodies in space. One degree of freedom is left, so they can rotate about their fix-point. The driving force is gravity.
The contact feature did need tuning. The surface behavior parameter is way off from the recommendation in the Calculix manual.
The input file is given together with two scripts, in order to create an animation with cgx. Put all files into one directory. Call the analysis. Open the results with cgx and there type

Code: Select all

read ./movie.fbd
This script writes pictures for each time step into the directory. A python-script is called which renames the files, in order to get the sorting right. Then convert from Image-magicks is called to generate the gif-file.

As this is also similar to a crash-test, it may be feasible to do such kind of analysis with calculix.

Ulrich
Attachments
bumper_test.zip
(2.41 KiB) Downloaded 129 times
animated.gif
animated.gif (861.85 KiB) Viewed 4012 times
User avatar
kkremitzki
Veteran
Posts: 2517
Joined: Thu Mar 03, 2016 9:52 pm
Location: Illinois

Re: Exploring Calculix

Post by kkremitzki »

This is really awesome! I'm still getting oriented with the FreeCAD code so I haven't had much chance to dive into FEM yet, but this is quite promising. Do you think this could be extended to do kinematics-type stuff, like animate a four-bar linkage and show the time-dependent stress concentrations throughout the members?
ulrich1a wrote:The input file is given together with two scripts, in order to create an animation with cgx. Put all files into one directory. Call the analysis.
I'm still pretty new to this, can you expand on these instructions a little more?
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Exploring Calculix

Post by HoWil »

Nice! Did not know that this is possible in CalculiX.
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Exploring Calculix

Post by ulrich1a »

kkremitzki wrote:Do you think this could be extended to do kinematics-type stuff, like animate a four-bar linkage and show the time-dependent stress concentrations throughout the members?
I think this should be possible. I am trying to make an example.
kkremitzki wrote:I'm still pretty new to this, can you expand on these instructions a little more?
The posted example has got one finite element from the FreeCAD-FEM-workbench by the help of a script in order to get a start with an input file for the ccx-solver. All the rest was done without FreeCAD. The important part of the input file is copied from other examples and from the ccx-manual.
This is mainly because FreeCAD does not provide up to today menu-entries for dynamic calculations. This is also the reason of this thread, give me and others some motivation, to make more possible with FreeCAD and Calculix.

The posted files have one inp-file, which is the input for the FEM-solver ccx. ccx produces an frd-result-file from it. This can be opened by the post-processor cgx. With cgx you can view each time step of the solution individually. In order to get an animation, a certain sequence of commands have to be called in cgx. I wrote those commands into a cgx-script with the extension fbd.This fbd-script can be called from inside cgx by typing "read movie.fbd". It produces an image for each time step. Those images have a not very suitable number in their names. So a python script is called from inside movie.fbd to get the numbering right. After that an other external program "convert" is called to create the gif-file from all the images.

So for now it is not the easiest task, to get this kind of result. Hopefully it will be faster with the help of some working examples.

Ulrich
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Exploring Calculix

Post by ulrich1a »

kkremitzki wrote:Do you think this could be extended to do kinematics-type stuff, like animate a four-bar linkage and show the time-dependent stress concentrations throughout the members?
Here is Watts linkage with animated stress. The model is driven by a rotation boundery. Forces are applied to the "cylinder" in sync with the rotation. I had to play with the time points to get the calculation run through.
The linkage is modeled after the test-example "pendel.inp" from Calxulix.
It is made from sketches in FreeCAD. I had to disable some annoying restrictions in FreeCAD in order to set constraints on sketch vertices. I then wrote a quick and dirty macro to convert sketches into a mesh of beams.
I made first a sketch that has the linkage. But this can not be used to make the mesh. At all places with a hinge between beams, the hinged beams have to be in different sketches. This allows to create the hinged beams with individual nodes in the mesh. This is needed in order to link those nodes with a

Code: Select all

*equation
(see calculix manual).
The input file needs some manual changes, search for the word: "manually"
Finally the results were opened with the program cgx and rendered with a cgx script "movie.fbd".

Ulrich
Attachments
animated.gif
animated.gif (1000.49 KiB) Viewed 3854 times
Linkage.zip
contains model and scripts
(18.46 KiB) Downloaded 101 times
User avatar
makkemal
Posts: 395
Joined: Wed Apr 29, 2015 12:41 pm
Location: South Africa
Contact:

Re: Exploring Calculix

Post by makkemal »

This is a hole new can of worms, sweet :D
Last edited by makkemal on Wed Feb 08, 2017 1:13 pm, edited 1 time in total.
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Exploring Calculix

Post by PrzemoF »

That is great!!! Anyone for making an importer into the animation workbench? :shock:
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Exploring Calculix

Post by Jee-Bee »

why not import animation in FEM it is also handy for temperature, flow and frequency stuff
User avatar
makkemal
Posts: 395
Joined: Wed Apr 29, 2015 12:41 pm
Location: South Africa
Contact:

Re: Exploring Calculix

Post by makkemal »

why not import animation in FEM it is also handy for temperature, flow and frequency stuff
+1
Post Reply