Fluid Dynamics - Educating Global Leadersmaynesrd/classes/me412/Inviscid Flow Past Cylinder.pdfand...

17
Fluid Dynamics CAx Tutorial: Pressure Along a Streamline Basic Tutorial #3 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.

Transcript of Fluid Dynamics - Educating Global Leadersmaynesrd/classes/me412/Inviscid Flow Past Cylinder.pdfand...

Fluid Dynamics

CAx Tutorial: Pressure Along aStreamline

Basic Tutorial #3

Deryl O. SnyderC. Greg Jensen

Brigham Young UniversityProvo, 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.

3

Pressure Along a Streamline

In this tutorial, Gambit® will be used to create and mesh the geometry for the problem.Once this is complete, FLUENT will be used to solve for the flow field within thedomain and calculate the pressure distribution along a streamline from the domaininlet to the stagnation point on the surface of the cylinder.

This 2D tutorial will provide more experience with 2D flows and also introduce you togeometry creation FLUENT.

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

An incompressible, inviscid fluidflows steadily past a cylinder.The fluid velocity along thestreamline that ends at the stagna-tion point is found to be:

where a is the radius of the cylin-der and Vo is the upstream veloci-ty. Determine and plot the veloci-ty and pressure gradients alongthe streamline.

⎟⎟⎠

⎞⎜⎜⎝

⎛⎟⎠⎞⎜

⎝⎛−= ∞

2

1xaVVx

Introduction

4

Pressure Along a Streamline

Begin the problem by creating geometry inGambit.

The Gambit standard display should beopen.

Meshes are generated in Gambit by follow-ing left to right the menu icons located inthe top right of the display window.

First create a rectangle as the computation-al domain.Operation > Geometry > FaceNote: Icons with a red arrow have a pull down menu. Toactivate the pull down menu select the icon with MB3.

Select the Create Face icon with MB3, andmake sure the rectangle option is selected

An additional working window shouldappear named Create Real RectangularFace.

Enter the dimensions for a rectangle ofwidth = 50, and height = 40.

Select Apply.

Note: To fit the geometry to the screen in Gambit, simplyselect the top left icon from the menu on the bottom rightof the display window.

Creating Geometry

5

Pressure Along a Streamline

Creating GeometryNow create the cylinder in the center of therectangle by selecting the same Create Faceicon wtih MB3 and activating the CreateReal Circle Face. Make a circle of radius =1 select Apply and then Close.

Since there is no flow inside of the cylinder,the circle face must be subtracted from therectangle face to create the desired domain.Click on the Join Faces button with MB3and select Subtract Real Faces.

Pick the rectangle with Shift + MB1 as thefirst face and the circle (Shift + MB1) as theface to be subtracted. Since only the newlycreated face is required for the solution,leave the two Retain boxes unchecked andselect Apply.

If problems are encountered in creating thegeometry, the geometry can be loaded from thefile “Stagnation_geometry.dbs”.

6

Pressure Along a Streamline

Meshing Geometry

In order to create a mesh for this 2ddomain, the edges of the geometry mustfirst be meshed. In this case the only edgemesh required is that of the cylinder.

Operation > Mesh > Edge > Mesh Edges

Select the circle edge. In the Spacing sec-tion change the pull down menu toInterval Count and enter 30. Click Apply.

Your domain should resemble the oneshown to the right.

7

Pressure Along a Streamline

Now create the interior mesh.

Operation > Mesh > Face > Mesh Faces

Select the entire face by clicking on any oneof the edges with Shift+MB1. In theElements pull down menu change the ele-ment type to Tri and click Apply.

The mesh should resemble the one shownto the right.

Meshing Geometry

8

Pressure Along a Streamline

Boundary Conditions

The next task is to specify the bondary con-ditions.

The first step is to specify the solver thatwill be used.

Solver > Fluent 5/6

Next, bring up the Specify BoundaryTypes window.

Operation > Zones > Specify BoundaryTypes

From the pull down menu under Entity,select Edges.

Select the top, left, and bottom edges ofthe rectangle.

Type the label inlet next to Name.

Select Velocity Inlet from the Type pulldown menu

Select Apply. The boundary conditionshould appear in the list at the top of theBoundary Types window.

Now create the last two boundary condi-tions in the same way. The far right edgeof the rectangle as an outflow and thecylinder as a wall. The list should resem-ble the image to the right.

9

Pressure Along a Streamline

Now export the mesh that will be importedinto Fluent

File > Export > Mesh

Make sure the Export 2d (X-Y mesh) box isselected.

Select Browse... to choose the saving direc-tory for the mesh file.

Save the mesh as Cylinder.msh.

Also save the Gambit file.

File > Save

Save the file as Cylinder

If problems are encountered in meshing thegeometry, the mesh can be loaded from the file“Stagnation_mesh.msh”.

Exporting the Mesh

10

Pressure Along a Streamline

Starting in FluentOpen FLUENT from the Desktop or Startmenu.

Select 2D

Select Run

The following window should appear.

This is the FLUENT user interface. Mosttasks are completed using the menus acrossthe top. The menus are designed to guideyou through the analysis in an orderlyfashion, going from top to bottom througheach menu, and left to right across themenu bar.

