Nastran to Code_Aster: nonlinear gap elements

Code_Aster can really replace in many cases traditional solvers, let’s try with a simple problem. This problem will look into a specific contact type, called CGAP in Nastran™ and unilateral contact (“LIAISON_UNIL”) in Code_Aster. This case is taken from a publicy available example on the internet, but the original source is probably this one, for all due credit.
To read this article one will need some knowledge both in Nastran and in Code_Aster.

1-1502031559210-L

The translation between Nastran and Code_Aster can be made by using the following correspondances :

Nastran keyword Code_Aster keyword
BEGIN DEBUT
SOL 106 + SUBCASE STAT_NON_LINE
DISPLACEMENT=ALL IMPR_RESU(FORMAT=’RESULTAT’)
TIME 600 See “prob30c.export” file, line “A tpmax 600
PARAM LGDISP STAT_NON_LINE(COMPORTEMENT)
NLPARM DEFI_LIST_REEL, DEFI_LIST_INST
PBEAML AFFE_MODELE(MODELISATION=’POU_D_T‘), MACR_CARA_POUTRE, AFFE_CARA_ELEM(POUTRE=_F(SECTION=’GENERALE’)) + AFFE_MATERIAU
CBEAM See “prob30c.mail” file: SEG2 + AFFE_CARA_ELEM(ORIENTATION) + AFFE_CARA_ELEM(POUTRE=_F(GROUPMA))
CGAP See “prob30c.mail” file: POI1 + AFFE_CARA_ELEM(DISCRET) + AFFE_MODELE(MODELISATION=’DIS_TR‘) + DEFI_MATERIAU(ELAS)
PGAP DEFI_CONTACT(FORMULATION=’LIAISON_UNIL’) + AFFE_MATERIAU
MAT1 DEFI_MATERIAU
GRID See “prob30c.mail” file: COOR_3D
SPC1 AFFE_CHAR_CINE
FORCE AFFE_CHAR_MECA(FORCE_NODALE)
ENDDATA FIN

After the calculation, we will find the displacements at nodes and compare them with Nastran results (the contact limit is shown by a single point, label “12”) :

depl_crop

Here is a table of comparison between Nastran and Code_Aster results for this case (Nastran values are taken from the pdf file above) :

Node Nastran Disp Code_Aster Disp Diff %
N2 -0.009780925 -0.00977726747071 0.037%
N3 -0.03698192 -0.0369769401306 0.013%
N4 -0.07929253 -0.0792879790551 0.006%
N5 -0.1344023 -0.13439934532 0.002%
N6 -0.2000008 -0.2 0.0004%
N7 -0.2737623 -0.273762838838 0.0002%
N8 -0.352976 -0.352977844004 0.0005%
N9 -0.4349158 -0.434918932333 0.0007%
N10 -0.5169551 -0.516965540582 0.002%
N11 -0.5989944 -0.59901214883 0.003%

First of all, let’s see the Nastran code (file “prob30c.dat”) for this exemple :

SOL 106
TIME 600
CEND
TITLE = Non-Linear Gap Element with Non-Coincedent Nodes
ECHO = NONE
MAXLINES = 999999999
SUBCASE 1
 NLPARM = 1
 SPC = 1
 LOAD = 1
 DISPLACEMENT=ALL
