LAB Pipe Flow
LAB Pipe Flow
Since we selected Fluid Flow (FLUENT), each cell of the system corresponds to a step
in the process of performing CFD analysis using FLUENT. Rename the project to
Laminar Pipe. We will work through each step from top down to obtain the solution
to our problem.
2
Launch Design Modeler Under the Details View table (located in the lower left corner), set H1=8m and
In the Project Schematic, double click on Geometry to start preparing the geometry. V2=0.1m, as shown in the image below.
At this point, a new window, ANSYS Design Modeler will be opened. You will be asked
to select desired length unit. Use the default meter unit and click OK.
Creating a Sketch
Start by creating a sketch on the XYPlane. Under Tree Outline, select XYPlane, then
click on Sketching right before Details View. This will bring up the Sketching
Toolboxes.
Click on the +Z axis on the bottom right corner of the Graphics window to have a
normal look of the XY Plane. In the Sketching toolboxes, select Rectangle. In the
Graphics window, create a rough Rectangle by clicking once on the origin and then
by clicking once somewhere in the positive XY plane. (Make sure that you see a letter
P at the origin before you click. The P implies that the cursor is directly over a point
of intersection.) At this point you should have something comparable to the image Surface Body Creation
below. In order to create the surface body, first (Click) Concept> Surfaces From Sketches as
shown in the image below.
Dimensions This will create a new surface SurfaceSK1. Under Details View, select Sketch1 as Base
At this point the rectangle will be properly dimensioned. Objects and then select the thickness to 0.1m. Finally click Generate to generate the
Under Sketching Toolboxes, select Dimensions tab, use the default dimensioning surface.
tools. Dimension the geometry as shown in the following image. First use horizontal At this point, you can close the Design Modeler and go back to Workbench Project
line (H1) then vertical (V2). Page. Save your work thus far in the Workbench Project Page.
Step 3: Mesh
In this section the geometry will be meshed with 500 elements. That is, the pipe will
be divided into 100 elements in the axial direction and 5 elements in the radial
direction.
Launch Mesher
In order to begin the meshing process, go to the Workbench Project Page, then
(Double Click) Mesh.
3
Default Mesh Mapped Face Meshing
In this section the default mesh will be generated. This can be carried out two ways. As can be seen above, the default mesh has irregular elements. We are interested in
The first way is to (Right Click) Mesh > Generate Mesh, as shown below. creating a grid style of mesh that can be mapped to a rectangular domain. This
meshing style is called Mapped Face Meshing. In order to incorporate this meshing
style (Click) Mesh Control > Mapped Face Meshing as can be seen below.
The second way in which the default mesh can be generated is to (Click) Mesh >
Generate Mesh as can be seen below.
Now, the Mapped Face Meshing still must be applied to the pipe geometry. In order
to do so, first click on the pipe body which should then highlight green. Next, (Click)
Apply in the Details of Mapped Face Meshing table, as shown below.
Either method should give you the same results. The default mesh that you generate
should look comparable to the image below.
Note that in Workbench there is generally at least two ways to implement actions as Now, generate the mesh by (Click) Mesh > Generate Mesh. You should obtain a mesh
has been shown above. For, simplicity's sake the "menu" method of implementing comparable to the following image.
actions will be solely used for the rest of the tutorial.
4
Edge Sizing Then, set Number of Divisions to 100 as shown below.
The desired mesh has specific number of divisions along the radial and the axial
direction. In order to obtain the specified number of divisions Edge Sizing must be
used. The divisions along the axial direction will be specified first. Now, an Edge Sizing
needs to be inserted. First, (Click) Mesh Control > Sizing as shown below.
At this point, the edge sizing in the radial direction will be specified. Follow the same
procedure as for the edge sizing in the axial direction, except select the left and right
side instead of the top and bottom and set the number of division to 5. Then,
generate the mesh. You should obtain the following mesh.
Now, the geometry and the number of divisions need to be specified. First (Click)
Edge Selection Filter, . Then hold down the "Control" button and then click the As it turns out, in the mesh above there are 540 elements, when there should be only
bottom and top edge of the rectangle. Both sides should highlight green. Next, hit 500. Mesh statistics can be found by clicking on Mesh in the Tree and then by
Apply under the Details of Sizing table as shown below. expanding Statistics under the Details of Mesh table. In order to get the desired 500
element mesh the Behavior needs to be changed from Soft to Hard for both Edge
Sizing's. In order to carry this out first Expand Mesh in the tree outline then click
Edge Sizing and then change Behavior to Hard under the Details of Edge Sizing table,
as shown below.
Then set the Behavior to Hard for Edge Sizing 2. Next, generate the mesh. You should
then obtain the following 500 element mesh.
5
Create Named Selections Save, Exit & Update
Here, the edges of the geometry will be given names so one can assign boundary First save the project. Next, close the Mesher window. Then, go to the Workbench
conditions in Fluent in later steps. The left side of the pipe will be called "Inlet" and
Project Page and click the Update Project button, .
the right side will be called "Outlet". The top side of the rectangle will be called
"PipeWall" and the bottom side of the rectangle will be called "CenterLine" as shown
Step 4: Setup (Physics)
in the image below.
Your current Workbench Project Page should look comparable to the following
image. Regardless of whether you downloaded the mesh and geometry files or if you
created them yourself, you should have checkmarks to the right of Geometry and
Mesh.
In order to create a named selections first (Click) Edge Selection Filter, . Then
click on the left side of the rectangle and it should highlight green. Next, right click
the left side of the rectangle and choose Create Named Selection as shown below.
Next, the mesh and geometry data need to be read into FLUENT. To read in the data
(Right Click) Setup > Refresh in the Workbench Project Page as shown in the image
below.
After you click Update, a question mark should appear to the right of the Setup cell.
This indicates that the Setup process has not yet been completed.
Launch Fluent
Double click on Setup in the Workbench Project Page which will bring up the FLUENT
Launcher. When the FLUENT Launcher appears change the options to "Double
Now, create named selections for the remaining three sides and name them Precision", and then click OK as shown below. The Double Precision option is used to
according to the diagram. select the double-precision solver. In the double-precision solver, each floating point
6
number is represented using 64 bits in contrast to the single-precision solver which Then, you should obtain the following output in the Command pane.
uses 32 bits. The extra bits increase not only the precision, but also the range of
magnitudes that can be represented. The downside of using double precision is that
it requires more memory.
The mesh that was created earlier has 500 elements (5 Radial x 100 Axial). Note that
in FLUENT elements are called cells. The output states that there are 500 cells, which
is a good sign. Next, FLUENT will be asked to check the mesh for errors. In order to
carry out the mesh checking procedure (Click) Mesh > Check as shown in the image
below.
Twiddle your thumbs a bit while the FLUENT interface starts up. This is where we'll
specify the governing equations and boundary conditions for our boundary-value
problem. On the left-hand side of the FLUENT interface, we see various items listed
under Problem Setup. We will work from top to bottom of the Problem Setup items
to setup the physics of our boundary-value problem. On the right hand side, we have
the Graphics pane and, below that, the Command pane.
You should see no errors in the Command Pane. Now that the mesh has been verified,
the mesh display options will be discussed. In order to bring up the display options
(Click) General > Mesh > Display as shown in the image below.
7
The previous step should cause the Mesh Display window to open, as shown below. Translation: The model can be translated in any direction by holding down the Left
Note that the Named Selections created in the meshing steps now appear. Mouse Button and then moving the mouse in the desired direction.
Zoom In: Hold down the Middle Mouse Button and drag a box from the Upper Left
Hand Corner to the Lower Right Hand Corner over the area you want to zoom in on.
Zoom Out: Hold down the Middle Mouse Button and drag a box anywhere from the
Lower Right Hand Corner to the Upper Left Hand Corner.
Use these operations to zoom in and interrogate the mesh.
You should have all the surfaces shown in the above snapshot. Clicking on a surface
name in the Mesh Display menu will toggle between select and unselect. Clicking
Display will show all the currently selected surface entities in the graphics pane.
Unselect all surfaces and then select each one in turn to see which part of the domain
or boundary the particular surface entity corresponds to (you will need to zoom
in/out and translate the model as you do this). For instance, if you select wall, outlet,
and centerline and then click Display you should then obtain the following output in
the graphics window.
Next, the Viscous Model parameters will be specified. In order to open the Viscous
Model Options Models > Viscous - Laminar > Edit.... By default, the Viscous Model
options are set to laminar, so no changes are needed. Click Cancel to exit the menu.
Now, make sure all 5 items under Surfaces are selected. The button next to
Now, the Energy Model parameters will be specified. In order to open the Energy
Surfaces selects all of the boundaries while the button deselects all of the Model Options Models > Energy-Off > Edit.... For incompressible flow, the energy
boundaries at once. Once, all the 5 boundaries have been selected click Display, then equation is decoupled from the continuity and momentum equations. We need to
close the Mesh Display window. The long, skinny rectangle displayed in the graphics solve the energy equation only if we are interested in determining the temperature
window corresponds to our solution domain. Some of the operations available in the distribution. We will not deal with temperature in this example. So leave the Energy
graphics window to interrogate the geometry and mesh are: Equation set to off and click Cancel to exit the menu.
8
Define Material Properties Inlet Boundary Condition
Now, the properties of the fluid that is being modeled will be specified. The In order to start the process (Click) Boundary Conditions > inlet > Edit... as shown in
properties of the fluid were specified in the Problem Specification section. In order the following image.
to create a new fluid (Click) Materials > Fluid > Create/Edit... as shown in the image
below.
In the Create/Edit Materials menu set the Density to 1kg/m3 (constant) and set the
Viscosity to 2e-3 kg/m-s (constant) as shown in the image below.
Note that the Boundary Condition Type should have been automatically set to
velocity-inlet. Now, the velocity at the inlet will be specified. In the Velocity Inlet
menu set the Velocity Specification Method to Components, and set the Axial-
Velocity (m/s) to 1 m/s, as shown below.
As can be seen in the image above the Type should have been automatically set to
pressure-outlet. If the Type is not set to pressure-outlet, then set it to pressure-outlet. When the dialog boxes appear click Yes to change the boundary type. Then click OK
Now, no further changes are needed for the outlet boundary condition. to accept "centerline" as the zone name.
10
As can be seen in the image above the Type should have been automatically set to Set Initial Guess
wall. If the Type is not set to wall, then set it to wall. Now, no further changes are Here, the flow field will be initialized to the values at the inlet. In order to carry out
needed for the pipe_wall boundary condition. the initialization click on Solution Initialization then click on Compute from and select
inlet as shown below.
Save
In order to save your work (Click) File> Save Project as shown in the image below.
Step 5: Solution
Second Order Scheme
A second-order discretization scheme will be used to approximate the solution. In
order to implement the second order scheme click on Solution Methods then click
on Momentum and select Second Order Upwind as shown in the image below.
11
Set Convergence Criteria Execute Calculation
FLUENT reports a residual for each governing equation being solved. The residual is Prior, to running the calculation the maximum number of iterations must be set. To
a measure of how well the current solution satisfies the discrete form of each specify the maximum number of iterations click on Run Calculation then set the
governing equation. We'll iterate the solution until the residual for each equation Number of Iterations to 100, as shown in the image below.
falls below 1e-6. In order to specify the residual criteria (Click) Monitors > Residuals
- Print, Plot > Edit..., as shown in the image below.
As a safeguard, save the project. Now, click on Calculate two times in order to run
the calculation. The residuals for each iteration are printed out as well as plotted in
the graphics window as they are calculated. After running the calculation, you should
obtain the following residual plot.
Next, change the residual under Convergence Criterion for continuity, x-velocity, and
y-velocity, all to 1e-6, as can be seen below.
The residuals fall below the specified convergence criterion of 1e-6 in about 48
iterations, as shown below. Actual number of convergence steps may vary slightly.
The velocity vectors provide a picture of how the flow develops downstream of the
inlet. As the boundary layer grows, the flow near the wall is retarded by viscous
friction. Note the sloping arrows in the near wall region close to the inlet. This
indicates that the slowing of the flow in the near-wall region results in an injection of
fluid into the region away from the wall to satisfy mass conservation. Thus, the
velocity outside the boundary layer increases. By default, one vector is drawn at the
center of each cell. This can be seen by turning on the grid in the vector plot: Select
Draw Mesh in the Vectors menu and then click Display in the Mesh Display as well
as the Vectors menus. Velocity vectors are the default, but you can also plot other
Under Mirror Planes, only the axis (or centerline) surface is listed since that is the vector quantities. See section 27.1.3 of the user manual for more details about the
only symmetry boundary in the present case. Select axis (or centerline) and click vector plot functionality.
Apply, as shown below.
Centerline Velocity
Here, we'll plot the variation of the axial velocity along the centerline. In order to
start the process (Click) Results > Plots > XY Plot... > Set Up..as shown below.
13
In the Solution XY Plot menu make sure that Position on X Axis is selected , and X is In the graph that comes up, we can see that the velocity reaches a constant value
set to 1 and Y is set to 0. This tells FLUENT to plot the x-coordinate value on the beyond a certain distance from the inlet. This is the fully-developed flow region. At
abscissa of the graph. Next, select Velocity... for the first box underneath Y Axis this point the graph will be modified such that the fully developed regions results are
Function and select Axial Velocity for the second box. Please note that X Axis truncated. That is, the range of the axes will be reconfigured. In the Solution XY Plot
Function and Y Axis Function describe the x and y axes of the graph, which should menu, click on Axes..., as shown below.
not be confused with the x and y directions of the pipe. Finally, select centerline
under Surfaces since we are plotting the axial velocity along the centerline. This
finishes setting up the plotting parameters. Your Solution XY Plot should look exactly
the same as the following image.
Then, deselect Auto Range, which is located under Options. The boxes under Range
should now be accessible. Next, select X, which is located under Axis. Enter 1 for
Minimum and 3 for Maximum under Range. At this point the grid lines will be turned
on in order to help estimate where the flow becomes fully developed. Check the
boxes next to Major Rules and Minor Rules under Options. At this point your Axes -
Solution XY Plot menu should look exactly the same as the image below.
Now, click Plot. The plot of the axial velocity as a function of distance along the
centerline now appears.
14
Lastly, click Apply. Now, that the X axis has been formatted, we will move on to Saving the Plot
formatting the Y axis. Select Y under Axis and once again deselect Auto Range under In this section, we will save the data from the plot and a picture of the plot. The data
Options. Then, enter 1.8 for Minimum and 2.0 for Maximum under Range. Also from the plot will be saved first. In order to save the plot data open the Solution XY
select Major Rules and Minor Rules to turn on the grid lines in the direction. At this Plot menu and then select Write to File, which is located under Options. The Plot
point your Axes - Solution XY Plot menu should look exactly the same as the image button should have changed to Write.... Click on Write..., and then enter vel.xy as
below. the XY File Name. Next, click OK. Check that this file has been created in your FLUENT
working directory. Lastly, close the Solution XY Plot menu.
At this point, we'll save a picture of the plot. First click on File then click Save Picture,
as shown below.
We have now finished specifying the range for each axis, so click Apply and then Close.
At this point, the graph can be replotted. Go to the Solution XY Plot menu and click
Plot to plot the graph again with the new axes extents.
Click on S in the links on top and scroll down to skin friction coefficient. Click on the
first link (normally, you would have to go through each of the links until you find what
you are looking for). There you can see the following excerpt on the skin friction
coefficient as well as the equation for calculating it.
Click on the link for Reference Values panel, which tells us how to set the reference
values used in calculating the skin coefficient. In order to set the reference values, Now, reopen the Solution XY Plot menu. Uncheck the Write to File check box under
click on Reference Values, as shown below. Options, since we want to plot to the window. The Options and Plot Direction can be
left as is since we are still plotting against the x distance along the pipe. Under the Y
Axis Function, pick Wall Fluxes..., and then Skin Friction Coefficient in the box under
that. Under Surfaces, only select pipe_wall. At this point, your Solution XY Plot menu
should look exactly like the following image.
Then, set Compute From to inlet, to tell FLUENT to calculate the reference values
from the values at inlet. Check that density is 1 kg/m3 and velocity is 1 m/s.
(Alternately, you could have just typed in the appropriate values). Your Reference
Values should look the same as the following screen snapshot.
16
Now, the ranges of each axis will be specified. Click on Axes... within the Solution XY
Plot menu and re-select Auto-Range for the Y axis. Click Apply. Set the range of the
X axis from 1to 8 by selecting X under Axis, entering 1 under Minimum, and 8 under
Maximum in the box (remember to deselect Range Auto-Range first if it is checked).
Click Apply, then click Close. Lastly, click Plot in the Solution XY Plot menu. You should
obtain the following plot.
Next, click on Axes in the Solution XY Plot menu. Then, change both the x and y axes
to Auto-Range. (Don't forget to click apply before selecting a different axis). Close
We can see that the fully developed region is reached at around x=3.0m and the skin the Axes - Solution XY Plot menu.
friction coefficient in this region is around 1.54.
In order to save the data from this plot, first reopen the Solution XY Plot menu. Then, It is of interest to compare the velocity profile with the theoretical parabolic profile.
select Write to File under Options and click Write.... Enter cf.xy for XY File and click In order to plot the theoretical results, first click here to download the necessary file.
OK. Save the file to your working directory. Next, go to the Solution XY Plot menu and
click Load File... and select the file that you just downloaded, profile_fdev.xy. Lastly,
Velocity Profile click Plot in the Solution XY Plot menu. You should then obtain the following figure.
In this section we will plot the velocity at the outlet as a function of the distance from
the center of the pipe. In order to start the process (Click) Results > Plots > XY Plot...
> Set Up.
For this graph, the y axis of the graph will have to be set to the y axis of the pipe
(radial direction). To plot the position variable on the y axis of the graph, uncheck
Position on X Axis under Options and choose Position on Y Axis instead. To make the
position variable the radial distance from the centerline, under Plot Direction, change
X to 0 and Y to 1. To plot the axial velocity on the x axis of the graph, select Velocity...
for the first box underneath X Axis Function, and select Axial Velocity for the second
box. Next, select outlet, which is located under Surfaces. Then, uncheck the Write to
File check box under Options, so the graph will plot. Your Solution XY Plot, should
look exactly like the image below.
Notice, how results compare relatively well with the theoretical parabolic profile. In
order to save the data from this plot, first reopen the Solution XY Plot menu. Then,
select Write to File under Options and click Write.... Enter profile.xy for XY File and
click OK.
To see how the velocity profile changes in the developing region, we will add profiles
at x=0.6m (x/D=3) and x=0.12m (x/D=6) to the previous plot. In order to create the
17
profiles, we must first create vertical lines using the Line/Rake tool. First, (Click) we can plot the velocity profiles at x=0.6m (x/D=3) and x=0.12m (x/D=6) along with
Surface < Line/Rake as shown in the following image. the outlet profile. First, open the Solution XY Plot menu. Under Surfaces, in addition
to outlet, select line1 and line2. Make sure Node Values is selected under Options.
Now, your Solution XY Plot menu should look exactly like the following image.
We'll create a straight line from (x0,y0)=(0.6,0) to (x1,y1)=(0.6,0.1). Select Line Tool
under Options. Enter x0=0.6, y0=0, x1=0.6, y1=0.1. Enter line1 under New Surface
Name and click Create.
Lastly, click Plot and you should obtain the following output. Your symbols might be
different from the ones below. You can change the symbols and line styles under the
Curves... button. Click on Help in the Curves menu if you have problems figuring out
how to change these settings.
To see the line that you just created,(Click) Display > Mesh. Note that line1 appears
in the list of surfaces. Select all surfaces except default-interior and click Display. This
displays all surfaces but not the mesh cells. Zoom into the region near the inlet to see
the line created at x=0.6m. (Click here to review the zoom functionality discussion in
step 4.) The white vertical line appearing to the right is line1, as shown in the image
below.
The profile three diameters downstream is fairly close to the fully-developed profile
at the outlet. If you redo this plot using the fine grid results in the next step, you'll
see that this is not actually the case. The coarse grid used here doesn't capture the
boundary layer development properly and under predicts the development length.
In FLUENT, you can choose to display the computed cell-center values or values that
Similarly, create a vertical line called line2at x=1.2; (x0,y0)=(1.2,0) to (x1,y1)=(1.2,0.1). have been interpolated to the nodes. By default, the Node Values option is turned
Display it in the graphics window to check that it has been created correctly. Now,
18
on, and the interpolated values are displayed. Node-averaged data curves may be
somewhat smoother than curves for cell values.
Under Details of "Edge Sizing", enter 10 for Number of Divisions, as shown below.
The mesh should now have 1000 elements (10 x 100). A quick glance of the mesh
Rename the duplicate project to Laminar Pipe Flow (mesh 2). You should have the statistics reveals that there is indeed 1000 elements.
following two projects in your Workbench Project Page.
Next, double click on the Mesh cell of the Laminar Pipe Flow (mesh 2) project. A new
ANSYS Mesher window will open. Under Outline, expand Mesh and click on Edge
Sizing 2, as shown below.
19
Compute the Solution Since we would like to see how the results compare to the courser mesh and the
Close the ANSYS Mesher to go back to the Workbench Project Page. Under Laminar theoretical solution, we will load the profile.xy file, which was created in the previous
Pipe Flow (mesh 2), right click on Fluid Flow (FLUENT) and click on Update, as shown step. In order to do so, click Load File... in the Solution XY Plot menu, then select the
below. profile.xy file. Click OK, then click Plot in the Solution XY Plot menu. You should then
obtain the following plot.
Now, wait a few minutes for FLUENT to obtain the solution for the refined mesh.
After FLUENT obtains the solution, save your project.
Velocity Profile
In order to launch FLUENT double click on the Solution of the "Laminar Pipe Flow
(mesh 2)" project in the Workbench Project Page. After, FLUENT launches (Click) In the plot above the green dots correspond to the theoretical solution, the red dots
Plots > XY Plot > SetUp.... correspond to the rough mesh ( 5 x 100 ), and the white dots correspond to the
For this graph, the y axis of the graph will have to be set to the y axis of the pipe refined mesh ( 10 x 100 ). Note how the refined mesh results resemble the theory
(radial direction). To plot the position variable on the y axis of the graph, uncheck significantly more than the rough mesh.
Position on X Axis under Options and choose Position on Y Axis instead. To make the
position variable the radial distance from the centerline, under Plot Direction, change Further Verification
X to 0 and Y to 1. To plot the axial velocity on the x axis of the graph, select Velocity... The plot below shows the results of a further refined mesh ( 20 radial x 100 axial )
for the first box underneath X Axis Function, and select Axial Velocity for the second and the theoretical results.
box. Next, select outlet, which is located under Surfaces. Then, uncheck the Write to
File check box under Options, so the graph will plot. Now, your Solution XY Plot menu
should look exactly like the following image.
Notice that for the further refined mesh, the results are almost indistinguishable from
theory.
20
Problem Specification get the 100x30 mesh. This will introduce you to the art of modifying meshes in the
ANSYS Workbench Mechanical Mesher.
Step 2: Geometry
For this tutorial we are going to be using the same geometry that we created in the
previous tutorial. Once you have completed the Laminar Pipe Flow tutorial, you can
open the saved project and use it as a template for this tutorial.
Step 3: Mesh
Let's revisit the pipe flow example considered in the previous exercise. As before, the You should have completed the Laminar Pipe Flow tutorial before continuing with
inlet velocity is 1 m/s, the fluid exhausts into the ambient atmosphere and density is this one. The starting point for this tutorial is the ending point of the one before it. If
1 kg/m3. For µ = 2 x 10-5 kg/m-s, the Reynolds no. based on the pipe diameter and you bring up the project we have already completed, you can follow the next steps.
average velocity at the inlet is 10,000. At this Reynolds number, the flow is usually Right click on Mesh. Then click on Duplicate, which will duplicate the mesh from the
completely turbulent. previous tutorial. 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
A turbulent flow exhibits small-scale fluctuations in time. It is usually not possible to (instead of 100 by 5). We are also going to need to bias it. This is because we want
resolve these fluctuations in a CFD calculation. So the flow variables such as velocity, smaller divisions the closer you get to the wall. First, right click on Edge Sizing 2 in
pressure, etc. are time-averaged. Unfortunately, the time-averaged governing the Project tree on the left, and click Delete to remove the existing edge sizing on the
equations are not closed i.e. they contain fluctuating quantities which need to be inlet and outlet.
modeled using a turbulence model. No turbulence model is currently available that Next, we'll apply an edge sizing with bias to the inlet, the left end of the pipe. Click
is valid for all types of flows and so it is necessary to choose and fine-tune a model Mesh Control > Sizing. Using the edge selection tool, highlight the inlet (left end) of
for particular classes of flows. In this exercise, you'll be turned loose on variants of the pipe and click Apply next to Geometry. As in the Laminar Pipe Flow tutorial,
the k-ε model. But in the real world, tread with great caution: you should evaluate change Type to Number of Divisions, and enter 30. Change Behavior to Hard.
the validity of your calculations using a turbulence model very carefully (which, ahem, Now, let's apply a bias to the edge sizing. Under Bias Type, select the second option,
means that there is no getting away from studying fluid dynamics concepts and - – — ----. Enter a Bias Factor of 10. Your Details of "Edge Sizing 2" should now appear
numerical methods very carefully). FLUENT should not be used as a black box. The k- like the image below.
ε models consist of two differential equations: one for the turbulent kinetic energy k
and one for the 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.
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
Now we would like to apply an edge sizing to the outlet, the right end of the pipe.
and 30 divisions in the radial direction). We could create this mesh from scratch, as
Once again, we'll use 30 divisions, with a bias factor of 10 and with the smaller
in the Laminar Pipe Flow tutorial, but instead, we will modify the previous 100x5 to
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,
21
the procedure is the same as for the inlet. When complete, your Details of "Edge feature and make sure that the boundary labels correspond to the correct geometric
Sizing 3" should look like this: entities.
Next, update the Mesh and close the meshing window to return to the main project Problem Setup > Models > Viscous...
view. Recall that we created the following boundary types for the 100x5 mesh in the Choose k-epsilon (2eqn). Notice that the window expands and additional options are
Laminar Pipe Flow tutorial: displayed on choosing the k-epsilon turbulence model. Under Near-Wall Treatment,
Edge Position Name Type pick Enhanced Wall Treatment so that we get a more accurate result.
Left inlet VELOCITY_INLET
Right outlet PRESSURE_OUTLET
Top wall WALL
Bottom centerline AXIS
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 Click OK.
boundary). Click Display again when you have selected your boundaries. Use this Problem Setup > Materials
Double click on air and change Density to 1.0 and Viscosity to 2e-5. These are the
values in the Problem Specification. We'll take both as constant.
22
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.
Click Change/Create and close the window.
Step 5: Solution
Define Boundary Conditions
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
Problem Setup > Boundary conditions > Operating Conditions...
of the k-epsilon turbulence model.
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
Solution > Solution Methods
gauge pressure. We'll use the default value of 1 atm (101,325 Pa) as the Operating
Change the discretization for “Momentum“, “Turbulence Kinetic Energy“, and
Pressure. Click Cancel to leave the default in place. We'll now set the value of the
“Turbulence Dissipation Rate“ equations to Second Order Upwind (if you do not see
velocity at the inlet and pressure at the outlet.
all of the equations scroll down to see them).
Problem Setup > Boundary conditions
The four types of boundaries we defined are specified in a window as zones. Recall
that we don't need to set any parameters for the centerline and wall zones. Verify
this by selecting each of these two zones and looking at their types in the drop down
menu below the Zones. Choose inlet and click on Edit.... Change the Velocity
Specification Method to Magnitude, Normal to Boundary. Enter 1 for 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.2 for Hydraulic
Diameter. Click OK to set the velocity.
23
The order of discretization that we just set refers to the convective terms in the In the Solution Initialization menu that comes up, choose inlet under Compute From.
equations; the discretization of the viscous terms is always second-order accurate The Axial Velocity for all cells will be set to 1 m/s, the Radial Velocity to 0 m/s and
in FLUENT. Second-order discretization generally yields better accuracy while first- the Gauge Pressure to 0 Pa. The Turbulence Kinetic Energy and Dissipation Rate
order discretization yields more robust convergence. If the second-order scheme (scroll down to see it) values are set from the prescribed values for the Turbulence
doesn't converge, you can try starting the iterations with the first-order scheme and Intensity and Hydraulic Diameter at the inlet
switching to the second-order scheme after some iteration.
Click Initialize. This completes the problem specification. Save your work:
Main Menu > File > Write > Case...
Type in {{pipe100x30.cas}} as the name of the Case File. Click OK. Check that the file
has been created in your working directory.
Iterate Until Convergence
Solve for 100 iterations first.
Click OK.
Solution > Run Calculation
Set Initial Guess In the Iterate menu that comes up, change the Number of Iterations to 100. Click
We'll use an initial guess that is constant over the entire flow domain and equal to Calculate.
the values at the inlet: You'll find that not all residuals have fallen below 1e-6 in 100 iterations. Solve for
Solution > Solution Initialization 200 more iterations. The solution converges in a total of about 210 iterations.
24
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/m3, 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.
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.
Save the solution to a data file:
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 Click Plot.
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+ > 30 or < 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+.
25
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.
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 We can see that the fully developed region starts around x=5m with the centerline
Solution XY Plot window. Select the solid line option under Pattern as shown below. velocity becoming constant at a value of 1.195 m/s. This is quite a bit lower than the
Change Weight to 2. Select the blank option under Symbol. Click Apply and Close. 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.
Navigate to your working directory elect the pipe100x60.msh file you have created.
Click OK. Display the grid. Check its size.
We can see that the fully-developed value is 0.0085. Compare this with what you'd
expect from the Moody chart. Finer Mesh Analysis
Save the data for this plot as cf.xy. 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,
Velocity Profile for each of the plots, overlay the corresponding result for the coarser mesh so that
We'll plot the axial velocity at the outlet as a function of the distance from the center we may compare them. To do this, after plotting the finer mesh result, in the Solution
of the pipe. Change the plot settings so that the radial distance from the axis is XY Plot Window, click on Load File.... Navigate to your working folder, click on the
plotted as the ordinate: In the Solution XY Plot window, uncheck Position on X Axis appropriate filename for the previous result, e.g. vel.xy for centerline velocity, and
under Options and choose Position on Y Axis instead. Under Plot Direction, change click OK. Then click Plot. You'll see both results plotted in the same the graphics
X to 0 and Y to 1. For the X Axis Function i.e. the abscissa, pick Velocity... and Axial window.
Velocity under that. Since we want to plot this at the outlet boundary, pick only
outlet under Surfaces. Uncheck Write to File and click Plot.
27
In the centerline velocity plot above, the white line represents the centerline velocity Once again, the finer mesh in this case doesn't offer much more precision than the
of the finer mesh, while the red line represents the velocity of the coarser mesh from coarser mesh. Save this plot as profile2.xy. Now let's take a look at the YPlus plot.
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:
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.
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. LAB REPORT DUE NOVEMBER 6
http://www.youtube.com/watch?v=GXciItTKePk
28