Contrib:KeesWouters/shell/plotcoq3d

From CAELinuxWiki
Revision as of 13:54, 27 April 2013 by Keeswouters (Talk | contribs) (A rough discription of the Code-Aster commands)

Jump to: navigation, search

Post processing of COQUE-3D calcalation

[under construction]

In this contribution the main (and only) focus is on the postprocessing of the displacements and stresses of shell COQUE-3D elements. The centre nodes of tria7 and quad9 elements used for the discription of the displacements field of COQUE_3D poses some nasty problems in the postprocessing with Salome. To overcome this problem the results are projected on the original quadratic mesh without the centre node.


  • preproccesing:
  • definition of geometry in Salome
  • partitioning of the geometry and groups
  • meshing of the geometry
  • definition of the groups
  • (maybe: python script which makes editing much easier ...)
  • static analysis with pressure or force applied on a group or nodes
  • postprocessing:
  • viewing displacement in Salome
  • determination of stresses, see also tables
  • interface ASTK

Definition of the geometry

This time the geometry has been drawn in FreeCAD. It is good enough at this moment (april 2013) to draw some more or less complex geometry, although, in this case, it wouldnot have been much more effort to construct it in Salome. Anyway, I import the brep geometry from FreeCAD into Salome and mesh it there. It is a planar shell with four holes. Main dimensions are Length x Width = 100 x 50. The holes with diameter of 6 are centred along the short centre line of have offset along the long centre line, see picture below. The thickness is defined in the Code Aster *.comm file and can be changed any time: thickness th = 0.02.
As usual no explicit dimensions are used here. But units have to be consistent and will be if you imagine:

  • length and displacments [m]
  • forces [N] and moments [Nm] and
  • Youngs' modulus and stresses [Pa]

Boundary conditions and loads:

  • all dof fixed on short side Lxm:
    • (DX=0.0, DY=0.0, DZ=0.0, DRX=0.0, DRY=0.0, DRZ=0.0)
  • 2 'loads': prescribed in-plane x displacement or out-out-of-plane vertical displacement fixed on short side Lxp:
    • (DZ=Zdisp) or
    • (DX=Xdisp)

Material:
Material steel

  • E = 210e9 Pa
  • Nu = 0.28
  • rho = 7850 kg/m3 (not needed)

Kw freecad sketch plane1.png * Kw coque3d mesh.png

A rough discription of the Code-Aster commands

The general calculation flow is as follows:

  1. initialise
  2. import the initial mesh (initMesh)
  3. create a modified mesh (modiMesh)
    • create COQUE_3D elements with centre nodes
    • orient all element in the same direction
  4. creaste models with both meshes: iniModel and modModel
  5. define Coque_3d characteristics (thickness on group shell)
  6. define material (steel)
  7. aplly boundary conditions
  8. main calculation: RESU=MECA_STATIQUE(...)
  9. post process the result RESU:
    • create displacement and stress fields for modified model: CALC_CHAMP
    • create displacement and stress fields for modified model at bottom, centre and top layer: POST_CHAMP
    • create displacement and stress fields for initial model at bottom, centre and top layer: PROJ_CHAMP. This last step is required to remove the data at the centre nodes that Salome is unable to coop with.
    • print results of modified and initial model (results of the modified model are only printed to show that they are not fully what you expect)

Steps 1 to 8 are fairly standard and are not descript in more detail here. We will concentrate on step 9).


import sys

  1. define your own path here for import construct_shell_thickness_v22

sys.path.append("/cae_sg500/caexample/caelinux/coque_3d/varyshth") ## please adjust

  1. from construct_shell_thickness_v22 import *
  2. import numpy
  1. reading initial mesh

initMesh=LIRE_MAILLAGE(FORMAT='MED',INFO=1,);

  1. define shell (coque_3D) model;
  2. we have to add centre nodes with CREA_MAILLAGE

modiMesh=CREA_MAILLAGE(MAILLAGE=initMesh,INFO=1,

                     MODI_MAILLE=(_F(TOUT='OUI',OPTION='TRIA6_7',),),);

modiMesh=MODI_MAILLAGE(reuse=modiMesh,

                      INFO=2,
                      MAILLAGE=modiMesh,
                      ORIE_NORM_COQUE=_F(GROUP_MA=('shell',),
                      VECT_NORM=(0.0,0.0,1.0),
                      NOEUD='N1'),);   ## use ORIE_PEAU_2D if eg. z=0 for all nodes
            


