You are on page 1of 40

Express Introductory Training in ANSYS Fluent

Workshop 08
Vortex Shedding

Dimitrios Sofialidis
Technical Manager, SimTec Ltd.
Mechanical Engineer, PhD

PRACE Autumn School 2013 - Industry Oriented HPC Simulations, September 21-27,
University of Ljubljana, Faculty of Mechanical Engineering, Ljubljana, Slovenia

2012 ANSYS, Inc. September 19, 2013 1 Release 14.5


Workshop 7b
Vortex Shedding

14.5 Release

Introduction to ANSYS
Fluent
2012 ANSYS, Inc. September 19, 2013 2 Release 14.5
I Introduction
Workshop Description:
The purpose of this workshop is to introduce good techniques for transient
flow modeling.
Learning Aims:
This workshop teaches skills for running Fluent for timedependant
(transient) simulations. Topics covered include:
Selecting a suitable timestep. Using CustomFieldFunctions (CFF).
Autosaving results during the simulation. Generating FastFourier Transforms (FFT).
Generating images during the simulation. Transient postprocessing in CFDPost.

Learning Objectives:
To show how to set up, run and postprocess a transient (time
dependant) simulation, as well as additional skills in using custom field
functions and FastFourierTransforms.

Introduction Model Setup Solving PostProcessing Summary


2012 ANSYS, Inc. September 19, 2013 3 Release 14.5
Simulation to be Performed
The case considered here is flow around a cylinder with a Reynolds number of
100.
Vortex shedding will be observed. However the workshop starts with a steady
state analysis assuming that the user didnt anticipate this behavior.
This workshop demonstrates iterative and noniterative time advancement,
Fast Fourier Transforms (FFT) and animations.
The tutorial is carried out using Fluent and CFDPost in standalone mode.

Introduction Model Setup Solving PostProcessing Summary


2012 ANSYS, Inc. September 19, 2013 4 Release 14.5
Computational Domain
Computational domain created in ANSYS DesignModeler has the following dimensions.

Name Location Dimension

Cylinder D1 2 m (dia.)
Inlet Length D2 20 m = 10 D
Outlet Length D3 30 m = 15 D
Width D4 40 m = 20 D

Introduction Model Setup Solving PostProcessing Summary


2012 ANSYS, Inc. September 19, 2013 5 Release 14.5
Reynolds Number Effects
Re < 5 Creeping flow (no separation).

A pair of stable vortices in the


515 < Re < 40 wake.

40 < Re < 150 Laminar vortex street.

Laminar boundary layer up to


150 < Re < 3105 the separation point, turbulent
wake.

Boundary layer transition to


3105 < Re < 3.5106 turbulent.

Turbulent vortex street, but


Re>3.5106 the separation is narrower
than the laminar case.
Introduction Model Setup Solving PostProcessing Summary
2012 ANSYS, Inc. September 19, 2013 6 Release 14.5
Start a Fluent Project (Standalone)
Launch Fluent from the Start Menu:
"Start Menu>ANSYS 14.5>Fluid Dynamics>Fluent".
Select "2D" Display Mesh After Reading.
Select the working directory you are using on your
machine (may be different to that shown here).

Introduction Model Setup Solving PostProcessing Summary


2012 ANSYS, Inc. September 19, 2013 7 Release 14.5
Mesh [1]
Read the Fluent mesh file: "vortexsheddingcoarse.msh" ("File>Read>Mesh").
The mesh will be read in and displayed, and the zones will be shown in the TUI window.

Introduction Model Setup Solving PostProcessing Summary


2012 ANSYS, Inc. September 19, 2013 8 Release 14.5
Mesh [2]
The mesh needs scaling.
Select "Scale" ("Problem Setup>General>Scale"), and enter the values shown, then
press "Scale". Be careful only to press "Scale" only once.

Final domain
extent.

Close the scale panel and "Check" the Mesh.