Now import the mesh into Fluent.

File > Read > Case

A browse window should appear.

Locate Cylinder.msh and select OK.

FLUENT will read in the geometry andmesh you created. If there are problemsreading the mesh, return to the beginningof the tutorial and make sure you followthe steps carefully. If there are no problemsthe command window should state“done”.

Now check the grid for errors.

Grid > Check

Any errors will be listed, otherwise thecommand window should again state“done”.

11

Pressure Along a Streamline

Defining the ProblemDefault settings for the Fluent Solver willbe sufficient for this problem.

Define > Models > Solver

Confirm that the Solver options are thesame as shown on the left.

Now change the viscosity model to an inviscid flow.

Define > Models > Viscous

Select Inviscid and then Ok

Since the cylinder is centered at (0,0) in thedomain, the reference pressure for the solu-tion must be moved into the domain.

Define > Operating Conditions...

Move the reference pressure location to thetop wall by setting X to 0 m and Y to 20 m.

Now set the desired inlet velocity in theBoundary Conditions menu.

Define > Boundary Conditions...

Select the inlet from the column on the leftand then click on Set...

12

Pressure Along a Streamline

Defining the ProblemChange Velocity Specification Method toMagnitude and Direction and set VelocityMagnitude to 1. Ensure that the X-Component of Flow Direction is set to 1and that the Y Component is 0. Click OKand exit from the Boundary Conditionswindow.

This case will be solved with a secondorder discretization, so change the solutioncontrols for momentum to second order.

Solve > Controls > Solution

Change the drop down menu forMomentum to Second Order Upwind andclick Ok.

The problem can now be initialized.

Solve > Initialize > Initialize...

Select inlet in the drop-down menu labeledCompute From and verify that the InitialValues match the inlet conditions:

Gague Pressure: 0

X-Velocity: 1

Y-Velocity: 0

Click on Init to initialize the computationaldomain and then close the window.

13

Pressure Along a Streamline

Solving the ProblemThe problem is now almost ready to besolved.

Solve > Monitors > Residual...

Make sure Plot is checked in the upper leftcorner and uncheck all of the boxes in theCheck Convergence column. Fluent canautomatically stop iterating once residualshave reached a certain value. For this casethe solution will be monitored manually.Click OK.

Now begin iterating on the solution.

Solve > Iterate...

Begin with 600 iterations. Convergencewill depend on the computing platformbeing used. The residuals should taper offafter 400 iterations or so. The solution hasstopped changing when the residualsbecome constant. A good indication of aconverged solution is that the residualshave dropped at least 4 orders of magni-tude.

14

Pressure Along a Streamline

Analyzing the SolutionThe problem statement calls for a graph ofthe pressure and velocity distributionsalong a streamline from the edge of thedomain up to the stagnation point on thecylinder. In order to plot distributionsalong this streamline, a line must be creat-ed in Fluent along the desired path.

Fluent can create lines in the domain basedon two user-specified points (the pointsrequire both X and Y coordinates) in thedomain that are used to create the slope ofthe line. Fluent automatically takes thisslope and draws a line across the entiredomain.

Surface > Line/Rake...

Create a horizontal line along the stagna-tion streamline by entering the first point(X0,Y0) at (0,0) and the second point(X1,Y1) at (1,0). Name the line streamlineunder New Surface Name. Click Createand then Close.

15

Pressure Along a Streamline

Analyzing the SolutionNow that a line has been specified, plots ofthe pressure and velocity can be createdand compared to the analytical solution.

Plot > XY Plot...

Change the two pull-down menus underthe Y Axis Function section to Pressure...and Static Pressure respectively. X AxisFunction should be set to Direction Vector.Select the streamline from the list of edgesto plot against and click Plot at the bottomof the window. A window should appearwith the static pressure distribution alongthe entire streamline. Since nothing down-stream of the stagnation point is required,change the X-Axis range to display only thedesired section.

Click on Axes... in the XY Plot window.

Unchecking Auto Range under Optionswill highlight the Range section in the mid-dle of the window. Change the Minimumto -25 (the far edge of the domain) and thenclick Apply and then Close.

Now replot the graph by selecting Plot onemore time. The new plot should look sim-liar to the image shown.

16

Pressure Along a Streamline

Analyzing the SolutionNow plot the velocity distribution alongthe same streamline by changing Y AxisFunction in the plot window to Velocity...instead of Pressure...

Make sure that the streamline is still select-ed in the Surfaces menu. The X-axis set-tings will remain the same from the pres-sure plot.

The velocity distribution should be similarto the image to the left.

If problems are encountered in setting up oranalyzing this problem in Fluent, the solvedproblem can be read in as Case & Data.... fromthe file “Stagnation _cylinder.cas”.

17

Pressure Along a Streamline

Analytical SolutionUsing Bernoulli’s equation with the velocityprofile given in the problem statement thepressure distribution can be found to be:

Plotting the analytical velocity and pres-sure distributions with correspondingFluent output reveals good agreement ascan be seen in the plots to the right.

⎟⎟⎠

⎞⎜⎜⎝

⎛⎟⎠⎞⎜

⎝⎛−⎟

⎠⎞⎜

⎝⎛+= ∞∞

222

211

xa

xaVPPx ρ