Difference between revisions of "Contrib:Claws/Code Aster/10 x cases/liaison mail"

From CAELinuxWiki
Jump to: navigation, search
Line 1: Line 1:
[[Contrib:Claws/Code_Aster/10_1_x_cases|'''<-Link: Back to Contrib:Claws/Code_Aster/10_1_x_cases''']] <br />
+
[[Contrib:Claws/Code_Aster/10_x_cases|'''<-Link: Back to Contrib:Claws/Code_Aster/10_x_cases''']] <br />
  
 
== Content ==
 
== Content ==
Line 72: Line 72:
 
<br\>
 
<br\>
  
*Assigning the mesh files in '''ASTK'''
+
*Assigning the ''input'' mesh files in '''ASTK'''
 
**''mmed'' for mesh file
 
**''mmed'' for mesh file
 
***''local'' file
 
***''local'' file
Line 78: Line 78:
 
*****''LU'': unique number correspondent to a number in the ''.comm'' file
 
*****''LU'': unique number correspondent to a number in the ''.comm'' file
 
******''D'' for Data
 
******''D'' for Data
 +
 +
*Assigning the ''output'' mesh files in '''ASTK'''
 +
**''rmed'' for mesh file
 +
***etc. etc.
 
<br\>
 
<br\>
 
=== Code_Aster setup ===
 
=== Code_Aster setup ===
Line 83: Line 87:
 
The way Code_Aster connects different meshes, is by using the '''LIAISON_MAIL''' command (see '''U4.44.01''' section '''4.14''').  
 
The way Code_Aster connects different meshes, is by using the '''LIAISON_MAIL''' command (see '''U4.44.01''' section '''4.14''').  
  
A 3D volume group is connected to a 2D face group using a 'parent/child' relationship called ''GROUP_MA_MAIT'' and ''GROUP_MA_ESCL'' - this explains why the parts in the  group diagram (in the Salomé paragraph) are assigned groups called ''name'''_f''' '' for face and ''name'''_v''' '' for volume.
+
A 3D volume group is connected to a 2D face group using a 'master/slave' relationship called ''GROUP_MA_MAIT'' and ''GROUP_MA_ESCL'' - this explains why the parts in the  group diagram (in the Salomé paragraph) are assigned groups called ''name'''_f''' '' for face and ''name'''_v''' '' for volume.
  
 
Heres a diagram of the boundary conditions - They will be explained further in the ''.comm'' file.
 
Heres a diagram of the boundary conditions - They will be explained further in the ''.comm'' file.
Line 93: Line 97:
 
==== ''.comm'' file, step by step ====
 
==== ''.comm'' file, step by step ====
  
  #Claws - Jan - 2010
+
  #Claws - March - 2011
 
  #For www.CAELinux.com
 
  #For www.CAELinux.com
   
+
  #Assembly tutorial
 +
 
 
  DEBUT();
 
  DEBUT();
 
   
 
   
Line 149: Line 154:
  
 
:*Assign a 3D mechanical model to everything on ''mesh2''
 
:*Assign a 3D mechanical model to everything on ''mesh2''
:*Reorient the normals of the 'press' face group
+
:*Reorient the normals of the face groups
  
  
Line 176: Line 181:
  
 
  CHAR=AFFE_CHAR_MECA(MODELE=qmod,
 
  CHAR=AFFE_CHAR_MECA(MODELE=qmod,
                     DDL_IMPO=_F(GROUP_MA='encast',
+
                     DDL_IMPO=(_F(GROUP_MA='encast',
                                DX=0.0,
+
                                DX=0.0,
                                DY=0.0,
+
                                DY=0.0,
                                DZ=0.0,),
+
                                DZ=0.0,),
 +
                              _F(GROUP_MA='noDX',
 +
                                DX=0.0,
 +
                                DY=0,),),
 
                     LIAISON_MAIL=(_F(GROUP_MA_MAIT='hinge_v',
 
                     LIAISON_MAIL=(_F(GROUP_MA_MAIT='hinge_v',
 
                                     GROUP_MA_ESCL='mount_f',
 
                                     GROUP_MA_ESCL='mount_f',
                                     CENTRE=0.0,
+
                                     TYPE_RACCORD='MASSIF',),
                                    DDL_MAIT='DNOR',
+
                                    DDL_ESCL='DNOR',),
+
 
                                   _F(GROUP_MA_MAIT='mount_v',
 
                                   _F(GROUP_MA_MAIT='mount_v',
 
                                     GROUP_MA_ESCL='ring_f',
 
                                     GROUP_MA_ESCL='ring_f',
                                     CENTRE=0.0,),),
+
                                     TYPE_RACCORD='MASSIF',),),
 
                     LIAISON_UNIF=_F(GROUP_MA='press',
 
                     LIAISON_UNIF=_F(GROUP_MA='press',
                                     DDL=('DX','DY','DZ',),),
+
                                     DDL='DZ',),
 
                     PRES_REP=_F(GROUP_MA='press',
 
                     PRES_REP=_F(GROUP_MA='press',
 
                                 PRES=0.325,),);
 
                                 PRES=0.325,),);