"General>Check".
"General>Report Quality".
Display the grid again once scaling has been performed.
"General>Display".
Introduction Model Setup Solving PostProcessing Summary
2012 ANSYS, Inc. September 19, 2013 9 Release 14.5
Solver & Models
Select "General" in the navigation pane and keep the "SteadyState" "Pressure
Based" solver.
Keep "Laminar" setting for the "Viscous Model".
The properties to be used for the material "air" need to be set.
For "Density", enter "1 (kg/m3)".
Later on we will compare the
For "Viscosity", enter "0.01 (kg/ms)".
Fluent results with those from a
Select "Change/Create". literature search. We have
changed the default material
properties for air to aid that
comparison.

Introduction Model Setup Solving PostProcessing Summary


2012 ANSYS, Inc. September 19, 2013 10 Release 14.5
Boundary Conditions/Solution Methods
Boundary Conditions.
"Inlet":
Select boundary "in".
Set velocity to be "1 [m/s]" "normal" to boundary.
"Outlet":
Select boundary "out".
Keep default of "0 [Pa]".
"Other boundaries":
"cylinder" is set to a "wall", no action needed.
"sym1" and "sym2" are set to "symmetry", no action needed.

Solution Methods.
Select "QUICK" scheme for "Momentum" equation.

Introduction Model Setup Solving PostProcessing Summary


2012 ANSYS, Inc. September 19, 2013 11 Release 14.5
Solution Monitor
Set up residual monitors so the convergence can be monitored.
"Monitors>Residuals>Edit".
Make sure "Plot" is on, then "OK".

Create points to monitor quantity.


"Surface (top menu)>Point".
Specify coordinates (2 , 1).
"Activate" point tool to check location on the grid.
(check out point tool before closing panel).
"Create" then "Close".

Surface monitor on point.


"Monitors>Surface Monitors>Create".
Select "VertexAverage" on report type and "Velocity" "Yvelocity" in field variable.
Select "point6" (the point created above at coordinates [2,1]).
Options: "Print to Console" & "Plot", then "OK".
Introduction Model Setup Solving PostProcessing Summary
2012 ANSYS, Inc. September 19, 2013 12 Release 14.5
Solution Initialization
Initialize the flow field based on the farfield boundary.
Select "Standard Initialization"
"Compute from" "in" (inlet zone).
"Initialize".

Save the case file.


"File>Write Case".
You can write case and data files with extension .gz, the files will be compressed automatically.

Introduction Model Setup Solving PostProcessing Summary


2012 ANSYS, Inc. September 19, 2013 13 Release 14.5
Run Calculation [1]
Set the number of requested iterations to "400" then "Calculate".

We have tried to solve this vortex


shedding problem in a steadystate
manner. Note that solution is not
converging and monitor shows a
regular periodic behavior.

Introduction Model Setup Solving PostProcessing Summary


2012 ANSYS, Inc. September 19, 2013 14 Release 14.5
Run Calculation [2]
Choose Graphics and "Animations>Vectors".
Since this is a 2D simulation, there is no need to pick a surface, just "Display".

Steady state
solution is
asymmetric.
Introduction Model Setup Solving PostProcessing Summary
2012 ANSYS, Inc. September 19, 2013 15 Release 14.5
Save Case&Data Files and Make Transient
Save the Case&Data files.
"File>Write Case&Data".
You can write case and data files with extension .gz the files will be compressed
automatically.

To obtain a more realistic solution to this problem we will solve it again, but in a
transient (time dependant) manner.

Under "Problem Setup>General", change the time option to "Transient".

Introduction Model Setup Solving PostProcessing Summary


2012 ANSYS, Inc. September 19, 2013 16 Release 14.5
Run Calculation
For the transient scheme, it is recommended to change Solver Methods. The
default pressure velocity coupling (SIMPLE) may require more iterations to
converge.
Change to the "PISO" scheme and "2nd Order Implicit" "Transient Formulation" as
shown in the image below .
Also change the "Under Relaxation Factors" as shown in the image.

Introduction Model Setup Solving PostProcessing Summary


2012 ANSYS, Inc. September 19, 2013 17 Release 14.5
Solution Monitor
Edit the Surface monitor.
Change "Get Data Every" to "Time Step". Also set the "X Axis" to be "Time Step".
"OK"

