You are on page 1of 14

Exp: 03 - Simulation of supersonic flow over a wing of convex cross section

Problem Specification

Consider a 15 angle wedge at zero angle of attack. The incoming flow conditions are: M1=3,
p1=1 atm, T1=300 K. Use FLUENT to obtain the flowfield over the wedge. Compare the pressure
coefficient on the wedge surface with the corresponding analytical result for an oblique shock.

Step 1: Create Geometry in GAMBIT


This tutorial leads you through the steps for generating a mesh in GAMBIT for a wedge
geometry. The generated mesh can then be read into FLUENT for fluid flow simulation.
In an external flow such as that over a wedge, we need to define a farfield boundary and mesh
the region between the wedge and the farfield boundary. It is a good idea to place the farfield
boundary well away from the wedge to reduce interference with the shock that we want to
observe.
The overall boundary is shown below.

Where ABCDE is the farfield boundary and FE is the wedge.

Start GAMBIT

Create a new directory called wedge and start GAMBIT from that directory by typing gambit -id
wedge at the command prompt.
Under Main Menu, select Solver > FLUENT 5/6 since the mesh to be created is to be used in
FLUENT 6.0.

Create Vertices

The coordinates needed for the mesh are shown below


Label x y z

A 0 0 0

B 0 1.259 0

C 0.5 1.259 0

D 1.5 1.259 0

E 1.5 0.268 0

F 0.5 0 0

Using bottom up approach, we start by creating vertices of the geometry using the coordinate
given.

Operation Toolpad > Geometry Command Button > Vertex Command Button >
Create Vertex
Create the vertices by entering the coordinates under Global and the label under Label:
Click the FIT TO WINDOW button to scale the display so that you can see all the vertices. The
resulting image should look like this:

Create Edges

Now we can create the edges using the vertices created.

Operation Toolpad > Geometry Command Button > Edge Command Button >
Create Edge
Create the edge AB by selecting the vertex A followed by vertex B. Enter AB for Label.
Click Apply. GAMBIT will create the edge. You will see a message saying something like
"Created edge: AB'' in the Transcript window.
Similarly, create the edges BC, CD, DE, EF, FA and CF. Click on the to select the vertices
from the list and move them to the picked list. You can also hold the shift button and mouse
click the vertices for selection.The resulting image should look like this.

Create Faces

The edges we have created can be joined together to form faces. We will need to define two
faces.

Operation Toolpad > Geometry Command Button > Face Command Button >
Form Face
This brings up the Create Face From Wireframe menu. Recall that we had selected vertices in
order to create edges. Similarly, we will select edges in order to form a face.
We will call two faces face1 and face2. To create the face1, select the edges AB, BC, CF, and
FA. Enter face1 for the label and click Apply. GAMBIT will tell you that it has "Created face:
face1'' in the transcript window.
Similarly, create the face face2 by selecting CD, DE, EF and CF.
We are now ready to mesh the geometry.

Step 2: Mesh Geometry in GAMBIT


Mesh Faces

We will mesh each of the 2 faces separately to get our final mesh. Before we mesh a face, we
need to define the point of distribution for each of the edges that form the face.
We will use the default setting for meshing of the edge.

Operation Toolpad > Mesh Command Button > Edge Command Button ** *> Mesh
Edges*
Select the edge AB. The edge will change color and an arrow will appear on the edge. This
indicates that you are ready to mesh this edge. Select interval size under Spacing. Enter 0.04
for interval size.
Next we will mesh the edge BC. Select the edge BC and enter 0.04 for interval size.
Do the same for edge CD and CF.
Now that the appropriate edge meshes have been specified, mesh the face face1:

Operation Toolpad > Mesh Command Button > Face Command Button > Mesh
Faces
Select the face1. The face will change color. You can use the defaults of Quad (i.e.
quadrilaterals) and Map. Click Apply.
The meshed face should look as follows:

Next mesh face face2 in a similar fashion.


The resultant mesh should look as follows:

Note that for each mesh face, we only define 2 mesh edges. Gambit will automatically define
the other two mesh edge for face mesh creation. Manual mesh of all edges can be done if more
control of the mesh is required. Please refer to the index of the GAMBIT User Guide and look
under Edge>Meshing for explanation on other type of meshing parameters.

Step 3: Specify Boundary Types in GAMBIT


We'll label the boundary ABCDE as farfield, EF as wedge and AF as symmetry. Recall that
these will be the names that show up under boundary zones when the mesh is read into
FLUENT.
Group Edges

