FLUENT Tutorial 3 - Unsteady Flow Over a Cylinder

Post on 09-Dec-2015

213 views 33 download

Tags:

description

fluENT

transcript

1

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 von Karman

vortex street) and estimate its frequency, i.e. Strouhal number. We also want to calculate the lift and drag

coefficients for the cylinder.

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.

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

16.5 m 13.5 m

š· = 1 m 7.5 m

7.5 m

2

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.

3

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.

4

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.

5

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ā€.

6

Step 7:

In the Outline tab expand Geometry and select Surface Body.

In the Details tab set Thickness to 0 (I donā€™t know why is it not already 0?)

7

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.

8

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.

9

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.

10

Step 8d:

In the Outline tab right click Mesh and select Insert ā€“ Inflation. Weā€™ll 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.

11

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.

12

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.

13

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.

14

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.

15

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 in drag and lift coefficient calculations.

16

Step 14:

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

17

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.

18

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.

19

Step 15b:

Similar to the previous step create a lift coefficient monitor.

20

Step 16:

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

21

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.

22

Residual plot will have zig-zags as shown below. These show the convergence of the iterations at each time step.

As seen, at the beginning of the solution residuals drop below the default tolerance value of 1e-3 in less than 50 iterations. This means that Max Iterations / Time Step value that we set previously as 50 is enough.

23

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).

24

Step 18:

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

25

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).

26

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

27

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

28

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.

29

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.

30

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 and 80 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 not aware

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.

31

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.

32

Step 21a:

To create a movie of vortex shedding letā€™s 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

33

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.

34

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.