You are on page 1of 16

Brunel University

School of Engineering and Design


Mechanical Engineering

Introductory Manual
ANSYS12 - FLUENT
CFD Finite Volume Program FLUENT and the
Mesh Generator GAMBIT

Prepared by
R. Mokhtarzadeh and S. Natarajan

© Brunel University, Mechanical Engineering, last modified Oct2009Page 1


1. Program Structure
FLUENT within ANSYS is a general purpose program capable of simulating a wide range of
flows using the finite volume method. The mesh generator used in 2009/2010 academic year is
GAMBIT. The geometry and mesh are set up in GAMBIT and then exported to be read in
FLUENT.

Numerical
model

Geometry Flow Type

GAMBIT FLUENT Program

© Brunel University, Mechanical Engineering, last modified Oct2009Page 2


2. GAMBIT - Grid generator
Initiate GAMBIT using the Start button. You should have the main front screen similar to the
image shown below. This section describes how to set up the geometry and the grid for a simple
2d problem and export the data to FLUENT.

The right side of the GAMBIT window contains all the tool pads. Top right is the main operation
tool pad containing all geometry, mesh, zone and tool commands. Immediately below that are the
corresponding sub pads. Upon activation of the sub pad further options will appear in the mid
section. Finally, the global control tool pad is located in the lower right of the window containing
various image and view manipulation options. Simply by holding the mouse pointer over various
buttons shows its function in the description window.
An example of a simple 2D domain of a sharp double bend is shown below. Working through this
tutorial will show you how to set up a mesh using GAMBIT.
in let

3 cm

0,0
2 cm
outlet

8 cm 3 cm 8 cm

© Brunel University, Mechanical Engineering, last modified Oct2009Page 3


2.1 Creating domain outline

IMPORTANT: In order to avoid problems with scaling, it is better to enter the dimensions in
meters (although the above dimensions are in cm).
Begin by defining the corners of the geometry.

GEOMETRY → VERTEX → CREATE VERTEX


Ensure "type" is Cartesian and enter the global co-ordinates of each vertex followed by ACCEPT.
Note that the origin is located at a convenient central position (shown above). It is also convenient
to enter co-ordinates in cm since these will be scaled later.
Useful tips

1. If you make a mistake simply use UNDO in the global controls lower right.
2. Note that some buttons (like UNDO) have a little arrow, this indicates that multiple
options are available by right clicking the button changes to REDO.

3. Use the FIT TO WINDOW button to view the extents of your drawing.
Connect the vertices to form edges

GEOMETRY → EDGE → CREATE EDGE


Shift-left-click each pair of points that make up an edge and APPLY. It helps later if you are
consistent with the direction of the line, so define all horizontal lines from left to right and all
vertical lines from top to bottom. Continue creating edges until you have the domain shown
below.

© Brunel University, Mechanical Engineering, last modified Oct2009Page 4


2.3 Basic graphics commands

Manipulation of the graphics view point is conducted with the mouse and the three buttons.
Mouse controls in the graphics window
1. EXAMIN the shape - Left-click and drag
2. PAN the view - Middle-click and drag
3. ROTATE the view - Right-click and drag left and right
4. ZOOM in/out - Right-click and drag up and down

To reset the view you may choose the PRESET CONFIGURATION four view button in the
global control tool pad. To return back to the favoured view, right-click PRESET
CONFIGURATION and choose the lower left window (not from the Active menu).

PRESET CONFIGURATION R

2.4 Save your work in GAMBIT

Remember you have already begun this session using the name "example".
1. Left-click File > Save overwriting the pervious file.
2. Alternatively you may Left-click File > Save as... and specify a new filename.
While saving, GAMBIT updates 3 files in this case,
1. example.dbs (the database file)
© Brunel University, Mechanical Engineering, last modified Oct2009Page 5
2. example.jou (the journal file containing a sequential list of commands)
3. example.trn (the transcript file containing a sequential list of response messages)
It is advisable to save your work frequently, since computer or network problems can result in
data loss.

