You are on page 1of 20

Problem Specification

Let's revisit the pipe flow example considered in the previous exercise. As before, the
inlet velocity is 1 m/s, the fluid exhausts into the ambient atmosphere and density is 1
kg/m 3 . For µ = 2 x 10 -5 kg/(ms), the Reynolds no. based on the pipe diameter and
average velocity at the inlet is

This change of viscosity has taken us from a Reynolds number of 100 to 10,000. At this
Reynolds number, the flow is usually completely turbulent.

We are interested in viewing results for the centerline velocity, skin friction coefficient
and the axial velocity profile at the outlet.

Step 1: Pre-Analysis & Start-Up

Preliminary Analysis

A turbulent flow exhibits small-scale fluctuations in time. It is usually not possible to


resolve these fluctuations in a CFD calculation. So the flow variables such as velocity,
pressure, etc. are time-averaged. Unfortunately, the time-averaged governing equations
are not closed. (i.e. They contain fluctuating quantities which need to be modeled using
a turbulence model.) No turbulence model is currently available that is valid for all types
of flows and so it is necessary to choose and fine-tune a model for particular classes of
flows.

In this exercise, you'll be turned loose on variants of the k-ε model. But in the real world,
tread with great caution: you should evaluate the validity of your calculations using a
turbulence model very carefully (which, ahem, means that there is no getting away from
studying fluid dynamics concepts and numerical methods very carefully). FLUENT
should not be used as a black box. The k-ε models consist of two differential equations:
one each for the turbulent kinetic energy k and turbulent dissipation ε. These two
equations have to be solved along with the time-averaged continuity, momentum and
energy equations. So turbulent flow calculations are much more difficult and time-
consuming than laminar flow calculations. This is an exercise to whet your appetite for
turbulent flow calculations.
Start ANSYS FLUENT

Since the flow is axisymmetric, the geometry is a rectangle as in the Laminar Pipe Flow
tutorial. We will first use a 100x30 mesh (i.e. 100 divisions in the axial direction and 30
divisions in the radial direction).

We could create this mesh from scratch, as in the Laminar Pipe Flow tutorial, but
instead, we will modify the previous 100x5 to get the 100x30 mesh. This will introduce
you to the art of modifying meshes in the ANSYS Workbench Mechanical Mesher.

Step 3: Mesh

Care to skip the Laminar Flow tutorial?


