add new function to fem module

About the development of the FEM module/workbench.

Moderator: bernd

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

Re: add new function to fem module

Post by bernd »

wow cool! We should definately add this to the examples.
RatonLaveur
Posts: 991
Joined: Wed Mar 27, 2019 10:45 am

Re: add new function to fem module

Post by RatonLaveur »

Regarding the buckling case shown last, might I suggest to lock the end supporting the force in X&Y, this way instead of a full "free end" deflection we see actual buckling?
twangrt
Posts: 40
Joined: Sun Apr 28, 2019 6:34 pm

Re: add new function to fem module

Post by twangrt »

bernd wrote: Fri Mar 19, 2021 2:04 pm wow cool! We should definately add this to the examples.
Ok, then I will add this as well.

I found out what was causing the small difference in results. In the verification example the load are divided equal between all the top nodes, not regarding to the influenced area of the load.

Calculix verification example beam8b.inp

Code: Select all

*NSET,NSET=LAST
    65,  
    66,  
    67,  
    68,  
   101,  
   102,  
   135,  
   136,  
   169,  
   170,  
   203,  
   204,  
   221,  
   238,  
   255,  
   288,  
   289,  
   306,  
   323,  
   340,  
   373,  
   374,  
   391,  
   408,  
   425,  
*STEP
*BUCKLE
10,0.01
*CLOAD
LAST,3,-0.84
FreeCAD generated beam8b.inp

Code: Select all

***********************************************************
** constraints force node loads
** written by write_constraints_force function
*CLOAD
** ConstraintForce
** node loads on shape: Box:Face6
65,3,-3.2812500000000E-01
66,3,-6.5625000000000E-01
67,3,-6.5625000000000E-01
68,3,-1.3125000000000E+00
101,3,-6.5625000000000E-01
102,3,-1.3125000000000E+00
135,3,-6.5625000000000E-01
136,3,-1.3125000000000E+00
169,3,-3.2812500000000E-01
170,3,-6.5625000000000E-01
203,3,-6.5625000000000E-01
204,3,-1.3125000000000E+00
221,3,-1.3125000000000E+00
238,3,-1.3125000000000E+00
255,3,-6.5625000000000E-01
288,3,-6.5625000000000E-01
289,3,-1.3125000000000E+00
306,3,-1.3125000000000E+00
323,3,-1.3125000000000E+00
340,3,-6.5625000000000E-01
373,3,-3.2812500000000E-01
374,3,-6.5625000000000E-01
391,3,-6.5625000000000E-01
408,3,-6.5625000000000E-01
425,3,-3.2812500000000E-01
[code]
twangrt
Posts: 40
Joined: Sun Apr 28, 2019 6:34 pm

Re: add new function to fem module

Post by twangrt »

RatonLaveur wrote: Fri Mar 19, 2021 2:22 pm Regarding the buckling case shown last, might I suggest to lock the end supporting the force in X&Y, this way instead of a full "free end" deflection we see actual buckling?
The main goal with that example is to verify that the input file that are generated from FreeCAD match with the verification example from Calculix.

Boring, I know. But still it qualify as actual buckling :D
twangrt
Posts: 40
Joined: Sun Apr 28, 2019 6:34 pm

Re: add new function to fem module

Post by twangrt »

I'm trying to semi-grasp the unit test without reading all the code. Can someone explain to me how it works?

I'm looking at this: https://github.com/FreeCAD/FreeCAD/comm ... 77ec8afd06

It compares the inp file when compiling?
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: add new function to fem module

Post by bernd »

twangrt wrote: Tue Mar 30, 2021 7:28 am I'm trying to semi-grasp the unit test without reading all the code. Can someone explain to me how it works?

I'm looking at this: https://github.com/FreeCAD/FreeCAD/comm ... 77ec8afd06

It compares the inp file when compiling?
no it does not. This file was mady by me to very easy compile FreeCAD and run a specific unit test manually because a complete unit test run of FreeCAD could take some minutes. It is not used at all from FreeCAD itself. If I need to compile FreeCAD and run a spcific unit test or unit test class I only need to copy the command from this file into my bash and wait a few seconds. 8-)
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: add new function to fem module

Post by bernd »

But you are correct. The unit test wors the way you foud yourself. The inp file written by the unit test is compared with a inp file saved in unit test case data directory for calculix test cases. See https://github.com/FreeCAD/FreeCAD/tree ... a/calculix
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: add new function to fem module

Post by bernd »

BTW: The file test_commands.sh is created by Python because I am lazy. Sudhanshu did add the lines manually since he did not know how to create the file by Python. If only one test is added this might even be faster than update the file by Python. https://github.com/FreeCAD/FreeCAD/blob ... ls.py#L103
twangrt
Posts: 40
Joined: Sun Apr 28, 2019 6:34 pm

Re: add new function to fem module

Post by twangrt »

bernd wrote: Tue Mar 30, 2021 11:32 am BTW: The file test_commands.sh is created by Python because I am lazy. Sudhanshu did add the lines manually since he did not know how to create the file by Python. If only one test is added this might even be faster than update the file by Python. https://github.com/FreeCAD/FreeCAD/blob ... ls.py#L103
I added it manually. Seemed like the easiest way for me.

I'm having second thoughts about the LTB example. I think the example is good, but it would be great to find another verification example, maybe it don't need to be an example from Calculix?
twangrt
Posts: 40
Joined: Sun Apr 28, 2019 6:34 pm

Re: add new function to fem module

Post by twangrt »

Now I have updated my lateral torsional buckling example. Hopefully fixed all the CMake/compiling stuff that went wrong in my earlier commits.

To simplify everything the example builds on a verification example from another FEA program.
Example 3.3 in: http://download.strusoft.com/FEM-Design ... amples.pdf

With the current mesh it's within 5% of the example. With more refined mesh(double the current size of the meshpy file) I'm able to get under 3% difference. To note, it that the mesh already is quite big for an example file.

Bernd, have you had time to check anything? I've been struggling a bit with the tests/compiling but I think I've almost got it :D

Im thinking of trying to fix the name of the returned result files(importCcxFrdResults.py). When calculating with 'buckling' the result is now displayed as 'Time'.

But I have not figured out a specific way to tell that a '.frd' is a buckling analysis result file. My now best bet is to read in the '.dat' file for determining the resultfile.
Post Reply