Sei sulla pagina 1di 21

Fluid Dynamics

CAx Tutorial: Channel Flow


Basic Tutorial # 4

Deryl O. Snyder
C. Greg Jensen
Brigham Young University
Provo, UT 84602

Special thanks to:

PACE, Fluent, UGS Solutions, Altair Engineering;

and to the following students who assisted in the creation of the Fluid Dynamics tutorials:

Leslie Tanner, Cole Yarrington, Curtis Rands, Curtis Memory, and Stephen McQuay.
Channel Flow
2D Curved Flow

In this tutorial, GAMBIT will be used to create and mesh the flow field geometry for
the problem. Once this is complete, FLUENT will be used to solve for the pressure
field everywhere in the domain and plot the pressure distribution across the pipe.

This tutorial will provide experience in solving 2D flows and creating plots of the
results.

The methods expressed in these tutorials represent just one approach to modeling, constraining
and solving 2D problems. Our goal is the education of students in the use of CAx tools for
modeling, constraining and solving fluids application problems. Other techniques and methods
will be used and introduced in subsequent tutorials.

Water flows around the vertical two-dimensional


bend with circular streamlines and constant velocity
as shown below. If the pressure is 40 kPa at point (1),
determine the pressure at points (2) and (3). Assume
that the velocity profile is uniform as indicated.

3
Channel Flow
Creating Geometry

Begin the problem by creating geometry in


Gambit.

Start Gambit by either typing gambit at the


command prompt (Unix or Windows) or
clicking on the Gambit icon (Windows).

The Gambit standard display should


appear.

Meshes are generated in Gambit by follow-


ing left to right the menu icons located in
the top right of the display window.

The 2-D geometry will consist of two 90°


arcs with lines connecting the ends. Create
a node which will be used to define the
center of curvature for the two arcs.

Geometry > Vertex > Create Vertex

Enter the Vertex at (0,6,0) as shown:

Select Apply and Close.

4
Channel Flow
Creating Geometry
Geometry > Edge > Create Real Circular
Arc

Note: Icons with a red arrow have a pull down menu.


The arc button is located in the edges pull down menu.
To activate the pull down menu select the icon with
MB3. Buttons are then selected with MB1.

Select the far right radio button

Enter 6 for the radius, 225 and 315 for the


angles.

Select the center button.

Select the vertex by holding the shift but-


ton and clicking MB1 over the vertex.

Repeat for another arc of radius 4.

Now draw two lines to connect the arcs.

Geometry > Edge > Create Edge

Create lines to connect the arcs by shift


selecting both end points and selecting
Apply. Repeat for the other side of the
channel.

5
Channel Flow
Creating Geometry

Next, create a face from the edges just cre-


ated.

Geometry > Face > Wireframe

Shift select all four edges and click Apply.

The edges should now be colored blue to


indicate that the face has been created.

If problems are encountered in creating the


geometry, the geometry can be loaded from the
file “Bend_Geometry.dbs”.

6
Channel Flow
Meshing Geometry

The geometry has now been created. The


next step is to generate the mesh.

First the edges must be meshed.

Mesh > Edge > Mesh Edges

Shift Select the left straight edge and the


right straight edge.

Change the pull-down menu to Interval


count and enter 30.

Click Apply.

Repeat this procedure for the upper and


lower walls.

The screen should now look like this:

Next mesh the face.

Mesh > Face > Mesh faces

Shift Select any edge of the geometry to


select the face. Make sure the Element
menu is set to Quad, Type is set to Map
and then select Apply.

The screen should look like this:

If problems are encountered in meshing geome-


try, the meshed geometry can be loaded from
the file “Bend_Meshed.dbs”.

7
Channel Flow
Boundary Conditions

Now define the boundary conditions for


the problem.

Since Fluent version 6 is going to be used,


select

Solver > Fluent5/6

from the pull-down menu across the top of


the window.

Operation > Zones > Specify Boundary


Types

Change the pull-down menu at the bottom