BEGIN BULK
PARAM AUTOSPC NO
PARAM WTMASS 1.
PARAM LGDISP -1
PARAM,NOCOMPS,-1
NLPARM 1 10 AUTO 5 25 PW NO + A
+ A .001 1.-7
PBEAML 1 1 I + B
+ B 2. 1. 1. .1 .1 .1 YES + C
+ C 1. 2. 1. 1. .1 .1 .1
CBEAM 1 1 1 2 0. 1. 0.
CBEAM 2 1 2 3 0. 1. 0.
CBEAM 3 1 3 4 0. 1. 0.
CBEAM 4 1 4 5 0. 1. 0.
CBEAM 5 1 5 6 0. 1. 0.
CBEAM 6 1 6 7 0. 1. 0.
CBEAM 7 1 7 8 0. 1. 0.
CBEAM 8 1 8 9 0. 1. 0.
CBEAM 9 1 9 10 0. 1. 0.
CBEAM 10 1 10 11 0. 1. 0.
PGAP 2 .2 1.+7
CGAP 100 2 6 12 1. 0. 0.
MAT1 1 1.+7 .3 .101
GRID 1 0. 0. 0.
GRID 2 5. 0. 0.
GRID 3 10. 0. 0.
GRID 4 15. 0. 0.
GRID 5 20. 0. 0.
GRID 6 25. 0. 0.
GRID 7 30. 0. 0.
GRID 8 35. 0. 0.
GRID 9 40. 0. 0.
GRID 10 45. 0. 0.
GRID 11 50. 0. 0.
GRID 12 25. -.2 0.
SPC1 1 123456 1 12
FORCE 1 9 0 50. 0. -1. 0.
ENDDATA

In Code_Aster, you will need to create distinct files for the mesh and the commands and also a mesh file for calculating the section parameters. Let’s start with the main mesh file (file “prob30c.mail”) :

prob30c_crop

TITRE 
 prob30c
 Non-Linear Gap Element with Non-Coincedent Nodes
FINSF

COOR_3D
 N1 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
 N2 5.0000000000e+00 0.0000000000e+00 0.0000000000e+00
 N3 1.0000000000e+01 0.0000000000e+00 0.0000000000e+00
 N4 1.5000000000e+01 0.0000000000e+00 0.0000000000e+00
 N5 2.0000000000e+01 0.0000000000e+00 0.0000000000e+00
 N6 2.5000000000e+01 0.0000000000e+00 0.0000000000e+00
 N7 3.0000000000e+01 0.0000000000e+00 0.0000000000e+00
 N8 3.5000000000e+01 0.0000000000e+00 0.0000000000e+00
 N9 4.0000000000e+01 0.0000000000e+00 0.0000000000e+00
 N10 4.5000000000e+01 0.0000000000e+00 0.0000000000e+00
 N11 5.0000000000e+01 0.0000000000e+00 0.0000000000e+00
 N12 2.5000000000e+01 -2.0000000298e-01 0.0000000000e+00
FINSF

POI1 
 V000012 N12 
FINSF

SEG2 
 E1 N1 N2
 E2 N2 N3
 E3 N3 N4
 E4 N4 N5
 E5 N5 N6
 E6 N6 N7
 E7 N7 N8
 E8 N8 N9
 E9 N9 N10
 E10 N10 N11 
FINSF

GROUP_MA NOM = G1
 % Original part : 1
 E1 E10 E2 E3 E4 E5 E6 
 E7 E8 E9
FINSF

FIN

And then, the section mesh file (file “poutre.mail”). This mesh does not exists in the Nastran file, it is needed because Code_Aster does not know anything about I-Beams, so we must provide a mesh for the beam section to calculate section properties :

poutre


 TITRE
