beam analysis with beams in z-direction

About the development of the FEM module/workbench.

Moderator: bernd

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

Re: beam analysis with beams in z-direction

Postby bernd » Tue Oct 17, 2017 5:14 am

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...
explizit reloading should work without restart of FreeCAD

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
User avatar
FemUser
Posts: 133
Joined: Wed Aug 23, 2017 6:45 pm

Re: beam analysis with beams in z-direction

Postby FemUser » Tue Oct 17, 2017 6:53 am

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...
User avatar
FemUser
Posts: 133
Joined: Wed Aug 23, 2017 6:45 pm

Re: beam analysis with beams in z-direction

Postby FemUser » Tue Oct 17, 2017 10:35 am

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
User avatar
FemUser
Posts: 133
Joined: Wed Aug 23, 2017 6:45 pm

Re: beam analysis with beams in z-direction

Postby FemUser » Tue Oct 17, 2017 4:28 pm

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.
User avatar
FemUser
Posts: 133
Joined: Wed Aug 23, 2017 6:45 pm

Re: beam analysis with beams in z-direction

Postby FemUser » Tue Oct 17, 2017 5:40 pm

Made the changes, and working definitely without the elegance of the initial source :o . I Hammered the code... :twisted:
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
(78.81 KiB) Downloaded 12 times
User avatar
FemUser
Posts: 133
Joined: Wed Aug 23, 2017 6:45 pm

Re: beam analysis with beams in z-direction

Postby FemUser » Tue Oct 17, 2017 6:38 pm

And here is the result with a bit of salt!
beam_normal_rotation_angle.jpg
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.
User avatar
FemUser
Posts: 133
Joined: Wed Aug 23, 2017 6:45 pm

Re: beam analysis with beams in z-direction

Postby FemUser » Wed Oct 18, 2017 11:13 am

I think I solved it. Will test later at night. Here is the resultant change in attach. :)
Attachments
FemInputWriterCcx.py
(79.66 KiB) Downloaded 13 times
User avatar
FemUser
Posts: 133
Joined: Wed Aug 23, 2017 6:45 pm

Re: beam analysis with beams in z-direction

Postby FemUser » Wed Oct 18, 2017 2:59 pm

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

Re: beam analysis with beams in z-direction

Postby bernd » Wed Oct 18, 2017 3:11 pm

@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
User avatar
FemUser
Posts: 133
Joined: Wed Aug 23, 2017 6:45 pm

Re: beam analysis with beams in z-direction

Postby FemUser » Wed Oct 18, 2017 6:48 pm

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