iniModel=AFFE_MODELE(MAILLAGE=initMesh,

                   AFFE=_F(TOUT='OUI',
                           PHENOMENE='MECANIQUE',
                           MODELISATION='3D',),);
         

cocModel=AFFE_MODELE(MAILLAGE=modiMesh,

                  AFFE=_F(TOUT='OUI',
                          PHENOMENE='MECANIQUE',
                          MODELISATION='COQUE_3D',),);


info = 0 th = 0.02 shellch=AFFE_CARA_ELEM(MODELE=cocModel,

                          COQUE=_F(GROUP_MA='shell',EPAIS=th,),);
  

steel=DEFI_MATERIAU(ELAS=_F(E=2.100e11,NU=0.28,RHO=7850.0),); material=AFFE_MATERIAU(MAILLAGE=modiMesh,

                      AFFE=_F(TOUT='OUI',
                      MATER=steel,),);
  1. define BC and loads
  2. this load is now used

xp = ['Lpx'] xm = ['Lmx'] displacement_dx = 1 if (displacement_dx==1): if (isclamped==1):

 clamped=AFFE_CHAR_MECA(MODELE=cocModel,
                        DDL_IMPO=(_F(GROUP_MA=xm,DX=0.0,DY=0.0,DZ=0.0,DRX=0.0,DRY=0.0,DRZ=0.0,),
                                  _F(GROUP_MA=xp,DX=0.10),),);

else:

 clamped=AFFE_CHAR_MECA(MODELE=cocModel,
                        DDL_IMPO=(_F(GROUP_MA=xm,DX=0.0,DY=0.0,DZ=0.0,DRX=0.0,DRY=0.0,DRZ=0.0,),
                                  _F(GROUP_MA=xp,DZ=0.00),),);
 pressure = 1.0e5
 ApplyPr = AFFE_CHAR_MECA(MODELE=cocModel,FORCE_COQUE=PressureOnShell);
                        FORCE_COQUE=_F(GROUP_MA='shell',PRES=pressure,),);
    1. ApplyPr = AFFE_CHAR_MECA(MODELE=cocModel,
    2. FORCE_ARETE=_F(GROUP_MA=xp, FX=1000.0),)
  1. Results

RESU=MECA_STATIQUE(MODELE=cocModel,

                    CHAM_MATER=material,
                    CARA_ELEM=shellch,
                    OPTION=('SIEF_ELGA'),   ##'SIEF_ELGA','DEPL','SICO_ELNO','SIGM_ELNO','SIEQ_ELNO'
                    EXCIT=(_F(CHARGE=clamped),
                           _F(CHARGE=ApplyPr),),);


RESU=CALC_CHAMP(reuse =RESU,

               RESULTAT=RESU,
               CONTRAINTE=('SIEF_ELNO','EFGE_NOEU','EFGE_ELNO',),
               CRITERES='SIEQ_ELNO',
               EXCIT=(_F(CHARGE=clamped),
                      _F(CHARGE=ApplyPr),),);

SIEQ_SUP=POST_CHAMP(RESULTAT=RESU,

                   EXTR_COQUE=_F(NOM_CHAM='SIEQ_ELNO',
                                 NUME_COUCHE=1,
                                 NIVE_COUCHE='SUP',),);

SIEQ_MOY=POST_CHAMP(RESULTAT=RESU,

                   EXTR_COQUE=_F(NOM_CHAM='SIEQ_ELNO',
                                 NUME_COUCHE=1,
                                 NIVE_COUCHE='MOY',),);

SIEQ_INF=POST_CHAMP(RESULTAT=RESU,

                   EXTR_COQUE=_F(NOM_CHAM='SIEQ_ELNO',
                                 NUME_COUCHE=1,
                                 NIVE_COUCHE='INF',),);

SIEF_SUP=POST_CHAMP(RESULTAT=RESU,

                   EXTR_COQUE=_F(NOM_CHAM='SIEF_ELNO',
                                 NUME_COUCHE=1,
                                 NIVE_COUCHE='SUP',),);

SIEF_MOY=POST_CHAMP(RESULTAT=RESU,

                   EXTR_COQUE=_F(NOM_CHAM='SIEF_ELNO',
                                 NUME_COUCHE=1,
                                 NIVE_COUCHE='MOY',),);

SIEF_INF=POST_CHAMP(RESULTAT=RESU,

                   EXTR_COQUE=_F(NOM_CHAM='SIEF_ELNO',
                                 NUME_COUCHE=1,
                                 NIVE_COUCHE='INF',),);

