# Nastran to Code_Aster: slideline contact

In this post we will have a look at a slideline contact problem, including friction.

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.

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(ETAT_INIT, EXCIT=_F(FONC_MULT))
TIME 600 See “prob9.export” file, line “A tpmax 600
NLPARM DEFI_LIST_REEL, DEFI_LIST_INST
BCOMP DEFI_CONTACT
BFRIC DEFI_CONTACT(FROTTEMENT)
BLSEG DEFI_CONTACT(GROUP_MA_MAIT,GROUP_MA_ESCL)
CQUAD4 See “prob9.mail” file: QUAD4 and in this case C_PLAN plane stress is needed
MAT1 DEFI_MATERIAU(ELAS)
GRID See “prob9.mail” file: COOR_2D
SPC1 AFFE_CHAR_CINE
FORCE AFFE_CHAR_MECA(FORCE_NODALE)
ENDDATA FIN

Here are Code_Aster results :

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

```
ID NAS103 WORKSHOP 9
TIME 300
SOL 106
CEND
\$
TITLE = SLINE2S: SYMMETRIC ELASTIC PUNCH WITH FRICTION
\$
DISP = ALL
SUBCASE 1
NLPARM = 410
SUBCASE 2
\$ DISPLACEMENT TO THE RIGHT
NLPARM = 420
SPC = 2
\$
BEGIN BULK
BCONP   10      40      50              10.     60      2       70
BFRIC   60                      0.1
BLSEG   40      12      13      14      15      16      17      18      +BLSG1
+BLSG1  19      20      21      22
BLSEG   50      25      24      23
CORD2R  70              0.      0.      0.      0.      0.      1.      +CRD10
+CRD10  1.      0.      0.
CQUAD4  1       1       1       2       13      12
CQUAD4  2       1       2       3       14      13
CQUAD4  3       1       3       4       15      14
CQUAD4  4       1       4       5       16      15
CQUAD4  5       1       5       6       17      16
CQUAD4  6       1       6       7       18      17
CQUAD4  7       1       7       8       19      18
CQUAD4  8       1       8       9       20      19
CQUAD4  9       1       9       10      21      20
CQUAD4  10      1       10      11      22      21
CQUAD4  11      1       23      24      27      26
CQUAD4  12      1       24      25      28      27
FORCE   1       26              -1000.  0.      1.      0.
FORCE   1       27              -2000.  0.      1.      0.
FORCE   1       28              -1000.  0.      1.      0.
GRID    1               0.      0.      0.              123456
GRID    2               10.     0.      0.              123456
GRID    3               20.     0.      0.              123456
GRID    4               30.     0.      0.              123456
GRID    5               40.     0.      0.              123456
GRID    6               50.     0.      0.              123456
GRID    7               60.     0.      0.              123456
GRID    8               70.     0.      0.              123456
GRID    9               80.     0.      0.              123456
GRID    10              90.     0.      0.              123456
GRID    11              100.    0.      0.              123456
GRID    12              0.      20.     0.              3456
GRID    13              10.     20.     0.              3456
GRID    14              20.     20.     0.              3456
GRID    15              30.     20.     0.              3456
GRID    16              40.     20.     0.              3456
GRID    17              50.     20.     0.              3456
GRID    18              60.     20.     0.              3456
GRID    19              70.     20.     0.              3456
GRID    20              80.     20.     0.              3456
GRID    21              90.     20.     0.              3456
GRID    22              100.    20.     0.              3456
GRID    23              45.     20.     0.              3456
GRID    24              55.     20.     0.              3456
GRID    25              65.     20.     0.              3456
GRID    26              45.     25.     0.              3456
GRID    27              55.     25.     0.              3456
GRID    28              65.     25.     0.              3456
MAT1    1       1.E5            0.0
NLPARM  410     1               AUTO                    PW      YES     +NLP41
+NLP41          1.E-6   1.E-10
NLPARM  420     10              AUTO                    PW      YES     +NLP42
+NLP42          1.E-6   1.E-10
PARAM   POST    -1
PSHELL  1       1       1.      -1
SPC     2       26      1       10.0
SPC     2       27      1       10.0
SPC     2       28      1       10.0
ENDDATA
```

