cantilever beam by FemWB and CalculiX

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
bernd
Posts: 8345
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

cantilever beam by FemWB and CalculiX

Postby bernd » Tue Mar 17, 2015 6:57 am

Since there have been some fixes in FemWB lately here is a simple cantilever beam to prove the FemWB is useble allready.

Since FemWB uses CalculiX to calculate displacements the first example of CalculiX manual is choosen.
- http://web.mit.edu/calculix_v2.7/Calcul ... node7.html
or the whole pdf (http://www.dhondt.de/cgx_2.8.pdf)

Geometry:

a box
l = 8.0 m
w = 1.0 m
h = 1.0 m

The start section (face) of the beam is fixed and the end section of the beam is loaded by 9.0 MN which makes it a usual cantilever beam.

material is steel:
young's modulus = 210000 Mpa
poisons ratio = 0.3

displacement formula (beam theory)
f = (F x l^3) / (3 x E x I) = ( 9 x 8^3 ) / ((3 x 210000 x ((1x1^3)/12)) = (12x9x8^3) / (3x210000) = 0.0877 m = 87.7 mm

The mesh was generated by Netgen (10-node-tetrahedron, max size = 750mm)

Max Displacement in FreeCAD is 85.1 mm which is only 3 % difference to the beam theory.

Current Limitations of CalculiX run:
- one mesh object
- one fixed object (only faces)
- one force object (only faces, force in N is distributed on all nodes of the given faces)
- one material object

- output
- since input is in mm, N and N/mm2 output will be in these units too.

OS: Debian GNU/Linux 8.0 (jessie)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.15.4660 (Git)
Branch: femunits
Hash: a0892a9c5637d843b72decf0ece8a01209ae5cb6
Python version: 2.7.8
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.7.0

Screen:
screen.jpg
screen.jpg (110.06 KiB) Viewed 2826 times
File:
calculix-sample01-cantilever.FCStd
(75.86 KiB) Downloaded 108 times
EDIT: File which runs on FreeCAD 0.16.5231
calculix-sample01-cantilever-V02.FCStd
(75.92 KiB) Downloaded 43 times
Last edited by bernd on Tue Jul 21, 2015 10:35 am, edited 2 times in total.
User avatar
bernd
Posts: 8345
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: cantilever beam by FemWB and CalculiX

Postby bernd » Wed Mar 18, 2015 7:25 am

Some more informations:

material:
If material is opened the material which is saved inside the material object is not displayed. If cancel is pressed the material inside the material object is not changed. If OK is pressed the material which is displayed is used in the material object. Watch out for the report view the data is printed if OK or cancel is triggered. This is a workaround becaus I was not able to display the data in the spin box. To really be sure use:

Code: Select all

App.ActiveDocument.MechanicalMaterial.Material
edit CalculiX:
The webbrowser is used. On windows, debian jessie, ubuntu the application which is assoziated with the inp file is used (In my case the editor). This may not work on all os or desktops. This was the easieest solution I found. It works for all os I'm on.
wmayer
Site Admin
Posts: 14795
Joined: Thu Feb 19, 2009 10:32 am

Re: cantilever beam by FemWB and CalculiX

Postby wmayer » Wed Mar 18, 2015 8:59 am

I played with your example and there are many things in the FEM Gui which makes its usage unintuitive.
The one thing is the material stuff that you mentioned. Then when generating the results and opening the panel things get even worse:

* to get the same result as in your image you first have to press the Show button, change the displacement factor and then change the colors to be Uabs.
If you do it in a different order you get something completely different

* as soon as you set the color and press the Show button again the result changes and any changes on the displacement factor are ignored

* and it's not obvious that the scroll bar on the right side is connected to the spin box of the displacement factor which also visually looks a bit strange
User avatar
bernd
Posts: 8345
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: cantilever beam by FemWB and CalculiX

Postby bernd » Wed Mar 18, 2015 11:02 am

Thanks werner for testing the provided file. I can confirm what you describe. There is something more in the result widget which is important to know. If the dialog is closed and the mesh is still deformed mesh this deformed mesh is the base for displaying the results from the next run. Furthermore if the spin box is not set back to none the colors of the mesh are colorful.

User PrzemoF describes some more Gui related problems here viewtopic.php?f=18&t=10140#p81859

I myself have some Gui related problems which I have not yet published. Seams there are a few things in FemWB Gui which needs some love ...

I have never done some Gui development. For me it will take some time to fix any Gui related code. I stay tuned but any help is appretiated.

Most important thing is we are on the way with FemWB.
ulrich1a
Posts: 1875
Joined: Sun Jul 07, 2013 12:08 pm

Re: cantilever beam by FemWB and CalculiX

Postby ulrich1a » Tue Mar 24, 2015 6:08 pm

I tried just something to run calculix. In my case FreeCAD can not read the result file. A file is created, but there is also a FreeCAD_lock-file in the temp-folder.

I am not sure, if this is caused just by nonsense input, or is this a bug?

Ulrich

OS: Windows 7
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.15.4664 (Git)
Branch: master
Hash: 4e41e535ff01d39b650add123f42629e1a8d6b05
Python version: 2.7.8
Qt version: 4.8.6
Coin version: 4.0.0a
Attachments
Zugstange.FCStd
(11.34 KiB) Downloaded 41 times
User avatar
PrzemoF
Posts: 2649
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: cantilever beam by FemWB and CalculiX

Postby PrzemoF » Tue Mar 24, 2015 6:56 pm

There were quite a few changes in FEM wb since the version you're using:

Code: Select all

$ git log 4e41e535..HEAD src/Mod/Fem/ | grep -i fem:
    FEM: Add description to massage about CalculiX binary
    FEM: Add printCalculiXstdout function
    FEM: Add function to show CalculiX state changes
    FEM: Warn user about not implemented Loads/Supports
    FEM: Link exisitng calculixError procedure with error signal
    FEM: Add message to indicate end of writing CalculiX input file
    FEM: fix typos
    FEM: Fix cursor error
Is it possible for you to test something newer?
User avatar
bernd
Posts: 8345
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: cantilever beam by FemWB and CalculiX

Postby bernd » Wed Mar 25, 2015 6:50 am

ulrich1a wrote:I tried just something to run calculix. In my case FreeCAD can not read the result file. A file is created, ...
thanks Ulrich for testing the FemWB and providing the file. I have been playing a bit with your file. Load the file, activate the analysis, write CalculiX-file, run-CalculiX and show the results works fine for me and shows some results which makes sense too. See later on in this post.

Some hints if you can't wait for the 0.15 Release on Windows. Since you are on Windows two things to check to get CalculiX running with FreeCAD on Windows RC 1 provided here: viewtopic.php?f=8&t=7717&p=82719#p82687

1.
FreeCAD awaits CalculiX-binary (ccx.exe and some dll's) at

Code: Select all

FreeCAD.getHomePath() + 'bin/'
What you can do is copy the files from your 0.14 installation. See viewtopic.php?f=8&t=7717&p=82719#p82745

2.
In following file check if the following patch is applied

Code: Select all

FreeCAD.getHomePath() + 'Mod/Fem/MechanicalAnalysis.py'
https://github.com/berndhahnebach/FreeC ... b7353e3790


OK back to your file. Checked results with beam theory:

cube: l,w,h = 100, 10, 10 mm
material: E = 3.64E3 MPa = 3.64E3 N / mm2 ; pr = 0.36
Force: F = 100 N

delta l = F * l / E * A
delta l = 100 N * 100 mm / ( 3.64E3 N / mm2 * 10 mm * 10 mm ) = 0.02747 mm

The provided file in FreeCAD gives as max Displacement in x : 0.0318806 which is 16 % more than beam theory. Watch out for the outer Vertexes at the end. The nodes there "run" out. A finer mesh should give better results.
Zugstange.jpg
Zugstange.jpg (128.97 KiB) Viewed 2658 times
If a finer mesh is used (2mm) I get much much better results.
FreeCAD : max Displacement in x is 0.02812 mm which is only 2.4 % more than beam theory
Zugstange-finemesh.jpg
Zugstange-finemesh.jpg (166.36 KiB) Viewed 2658 times
attached the file. Hope that helps. Bernd

OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.15.4666 (Git)
Branch: releases/FreeCAD-0-15
Hash: be823acda289b9354226b3229d98ca0ac9352267
Python version: 2.7.8
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
Attachments
Zugstange-finemesh.FCStd
(193.7 KiB) Downloaded 47 times
ulrich1a
Posts: 1875
Joined: Sun Jul 07, 2013 12:08 pm

Re: cantilever beam by FemWB and CalculiX

Postby ulrich1a » Wed Mar 25, 2015 6:09 pm

bernd wrote: Hope that helps. Bernd
Thanks for reviewing my attempt. My problem is, I got a result with zero displacement. Calculix was called, but from a bConverged-installation.

I will compile an actual version and install ccx in the FreeCAD-binary-path and try again.
PrzemoF wrote:Is it possible for you to test something newer?
Yes, but takes a few days as I did not compile FreeCAD on Windows for a long time.

What revision/version of calculix is used for tests in FreeCAD-Windows?

Ulrich
User avatar
PrzemoF
Posts: 2649
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: cantilever beam by FemWB and CalculiX

Postby PrzemoF » Wed Mar 25, 2015 8:07 pm

Can you try to run calculix manually and test (or post here, for test) the results?
I was getting "results" (zero displacement) when FreeCAD was failing silently on reading and converting calculix command line output. That output is for information only and it doesn't affect the calculation results.

For me the problem was fixed with this commit:
https://github.com/FreeCAD/FreeCAD_sf_m ... a78f6b0144
User avatar
bernd
Posts: 8345
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: cantilever beam by FemWB and CalculiX

Postby bernd » Thu Mar 26, 2015 9:43 am

ulrich1a wrote:... Calculix was called, but from a bConverged-installation.
Ahh you trying to use the bConverged-binary of CalculiX. To use this binary I had to to change in

Code: Select all

FreeCAD.getHomePath() + 'Mod/Fem/MechanicalAnalysis.py'
the line

Code: Select all

self.CalculixBinary = FreeCAD.getHomePath() + 'bin/ccx.exe'
to the destination where the CalculiX-binary of bConverged is (in my case)

Code: Select all

self.CalculixBinary = 'C:/Program Files (x86)/bConverged/CalculiX/ccx/ccx.exe'
my bConverged has CalculiX version 2.7 With this binary I get the same results as with the one provided with FreeCAD 0.14
Zugstange --> max Displacement in x --> 0.0318806 mm
Zugstange-finemesh --> max Displacement in x --> 0.0281159 mm

If bConverged is installed SciTE should be installed too. This means if you klick in FreeCAD on Button "Edit Calculix Input File" the input file is opended in SciTE. There you invoke the Calculation with Tools --> solve
CGX shows for the Zugstange-finemesh a max displacement in x of 2.81e-002 mm = 0.0281 mm same as FreeCAD has.
screen.jpg
screen.jpg (411.66 KiB) Viewed 2582 times
ulrich1a wrote:... What revision/version of calculix is used for tests in FreeCAD-Windows?
With FreeCAD Windows Version 0.14 the following binary is distributed

CalculiX version 2.6.1
You are using an executable made on Sat Sep 7 17:25:03 EEST 2013

In FreeCAD Windwos 0.15 RC1 the CalculiX binary is missing but as stated earlier the one of 0.14 works too.

OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.15.4666 (Git)
Branch: releases/FreeCAD-0-15
Hash: be823acda289b9354226b3229d98ca0ac9352267
Python version: 2.7.8
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
cron