Professional Documents
Culture Documents
CFDLab Cylinder
CFDLab Cylinder
(1)
where U is the stream velocity of the uid, is the uid density, is the
dynamic viscosity and D is the characteristic length (here, D is the diameter of
the circular cylinder). The kinematic viscosity is dened as:
=
(2)
Strouhal number (St): a measure of the frequency of the vortex shedding
(non- dimensional number).
St =
fD
U
(3)
where f is the frequency of the vortex shedding.
Karman vortex street: a wake of alternating vortices in a regular fashion
behind a body.
Courant Number, or Courant-Friedrichs-Lewy condition (CFL), Co:
a necessary condition for numerical convergence to, usually hyperbolic, PDEs.
Co =
t u
x
(4)
where t is the time step, u is the magnitude of the velocity through that cell
and x is the cell size in the direction of the velocity.
Vorticity (): a vector quantity, representing the local rotation of a uid
element
= u. (5)
Figure 2: von Karman vortex street at Re=105. Streaklines visualized by elec-
trolytic precipitation in water (Van Dyke 1988, An album of uid motion, The
parabolic press, CA)
3
Fluid Dynamics Software Lab Flow past a circular cylinder
1.3 Fluid forces acting on the cylinder
Drag: in the direction of the stream velocity.
Lift: perpendicular to the direction of the stream velocity.
2 Pre-processing
2.1 Mesh generation with ANSA
A demonstration of the high-accuracy mesh generation software ANSA (www.beta-
cae.gr/) will be given. The mesh for this problem will be generated step-by-step
which will then be used for processing in OpenFOAM.
2.2 Inspect mesh with ParaView
- Open a Terminal window
- Change to the cylinder case directory
cd Desktop/CFDLab/cylinder/
ls
It is always a good practice to view the mesh before running the case for any
errors. The mesh can be viewed in ParaView, the post-processing tool supplied
with OpenFOAM. It is started by typing from within the case directory, in the
terminal, the command:
paraFoam
ParaView has opened the cylinder.OpenFOAM.
- Select the Patch Names and all the Mesh Parts in the bottom left side of the
GUI windown
- Click the Apply button to load the geometry into ParaView
- At the top of the GUI window, press on the arrow adjacent to Outline and
choose Surface With Edges
- Zoom, Pan, and Rotate the geometry to see the cylinder and the boundaries
(check default or change mouse functions from Edit > Settings > Render View
> Camera; you can also change the Background Color to white from Edit >
Settings > Colors)
What type of mesh is used for this geometry?
What is the size and shape of the computational domain?
What type of boundaries are used and how are they labeled?
- Close ParaView
4
Fluid Dynamics Software Lab Flow past a circular cylinder
3 Processing
3.1 Run the case
- Run the case with the OpenFOAM solver icoFoam
icoFoam
This will take a while.. (or maybe not?)
Error message: what went wrong?
Notice the mean value of the Courant Number (Co). Co must be less than 1 to
achieve temporal accuracy and numerical stability.
3.2 Re-run the case
- Open the controlDict le of the system/ folder (use any text editor you prefer,
emacs, gedit, vi etc)
emacs system/controlDict &
- Change the value of t to 0.01
- Save and close le
- Run the solver again
icoFoam
Does the Courant Number remain below 1?
3.3 Check solution
- Open Gnuplot
gnuplot
- Plot the lift force coecient
plot ./forces/0/forceCoes.dat u 1:3 w l
Is the solution converged?
It is crucial to ensure convergence of the numerical solution to the exact so-
lution. The time evolution of the drag, lift, and moment coecients can give
such information. Initially, the values of the force coecients will uctuate,
as a result of the uctuation of the numerical solution. It is safe to say the
solution has converged when the force coecients have also converged and show
a sustained behavior, e.g. reach a constant value, be periodic etc.
- Exit gnuplot
exit
5
Fluid Dynamics Software Lab Flow past a circular cylinder
4 Post-processing
4.1 Calculate the vorticity
- First compile the post-processing utilities in OpenFOAM
/opt/openfoam200/applications/Allwmake
- Calculate the vorticity
vorticity
4.2 Visualize results
- Open paraFoam and load the case by selecting all the Mesh Parts and Volume
Fields
- Select Surface instead of Outline at the top of the GUI window
- Pan and zoom on the cylinder and from the top-right of the GUI deselect Show
Center
- At the left side of the GUI, press Refresh Times
- From top-left of the GUI, press the arrow adjacent to Solid Color and select
vorticity
- From the top-far-left, turn the Color Legend visible
- Press the adjacent button to edit the Color Map. Press Choose Preset and
select HSV from Blue to Red. Press OK.
- Within the Color Scale Editor, deselect the Automatically Rescale to Fit Data
Range option. This will make the Rescale Range option active. Press it and Set
Range from 0 (minimum) to 4 (maximum). Close.
- From the top-center of the GUI, press Play.
Can you see the Karman vortex street?
- Activate the Stream Tracer icon (eight button from the left, at the fourth row
of options, or else from Filters > Alphabetical > Stream Tracer)
- Slide the bar down in the Object Inspector eld and under at the Seed Type
replace Point Source with Line Source
- Choose the following
Point1 1.5 1.5 0
Point2 1.5 -1.5 0
Resolution 31
- Press Apply
What is the streamline pattern around the cylinder?
What is the pressure in the vortex cores?
6
Fluid Dynamics Software Lab Flow past a circular cylinder
4.3 Find the Strouhal frequency & verify the results
- Close ParaView
- Open gnuplot and plot the force coecient le from the forceCoes.dat le
within the forces/0/ directory. Find the frequency of the oscillation.
gnuplot
plot ./forces/0/forceCoes.dat u 1:3 w l
max y = GPVAL DATA Y MAX
min y = GPVAL DATA Y MIN
print max y
print min y
exit
grep 0.0168 forces/0/forceCoes.dat
- Open gnuplot
print 1/(119-113.02)
What is the Strouhal frequency?
What is the Strouhal number?
Is your result veried with the theoretical value for this Re?
The theoretical value of St for Re=100 is 0.165 (Williamson & Brown, J. Fluid
Struct., 12, 1998).
5 Conclusions
In this Software Lab, the ow past a circular cylinder was considered to demon-
strate a complete process for computational uid dynamics, from pre-processing
to post-processing. There was a demonstration of the ANSA mesh generation
software (www.beta-cae.gr/). The generated mesh was imported in OpenFOAM
to compute the numerical solution, which was visualized with ParaView. Gnu-
plot was used for further data analysis. Numerical issues and verication of the
results were discussed.
Further reading
G.K. Batchelor, An Introduction to Fluid Dynamics, Cambridge University
Press; 2000.
D.J. Tritton, Physical Fluid Dynamics, Oxford University Press; 1988.
7