In Code_Aster, you will need to create distinct files for the mesh and the commands. We will need to treat this problem as a two-dimensional one and create contact zones.

```

TITRE
prob9
SLINE2S: SYMMETRIC ELASTIC PUNCH WITH FRICTION
FINSF

COOR_2D

N1  0.0000000000e+00 0.0000000000e+00
N2  1.0000000000e+01 0.0000000000e+00
N3  2.0000000000e+01 0.0000000000e+00
N4  3.0000000000e+01 0.0000000000e+00
N5  4.0000000000e+01 0.0000000000e+00
N6  5.0000000000e+01 0.0000000000e+00
N7  6.0000000000e+01 0.0000000000e+00
N8  7.0000000000e+01 0.0000000000e+00
N9  8.0000000000e+01 0.0000000000e+00
N10  9.0000000000e+01 0.0000000000e+00
N11  1.0000000000e+02 0.0000000000e+00
N12  0.0000000000e+00 2.0000000000e+01
N13  1.0000000000e+01 2.0000000000e+01
N14  2.0000000000e+01 2.0000000000e+01
N15  3.0000000000e+01 2.0000000000e+01
N16  4.0000000000e+01 2.0000000000e+01
N17  5.0000000000e+01 2.0000000000e+01
N18  6.0000000000e+01 2.0000000000e+01
N19  7.0000000000e+01 2.0000000000e+01
N20  8.0000000000e+01 2.0000000000e+01
N21  9.0000000000e+01 2.0000000000e+01
N22  1.0000000000e+02 2.0000000000e+01
N23  4.5000000000e+01 2.0000000000e+01
N24  5.5000000000e+01 2.0000000000e+01
N25  6.5000000000e+01 2.0000000000e+01
N26  4.5000000000e+01 2.5000000000e+01
N27  5.5000000000e+01 2.5000000000e+01
N28  6.5000000000e+01 2.5000000000e+01
FINSF

SEG2
V1  N12 N13
V2  N13 N14
V3  N14 N15
V4  N15 N16
V5  N16 N17
V6  N17 N18
V7  N18 N19
V8  N19 N20
V9  N20 N21
V10 N21 N22
V11  N23 N24
V12  N24 N25
V13  N24 N17
FINSF

E1  N1 N2 N13 N12
E2  N2 N3 N14 N13
E3  N3 N4 N15 N14
E4  N4 N5 N16 N15
E5  N5 N6 N17 N16
E6  N6 N7 N18 N17
E7  N7 N8 N19 N18
E8  N8 N9 N20 N19
E9  N9 N10 N21 N20
E10  N10 N11 N22 N21
E11  N23 N24 N27 N26
E12  N24 N25 N28 N27
FINSF

GROUP_NO NOM = GNO00001
% Virtual node group
N1 N10 N11 N2 N3 N4 N5
N6 N7 N8 N9
FINSF
GROUP_NO NOM = GNO00002
% Virtual node group
N12 N13 N14 N15 N16 N17 N18
N19 N20 N21 N22 N23 N24 N25
N26 N27 N28
FINSF

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

GROUP_MA NOM = GMA00001
% Contact 1 slave
V1 V10 V2 V3 V4
V5 V6 V7 V8 V9
FINSF
GROUP_MA NOM = GMA00002
% Contact 1 master
V11 V12
FINSF

FIN
```

Then, the command file (file “prob9.comm”) :