We'll create groups of edges and then create boundary entities from these groups.
First, we will group AB, BC, CD and DE together.
Operation Toolpad > Geometry Command Button > Group Command Button > Create
Group
Select Edges and enter farfield for Label, which is the name of the group. Select the edges AB,
BC, CD and DE.
Note that GAMBIT adds the edge to the list as it is selected in the GUI.

Click Apply.
In the transcript window, you will see the message "Created group: farfield".

Similarly, create the other two groups. You should have created a total of three groups:
Group Name Edges in Group

farfield AB,BC,CD,DE

wedge EF

symmetry EF

Define Boundary Types

Now that we have grouped each of the edges into the desired groups, we can assign
appropriate boundary types to these groups.
Operation Toolpad > Zones Command Button > Specify Boundary Types
Under Entity, select Groups.
Click on the wedge surface. Next to Name:, enter wedge. Leave the Type as WALL.

Click Apply.
In the Transcript Window, you will see a message saying "Created Boundary entity: wedge".
Similarly, create boundary entities corresponding to farfield and symmetry groups. Set Type the
to Pressure Farfield andsymmetry in each case.

Save Your Work

Main Menu > File > Save

Export Mesh

Main Menu > File > Export > Mesh...


Save the file as wedge.msh.
Make sure that the Export 2d Mesh option is selected.
Check to make sure that the file is created.

Step 4: Set Up Problem in FLUENT


You can proceed with the flow solution steps below.

Launch FLUENT

Start > All Programs > ANSYS 12.0 > Fluid Dynamics > FLUENT
Select 2D under the Dimension list and Double Precision under the Options list, and click Run.
In the double-precision solver, each floating point number is represented using 64 bits in
contrast to the single-precision solver which uses 32 bits. The extra bits increase not only the
precision but also the range of magnitudes that can be represented. The downside of using
double precision is that it requires more memory.

Import File

File > Read > Mesh...


Navigate to your working directory and select the wedge.msh file. Click OK.
Check that the displayed information is consistent with our expectations.

Analyze Grid

First, we check the grid to make sure that there are no errors.
Problem Setup > General > Check
Any errors in the grid would be reported at this time. Check the output and make sure that there
are no errors reported.
Mesh > Info > Size
How many cells and nodes does the grid have?
General > Mesh > Display...
You can look at specific parts of the grid by choosing the items you wish to view
under Surfaces (click to select and click again to deselect a specific boundary).
Click Display again when you have selected your boundaries. Note what the surfaces farfield,
wedge, etc. correspond to by selecting and plotting them in turn.

Define Properties

General > Solver > Type


We see that FLUENT offers two methods ("solvers") for solving the governing equations:
Pressure-Based and Density-Based. To figure out the basic difference between these two
solvers, let's turn to the documentation.
Help > User's Guide Contents ...
This should bring up ANSYS FLUENT 12.0 User's Guide in your web browser. If not, access the
User's Guide from the Start menu: Start > Programs > ANSYS 12.0 > Help > FLUENT
Help. This will bring up the FLUENT documentation in your browser. Click on the link to the
user's guide.
Go to chapter 26 in the user's guide; it discusses the Pressure-Based and Density-Based
solvers. Section 26.1 introduces the two solvers:
Since we expect an oblique shock for our problem and the density-based solver is likely to
resolve the shock better, let's pick this solver.

In the Solver menu, select Density-Based.


Problem Setup > Models
Double click on Viscous - Laminar
Select Inviscid under Model.

Click OK. This means the solver will neglect the viscous terms in the governing equations.
Models > Energy
Double click on Energy - Off
In compressible flow, the energy equation is coupled to the continuity and momentum
equations. So we need to solve the energy equation for our problem.
To turn on the energy equation, check the box next to Energy Equation and click OK.
Problem Setup > Materials
Make sure air is selected under Fluid. Double click air, set Density to ideal-gas and make
sure Cp is constant and equal to 1006.43 j/kg-k. Also make sure the Molecular Weight is
constant and equal to 28.966 kg/kgmol. Selecting the ideal gasoption means that FLUENT will
use the ideal-gas equation of state to relate density to the static pressure and temperature.
Click Change/Create.
Define > Operating Conditions
To understand what the Operating Pressure is, read through the short-and-sweet section
8.14.2 in the user's guide. We see that for all flows, FLUENT uses the gauge pressure internally
in order to minimize round-off errors. Any time an absolute pressure is needed, as in the ideal
gas law, it is generated by adding the operating pressureto the gauge pressure:
absolute pressure = gauge pressure + operating pressure
Round-off errors occur when pressure changes p in the flow are much smaller than the
pressure values p. One then gets small differences of large numbers. For our supersonic flow,
we'll get significant variation in the absolute pressure so that pressure changes p are
comparable to pressure levels p. So we can work in terms of absolute pressure without being
hassled by pesky round-off errors. To have FLUENT work in terms of the absolute pressure, set
the Operating Pressure to 0.

