A simple mechanical study
code_aster, salome_meca course materialGNU FDL licence (http://www.gnu.org/copyleft/fdl.html)
Outline
1. Introducing a simple study
2. Starting the study
3. Data settings
4. Solving the problem
5. Post-processing the resultsGNU FDL licence | code_aster, salome_meca course material
3
1. Introducing a simple study
A pump of the safety injection system (RIS)
GNU FDL licence | code_aster, salome_meca course material
Under a constant internal pressure
Inlet pipe
Outlet pipe
4
1. Introducing a simple study
A pump of the safety injection system (RIS)
GNU FDL licence | code_aster, salome_meca course material
Simplifications and hypotheses
Simplify the connexions
Intake, Exhaust : supported forces
Simplify the fixation :
Haut, Face_bas are clamped
Intake
Exhaust
Haut
Face_Bas
Outline
1. Introducing a simple study
2. Starting the study
3. Data settings
4. Solving the problem
5. Post-processing the resultsGNU FDL licence | code_aster, salome_meca course material
6
2. Starting the study
Mesh in code_aster
GNU FDL licence | code_aster, salome_meca course material
Mesh consists of
Coordinates of nodes
Cells defined by their connectivity
Groups of cells (GROUP_MA) and groups of nodes (GROUP_NO)
7
2. Starting the study
Mesh in code_aster
GNU FDL licence | code_aster, salome_meca course material
8
2. Starting the study
Mesh in code_aster
GNU FDL licence | code_aster, salome_meca course material
Import mesh in different formats
MED format (default input format)
Aster format and other foramts (GIBI, IDEAS, GMSH)
MAIL = LIRE_MAILLAGE ( FORMAT = … )
Orientation of the normals
Check for plate/shell elements or the borders where a pressure is applied
Reorients properly the cells where contact is defined
Command MODI_MAILLAGE
Keywords : ORIE_NORM_COQUE, ORIE_PEAU_2D, ORIE_PEAU_3D
Direct display
Outline
1. Introducing a simple study
2. Starting the study
3. Data settings
4. Solving the problem
5. Post-processing the resultsGNU FDL licence | code_aster, salome_meca course material
10
3. Data setting
Finite elements
GNU FDL licence | code_aster, salome_meca course material
What is a finite element ?
A geometric description, provided by the mesh
Shape functions
Degrees of freedom
The choice determines
equations to solve
Discretization and integration hypothesis
Unknowns fields
11
3. Data setting
Finite elements
GNU FDL licence | code_aster, salome_meca course material
12
3. Data setting
Finite elements
GNU FDL licence | code_aster, salome_meca course material
Defined by command AFFE_MODELE
Example for mechanical phenomenon, with 3D elements:
MODE = AFFE_MODELE ( AFFE = _F ( GROUP_MA ='ZONE_1',
PHENOMENE = 'MECANIQUE‘,
MODELISATION = '3D'),)
Different choices for 3D, 2D, 1D, 0D elements
MODELISATION = / '3D' / 'D_PLAN' / 'POU_D_T'
/ '3D_SI' / 'C_PLAN' / 'TUYAU'
/ '3D_THM' / 'DKT' / …
/ … / …
3D isoparametric
mechanical element
13
3. Data setting
Finite elements
GNU FDL licence | code_aster, salome_meca course material
Mixture of finite elements
Kinematic connections between different degrees of freedom ( in the definitions of
loadings and boundary conditions)
Direct display
14
3. Data setting
Materials – Definition
GNU FDL licence | code_aster, salome_meca course material
Defined through numerical parameters of properties
Units are not managed by code_aster: the user must use a consistent system of units
throughout the study
Example:
Coordinates of the mesh nodes mm m
Young's modulus MPa Pa
Applied force N N
Stress obtained as a result MPa Pa
15
3. Data setting
Materials – Definition
GNU FDL licence | code_aster, salome_meca course material
16
3. Data setting
Materials – Assignment
GNU FDL licence | code_aster, salome_meca course material
Assigned to the mesh
Overloading rule
Example:
STEEL1 = DEFI_MATERIAU( ELAS = _F( E = 305000.0E6, NU = 0.3, ), )
STEEL2 = DEFI_MATERIAU( ELAS = _F( E = 405000.0E6, NU = 0.3, ), )
CHMAT1 = AFFE_MATERIAU( MAILLAGE=MESH,
AFFE =(_F(GROUP_MA=('GR1','GR2',),
MATER=STEEL1,),
_F(GROUP_MA=('GR2',),
MATER=STEEL2,),),)
GR1
GR2
1 2
1
2Direct display
17
3. Data setting
Materials – Assignment
GNU FDL licence | code_aster, salome_meca course material
Assigned to the mesh
Assignment after the definition, and used directly in the solving operators
Example:
STEEL1 = DEFI_MATERIAU( ELAS = _F( E = 205000.0E6, NU = 0.3, ), )
STEEL2 = DEFI_MATERIAU( ELAS = _F( E = 305000.0E6, NU = 0.3, ), )
STEEL3 = DEFI_MATERIAU( ELAS = _F( E = 405000.0E6, NU = 0.3, ), )
CHMAT1 = AFFE_MATERIAU( MAILLAGE=MESH,
AFFE =_F(TOUT='OUI',
MATER= STEEL2,),)
CHMAT2 = AFFE_MATERIAU( MAILLAGE=MESH,
AFFE =_F(TOUT='OUI',
MATER= STEEL3,),)
RESU = MECA_STATIQUE(...
CHAM_MATER= CHMAT1,
...)
18
3. Data setting
Materials – Consistency with constitutive equation
GNU FDL licence | code_aster, salome_meca course material
Materials must be consistent with the resolution assumptions
Example: VMIS_ISOT_TRAC, constitutive equation for von Mises elasto-plasticity with
isotropic nonlinear hardening
steel=DEFI_MATERIAU(ELAS =_F(E=2.1.E11, NU=0.3,),)
TRACTION =_F( SIGM = CTRACB),)
mater=AFFE_MATERIAU(MAILLAGE=mesh,
AFFE=_F(TOUT='OUI', MATER=steel,),)
result=STAT_NON_LINE( ... CHAM_MATER=mater,
COMPORTEMENT=_F(
RELATION = 'VMIS_ISOT_TRAC'),)
19
3. Data setting
Boundary conditions and loading
GNU FDL licence | code_aster, salome_meca course material
20
3. Data setting
Boundary conditions and loading
GNU FDL licence | code_aster, salome_meca course material
Commands AFFE_CHAR_****(_F)
With _F => functions
**** => MECA / CINE / THER
Example – different choices of boundary conditions in MECA:
Be careful of the consistency with the DOF allowed by the chosen finite element
Imposed relationships on the degrees of freedom (DOF)
| DDL_IMPO Unknowns imposed on a node or group| FACE_IMPO Unknowns imposed on the nodes of a cell or a group of cells| LIAISON_SOLIDE Rigid body element on a set of nodes or cells| LIAISON_ELEM 3D-beam, beam-shell, 3D-pipe connections …| LIAISON_COQUE connection between shells
Direct display
21
3. Data setting
Boundary conditions and loading
GNU FDL licence | code_aster, salome_meca course material
Commands AFFE_CHAR_****(_F)
Loadings used as boundary conditions
Example – different choices of loadings in MECA
Loadings inside the continuous media
| PESANTEUR
| ROTATION
| FORCE_INTERNE
| FORCE_NODALE
. . .
Border loadings
| FORCE_FACE
| FORCE_ARETE
| FORCE_CONTOUR
| PRES_REP
. . .
Loadings specific to structural elements
| FORCE_POUTRE
| FORCE_COQUE
| FORCE_TUYAU
. . .
Direct display
Outline
1. Introducing a simple study
2. Starting the study
3. Data settings
4. Solving the problem
5. Post-processing the resultsGNU FDL licence | code_aster, salome_meca course material
23
4. Solving the problem
Setting of solving operators
GNU FDL licence | code_aster, salome_meca course material
~ 15 resolution operators to solve the physical problems
Thermics: THER_LINEAIRE, THER_NON_LINE
Mechanics: MECA_STATIQUE, STAT_NON_LINE
Dynamics: DYNA_VIBRA, DYNA_NON_LINE
Modal calculation: CALC_MODES
24
4. Solving the problem
Setting of solving operators
GNU FDL licence | code_aster, salome_meca course material
25
4. Solving the problem
Setting of solving operators
GNU FDL licence | code_aster, salome_meca course material
Input the description of the problem prior to solving
The model: MODELE
Materials: CHAM_MATER
Geometrical characteristics (for structural elements): CARA_ELEM
Loadings: EXCIT
A time stepping if necessary: LIST_INST (Appendix)
One can also change settings on the resolution algorithm =>
advanced usage
In most cases, the default values are suitable
Analysis Summary
26
4. Solving the problem
Setting of solving operators
GNU FDL licence | code_aster, salome_meca course material
Choosing the linear solver
via the keyword SOLVEUR / METHODE, Relevant depending on the problem
Direct solvers
MUMPS (MUltifrontal Massively Parallel sparse direct Solver): Default method. external
solver. Slightly broader scope than MULT_FRONT. Provides access to parallelism.
MULT_FRONT (multi-frontal): Universal solver, very robust. Not recommended for mixed
models of X-FEM, incompressible ...
27
4. Solving the problem
Setting of solving operators
GNU FDL licence | code_aster, salome_meca course material
Choosing the linear solver
via the keyword SOLVEUR / METHODE, Relevant depending on the problem
Iterative solvers
GCPC (Preconditioned conjugate gradient): recommended method for thermics. Useful for
well conditioned, large problems.
PETSC: external multi-method solver. Very fast and robust when associated with pre-
conditioner LDLT_SP. Provides access to parallelism.
28
4. Solving the problem
Setting of solving operators
GNU FDL licence | code_aster, salome_meca course material
Use of parallelism
Choose SOLVEUR=_F(METHODE=‘MUMPS’) or
SOLVEUR=_F(METHODE=‘PETSC’)
Choose a MPI version of code_aster
Choose the number of processors
Moderate parallelism: Up to 8 processors, the gains are virtually guaranteed for large
enough problems (50000 unknowns)
Massive parallelism: for huge studies (Exemple, 200 millions DOF and 2000 time steps
during 5h with 2000 processors
Outline
1. Introducing a simple study
2. Starting the study
3. Data settings
4. Solving the problem
5. Post-processing the resultsGNU FDL licence | code_aster, salome_meca course material
30
5. Post-processing the results
Results in code_aster
GNU FDL licence | code_aster, salome_meca course material
31
5. Post-processing the results
Results in code_aster – fields, tables, functions
GNU FDL licence | code_aster, salome_meca course material
Fields: CALC_CHAMP / CREA_CHAMP
Tables: POST_ELEM / CREA_TABLE / CALC_TABLE /
POST_RELEVE_T / MACR_LIGN_COUPE
Functions: RECU_FONCTION
32
5. Post-processing the results
Results in code_aster – Output files
GNU FDL licence | code_aster, salome_meca course material
IMPR_RESU
Meshes / Fields / Data contained in a result data structure.
Different formats: RESULTAT / ASTER/ MED / GMSH/ IDEAS
IMPR_TABLE
Different formats: Print the contents of a table in a listing or an Excel file, also plot
curves
IMPR_FONCTION
Extract the evolution of a quantity as a function of another
Formats ‘TABLEAU’ or ‘XMGRACE’,
33
5. Post-processing the results
Results in code_aster – Post-process
GNU FDL licence | code_aster, salome_meca course material
34
5. Post-processing the results
Results in code_aster
GNU FDL licence | code_aster, salome_meca course material
Single field, single physical quantity: cham_gd
Type;
Several components;
A single access number (no time step for example).
Result data structure: resultat
Gathering several fields of quantities in a given physics;
Several access numbers;
Parameters (depending on the model).
35
5. Post-processing the results
Results in code_aster - Fields
GNU FDL licence | code_aster, salome_meca course material
Naming rule XXXX_YYYY :
Four first characters: name of the quantity (SIGM, EPSI, ERRE, etc);
Four last characters : location (NOEU, ELGA, ELNO or ELEM).
Examples:
Exception! DEPL, VITE, ACCE
SIEQ_ELNO, SIGM_ELNO
36
5. Post-processing the results
Results in code_aster - Fields
GNU FDL licence | code_aster, salome_meca course material
Location of the values:
Fields on nodes (NOEU) ;
On the elements: (ELGA) (ELNO) (ELEM).
37
5. Post-processing the results
Results in code_aster – Data structure resultat
GNU FDL licence | code_aster, salome_meca course material
Produced by resolution operators
The type depends on the operator:
EVOL_ELAS (linear mechanics), EVOL_NOLI (non-linear mechanics), EVOL_THER
(linear thermics), MODE_MECA (modal analysis), ...
At each computation step, one or more fields are stored in the
data structure resultat
Fields are identified by access variables: INST, NUME_ORDRE, FREQ, NUME_MODE, ...
Examples of stored fields
Temperatures for a list of time steps / Displacements for the first n modes
Displacements and stresses for a list of time steps
Outline
1. Introducing a simple study
2. Starting the study
3. Data settings
4. Solving the problem
5. Post-processing the resultsGNU FDL licence | code_aster, salome_meca course material
Go
further !
39
Go further
Redo this study with assistant
GNU FDL licence | code_aster, salome_meca course material
Step 1: Choose the type of your study
40
Go further
Redo this study with assistante
GNU FDL licence | code_aster, salome_meca course material
Step 2 : Edit et/or add commands
41
Go further
Analysis summary before the launch
GNU FDL licence | code_aster, salome_meca course material
Verifier the data setting of the study
42
Go further
Calculation information
GNU FDL licence | code_aster, salome_meca course material
Follow-up
43
Go further
Study with several stages
GNU FDL licence | code_aster, salome_meca course material
Good practice for several cases:
Analysis + Post-processing
Thermal analysis + mechanical analysis
44
Go further
Calculation information
GNU FDL licence | code_aster, salome_meca course material
Messages : find the error quickly (only redo post-processing)
45
Go further
Calculation information
GNU FDL licence | code_aster, salome_meca course material
Messages : find the error quickly (only redo post-processing)
46
Go further
Results view in Post-Process
GNU FDL licence | code_aster, salome_meca course material
47
Go further
Access to other modules
GNU FDL licence | code_aster, salome_meca course material
MESH: dynamic link
(Post-Process =>)ParaVIS
ADAO
OpenTurns
Variables
One value (Table in Numpy format) => Launch to verfify
(Click CurrentCase) Export to OpenTurns
End of presentation
Is something missing or unclear in this document?
Or feeling happy to have read such a clear tutorial?
Please, we welcome any feedbacks about Code_Aster training materials.
Do not hesitate to share with us your comments on the Code_Aster forum
dedicated thread.
GNU FDL licence | code_aster, salome_meca course material
49
Appendix
Special commands
GNU FDL licence | code_aster, salome_meca course material
DEBUT command
Begins execution, previous lines are ignored
POURSUITE command
Restarts execution from a database provided as an input
Useful to continue a calculation initiated with the same version of code_aster
Recommended to separate the calculation from the post-processing
FIN command
Ends the command file and ends the run, following lines are ignored
Closes the database at the end of execution
Specifies the format used for the produced base: HDF or Aster
Calculation: DEBUT() … FIN()
Post-processing: POURSUITE() … FIN()
50
Appendix
Functions and time stepping
GNU FDL licence | code_aster, salome_meca course material
Functions
Define a real or complex function of a real variable
Usually for the loading or boundary conditions, which depends on space or time
Time stepping
Time list for the calculation
Time management for the iterative algorithms
FUNC = DEFI_FONCTION( NOM_PARA = ‘Y’,
VALE = ( 0.0, 200000.0, 4.0, 0.0) )
listr = DEFI_LIST_REEL( DEBUT = 0.0,
INTERVALLE = _F( JUSQU_A = 10.0,
NOMBRE = 10 ) )
time = DEFI_LIST_INST( DEFI_LIST = _F( LIST_INST = listr,) )