You are on page 1of 13

STAR-CCM+ Tutorial number 1: Flow Around a 2-D Cylinder

Sergio E. Perez, Ph.D. Copyright 2005. No part of this document may be copied after
downloading without the consent of the author. This document is available for download
free-of-charge from www.computationalfluids.com .

In this tutorial you will learn how to run a simulation in Star-CCM+, from Adapco, Inc.
We will model the flow around a 2-D cylinder, and compare our results to experimentally
obtained data.

Introduction:

There are three steps to running a CFD simulation:


• Grid Generation (sometimes referred to as pre-processing). In this step, the mesh
is made covering the flow domain. This is usually the most time-consuming step,
requiring the 3-D definition of the object being analyzed.
• Processing: running the simulation on a computer.
• Post-Processing. This step involves analyzing the results from the simulation.

We will use a pre-generated grid of a 2-D cylinder, avoiding the tedium of having to
create a grid. The results should be comparable to 3-D flow around a long cylinder placed
perpendicularly in a flow. Since the cylinder is long, any effects due to the cylinder edges
are insignificant.

Tutorial:

Before beginning you must download the midres.ccm.ngeom file from


www.computationalfluids.com . Please make a mental note as to where you are saving to,
as you will need it soon!

1) Click on the Star-CCM+ icon. A mostly empty screen will appear.


2) Go up to File/New Simulation in the upper left corner.
3) A window will open asking you to select the server options. We are not running a
parallel simulation, nor a remote session from a server, so just click OK.
4) Click OK after information/legal disclaimers come up.
5) In the upper left portion of your screen you will see some options:

1
6) Go to File/Import and import midres.ccm.ngeom (Star-CCM files have the ccm.ngeom
extension) from wherever you saved it when you downloaded it.

7) Nothing is visible after you imported it! To see the file, right-click Scenes/New
Scene/Geometry. Anytime you want to see anything new on the screen, you generally
have to go to scenes.

8) You will now see a cylinder in a box.

2
9) You can use your left mouse button to move the scene around. Notice that it’s a thin 3-
D piece. Since the demo version of Star-CCM+ that we are using is limited to about
17,000 cells, we will only do a 2-D analysis. The third dimension eats up cells rapidly!

10) Convert the 3-D body to a 2-D body by going to the taskbar at the top of the page and
click on Mesh/Convert to 2-D/OK. The body has disappeared!

11) To see the new body, go to Scenes again – you know how now!

12) The 2-D body should now be visible. Notice that if you try to move it around as
before, you can only shift it around in translational motion, and you cannot see the third
dimension.

13) Under Mesh again, click on Diagnostics and click OK. This is necessary since
sometimes, especially if you are using a grid generator other than the standard one for
Star-CCM+, the geometry may not be in the proper format.

14) To see the mesh, go to Geometry Scene 2 (Geometry 2 is the new 2-D body you just
created). Click on Geometry 1 under scene 2, and check the “Mesh” box. Notice that it’s
finer near the cylinder walls. This is done to help capture the higher gradients expected in
the boundary layer.

3
The flow will enter from the left, and leave at the right. more on this later when we
specify our boundary conditions.

15) Now we must tell the program something about the problem to be solved. Go to
Continua/ Continuum 1. Double-click on Models.

16) A screen for model selection appears, meaning how you want the problem solved.

4
Click on Stationary (the body is not moving)/ Two-dimensional (2-D flow)/ Liquid/
/Segregated Flow (the energy and momentum equations are not coupled (see the
book!))/constant density (incompressible flow)/ steady flow/ turbulent/ k-e model (by
default Star-CCM+ will use the RKE model if you select k-e).

Incidentally, when you select Liquid, the program automatically selects water. You can
change this by going to Continuum 1/Models/Liquid.

17) Ignore the Optional choices and click on the close button.

18) We need to now select the boundary conditions. Go to regions/ Zone-112. You will
see five listings. These are the five walls, including the body itself. Think of what’s going
to happen as a virtual water tunnel, with the flow entering from the left face, and exiting
at the right face, going around the body in the middle. The top and bottom boundaries are
the top and bottom of the water tunnel

5
19) Click on the 1st entry, which should be Wall-13 1, or the bottom of the tunnel. In the
lower left of your screen you will see “Properties of Wall-13 1”.