DI-19-MARS-2017 13:15:15                                                        
 FINSF
 %
 COOR_2D
 N1        1.00000000000000E+00  0.00000000000000E+00
 N2        0.00000000000000E+00  1.11022302462516E-16
 N3        0.00000000000000E+00  1.00000000000000E-01
 N4        4.50000000000000E-01  1.00000000000000E-01
 N5        4.50000000000000E-01  1.90000000000000E+00
 N6        2.22044604925031E-16  1.90000000000000E+00
 N7        2.22044604925031E-16  2.00000000000000E+00
 N8        1.00000000000000E+00  2.00000000000000E+00
 N9        1.00000000000000E+00  1.90000000000000E+00
 N10       5.50000000000000E-01  1.90000000000000E+00
 N11       5.50000000000000E-01  1.00000000000000E-01
 N12       1.00000000000000E+00  1.00000000000000E-01
 N13       8.00000000000000E-01  2.22044604925031E-17
 N14       6.00000000000000E-01  4.44089209850063E-17
 N15       4.00000000000000E-01  6.66133814775094E-17
 N16       2.00000000000000E-01  8.88178419700125E-17
 N17       1.50000000000000E-01  1.00000000000000E-01
 N18       3.00000000000000E-01  1.00000000000000E-01
 N19       4.50000000000000E-01  3.00000000000000E-01
 N20       4.50000000000000E-01  5.00000000000000E-01
 N21       4.50000000000000E-01  7.00000000000000E-01
 N22       4.50000000000000E-01  9.00000000000000E-01
 N23       4.50000000000000E-01  1.10000000000000E+00
 N24       4.50000000000000E-01  1.30000000000000E+00
 N25       4.50000000000000E-01  1.50000000000000E+00
 N26       4.50000000000000E-01  1.70000000000000E+00
 N27       3.00000000000000E-01  1.90000000000000E+00
 N28       1.50000000000000E-01  1.90000000000000E+00
 N29       2.00000000000000E-01  2.00000000000000E+00
 N30       4.00000000000000E-01  2.00000000000000E+00
 N31       6.00000000000000E-01  2.00000000000000E+00
 N32       8.00000000000000E-01  2.00000000000000E+00
 N33       8.50000000000000E-01  1.90000000000000E+00
 N34       7.00000000000000E-01  1.90000000000000E+00
 N35       5.50000000000000E-01  1.70000000000000E+00
 N36       5.50000000000000E-01  1.50000000000000E+00
 N37       5.50000000000000E-01  1.30000000000000E+00
 N38       5.50000000000000E-01  1.10000000000000E+00
 N39       5.50000000000000E-01  9.00000000000000E-01
 N40       5.50000000000000E-01  7.00000000000000E-01
 N41       5.50000000000000E-01  5.00000000000000E-01
 N42       5.50000000000000E-01  3.00000000000000E-01
 N43       7.00000000000000E-01  1.00000000000000E-01
 N44       8.50000000000000E-01  1.00000000000000E-01
 N45       3.82651061570731E-01  6.69924241892496E-02
 N46       3.82651061570732E-01  1.93300757581075E+00
 N47       7.82788561088396E-01  6.69924241892496E-02
 N48       7.82788561088396E-01  1.93300757581075E+00
 FINSF
 %
 SEG2    
 M1       N1       N13     
 M2       N13      N14     
 M3       N14      N15     
 M4       N15      N16     
 M5       N16      N2      
 M6       N2       N3      
 M7       N3       N17     
 M8       N17      N18     
 M9       N18      N4      
 M10      N4       N19     
 M11      N19      N20     
 M12      N20      N21     
 M13      N21      N22     
 M14      N22      N23     
 M15      N23      N24     
 M16      N24      N25     
 M17      N25      N26     
 M18      N26      N5      
 M19      N5       N27     
 M20      N27      N28     
 M21      N28      N6      
 M22      N6       N7      
 M23      N7       N29     
 M24      N29      N30     
 M25      N30      N31     
 M26      N31      N32     
 M27      N32      N8      
 M28      N8       N9      
 M29      N9       N33     
 M30      N33      N34     
 M31      N34      N10     
 M32      N10      N35     
 M33      N35      N36     
 M34      N36      N37     
 M35      N37      N38     
 M36      N38      N39     
 M37      N39      N40     
 M38      N40      N41     
 M39      N41      N42     
 M40      N42      N11     
 M41      N11      N43     
 M42      N43      N44     
 M43      N44      N12     
 M44      N12      N1      
 FINSF
 %
 TRIA3   
 M45      N2       N17      N16     
 M46      N16      N18      N15     
 M47      N45      N15      N18     
 M48      N16      N17      N18     
 M49      N17      N2       N3      
 M50      N41      N42      N19     
 M51      N19      N20      N41     
 M52      N12      N1       N44     
 M53      N13      N44      N1      
 M54      N47      N44      N13     
 M55      N47      N43      N44     
 M56      N42      N11      N4      
 M57      N4       N19      N42     
 M58      N45      N4       N15     
 M59      N45      N18      N4      
 M60      N15      N4       N11     
 M61      N11      N14      N15     
 M62      N14      N43      N13     
 M63      N47      N13      N43     
 M64      N14      N11      N43     
 M65      N29      N27      N28     
 M66      N27      N29      N30     
 M67      N46      N5       N27     
 M68      N29      N28      N7      
 M69      N28      N6       N7      
 M70      N36      N37      N24     
 M71      N24      N25      N36     
 M72      N8       N9       N33     
 M73      N48      N34      N32     
 M74      N8       N33      N32     
 M75      N48      N32      N33     
 M76      N46      N27      N30     
 M77      N5       N30      N31     
 M78      N35      N36      N25     
 M79      N25      N26      N35     
 M80      N26      N5       N10     
 M81      N46      N30      N5      
 M82      N10      N35      N26     
 M83      N31      N10      N5      
 M84      N48      N33      N34     
 M85      N31      N34      N10     
 M86      N31      N32      N34     
 M87      N23      N37      N38     
 M88      N37      N23      N24     
 M89      N22      N39      N21     
 M90      N40      N41      N20     
 M91      N20      N21      N40     
 M92      N21      N39      N40     
 M93      N38      N39      N23     
 M94      N39      N22      N23     
 FINSF
 %
 GROUP_MA
 BORDER                  
 M1       M2       M3       M4       M5       M6       M7      
 M8       M9       M10      M11      M12      M13      M14     
 M15      M16      M17      M18      M19      M20      M21     
 M22      M23      M24      M25      M26      M27      M28     
 M29      M30      M31      M32      M33      M34      M35     
 M36      M37      M38      M39      M40      M41      M42     
 M43      M44     
 FINSF
 %
 FIN