Introduction Model Setup Solving PostProcessing Summary


2012 ANSYS, Inc. September 19, 2013 18 Release 14.5
Run Calculation [1]
Save the transient case file before starting the computation.
We need to identify a suitable time step size for this problem.
1) A quick way is to do a handcalculation to see how long it takes for the flow to pass
through a typical grid cell. Run this, and check that convergence occurs in less that 20
iterations per timestep.

2) Another approach is to determine the characteristic response of the system. By performing


a literature search, we believe that for this problem, the Strouhal number will be
approximately 0.165 at this Reynolds number. From this, we can predict the period of the
oscillation:
fD 1 D
St period 6.06 s
V f St.V
For each oscillation cycle, we will aim to solve 60 timesteps. Hence we will run the solver
using a timestep size of 0.1s.

Introduction Model Setup Solving PostProcessing Summary


2012 ANSYS, Inc. September 19, 2013 19 Release 14.5
Run Calculation [2]
Specify "Time Step" ("0.1 s") and "Number of Time Steps" ("120').
Click on the "Extrapolate Variables" option.
"Calculate" the solution.

Use this option to


change the display to
show both output
Windows.

The "Extrapolate Variables" option will speed up


convergence. Without this option, each timestep would
start with the solution at the previous timestep. This
option provides a better starting point for the new
timestep based on how the solution is changing with
time. Notice that as the solver runs, convergence is
attained in 510 iterations at each timestep.

Introduction Model Setup Solving PostProcessing Summary


2012 ANSYS, Inc. September 19, 2013 20 Release 14.5
Run Calculation [3]
Save the transient case&data files.
Note if you add the string %t to the filename ("vortexsheddingtransient%t.gz")
then Fluent will append the current time value to the filename. Note also that this file
just contains the results at the current timestep. If you require interim results as the
solution progresses, use the "Autosave" feature prior to running the model. We will do
this shortly.
Although we now have simulated a couple of oscillations, in order to obtain a true
representation of the vortex shedding we need to simulate many more cycles. With
each cycle, the "starting position" converges with time until eventually all cycles
are identical.
It will take many cycles to achieve this, so we have provided case and data files
that has already been converged (simulation time of 84secs). You will then run this
on for a further couple of cycles to extract the detail of the fluctuating flow
patterns.

So, read in the supplied Case and Data file:


"vortexsheddingconverged.cas.gz" and ".dat.gz".

Introduction Model Setup Solving PostProcessing Summary


2012 ANSYS, Inc. September 19, 2013 21 Release 14.5
NITA
Enable the "Non Iterative Time Advancement Method" (NITA).
With "Fractional Step" for "PressureVelocity Coupling".

NITA is an algorithm used to speed up the


transient solution process.
NITA runs about twice as fast as the ITA scheme.
2
NITA scheme reduce the splitting error to O(t2)
by using subiterations per time step.
Overall timediscretization Truncation Splitting error (due
error for 2ndorder = error: O(Dt2)
+ to eqn segregation):
scheme: O(Dt2) O(Dtn)

Two flavors of NITA schemes available.


- PISO (NITA/PISO).
- Fractionalstep method (NITA/FSM). 1
About 20% cheaper than NITA/PISO on a per
timestep basis.

Introduction Model Setup Solving PostProcessing Summary


2012 ANSYS, Inc. September 19, 2013 22 Release 14.5
Result Analysis
Save the transient case&data files.
One of the ways of quantifying the wake vortices is through the use of the "QCriterion".
The formula for this is below. It is not a standard quantity computed by Fluent, however
since we know the formula, we can ask Fluent to compute it at each grid cell.
U V U V
Q .
x y y x
"Define>Custom Field Functions"
Select solver quantities using the pull down list at the right hand side to construct this
function as shown, then press "Define".

Introduction Model Setup Solving PostProcessing Summary


2012 ANSYS, Inc. September 19, 2013 23 Release 14.5
Extracting Transient Data
Unless specifically requested, Fluent will not save interim results during a transient
simulation. There are two ways you may want to consider doing this:

1) Saving the results data every (n) timesteps to disk. This will give a collection of files
that can be postprocessed at a later date, either using Fluent or CFDPost. However
having to load in a large number of files can be time consuming.