20) Click on “Type”. You will see that there are several options. We want this boundary
to be a wall, so just use the default. If you expand the Wall-13 1 “Boundaries” entry, you
will see the display below:

6
21) Click on “Conditions”. You will now see “Shear Stress Specification” and
“Tangential Velocity Specification”. Using these you can specify how you want the wall
to behave. If you select the velocity option, you would be specifying a velocity at the
wall. Instead, we will specify the shear at the wall, by clicking on “Shear Stress
Specification”, then selecting the “Slip” option for the wall. This means that there will be
no friction at this wall, which means that there will be no boundary layer on the wall to
upset the flow around our cylinder.

22) Click on the next wall, which should be the left portion of the tunnel. We will specify
this to be the inlet to our water tunnel, with the water flowing from left to right. Select the
“Velocity Inlet” option under “Conditions”.

23) Under “Values”, enter a constant velocity of 10 m/s (no need to input the units, as the
default setting is m/s). Make sure you hit ENTER to set the value! Leave the default
values of turbulent intensity and turbulent viscosity ratio. To properly do a CFD analysis,
one must know the intensity of the turbulence entering the area (See the book “A First
Course in Computational Fluid Dynamics”, available at www.computationalfluids.com) .
If this is not known, Star-CCM+ will automatically enter a value of 10%, which means
the turbulent fluctuations are 10% of the entering 10 m/s.

24) Make the upper wall a slip wall.

7
25) The right wall is the outlet. Make this wall a “Pressure Outlet” type, where we
specify the exit pressure out of the tunnel. Under “Values”, a constant static pressure of
0.0 KPa is used, that is, 0 KPa gauge pressure, relative to the reference pressure of
101325 Pa (atmospheric pressure – the default). The reference pressure can be changed if
desired under Continuum 1/Reference Values/ Pressure.

26) The last wall is the cylinder itself. Keep the default setting of “No-slip”. In other
words, this is a real surface with a boundary layer, where the no-slip-condition applies.

27) Star-CCM+ needs to know when to stop iterating. Go to “Stopping Criteria”, click on
maximum steps, and keep the default setting of 1000 steps. In other words, we are
instructing the program to stop after 1000 iterations are made. If you need to do more, as
determined by your post-processing (more on this later), you can restart the program
where it left off and have it do any number of more iterations.

28) We wish to know the drag coefficient of the cylinder. Right click on reports/New
Report/Force Coefficient. We wish to have the total coefficient, including both shear and
pressure forces.

Notice that the direction the coefficient will be calculated on is the [1.0, 0.0, 0.0]
direction. These are x, y, z components. If we wanted a lift coefficient we would type in
[0.0, 1.0, 0.0]. Make sure you hit ENTER!

Put in a reference area of 1.5 (the cylinder was made with a diameter of 1.5 m in the grid
generation part of the process, which the reader had no control over). Since the case is
two-dimensional, the z-dimension is considered unity. The reference area is the
“Snapshot” area that the flow sees, or 1.5 x 1.

Put in a reference density of 998 kg/m^3 (the density of water).

Put in a reference velocity of 10 m/s. The drag coefficient will be calculated using this
velocity.

In the option for Parts with “[]” next to it, click on the brackets. The different walls on the
geometry will be displayed. You must tell the program which wall you want the force
coefficient for, so select the cylinder, sending it to the right-hand section of the window.

It’s sometimes good to look at the drag coefficient plot to as the iterations are being
made, to ascertain if the program is converging upon a value. To do this, right click on
the Force 1 monitor/create monitor from report. Force 1 Monitor appears under Monitors.
Right-click on Create Plot from Monitor. As you run the simulation, you will be able to
see the drag coefficient displayed every iteration. You can change the scale as it runs, if
you wish.

29) To make the job a little easier for the program, and to cut down on the time to
converge, it’s helpful to give some fairly realistic initial value to all the velocities in the

8
tunnel. Since the incoming speed is 10 m/s, it’s not a bad choice to set all the speeds
inside the tunnel to the same number. These will change as the simulation runs. Go to
Continua/Initial Conditions, and set the speed to 10 m/s.

30) On the taskbar at top you will see an icon of a man running. Hit this to run your
simulation. You will see a plot of residuals come up (if not, at the top of the plot you can
select what to see: the geometry, the force coefficient plot you created in the latter portion
of step 28, or the residual plot), and updated as the program runs:

