Caelinux and Finite Element Analysis. Tutorial 1, Perforated Cube
Caelinux and Finite Element Analysis. Tutorial 1, Perforated Cube
Caelinux and Finite Element Analysis. Tutorial 1, Perforated Cube
CONTENTS
Contents
1 Introduction 2 Important note 2.1 CAELinux Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Add functionalities to CAELinux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Create the part with SALOME 3.1 Create the cube . . . . . . . . . . . . 3.2 Create the cylinder . . . . . . . . . . . 3.3 Perforate the cube with the cylinder . . 3.4 Explode the volume into different faces 3.5 Remember: . . . . . . . . . . . . . . . 1 1 1 2 2 2 3 4 4 4 4 5 5 6 6 7 7 9 9 11
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
4 Mesh with SALOME 4.1 Hypotheses and basic algorithms . . . . . . 4.2 Apply the various hypothesis to the elements 4.3 Create mesh groups for the analysis . . . . . 4.4 Export to Code-Aster . . . . . . . . . . . . . 5 Create the ASTER folder with New FE Analysis
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
6 Set-up the command le with EFICAS 6.1 Material properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2 Apply the mechanical loads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Analysis with CODE-ASTER
8 Post-processing with SALOME 11 8.1 Visualize the displacements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 8.2 Visualize the stress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 8.3 Understand the resulsts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 9 Relationships between the various softwares 10 Conclusion, author, translation
Summary The aim of this document is to provide an introduction to CAELinux as well as the softwares included in this Linux distribution specialized in nite element analysis. Next, we will learn how to use:
12 13
Page 1
EFICAS, the Code-Aster command-le editor CODE-ASTER, the nite element method software launched via the ASTK graphical user
interface.
Introduction
This tuttorial aims at simulating the stress and displacements of a perforated cube, one face being xed and the opposite face submitted to a distributed pressure. The holes axis is parallel to the faces on which the loads are applied. For this tutorial, les and folders are named after cube_perce.xxx, the xxx extension refering to the le format.
Important note
The following tutorial is based on the Beta 1 version of CAELinux, october 2005. With a more up-todate version (Beta2?), various informations may be inaccurate.
2.1
CAELinux Installation
The CAELinux DVD is both an install DVD and a bootable DVD. As a result, you could either install CAELinux on your hard-drive or simply use it as a Live DVD such as KNOPPIX, UBUNTU Live or FRENZY in the BSD world. From a personnal standpoint, i was not successful in launching SALOME as metionned, and this on several congurations: IBM laptop, SIEMENS laptop, SIEMENS desktop and so on. I ended up installing it on my personnal computer (a white box PC) and on an IBM at my workplace. CAELinux is based on PCLinuxOS, a fork from Mandriva which in turn used to be Mandrake Linux. Given this, users accustomzied with Mandriva will nd themself at home. The installation procedure is a breeze, just select your keyborad conguration accurately. If not, you might have to tweak some parameters afterwards.
2.2
I was rather surprised to nd a working LaTeX environment in CAELinux. This detail is a great help as I am currently typing this tutorial. However, bad luck as it goes, the VI version, my favorite text editor, is a old bloated piece of software which would only nds its way in Rescue Distributions like "Everything you need on a single oppy". The Gimp is there too but not Xg, too bad. Being a FreeBSD user, i struggled for some time to nd the useful trick: the 10.0 revision of Mandrake looks like the accurate version to add packages to CAELinux. One only has to know basic commands like nd and rpm and thats about it. Adding the "enhanced" version of VI with syntax highligthings and others much appreciated add-ons was easy. Installing Xg only required inserting a CD. To go straight to the point: dont throw your old Mandrake / Mandriva CDs, keep them close to your machine, they might be useful when adding functionalities to CAELinux.
Not being an advanced 3D product creation software or CAD tool, SALOME will still create advanced geometric shapes and corresponding volumes. We will use this functionality to build a volume and create a mesh. I have to mention here that SALOME is able to import CAD les like iges and step, as well as brep, a format i didnt knew before.
Page 2
3.1
3.1
Launch SALOME, open File/New, select Geometry then close the various Pyton interpreter windows by adjusting the display window, using the small dedicated arrows on the bottom left. Please bear in mind that SALOME can be used in Geometry mode, but also in Mesh mode, Post-Pro mode ( as a post-processor for Code-Aster), and so on. Be aware of this: if you dont nd a specic item in the menu, or a right-click doesnt do what it is supposed to do, ask yourself if you are really in the mode you are supposed to be! A cube is, well, a square vector-extruded face. This face is the result of a transformed "sketch" gure. The rst step is then to create this part from the various mentionned elements. To do so: Menu New entity / Sketch, enter successively the following coordinates (0,0), (2,0), (2,2), (0,2), and validate each set of coordinates using the "Apply" icon. The "Sketch closure" allows to validate the drawing and close to window. Use the magnifying glass icon on the left, "Fit all", to display the new drawing using the available space. Bear in mind that the units are not indicated. Enter the values using the system you want, just be accurate: pressure in Pascal if the dimensions are expressed in meters and force in Newton. It is important to understand that we currently created 4 lines, connected to make a square. So this is still a line and not a surface. In a following step, we will transform those 4 lines into a plane object, also called "face" in SALOME. Lets stop for a while to explain how does the mouse work. Using CTRL, the mouse buttons allow to change the view as follow:
CTRL + right click: turn in the view CTRL + left click: keep the orientation, zoom in or out CTRL + middle: move the view, size and orientation remaining the same.
All this can also be done using the various magnifying glasses located on the right in the menu toolbar. Before starting to modify the square into face, lets have a look at the left corner of the screen. A right-click on "Geometry" and a "Expand all" selection displays a line Wire_1. A click on Wire_1 modies the squares color and a click on the square brings the selection back to Wire_1. The menu
Page 3
3.2
on the left will change according to the status of the project, to describe how the different elements were created. To modify the square Wire_1 into a face (or plane surface), click in the "New Entity" menu, "Build", "Face". A click on the "Wire(s)" arrow followed by "Wire_1" in the left menu displays "Wire_1" in the dialog box. Please bear in mind that, if the selection was on Wire_1 (left panel) before starting to create the face, a click on the arrow would have been enough to select Wire_1. Validate with OK to close the dialog box. You know see a new element "Face_1" in the menu, click on the + sign to "open" the line, you will then see the Wire_1 in red. The face Face_1 is a product of the Wire_1 transformation. Up to now, this detail seems rather pointless, but soon, it will be nice to quickly nd this f******! primitive we forgot everything about! Once the basic face has been created, one needs to create a vector to construct the different extrusions. To do so, Menu, New Entity, Basic, Vector. You then have the choice to choose between two kind of generation method: either a vector described by two points (the default choice), or a vector dened by its coordinates. We are gonna use the later, so click on the right icon then input the coordinates 0,0,1 and validate with OK. Vector_1 is then displayed in the left panel. We now have everything we need to extrude the cube, that is: one face and one non parallel vector. To extrude Menu, New Entity, Generation, Extrusion, Base = Base_1, Vector = Vector_1, enter 2 in Height and validate with OK. Im gonna go straight to the point now, manipulating the dialog box not being rocket science. To quickly get a nice cube, go to menu View, Display Mode, Shading and you can even play with your new creation. Come back to the wire view (View, Display Mode, Wireframe) to go further in this tutorial.
3.2
Now it is time to draw the circle which we will use to dene the hole in the cube. To do so, one needs a center, a vector and a radius. We previsouly created this vector. Only a center point is currently missing. Menu New, Basic, Point, then enter the coordinates 1,1,0 and validate. A point named Vetex_1 appears in hte left menu and on the drawing, in the middle of a cubes face. Drawing the circle isnt much complicated, menu New Entity, Basic, Circle, Center Point = Vertex_1, Vector = Vector_1, Radius = 0.5 and then OK. One may be tempted to change the circle into a face. However, this shortcut doesnt work. One needs to rst transform the circle into a "Wire" then the "Wire" element into a face. Lets go to menu New Entity, Build, Wire, Objects = Circle_1 then OK. A gure "Wire_2" is added to the parts list in the left menu. To transform it into a face, menu New Entity, Build, Face, Wire(s) = Wire_2 and nally OK. The cylinders extrusion associated to the circle is similar to the cubes extrusion: menu New Entity, Generation, Extrusion, Base = Face_2, Vector = Vector_1, Height = 2 and OK. You just created Prism_2, a cylinder with the following properties: radius=0.5, height=2 inside the cube and located on a face.
3.3
In order to get the nal volume, a perforated cube, one just needs now to substract the cylinder to the cube. Menu Operations, Boolean, Cut, Main Object = Prism_1, Tool Object = Prism_2 then OK. If everyhting went smoothly, you should now have a perforated cube. Check by using a shaded view, menu View, Display Mode, Shading. Use Display Only (after a right click) on Cut_1 to cancel the other parts already on the screen.
3.4
But we are not done yet. In the introduction, i explained that the load condition on the part would be a xed boundary condition and a distributed pressure load on the opposite face. The geometry we already dened here doesnt allow such a thing. The next step is to explode the cube into faces . Lets begin with menu New Entity, Explode, Main Object = Cut_1, Sub Shapes = Face then OK. This operation creates faces numbered from 3 to 9; face 3 being the one constructed on the X and
Page 4
3.5
Remember:
Figure 2: Final Geometry display Z axis, face 8 being the opposite one. To identify the face, use the right click - Display Only on each faces description or simply click on the crosses displayed on the faces. You could also use a right click on Geometry, the rst line on the left menu then Display to..erm..display the different parts of the geometry.
3.5
Remember:
We are now at the end of the rst part and we created a perforated cube. It is important to keep the following in mind:
Holding CTRL and moving the mouse allow one to turn / resize / translate the view. The left menu displays the procedures we went through to get our part. Be smart and use a
right-click - Expand All to get all the needed details of the parts tree.
Right-click, Display or Display Only are used to complete or limit a display and identify a component. Now, it is time to save our progress, menu File, Save then enter the le name. By default, SALOME proposes Study1. In this tutorial, we will just call the le cube_perce. This creates, in the working folder, a le named cube_perce.hdf, hdf being the SALOME format.
The goal is now to divide the previous volume into a mesh, a bunch of smaller volumes on which we will apply the various material properties and calculate the stresses resulting from the load. It is out of question to discuss the theory behing the meshing, a whole manual wouldnt be enough. So, we will only apply a basic recipe. Leave the Geometry mode and enter the Mesh mode (on the bottom left of the screen). There are three main steps in order to produce a mesh: the basic hypothesiss denition, its application to the desired volume and the designation of the faces on which we will later apply the loads.
Page 5
4.1
4.1
The Hypotheses menu Create Hypotheses displays (could you guess?) a window "Create hypotheses". We will create 3 hypotheses:
Average length, click on Create. A new dialog box appears, enter 0.2 in length and choose OK. Lenght From Edges Then Create. Max. Element Volume Then Create, keep 1 as Max Volume value and validate with OK.
What did we just do? I feel quite embarrased to give you a satisfying explanation up to this point. One thing is for sure, the Average Length value we just enter has a direct effect on the meshs renement. If you got a standard vintage PC like mine, RAM 256Mo with a 1.6Ghz processor, a good start would be to just choose a value roughly 1/10th of the cubes diagonale. A ner mesh could lead to very intensive calculations. The Hypothes menu, Create Algorithms leads to a dialog box similar to the previous one. Select here Wire discretization, Triangle (Mesto) then Tetrahedron (Netgen) by validating Create between two selections. Close...closes the dialog box after the third selection. So, the game is over: hypothesis and algorithms are now ready for action. An important matter here: right-click on the new Mesh entity at the end of the left menu, then Expand All so you see 6 lines corresponding to the 3 hypotheses and 3 algorithms we just setted up.
4.2
The menu Mesh, Global Hypotheses opens a dialog box called Mesh Construction. This one belongs to the same group as the one we worked on previously. Name = Mesh_1 is staight forward. Enter the Cut_1 value to Geometrical Object and then you will need to ll Hypothesis and Algorithm. Here we are gonna use a multiple selection for both of the elds. So, click on the Hypothesis arrow then click on the rst line of the left menu. The dialog box displays Average length. Hold on the Upper case and select the last line of hypotheses, the display changes, you now see "3 Hypotheses". Follow the very same procedure for Algorithm by selecting (a multiple selection) the three algorithms Wire discretization affected to (??) Tetrahedron (Netgen) and press OK. A new element Mesh_1 has been created in the left menu. Now it is nally time to calculate the meshes, so right click on Mesh_1 and then on "Compute". The screen freezes for a few seconds (roughly a dozen on my machine). Do it again by selecting "Update" this time. After a few seconds, you should see that the perforated mesh changes. You guess at this very moment that the mesh is about to be drawn. A new click on Mesh_1 followed by a snappy "Display Only" and the screen is now displaying the mesh, which was the aim of this chapter.
Page 6
4.3
Create mesh groups for the analysis 5 CREATE THE ASTER FOLDER WITH NEW FE ANALYSIS
4.3
The part is now meshed. Before going to the next step, the one dening the loads applied to the structure, one task still remains ahead of us. We need to name the faces ( and so the elementary meshes that are parts of the faces) so we will be able to called them accurately in the next step. Menu Mesh, Create Group to display the "Create Group" dialog box. Click on Face and Group on Geometry to mimic the 4 gure on page 7. Use the previous procedures (click on the arrow then click on the obejct in the left menu) to ll up the elds Mesh and Geometrical Object. The result of the rst dialog window is the one shown on gure 4, page 7. Name the face 3 "Base" and the face 8 "Pression" (those names wont be translated since they will be used later in the command le). Those names are free, you really can do whatever you feel like, i tend to prefer Base to designate a xed face which isnt gonna move under the load and Pression the face on which we will apply the pressure load. One still needs to:
Save the le using the Save menu. You can save it under the previous name and scratch the
previously saved le or give it a new name.
Export the mesh (with the designated faces) so that Code-Aster can read the data.
4.4
Export to Code-Aster
The export is launched by a right click on the Mesh_1 element of the tree then Export to MED. In the dialog window, please make sure you choose the File Type MED 2.2 and give a name to the le. It doesnt matter if it is the same as the one you gave to the previous le since it has been saved in the SALOME format (extensions are differents). Now, you should have two les, cube_perce.hdf (SALOME format) and cube_perce.med (CODE-ASTER format). You may reduce the SALOME window as we wont need it in the next chapter.
Click on the "New FE Analysis" icon. "Create New Aster Job" welcomes you. As it is stated, this is your entry point for CODE-ASTER. In fact, this tiny program is about to create a new folder which you
Page 7
will dene on the rst line 1, in a folder dened line 2, using the MED le designated line 3 and using the model on line 4. Easy isnt it? To summarize:
Name the folder line 1. I do use the previous name cube_perce. Choose the folder in which the previous folder will be created, /root by default. Choose the MED le you just created for this new analysis. Select LinStatics3D.comm among the 3 availables models.
Validate, you should get a Conrmation box similar to the ?? gure on page 8.
Now it is time to click on the ASTK icon on the desktop. This opens an ASTK window "ASTK Version ... New". The menu allows, thanks to File, Open, to load the le cube_perce.astk already located in cube_perce. The window is similar to the 7 gure diplayed on page 8. A double-click on ./cube_perce.comm opens the CODE-ASTER command line editor. A new window like 8 page 9 appears on the screen. In this window, we will dene the boundary conditions, the loads, the material properties and so on. The content of the various tabs corresponds to groups of command lines in the le cube_perce.comm. We could edit this le by hand, but EFICAS (which would mean EFFICIENT in english) will provide us some great help and will thankfully advices us in order to create the le and also to check the syntax.
Page 8
Page 9
6.1
Material properties
6.1
Material properties
Open the DEFI_MATERIAU tab by clicking on the + sign at the start of the line. Open also the new tab ELAS. A materials name and three numerical values are mentionned there, Steel to designate ...steel, then the Young modulus E, the POISSON coefcient NU and the volumetric mass RHO. No units are specied, we just use the basic ones, Newton, meter and so on. You have the ability to rename the material by clicking on DEFI_MATERIAU then "Nommer Concept" in the right panel. Additionnaly, you can change the values E, NU or RHO by clicking on the appropriate lines and entering the new value. Hit Enter to validate your value. As for the rst test, you can let the default values. You can also add a material by clicking on "Nouvelle commande" in the right panel then DEFI_MATERIAU in the next list. This creates a new line DEFI_MATERIAU in the left panel, highlighted in red, meaning that the denition is not complete yet. To delete a line you might have wrongly created (or just for the shake of trying), select the offending line and click on the Supprimer icon in the right part of the window.
6.2
The line "AFFE_CHAR_MECA", which i recommend you to open by clicking on "+", is by far the most important of this whole tutorial. Thats where we will do the most important modications. See the gure 9 on page 10. Start by deleting the group of lines FORCE_NODALE, which is not needed in this tutorial. Click on FORCE_NODALE and then on the supprimer icon. We will rst modify DDL_IMPO to apply a boundary condition to the face "Base" of our cube. Select GROUP_NO and delete it. Change it to GROUP_MA by clicking on DDL_IMPO then GROUP_MA in the right list (double click). Enter "Base" in the dialog box on the right then on the hand whose ngers are pointed on the left to transfer this value in the "Valeur(s) actuelle(s)" list. The screen 10 page 10 shows the result of those manipulations. By our last inputs, we have been telling the mechanical code that the face "BASE" is a xed boundary because DX, DY and DZ are zeros. Now, one still have to apply the homogeneous pressure on the face PRESSION. Click on AFFE_CHAR_MECA then choose PRES_REP in the list. This is the homogeneous pressure. With a double-click, a new line PRES_REP is created under DDL_IMPO. We just need to indicate on which face to apply this load:
Click on GROUP_MA (double click) to add a line and open a new input window. Enter "Pression" in the input eld like we did previously for "Base".
Click again on PRES_REP (on the left) then double-click on PRES in the list of available keywords and enter 1e6. Validate with Eneter. The value 1e6 is in Pascal so it means 10bars. Once the pressure has been validated, all the icons should be green. Save this new version of the cube_perce.comm le with Fichier, Enregistrer. You may reduce the EFICAS window, we shouldnt need it anymore.
Page 10
Thats it, the ASTER conguration le has been created, we now launch the analysis. This is the least interactive step because one only needs to click on RUN in the ASTK window to see the machine crunching numbers. You can follow the analysiss progress in the text window if you are snappy enough to get a glimpse. Its particularly interesting to have a look at the start of the lines. You would see <I> for some steps but a <F> would mean that there is a mistake and that the calculation will not be successful. If you have got doubts, click on ./cube_perce.erre once the calculation has ended to see the messages / errors summary.
Lets say everything went to a happy end. You can now wake up SALOME, open a new window, this time in the Post-Pro mode and not Geometry or Mesh. Load the result of the calculation with File, Import from File then select the le /cube_perce/ cube_perceres.med. A line + Post-Pro should appear on the left. A right click followed by Expand All and the results tree is here! The interesting lines are SolutionDEPL as well as 0,INCONNUE and SolutionEQUI_ELNO_SIGM, followed by 0,INCONNUE. Those two groups are respectively the diplsacements and stresses calculated in the part.
8.1
Click on 0,INCONNUE corresponding to the group DEPL then right click and select the option
Scalar Map. Validate the new dialog box, there are no mandatory change for the time being, the default values are ok. A colored cube is displayed and a graduated bar assigns numerical values to the colors. One recognizes the Base in blue (displacement value = 0), and the face Pression is fully colored.
Again, click on 0, INCONNUE and validate Deformed Shape. Validate Magnitude coloring. The
mesh will be displayed along with the previous shape. Select now the new line Def.Shape:1 and then, using a right click, select Display Only. The view, similar to 11 on page 12 only shows the mesh corresponding to the deformed part. Turn the gure to really see the shape under load. Clearly, the displacements look bigger than usual: the amplication factor has been briey displayed in the screen in which we selected Magnitude Coloring.
Click on Def.Shape:1 then right-click on sweep. Your rolling eyes discover the part being
crushed under the stress, starting from the initial free case to the nominal load.
Page 11
8.2
8.2
The idea behind it is similar, you should easily nd how to display the colors corresponding to the stress. Keep in mind that, this time, there is no deformation view but only a stress eld. You are free to change the display mode, going to wire frame for instance. If you are eager to try a few things, you will discover how to increase or reduce the amplication factor.
8.3
The part we created is 2m big. In fact, it is rather closer to a Charles de Gaulle aircraft carriers propeller bearing than a motorcycles part. I decided to go with these dimensions since it would be easier to type. The interested reader should feel free to do it again using more common dimensions. The 1MPas distributed pressure on a 2*2 is equivalent to a 400tons force. The gure 11 clearly shows that the maximum displacement is roughly, given the material, 2e-5m at the center, half of that on the extremities.
One of the main difculty i encountered when i discovered CAELInux and the softwares allowing the nite element analysis was the understanding of the various links between the softwares. I especially had a hard time getting the fact that Code-Aster wasnt an interactive software but it was running as a standalone solver, using one click on the run icon within ASTK. We browsed together the tutorial, getting from one software to the other to nally go back to the rst one. To really get to undertsand our path, a small scheme is worth thousands words. Here are some explainations regarding the gure 12 on page 13.
The SALOME mesher is more than a simple mesh generator. SALOME can also import a CAO
le like step or iges or it can be used to generate parts, being surface or volume. The later
Page 12
Salome has many modules, a geometry module in which we dened the perforated mesh but in
which we also exploded the faces. The mesh module gathers the geometrical datas to create meshed structures. The previously designated faces are used to create the groups of mesh linked to the faces. We only created meaningful groups regarding the load.
Salome works with its own le format, corresponding to the hdf extension. To work together
with Code-Aster the datas are exported in med (version 2.2 and no 2.1 like the one by default) which is specic to Code-Aster. Following the same philosophy, the datas are imported into SALOME using this very same format.
New FE Analysis is a small script with only one purpose: to gather informations like the name
of the working folder, the name of the folder to be created for the study, the name of the med le and so on. Once done, the script gathers the informations in a raw Code-Aster command le, save this le in the new folder, and thats about it.
ASTK is a Graphical User Interface for Code-Aster. We used it to launch EFICAS, the command
line editor for the le created by New FE Analysis. Once we are done with it and the le has been saved, ASTK launches Code-Aster thanks to the RUN icon. Code-Aster runs and displays its output in a non-interactive shell window.
EFICAS, shortcut for Editeur de FIchier Code-Aster (it also means EFFICIENT), is the most
important software to be used. The groups of meshes are given properties (material, properties,...) and, in this tutorial, the mechanical loads and boundary conditions. EFICAS only works on the command le, then, once it has been saved, one shoudl come back to ASTK to launch the Code-Aster calculation.
Once done, you can come back to SALOME and, this time using the Post-Processor module,
you can graphically display your results. Bear in mind that the datas are imported from CodeAster.
Page 13
10
10
This tutorial is the rst one of a serie of others in which i wish to write down my various experiences with CAELinux. I feel free to get some help from an intern who should spend a few weeks on this subject in my company. Its contributions will be clearly mentionned if anything should be published. Authors right: the present document is GPLed. If extracts are used in some articles or documents, please acknowledge the author of the initial document. The author: Jean-Marc LICHTLE Engineer "Arts et Mtiers", Chalons 1973-1977. At this time, we used to study complex structures using a slide rule. The luckiest ones got an electronic calculator which painfully handle trigonometry. It has changed! Translation: This quick and dirty translation has been carried out by Laurent Malod-Panisset. In order to improve it, feel free to send an email.
In english: [email protected]
Page 14