Pipe Flow Tutorial 2014
Pipe Flow Tutorial 2014
ME 448/548
February 5, 2014
Gerald Recktenwald
[email protected]
Overview
1.1
Modeling Procedure
1.2
The pipe flow model is specified by defining the geometry D and L and the
inlet velocity V . The fluid is air, and STAR-CCM+ provides the density and
viscosity from its internal database of thermophysical properties. The location
of the inlet and outlet boundaries and a choice of models at those boundaries
must be specified.
The inlet boundary condition can be specified as uniform velocity or prescribed mass flow rate1 . The value of inlet velocity or inlet mass flow rate are
chosen so that the flow in the duct is laminar. We will choose a Reynolds number, ReD , and pipe diameter, and then compute the average velocity consistent
with ReD .
1A
velocity profile could also be specified at the inlet, but the procedure is a bit more
involved than the two simple boundary condition treatments discusses in this tutorial.
Let the tube have a diameter of 3 cm. The density and viscosity of air at
15 C are
= 1.23
kg
,
m3
= 1.79 105
Ns
kg
= 1.79 105
m2
ms
V D
V =
kg
1.79 105 ms
m
ReD =
500 = 0.24
kg
D
s
1.23 m3 (0.03 m)
2 Frank
3
Graphics
(initially empty)
Menus
Properties
Output
2.1
STAR-CCM+ has a complex user interface that is more similar to a CAD tool
than a typical business application. Figure 1 shows the state of the interface at
the start of a new simulation.
The STAR-CCM+ interface is divided into four primary panes3 . The upper
left pane contains the Simulation Tree, which appears as a list of icons that look
like folders in a file browser. Each of the folder icons is a node in a hierarchy of
model features and parameters. The Simulation Tree is manipulated by clicking
on nodes to reveal subnodes. One also uses a right-click to expand a pop-up
menu for a node. During model creation, additional nodes appear when features
that are selected by the user require additional parameters to be specified.
Below the Simulation Tree, in the lower left corner of the user interface,
is the Properties Pane. When you select a node in the Simulation Tree, parameter choices or numerical values associated with that node are revealed in
the Properties Pane. Thus, an important mode of setting simulation parameters is to select a node in the Simulation Tree, and then choose the value of a
corresponding parameter in the Properties Pane.
The upper right corner of the user interface is the Graphics Pane, which
is empty at the start of a simulation. In creating a model and solving for
the flow field, you will create Scenes, which appear as tabbed sub-panes of
the Graphics Pane. For example, a Geometry Scene is used to display and
3 The STAR-CCM+ user guide refers to these panes as windows. Refer to the What is the
Client Workspace? in the Using STAR-CCM+ section of the User Guide.
The geometry of simple flow models can be created with a 3D-CAD tool that
is built into STAR-CCM+. We will use the 3D-CAD tool to create a cylindrical
object, and then incorporate that object as the fluid domain for the pipe flow
simulation.
CFD simulations require specifying the geometry and boundary conditions
on a fluid volume. Thus, unlike a typical CAD tool for drawing physical parts,
the STAR-CCM+ interface is designed to ultimately create volumes occupied by
fluid, not volumes occupied by solid parts. Although we are creating a model
of flow in a pipe, we will not be drawing the pipe. Rather, we will be drawing
a cylindrical plug that corresponds to the fluid inside the pipe.
3.1
1. Right click on the plus sign (+) next to the Geometry node in the Simulation
Tree.
2. Right click on the 3D-CAD Models node and select New... from the pop-up
menu. The Simulation Tree pane is replaced by a CAD Tree pane.
3. Right-click on the XY plane icon under the
Features node, and select Create Sketch from
the pop-up menu. The CAD Tree pane is replaced by a pane with two sub-panels, each
one highlighted by a light blue box. The upper sub-panel labeled Create Sketch Entities
contains icons for primitive sketching operations. The lower sub-panel labeled Display
Options contains icons for grid spacing, snapto-grid and other options. Note that the icons
in both panels contain tool-tips that are displayed when the mouse pointer hovers above
the icon.
4. Before drawing any features, set the grid scale for the CAD tool. Click on
the icon in the lower right corner of the Display Options panel.
Note that all physical quantities are specified with dimensions. Thus, the input
to the grid spacing dialog box could be 0.005 m, 0.5 cm, or 5 mm. Only SI and
metric units are accepted. If the units are not specified, the value is assumed
to be in the m-kg-s system.
3.2
.
1. Select the Create circle from center tool.
Mouse input to the CAD Tool
Drag and rotate an object
with the left mouse button
3. Click OK in the lower left corner of the CAD panel. Dont skip this step!
The result is a new entity, Sketch 1, in the CAD tree.
4. Right-click on Sketch 1 node in the CAD tree, and select Create Extrude
from the pop-up menu. A dialog box appears as shown in the left half of
Figure 2.
5. Enter 0.45m for the Distance parameter, and click the OK button in the
bottom left corner of the CAD pane.
The preceding steps create a three-dimensional cylinder in the Graphics Pane.
You will likely need to manipulate the image with the mouse to make the cylinder visible. The default viewing position is so close to the origin that the cylinder
does not fit into the viewport of the Graphics pane. Refer to the short list of
hints in the box above and to the right. For example, to make the cylinder
visible, try zooming away by using the middle mouse button or the scroll wheel,
and rotating the image with the left mouse button.
Figure 2: Dialog box for setting the extrusion distance (left). Extruded cylinder
(right).
3.3
Select Save from the file menu, and save the .sim file to the hard drive of your
computer. Its a good idea at this point to create a directory for the simulation
results as well as a meaningful file name. As you build the model and run
different cases, you will accumulate alternate .sim files for the same physical
problem. You will also generate external graphics files to be incorporated into
reports. Therefore, a little thought at this point will help you stay organized
later.
3.4
Labeling surfaces in the 3D-CAD tool will make it easier to identify boundaries
of the Regions later in the model setup. It is possible to label the surfaces later
using tools in the simulation mode.
Label the inlet, outlet and pipe wall surfaces with the following steps. Make
sure you are in the 3D-CAD mode as described in Figure 3.
1. Rotate the model so that the inlet (or outlet) end is visible.
2. Right-click on the face, and select Rename from the pop-up menu.
3. Change the name of the surface to inlet (or outlet).
4. Repeat the preceding steps to label the outlet (or inlet) and the pipe walls.
5. Close the 3D-CAD model, and return to the Simulation Pane.
Note: The steps to label the surface geometry require that you are
in working in the 3D-CAD mode of STAR-CCM+. If you are in the
Simulation mode, you will see the Simulation Tree for the model as
in the screen shot below right. Select the 3D-CAD mode by clicking
the 3D-CAD button as shown in the screen shot below left.
Figure 3: Toggling between the 3D CAD mode and the Simulation mode.
Notice that the view of the part shows up as a Geometry Scene.
Its possible that the geometry of the model will not be visible. In that case
create a new Geometry Scene.
1. Right click on Scenes at the top level of the simulation tree and select
New Geometry Scene.
2. Expand the Geometry Scene node and select the Parts corresponding to
the CAD model you just created.
3.5
Alternatively, multiple CAD objects can be used to create separate Parts, which
can be used to create multiple Regions.
3.5.1
Procedure
Use these steps to create a geometry Part from the 3D-CAD model. Make sure
you are in the Simulation mode as described in Figure 3.
1. Expand the Bodies node.
2. Select Body 1 (or whatever you named the pipe object)
3. Right click and select New Geometry Part
You can rename the 3D CAD model (or not). I suggest Pipe_fluid or similar
name for the part. Notice that a new Part is created under the Parts node. Also
note that the names assigned in the CAD tool (Inlet, Outlet and Walls) have
been propagated to the nodes of the Parts tree.
3.6
The physical problem being modeled my be specified in three distinct and independent categories.
Regions
Mesh Continuum
Physics Continuum
A region defines the topological relationship between material in the simulation,
i.e., it defines how the geometric entities (volumes or areas and their boundaries)
in the model are connected to each other. Boundary conditions are defined
on the region and the boundary conditions are independent of the mesh, the
kind of simulation (e.g., laminar or turbulent flow) or the thermophysical fluid
properties.
Each region has a Mesh Continuum that consistes of a surface and volume
mesh. Each region also has a Physics Continuum that specifies the physical
behaviors of the material, e.g., fluid or solid, compressible or incompressible,
liquid or gas. The Physics Continuum also specifies other factors that determine
the physical behavior such as steady or transient as well as the solution methods
used.
The three categories (Region, Mesh and Physics) influence each other. For
example, wall boundaries and inlet boundaries influence the interior mesh differently. However, the three categories are sufficiently distinct that you can make
major changes in on category, e.g., changing a boundary condition from constant wall temperature to adiabatic, without influencing the other categories.
This flexibility comes at a cost of greater complexity in setting up the model.
From the Star-CCM+ Users Guide4 :
4 See
4.1
For this model there is only one region. The region is created from a part that
was created with the built-in CAD tool
CAD Model Part Region
1. Right click on the Region node and select New
2. Select the Geometric Parts for the region
a.
b.
c.
d.
Notice that the there is one boundary called Default in the list of Boundaries.
Expand the Boundaries node if you do not see the Default boundary.
4.2
There is only one Boundary called Default. We will create two new boundary
surfaces the inlet and the outlet and we will rename the remaining part of
the boundary.
4.2.1
10
Figure 4: Assigning the inlet surface patch to the inlet boundary of the fluid region
4. Click on the [...] button in the Part Surfaces item in the Properties Pane.
5. Expand the nodes and click on the inlet See Figure 4
6. Click OK
7. Set the boundary type to inlet with a prescribed velocity See Figure 6
a. Select the Type characteristic in the inlet property pane
b. Select Velocity Inlet from the pop-up menu
c. Expand the Physics Values node and select Constant
d. Set the Value to 0.24 m/s
4.2.2
Repeat the steps used to create the inlet boundary. Instruction steps are abbreviated.
1. Create a new boundary and rename it outlet. New.
2. Assign the outlet part to the outlet boundary using the Part Surfaces item
in the Properties Pane.
3. Set the Type to Pressure outlet.
4.2.3
The default condition is that all surfaces are solid, adiabatic walls. Therefore,
no additional steps need to be taken. However, it is good practice to assign a
meaningful name to each boundary.
4.3
11
12
13
In this tutorial we will first use the polyhedral mesher with prism layers, which is
the mesh type commonly used for complex geometries. Although the polyhedral
mesher is easy to use, for this problem it creates a mesh that is topologically
more complex than necessary for the simple pie flow. In follow-up exercises, we
will explore different meshing models. Our immediate goal is to walk through
the basic CFD analysis procedure from start to finish, not to use the optimal
mesh.
Its a good idea to define the regions before defining the mesh because the
type of boundary (not the boundary values) influences the allowable types of
mesh adjacent to the boundary.
5.1
5.2
14
The Physics Continua defines the physical behavior of the material in the region.
It also specifies which type of global solution algorithm is used to solve the flow
field. Refer to Modeling Physics section of the User Guide.
1. Right click on the Continua node and choose NewPhysics Continuum.
2. Right click on the newly created Physics 1 node and choose Select models. . .
3. In the Model Selection dialog box, make the following choices
Three Dimensional
Steady
Gas
Segregated flow
Constant Density
Laminar
4. Click Close
7.1
7.2
Its possible to begin the solution immediately, but it is often helpful to have
a way to visualize the solution as it is happening. Well do that by creating a
display of the fluid pressure.
7.3
7.4
15
7.5
7.6
Click the
8
8.1
16
8.2
Figure 8: Maximum pressure value in the domain during iterations toward convergence
8.3
17
8.4
18
By default, scalars and vectors are only viewable on the surfaces of the fluid
Regions. To display the velocity vectors inside the domain, we first need to
create a surface on which the vectors are displayed. The simplest surface is a
plane aligned with one of the coordinate axes.
1. Click on the Derived Parts node and Select NewPlane Section.
2. In the New Section dialog box, leave defaults for Plane Parameters (or
adjust as necessary to put the plane through the center)
3. ScenesNew SceneGeometry
With a new (derived) part ready to be selected, create the velocity field plot as
a Vector Displayer
1. Right click Scenes node and select NewVector Displayer
2. Click create
8.4.1
8.5
19
Plots to add
8.6
20
9.1
10
11
Engineering Analysis
11.1
To do
12
HOMEWORK
21
2. How does the velocity profile at the exit compare to the model of fully
developed laminar flow (parabolic profile)?
3. Pressure drop becomes linear almost immediately after the entrance (?)
Questions for further model development
1. How might mesh be refined to improve the result?
2. Does the domain need to be lengthened?
12
Homework