Difference between revisions of "Contrib:KeesWouters/beam/macropoutre"

From CAELinuxWiki
Jump to: navigation, search
m ('''Using the results inside the command file - II''')
('''Using the results inside the command file - II''')
Line 204: Line 204:
 
|-
 
|-
 
! commands to generate tables
 
! commands to generate tables
 +
|
 +
empty
 
|-
 
|-
 
|
 
|
  {'IYR2'
+
'IYR2'
 
  'EZ'
 
  'EZ'
 
  'IXY_G'
 
  'IXY_G'
Line 228: Line 230:
 
  'IY_G'
 
  'IY_G'
 
  'IXY_G_M'
 
  'IXY_G_M'
|-
 
 
|
 
|
 
  'KZ'
 
  'KZ'

Revision as of 13:44, 31 March 2011

back to my main page:
Contrib:KeesWouters
Back to: Use of beam elements
Contrib:KeesWouters/beam

Software compatibility

march 2011 - SalomeMeca 2010 (Code Aster 10.2) - Ubuntu Meerkat 10.10 64bits.

Using the macro MACR_CARA_POUTRE to define cross section quanties of a beam

This is just another simple example of the use of beams for static calculations. The main focus is on varying obtaining the cross section quantities of the beam by using the macro MACR_CARA_POUTRE. Based on a 2D mesh of the cross section of the beam, most of the required quantities for beam analysis are derived. Here (Contrib:KeesWouters/beam/orientation) an equivalent analysis has been carried out based on a rectangular beam cross section. Here we use an L shaped cross section. Length of the beam is 1.41 [m].

Geometry, mesh, material properties and loads

We need to define two meshes now: one for the cross section of the beam and one for the configuration of the beams. The configuration of the beams: this mesh consists of about thirty beam elements distributed along the x axis.
Note that this has the curious effect that the coordinates of the nodes are defined by a single coordinate. A mesh along the y axis yields a 2D coordinate (x equal to zero). No prices for further guessing.
I decided to read the configuration mesh from unit 20, defined by ASTK:

#Read MED mesh file
BeamMesh=LIRE_MAILLAGE(UNITE=20,
                       FORMAT='MED',
                       NOM_MED='Mbeam1',
                       INFO_MED=2,
                       INFO=2,);

In the picture below the configuration mesh is shown.

Kw beamnodes.png

The boundary conditions are: fully clamped at x = 0, free at the opposite end. The load consist of a shear force of 1 [N] in y direction at the end node:

#Define boundary conditions
BndCnd=AFFE_CHAR_MECA(MODELE=BeamMod,
                     DDL_IMPO=(_F(GROUP_NO='P1',DX=0.0, DY=0.0, DZ=0.0,
                                  DRX=0.0,DRY=0.0,DRZ=0.0,),),
                     FORCE_NODALE=_F(GROUP_NO='P2',FX=0.0,FY=1.0,FZ=0.0),);

The cross section of the L shaped beam is read from unit 21, also defined by ASTK:

XL=LIRE_MAILLAGE(UNITE=21,
                       FORMAT='MED',
                       NOM_MED='AMesh',
                       INFO_MED=2,
                       INFO=2,);
Kw beam xsection.png

Remark:

  • the coordinate system is oxy for the definition of the cross section. The local coordinate system of a beam is: x axis equal to the axial axis of the beam and the y and z axes are defined by VECTEUR.

Using the macro MACR_CARA_POUTRE

As seen previously, the cross section of the L shaped beam is read from unit 21:

XL=LIRE_MAILLAGE(UNITE=21,
                       FORMAT='MED',
                       NOM_MED='AMesh',
                       INFO_MED=2,
                       INFO=2,);

The result structure XL is used by the macro MACR_CARA_POUTRE to retrieve the cross section quantities of it:

Bsection=MACR_CARA_POUTRE(MAILLAGE=XL,
                         INFO=2,
                         ORIG_INER=(0.0,0.0),);

The result Bsection is an Aster (table Bsection:<table_sdaster(7f166f039810,'Bsection')> with the geometrical quantities of the cross section. The table can be written to a file to be examined:

IMPR_TABLE(TABLE=Bsection,
           FORMAT='TABLEAU',
           UNITE=26, 
           SEPARATEUR=' * ',
           TITRE='xsection of L-beam');

The result:

#
# -------------------------------------------------------------------------#
#xsection of L-beam
#ASTER 10.02.00 CONCEPT Bsection CALCULE LE 26/03/2011 A 15:57:43 DE  TYPE
#TABLE_SDASTER
* LIEU         * ENTITE       * AIRE_M       * CDG_X_M      * CDG_Y_M      
* IX_G_M       * IY_G_M       * IXY_G_M      * Y_MAX        * Z_MAX       
* Y_MIN        * Z_MIN        * R_MAX        * AIRE         * CDG_X       
* CDG_Y        * IX_G         * IY_G         * IXY_G        * IY_PRIN_G   
* IZ_PRIN_G    * ALPHA        * X_P          * Y_P          * IX_P        
* IY_P         * IXY_P        * IXR2         * IYR2         * IYR2_PRIN_G 
* IZR2_PRIN_G  * IXR2_P       * IYR2_P       * MAILLAGE
* .... list of Nones (with index 1, next usefull quantities have index 2)
* .9000014
* .9000014     * TOUT         *  1.54334E-03 *  1.14339E-02 *  3.95862E-02 
*  1.53931E-06 *  2.14464E-07 * -2.96934E-07 *  6.14691E-02 *  1.94603E-02
* -4.67767E-02 * -3.03799E-02 *  6.14862E-02 *  1.54334E-03 *  1.14339E-02
*  3.95862E-02 *  1.53931E-06 *  2.14464E-07 * -2.96934E-07 *  1.50958E-07
*  1.60282E-06 *  1.02072E+02 *  0.00000E+00 *  0.00000E+00 *  3.95783E-06
*  4.16232E-07 *  4.01622E-07 *  1.10571E-08 *  6.24183E-09 * -8.41633E-09
*  9.50713E-09 *  2.99290E-07 *  3.76498E-08 * -  

Now suppose you need the area of the cross section AIRE/AIRE_M. This is the third entry (and equal to entry 14 AIRE) of the table. The numerical value is 1.54334E-03 [mm2].
Other interesting quantities are:

  • CDG_X_M and CDG_X_M:
    • centre of gravity CoG/CDG in x and y direction
  • Y_MIN/MAX and Z_MIN/Max:
    • minimum and maximum distance from CDG in the main coordinate system 0YZ. The origin coincides with CoG/CDG and is rotated by alpha
  • ALPHA:
    • rotation (in [deg]) from global x axis of the mesh to local Y axis of the main coordinate system. In this case alpha = 102 [deg], see also second picture.
  • IY_PRIN_G and IZ_PRIN_G:
    • Second moment of inertia

For normal static analysis we only need the torsion stiffness CT of the beam. This is not provided by the table.

Using the results inside the command file - I

Having these geometrical quantities print in to a file is nice, having directly access by a Python command is much nicer. You can eg define:

alpha  = Bsection['ALPHA',      2] = 1.02072E+02
Iyy    = Bsection['IY_PRIN_G',  2] = 1.50958E-07 
Izz    = Bsection['IZ_PRIN_G',  2] = 1.60282E-06 
Area   = Bsection['AIRE_M',     2] = 1.54334E-03
CoGX   = Bsection['CDG_X',      2] = 1.14339E-02 
CoGY   = Bsection['CDG_Y',      2] = 3.95862E-02
IyR20  = Bsection['IYR2_PRIN_G',2] =-8.41633E-09
IzR20  = Bsection['IZR2_PRIN_G',2] = 9.50713E-09

print 'alpha0: etc: ',alpha,Iyy,Izz,Area,CoGx,CoGy,IxR20,IyR20

A few remarks:

  • index 2 is used because the first index is normally filled with None
  • depending on the quantity, the reference coordinate system maybe: [O,X,Y][CoG,X,Y] and [CoG,Yp,Zp]. You need to interpreted the results accordingly.
  • the first index is the name also found in the table output
  • a number of values is None. For example the torsion stiffness 'CT' is None and thus has not been computed by the macro.
  • the values IY_PRIN_G and IZ_PRIN_G are computed with respect to the axes [CoG, Yp, Yz]. The coordinates of CoG are CoGX and CoGY (wrt OXY) and the angle alpha = 102 deg is measured between the axis Xcog of [CoG, Xcog, Ycog] and the axis Yp of [CoG, Yp, Zp], see the figure below.
Kw crosssection axes.png

Using the results inside the command file - II

It is also possible to define a Python variable that extracts the data from the Bsection table.

BSvar    = Bsection.EXTR_TABLE()
BSvalues = BSvar.values()
  • the following types are obtained from:
    • print Bsection....................<table_sdaster(7ff0d0bc37d0,'Bsection')>
    • print type(BSvalues)............<type 'dict'>
    • print type(BSvar)................<class 'Utilitai.Table.Table'>
    • print type(BSvar.values).......<type 'instancemethod'>
    • print BSvalues['IYR2'][0]......None
    • print BSvalues['IYR2'][1]......6.24183205019e-09

Here eg we can extract the following data from BSvalues. BSvalues is a Python dictionary:

Jx   = BSvalues['CT'][1]
Axy  = BSvalues['AIRE'][1]
alpha= BSvalues['ALPHA'][1]    ## angle of main principle axes
CoGx = BSvalues['CDG_X'][1]
CoGy = BSvalues['CDG_Y'][1]
Iyy  = BSvalues['IY_PRIN_G'][1]
Izz  = BSvalues['IZ_PRIN_G'][1]

Again a remark:

  • Note the the last index of BSvalues['AY'][1] is now 1 because Python counts from zero.

Unfortunately the torsion stiffness Jx = CT is not defined here either.

and finally the complete result of print BSvalues:

{'IYR2': [None, 6.2418320501942666e-09], 
'EZ': [None, None], 
'IXY_G': [None, -2.9693380576535402e-07], 
'IY_PRIN_G': [None, 1.5095771271938019e-07],  
'Z_MIN': [None, -0.030379887052565866], 
'ENTITE': [None, 'TOUT    '], 
'X_P': [None, 0.0], 
'IXY_P': [None, 4.0162157016377599e-07], 
'JG': [None, None], 
'IZR2_PRIN_G': [None, 9.5071319311016695e-09], 
'IYR2_P': [None, 3.7649841463497238e-08], 
'Y_MAX': [None, 0.06146905080820729], 
'Z_MAX': [None, 0.019460314808255372], 
'MAILLAGE': ['.9000014', None], 
'IYR2_PRIN_G': [None, -8.4163339897006481e-09], 
'IXR2_P': [None, 2.9929035191926414e-07], 
'IY_G_M': [None, 2.1446447924954742e-07], 
'IX_G_M': [None, 1.5393087471625248e-06], 
'IX_G': [None, 1.5393087471625248e-06], 
'Y_MIN': [None, -0.046776669698839826], 
'IY_G': [None, 2.1446447924954742e-07], 
'IXY_G_M': [None, -2.9693380576535402e-07], 
'KZ': [None, None], 
'CT': [None, None], 
'CDG_Y_M': [None, 0.039586221722664502], 
'EY': [None, None], 
'IX_P': [None, 3.9578309685899442e-06], 
'LIEU': [None, '.9000014'], 
'AY': [None, None], 
'CDG_X_M': [None, 0.011433911068540359], 
'AZ': [None, None], 
'PCTY': [None, None], 
'IY_P': [None, 4.1623215742762136e-07], 
'CDG_X': [None, 0.011433911068540359], 
'CDG_Y': [None, 0.039586221722664502], 
'PCTX': [None, None], 
'AIRE': [None, 0.0015433412939497826], 
'IXR2': [None, 1.1057113910905097e-08], 
'Y_P': [None, 0.0], 
'IZ_PRIN_G': [None, 1.6028155136926921e-06], 
'R_MAX': [None, 0.061486249910580375], ! write all tables to the same file
'ALPHA': [None, 102.07226511894622], 
'KY': [None, None], 
'AIRE_M': [None, 0.0015433412939497826]}


commands to generate tables
empty
'IYR2'
'EZ'
'IXY_G'
'IY_PRIN_G'
'Z_MIN'
'ENTITE'
'X_P'
'IXY_P'
'JG'
'IZR2_PRIN_G'
'IYR2_P'
'Y_MAX'
'Z_MAX'
'MAILLAGE'
'IYR2_PRIN_G'
'IXR2_P'
'IY_G_M'
'IX_G_M'
'IX_G'
'Y_MIN'
'IY_G'
'IXY_G_M'
'KZ'
'CT'
'CDG_Y_M'
'EY'
'IX_P'
'LIEU'
'AY'
'CDG_X_M'
'AZ'
'PCTY'
'IY_P'
'CDG_X'
'CDG_Y'
'PCTX'
'AIRE'
'IXR2'
'Y_P'
'IZ_PRIN_G'
'R_MAX'
'ALPHA'
'KY'
'AIRE_M'