It appears that the residuals stop changing after about 200 iterations. You could probably
instruct the program to stop by hitting the stop button way before the 1000 iterations are
up, since things do not seem to change much after a point. Note that the residuals are
plotted for the continuity, momentum, turbulent kinetic energy (Tke) and Turbulence
dissipation rate (Tdr). Please consult the book to learn more about what these are.

31) We now wish to do our post-processing. or analysis of the results. Go to Scenes/New


Scenes/Vector. The default setting is the velocity field, which should now come up with a
very pretty plot. If this does not happen, under Vector Scene 1/Vector 1/Vector
Field/Select Velocity. Note that you could use this to plot other vectors.

32) Zoom in on the velocity vectors by using the rubber band zoom button near the top (if
you put the mouse over each icon, the screen will tell you what you are looking at), next
to the camera icon.

9
Notice that the results are color-coded. The max speed is near the top of the cylinder, as
might be expected, and that this is in accordance with potential flow theory (frictionless),
which predicts the flow speed at the top to be twice the upstream speed.

We do note something troublesome – there appears to be no flow separation as one might


expect in flow over a blunt object such as a cylinder! We begin to think that something is
off.

33) We plot the pressure next (a scalar). Make a new scene, and select scalar and the
pressure. You can make the plot look smoother by clicking on Scalar 1, and changing the
contour style to smooth-filled. This makes the color transitions smoother.

10
We note that the pressure is highest at the stagnation point at the forward portion of the
cylinder, and that pressure is lowest at the top and bottom. This is all as expected, as
pressure goes down when velocity goes up, and vice-versa. However, the high pressure in
the aft portion is troublesome – one might expect the pressure to be low in the wake
region. We are becoming pretty sure that something is wrong!

34) Just for fun, we make scalar plots of the turbulent viscosity ratio (the ratio of the
turbulent viscosity to the dynamic viscosity):

11
It appears from the plot that there is turbulence generated aft of the cylinder, but we are
frankly not quite sure what to make of the plot.

35) We make a scalar plot of the turbulent kinetic energy:

Like the previous plot, it appears that the turbulent kinetic energy is about what one
might expect, with larger turbulence in the wake, but again, we are not quite sure what to
make of the plot.
It’s interesting to note that the tunnel appears to smooth out the flow after entry.

36) To see the drag coefficient, click on the force monitor icon (to the left of where it
says Force Monitor, on the icon that looks like a paper). The drag coefficient is
considerably different from experimental values: at Re = 1E7, the drag coefficient should
be about 0.4 (Re is calculated by Re = VD/ν, where ν is the kinematic viscosity).

Clearly something is wrong with our analysis. We now investigate the effects of grid size
in the assignment below. We expect the separation point of the flow to be at 120 degrees
in turbulent flow (the transition to turbulent flow occurs at about Re = 3E5, so make sure
any runs you make are at a Reynolds number greater than this:

12
120 degrees -
separation

Some notes before you go on: You can clear the solution to re-run the program, by going
to Solution on the task bar at top, and re-run the program You can change any of the
many parameters you selected before running.

Assignment 1:

Investigate the effect of using a smaller, more refined mesh. Run the same analysis using
file twod6k.ccm (about 6,000 cells), twodbig2.ccm (12,364 cells), and twodbig3.ccm
(13,566 cells). In all of these, the radius of the cylinder is 0.7 m (as opposed to 0.75 in the
example above), so make sure you specify this when preparing your force coefficient.
You will note that the cylinder is no longer at the center of the tunnel. Make sure you
allow the largest amount of empty space AFT of the ball – in other words, choose the exit
boundary so it has more space between it and the cylinder than the front portion of the
ball has between it and the inlet. This is done because it is expected that the flow will be
disturbed a greater distance aft than forward of the cylinder.

Assignment 2:

Run the 13,566 cell model with the flow in the opposite direction (in other words, the
inlet is now the outlet, and vice-versa). Is there any difference in the drag coefficient
value?

Assignment 3:

Experiment with the 13,000 cell model and the following turbulence models: Rke
(default when you select k-e), standard k-e, k-w, and sst k-w. Which gives a value closest
to the experimental drag coefficient and separation point of 120 degrees?

Report: Prepare a report addressing the results of the following assignments. What do
you conclude about the grid size? About the orientations of the tunnel? About the
turbulence models? Make sure you address separation point and drag coefficient.

13

You might also like