Generate a truss and analysis with frame3DD

Show off your FreeCAD projects here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
johnwang
Veteran
Posts: 1382
Joined: Sun Jan 27, 2019 12:41 am

Generate a truss and analysis with frame3DD

Post by johnwang »

Given Span, Pitch angle and a max member length to generate a truss. A Frame3DD input file is generated at the same time. At the moment, only a point load at a fixed node is applied.

Referenced this post: https://forum.freecadweb.org/viewtopic. ... t=frame3dd

Input:
t1.jpg
t1.jpg (21.84 KiB) Viewed 4763 times


Result:
t2.jpg
t2.jpg (103.64 KiB) Viewed 4763 times


OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18778 (Git)
Build type: Release
Branch: master
Hash: f55cf3ef103532c9718c108bd856a4ef06ad49a5
Python version: 3.6.7
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Last edited by johnwang on Thu Feb 20, 2020 5:02 am, edited 1 time in total.
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Generate a truss

Post by bernd »

cool, Would you share the code as well? Do you regularly use Frame3DD? If yes we could add it as a real FEM solver!
User avatar
johnwang
Veteran
Posts: 1382
Joined: Sun Jan 27, 2019 12:41 am

Re: Generate a truss

Post by johnwang »

bernd wrote: Sat Feb 15, 2020 11:56 am cool, Would you share the code as well? Do you regularly use Frame3DD? If yes we could add it as a real FEM solver!
The answer is no. I haven't use Frame3DD before. Just testing.
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Generate a truss

Post by vocx »

bernd wrote: Sat Feb 15, 2020 11:56 am cool, Would you share the code as well? Do you regularly use Frame3DD? If yes we could add it as a real FEM solver!
I remember this other thread, 2D structures basic calculations. It never got much attention.

https://anastruct.readthedocs.io/en/lat ... arted.html
anaStruct wrote: anaStruct is a Python implementation of the 2D Finite Element method for structures. It allows you to do structural analysis of frames and frames. It helps you to compute the forces and displacements in the structural elements.

Besides linear calculations, there is also support for non-linear nodes and geometric non linearity.
Also this thread, Solving Beam Bending with SymPy.

Maybe these could be implemented as solvers in FEM?
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
johnwang
Veteran
Posts: 1382
Joined: Sun Jan 27, 2019 12:41 am

Re: Generate a truss

Post by johnwang »

PointLoads added at two nodes in program, not interactively yet.

frame3dd.exe saved under freecad/bin folde. The generated frame3dd input case file also saved there.
t3.jpg
t3.jpg (308.24 KiB) Viewed 4446 times
Last edited by johnwang on Thu Feb 20, 2020 4:59 am, edited 1 time in total.
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
User avatar
johnwang
Veteran
Posts: 1382
Joined: Sun Jan 27, 2019 12:41 am

Re: Generate a truss

Post by johnwang »

After runing frame3dd, it genearets gmsh pos files which shows the orginal truss and deflection under each load case. This example only defined one load case.
These pos files could be viewed with gmsh.
t4.jpg
t4.jpg (172.59 KiB) Viewed 4443 times
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Generate a truss and analysis with frame3DD

Post by bernd »

Depending what kind of obj this is in gmsh you export the objects from gmsh into unv (mesh) or brep (geometry). Both formats could be opened in FreeCAD. I am curious if this works.

bernd
User avatar
johnwang
Veteran
Posts: 1382
Joined: Sun Jan 27, 2019 12:41 am

Re: Generate a truss and analysis with frame3DD

Post by johnwang »

bernd wrote: Thu Feb 20, 2020 11:29 am Depending what kind of obj this is in gmsh you export the objects from gmsh into unv (mesh) or brep (geometry). Both formats could be opened in FreeCAD. I am curious if this works.

bernd
The POS ASCII file is Gmsh’s old native post-processing format. Maybe I should let Frame3DD output in the current MSH file format. Does FreeCad's FEA can show MSH file directly?

chakkree's code can reads Frame3DD's 3DD file and show the mesh in FreeCAD. It's easy to add to show more variable values.

I am interested if FreeCad's FEA can provide its own post-processing format, so people who write their own FEA solver could output in that format and quickly view their result with FreeCAD.
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Generate a truss and analysis with frame3DD

Post by bernd »

there is a generic postprocessing format already, vtk. FreeCAD FEM supports this format. If a solver would suport vtk the output is suported by FreeCAD FEM out of the box. Otherwise one would need to write a parser for the output format of the solver. This was done for Calculix and z88 output formats in FreeCAD FEM.


https://github.com/FreeCAD/FreeCAD/blob ... Results.py

https://github.com/FreeCAD/FreeCAD/blob ... Results.py
User avatar
johnwang
Veteran
Posts: 1382
Joined: Sun Jan 27, 2019 12:41 am

Re: Generate a truss and analysis with frame3DD

Post by johnwang »

Read in result file and draw the mesh and dispalcement with two fem::femmesh objects.
t5.jpg
t5.jpg (42.33 KiB) Viewed 3921 times
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
Post Reply