2.5 Exit GAMBIT and check your files

1. File > Exit


2. "Yes", confirm that you wish to save changes, then the GAMBIT screen will close.
3. check that you see the 3 saved example files.
example.dbs example.jou example.trn

2.6 Opening an existing GAMBIT database

Next we return to the program where we left it.


Initiate Gambit and load example.
After the main screen appears, you will see your model. If the model is not fully shown use the
FIT TO WINDOW button as you did before.

2.7 Specifying the flow domain

Next we need to define the region of flow. For purposes of mesh distribution this region will be
considered as two offset rectangular sections.

GEOMETRY → FACE → FORM FACE


Beginning at the inlet (left most edge) shift-left-click all the edges to make a closed loop of the
upper rectangle and APPLY. The upper rectangle will turn light blue. If you make a mistake in
your selection you use RESET (next to APPLY) and try again. Similarly, define the lower
rectangle as the second face.

2.8 Specifying Mesh Edge distribution (grading)

Prior to discretizing the flow into elements it is beneficial to choose the number of elements and
distribution at the edges.

MESH → EDGE → MESH EDGES


There are two ways of specifying the number of edge divisions, by interval size or by interval
count. Firstly we will define all horizontal lines to be divided equally with an interval size of 0.3
cm.
1. Shift-left-click on all the horizontal edges then change the spacing to 0.3. You should see
something similar to that shown below. You may need to press TAB to see the preview of the
distribution, then APPLY. If you make a mistake prior to applying the mesh edges you should
press RESET (next to APPLY) and re-select the edges.

© Brunel University, Mechanical Engineering, last modified Oct2009Page 6


2. Shift-left-click all the vertical edges. Then change interval size to interval count and set a value
of 20 intervals. Next under grading enter a ratio of 1.2 and press double sided. Again press TAB to
see the preview and then APPLY.

The benefit of using a double sided grading on the vertical faces is to concentrate elements closer
to the wall in order to better resolve the relatively large velocity gradients present in a boundary
layer. The quality of the grid in any CFD problem is a major contributor to the quality of the
solution. Now the model is ready to be meshed.

2.9 Meshing the flow domain

MESH → FACE → MESH FACES


There are many options and combinations regarding mesh elements and types. Here we will apply
only the most simple, a quadrilateral mapped mesh.
Shift-left-click the upper face and then the lower face. Notice that a compatible element and type
have been selected (Quad and Map). These can be changed if required, but we will APPLY these
here.

© Brunel University, Mechanical Engineering, last modified Oct2009Page 7


If you wish to erase any aspect of the mesh, face, edge, or points then simply use the DELETE

button under the relevant menu. Note that usually when deleting a mesh alone you should
unselect "remove unused lower mesh" since this would otherwise remove all associated edges,
faces, lines and points. When you are happy with your mesh, save your work (see section 2.4).

2.10 Define the type of boundaries

GAMBIT can be used to generate grids for a wide range of numerical solvers, such as FIDAP,
FLUENT, RAMPANT, ANSYS. The type of boundary definition depends on the solver
application, in this case FLUENT5. Choose from the top menu "Solver" and then "Fluent5".
1. Solver > FLUENT5 (specifies the model will be used by FLUENT5)
2. Next we define the types of various boundaries

ZONES → SPECIFY BOUNDRY TYPES


Later during post processing it will be useful if the boundaries are separated not only by types but
also by region of interest. In this example if we assume the wall upstream of the step is heated and
we are interested in the upstream region, we will name the domain as shown below.
heated-wall-upper
in let

wall
wall
outlet

heated-wall-lower

wall

1. First change the entity option to EDGES.


2. Then enter a name and set the type.
3. Shift-left-click the edge corresponding to the definition (begin with the inlet), and APPLY.
4. Repeat the process from step 2 for the other boundaries as shown below.

Name Type Accept

inlet VELOCITY_INLET APPLY

© Brunel University, Mechanical Engineering, last modified Oct2009Page 8


outlet OUTFLOW APPLY