Line 196: Line 202:
  
 
:*Assign loads and boundary conditions:
 
:*Assign loads and boundary conditions:
:**Impose zero displacements to face group 'encast'
+
:**Impose zero displacements to face group 'encast' and allow 'noDX' to only move in the Z direction
 
:**Use LIAISON_MAIL to 'glue' the ''VOLUME'' group ''hinge_v'' to ''FACE'' group 'mount_f' - 'hinge_v' can rotate freely around 'mount_f', but not slide off.
 
:**Use LIAISON_MAIL to 'glue' the ''VOLUME'' group ''hinge_v'' to ''FACE'' group 'mount_f' - 'hinge_v' can rotate freely around 'mount_f', but not slide off.
:*** CENTRE=0.0: Not entirely sure what this does yet, but it has to be there.
 
:***DDL_MAIT=DNOR: No friction between the two meshes.
 
:***DDL_ESCL=DNOR: -||-
 
 
:**Use LIAISON_MAIL to 'glue' the ''VOLUME'' group 'mount_v' to ''FACE'' group 'ring_f'
 
:**Use LIAISON_MAIL to 'glue' the ''VOLUME'' group 'mount_v' to ''FACE'' group 'ring_f'
:**Use LIAISON_UNIF to make sure the face group 'press' doesn't deform
+
:**Use LIAISON_UNIF to make sure the face group 'press' deforms uniformly in the Z direction
 
:**Apply force to the face group 'press'
 
:**Apply force to the face group 'press'
  
Line 227: Line 230:
 
:*Calculate the results at the nodes
 
:*Calculate the results at the nodes
  
 +
IMPR_RESU(FORMAT='RESULTAT',
 +
          RESU=_F(RESULTAT=RESU,
 +
                  NOM_CHAM='EQUI_ELGA_SIGM',
 +
                  NOM_CMP=('VMIS','TRESCA',),
 +
                  VALE_MAX='OUI',),);
 +
 +
;Definition
 +
 +
;*Extract maximum Von Mises and Tresca stresses (NOM_CMP = component name) from the solution (ELGA = Gauss points) and write the results to the .resu file.
 +
;*(Alternatively, the results can be written to a specified file; use 'unit' command for this.)
 +
;*This is done before the Gauss points are stripped from the result by the PROJ_CHAMP command.
  
 
  qresu=PROJ_CHAMP(RESULTAT=RESU,
 
  qresu=PROJ_CHAMP(RESULTAT=RESU,
 
                 MODELE_1=qmod,
 
                 MODELE_1=qmod,
 
                 MODELE_2=linmod,);
 
                 MODELE_2=linmod,);
 
IMPR_RESU(FORMAT='MED',
 
          UNITE=80,
 
          RESU=_F(MAILLAGE=mesh2,
 
                  RESULTAT=qresu,
 
                  NOM_CHAM=('SIGM_NOEU_DEPL','EQUI_NOEU_SIGM','DEPL',),),);
 
  
 
;Definition
 
;Definition
  
 
:*Project the high definition quadratic model '''qmod''' optained from '''RESU''' onto the lower definition linear model '''linmod''', call the projected result '''qresu'''
 
