Generate a truss and analysis with frame3DD

Show off your FreeCAD projects here!
johnwang
Posts: 117
Joined: Sun Jan 27, 2019 12:41 am

Generate a truss and analysis with frame3DD

Postby johnwang » Sat Feb 15, 2020 10:39 am

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 1354 times


Result:
t2.jpg
t2.jpg (103.64 KiB) Viewed 1354 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.
User avatar
bernd
Posts: 9311
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Generate a truss

Postby bernd » 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!
johnwang
Posts: 117
Joined: Sun Jan 27, 2019 12:41 am

Re: Generate a truss

Postby johnwang » Mon Feb 17, 2020 4:23 am

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.
vocx
Posts: 3341
Joined: Thu Oct 18, 2018 9:18 pm

Re: Generate a truss

Postby vocx » Mon Feb 17, 2020 5:24 am

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.
To support the documentation effort, and code development, your donation is appreciated: paypal.
johnwang
Posts: 117
Joined: Sun Jan 27, 2019 12:41 am

Re: Generate a truss

Postby johnwang » Thu Feb 20, 2020 4:49 am

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 1035 times
Last edited by johnwang on Thu Feb 20, 2020 4:59 am, edited 1 time in total.
johnwang
Posts: 117
Joined: Sun Jan 27, 2019 12:41 am

Re: Generate a truss

Postby johnwang » Thu Feb 20, 2020 4:56 am

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 1032 times
User avatar
bernd
Posts: 9311
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Generate a truss and analysis with frame3DD

Postby bernd » 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
johnwang
Posts: 117
Joined: Sun Jan 27, 2019 12:41 am

Re: Generate a truss and analysis with frame3DD

Postby johnwang » Thu Feb 20, 2020 10:18 pm

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.
User avatar
bernd
Posts: 9311
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Generate a truss and analysis with frame3DD

Postby bernd » Sat Feb 22, 2020 4:38 pm

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
johnwang
Posts: 117
Joined: Sun Jan 27, 2019 12:41 am

Re: Generate a truss and analysis with frame3DD

Postby johnwang » Wed Feb 26, 2020 9:53 pm

Read in result file and draw the mesh and dispalcement with two fem::femmesh objects.
t5.jpg
t5.jpg (42.33 KiB) Viewed 510 times