heated-wall-upper WALL APPLY

heated-wall-lower WALL APPLY

You should then see the boundary types associated with the given names as shown below. If you
make a mistake before you APPLY then use RESET (as before) otherwise if you have an incorrect
entry you must highlight it and choose delete followed by APPLY. Note that any boundary edges
that you do not define will be treated as a WALL by default.

When you have finished, close the "specify boundary types" menu, and save your work.

2.11 Export the mesh

The mesh is now ready to be exported to the numerical solver (FLUENT).


1. File > Export > Mesh...
2. ACCEPT the default filename of example.msh. In 2D problems you need the tick the box.
You may now exit GAMBIT. It is always good practice to check you know where your files are
and keep your directory neat by removing files you do not want or need.

© Brunel University, Mechanical Engineering, last modified Oct2009Page 9


3. FLUENT
Having discretised the domain by creating the mesh, it is now necessary to specify details about
the type of flow equations that need to be solved. This is FLUENT'S domain and will require you
to define the type of flow (laminar/turbulent), the boundary conditions, fluid properties etc.
Start ANSYS12 using the Start button. It is advisable to start FLUENT in the same directory that
you created your grid files. You should then see the FLUENT main window.

© Brunel University, Mechanical Engineering, last modified Oct2009Page 10


Read the mesh into FLUENT

File > Read > Case...

Choose your file "example.msh" and OK (the mesh data will be imported).
mesh > Check (will display statistics of the grid so you need to check that there are no error
messages, particularly that the minimum volume is positive).
Display > mesh (just to see that your import has worked correctly).

Define details of the model

Use Each of the following items on the menu in turn and check the default conditions set, modify
if necessary using "edit": General, Models (-> viscous), Materials, Boundary conditions,
Solution, Results. Leave all default conditions, which at this stage is for a laminar flow.
Define Boundary Conditions
Use the Boundary Conditions key. You will notice that the parts of the geometry you defined in
GAMBIT are shown. Use Edit to enter the boundary conditions as: in the zone box. Select each
boundary:

Set the x-velocity at "inlet" as 0.1 m/s.

© Brunel University, Mechanical Engineering, last modified Oct2009Page 11


Provide information to the solver

Use Solution and Initialization of the flow field using the inlet velocity.

Use Solution and Monitor. Here you can check that both print and plot options for monitoring of
the residuals as the iteration process progresses is on.
Select Solve, Run Calculation, set number of iterations and calculate

Display vector plots by selecting Display, Vectors

© Brunel University, Mechanical Engineering, last modified Oct2009Page 12


A velocity vector plot is displayed. More detailed post processing options will be set later.
Remember that this problem was very simple in that it was laminar, isothermal and only used a
first order discretization method for the momentum equations. We will now go back and modify
the model to be turbulent and involve heat transfer.
Save the data by selecting File, Write > Case & Data

This will save both Mesh with the settings (example.cas) and the numerical results data just
calculated (example.dat).

© Brunel University, Mechanical Engineering, last modified Oct2009Page 13


Set the problem to turbulent using k-ε model with standard wall function. Note that you may want
to change this using the Edit key.

Set the model to solve for heat transfer by selecting Models, and Edit to select energy equation.

Change the velocity to 10 m/s, set the "heated-wall upper" to constant heat flux of 500 W/m2, and
the heated-wall-lower and enter a constant heat flux of say 700 W/m2 following the procedure you
use before. Check the discretization schemes by selecting solve, method

© Brunel University, Mechanical Engineering, last modified Oct2009Page 14


Initialize and solve again.

The results can be displayed in various forms. Vector plot of the velocity field, contour plot of a
particular variable and line plots are three basic methods of displaying the results. Various menus
can be found under Display key:

Line plots can be found under Surface, Line/Rake - You need to define a line by defining the
coordinates and also giving it a name, so that you can pick that later in the menu:

© Brunel University, Mechanical Engineering, last modified Oct2009Page 15


© Brunel University, Mechanical Engineering, last modified Oct2009Page 16

You might also like