Code_Aster ®
Version
7.4
Titrate:
Simple example of use


Date:
26/05/05
Author (S):
Mr. ABBAS, J.M. PROIX, NR. TARDIEU Key
:
U1.05.00-C Page
: 1/10

Organization (S): EDF-R & D/AMA
Handbook of Utilization
U1.0- booklet: Introduction to Code_Aster
Document: U1.05.00

Simple example of use

Summary:

This document describes a very simple example of use of Code_Aster.

One illustrates the commands “impossible to circumvent” on the calculation of a tank (cylinder thin under pressure
hydrostatic) modelled into axisymmetric.

The command file is analyzed, as well as the file of results.
Handbook of Utilization
U1.0- booklet: Introduction to Code_Aster
HT-66/05/004/A

Code_Aster ®
Version
7.4
Titrate:
Simple example of use


Date:
26/05/05
Author (S):
Mr. ABBAS, J.M. PROIX, NR. TARDIEU Key
:
U1.05.00-C Page
: 2/10

1
To model a mechanical problem with Code_Aster

The problem to be modelled is a thin cylindrical tank (thickness 0.02m, average radius R=1m,
L=4m height) subjected to a pressure interns variable with the height, corresponding to a pressure
hydrostatic.

Being given symmetries of the geometry and
R=1m
loading, one chooses a modeling
two-dimensional axisymmetric.

It will thus be enough to represent a vertical section of
this cylinder (in plan X Y)

The two stages to be envisaged are:
L=4m

·
the creation of the grid
·
the drafting of the command file


2
Manufacture of the grid: what to envisage?

y
Some is the software of grid used (GIBI, IDEAS,
GMSH), it is necessary to envisage, as of the creation of the grid, of
to name the entities which will be used in calculation to affect
D
C
elementary characteristics, conditions with
limits, of the loadings, materials…

Indeed, although it is possible to use them directly
numbers of nodes and meshs in the file of
commands, it is preferable to use entities
named. This makes it possible to have a command file
ldf
independent of the degree of refinement of the grid, and
of a possible renumerotation of the nodes or
elements.

In practice, these entities are groups:
charg

·
groups of nodes (possibly containing one
only node, like the points A, B, C, D in
the example),
lfa
·
groups of meshs corresponding to
under-fields of the grid, or many meshs
used to apply the loadings: here by
example, groups of meshs lfa, ldf
contain linear meshs (meshs of
With
B
skin) which will be used to apply the pressure.
support
X

Handbook of Utilization
U1.0- booklet: Introduction to Code_Aster
HT-66/05/004/A

Code_Aster ®
Version
7.4
Titrate:
Simple example of use


Date:
26/05/05
Author (S):
Mr. ABBAS, J.M. PROIX, NR. TARDIEU Key
:
U1.05.00-C Page
: 3/10

3
How to write its command file?

3.1
To start from nothing?

When one wants to model a new thermomechanical problem, one does not leave in general
white sheet: it is useful to take as a starting point a command file of a modeling close to that
to treat. How to obtain these files? The sources are varied:

·
the base of the tests of Code_Aster, with its documentation, is often an important help,
because it covers most of the functionalities of the code (one can find these tests in
the repertory astest),
·
the formations make it possible to know the whole of the commands thoroughly
paying to types of modelings
: statics linear, thermal, dynamic,
thermo plasticity, post_traitement…

The drafting of this command file will be largely facilitated by using the editor of file of
commands EFICAS.

3.2
Commands with the magnifying glass

We now will detail the commands necessary to the realization of calculation considered.

File of Commandes
Explanations


# TITER Cylindre mean under pressure
The comments are preceded by sign #,
hydrostatic


DEBUT ();
Obligatory command to start…
PRE_GMSH ();
The grid is with format GMSH
mall = LIRE_MAILLAGE ();
Reading of the grid in the file of grid,
and creation of the concept mall containing it
grid with the Aster format


# Redefinition of the groups of nodes and
groups of meshs