to edges. This allows for selection of indi-
vidual edges. Select the top and bottom
edges. Name them “walls” and click
Apply.

Select the left straight edge, change the


type pull-down menu to Velocity-Inlet,
name it “inlet” and click Apply.

Select the right straight edge, change the


type pull-down menu to Outflow, name it
“outlet” and click Apply.

Now the geometry is ready to be exported.


From the file pull-down menu, select

File>export>mesh

Select a location for the *.msh file and


Accept.

make sure to select the "export 2-D (X-Y)


Mesh" radio button.

Save and exit from Gambit.

8
Channel Flow
Starting in Fluent
If problems are encountered in specifying
boundary conditions, the completed mesh with
boundary conditions specified can be loaded
from the file “Bend_Complete.dbs”.

Open Fluent from the Desktop or Start


menu.

Select 2D

Select Run

The following window should appear.

This is the FLUENT user interface. Most


tasks are completed using the menus across
the top. The menus are designed to guide
you through the analysis in an orderly
fashion, going from top to bottom through
each menu, and left to right across the
menu bar.

Text commands can also be used in the


command window.

9
Channel Flow
Defining the Problem

Start by importing the mesh created in


Gambit.

File > Read > Case


A browse window should appear.

Locate the *.msh file and select OK.

FLUENT will read the mesh you created.


If there are problems reading the mesh,
return to the beginning of the tutorial and
make sure you follow the steps carefully. If
there are no problems the command win-
dow should state “done”.

Now check the grid for errors.

Grid > Check

Any errors will be listed, otherwise the


command window should again state
“done”.

10
Channel Flow
Defining the Problem

Because the problem statement assumes a


constant velocity profile across the channel,
the flow will be modeled as inviscid.

Define > Models > Viscous…

Select the Inviscid radio button and then


OK.

Now the fluid properties must be specified.


The fluid properties are found by selecting:

Define > Materials…

Select database... to browse through the


FLUENT library of materials. Scroll down
and select water-liquid (h2o<l>).

Select Copy to copy these material properties


into the current problem. Select Close on the
Database Materials windows, followed by
Close on the Materials window.

Note: it is very important to click on the copy button. The


fluid properties will not be loaded if the copy button is not
selected.

11
Channel Flow
Defining the Problem

In order to set gravitational conditions as


specified in the problem, select:

Define > Operating Conditions…

Click on the Gravity radio button.

Set the Operating pressure to be 40000 Pa


and Gravity to be -9.81 m/s2 in the y direc-
tion.

Click Ok.

Now the velocity condition at the inlet and


fluid type must be specified.

Define > Boundary Conditions…

Select fluid under zones menu.

Select fluid from the type menu.

Click on set...

From the Material Name pull down menu


select the fluid that was previously added
to the list, namely water-liquid (h2o<l>).

Select Ok.

12
Channel Flow
Defining the Problem

Now to set the inlet conditions, select the


inlet on the left, then select Set...

Set the velocity magnitude to 10m/s.

Select Ok and close the Boundary


Conditions window.

Specify which discretization functions will


be used to calculate the solution.

Solve > Controls > Solution…

In the Solution Control dialogue box, set


the under-relaxation coefficients to

Pressure = 0.9
Density =1
Body Forces =1
Momentum = 0.7

Also, change the Discretization functions


to:

PRESTO!
SIMPLEC
2nd order upwind

Click Ok.

13
Channel Flow
Defining the Problem

Next, the solution must be initialized. To


do this:

Solve > Initialize > Initialize…

From the Compute From pull-down menu,


select the name given to the inlet wall.

Select Init then close.

Note: Once again, if initialize is not selected before close


is, the case will remain un-initialized.

By default, while trying to converge to a


solution, FLUENT will stop iterating at a
prescribed convergence threshold. Since the
residuals will be plotted and analyzed
graphically, it is not necessary to have FLU-
ENT do this. To change this select:

Solve > Monitors > Residual…

Place a check mark next to the Plot option


using MB1.

Make a new window by incrementing


Window from 0 to 1.

Deselect all of the check convergence