```
# prob9
# SLINE2S: SYMMETRIC ELASTIC PUNCH WITH FRICTION

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

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

MAIL=MODI_MAILLAGE(reuse =MAIL,
MAILLAGE=MAIL,
ORIE_PEAU_2D=_F(GROUP_MA=('GMA00001','GMA00002'),),)

MODMECA=AFFE_MODELE(MAILLAGE=MAIL,
AFFE=_F(GROUP_MA='G1',
PHENOMENE='MECANIQUE',
#~ MODELISATION='DKT',
MODELISATION='C_PLAN',
),);

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

LST00002=DEFI_LIST_REEL(DEBUT=1.0,
INTERVALLE=_F(JUSQU_A=2.0,
NOMBRE=10,),);

MAT00001=DEFI_MATERIAU(ELAS=_F(E=100000.0,
NU=0.0,
RHO=0.0,),);

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

CINE0=AFFE_CHAR_CINE(MODELE=MODMECA,
MECA_IMPO=(_F(GROUP_NO='GNO00001',
DX=0.0,
DY=0.0,
),
),
);

CINE1=AFFE_CHAR_CINE(MODELE=MODMECA,
MECA_IMPO=_F(NOEUD=('N26','N27','N28',),
DX=0.0,),);

CINE2=AFFE_CHAR_CINE(MODELE=MODMECA,
MECA_IMPO=_F(NOEUD=('N26','N27','N28',),
DX=10.0,),);

CONT1=DEFI_CONTACT(MODELE=MODMECA,
FORMULATION='CONTINUE',
FROTTEMENT='COULOMB',
ZONE=_F(GROUP_MA_MAIT='GMA00002',
GROUP_MA_ESCL='GMA00001',
COULOMB=0.1,
),
);

CHARGE1=AFFE_CHAR_MECA(MODELE=MODMECA,
FORCE_NODALE=(_F(NOEUD=('N26','N28',),
FY=-1000.0,),
_F(NOEUD='N27',
FY=-2000.0,),),);

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

RAMPE1=DEFI_FONCTION(NOM_PARA='INST',VALE=(0,0,
1,1,
))

RESU1=STAT_NON_LINE(MODELE=MODMECA,
CHAM_MATER=CHMAT,
EXCIT=(_F(CHARGE=CHARGE1,FONC_MULT=RAMPE1,),
_F(CHARGE=CINE0,),
_F(CHARGE=CINE1,),),
CONTACT=CONT1,
COMPORTEMENT=_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,),);

LAUTO2=DEFI_LIST_INST(DEFI_LIST=_F(METHODE='AUTO',
LIST_INST=LST00002,),);

RAMPE2=DEFI_FONCTION(NOM_PARA='INST',VALE=(1,0,
2,1,
))

RESU2=STAT_NON_LINE(MODELE=MODMECA,
CHAM_MATER=CHMAT,
EXCIT=(_F(CHARGE=CHARGE1,),
_F(CHARGE=CINE0,),
_F(CHARGE=CINE2,FONC_MULT=RAMPE2),),
CONTACT=CONT1,
COMPORTEMENT=_F(GROUP_MA='G1',
RELATION='ELAS',),
ETAT_INIT=_F(EVOL_NOLI=RESU1,),
INCREMENT=_F(LIST_INST=LAUTO2,),
NEWTON=_F(REAC_ITER=1,),
SOLVEUR=_F(METHODE='MUMPS',
NPREC=8,),
ARCHIVAGE=_F(LIST_INST=LST00002,),);

IMPR_RESU(FORMAT='RESULTAT',
RESU=(_F(RESULTAT=RESU1,
INST=1.0,
NOEUD=('N22','N23'),
NOM_CHAM='DEPL'),
_F(RESULTAT=RESU2,
INST=2.0,
NOEUD=('N22','N23'),
NOM_CHAM='DEPL',),
)
);

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

FIN(FORMAT_HDF='OUI',);
```

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

```
P actions make_etude
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 version testing
A memjeveux 375.0
A tpmax 172800
P memjob 3072000
P tpsjob 2880
F comm prob9.comm D 1
F mail prob9.mail D 20
F mess prob9.mess R 6
F resu prob9.resu R 8
F rmed prob9.rmed R 80
```