Finally, the command file (file “prob30c.comm”) :


# prob30c
# Non-Linear Gap Element with Non-Coincedent Nodes

DEBUT(PAR_LOT='NON',
      ERREUR=_F(ERREUR_F='ABORT',),
      IGNORE_ALARM=('SUPERVIS_1','MODELISA4_6','MODELISA4_8',),);

MAIL=LIRE_MAILLAGE(FORMAT='ASTER',
                   VERI_MAIL=_F(VERIF='OUI',),);

MODMECA=AFFE_MODELE(MAILLAGE=MAIL,
                    AFFE=(_F(MAILLE='V000012',
                             PHENOMENE='MECANIQUE',
                             MODELISATION='DIS_TR',),
                          _F(GROUP_MA='G1',
                             PHENOMENE='MECANIQUE',
                             MODELISATION='POU_D_T',),),);

CNS00001=DEFI_CONSTANTE(VALE=0.2,);

CNS00002=DEFI_CONSTANTE(VALE=0.0,);

CNS00003=DEFI_CONSTANTE(VALE=-1.0,);

LST00001=DEFI_LIST_REEL(DEBUT=0.0,
                        INTERVALLE=_F(JUSQU_A=1.0,
                                      NOMBRE=10,),);

FAUXMAT=DEFI_MATERIAU(ELAS=_F(E=1e-10,
                              NU=0.0,
                              RHO=0.0,),);

MAT00001=DEFI_MATERIAU(ELAS=_F(E=10000000.0,
                               NU=0.3,
                               RHO=0.101,),);

CHMAT=AFFE_MATERIAU(MAILLAGE=MAIL,
                    AFFE=(_F(MAILLE='V000012',
                             MATER=FAUXMAT,),
                          _F(GROUP_MA='G1',
                             MATER=MAT00001,),),);

CINE1=AFFE_CHAR_CINE(MODELE=MODMECA,
                     MECA_IMPO=_F(NOEUD=('N12','N1',),
                                  DX=0.0,
                                  DY=0.0,
                                  DZ=0.0,
                                  DRX=0.0,
                                  DRY=0.0,
                                  DRZ=0.0,),);

CHCONT=DEFI_CONTACT(MODELE=MODMECA,
                    FORMULATION='LIAISON_UNIL',
                    ZONE=_F(NOEUD='N6',
                            NOM_CMP=('DX','DY',),
                            COEF_IMPO=CNS00001,
                            COEF_MULT=(CNS00002,CNS00003,),),);

