Tutorial 2
Steady Flow Past a Cylinder
ISSIG 2015/2016
Plan
Problem Specification
1. Pre-Analysis & Start-Up
2. Geometry
3. Mesh
4. Physics Setup
5. Numerical Solution
6. Numerical Results
Steady Flow Past a Cylinder
Created using ANSYS
Problem Specification
Consider the steady state case of a fluid flowing past a
cylinder, as illustrated above. Obtain the velocity and pressure
distributions when the Reynolds number is chosen to be 20. In
order to simplify the computation, the diameter of the cylinder
is set to 1 m, the x component of the velocity is set to 1 m/s
and the density of the fluid is set to 1 kg/m^3. Thus, the
dynamic viscosity must be set to 0.05 kg/m*s in order to obtain
the desired Reynolds number.
Pre-Analysis & Start-Up
Prior to opening FLUENT, we must answer a couple of questions. We must determine what
our solution domain is and what the boundary conditions are.
Solution Domain
For an external flow problem like this, one needs to determine where to place the outer
boundary. A circular domain will be used for this simulation. The effects that the cylinder has
on the flow extend far. Thus, the outer boundary will be set to be 64 times as large as the
diameter of the cylinder. That is, the outer boundary will be a circle with a diameter of 64 m.
The solution domain discussed here is illustrated below.
Boundary Conditions
First, we will specify a velocity inlet boundary condition. We will set the left half of the outer
boundary as a velocity inlet with a velocity of 1 m/s in the x direction. Next, we will use a
pressure outlet boundary condition for the right half of the outer boundary with a gauge
pressure of 0 Pa. Lastly, we will apply a no slip boundary condition to the cylinder wall. The
aforementioned boundary conditions are illustrated below.
Geometry
Strategy for Geometry Creation
In order to create the desired geometry we will first create a surface body for the cylinder.
Next, we will create a surface body for the outer boundary as a "frozen body", so that it
doesn't merge with the first surface body. Then, we will use a boolean operation to subtract
the small surface body from the large surface body. At this point, we will have the surface body
of the outer boundary with a hole in the middle where the cylinder is. Lastly, we will project a
vertical line on to the geometry, so that radial edge sizing can be implemented in the meshing
process.
Steps:
Fluid Flow(FLUENT) Project Selection
Drag Fluid Flow(FLUENT) into the Project Schematic window.
Analysis Type
(Right Click) Geometry > Properties
Set Analysis Type to 2D
Launch Design Modeler , (Double Click) Geometry
Create Inner Circle and Dimension
Create a circle, centered around the origin in the xy plane. Set the diameter of the
circle to 1m.
Inner Circle Surface Body Creation
Concept > Surfaces From Sketches.
Set the Base Object to Sketch 1 (located
underneath XYPlane in the Tree).You can
do this by clicking within the tree or you
can click on the circle to select Sketch 1.
Then click Apply next to Base Object.
Click Generate
Create New Sketch in the XY Plane
In this step we will create a new sketch in
the XY Plane. This step is required for the
boolean operation that we will carry out
later in the geometry process. It allows us
to create two distinguishable geometries, in
the xy plane.
Click on XYPlane in the Tree Outline and
it should highlight blue. Then click on
the New Sketch button, .
Create Outer Circle and Dimension
Now, create a circle centered around the origin
in Sketch 2. Set the diameter of the circle to 64m.You
can click the "fit to window" button shown below to
see both circles.
Outer Circle Surface Body Creation
In this step the Surface Body will be created as a frozen,
such that it does not merge with the inner circle surface
body.
Concept > Surfaces From Sketches.
Set the Base Object to Sketch 2 (located
underneath XYPlane in the Tree).You can do this by
clicking within the tree or you can click on the outer
circle to select Sketch 2. Then click Apply next to Base
Object.
Then set Operation to Add Frozen (“ajouter un corps
bloqué”) as shown in the image below.
Then, click Generate
Carry Out Boolean Operation:
Subtraction
In this step, the inner circle will be
subtracted from the outer circle in order to
obtain the desired geometry.
Create > Boolean. (surface selection:
Ctrl+F)
First, set Operation to Subtract. Next, use
the face selection filter, , to apply the outer
circle surface body as the Target Body.
Then, use the face selection filter, , to apply
the inner circle surface body as the Tool
Body. In order to select inner circle which
overlaps with the outer circle, you may have
to click on the planes to the lower left as
shown below.
Lastly, click Generate. At this point if you
zoom into the center of the circle you
should see the 1m diameter hole, as shown
below.
Create a Bisecting Line
The purpose of this step and the following two steps is to imprint a line onto the geometry that
will, allow for radial edge sizing in the meshing step.
Click on XYPlane in the tree and it should highlight blue. Then, click the new sketch button, .
In the new sketch draw a line on the y axis that goes through both of the concentric circles.
Make sure that it is coincident to the y axis. Then trim the line segments that lay inside of the
inner circle and the line segments that lay outside of the outer circle. This, is carried out by
using the Trim (“Ajuster”) feature located in the Modify portion of Sketching.
Line Body Creation
Concept > Lines From Sketches.
Set the Base Object to Sketch 3. (located underneath XYPlane in the Tree). Click Generate
Projection
Tools > Projection.
Apply the two lines that you created to edge and apply the surface body to target. You must
do these steps by using the line selection filter and the surface selection filter. For the two
lines hold down control to select them both. Click Generate.
Save Project and Close Design Modeler
Mesh
In this section the geometry will be meshed with 18,432 elements. The
geometry will be given 192 circumferential divisions and 96 radial divisions.
Mapped face meshing will be used and biasing will be used in order to
significantly increase the number of elements located close to the cylinder.
Launch Mesher: (Double Click) Mesh
Mapped Face Meshing
(Right Click) Mesh > Insert > Mapped Face Meshing
Set Geometry to both portions of the surface body.You will have to hold
down control in the selection process in order to highlight both halves.
Click Update.
Circumferential Edge Sizing
(Right Click) Mesh > Insert > Sizing
Set Geometry to both edges of the surface body.You will have to use the
edge selection filter and you will have to hold down control in the selection
process in order to highlight both halves. Set Type to Number of
Divisions, set Number of Divisions to 96 and setBehavior to Hard.
Click Update to generate the new mesh.
Radial Edge Sizing 1 (Top Half)
(Right Click) Mesh > Insert > Sizing
Set Geometry to the top half of the bisecting line. Set Type to Number
of Divisions, set Number of Divisions to 96 and setBehavior to Hard.
Then, set Bias Type to the first option and set Bias Factor (rapport de
transition) to 460. These selections are shown in the image below.
Radial Edge Sizing 2 (Bottom Half)
(Right Click) Mesh > Insert > Sizing
Set Geometry to the top half of the bisecting line. Set Type to Number
of Divisions, set Number of Divisions to 96 and setBehavior to Hard.
Then, set Bias Type to the second option and set Bias Factor to 460.
These selections are shown in the image below.
Then, click Update to generate the new mesh.You should obtain the
mesh, that is shown below.
Verify Mesh Size
(Click) Mesh > (Expand) Statistics
You should have 18,624 nodes and 18,432 elements.
Verify Mesh Size
(Click) Mesh > (Expand) Statistics
You should have 18624 nodes and 18432
elements.
Create Named Selections
In this section the various parts of the geometry
will be named according to the image below.
First create a named selection for the left half
of the outer boundary and call it "farfield1".
Next, create a named selection for the right
half of the outer boundary and call it
"farfield2".
Lastly, create a named selection for both sides
of the inner circle(cylinder) and call it
"cylinderwall". When creating the third named
selection, make sure that you included both
halves of the circle. You will have to hold
down control to select both edges.
Save Project
Physics Setup
Your workbench project should look like
this.
We are done with all the meshing steps but
for some reason, a tick mark doesn't appear
next to Mesh in the project page. To get the
tick mark next to mesh, right-click on it and
select Update as shown below.
Launch Fluent
(Double Click) Setup in the Workbench
Project Page.
When the FLUENT Launcher appears
change options to "Double Precision", and
then click OK as shown below.
Check Mesh
(Click) Mesh > Info > Size
You should now have an output in
the command pane stating that there are
18432 cells.
(Click) Mesh > Check
You should see no errors in
the command pane.
Specify Material Properties
Solution Setup > Materials > Fluid >
Create/Edit....
Then set the Density to 1 kg/m^3 and
set Viscosity to 0.05 kg/m*s.
Click Change/Create then click Close.
Boundary Conditions
FarField1
Solution Setup > Boundary Conditions > farfield1.
Set Type to velocity-inlet. Click Edit.... Set Velocity Specification
Method to Components, set X-Velocity to 1 m/s, and set Y-Velocity to 0 m/s.
FarField2
Solution Setup > Boundary Conditions > farfield2..
Set Type to pressure-outlet, and set gauge pressure = 0 Pa
Cylinder Wall
Solution Setup > Boundary Conditions > cylinderwall.
Set Type to wall.
Reference Values
Solution Setup > Reference Values.
Set the Density to 1 kg/m^3. The other default values will work for the purposes of
this simulation.
Save Project
Numerical Solution
Second Order Upwind Momentum Scheme
Solution > Solution Methods > Spatial Discretization.
Set Momentum to Second Order Upwind
Convergence Criterion
Solution > Monitors > Residuals > Edit....
Set the Absolute Criteria for continuity, x-velocity and y-
velocity to 1e-6. Click ok
Solution > Monitors > Create > Drag
Then check Print to Console and Plot. Next, click cylinderwall,
which is located under Wall Zones. Lastly, click ok
Initial Guess
Solution > Solution Initialization > Standard Initialization.
Set Compute From to farfield1. Alternately, you can simply set X
Velocity to 1 m/s. Then, click Initialize.
Iterate Until Convergence
Solution > Run Calculation.
Set the Number of Iterations to 2000. Then, click Calculate. (You
may have to hit Calculate twice.).
Save Project
Numerical Results
1. Velocity Vectors
Results > Graphics and Animations > Vectors > Set Up...
Then click Display. The Scale was set to 2 in the plot below.
File>save picture (vectors.jpeg)
2. Stream Lines
Results > Graphics and Animations > Contours > Set Up...
Set Contours of to Velocity.. and set the box below to Stream
Function. Make sure Filled is not selected and click Display. The plots
below were created by setting levels to 40, deselecting Auto Range,
setting Min (kg/s) to 31 and setting Max (kg/s) to 33.
File>save picture (stream.jpeg)
3. Vorticity
Results > Graphics and Animations > Contours > Set Up...
Set Contours of to Velocity.. and set the box below to Vorticity
Magnitude. Then click Display. The plot below was created by by
setting levels to 60, deselecting Auto Range, setting Min (1/s) to 0.25
and setting Max (1/s) to 9.
File>save picture (vorticity.jpeg)
4. Drag Coefficient
Reports > Result Reports > Forces > Setup
Then, click Print. The command pane will now display the following
results: the pressure force, the viscous force, the total force, the pressure
force coefficient, the viscous force coefficient and the drag force
coefficient.
Reports > Result Reports > Forces > Setup , then Click Write to save
the report as forces.txt