mail=DEFI_GROUP (reuse =mail,
Definition of the groups of meshs from
MAILLAGE=mail,
those created in GMSH
CREA_GROUP_MA= (_F (NOM=' APPUI',
GROUP_MA=' GM11',),
_F (NOM=' LDF',

GROUP_MA=' GM13',),
_F (NOM=' LFA',

GROUP_MA=' GM14',),
_F (NOM=' ND_A',
GROUP_MA=' GM1',),
_F (NOM=' ND_B',
GROUP_MA=' GM2',),
_F (NOM=' ND_C',
GROUP_MA=' GM3',),
_F (NOM=' ND_D',
GROUP_MA=' GM4',),
),);









# Definition of the model
A model is a concept containing the types
finite elements useful for calculation
Handbook of Utilization
U1.0- booklet: Introduction to Code_Aster
HT-66/05/004/A

Code_Aster ®
Version
7.4
Titrate:
Simple example of use


Date:
26/05/05
Author (S):
Mr. ABBAS, J.M. PROIX, NR. TARDIEU Key
:
U1.05.00-C Page
: 4/10


modl=AFFE_MODELE (MAILLAGE=mail,
Associate all the meshs grid of
axisymmetric mechanical finite elements
AFFE=_F (TOUT=' OUI',

PHENOMENE=' MECANIQUE', Une even command can continue on
MODELISATION=' AXIS',),); several lines

# Definition of material



acier=DEFI_MATERIAU (ELAS=_F (E=210000000000.0, Les characteristics of each material
constituting the grid are provided
NU=0.3,),);
Young modulus and Poisson's ratio


chmat=AFFE_MATERIAU (MAILLAGE=mail,
Assignment of material on the grid
AFFE=_F (TOUT=' OUI',
Here the material is the same one for all the grid
MATER=acier,),); If not one could affect materials
different on groups from meshs


# Definition of the boundary conditions
The boundary conditions can relate to

nodes, of the groups of nodes, the meshs or
groups of meshs.

clim=AFFE_CHAR_MECA (MODELE=modl,
Here nodes of the group of meshs APPUI
FACE_IMPO=_F (GROUP_MA=' APPUI',
(meshs of edge) are affected
condition:
DY=0,),);
DY = 0 what means:
“displacement following” no one there


# Definition of the loading: pressure function Les functions are point by point defined
of y
(variation refines between two points per defect)



f_y=DEFI_FONCTION (NOM_PARA=' Y',
Here, the pressure varies between:
VALE= (0.0, 20000.0,
20000 Pa for y=0
4.0, 0.0,),);
and 0 for y = L




charg=AFFE_CHAR_MECA_F (MODELE=modl,
Assignment of the pressure (function of y) on
PRES_REP=
edge made up of the groups of meshs LFA LDF
_F (GROUP_MA= (“LFA”, “LDF”,),
PRES=f_y,),);



# Resolution
Total ordering of resolution of the problems
statics in thermo linear elasticity
res1=MECA_STATIQUE (MODELE=modl,

CHAM_MATER=chmat,
The material field
EXCIT= (_F (CHARGE=charg,), One defines the loadings
_F (CHARGE=clim,),),);

res1 is the name of the concept result containing
the field of displacements






# Calculation of the constraints
reuse=res1 means that one “
enriches “it
concept
res1=CALC_ELEM (reuse =res1,
res1: the stress field will be stored
in addition to the field of displacements
RESULTAT=res1,

OPTION=' SIGM_ELNO_DEPL',);
Name “SIGM_ELNO_DEPL” means
“forced calculated with the nodes of each
Handbook of Utilization
U1.0- booklet: Introduction to Code_Aster
HT-66/05/004/A

Code_Aster ®
Version
7.4
Titrate:
Simple example of use


Date:
26/05/05
Author (S):
Mr. ABBAS, J.M. PROIX, NR. TARDIEU Key
:
U1.05.00-C Page
: 5/10


element starting from displacements “

# Impression of the results at points A B C D

IMPR_RESU (MODELE=modl,
Impression of the results to the format text
RESU=_F (RESULTAT=res1,
displacements with the nodes
GROUP_MA=' ND_A',),);
corresponding to points A B C D


IMPR_RESU (MODELE=modl,

RESU=_F (RESULTAT=res1,

GROUP_MA=' ND_B',),);



