beam analysis with beams in z-direction

About the development of the FEM module/workbench.

Moderator: bernd

UR_
Veteran
Posts: 1354
Joined: Tue Jan 03, 2017 8:42 pm

Re: beam analysis with beams in z-direction

Post by UR_ »

Here we have a nice circle shaped beam.
So we have only one shape accessible for "Beam Section Parameter" input box to assign a cross section.

Screenshot CircleBeam-13mm charac Lmin.png
Screenshot CircleBeam-13mm charac Lmin.png (20.65 KiB) Viewed 1781 times

Every is fine, because there is no element properly aligned to z axis.

Now we change "characteristic length min" to 12 mm and we get a single beam element aligned to z axis.
But we have no chance to assign another cross section and therefore we get an error message from ccx.

Screenshot CircleBeam-12mm charac Lmin.png
Screenshot CircleBeam-12mm charac Lmin.png (10.95 KiB) Viewed 1781 times
Last edited by UR_ on Sat Oct 14, 2017 3:43 pm, edited 1 time in total.
User avatar
FemUser
Posts: 134
Joined: Wed Aug 23, 2017 6:45 pm

Re: beam analysis with beams in z-direction

Post by FemUser »

The bug gets fixed with the python script and looking at the image it is rotating 45º consistently. The good part of the script is that we can control rotation of the beam.

ni(-(a2+a3)/a1),1,1)

The two 1's control rotation about the two perpendicular axis. if 0,1 or 1,0 we get alignment to each normal axis. We could graphically control the normals this way with no problem, coordinate wise however I don't know much about how to actually modify the GUI but Bernd certainly knows.
User avatar
FemUser
Posts: 134
Joined: Wed Aug 23, 2017 6:45 pm

Re: beam analysis with beams in z-direction

Post by FemUser »

UR_ When I wrote the previous post I didn't see your post.
thschrader
Veteran
Posts: 3129
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: beam analysis with beams in z-direction

Post by thschrader »

fandaL wrote: Sat Oct 14, 2017 7:36 am imho: If you rotate rectangular cross section you get globally different quadratic moments so that (on detailed level) it is different model and that's why I think that orientations of beams are quite important and "responsible" user :geek: should take care about them.
...
In the future It would be cool to display cross sections in the model with orientations and offsets.
Definition of beam axis/orientation in my comercial 3D-program. Taken from (text in german):
http://www.pcae.de/main/download/handbu ... ndbuch.pdf
For easy checking beam orientation there is a rendering module in the program.
beamCoordinateSystem.JPG
beamCoordinateSystem.JPG (66.33 KiB) Viewed 1748 times
render.JPG
render.JPG (17.17 KiB) Viewed 1748 times
User avatar
FemUser
Posts: 134
Joined: Wed Aug 23, 2017 6:45 pm

Re: beam analysis with beams in z-direction

Post by FemUser »

Nice... thschrader I was wondering how things should look like but now it is clear. We aren't that far. And picking your figure makes clear we need to add another variable to the Beasec_obj -> my suggestion is add Section_nor which will hold the axis (n1,n2) see my previous post to know what is n1 and n2.
Schematics.JPG
Schematics.JPG (309.54 KiB) Viewed 1742 times
When we in the GUI have one elementgeometry1D icon this is generated:

Code: Select all

** Element sets for materials and FEM element type (solid, shell, beam, fluid)
** written by write_element_sets_material_and_femelement_type function
*ELSET,ELSET=Mat0Beam0
Eedges

** Sections
** written by write_femelementsets function
*BEAM SECTION, ELSET=Mat0Beam0, MATERIAL=SolidMaterial, SECTION=RECT
2 , 1 
When we in the GUI have one elementgeometry1D icon and another icon with a defined edge inside this is generated:

Code: Select all

** Element sets for materials and FEM element type (solid, shell, beam, fluid)
** written by write_element_sets_material_and_femelement_type function
*ELSET,ELSET=Mat0Beam0
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
*ELSET,ELSET=Mat0Beam1
12,