2) The alternative is to extract the required result (like an image from which to build an
animation) from Fluent during the solution process. Since all the data is in memory at
that instant, this is very quick to perform.

We will do both in this example.

Introduction Model Setup Solving PostProcessing Summary


2012 ANSYS, Inc. September 19, 2013 24 Release 14.5
Save Interim Results
To save interim results:
Select "Calculation Activities", and save "Every 5 Time Steps".
Press "Edit", and specify the name of the file to be saved.
Note that the file name will be appended with the current time value
(e.g. "transientdetail00845.dat.gz").
"OK".

Introduction Model Setup Solving PostProcessing Summary


2012 ANSYS, Inc. September 19, 2013 25 Release 14.5
Saving Images OnTheFly [1]
Select "Calculation Activities>Solution Animation>Create/Edit".
Increase "Number of Sequences" to "1".
"Sequence 1", "Every" "2 Time Steps".
"Define", which will open the "Animation Sequence" window.
Set "Window to 3", press "Set" to enable this window, and "Display Type" to
"Contours".
Continued on next slide...

Introduction Model Setup Solving PostProcessing Summary


2012 ANSYS, Inc. September 19, 2013 26 Release 14.5
Saving Images OnTheFly [2]
Set up the contour panel as shown in the image below, then "Display".
Set the graphics window to display screen "3".
Draw a zoombox with the middle mouse button to zoom in on the cylinder.
Note that the file name will be appended with the current time value.
Close the contour panel, then "OK" to both panels opened on previous slide.

Introduction Model Setup Solving PostProcessing Summary


2012 ANSYS, Inc. September 19, 2013 27 Release 14.5
Solution Monitors
Edit the Surface monitor again.
Check the box next to "Write" and specify a name for the file. This type of file can be
used for Fourier Transform analysis.
"OK".

Introduction Model Setup Solving PostProcessing Summary