If you would like to skip the Laminar Flow tutorial, you can download the completed
project here (right click and select Save As..., which will be used as a template in this
Turbulent Flow tutorial. Unzip the folder and open up the project before continuing.

Care to skip the meshing step?


If you would like to skip the meshing step, you can download the project with this step
completed here (right click and select Save As..., and skip to the Setup.

You should have completed the Laminar Pipe Flow tutorial before continuing with this
one. The starting point for this tutorial is the ending point of the one before it. If you bring
up the project we have already completed, you can follow the next steps.

Right click on Mesh . Then click on Duplicate, which will duplicate the mesh from the
previous tutorial. Enter "Turbulent Flow" in the highlighted field to rename it. At this point
your project schematic window should appear as below:

Next, double click on the Mesh cell so we can edit the mesh.

We need to change the edge sizing, as we did in the previous tutorial, to 100 by 30
(instead of 100 by 5). We are also going to need to bias it. This is because we want
smaller divisions the closer you get to the wall. First, right click on Edge Sizing 2 in the
Project tree on the left, and click Delete to remove the existing edge sizing on the inlet
and outlet.
Next, we'll apply an edge sizing with bias to the inlet, the left end of the pipe. Click Mesh
Control > Sizing. Using the edge selection tool, highlight the inlet (left end) of the pipe
and click Apply next to Geometry. As in the Laminar Pipe Flow tutorial, change Type to
Number of Divisions, and enter 30. Change Behavior to Hard. Now, let's apply a bias
to the edge sizing. Under Bias Type, select the second option, - – — ----. Enter a Bias
Factor of 30. Your Details of "Edge Sizing 2" should now appear like the image below.

Now we would like to apply an edge sizing to the outlet, the right end of the pipe. Once
again, we'll use 30 divisions, with a bias factor of 10 and with the smaller divisions at the
top, near the wall. This time, when selecting Bias Type, choose the first option, ---- — –
-. This will put the smallest divisions at the top. Other than this, the procedure is the
same as for the inlet. When complete, your Details of "Edge Sizing 3" should look like
this:

Next, close the meshing window to return to the main project view.

Recall that we created the following boundary types for the 100x5 mesh in the Laminar
Pipe Flow tutorial:

Edge Position Name Type

Left inlet VELOCITY_INLET

Right outlet PRESSURE_OUTLET


Top wall WALL

Bottom centerline AXIS

Step 4: Setup (Physics)

Launch FLUENT

We will be working within the ANSYS Workbench 13.0. Before launching FLUENT, click
Refresh Project. The Setup cell should now appear with a lightning bolt. To launch
FLUENT, double click on the Setup cell from the Project view. Make sure the Double
Precision option is selected, and if using a computer with multiple cores, you can
select the Parallel option, and choose the number of processors to use.

Once Fluent has opened, select Problem Setup > General > Display...

Make sure all 5 items under Surfaces are selected. Then click Display. Remember
that we can zoom in using the middle mouse button. Zoom in and admire the mesh. How
many divisions are there in the radial direction?

Recall that you can look at specific components of the mesh by choosing the entities you
wish to view under Surfaces (click to select and click again to deselect a specific
boundary). Click Display again when you have selected your boundaries. Use this
feature and make sure that the boundary labels correspond to the correct geometric
entities.

Define Governing Equations

Problem Setup > General > Solver


Choose Axisymmetric under 2D Space. As in the laminar pipe flow tutorial, we'll use
the defaults of Pressure-Based Type, Steady flow and Absolute Velocity Formulation.

Problem Setup > Models > Energy...

The energy equation can be turned off since this is an incompressible flow and we are
not interested in the temperature. Make sure Energy - Off appears.

Problem Setup > Models > Viscous - Laminar

Click Edit... and choose k-epsilon (2eqn). Notice that the window expands and
additional options are displayed on choosing the k-epsilon turbulence model. Under
Near-Wall Treatment, pick Enhanced Wall Treatment so that we may get a
more accurate result.

Click OK.

Problem Setup > Materials

Double click on air and change Density to 1.0 kg/m^3 and Viscosity to 2e-5
kg/(m*s). These are the values in the Problem Specification. We'll take both as
constant.
Click Change/Create and close the window.

Define Boundary Conditions

Problem Setup > Boundary conditions > Operating Conditions...

Recall that for all flows, FLUENT uses the gauge pressure internally. Any time an
absolute pressure is needed, it is generated by adding the operating pressure to the
gauge pressure. We'll use the default value of 1 atm (101,325 Pa) as the Operating
Pressure.

Click Cancel to leave the default in place.

We'll now setup the boundary conditions at the wall, centerline, inlet and outlet.

Problem Setup > Boundary conditions

We don't need to set any parameters for the wall zone. FLUENT will automatically
detect that this location should be set as a wall based on its name. Verify this by
selecting that zone and looking at its type in the drop down menu.

Next, let's look at the centerline. Since we are solving an axisymmetric problem, we will
set the centerline as the axis. Set centerline to axis boundary type, using the drop
down menu.

Choose inlet and click on Edit.... Change the Velocity Specification Method to
Magnitude, Normal to Boundary. Enter 1 m/sfor Velocity Magnitude. This
indicates that the fluid is coming in normal to the inlet at the rate of 1 meter per second.
Select Intensity and Hydraulic Diameter next to the Turbulence
Specification Method. Then enter 1% for Turbulence Intensity and 0.2m for
Hydraulic Diameter. Click OK to set the boundary conditions for the inlet.
The (absolute) pressure at the outlet is 1 atm. Since the operating pressure is set to 1
atm, the outlet gauge pressure = outlet absolute pressure - operating pressure = 0.
Choose outlet under Zone. The Type of this boundary is pressure-outlet. Click on
Edit. The default value of the Gauge Pressure is 0. Click Cancel to leave the
defaults in place.

Note: Backflow in the Pressure Outlet menu refers to flow entering through an outlet
boundary. This is not likely to happen in this case. So we don't have to set the backflow
parameters.

This completes the boundary condition specification.

Reference Values

Let's setup the reference values, which will be used later on while calculating results.

Problem Setup > Reference Values


Select Compute from > inlet.

Step 5: Solution
We'll use second-order discretization for the momentum equation, as in the laminar pipe
flow tutorial, and also for the turbulence kinetic energy equation which is part of the k-
epsilon turbulence model.

Solution > Solution Methods

Change the Discretization for Momentum, Turbulence Kinetic Energy and


Turbulence Dissipation Rate equations to Second Order Upwind (if you do not
see all of the equations scroll down to see them).
The order of discretization that we just set refers to the convective terms in the
equations; the discretization of the viscous terms is always second-order accurate in
FLUENT. Second-order discretization generally yields better accuracy while first-order
discretization yields more robust convergence. If the second-order scheme doesn't
converge, you can try starting the iterations with the first-order scheme and switching to
the second-order scheme after some iterations.

Set Convergence Criteria

Recall that FLUENT reports a residual for each governing equation being solved. The
residual is a measure of how well the current solution satisfies the discrete form of each
governing equation. We'll iterate the solution until the residual for each equation falls
below 1e-6.

Solution > Monitors > Residuals, Statistic and Force Monitors

Double click on Residuals.Notice that Convergence Criterion has to be set for the
k and epsilon equations in addition to the three equations in the last tutorial. Set the
Convergence Criterion to be 1e-06 for all five equations being solved.

Select Print to Console and Plot under Options. This will print as well plot the
residuals as they are calculated which you will use to monitor convergence.
Click OK.

Set Initial Guess

We'll use an initial guess that is constant over the entire flow domain and equal to the
values at the inlet:

Solution > Solution Initialization

In the Solution Initialization menu that comes up, choose inlet under Compute
From. The Axial Velocity for all cells will be set to 1 m/s, the Radial Velocity to 0
m/s and the Gauge Pressure to 0 Pa. The Turbulence Kinetic Energy and
Dissipation Rate(scroll down to see it) values are set from the prescribed values for
the Turbulence Intensity and Hydraulic Diameter at the inlet.
Click Initialize.

This completes the problem specification. Save your project.

Setup Data Export

In addition to the standard data quantities used in FLUENT, we would also like to view
the results for the Skin Friction Coefficient.

Solution > Run Calculation > Data File Quantities

Under Additional Quantities, select Skin Friction Coefficient, which should be


roughly half way down. Your window should now look like this:
Iterate Until Convergence

Solve for 700 iterations.

Solution > Run Calculation

In the Iterate menu that comes up, change the Number of Iterations to 700. Click
Calculate.

The solution converges in a total of about 220 iterations.


Click here to see a higher resolution image.

We need a larger number of iterations for convergence than in the laminar case since
we have a finer mesh and are also solving additional equations from the turbulence
model.

Step 6: Results

y+

Turbulent flows are significantly affected by the presence of walls. The k-epsilon
turbulence model is primarily valid away from walls and special treatment is required to
make it valid near walls. The near-wall model is sensitive to the grid resolution which is
assessed in the wall unit y+(defined in section 10.9.1 of the FLUENT user manual). We'll
gloss over the details for now and use the following rule of thumb: select the near-wall
resolution such that y+ > 30or < 5 for the wall-adjacent cell. Look at section 10.9, Grid
Considerations for Turbulent Flow Simulations, for details.

First, we need to set the reference values needed to calculate y+.

Problem Setup > Reference Values

Select inlet under Compute From to tell FLUENT to use values at the pipe inlet for
the reference values. Check that the reference value for density is 1 kg/m 3, velocity is 1
m/s, and coefficient of viscosity is 2e-5 kg/m-s as given in the Problem
Specification.These reference values will be used to non-dimensionalize the distance of
the cell center from the wall to obtain the corresponding y+ values.

Let's plot y+ values for wall-adjacent cells to check how it compares with the
recommendation mentioned above.

Results > Plots > XY Plot > Set Up...

Make sure that Position on X Axis is set under Options. Also, make sure that 1 is
the value next to X, and 0 is the value next to Y and Z under Plot Direction. Recall
that this tells FLUENT to plot the x-coordinate value on the abscissa of the graph. Pick
Turbulence...under Y Axis Function and select Wall Yplus from the drop down
list under that. Since we want the y+ value for cells adjacent to the wall of the pipe,
choose wall under Surfaces.

Click Plot.
Click here to see a higher resolution image.

As we can see, the wall _y+_value is between 1.6 and 1.9 (ignoring the anomalous at
the inlet). Since this is less than 5, the near-wall grid resolution is acceptable.

Save Plot

In the Solution XY Plot Window, check the Write to File box under Options. The
Plot button should have changed to the Write... button. Click on Write.... Enter
yplus.xy as the file name and click OK. Check that this file has been created in your
FLUENT working directory.

Centerline Velocity

Under Y Axis Function, pick Velocity... and then in the box under that, pick Axial
Velocity. Finally, select centerline under Surfaces since we are plotting the axial
velocity along the centerline. De-select wall under Surfaces.

Click on Curves... in the Solution XY Plot window. Select the solid line option under
Pattern as shown below. Change Weight to 2. Select the blank option under
Symbol. Click Apply and Close.
Turn on grid lines: In the Solution XY Plot window, click on Axes.... Turn on the grid
by checking the boxes Major Rules and Minor Rules under Options. Leave Auto
Range checked. Click Apply. Select Y under Axis and repeat. Click Apply and
Close.

Uncheck Write to File. Click Plot.

Click here to see a higher resolution image.

We can see that the fully developed region starts around x=5m with the centerline
velocity becoming constant at a value of 1.195 m/s. This is quite a bit lower than the
value of 2 m/s for the laminar case. Can you explain the difference based on the
physical characteristics of laminar and turbulent flows?
Save the data for this plot as vel.xy.

Coefficient of Skin Friction

The definition of the skin friction coefficient was discussed in the laminar pipe flow
tutorial. The required reference values of density and velocity have already been set
when plotting y+.

Go back to the Solution XY Plot Window. Under the Y Axis Function, pick Wall
Fluxes..., and then Skin Friction Coefficient in the box under that. Under
Surfaces, we are plotting the friction coefficient along the wall. Uncheck centerline
surface.

Uncheck Write to File. Click Plot.

Click here to see a higher resolution image.

We can see that the fully-developed value is 0.0085. Compare this with what you'd
expect from the Moody chart.

Save the data for this plot as cf.xy.

Velocity Profile

We'll plot the axial velocity at the outlet as a function of the distance from the center of
the pipe.

Change the plot settings so that the radial distance from the axis is plotted as the
ordinate: In the Solution XY Plot window, uncheck Position on X Axis under
Options and choose Position on Y Axis instead. Under Plot Direction, change X
to 0and Y to1. For the X Axis Function i.e. the abscissa, pick Velocity... and Axial
Velocity under that.

Since we want to plot this at the outlet boundary, pick only outlet under Surfaces.

Uncheck Write to File. Click Plot.

Click here to see a higher resolution image.

The axial velocity is maximum at the centerline and zero at the wall to satisfy the no-slip
boundary condition for viscous flow. Compare qualitatively the near-wall velocity gradient
normal to the wall with the laminar case. Which is larger? From this, what can you say
about the relative strengths of near-wall mixing in the laminar and turbulent cases?

Save this plot as profile.xy.

Step 7: Verification & Validation


In order to assess the numerical accuracy of the results obtained, it is necessary to
compare results on different meshes. We'll re-do the calculation on a 100x60 mesh
which has twice the number of nodes in the radial direction as the 100x30 mesh. You
can download the 100x60 mesh here.

File > Read > Case...

Navigate to your working directory elect the pipe100x60.msh file you have created.
Click OK. Display the grid. Check its size.
Finer Mesh Analysis

Repeat steps 4, 5, and 6 of this tutorial with the finer mesh.

When you get to step 6 of the tutorial, plot each of the graphs as described. However, for
each of the plots, overlay the corresponding result for the coarser mesh so that we may
compare them. To do this, after the plotting the finer mesh result, in the Solution XY
Plot Window, click on Load File.... Navigate to your working folder, click on the
appropriate filename for the previous result, eg. vel.xy for centerline velocity, and click
OK. Click Plot. You'll see both results plotted in the same the graphics window.

Higher Resolution Image

In the centerline velocity plot above, the white line represents the centerline velocity of
the finer mesh, while the red line represents the velocity of the coarser mesh from
before. As we can see, there isn't too much of a difference between the two plots. Save
this plot as vel2.xy.

Now, let's take a look at the coefficient of skin friction. This time, load the cf.xy file to
compare against the plot. This is the coefficient of skin friction plot:
Higher Resolution Image

Once again, we can see that due to the fine degree of each mesh, there isn't much
difference between the two plots. Save this plot as cf2.xy. Now, study the velocity of
the outlet by plotting and comparing to the graph in profile.xy.

Higher Resolution Image

Once again, the finer mesh in this case doesn't offer much more precision than the
coarser mesh. Save this plot as profile2.xy. Now let's take a look at the YPlus plot.

Higher Resolution Image

As we can see, there is a significant increase in the accuracy of the plot from the finer
mesh. Save this plot as yplus2.xy.

You may want to experiment with meshes of other granularities and compare their plots
with the plots saved from the 100x30 and 100x60 meshes.

In Problem 1, we will be looking at the effect of coarse meshes with uniform granularity.

You might also like