***********************************************************
** Sections
** written by write_femelementsets function
*BEAM SECTION, ELSET=Mat0Beam0, MATERIAL=SolidMaterial, SECTION=RECT
2 , 1 
*BEAM SECTION, ELSET=Mat0Beam1, MATERIAL=SolidMaterial, SECTION=RECT
25 , 10 
I can't seem to figure out how to instead of Eedges to write the full list like is done for the multiple case, when we generate each beam we calculate its normal. When we make a individual beam these are separated from the general list and we can specify for that case only its normal. So it looks we can make the beam engine work as requested.

Now on the programming I am lost as one can be :) still figuring out how the program works.
I think these are important but am a bit lost...
get_ccx_elsets_single_mat_single_beam(self)
get_ccx_elsets_single_mat_multiple_beam(self)

Also I can't find the main object definition
beamsec_obj where the beam attributes should be.
User avatar
FemUser
Posts: 134
Joined: Wed Aug 23, 2017 6:45 pm

Re: beam analysis with beams in z-direction

Post by FemUser »

My first set objective is to create all normals from the default case (the case where we don't wish to define everything). If we want to control individually each beam axis we need to individually create a beam element and maybe there we can specify the normal for each set.

For the default case I think I need to change the behaviour to not create the "Eedges" field.

Code: Select all

def get_ccx_elsets_multiple_mat_single_beam(self):
        beamsec_obj = self.beamsection_objects[0]['Object']
        for mat_data in self.material_objects:
            mat_obj = mat_data['Object']
            ccx_elset = {}
            ccx_elset['beamsection_obj'] = beamsec_obj
            ccx_elset['ccx_elset'] = mat_data['FEMElements']
            ccx_elset['ccx_elset_name'] = get_ccx_elset_beam_name(mat_obj.Name, beamsec_obj.Name, mat_data['ShortName'])
            ccx_elset['mat_obj_name'] = mat_obj.Name
            ccx_elset['ccx_mat_name'] = mat_obj.Material['Name']
            self.ccx_elsets.append(ccx_elset)
But I don't seem to see the Eedges field.
I noticed that the multi case is different:

Code: Select all

    def get_ccx_elsets_multiple_mat_multiple_beam(self):
        for beamsec_data in self.beamsection_objects:
            beamsec_obj = beamsec_data['Object']
            for mat_data in self.material_objects:
                mat_obj = mat_data['Object']
                ccx_elset = {}
                ccx_elset['beamsection_obj'] = beamsec_obj
                elemids = []
                for elemid in beamsec_data['FEMElements']:
                    if elemid in mat_data['FEMElements']:
                        elemids.append(elemid)
                ccx_elset['ccx_elset'] = elemids
                ccx_elset['ccx_elset_name'] = get_ccx_elset_beam_name(mat_obj.Name, beamsec_obj.Name, mat_data['ShortName'], beamsec_data['ShortName'])
                ccx_elset['mat_obj_name'] = mat_obj.Name
                ccx_elset['ccx_mat_name'] = mat_obj.Material['Name']
                self.ccx_elsets.append(ccx_elset)
User avatar
FemUser
Posts: 134
Joined: Wed Aug 23, 2017 6:45 pm

Re: beam analysis with beams in z-direction

Post by FemUser »

The final result I am looking for is the following:

Code: Select all

** Element sets for materials and FEM element type (solid, shell, beam, fluid)
** written by write_element_sets_material_and_femelement_type function
*ELSET,ELSET=Mat0Beam0
1,
*ELSET,ELSET=Mat0Beam1
2,
*ELSET,ELSET=Mat0Beam2
3,
*ELSET,ELSET=Mat0Beam3
4,
*ELSET,ELSET=Mat0Beam4
5,
*ELSET,ELSET=Mat0Beam5
6,
*ELSET,ELSET=Mat0Beam6
7,
*ELSET,ELSET=Mat0Beam7
8,
*ELSET,ELSET=Mat0Beam8
9,
*ELSET,ELSET=Mat0Beam9
10,
*ELSET,ELSET=Mat0Beam10
11,
*ELSET,ELSET=Mat0Beam11
12,


***********************************************************
** Sections
** written by write_femelementsets function
*BEAM SECTION, ELSET=Mat0Beam0, MATERIAL=SolidMaterial, SECTION=RECT
2 , 1 
0,n11,n12
*BEAM SECTION, ELSET=Mat0Beam1, MATERIAL=SolidMaterial, SECTION=RECT
2 , 1
0,n21,n22
*BEAM SECTION, ELSET=Mat0Beam2, MATERIAL=SolidMaterial, SECTION=RECT
2 , 1
0,n31,n32
*BEAM SECTION, ELSET=Mat0Beam3, MATERIAL=SolidMaterial, SECTION=RECT
2 , 1 
0,n41,n42
*BEAM SECTION, ELSET=Mat0Beam4, MATERIAL=SolidMaterial, SECTION=RECT
2 , 1 
0,n51,n52
*BEAM SECTION, ELSET=Mat0Beam5, MATERIAL=SolidMaterial, SECTION=RECT
2 , 1 
0,n61,n62
*BEAM SECTION, ELSET=Mat0Beam6, MATERIAL=SolidMaterial, SECTION=RECT
2 , 1 
0,n71,n72
*BEAM SECTION, ELSET=Mat0Beam7, MATERIAL=SolidMaterial, SECTION=RECT
2 , 1 
0,n81,n82
*BEAM SECTION, ELSET=Mat0Beam8, MATERIAL=SolidMaterial, SECTION=RECT
2 , 1 
0,n91,n92
*BEAM SECTION, ELSET=Mat0Beam9, MATERIAL=SolidMaterial, SECTION=RECT
2 , 1 
0,n101,n102
*BEAM SECTION, ELSET=Mat0Beam10, MATERIAL=SolidMaterial, SECTION=RECT
2 , 1 
0,n111,n112
*BEAM SECTION, ELSET=Mat0Beam11, MATERIAL=SolidMaterial, SECTION=RECT
2 , 1 
0,n121,n122
the normal vector changes as calculated from 0,n1,n2 to n1,0,n2 to n1,n2,0 depending on the orientation of the bar this will be calculated.
n1....n121 is replaced by calculated values.
User avatar
FemUser
Posts: 134
Joined: Wed Aug 23, 2017 6:45 pm

Re: beam analysis with beams in z-direction

Post by FemUser »

I am having a hard time debugging. I noticed that there is a FEM folder with .py and .pyc files that make the fem module, however when I attempt to change them nothing happens. I took all py files placed into a folder and still could generate a inp file in calculix menu. So how can see the change effects when I change the py file? Do I have to compile the whole program? I think not but I must be doing something wrong.
User avatar
FemUser
Posts: 134
Joined: Wed Aug 23, 2017 6:45 pm

Re: beam analysis with beams in z-direction

Post by FemUser »

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

Re: beam analysis with beams in z-direction

Post by FemUser »

A bit hammered but the following code in the case we have only one beam element type

Code: Select all

   def get_ccx_elsets_single_mat_single_beam_edit(self):
	beam_elm_count= len(self.beamsection_objects[0]['FEMElements'])
	for i in range (0, beam_elm_count):
        	mat_obj = self.material_objects[0]['Object']
        	beamsec_obj = self.beamsection_objects[0]['Object']
        	ccx_elset = {}
        	ccx_elset['beamsection_obj'] = beamsec_obj
		ccx_elset['ccx_elset'] = [self.beamsection_objects[0]['FEMElements'][i]]
        	ccx_elset['ccx_elset_name'] = get_ccx_elset_beam_name(mat_obj.Name, beamsec_obj.Name)
        	ccx_elset['mat_obj_name'] = mat_obj.Name
        	ccx_elset['ccx_mat_name'] = mat_obj.Material['Name']
        	self.ccx_elsets.append(ccx_elset)
This will produce on the cube test subject the following:

Code: Select all

***********************************************************
** Element sets for materials and FEM element type (solid, shell, beam, fluid)
** written by write_element_sets_material_and_femelement_type function
*ELSET,ELSET=Mat0Beam0
1,
*ELSET,ELSET=Mat0Beam0
2,
*ELSET,ELSET=Mat0Beam0
3,
*ELSET,ELSET=Mat0Beam0
4,
*ELSET,ELSET=Mat0Beam0
5,
*ELSET,ELSET=Mat0Beam0
6,
*ELSET,ELSET=Mat0Beam0
7,
*ELSET,ELSET=Mat0Beam0
8,
*ELSET,ELSET=Mat0Beam0
9,
*ELSET,ELSET=Mat0Beam0
10,
*ELSET,ELSET=Mat0Beam0
11,
*ELSET,ELSET=Mat0Beam0
12,
Post Reply