CFD tutorials GAMBIT

INTRODUCTION CASE STUDY: Meshing the P-II buildings Àrea de Mecànica de Fluids EMCI, EPS

which is based on the numerical integration of the fluid dynamics governing equations. the simulation process contains three basic steps: 1. These software packages are called CFD (Computational Fluid Dynamics) and are rapidly spreading in many disciplines. there exists both open source and commercial general-purpose models that may deal with a wide variety of problems.. Postprocessing This is the final step where we analyze the results obtained from the simulation..Introduction Fluid dynamics is a discipline that encompasses a wide variety of scientific and technical systems. Preprocessing This initial step consists of defining the problem geometry. 3. Very recently. discretize it in small control volumes (mesh) and determine the suitable boundary conditions as well as initial conditions. Currently. a new technique has arisen. 2. Historically. Solver This step refers to the code execution and includes the monitorization of the solution. In short. fluid dynamics analyses have been carried out by means of analytical approximations with a narrow range of applicability and of expensive experimental studies. . The mesh generation corresponds to one task within the multiples ones carried out in the preprocessing step. however.

It is essential to know how to interact with the Gambit graphical interface. etc. Fig. hexahedral. quads.) and volume (tetrahedral. For a better simulation. Fig.) elements. use the most suitable surface (triangles. 1. In essence the mesh consists of a discretization of the fluid domain into small control volumes called elements. prism. Introduction to GAMBIT Here we use Gambit software for generating meshes. Thus: . 1. etc.1. pyramids. To start Gambit. Initial Gambit window.1.2.2 we show the initial window of the Gambit software. the mesh must follow a given quality criteria.30. Initial window of the Gambit software. Here we choose the working directory. In Fig. It opens a window where we have to choose the working directory and select run (Run ). make a double click on the icon Gambit 2.2.. 1.

Main operations icons. faces. Middle button: Translation. Each one of these main operations contains a subgroup of icons that allow us to perfrom several tasks. Fig. 1. Fig. edges..4. For example. Zones (determine boundary conditions) and Volumes (from left to right). 1.4 where we can carry out operations with vertexs. by clicking on the main geometry icon. In the upper right corner we find the icons corresponding to the main four operations (Operation) that we may carry out within Gambit: Geometry. a new window appears as in Fig. 1.- Right click on the mouse: Zoom. volumes and groups.3. Icons for performing several tasks within the geometry option. Mesh. Left click on the mouse: Rotation. .

1.In Fig. . Possible operations within the mesh option. we also find several options: Fig. Fig. within the mesh icon. 1.6.5 we show an example of generating a volume. 1. Generating a brick (volume).5. On the other hand.

7. 1. the most useful ones are the icon for visualization the full object (1). Fig. in the lower right corner we see the Global Control window that takes all the information related to the visualization into account. Meshing a volume. another possibility is to import a geometry already designed with an external software program. types of rendering (4) and mesh examination (5). Gambit allows us to import geometries in a wide variety of formats. Fig. back and forward operations (2). 1. 1. visualization options (3). Icons for improving the visualization of our problem. all common to CAD/CAE codes. 1.7 we show how to mesh the volume above generated.7.In Fig. Among these multiple options. This . Instead of generating the geometry with Gambit.8. In Fig.

we choose the following options: Source → Volumes. This tool is activated by clicking on the last of the main Operation icons. In contrast. 1. faces. Finally. . Since the discretization task of the fluid domain essentially deals with three dimensional (3D) bodies. called Size Function. green edges tell us that the geometry corresponds to a closed volume. In the visualization window. Vertices (to specify the mesh starting point). Faces. Then we select the type of file we want to import. Attachment → Volumes. There. 11). Fig. we may identify the size function with a name (Label) and select Apply. in the Create Size Function window. and within the standard parameters of the Gambit software.10. Gambit software has a very useful tool. Growth rate (from the source region to the attached one) and Size limit (maximum element size in the attachment region). Edges. Edges (to specify the region where the Size Function will apply to). Then. that allows to define those regions (lines. In addition. we need to work with well-defined volumes and not only with surfaces. volumes) that require a refinement on the element size. Faces.can be done by choosing File → Import in the main menu bar. yellow edges make reference to lines that do not form neiter a surface nor a volume. we shall define the values of the parameters (Parameters): Start size (element size on the source region). and choosing the second Tools icons (see Fig. blue edges would correspond to faces (surfaces) without forming a closed volume. How to import geometry built within an external CAD/CAE software.9 i 1.

Size Function.11. In what follows we show how the mesh of our volume is generated. Note that we have already apply the Size Function tool. . 1. An example of the result is shown in Fig. Now. Fig. Figure 1.13. we can examine the mesh.12. 1. 1.12 clearly shows the surfaces where we have specified a refined mesh that increases in the element size as it enters to the attachment volume. Mesh visualization. by clicking the lower right icon.Fig.

2. 1. Once the graphical user interface has been opened. let us import the file that contains the geometry as it is shown in figure 2.Fig. Case study: meshing the P-II building In this section we will carry out a practical mesh study. such as the P-II and the Tallers. you will find the file PII. this mesh may be used in different solver codes. Let us open Gambit and select the proper working directory.igs in your working directory. The purpose of this mesh is to analyze the wind behavior in order to define the most suitable location for installing a wind generator. It consists of meshing the air volume above some of the Politechnic buildings. Once exported. Note that Gambit allows us to import geometry files in different electrocin formats. . Cut plane to visualize the mesh. In our case.1.13.

where the activated operation corresponds to Geometry.2. volumes and groups (set of different geometrical elements). the green color reveals that our geometry satisfy the requirements of being a close volume. Note the icons on the upper right. This option allow us to select different icones related to vertexs (points). noting the simplification on defining the small hill near the buildings. How to import the geometry file. In the visualization window. Let us take a look on the geometry. edges (lines).1. the geometry will appear in the visualization window in a similar way as it is shown in figure 2. Once imported. .Figure 2. faces (surfaces).

we choose the option Source → Faces. . in the Face List (Multiple) window. Then.2.3. the velocity field will greatly vary. 230. Geometry imported in Gambit. let us discretize the fluid volume shown in figure 2. we require small elements near the surface of buildings since. 232 i 233. faces 1. all virtual surfaces of the fluid domain. For doing so. we keep press the Shift button and click on the visualization window in order to capture all elements. Therefore. Now. called Size Function. that allows us to define those regions (edges. we choose only those surfaces corresponding to the hill and the buildings. we shall move to the Available zone all the surfaces that will not use an intensive mesh (i. since we will perform an intensive mesh on the building surfaces.Figure 2. In this example. see figure 2. as we show in figure 2. within the Create Size Function window.2. volumes) that require a smaller size element in order to better represent the actual flow behavior. This tool is activated by choosing the rightmost icon of the main Operation menu and by choosing the second Tools. 229..e. 231. Here. the most suitable option is the apply an unstructured mesh formed by triangles on surfaces and tetrahedral on the volume. faces. Gambit makes use of a tool. there.3). Then.

). Note that in Entities → Attachment. Please note that the characteristic element sizes here used is very large since we are dealing with a simple tutorial. Finally. Define sources for the Size Function option. we shall select Volumes and include our unique volume. On the other hand.2 (as in figure 2. Then. A detail study would require a much more refinement in order to properly capture the effects of the boundary layer. size field makes references to the maximum element size reached in all the elements included in the Attachment. the Growth rate of the elements starting at the Source and reaching the volume define withn the Attachment field is equal to 1.Figure 2. the Max. Here we write 8 m. this would imply a very slow execution since it would require high computational resources. . Value 1 in the Start size field implies a characteristic size for the surface elements labeled as Source equal than 1 m (the scale is in meters). Size Function parameters.4.3. Figure 2.4. we fill the parameters of the Size Function window following figure 2. However.4.

very similar to that shown in figure 2. we select Apply and Gambit starts meshing the volume. Finally. Then. The mesh generated by Gambit will be similar to that shown in figure 2. we choose the Tet/Hybrid element types in order to better represent the fluid domain. as explained above. we click on the volume icon (the other options would allow to define the boundary layer and mesh specific lines and surfaces). being impossible to solve within the execution step. a message of inverted elements warns us that there are elements with negative volumes. For example. we can find messages pointing out a number of highly skew elements (> 0. Gambit will provide information of any problem that may arise during the meshing process. we shall select the volume to mesh in Volumes and to define the element types in Elements.Once we have defined the Size Function. a remeshing of the entire fluid domain would be required. In the very same field. Gambit gives us information on the total number of elements required to mesh the entire fluid domains (507976 for the example shown in figure 2.). Here we may vary the characteristic size of volume elements.6. corresponding to the surfaces defined in the Size Function tool. Parameters for the volume mesh.97) that may invalidate the solution during the execution process. a new window will arise.5. it is time to determine the parameters of the mesh volume. it is important to point out the information arisen in the Transcript field. There. we require an unstructured mesh. On the other hand.6. By choosing the first one. Prior to that. From the Mesh menu. In this case. where the surface discretization in terms of triangles is shown. Figure 2. This is achieved by choosing the mesh icon on the main Operation bar on the upper right side. Note the refinement regions.5. By doing so. we click on the Spacing option and write 8. we find several icons below the Volume one. with different parameters in order to solve this problem. . Since. Here. on the lower side of the window. This corresponds to the 8 meters as the characteristic maximum element size allowed within the fluid domain.

Cut plane to visualize the volume mesh. The Gambit software allows us to visualize the mesh in several cut planes.Figure 2.7. . with the possibility to visualize the volume mesh in different cut planes (as in figure 2. Note that by changing the axis in the Cut Orientation option. you may change the plane. Figure 2. Here.7). only. This opens a new window with information on the mesh quality and. Surface mesh.7). to the surface one. also. let us click on the lowest right icon that opens a new window called Examine Mesh.6 corresponds. we shall choose the tetrahedra option in the 3D Element box. The mesh shown in figure 2. (see figure 2. For doing so.6.

south. All these surfaces will be identified with the label introduced in the Name box. east. in the Faces box we must select all the surfaces that satisfy the same boundary condition. In Gambit. The first one allows us to specify the type of boundary conditions on those surfaces that delimit the fluid domain. Figure 2. a new window arises. Definition of boundary conditions. a boundary condition for the remaining surfaces (ground) also of type wall. Here.. Now.8. each one containing a single surface of type wall and. By choosing this option. Thus. STAR CCM+.Now.. we shall define a north. This opens a Zones menu with two different icons.. let us creat six different boundary conditions corresponding to the surfaces that delimit the fluid virtual domain.). boundary conditions are applied by clicking on the third icon of the main Operation bar. In our example. being similar to that shown in figure 2. finally. This is carried out by selecting File → Export → msh. we need to define the boundary conditions. This is chosen among the multiple options that appear in the Type box.8. west and sky boundaries. that will open a new window where you may write the name of the file being stored in the working directory. we can save the mesh in a format suitable for many solver codes (ANSYS CFX. .

Sign up to vote on this title
UsefulNot useful