IMPR_RESU (MODELE=modl,

RESU=_F (RESULTAT=res1,

GROUP_MA=' ND_C',),);



IMPR_RESU (MODELE=modl,

RESU=_F (RESULTAT=res1,

GROUP_MA=' ND_D',),);



# Impression of the results

IMPR_RESU (MODELE=modl,
Impression of the results to the format text
RESU=_F (RESULTAT=res1,),);
displacements/forced on all the grid








# Impression of the results for visualization
with GMSH


DEFI_FICHIER (ACTION=' ASSOCIER',
Definition of the logical unit for file GMSH
UNITE=37,)

IMPR_RESU (MODELE=modl,
Impression of the results to format GMSH
FORMAT=' GMSH',
UNITE=37,
RESU=_F (RESULT = RES1,),)

DEFI_FICHIER (ACTION=' LIBERER',
Closing of the logical unit
UNITE=37,)

FIN ();

Obligatory command to close an execution
Handbook of Utilization
U1.0- booklet: Introduction to Code_Aster
HT-66/05/004/A

Code_Aster ®
Version
7.4
Titrate:
Simple example of use


Date:
26/05/05
Author (S):
Mr. ABBAS, J.M. PROIX, NR. TARDIEU Key
:
U1.05.00-C Page
: 6/10

4
What contains the file of results?

=> a heading pointing out the date, the version, the platform used:

-- CODE_ASTER -- VERSION OF DEVELOPMENT 7.04.00 --

COPYRIGHT EDF-R & D 2003

EXECUTION OF: ME-11-JUIN-2003 10:11:32

PLATE-FORME: CLA1ASTR.CLA.EDF

NB MAX PROC: 1

SYSTEME: OSF1

CPU: ALPHA

--------------------------------------------------------------------------------
ASTER 7.01.07 CONCEPT RES1 CALCULATES THE 11/06/2003 A 10:11:34 OF TYPE EVOL_ELAS



=> Impression of the field of displacements to the nodes of the groups (points) A, B, C, D:

GROUP_MA: ND_A
FIELD WITH THE NODES OF REFERENCE SYMBOL DEPL
SEQUENCE NUMBER: 1 INST: 0.00000E+00
NODE DX DY
N1 4.68143E-06 3.74958E-24

GROUP_MA: ND_B
FIELD WITH THE NODES OF REFERENCE SYMBOL DEPL
SEQUENCE NUMBER: 1 INST: 0.00000E+00
NODE DX DY
N2 4.65280E-06 5.20865E-24

GROUP_MA: ND_C
FIELD WITH THE NODES OF REFERENCE SYMBOL DEPL
SEQUENCE NUMBER: 1 INST: 0.00000E+00
NODE DX DY
N3 1.20218E-06 - 2.63963E-06

GROUP_MA: ND_D
FIELD WITH THE NODES OF REFERENCE SYMBOL DEPL
SEQUENCE NUMBER: 1 INST: 0.00000E+00
NODE DX DY
N4 3.31016E-09 - 2.81696E-06


=> Impression of the stress field

FIELD BY ELEMENT WITH THE NODES OF REFERENCE SYMBOL SIGM_ELNO_DEPL
SEQUENCE NUMBER: 1 INST: 0.00000E+00
M37 SIXX SIYY SIZZ SIXY
N3 - 5.13918E+03 - 1.03624E+04 2.42856E+05 6.82275E+01 => Point C
N54 - 4.40750E+03 - 9.63147E+03 2.44564E+05 - 4.70082E+01
N55 4.14124E+03 1.04408E+04 3.02923E+05 - 6.66820E+01
N24 3.26306E+03 9.56344E+03 3.00873E+05 4.85536E+01
M51 SIXX SIYY SIZZ SIXY
N11 - 3.38160E+03 4.89698E+03 9.41453E+05 2.91041E+04 => Point B
N68 - 2.46101E+03 3.32521E+03 9.46093E+05 2.90567E+04
N10 - 9.31239E+02 9.59144E+03 9.65451E+05 - 3.32524E+04
N2 - 1.90427E+03 1.11108E+04 9.60688E+05 - 3.32050E+04
M111 SIXX SIYY SIZZ SIXY
Handbook of Utilization
U1.0- booklet: Introduction to Code_Aster
HT-66/05/004/A

