You are on page 1of 34

Middle East Technical University

Mechanical Engineering Department


ME 485 CFD with Finite Volume Method
Spring 2015 (Dr. Sert)
ANSYS Fluent1 Tutorial 3
Problem Definition
We want to simulate the unsteady flow over a 2D cylinder. Problem domain is a rectangular box with a circular
hole in it, as shown below. Fluid properties are = 1 kg/m3 , = 1 Pa s. To simulate the flow with Reynolds
number = 80, inlet velocity at the left boundary is set to be 80 m/s. Exit pressure is taken as 0 Pa (this is a
reference pressure value, the value itself is not important in this problem) . To minimize the effect of top and
bottom boundaries on the flow field, zero shear is specified on them. No slip BC is specified at the cylinder
surface.
We are interested in capturing the time periodic vortex shedding behind the cylinder (known as the vonKarman
vortex street) and estimate its frequency, i.e. Strouhal number. We also want to calculate the lift and drag
coefficients for the cylinder.

16.5 m

7.5 m

13.5 m

= 1m

7.5 m

Reference: A. L. F. L. M. Silva, A. Silveira-Neto, J. J. R. Damasceno Numerical simulation of two-dimensional


flows over a circular cylinder using the immersed boundary method, J. Comp. Physics, 189, 351-370, 2003.

ANSYS 14.5 is used to prepare this tutorial. There might be some changes if you use another version.

Step 0:
Before working on this tutorial finish the first and the second.

Step 1:
Start ANSYS Workbench.
Find Fluid Flow (Fluent) in the Toolbox tab and drag and drop it to the Project Schematic tab.
Change the name of the analysis to Tutorial 3.

Step 2:
Click on the Geometry cell.
In the Properties tab change Analysis Type to 2D.
Double click on the Geometry cell to start the DesignModeler.
Do not change the default length unit Meter.

Step 3:
In the Sketching tab go to Settings and check the Snap checkbox.
Set Major Grid Spacing to 5 m.
Set Minor-Steps per Major to 5.
Set Snaps per Minor to 2.
This will allow you to draw the problem geometry exactly using the mouse.

Step 4:
In the Sketching tab select Draw Rectangle.
In the Graphics tab first click on point (-16.5, -7.5) for the lower left corner of the rectangle and then click on
point (13.5, 7.5) for the upper right corner of the rectangle. As you move the mouse you can see the x and y
coordinates of the pointer on the lower right corner of the DesignModeler window.
In the Sketching tab select Draw Circle.
In the Graphics tab first click on point (0, 0) for the center of the circle and then click on (0.5,0) for the arbitrary
point on its perimeter.

Step 5:
In the Concept menu select Surface from Sketches.
In the Graphics tab select 4 edges of the rectangle and the circle and click the Apply button in the Details tab.
Click the Generate button in the toolbar. A new part will be generated.

Save the project and close the DesignModeler window to go back to the Workbench window.

Step 6:
In the Workbench double click on the Mesh cell to start the Meshing application.
Click on the Edge button of the toolbar in order to be able to select edges.
In the Geometry tab using the Ctrl key select the top and bottom edges of the rectangle, right click and select
Create Named Selection. Give a name wall to this selection.
Similarly create named selections as inlet, outlet and cylinder.

Step 7:
In the Outline tab expand Geometry and select Surface Body.
In the Details tab set Thickness to 0 (I dont know why is it not already 0?)

Step 8a:
In the Outline tab right click on Mesh and select Insert Method.
Select the 2D domain in the Geometry tab and click on the Apply button of the Details tab.
Change Method to Triangles.

Step 8b:
In the Outline tab right click on Mesh and select Insert Sizing.
Click the Edge button of the Toolbar in order to be able to select an edge.
In the Graphics tab select the circle.
In the Details tab click the Apply button.
Change Element Size to 0,001. This way there will be elements on the cylinder with size 0,001 m.

Step 8c:
In the Outline tab select Mesh.
In the Details tab change Max Face Size to 0,3 m to control the element sizes away from the cylinder.
Click Generate Mesh button of the toolbar.
An ustructured mesh of 8066 nodes (seen in the Statistics part of the Details tab) will be generated.

Step 8d:
In the Outline tab right click Mesh and select Insert Inflation. Well create a structured boundary layer mesh
around cylinder.
Select the 2D surface and click the Apply button next to Geometry cell of the Display tab.
Select the circle and click the Apply button next to Boundary cell of the Display tab.
Set Inflation Option to First Layer Thickness.
Set First Layer Height to 1e-3, Maximum Layers to 40 and Growth Rate to 2.5.
Click the Update button of the toolbar.

10

Zoomed view of the created mesh is given below. It has 13000 nodes.

Save the project and close the Meshing window to go back to the Workbench.

11

Step 9:
In the Workbench window double click on Setup to start Fluent.
In the Fluent Launcher window check Double Precision option.

Step 10:
In the General tab select Pressure-Based solver, which is the appropriate one for incompressible flows.
For 2D Space, select Planar option.

12

Step 11:
In the Materials tab select air and press the Edit button.
In the opened window change Name to myfluid.
Set Density to 1 and Viscosity to 1.
Press Change/Create button and click Yes on the popup window.
Close Create/Edit Materials window.

13

Step 12:
In the Boundary Conditions tab, select cylinder zone and make sure that its Type is wall.
Select inlet zone and make sure that its Type is velocity-inlet. Click the Edit button and set Velocity Magnitude

to 80 m/s to simulate =
= 80.