Thus, in our case, there is no difference between the gauge and absolute pressures. Click OK.
Define > Boundary Conditions
Set the boundary condition for the pressure_farfield surface (aka zone) to the boundary
type pressure-far-field by clicking on the drop-down list. Select Yesin the pop-up window
asking if it's "OK to change pressure_farfield's type from wall to pressure-far-field?".
Set the Gauge Pressure to 101325. Set the Mach Number to 3. Under X-Component of Flow
Direction, enter a value of 1 (i.e. the farfield flow is in the X direction).
Next, click on the Thermal Tab. Change the temperature to 300K.

Click OK. The pressure-far-field boundary type effectively imposes that there is no upstream
propagation of disturbances if the flow at the boundary is supersonic. See section 7.9 of the
FLUENT help for more details about this boundary type.
Similarly, change the boundary condition for the symmetry surface to the symmetry boundary
type. No user input is required for the symmetry boundary type. At any boundary set to
the symmetry type, FLUENT internally sets

normal velocity = 0
normal gradients of all variables = 0

See section 7.14 of the FLUENT help for more details.


The boundary type for the wedge surface is set to wall by default. There is no need to change
that.

Step 5: Solve!
Solve > Controls or Solutions > Solution Controls
Click on the Equations button and select Flow, then click OK. Also, set the Courant
Number to 0.1.
Solve > Methods or Solutions > Solution Methods
We'll use a second-order discretization scheme. Under Spatial Discretization,
set Flow to Second Order Upwind.

Solve > Initialization or Solutions > Solution Initialization


This is where we set the initial guess values for the iterative solution. We'll use the farfield
values (M=3, p=1 atm, T=300 K) as the initial guess for the entire flowfield.
Select farfield under Compute From. This fills in values from the farfield boundary in the
corresponding boxes. (Alternately, I could have typed in these values but I like to palm off as
much grunt work as possible to the computer.)
Click Initialize. Now, for each cell in the mesh, M=3, p=1 atm, T=300 K. These values will of
course get updated as we iterate the solution below.
FLUENT reports a residual for each governing equation being solved. The residual is a measure
of how well the current solution satisfies the discrete form of each governing equation. We'll
iterate the solution until the residual for each equation falls below 1e-6.
Solve > Monitors
Select Residuals - Print and click Edit. Set Absolute Criteria for all equationsto 1e-6.
Also, click on Plot. This will plot the residuals in the graphics window as they are calculated;
giving you a visual feel for if/how the iterations are proceeding to convergence.
Click OK.
Main Menu > File > Write > Case...
This will save your FLUENT settings and the mesh to a "case" file. Type in wedge.cas for Case
File. Click OK.
Solve > Run Calculation...
Set the Number of Iterations to 1000. Click Calculate.
The residuals for each iteration are printed out as well as plotted in the graphics window as they
are calculated. The residuals after 1000 iterations are not below the convergence criterion of 1e-
6 specified before. So run the solution for 1000 more iterations. The solution converges in about
1510 iterations; the residuals for all the governing equations are below 1e-6 at this point.
Save the solution to a data file:
Main Menu > File > Write > Data...
Enter wedge.dat for Data File and click OK. Check that the file has been created in your working
directory. You can retrieve the current solution from this data file at any time.

Step 6: Analyze Results

Plot Velocity Vectors


Let's plot the velocity vectors obtained from the FLUENT solution.
Display > Graphics and Animations or Results > Graphics and Animations
Select Vectors, click on the Set up button. Under Color by, select Mach Number in place
of Velocity Magnitude since the former is of greater interest in compressible flow. The colors of
the velocity vectors will indicate the Mach number. Use the default settings by clicking Display.
This draws an arrow at the center of each cell. The direction of the arrow indicates the velocity
direction and the magnitude is proportional to the velocity magnitude (not Mach number, despite
the previous setting). The color indicates the corresponding Mach number value. The arrows
show up a little more clearly if we reduce their lengths. Change Scale to 0.2. Click Display.
Zoom in a little using the middle mouse button to peer more closely at the velocity vectors.

We can see the flow turning through an oblique shock wave as expected. Behind the shock, the
flow is parallel to the wedge and the Mach number is 2.2. Save this figure to a file.

You might also like