SIEQ_SUP=CALC_CHAMP(reuse =SIEQ_SUP,

                   RESULTAT=SIEQ_SUP,
                   CRITERES='SIEQ_NOEU',);

SIEQ_MOY=CALC_CHAMP(reuse =SIEQ_MOY,

                   RESULTAT=SIEQ_MOY,
                   CRITERES='SIEQ_NOEU',);

SIEQ_INF=CALC_CHAMP(reuse =SIEQ_INF,

                   RESULTAT=SIEQ_INF,
                   CRITERES='SIEQ_NOEU',);

SIEF_SUP=CALC_CHAMP(reuse =SIEF_SUP,

                   RESULTAT=SIEF_SUP,
                   CONTRAINTE='SIEF_NOEU',);

SIEF_MOY=CALC_CHAMP(reuse =SIEF_MOY,

                   RESULTAT=SIEF_MOY,
                   CONTRAINTE='SIEF_NOEU',);

SIEF_INF=CALC_CHAMP(reuse =SIEF_INF,

                   RESULTAT=SIEF_INF,
                   CONTRAINTE='SIEF_NOEU',);

IMPR_RESU(FORMAT='MED',

         UNITE=80,
         RESU=(_F(RESULTAT=RESU,),
               _F(RESULTAT=SIEQ_SUP,),
               _F(RESULTAT=SIEQ_MOY,),
               _F(RESULTAT=SIEQ_INF,),
               _F(RESULTAT=SIEF_SUP,),
               _F(RESULTAT=SIEF_MOY,),
               _F(RESULTAT=SIEF_INF,),),);

QSUP_INI=PROJ_CHAMP(RESULTAT=SIEQ_SUP,

                   MODELE_1=cocModel,    # project fields of this model to
                   MODELE_2=iniModel,); # field of model_2

QMOY_INI=PROJ_CHAMP(RESULTAT=SIEQ_MOY,

                   MODELE_1=cocModel,    # project fields of this model to
                   MODELE_2=iniModel,); # field of model_2

QINF_INI=PROJ_CHAMP(RESULTAT=SIEQ_INF,

                   MODELE_1=cocModel,    # project fields of this model to
                   MODELE_2=iniModel,); # field of model_2

FSUP_INI=PROJ_CHAMP(RESULTAT=SIEF_SUP,

                   MODELE_1=cocModel,    # project fields of this model to
                   MODELE_2=iniModel,); # field of model_2

FMOY_INI=PROJ_CHAMP(RESULTAT=SIEF_MOY,

                   MODELE_1=cocModel,    # project fields of this model to
                   MODELE_2=iniModel,); # field of model_2


FINF_INI=PROJ_CHAMP(RESULTAT=SIEF_INF,

                   MODELE_1=cocModel,    # project fields of this model to
                   MODELE_2=iniModel,); # field of model_2


initRes=PROJ_CHAMP(RESULTAT=RESU,

                   MODELE_1=cocModel,    # project fields of this model to
                   MODELE_2=iniModel,); # field of model_2


  1. IMPR_RESU(FORMAT='MED',
  2. UNITE=80,
  3. RESU=_F(MAILLAGE=initMesh,RESULTAT=initRes,
  4. NOM_CHAM=('DEPL'),),);


IMPR_RESU(FORMAT='MED',

         UNITE=81,
         RESU=(_F(RESULTAT=initRes,NOM_CHAM=('DEPL'),),
               #_F(MAILLAGE=initMesh,RESULTAT=RESU,NOM_CHAM=('DEPL'),),
               _F(RESULTAT=QSUP_INI,),
               _F(RESULTAT=QMOY_INI,),
               _F(RESULTAT=QINF_INI,),
               _F(RESULTAT=FSUP_INI,),
               _F(RESULTAT=FMOY_INI,),
               _F(RESULTAT=FINF_INI,),),);

IMPR_RESU(FORMAT='MED',

         UNITE=82,
         RESU=(_F(RESULTAT=initRes),),);


  1. IMPR_RESU(FORMAT='MED',
  2. UNITE=80,
  3. RESU=_F(MAILLAGE=initMesh,RESULTAT=initRes,
  4. NOM_CHAM=('DEPL'),),);


FIN();

Results of Ux displacement

Kw dispux ux.png * Kw vnmises ux.png


Results of Uz displacement

Kw dispux ux.png * Kw vnmises ux.png