Select outlet zone and make sure that its Type is pressure-outet.
Select wall zone and make sure that its Type is wall. Click the Edit button and set Shear Condition to Specified
Shear with shear components being their default values of zero. This way at the top and bottom walls fluid will
slip freely, i.e. no-slip condition is not applied and the effect of wall is minimized.

14

Step 13:
In the Reference Values tab set Area (Frontal area of the cylinder, i.e. the diameter in 2D), Density and Viscosity
to 1 and Velocity to 80. These are the values that will be used i n drag and lift coefficient calculations.

15

Step 14:
In the Solution Methods tab change Transient Formulation to Second Order Implicit.

16

Step 15a:
In the Monitors tab press the Create Drag button to create a drag coefficient monitor. Select the created cd-1
monitor and press the Edit button.

17

In the Drag Monitor window check Print to Console and Plot checkboxes. Set Window to 2.
Select cylinder as Wall Zones.
Click the Axes button.

In the Axes Drag Monitor Plot window select Y Axis, deselect Auto Range and set Minimum and Maximum
values as shown. Click Apply and Close buttons.

18

Step 15b:
Similar to the previous step create a lift coefficient monitor.

19

Step 16:
In the Solution Initialization tab press the Initialize button to perform the automated hybrid initialization.

20

Step 17:
In the Run Calculation tab set Time Step to 0.001 and Number of Time Steps to 10000 to perform a simulation
up to 10 s.
Set Max Iterations/Time Step to 50.
Press the Calculate button.

21

Residual plot will have zig-zags as shown below. These show the convergence of the iterations at eachtime step.
As seen, at the beginning of the solution residuals drop below the default tolerance value of 1e-3 in lessthan50
iterations. This means that Max Iterations / Time Step value that we set previously as 50 is enough.

22

Watch the Cd and Cl graphs during the solution and after 3.15 seconds of run (3150 time steps) stop the run by
pressing the Cancel button. As seen below time periodicity is reached and both curves start doing constant
amplitude and frequency oscillations. Cd value does slight oscillations around 1.40 and Cl curve oscillates
between +- 0.23 with a zero mean value. Both values agree with the values given in the reference study(See the
first page).

23

Step 18:
In the Graphics and Animations tab select Contours and press Set Up.

24

In the Contours window set Contours of to Velocity and Vorticity Magnitude.


Check Filled and uncheck Auto Range checkboxes.
Set Min and Max values to 0 and 200. Press the Display button.

Following contour plot will be generated, showing the counter-rotating von Karman vortices shed from the top
and bottom of the cylinder (Sometimes the contour plot does not show up when you press the Display button,
a second or third trial may be necessary. Looks like a visualization bug).

25

Step 19:
CFD-Post software that comes with ANSYS can also be used to visualize the results.
Close Fluent, go to Workbench and double click on Results. CFD-Post will start. By default the solution at the
final time (10 s) will be shown.
In the Insert menu select Stremaline. A new item named Streamline 1 will appear in the Outline window.
Set Start From property of the streamline item to inlet.
Click Apply

26

Following streamlines seeded from 25 equally spaced points from the inlet will be drawn.

27

Step 20:
Although this is an unsteady flow we only have the solution at the final time of the simulation. It is seen in the
following Timestep Selector window that can be opened from the Tools menu of CFD-Post. Only the initial
condition at = 0 and the final solution at = 10 are available.

28

If we want to have more results, for example to create a movie of the vortex shedding, go to the Workbench
and double click on Solution to start Fluent.
In the Calculation Activities tab, set Autosave Every value to 1. This way a results will be saved to a file at
every time step.

29

In Run Calculation tab, set Number of Time Steps to 80. With the time step 0.001, 80 time steps will perform
a simulation of 0.08 s, which approximately corresponds to one cycle of vortex shedding for = 80.
Press the Calculate button. The solution will start by using the last available solution as the starting point and80
more time steps will be calculated.
Important: If you get a warning that says The solution needs to be initialized, it means that Fluent is notaware
of your already finished run. From the File menu select Import Data. Go to dp0\FFF\Fluent folder in your
working directory and select the last file with dat.gz extension.

30

When the solution is done close Fluent and go to the Workbench. Double click on Results to start CFD-Post.
Open the Timestep Selector window from the Tools menu. As seen below solutions of all 80 time steps show
up. You can select any of them any visualize the result of that step.

31

Step 21a:
To create a movie of vortex shedding lets use the v velocity contour plot.
In CFD-Post select Contour from the Insert menu. Set its parameters as follows

Following contour plot will be generated for the initial time step

32

Step 21b:
Select Animation from the Tools menu.
Set the movie parameters as follows and press the Play button. The movie of contour plots changing in a
shedding cycle will be saved to your computer.

33

Exercises:

Calculate the Strouhal number of the flow using

where is the frequency of the shed vortices (or the frequency of the oscillations of the Cd or Cl graphs).
Compare the result with that of the reference. For this, at Step 15 select to write the Cl and Cd data to a
text file and investigate that file (plot it outside ANYSS if you need) after the solution is completed.
=

Create vs angle graph shown in page 368 of the reference study.

Close Fluent and go to the Workbench. Open the Meshing application, suppress the Inflate option and
regenerate the mesh. Close meshing. In the Workbench right click Mesh cell and click Update. Double click
Setup cell and say Yes to the warning window. Make sure that the displayed mesh is the new mesh.
Reinitialize the solution and resolve the problem. Do you get different results, better or worse compared
with the reference?

Increase time step to 0.005 and 0.01 and solve the problem again. Compare the Cl and Cd results with those
obtained with 0.001 time step.

In the Solution Method tab of Fluent (Step 14) change Scheme to SIMPLE and see how the run time is
affected by this.

Simulate = 300 case and compare the results with that of the reference.

34

You might also like