CHARGE1=AFFE_CHAR_MECA(MODELE=MODMECA,
                       FORCE_NODALE=_F(NOEUD='N9',
                                       FY=-50.0,),);

SECT=LIRE_MAILLAGE(UNITE=21,
                   FORMAT='ASTER',
                   VERI_MAIL=_F(VERIF='OUI',),);

TB_POU=MACR_CARA_POUTRE(MAILLAGE=SECT,
                       ORIG_INER=(0.0,0.0,),
                       INFO=2,
                       GROUP_MA_BORD='BORDER',
                       NOEUD='N23',TABLE_CARA='OUI',NOM='ibeam',);

CAEL=AFFE_CARA_ELEM(MODELE=MODMECA,
                    POUTRE=_F(SECTION='GENERALE',
                              GROUP_MA='G1',TABLE_CARA=TB_POU,NOM_SEC='ibeam',),
                    DISCRET=_F(CARA='K_TR_D_N',
                               MAILLE='V000012',
                               VALE=(0.0,0.0,0.0,0.0,0.0,0.0,),),
                    ORIENTATION=_F(CARA='VECT_Y',
                                   GROUP_MA='G1',
                                   VALE=(0.0,1.0,0.0,),),);

LAUTO1=DEFI_LIST_INST(DEFI_LIST=_F(METHODE='AUTO',
                                   LIST_INST=LST00001,),);

RESU1=STAT_NON_LINE(MODELE=MODMECA,
                    CHAM_MATER=CHMAT,
                    CARA_ELEM=CAEL,
                    EXCIT=(_F(CHARGE=CHARGE1,),
                           _F(CHARGE=CINE1,),),
                    CONTACT=CHCONT,
                    COMPORTEMENT=(_F(MAILLE='V000012',
                                     RELATION='ELAS',),
                                  _F(GROUP_MA='G1',
                                     RELATION='ELAS',),),
                    INCREMENT=_F(LIST_INST=LAUTO1,),
                    NEWTON=_F(REAC_ITER=1,),
                    SOLVEUR=_F(METHODE='MUMPS',
                               NPREC=8,),
                    ARCHIVAGE=_F(LIST_INST=LST00001,),);

RESU1=CALC_CHAMP(reuse =RESU1,
                 RESULTAT=RESU1,
                 FORCE='REAC_NODA',);

TEST_RESU(RESU=(
                _F(RESULTAT=RESU1,
                   INST=1.0,
                   NOM_CHAM='DEPL',
                   NOM_CMP='DY',
                   NOEUD='N11',
                   TOLE_MACHINE=0.05,
                   CRITERE='RELATIF',
                   VALE_REFE=-0.5989944,
                   PRECISION=0.05,
                   REFERENCE='SOURCE_EXTERNE',
                   VALE_CALC=-0.5989944,),),);

IMPR_RESU(FORMAT='RESULTAT',
          RESU=_F(RESULTAT=RESU1,
                  NOM_CHAM='DEPL',
                  VALE_MAX='OUI',
                  VALE_MIN='OUI',),);

IMPR_RESU(FORMAT='MED',
          UNITE=80,
          RESU=_F(RESULTAT=RESU1,
                  NOM_CHAM='DEPL',),);

FIN(FORMAT_HDF='OUI',);

You will also need a file to keep everything together ( file “prob30c.export”). This file is the one needed to start the calculation on command line (“as_run prob30c.export”) :


P actions make_etude
P memjob 262144
P memory_limit 256.0
P mode interactif
P mpi_nbcpu 1
P mpi_nbnoeud 1
P ncpus 1
P testlist verification sequential
P time_limit 60.0
P tpsjob 2
P version testing
A memjeveux 32.0
A tpmax 60.0
F comm prob30c.comm D 1
F mail prob30c.mail D 20
F mail poutre.mail D 21
F mess prob30c.mess R 6
F resu prob30c.resu R 8
F rmed prob30c.rmed R 81

One thought on “Nastran to Code_Aster: nonlinear gap elements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s