:*Project the high definition quadratic model '''qmod''' optained from '''RESU''' onto the lower definition linear model '''linmod''', call the projected result '''qresu'''
:*Write the result '''qresu''' to a .med file
 
  
  
  IMPR_RESU(FORMAT='RESULTAT',
+
  IMPR_RESU(FORMAT='MED',
           RESU=_F(RESULTAT=RESU,
+
          RESTREINT=_F(GROUP_MA='hinge_v',),
                   NOM_CHAM='EQUI_NOEU_SIGM',
+
           RESU=_F(MAILLAGE=hinge,
                   FORM_TABL='OUI',
+
                   RESULTAT=qresu,
                  VALE_MAX='OUI',
+
                   NOM_CHAM=('SIGM_NOEU_DEPL','EQUI_ELNO_SIGM','DEPL','SIEF_ELNO_ELGA',),),);
                  VALE_MIN='OUI',
+
                  SOUS_TITRE='Principal_max_min',),);
+
+
FIN();
+
  
;Definition  
+
IMPR_RESU(FORMAT='MED',
 +
          UNITE=81,
 +
          RESTREINT=_F(GROUP_MA='mount_v',),
 +
          RESU=_F(MAILLAGE=mount,
 +
                  RESULTAT=qresu,
 +
                  NOM_CHAM=('SIGM_NOEU_DEPL','SIEF_ELNO_ELGA','EQUI_ELNO_SIGM','DEPL',),),);
 +
 
 +
IMPR_RESU(FORMAT='MED',
 +
          UNITE=82,
 +
          RESTREINT=_F(GROUP_MA='ring_v',),
 +
          RESU=_F(MAILLAGE=ring,
 +
                  RESULTAT=qresu,
 +
                  NOM_CHAM=('SIGM_NOEU_DEPL','EQUI_ELNO_SIGM','SIEF_ELNO_ELGA','DEPL',),),);
 +
 
 +
 
 +
FIN();
 +
 
 +
;Definition
  
:*(Optional)
+
:*Write the results to each individual mesh file, defining which physical file with '''UNITE''' and ''restrain''ing the results to a corresponding volume group
:*Optain minimum and maximum pricipal stresses in the solution and write the results to the .resu file.
+
:*Alternatively, the results can be written to a specified file; use 'unite' command for this.
+
  
  

Revision as of 23:33, 2 March 2011

<-Link: Back to Contrib:Claws/Code_Aster/10_x_cases

Content

UNDER CONSTRUCTION

Introduction and theory

In this case we'll use Salomé, ASTK and Code_Aster to load and combine several separate mesh files into one big mesh and solve for an applied load. Then separate the mesh again, now containing the calculated fields.


The reasons for this approach can be many, such as Salomé running out of available memory, operations take exceedingly long to complete because the whole mesh has to be displayed/updated etc., or sometimes it's just more practical to work on one part of an assembly instead of the full assembly.

In Salomés geometry module the full assembly is manipulated in different ways, but each of the parts are meshed and exported separately.

A section of the assembly below, is what we'll be working with.

Claws assm geo.jpg

Work flow

To accomplish this feat using Salomé, ASTK and Code_Aster, a few steps must be completed.

  • Decide which surfaces of the parts that will be 'glued' together and assign mesh groups accordingly
  • Assign unit numbers in ASTK
  • Tell Code_Aster which mesh files to read using unit numbers and tell it which surfaces should be glued together.
  • Calculate the results, then print results to each separate mesh


Below in the table the different parts that go into the assembly can be seen.

Tables Are Fun
"Part:Ring"
"Part:Mount"
"Part:Hinge"
"Part:Assembly exploded"
"Part:Assembly"



<br\>

Assignment of groups in Salomé

You should be familiar with assigning groups, meshing and exporting files in Salomé, so I will not go through it here. Consult the .hdf file I've attached at the bottom of the page.

note: I have used Salomé 5.1.5 to generate the mesh, so the .hdf might not be backwards compatible. To recreate the mesh, use the included .brep files, the diagram below, and use 'automatic tetrahedralization' with a average/local size of 3. <br\>

Group diagram


click here for bigger version


<br\>

ASTK setup

Each exported mesh file is assigned a unique unit number in ASTK so Code_Aster can recognize them during parsing of the .comm file.