2012 ANSYS, Inc. September 19, 2013 28 Release 14.5
Run Calculation for Creating Animation
Run the calculation:
Use a smaller timestep for NITA (0.05s).
Solve for 240 Time Steps.
Calculate (this corresponds to roughly 2 periods).
Save the Case and Data File.
Remember that if you add the string %t to the filename ("vortexshedding
transient%t.gz") then Fluent will append the current time value to the filename.

Introduction Model Setup Solving PostProcessing Summary


2012 ANSYS, Inc. September 19, 2013 29 Release 14.5
Post Processing (Fluent) [1]
To run the animation (Graphics and Animation in the navigation pane on the left,
then choose Solution Animation Playback and Set Up)
Use the Play button to view a movie of the series of images.
If required, this can be written out as an mpeg movie.

Introduction Model Setup Solving PostProcessing Summary


2012 ANSYS, Inc. September 19, 2013 30 Release 14.5
Post Processing (Fluent) [2]
From the Plot Menu, select "FFT" then "Setup".
From the Fourier Transform Window, "Load Input File" and pick the supplied file
"fftdata2000timesteps.out"(this file was generated after running the
simulation for 2000 timesteps. Tip: You may need to alter the file selection filter
to "All Files" to see this).
Pick "Magnitude" for "YAxis Function".
Pick "Strouhal Number" for "XAxis Function".
Continued on next slide

Introduction Model Setup Solving PostProcessing Summary


2012 ANSYS, Inc. September 19, 2013 31 Release 14.5
Post Processing (Fluent) FFT [1]
Pick "Axes", and for the "XAxis" turn off "AutoRange".
Set bounds from "0.05" to "1". "Apply", then "Close".
Select "Plot FFT".
Continued on next slide

Introduction Model Setup Solving PostProcessing Summary


2012 ANSYS, Inc. September 19, 2013 32 Release 14.5
Post Processing (Fluent) FFT [2]
You may need to change the graphic window so that "Spectral Analysis" is visible.

The peak Strouhal number is 0.171, which is close to the 0.165


that was suggested by the literature search. To extract the exact
peak value from this graph, enable "Write FFT to file" and look at
the text file on disk. The second peak is a harmonic as the input
signal is not perfectly sinusoidal.

Introduction Model Setup Solving PostProcessing Summary


2012 ANSYS, Inc. September 19, 2013 33 Release 14.5
Close Fluent Run CFDPost
Close Fluent.
Open a CFDPOST session.
We will create an animation.

Introduction Model Setup Solving PostProcessing Summary


2012 ANSYS, Inc. September 19, 2013 34 Release 14.5
Post Processing (CFDPost) [1]
Animation in CFD post can be done based on all the data files already saved
Thus, you can create any animation once calculation is finished.
"File>Load Results".
Select last time step data file (Make sure you select the files generated from the
autosave feature, with a filename "transientdetail1nnnnn.dat.gz", rather than the
results that you have saved manually whilst working though the instructions.
Select "Load complete history as": "A single case".

Introduction Model Setup Solving PostProcessing Summary


2012 ANSYS, Inc. September 19, 2013 35 Release 14.5
Post Processing (CFDPost) [2]
Insert a vector.
Open a CFDPOST
session.
Keep default name
"Vector 1".
Location "Symmetry 1".
"Apply".
Click on the "Z" axis to
align the view angle.

Introduction Model Setup Solving PostProcessing Summary


2012 ANSYS, Inc. September 19, 2013 36 Release 14.5
Post Processing (CFDPost) [3]
Activate Timestep Selector panel.

Pick a time value from


the list then Apply to
see the result at that
timestep.
Click on the film icon,
then the play button,
for a quick animation
of all saved timesteps.
Recall that in Fluent, we
generated a contour plot
every 2 timesteps. We
saved the data files used
here every 5 timesteps.
Introduction Model Setup Solving PostProcessing Summary
2012 ANSYS, Inc. September 19, 2013 37 Release 14.5
Optional Further Work
There are many ways the simulation in this tutorial could be extended.
Mesh independence.
Check that results do not depend on mesh.
Rerun simulations with finer mesh(es).
Generated in ANSYS Meshing application, or,
from adaptive meshing in Fluent.

You can investigate other


Reynolds number effects. flow pattern by changing
the Reynolds number.
For lower Reynolds number, steady state analysis with laminar model is possible.
For higher Reynolds numbers, unsteady transitional turbulent models (kkl
omega, SST) have to be considered.
While for Reynolds number higher than 3.5106 , the standard or SST komega
turbulence models would be used.

Introduction Model Setup Solving PostProcessing Summary


2012 ANSYS, Inc. September 19, 2013 38 Release 14.5
WrapUp
This workshop has shown the basic steps that are applied in all CFD simulations:
Setting boundary conditions and solver settings.
Running steady and transient models.
Using iterative and noniterative advancement schemes.
Postprocessing the results, both in Fluent and CFDPost for transient cases.
One of the important things to remember in your own work is, before even
starting the ANSYS software, is to think WHY you are performing the simulation:
What information are you looking for.
What do you know about the boundary conditions.

In this case we were interested in calculating flow around a cylinder, and assessing
the vortex shedding frequency. We checked with FFT analysis that predicted
frequency is in good agreement with results from literature.

Knowing your aims from the start will help you make sensible decisions of how
much of the part to simulate, the level of mesh refinement needed, and which
numerical schemes should be selected.

Introduction Model Setup Solving PostProcessing Summary


2012 ANSYS, Inc. September 19, 2013 39 Release 14.5
References
Braza, M., Chassaing, P., & Minh, H. H., "Numerical Study and Physical Analysis of
the Pressure and Velocity Fields in the Near Wake of a Circular Cylinder", J. Fluid
Mech., 165:79130, 1986.

Coutanceau, M. & Defaye, J. R., "Circular Cylinder Wake Configurations A Flow


Visualization Survey", Appl. Mech. Rev., 44(6), June 1991.

Williamson, C. H. K, "Vortex Dynamics in The Cylinder Wake", Annu. Rev. Fluid


Mechanics, 28:447539, 1996.

2012 ANSYS, Inc. September 19, 2013 40 Release 14.5