Code_Aster ®
Version
7.4
Titrate:
Simple example of use


Date:
26/05/05
Author (S):
Mr. ABBAS, J.M. PROIX, NR. TARDIEU Key
:
U1.05.00-C Page
: 7/10

N110 - 2.00922E+04 - 1.00398E+04 9.51623E+05 2.92456E+04
N50 - 1.90559E+04 - 1.15088E+04 9.56546E+05 2.92049E+04
N1 - 1.61470E+04 - 4.53210E+03 9.76893E+05 - 3.34251E+04 => Point A
N7 - 1.72353E+04 - 3.11525E+03 9.71848E+05 - 3.33844E+04
M112 SIXX SIYY SIZZ SIXY
N3 3.43073E+03 9.63409E+03 2.51426E+05 5.11140E+01 => Point C
(belongs to several meshs)
N25 - 4.96037E+03 - 1.02898E+04 1.93404E+05 5.97663E+01
N111 - 4.37491E+03 - 9.70470E+03 1.94770E+05 - 5.55617E+01
N54 4.16274E+03 1.03658E+04 2.53134E+05 - 6.42140E+01


=> a table summarizing the commands used and time CPU of each one:

***********************************************************
* ORDER * TO USE * TOTAL SYSTEM * *
***********************************************************
* DEBUT: 0.02: 0.03: 0.05 *
* PRE_GMSH: 0.02: 0.02: 0.03 *
* LIRE_MAILLAGE: 0.02: 0.00: 0.02 *
* DEFI_GROUP: 0.02: 0.00: 0.02 *
* AFFE_MODELE: 0.02: 0.00: 0.02 *
* DEFI_MATERIAU: 0.07: 0.00: 0.07 *
* AFFE_MATERIAU: 0.00: 0.00: 0.00 *
* AFFE_CHAR_MECA: 0.03: 0.00: 0.03 *
* DEFI_FONCTION: 0.00: 0.00: 0.00 *
* AFFE_CHAR_MECA_F: 0.02: 0.02: 0.03 *
* MECA_STATIQUE: 0.08: 0.03: 0.12 *
* CALC_ELEM: 0.03: 0.00: 0.03 *
* IMPR_RESU: 0.08: 0.02: 0.10 *
* IMPR_RESU: 0.03: 0.02: 0.05 *
* IMPR_RESU: 0.05: 0.00: 0.05 *
* IMPR_RESU: 0.05: 0.00: 0.05 *
* IMPR_RESU: 0.05: 0.00: 0.05 *
* IMPR_RESU: 0.17: 0.20: 0.37 *
* FIN: 0.00: 0.03: 0.03 *
***********************************************************
* TOTAL_JOB: 0.83: 0.42: 1.25 *
***********************************************************
Handbook of Utilization
U1.0- booklet: Introduction to Code_Aster
HT-66/05/004/A

Code_Aster ®
Version
7.4
Titrate:
Simple example of use


Date:
26/05/05
Author (S):
Mr. ABBAS, J.M. PROIX, NR. TARDIEU Key
:
U1.05.00-C Page
: 8/10

5
And other files produced by calculation?

5.1
File MESSAGE

This file contains the echo of the commands and gives additional information on the execution
of each command:

for example MECA_STATIQUE:
# -----------------------------------------------------------------------
# ORDERS NO: 0011 CONCEPT OF THE TYPE: evol_elas
# ------------- -----------------
res1=MECA_STATIQUE (CHAM_MATER=chmat,
MODELE=modl,
ANGLE=0,
NIVE_COUCHE=' MOY',
NUME_COUCHE=1,
SOLVEUR=_F (NPREC=8,
METHODE=' MULT_FRONT',
STOP_SINGULIER=' OUI',
RENUM=' METIS'),
INFO=1,
PLAN=' MAIL',
INST=0.0,
EXCIT= (_F (CHARGE=charg,
TYPE_CHARGE=' FIXE'),
_F (CHARGE=clim,
TYPE_CHARGE=' FIXE')),
);

