Você está na página 1de 12

Getting started with Code_Aster Finite Element Program and Salome_Meca

platform

EDF R&D

Modelling and Simulation Centre

School of MACE

Manchester University

The objective of that Tutorial is to present Code_Aster and Salome_meca platform and to guide you
through a first simple example.

Code_Aster
Salome_meca
1. Code_Aster and Salome_meca short presentation

Simulation challenges guided by industrial


needs

Code_Aster in a few words


 An all-purpose FEA software for structural mechanics :

 Plugged in a user-friendly inter-operable environment : Salome_Meca


Code_Aster in a few figures

60 releases each year


1.250 documents freely available ( 17.000 pages)
15 PHD for the 8 last years
250 new features in the code in 2008
2.300 tests runned for each release

CODE_ASTER as a GPL free software since 2001 :


50.000 downloads, more than 10. 000 hits each week

Code_Aster Capabilities
Large range of capabilities for structural analysis
Thermal and mechanical analysis
Static and dynamic analysis, linear or non-linear
Modal analysis, harmonic and random response
400 finite element types : 3D, 2D, shells, beams, pipes

Wide range of loading can be simulated


Prestressing
Interaction with other physical mechanisms (coupled or not) : e.g. fluid, soil
structure computation, electro-magnetism
Non linearities and specific models
Contact, friction
Large displacements, large deformations
Behaviour models ( 100 constitutive laws)
Porous media, fracture mechanics, damage, fatigue, welding, seismic analysis

Example
When you cannot idealize (too much) the structure : big FEM models

8.5

7.2
mm

mm
2
,

,
13.0m
m
1

m, 4m
8m

34.0m m
m

Cong 2.2mm

x 200
Interne Inf rieur
4m

de la cuve

Elastoplasticity with creep and swelling induced by irradiation


From 4 meters to 20 millimeters
Unilateral contact on each of 200 screws

6.7 M DOF without contact : OK


6.7 M DOF with 50000 contact nodes : challenge
0.8 M DOF with 15000 contact nodes : OK
4 m
Salome

Integration platform for numerical simulation


Geometry definition
Meshing tools
Post-processing module
Supervision and job manager module to perform multi disciplinary calculations,
coupling single physics codes

The open source way for in-house developed