boxes.

Select Ok.

14
Channel Flow
Defining the Problem

In order to view the pressure field includ-


ing the hydrostatic pressure, create a
"Custom Field Function”

Define > Custom Field Function…

Create the function defined as follows:

absolute-pressure - density * 9.81 * y

Select absolute-pressure from the pull-


down menu as shown:

Click Select.

Select the subtract sign.

Select density from the pull-down menu


and click select

Select the multiplication (X) sign

Enter 9.81 on the calculator pad

Select the multiplication sign

Select the y-coordinate as follows:

First Pull-down menu: Grid

Second Pull-down menu: Y-Coordinate

Rename the function “Press” in the new


function name box.

Click Define and Close.

15
Channel Flow
Defining the Problem
In order to view pressure at discrete
points, the points of interest must be creat-
ed.

Surface > Point...

Create three points by entering the coordi-


nate values and giving the point a name. If
the bottom point surface creation fails, use
a value slightly above zero (y=.0001), as
shown.

Create two points located at the middle


(y=1) and top of the channel (y=2), respec-
tively.
Now set up monitors for these points
under:

Solve > Monitors > Surface...

Set up three separate monitors (one for


each point).

Rename the monitors.

Check the Print box for all three monitors.


Choose Iteration from the Every pull-
down menu.

Select Define for the first monitor. Choose


the point to be monitored from the
Surfaces scroll menu.

Change Report type to Sum.

Verify that the correct Custom Field


Function chosen from the Report of menu.
Click Ok.

Repeat for the remaining two points. Now,


while iterating, there will be a column of
pressure values displayed in the prompt
window for each point.

16
Channel Flow
Solving the Problem

The problem is now ready to be solved.


Select:

Solve > Iterate…

Set the number of iterations to 100 and


click Iterate.

When iterations have completed close the


iterate window.

Note: It is preferable to have a view of the residuals


handy so that they can be visually monitored., as shown.

17
Channel Flow
Analyzing the Results

Notice that the residuals have dropped by 6


to 7 orders of magnitude and have leveled
out. This means that the solution has con-
verged.

To visually inspect the solutions, select

Display > Contours

From the pull-down menus select Pressure


and select Display.

The Pressure Distribution should look like


this:

18
Channel Flow
Analyzing the Results

Now, since the pressure along the z-axis is


desired, create a line along which to plot
pressure vs. position by selecting:

Surface > Line/Rake…

Enter the values as follows to define a line:

x0 = 0
y0 = 0
x1 = 0
y1 = 2

Name the line “centerline”. Click create


then close.

Display the line in the display window by


highlighting “centerline” in the Grid
Display window, and clicking display.

It should appear as shown:

19
Channel Flow
Analyzing the Results

Now plot the user-defined function by


selecting:

Plot > XY Plot…

From the pull down menu, select:

Custom Field Functions...

Select the line that was created:

Change the plot direction as shown:

Select Plot.

The plot should look like this:

If problems are encountered in setting up this


problem in fluent, the solved problem can be
read in as a “Case and Data” from the file
“Bend.cas”.

20
Channel Flow
Analytical Solution
The analytical solution for the pressure
along the vertical line from (1) to (3) is
derived from

dy ∂p ñV 2
−ã − =
dn ∂n R

Where γ is the specific weight of the fluid


and ρ is the density. Substituting the geom-
etry conditions for this problem and inte-
grating yields

⎛ 6 ⎞
P = P1 − γy − ρV 2 ln⎜⎜ ⎟⎟
⎝6− y⎠
At point (2), y=1m, and P2 = 12.0kPa.
At point (3), y=2m, and P3 = -20.1kPa.
The values predicted by Fluent are:

P2 = 13507kPa
P3 = -18386kPa

which are in both in error by 13% and 9%


respectively.

The plot below shows a comparison of the


analytical and CFD results.

Fluent
40.0 Analytical

20.0
P (kpa)

0.0

-20.0

0.0 0.5 1.0 1.5 2.0


y (m)

21

Potrebbero piacerti anche