--- NUMBERS TOTAL NODES: 138 DONT:
12 NODES “LAGRANGE”
--- NUMBERS TOTAL EQUATIONS: 264
--- A NUMBER OF NONNULL COEFFICIENTS IN THE MATRIX: 2120
--- A NUMBER OF BLOCKS USE FOR STORAGE: 1

5.2
File GMSH

File GMSH (filled by IMPR_RESU, format “GMSH”) contains the data necessary to
visualization.

In the same way for the other files of interface with software of graphic postprocessing (IDEAS,
ENSIGHT)

or software of layout of curves XMGRACE.

5.3
Generation of the grid with GMSH

One proposes here the file geo allowing the generation of the grid with GMSH (software free and free).

//////////////////////////////////////////////////////////////
//Grid of the tank ­ GMSH V1.60
//////////////////////////////////////////////////////////////

//Variable
//Rayon interns tank
Rint = 1;
//Thickness of the wall
ep = 0.02;
//External Radius of the tank
Rext = Rint+ep;
//Height of the tank
H = 4;
Handbook of Utilization
U1.0- booklet: Introduction to Code_Aster
HT-66/05/004/A

Code_Aster ®
Version
7.4
Titrate:
Simple example of use


Date:
26/05/05
Author (S):
Mr. ABBAS, J.M. PROIX, NR. TARDIEU Key
:
U1.05.00-C Page
: 9/10

//A Number of elements on the horizontal one
nbelh= 5;
//A Number of elements on the vertical
nbelv= 20;

//Points
Not (1) = {Rint, 0,0,1};
Not (2) = {Rext, 0,0,1};
Not (3) = {Rext, 0.75 * H, 0,1};
Not (4) = {Rext, H, 0,1};
Not (5) = {Rint, H, 0,1};
Not (6) = {Rint, 0.75 * H, 0,1};

//Lines
Line (1) = {1,2};
Line (2) = {2,3};
Line (3) = {3,4};
Line (4) = {4,5};
Line (5) = {5,6};
Line (6) = {6,1};
Line (7) = {6,3};


//Surface regulated for regulated grid
Line Loop (1) = {- 2, - 1, - 6,7};
Ruled Surfaces (1) = {1};
Line Loop (2) = {3, 4, 5, 7};
Ruled Surfaces (2) = {2};

//Description of the groups of meshs/nodes (points)
Physical Not (1) = {1};
Physical Not (2) = {2};
Physical Not (3) = {3};
Physical Not (4) = {4};
Physical Not (5) = {5};
Physical Not (6) = {6};

//Description of the groups of meshs/nodes (lines)
Physical Line (11) = {1};
Physical Line (12) = {4};
Physical Line (13) = {5};
Physical Line (14) = {6};

//Description of the groups of meshs/nodes (surface)
Physical Surfaces (21) = {1,2};

//Smoothness of the grid (regulated)
Transfinite Line {1} = nbelh+1;
Transfinite Line {4} = nbelh+1;
Transfinite Line {7} = nbelh+1;
Transfinite Line {5,3} = 0.25 * nbelv+1;
Transfinite Line {2,6} = 0.75 * nbelv+1;

Transfinite Surfaces {1} = {3,6,1,2};
Transfinite Surfaces {2} = {3, 4, 5, 6};

//Passage triangles->quadrangles
Recombine Surface {1,2};

GMSH will generate the groups of meshs 1 to 6 (points), 11 to 14 (lines) and 21 groups it (surface). These
groups of meshs are recovered in Code_Aster with name GM # # where # # is the number of
group GMSH.
In our example, we redefine these names by DEFI_GROUP to have a name of it more
convenient (APPUI, LFA, LDE).
Handbook of Utilization
U1.0- booklet: Introduction to Code_Aster
HT-66/05/004/A

Code_Aster ®
Version
7.4
Titrate:
Simple example of use


Date:
26/05/05
Author (S):
Mr. ABBAS, J.M. PROIX, NR. TARDIEU Key
:
U1.05.00-C Page
: 10/10

Intentionally white left page.
Handbook of Utilization
U1.0- booklet: Introduction to Code_Aster
HT-66/05/004/A

Outline document