codes and systems
Code_Aster but also Code_Saturne, Telemac, Open-Turns, Code_Carmel,
Salom
Improving the codes :
By validation, bug detection,
Extension of validity domain or to new simulation domains
Sharing development effort
Facilitating collaboration
With academics (no licence, capitalisation tool, .)
With industrial partners (interaction with others codes,
Facilitating dissemination acceptance of methods
Support to education
For students and initial formation
Building a community of end-users
Downloading, documentation

http://www.code-aster.org

Code_Aster huge documentation is fully available in French, soon


in English :
U documentation : Users manuel. Every command and available options are described
R documentation : Reference documentation. The detailed algorithms and equations are
described.
V documentation : Validation documents. The test cases and reference results are
described. It is very convenient when you want to start a new analysis to refere to close
test cases.
2. Example introduction

The steps in setting up and running a model are:

- Define the geometry in the Geometry Salome module. Then mesh it in Mesh module. You can
also do that pre-processing with other tools like Gibi, Ideas, GMSH, any other tool able to
export mesh files in a compatible format.

- Write the command file. You could do that by writing it directly by hand or by using Eficas, a
dedicated tool that allows you to write the file in Salome_Meca.

- Run the calculation, using Astk. The results are saved in .resu file, and messages are in the
.mess file.

- Post-process the results using Salome_Meca

You will go through these steps with a simple example :

A steel cube of sides 0.1m and whose base is fixed is subjected to a 100 MPa pressure, distributed on
its upper face, see the figure below.

0,1 m y

The material is steel with the properties E = 210 000 MPa, = 0.3

The aim of the analysis is to determine the stresses, strains and displacements in the cube, assuming
elastic behaviour.

3. Geometry definition
Run Salome_meca.

Select Geometry module, open a new file.

Build the cube with New Entity / Primitive / Box : Box_1

You can zoom, translate, rotate the graphical view pushing Ctrl key and using the mouse buttons, or
click on the graphical buttons.

Now that you have defined the geometry you need to define the faces and nodes where your
boundary conditions and loadings are applied.
Use New Entity / Explode

Select Box_1 as the main object. The sub-shapes we want to define are faces. Choose to select the sub
shapes and select the bottom face and them the upper face. Rename the faces: bottom and upper.

4. Mesh definition
Open the mesh module

Now you have to create the mesh from the geometry.

Mesh / Create mesh

Name : MAIL

Geometry : select Box_1

Click on assign a set of hypothesis, choose automatic Hexahedralization or Tetrahedralization. Keep


the default settings.

Mesh / compute

Now you have to create the mesh groups from geometry.

Create upper group of faces and bottom group of nodes with Mesh / Create groups from geometry

You have to save the mesh file.

File / Export / Med File : cube.med

5. Write the command file


Open Code_Aster module

Open Eficas

You are now going to define the different commands for the finite element analysis. In Eficas you can
select the commands among the listed ones on the right side of the screen and insert them in the file.
The program offers you the different commands and key words and gives you the rules for their use. In
particular it provides information about mandatory and optional inputs.

When you have a question about a command, the best solution is to read the associated
documentation. The use of each command is explained in detail there. The whole Code_Aster
documentation will be available in English by the summer.

DEBUT Beginning of the analysis

LIRE_MAILLAGE Reads the Mesh.

You have to name the concept that will be the result of the command: MAIL

Define the format of the mesh with format option: MED in our case
AFFE_MODELE Assigns the elements type and the modelling to the whole mesh or different
parts of it

Name the concept: MODE

Choose MAIL mesh with MAILLAGE keyword

Assign the above properties to the model with AFFE keyword:

Select the whole mesh with TOUT = OUI

Select the mechanical modeling with PHENOMENE = MECANIQUE

Select MODELISATION = 3D

DEFI_MATERIAU Defines a material

Name the concept : MA

Choose ELAS keyword as we will use steel in the elastic domain

Enter E (Youngs Modulus of 210 GPa) and

Enter NU (Poisson's ratio of 0.3)

I would advise you to always use SI units: it will prevent you from false results arising from mistakes
with units.

AFFE_MATERIAU assign the materials to different parts of the mesh

Name the concept: MATE

Choose MAIL mesh with MAILLAGE keyword

Assign the material with AFFE keyword:

Select the whole mesh with TOUT = OUI

Select the material with MATER = MA

AFFE_CHAR_MECA Defines and assigns the boundary conditions and / or the loadings

Name the concept: CHAR

Choose MODE model with MODELE = MODE

Use DDL_IMPO keyword to fix the bottom face nodes displacements

Select GROUP_NO and choose the bottom face nodes using Salome
interface Select DX, put 0.0 value

Idem for DY and DZ

Use PRES_REP keyword to impose the pressure on the upper face

Select GROUP_MA and choose the upper face using Salome


interface

Enter PRES=100000000.0
MECA_STATIQUE Performs the static mechanical calculation

Name the concept: RESU

Choose MODE model with MODELE = MODE

Choose MATER material field using CHAM_MATER = MATER

Choose CHAR loadings and boundary conditions with EXCIT keyword

Select CHARGE = CHAR

You could use a combination of material fields or boundary conditions.

We are now going to write the commands to calculate values that we want to post-process.

CALC_ELEM Calculates different element fields

Choose to save the results in RESU structure with reuse = RESU


Choose MODE model with MODELE = MODE

Choose to use RESU result with RESULTAT = RESU

Choose CHAR loadings and boundary conditions with EXCIT keyword

Select CHARGE = CHAR

Select the fields you want to calculate with OPTION keyword:

Take SIGM_ELNO_DEPL (will calculate the stresses)

Take EQUI_ELNO_SIGM (will calculate the equivalent stresses)

CALC_NO Calculates different nodal fields

Choose to save the results in RESU base with reuse = RESU

Choose to use RESU result with RESULTAT = RESU

Select the fields you want to calculate with OPTION keyword:

Take SIGM_NOEU_DEPL

Take EQUI_NOEU_SIGM

Take REAC_NODA

IMPR_RESU Prints the results in one of the supported file format.

Choose MED format to be able to use Salome post-processing

Select UNITE = 80. The logical unit number of the file will be 80

Select the results you want to save with RESU keyword:

Select MAILLAGE MAIL

Select RESULTAT RESU

Select the fields to print with NOM_CHAM:


SIGM_NOEU_DEPL,EQUI_NOEU_SIGM,DEPL,REAC_NODA

FIN Ends the analysis

Save the command file: cube.comm.

6. Run the analysis

Open Astk in Salome_Meca

Aster/Tools/Astk

In this tool, specify:

The files needed for the study:

the command file (.comm),

the mesh file (.mmed),

the results file (text file . resu and Med File .rmed),

the message file (.mess).

You can also construct a base that will allow you to save the calculation outputs in order
to use them again to calculate other values or as the initial state of a new calculation. For
each file, default properties are specified : the Logical Unit Number (LU) and if the file
contains data for the calculation (D), results (R) and if it has to be compressed (C).

Save the study: cube.astk

Run the study

You can follow the progress of the job clicking on the corresponding box.

At the end of the analysis, you can have 3 kinds of status :

Ended OK: it means that the calculation was carried out successfully.

Ended Alarm: the calculation was carried out, but there were alerts that should be checked in the
.mess file.

Error: the analysis could not be carried out to completion.

7. Post processing

Calculate the stresses, strains and displacements of the upper face by hand to be able to compare the
results.
Open Post-Pro Salome module

File / Import / MED File (browse cube.rmed)

Click on the different fields you want to visualize.

You can choose to display them on the initial or deformed shape.

- Visualize the vertical displacements (choose DEPL field and click on visualization, choose DZ
in Scalar Mode box) with the option deformed shape and scalar Map. You can enlarge the
scale factor to 500 for example. Is the maximum displacement what you expected?

- Visualize the different stresses (choose SIZZ for the vertical ones for example) using cut
planes // X-Y.

- Visualize the equivalent Von Mises stress from the equivalent stresses field, using cut planes.

- Visualize the nodal forces

You can try every type of proposed visualization.

You can also mesh the cube again, changing elements type or size, run the calculation and compare
the results.