## beam analysis with beams in z-direction

About the development of the FEM module/workbench.

Moderator: bernd

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

### Re: beam analysis with beams in z-direction

FemUser wrote:
Mon Oct 16, 2017 5:18 pm
I learned that I have to quit FreeCAD and come back in for it to read the changed python file. I know this is a newbee thing! I took me a while to understand this. I wish there was a less painful way to test the code...

Code: Select all

``reload(FemInputWriterCcx)``
IMHO we should have one parameter at beam section objects which is a user input. Rotation around beam axis. I may have a look at the standard definition of beam rotation of the analysis software we have at work too.

bernd
FemUser
Posts: 133
Joined: Wed Aug 23, 2017 6:45 pm

### Re: beam analysis with beams in z-direction

Hei thats a big help! Was already desperate from closing and opening so many times free cad...
To the user it can be an angle no problem there. Internally we will need the 2D vector: section_nor. This is important since it will be apart of the algebra system of equations.

I was doing reload(Fem), that explain everything...
FemUser
Posts: 133
Joined: Wed Aug 23, 2017 6:45 pm

### Re: beam analysis with beams in z-direction

Bernd I can't seem to get my hands on the nodes for the beam elements. Where is this information? how can I access it? I tried with "self.femmesh" but can only see a short description not actually the lists.

Written on the file I can see there all the information I need:

Here are the elements and the nodes that form them

Code: Select all

``````** Edge elements
*Element, TYPE=B31, ELSET=Eedges
1, 1, 2
2, 3, 4
3, 1, 3
4, 5, 1
5, 6, 2
6, 2, 4
7, 5, 6
8, 7, 8
9, 8, 4
10, 6, 8
11, 7, 3
12, 5, 7``````
And here are the nodes:

Code: Select all

``````*Node, NSET=Nall
1, 0, 0, 10
2, 0, 10, 10
3, 10, 0, 10
4, 10, 10, 10
5, 0, 0, 0
6, 0, 10, 0
7, 10, 0, 0
8, 10, 10, 0``````
FemUser
Posts: 133
Joined: Wed Aug 23, 2017 6:45 pm

### Re: beam analysis with beams in z-direction

For the elements I am using

Code: Select all

``self.femelement_table = FemMeshTools.get_femelement_table(self.femmesh)``
and for the nodes:

Code: Select all

``self.femmesh.Nodes``
But I have to play with print functions to know what is happening with them. Is there any way I can access them directly on the console? I just wish I could see all the objects and play with the functions while in the python console window.
FemUser
Posts: 133
Joined: Wed Aug 23, 2017 6:45 pm

### Re: beam analysis with beams in z-direction

Made the changes, and working definitely without the elegance of the initial source . I Hammered the code...
The only thing required is an angle. For now this is only working for single beam (without defining a second beam or multiple selection). Also don't know what can happen if we mix beams with surfaces or solid bodies.
Attachments
FemInputWriterCcx.py
FemUser
Posts: 133
Joined: Wed Aug 23, 2017 6:45 pm

### Re: beam analysis with beams in z-direction

And here is the result with a bit of salt!
beam_normal_rotation_angle.jpg (95.66 KiB) Viewed 497 times
The algorithm isn't working properly since only some bars rotate 45º and other do not. Also when I define 180º rotation I get an error but don't understand why.
FemUser
Posts: 133
Joined: Wed Aug 23, 2017 6:45 pm

### Re: beam analysis with beams in z-direction

I think I solved it. Will test later at night. Here is the resultant change in attach.
Attachments
FemInputWriterCcx.py
FemUser
Posts: 133
Joined: Wed Aug 23, 2017 6:45 pm

### Re: beam analysis with beams in z-direction

Here are the first results for single beam type with same material.
0º rotation
pic1.jpeg (30.65 KiB) Viewed 469 times
and 45º rotation
pic2.jpeg (30.46 KiB) Viewed 469 times
bernd
Posts: 10523
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

### Re: beam analysis with beams in z-direction

@FemUser: Looks good. I need to have a closer look at this, but there is pretty much going on here on FEM ATM ...

Do you know github? Have you ever used it? The best way to present changes on FreeCAD code is to use git and github and post a link to your github.

Bernd
FemUser
Posts: 133
Joined: Wed Aug 23, 2017 6:45 pm

### Re: beam analysis with beams in z-direction

Never used it. Will take a look. Meanwhile the results so far:
pic1.jpg (68.23 KiB) Viewed 446 times
pic2.jpg (109.26 KiB) Viewed 446 times
pic3.jpg (107.67 KiB) Viewed 446 times
pic4.jpg (105.23 KiB) Viewed 446 times