<br\> Claws assm astk.png <br\>

  • Assigning the input mesh files in ASTK
    • mmed for mesh file
      • local file
        • Name of file on disk
          • LU: unique number correspondent to a number in the .comm file
            • D for Data
  • Assigning the output mesh files in ASTK
    • rmed for mesh file
      • etc. etc.

<br\>

Code_Aster setup

The way Code_Aster connects different meshes, is by using the LIAISON_MAIL command (see U4.44.01 section 4.14).

A 3D volume group is connected to a 2D face group using a 'master/slave' relationship called GROUP_MA_MAIT and GROUP_MA_ESCL - this explains why the parts in the group diagram (in the Salomé paragraph) are assigned groups called name_f for face and name_v for volume.

Heres a diagram of the boundary conditions - They will be explained further in the .comm file.

Load and boundary conditions diagram


.comm file, step by step

#Claws - March - 2011
#For www.CAELinux.com
#Assembly tutorial
DEBUT();

MA=DEFI_MATERIAU(ELAS=_F(E=2.1e5,
                        NU=0.28,),);
Definition
  • Self serving credits and date
  • DEFI_MATERIAU: Define material, assign the name MA to it.
    • ELAS: We only deal with a regular elastic material here, with an elasticity module (Young's module) of 210 GPA and a Poisson's ratio of 0.28


ring=LIRE_MAILLAGE(UNITE=20,
                  FORMAT='MED',);

mount=LIRE_MAILLAGE(UNITE=21,
                   FORMAT='MED',);

hinge=LIRE_MAILLAGE(UNITE=22,
                   FORMAT='MED',);
Definition
  • Read each of the mesh files assigned in ASTK
    • UNITE: Uniquely assigned number in ASTK (LU)


mesh1=ASSE_MAILLAGE(MAILLAGE_1=hinge,
                   MAILLAGE_2=mount,
                   OPERATION='SUPERPOSE',);

mesh2=ASSE_MAILLAGE(MAILLAGE_1=mesh1,
                   MAILLAGE_2=ring,
                   OPERATION='SUPERPOSE',);
Definition
  • ASSE_MAILLAGE - Assemble mesh (See U4.23.03 for explanation)
    • mesh1: 'Assemble' two mesh files hinge and mount - use superposition or 'overlay'
    • mesh2: 'Assemble' two mesh files - This time use the mesh1 previously created and add ring to the combined mesh - use superposistion or 'overlay'


linmod=AFFE_MODELE(MAILLAGE=mesh2,
                  AFFE=_F(TOUT='OUI',
                          PHENOMENE='MECANIQUE',
                          MODELISATION='3D',),);

mesh2=MODI_MAILLAGE(reuse =mesh2,
                   MAILLAGE=mesh2,
                   ORIE_PEAU_3D=_F(GROUP_MA='press',),);

Definition
  • Assign a 3D mechanical model to everything on mesh2
  • Reorient the normals of the face groups


Qmesh=CREA_MAILLAGE(MAILLAGE=mesh2,
                   LINE_QUAD=_F(TOUT='OUI',),);

qmod=AFFE_MODELE(MAILLAGE=Qmesh,
                AFFE=_F(TOUT='OUI',
                        PHENOMENE='MECANIQUE',
                        MODELISATION='3D',),);

Definition
  • Qmesh: Convert the original linear mesh to a quadratic mesh
  • qmod: Assign a 3D mechanical model to everything


MATE=AFFE_MATERIAU(MAILLAGE=Qmesh,
                  AFFE=_F(TOUT='OUI',
                          MATER=MA,),);
Definition
  • Assign the material MA to everything, call the field MATE


CHAR=AFFE_CHAR_MECA(MODELE=qmod,
                   DDL_IMPO=(_F(GROUP_MA='encast',
                                DX=0.0,
                                DY=0.0,
                                DZ=0.0,),
                             _F(GROUP_MA='noDX',
                                DX=0.0,
                                DY=0,),),
                   LIAISON_MAIL=(_F(GROUP_MA_MAIT='hinge_v',
                                    GROUP_MA_ESCL='mount_f',
                                    TYPE_RACCORD='MASSIF',),
                                 _F(GROUP_MA_MAIT='mount_v',
                                    GROUP_MA_ESCL='ring_f',
                                    TYPE_RACCORD='MASSIF',),),
                   LIAISON_UNIF=_F(GROUP_MA='press',
                                   DDL='DZ',),
                   PRES_REP=_F(GROUP_MA='press',
                               PRES=0.325,),);
Definition
  • Assign loads and boundary conditions:
    • Impose zero displacements to face group 'encast' and allow 'noDX' to only move in the Z direction
    • Use LIAISON_MAIL to 'glue' the VOLUME group hinge_v to FACE group 'mount_f' - 'hinge_v' can rotate freely around 'mount_f', but not slide off.
    • Use LIAISON_MAIL to 'glue' the VOLUME group 'mount_v' to FACE group 'ring_f'
    • Use LIAISON_UNIF to make sure the face group 'press' deforms uniformly in the Z direction
    • Apply force to the face group 'press'


RESU=MECA_STATIQUE(MODELE=qmod,
                  CHAM_MATER=MATE,
                  EXCIT=_F(CHARGE=CHAR,),);

RESU=CALC_ELEM(reuse =RESU,
              MODELE=qmod,
              CHAM_MATER=MATE,
              RESULTAT=RESU,
              OPTION=('SIGM_ELNO_DEPL','EQUI_ELNO_SIGM',),
              EXCIT=_F(CHARGE=CHAR,),);

RESU=CALC_NO(reuse =RESU,
            RESULTAT=RESU,
            OPTION=('SIGM_NOEU_DEPL','EQUI_NOEU_SIGM',),);
Definition
  • Calculate a solution using the material and loads/boundary conditions
  • Calculate the results at the elements
  • Calculate the results at the nodes
IMPR_RESU(FORMAT='RESULTAT',
         RESU=_F(RESULTAT=RESU,
                 NOM_CHAM='EQUI_ELGA_SIGM',
                 NOM_CMP=('VMIS','TRESCA',),
                 VALE_MAX='OUI',),);
Definition
  • Extract maximum Von Mises and Tresca stresses (NOM_CMP = component name) from the solution (ELGA = Gauss points) and write the results to the .resu file.
  • (Alternatively, the results can be written to a specified file; use 'unit' command for this.)
  • This is done before the Gauss points are stripped from the result by the PROJ_CHAMP command.
qresu=PROJ_CHAMP(RESULTAT=RESU,
                MODELE_1=qmod,
                MODELE_2=linmod,);
Definition
  • Project the high definition quadratic model qmod optained from RESU onto the lower definition linear model linmod, call the projected result qresu


IMPR_RESU(FORMAT='MED',
         RESTREINT=_F(GROUP_MA='hinge_v',),
         RESU=_F(MAILLAGE=hinge,
                 RESULTAT=qresu,
                 NOM_CHAM=('SIGM_NOEU_DEPL','EQUI_ELNO_SIGM','DEPL','SIEF_ELNO_ELGA',),),);
IMPR_RESU(FORMAT='MED',
         UNITE=81,
         RESTREINT=_F(GROUP_MA='mount_v',),
         RESU=_F(MAILLAGE=mount,
                 RESULTAT=qresu,
                 NOM_CHAM=('SIGM_NOEU_DEPL','SIEF_ELNO_ELGA','EQUI_ELNO_SIGM','DEPL',),),);
IMPR_RESU(FORMAT='MED',
         UNITE=82,
         RESTREINT=_F(GROUP_MA='ring_v',),
         RESU=_F(MAILLAGE=ring,
                 RESULTAT=qresu,
                 NOM_CHAM=('SIGM_NOEU_DEPL','EQUI_ELNO_SIGM','SIEF_ELNO_ELGA','DEPL',),),);


FIN();

Definition
  • Write the results to each individual mesh file, defining which physical file with UNITE and restraining the results to a corresponding volume group



<br\>

Tables Are Fun
"Part:Ring"
"Part:Mount"
"Part:Hinge"
"Part:Assembly exploded"
row 2, cell 2 row 2, cell 3

UNDER CONSTRUCTION

Media:Assembly2_1.tar.gz <- might contain bugs or errors