Gambit - Generation of Grid for an Inlet Flow
Latest revision: 13 November, 2003, 4:30 p.m.
Introduction and Instructions:
In this module is a procedure that enables students to generate an unstructured (triangular) grid, which is used to solve for flow into a two-dimensional slot (or round hole) with the CFD program, Fluent. Both two-dimensional and axisymmetric solutions are possible with this grid. Readers should already be familiar with the notation used in this module, as described in the learning module, Fluent and Gambit - Introduction and General Information.
- We model flow into a flat line which simulates the "face," i.e. the two-dimensional slot (or round hole) which serves as the suction inlet to a hood, a vacuum cleaner, or some other suction device. The flow comes from all over - i.e. from "infinity." Because of symmetry, only one half (the upper half) of the geometry needs to be generated. The boundaries of the computational domain is formed by a circular arc and three straight line segments as sketched below (not to scale):
- In the sketch, the origin is in the middle of the slot, x is toward the right, and y is up. The suction slot itself extends up from the origin to a distance s/2, where s is the slot height of the inlet face. Note that due to symmetry, only half of the physical domain is used; the actual slot has a height s. To the left of the slot is a wall, representing the duct or tube through which air is drawn. To the right of the slot is the line of symmetry for the two-dimensional case (or the axis of rotation for the axisymmetric case).
- All lengths in Gambit are meters by default. In the present case, the slot height s is 0.20 m, and the circular arc is 20 times this, i.e. 4.0 m in radius to ensure that the far-field boundary conditions are far enough away.
- The blue dots on the above sketch indicate points (called vertices in Gambit) which define the computational domain.
Log on and launch Gambit:
- Log on to any UNIX or LINUX machine which has a valid license for the Fluent family of software.
- Create a UNIX shell ("terminal"): Click on the red hat on the tool bar at the bottom of the screen (it is called the "GNOME Menu"). System Tools-Terminal.
- At this point, if not already done previously, you should create a new directory called Fluent, so that all of your Fluent projects reside on this directory. To do so, Enter "mkdir Fluent" and then go to this new directory by entering "cd Fluent".
- Also create a new directory called Gambit, as a subdirectory of Fluent (enter "mkdir Gambit"). Go to the Gambit subdirectory by entering "cd Gambit".
- Gambit may now be launched. Enter "gambit -id inlet &". After a while (sometimes a couple minutes!), the main Gambit window should appear on your screen. Note the "&" at the end of the command, which tells UNIX to run this in background mode. This frees up your UNIX shell for other commands while Gambit continues to run.
- In Gambit, when the mouse cursor is placed over a button, a short description of the function of that button appears in the lower right window under Description. This is useful in implementing the commands given below.
- Note: If Gambit does not open properly, you may not have the proper path set up in your user files. If this is the case, check with the system administrator.
- Gambit needs to know for which code it is generating the grid. At the top of the screen, Solver-Fluent 5/6 (or later version if available).
Create some data points (vertices) for the desired geometry:
- Create a vertex at the origin, which is the center point of the slot. In Geometry, Vertex Command Button-R-Create Vertex-From Coordinates. In Create Real Vertex-Global, enter 0, 0, and 0 for x, y, and z coordinates respectively. Type an appropriate label for this vertex, i.e. "origin", and Apply. A vertex is created, as indicated by a small plus sign at this location.
- Create another vertex with coordinates (0,0.1,0). You can call it "top of slot" or something like that. Apply.
Another small plus sign should appear on the screen.
- In similar fashion, enter the coordinates of the other points defining the limits of the computational domain, i.e. (-4,0.1,0), (4,0,0) and (0,4.1,0). You can name them appropriately ("lower left", "lower right", and "top center" are suggested), or you can let Gambit label these vertices for you by default.
- At this point, it is wise to zoom in somewhat to see the vertices more clearly. There are two ways to do this. You can zoom in and move with the right mouse and middle mouse, respectively. Or, to fit all the geometry into the available screen space (a very handy tool!), in Global Control (near the bottom right), Fit to Window.
- In the main Gambit window near the upper left, File-Save. This saves your work so far. It is a good idea to do this every so often, especially after a major task is completed.
Create edges from these vertices to define the computational domain:
- Now some edges will be created to define the slot, the line of symmetry, the circular arc, and the horizontal wall to the left of the slot. Under Geometry, Edge Command Button. (Note: If the button is already open, clicking it again will make the options disappear! If this happens, click it again.)
- Under Edge, R-Create Edge-Straight. A new window called Create Straight Edge will appear.
- In Create Straight Edge, make sure the text area called Vertices is highlighted - if not, click in that area. Vertices are selected by Shift + left mouse click. Select the two vertices which define the top and bottom of the slot.
- Type in an appropriate label for the edge about to be created. I suggest "slot" or "face" or something equally descriptive. Apply. Gambit will create a straight edge between these two vertices. A yellow line should be drawn on the screen connecting the vertices.
- In similar fashion, create two other edges - one the horizontal line to the top left of the slot, and one along the line of symmetry (bottom right of the slot). Name each of them something appropriate. If you prefer, let Gambit name them for you.
- Now Close the Create Straight Edge window.
- Next, the large circular arc will be created. Under Edge, R-Create Edge-Arc. A new window called Create Real Circular Arc will appear.
- There are two methods for creating a circular arc. The first one (default) requires selection of a center vertex and two end vertices. This is not the one we want. Select the second method instead, which requires selection of three vertices along the arc.
- Select the three vertices which will form the circular arc, i.e. the lower left vertex, the middle top vertex, and the lower right vertex. Type in a label like "circular arc" and Apply. A yellow circular arc should appear.
- In the main Gambit window near the upper left, File-Save. This will save your work so far. It is a good idea to do this every so often, especially after a major task is completed.
Generate a face above the flat plate from the available edges:
- Under Geometry, Face Command Button-R-Form Face-Wireframe.
- It is important to select the edges in order when creating a face from existing edges. (I like to select them in mathematically positive counterclockwise order). Select the circular arc, then the bottom left edge, the slot itself, and finally the edge along the line of symmetry. These edges outline the "wireframe" of a closed face.
- In Create Face From Wireframe, type in a label for this face if desired ("domain" is suggested), and Apply. If all went well, a blue outline of the face should appear on the screen; this is a face, which is now ready to be meshed.
Define node points along the edges:
- In Operation, Mesh Command Button-Edge Command Button. Mesh Edges should be the default window that opens; if not, Mesh Edges. Turn off Pick with Links.
- Select the horizontal lower right edge (the line of symmetry), and in Mesh Edges, change the Spacing option from Interval Size to Interval Count. Enter the number 40 as the Interval Count. It is desirable to cluster or bunch nodes close to the slot. This is accomplished by changing Ratio (in the Grading section of the Mesh Edges window). A Ratio of 1.1 is recommended so that there are lots of nodes near the slot, and not so many nodes near the right edge of the computational domain.
Hit the key on the keyboard to see the node distribution. Note: If the bunching is backwards from the way you desire, click on the Reverse button. Apply. Blue circles should appear at each created node point along that edge.
- Note that at any time, if you make a mistake, you can undo your previous command by clicking on the Undo button, which looks like a looped arrow in the bottom right portion of the computer screen.
- Next, select the leftmost horizontal edge (the wall of the slot). This wall will require a finer grid since a boundary layer will build up along the wall as fluid is sucked into the slot. Generate around 100 nodes, with a bunching Ratio of 1.04. You may have to Reverse the distribution of nodes so that they are bunched up to the right, near the slot, not the other way around. Don't forget to Apply; otherwise the node distribution is not saved.
- Similarly, define 40 node points along the circular arc, bunched towards the lower left portion of the domain, since the wall boundary layer there will require a finer grid. A Ratio of 1.03 is suggested. Note: This is the far field "infinity", so it is not necessary to have a lot of nodes out here.
- Finally, select the slot edge itself. You may wish to move and zoom in first, using the middle and right mouse buttons respectively. Define 20 evenly-spaced node points along the slot edge. Don't forget to Apply, or the nodes will not actually be saved.
- When all edges have been assigned nodes, save your work, and Close the Mesh Edges window.
Specify the boundary types on all edges:
- In order for the mesh to be properly transferred to Fluent, the edges must be assigned boundary types, such as wall, inlet, outlet, etc. Actual numerical values, such as the outlet and inlet pressures, will be specified as boundary conditions from within Fluent itself. In Operation, Zones Command Button-Specify Boundary Types Command Button.
- In the Specify Boundary Types window, change Entity to Edges (the default is usually Faces). In this problem, which is 2-D, boundary conditions will be applied to edges rather than to faces.
- Select the bottom left horizontal edge of the computational domain, which will become a wall. The default Type should be Wall. If not, change it to Wall, and type in some name like "hood wall". Apply. Some words indicating this boundary condition will appear on the screen.
- Select the bottom right horizontal edge. In similar fashion, make this a Symmetry boundary condition named "axis". Be sure to Apply, or the boundary condition will not actually be changed.
- Select the circular arc, which is the far-field boundary. In similar fashion, make this edge a Pressure Inlet boundary conditions named "far field". Apply.
- Finally, Select the edge defining the slot itself. Name this boundary type "face", and change Type to Pressure Outlet. Apply. Note the nomenclature here. This edge is an inlet to a suction device such as a vacuum cleaner or hood, but it is an outlet to the computational domain.
- Turn on Show Labels, and make sure that all four boundary conditions are properly defined.
- Close the Specify Boundary Types window.
Generate the mesh on the face:
- Under Operation, Mesh Command Button-Face Command Button. The default window that pops up should be Mesh Faces. If not, Mesh Faces.
- Select the face by shift clicking on one of its edges. Change Elements to Quad if necessary, for quadrilateral elements. Also change Type to Pave if necessary (for unstructured elements). The Spacing options will be ignored since nodes have already been defined on all edges of this face.
- Generate the mesh by Apply. If all goes well, an unstructured mesh should appear after some calculation time. Zoom in to see how the cells are nicely clustered near the slot. This will help Fluent to more accurately resolve the flow near the slot.
- Zoom back out so that the entire mesh can be clearly seen. This is most easily accomplished by clicking on Fit to Window in Global Control (near the bottom right of the screen).
- You can now Close the Mesh Faces window.
Write out the mesh in the format used by Fluent, and then exit Gambit:
- In the main Gambit window, File-Export-Mesh.
Turn on the 2-D option, and Accept. (The default file name can be changed here if desired, but the default name is acceptable in this case.)
- The Transcript (at lower left) informs you when the mesh is written correctly to the file. If there is an error here, you must have done something incorrectly. You may need to re-do the mesh or the boundary conditions.
- Exit Gambit: File-Exit-Yes.
- When Gambit exits, the UNIX window will re-appear. Enter "ls -la" to see the files created by Gambit. The inlet.msh file is the one to be used by Fluent.
- It is a good idea to move this file into the Fluent directory, so that it is ready to be read in. Enter "cd .." (CAUTION: There must be a space between "cd" and ".." or the command will not work.). This command moves your working directory up one level to the Fluent directory. To verify, Enter "pwd" (print working directory). It should return something like /home/...../Fluent.
- Now enter "mv Gambit/inlet.msh axi_inlet.msh", which will move the file from the Gambit subdirectory into the working directory, and change its name in the process. Enter "ls -la" to verify that the file is now in the Fluent directory.
- The mesh file should now be ready for use by Fluent. You may move on to the next learning module, Fluent - Laminar Flow into an Axisymmetric Inlet, which describes how to run this case with the CFD solver, Fluent.