modeling external flow in airfoil 2d

23
Gambit - Generation of Grid for a 2-D Airfoil Introduction and Instructions: In this document is a procedure that enables students to generate a two-dimensional, unstructured grid around an airfoil, which will be used with the CFD program, Fluent. Readers should already be familiar with the notation used in this module, as described in the learning module, Fluent and Gambit - Introduction and General Information . Overall description of the problem and grid: 1. We will model flow over a 2-D airfoil at some arbitrary angle of attack with respect to the freestream flow. The computational domain is bounded on the inside by an airfoil shaped closed path, and by a rectangular box on the outside, as sketched (drawing not to scale). 2. The airfoil is assumed to have a chord length of 1.0 meters (all dimensions in this module are in the standard MKS system of units), with the front-most part of the airfoil at (0,0,0) and the trailing edge at (1,0,0). 3. The computational domain extends far upstream of the airfoil where the boundary condition will be a velocity inlet. The angle of attack will be specified in the CFD flow solver, Fluent. The outlet is to the far right.

Upload: nugrohoisnandi

Post on 24-Oct-2015

38 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Modeling External Flow in Airfoil 2D

Gambit - Generation of Grid for a 2-D Airfoil

Introduction and Instructions:

In this document is a procedure that enables students to generate a two-dimensional, unstructured grid around an airfoil, which will be used with the CFD program, Fluent. Readers should already be familiar with the notation used in this module, as described in the learning module, Fluent and Gambit - Introduction and General Information.

Overall description of the problem and grid:

1. We will model flow over a 2-D airfoil at some arbitrary angle of attack with respect to the freestream flow. The computational domain is bounded on the inside by an airfoil shaped closed path, and by a rectangular box on the outside, as sketched (drawing not to scale).

2. The airfoil is assumed to have a chord length of 1.0 meters (all dimensions in this module are in the standard MKS system of units), with the front-most part of the airfoil at (0,0,0) and the trailing edge at (1,0,0).

3. The computational domain extends far upstream of the airfoil where the boundary condition will be a velocity inlet. The angle of attack will be specified in the CFD flow solver, Fluent. The outlet is to the far right.

4. The top and bottom of the computational domain are "periodic" boundary conditions, which means that whatever flows out of the top goes directly into the bottom. Another way of thinking about this is that we are actually modeling an infinite array of airfoils, stacked on top of each other. It is assumed that since the outer limits of the computational domain are so far apart, this airfoil behaves as if in an infinite freestream.

5. In order to adequately resolve the boundary layer along the airfoil wall, grid points will be clustered near the wall. Far away from walls, where the flow does not have large velocity gradients, the grid points can be very far apart. A hybrid grid will be used in this problem, i.e. a structured quadratic (rectangular cells) grid around the airfoil and outward to an ellipse,

Page 2: Modeling External Flow in Airfoil 2D

connected to an unstructured (triangular cells) grid out to the limits of the computational domain. Grid adaptation within the flow solver, Fluent, will increase the grid density even more near the wall and wherever else needed.

Generate data points defining the airfoil:

1. Using an internet browser, go to the NACA 4-Digits Series web page at http://www.pagendarm.de/trapp/programming/java/profiles/NACA4.html orhttp://www.ppart.de/aerodynamics/profiles/NACA4.html . This site enables users to generate any standard NACA 4-digit 2-D airfoil. Note: On some computers, Java may be disabled by default. In some of the older versions of Netscape, Options-Network References, and turn on Java.

2. Adjust the values to create various airfoil shapes. Explain to what each of the four digits refer.3. Generate a non-symmetric airfoil, i.e. a NACA 4314 airfoil.4. Change # Points to about 50, which should be sufficient to generate the airfoil shape.

Change Point Size to around 3 or 4 so that the points are clearly visible. Show Points.5. Highlight all the data points with your mouse (left click and drag over the text area). On

Windows platforms, copy the data points (Ctrl-C).6. Open your favorite text editor, and insert (paste - Ctrl-V on Windows platforms) the data points.7. The very first point of the data should be at the trailing edge, i.e. at (1,0). However, due to

resolution and accuracy limits, it may not be exactly correct. If not, change the x value to 1.0 and change the y value to 0.0 on the first line of the data file. This will ensure a nicely defined trailing edge.

8. Do the same thing to the last data point, which should also be at exactly (1,0).9. Gambit expects to read three-dimensional data, i.e. x, y, and z for each data point or "vertex".

Therefore, the z value must be added manually here. Simply add a blank space or two, followed by "0.0" at the end of each line.

10. Save the file (a name such as "NACA4314.txt" is recommended).11. If your internet browser is not on the same computer or cluster as is Fluent and Gambit, you will

need to transfer the file onto the appropriate computer (using FTP, or e-mail).

Log on and launch Gambit:

1. Log onto a UNIX machine which has a license for the Fluent family of software.2. Note: If using Telnet or rlogin, this step is unnecessary. Create a Unix shell: From the small

window in the upper left of the screen (usually named Global or Toolchest or something like that, depending on the operating system), Desktop-Unix shell.

3. Enter "set path = (/disk03/local/Fluent.Inc/bin $path)" to give you access to the Fluent programs. Note: This line should be added to your .cshrc file so that you won't have to add it manually every time you log in.

4. At this point, if not already done previously, you should create a new directory called Fluent, so that all of your Fluent projects reside on this directory. To do so, Enter "mkdir Fluent" and then go to this new directory by entering "cd Fluent".

5. Also create a new directory called Gambit, as a subdirectory of Fluent. Go to the Gambit subdirectory by entering "cd Gambit".

Page 3: Modeling External Flow in Airfoil 2D

6. Copy, move, or FTP the airfoil data file (NACA4314.txt) onto this Gambit directory so that it is readily available from within Gambit.

7. Gambit may now be launched. Enter "gambit -id airfoil &". After a while (sometimes a couple minutes!), the main Gambit window should appear on your screen. Note the "&" at the end of the command, which tells UNIX to run this in background mode. This will free up your UNIX window for other commands while Gambit continues to run.

8. In the upper left of the screen, Solver-Fluent 5. This selects Fluent as the solver for which gambit will eventually write the mesh file.

Import the airfoil data points (vertices) into Gambit, and generate other vertices:

1. From Command at the bottom of the screen, enter "import vertexdata "NACA4314.txt"" Note: include the quotes around the file name, but not around the whole command. If successful, a vertex is created in Gambit for each (x,y,z) data point present in your text file. These should appear as little plus signs on the screen, and the Transcript Window should show that 78 new vertices were created.

2. Now create some more vertices manually. First, we will create a vertex inside the airfoil. In Geometry, Vertex Command Button-R-Create Vertex-From Coordinates. In Create Real Vertex-Global, enter 0.5, 0, and 0 for x, y, and z respectively. Type an appropriate label for this vertex, i.e. "inside airfoil", and Apply. A vertex is created.

3. Create another vertex at (1.5,0,0). You can call it "right of airfoil" or something like that. At this point, you may not be able to see the new vertex, since it may be located off the screen. There are two ways to see it. You can zoom in and move with the right mouse and middle mouse, respectively. Or, to fit all the geometry into the available screen space (a very handy tool!), in Graphics/Windows Control (near the bottom right), Fit to Window.

4. In a similar fashion, create three more vertices surrounding the airfoil at the following locations (you can enter some labels if desired, or you can let Gambit name them by default): (-0.5,0,0), (0.5,0.3,0) (0.5,-0.3,0). These will be used to help generate a very fine grid near the airfoil wall.

5. In the main Gambit window near the upper left, File-Save. This will save your work so far. It is a good idea to do this every so often, especially after a major task is completed.

Create edges from these vertices for the top half of the computational domain:

1. Now some edges will be created to define the airfoil and an elliptical boundary surrounding the airfoil. First, the top half of the airfoil will become an edge. This edge will be a curve fit through the vertices just created, from the trailing edge through the vertices defining the top of the airfoil, to the leading edge. Under Geometry, Edge Command Button. (Note: If the button is already open, clicking it again will make the options disappear! If this happens, click it again.)

2. Under Edge, right mouse click the top left icon, which is called Create Edge, and then NURBS. (In this learning module from now on, this type of command which requires a right click of the mouse will be denoted by R-Create Edge-NURBS.) NURBS is Gambit's curve-fitting routine, which will fit a smooth curve onto several vertices. NURBS stands for Non-Uniform Rational B-Spline.

Page 4: Modeling External Flow in Airfoil 2D

3. In Create Real Edge From Vertices, make sure the text area called Vertices is highlighted - if not, click in that area. Select, in order, the vertices starting from the trailing edge, and continuing counterclockwise along the top of the airfoil, up to and including the leading edge vertex (the one at the origin). You may need to zoom in to pick them properly. Note that vertices are selected by Shift + left mouse click. We are telling Gambit to create an edge by fitting a smooth curve between all of these vertices.

4. In Create Real Edge From Vertices, type in an appropriate label for the edge about to be created. I suggest "airfoil top" or something equally descriptive. Apply. A yellow line should be drawn on the screen connecting the vertices.

5. Now Close the Create Real Edge From Vertices window.6. Now we will create the upper half of an ellipse surrounding the airfoil. Under Edge, R-Create

Edge-Ellipse.7. In Create Real Elliptic Arc, the Center of the ellipse should be highlighted. Select the vertex

inside the airfoil as the ellipse center. Click inside the text box called Major, and select the vertex to the right of the trailing edge of the airfoil. In a similar fashion select the vertex above the airfoil as On Edge.

8. Change Angle-End to 180 degrees (since we only want to draw the upper half of the ellipse). Label this edge if you like ("upper ellipse") and Apply. The top half of an ellipse surrounding the airfoil will be drawn in yellow if all is well. Close the Create Real Elliptic Arc window.

9. Two more edges are needed to completely define the domain above the airfoil. These edges will be straight lines between vertices. Under Edge, R-Create Edge-Straight.

10. Select the vertex at the trailing edge (should be labeled vertex.1 by default), and also the one just to the right of the trailing edge. Label it if you wish, and Apply.

11. Similarly, create and edge from the leading edge vertex (should be labeled vertex.39 by default) to the vertex to the left of the leading edge.

12. In the main Gambit window near the upper left, File-Save. This will save your work so far. It is a good idea to do this every so often, especially after a major task is completed.

Define node points along the edges:

1. In Operation, Mesh Command Button-Edge Command Button. Mesh Edges should be the default window that opens; if not, Mesh Edges.

2. Select the airfoil top edge, and in Mesh Edges, change the Spacing option from Interval Size to Interval Count. Enter the number 50 as the Interval Count. Apply. Blue circles should appear at each created node point along that edge.

3. Now select the ellipse top, and Apply. 50 node points will appear on that edge as well.4. On the other two edges (the horizontal ones), we want to bunch up the nodes at the airfoil. Select

the edge to the right of the trailing edge of the airfoil. Change Interval Count to 20. Change Ratio to about 1.4 or 1.5 so that nodes are really bunched up near the airfoil. Note: If the bunching is backwards from the way you desire, click on the Reverse button. Apply.

5. In similar fashion, assign 20 bunched-up nodes on the edge to the left of the leading edge of the airfoil. Don't forget to Apply.

Generate a face above the airfoil from the available edges, and mesh the face with quadratic cells:

Page 5: Modeling External Flow in Airfoil 2D

1. Under Operation, Geometry Command Button, and under Geometry, Face Command Button-R-Create Face-Wireframe.

2. It is important to select the edges in order when creating a face from existing edges. (I like to select them in mathematically positive counterclockwise order). Select the upper ellipse edge first, followed by the edge to the left of the airfoil, the upper airfoil edge itself, and then finally the edge to the right of the airfoil. These four edges outline a closed face.

3. In Create Face From Wireframe, type in a label for this face ("upper airfoil face" is suggested), and Apply. If all went well, a pretty blue outline of the face should appear on the screen; this is a face, which is now ready to be meshed.

4. Under Operation, Mesh Command Button-Face Command Button. The default window that pops up should be Mesh Faces. If not, Mesh Faces.

5. Select the face just created. Elements should be Quad by default; if not, change it. Also change Type to Map. The Spacing options will be ignored since nodes have already been defined on all edges of this face.

6. Generate the mesh by Apply. If all goes well, a structured mesh around the top of the airfoil should appear. Zoom in to see how the cells are nicely clustered near the airfoil surface. This will help Fluent to resolve the boundary layer around the airfoil.

7. You can now Close the Mesh Faces window.

Generate edges, a face, and mesh the face below the airfoil:

1. Duplicate the commands just performed, but this time on the bottom of the airfoil. Specifically, first generate an edge following the bottom half of the airfoil from the trailing edge to the leading edge, as before. (You can zoom in or out anytime.)

2. Generate the bottom half of the ellipse (angle goes from 180 to 360 or 0 to 180 this time, depending on which vertex you select as Major and On Edge).

3. Put 50 uniform points (Ratio = 1) on the bottom of the airfoil, and also on the ellipse edge.4. Create a face below the airfoil from the four edges.5. Create the mesh on the bottom face.6. Caution: Sometimes (I don't know why), the node distribution on an edge will disappear

mysteriously. If it does, you must re-assign nodes along that edge before the face can be meshed. In some cases, the mesh on the upper face disappears while meshing the lower face. If this happens, re-mesh the upper face. When all is done, a nice structured grid should appear around the whole airfoil out to the ellipse. We are now ready to define the outer limits of the computational domain, and to generate an unstructured mesh from the ellipse to the outer limits.

Generate the outer limits of the computational domain:

1. In Operation, Geometry Command Button, and then in Geometry, Vertex Command Button-R-Create Vertex-From Coordinates. In Create Real Vertex-Global, enter -10, 10, and 0 for x, y, and z respectively. Type an appropriate label for this vertex, i.e. "top left", and Apply. A vertex is created.

Page 6: Modeling External Flow in Airfoil 2D

2. In a similar manner, create and label vertices for the bottom left, bottom right, top right, middle left, and middle right, at locations (-10,-10,0), (20,-10,0), (20,10,0), (-10, 0,0), and (20,0,0) respectively. Use the handy Fit to Window command to see your vertices.

3. Now create straight edges between pairs of vertices just created. We will do the top half first, then the bottom half. In Geometry, Edge Command Button-R-Create Edge-Straight.

4. Two vertices are needed to define each straight edge. For example, select the vertex on the right side on the ellipse created previously. Select also the middle right vertex of the outer domain. Label this edge "middle right edge" or something, and Apply.

5. Now select the middle right vertex and the top right vertex. Create an edge between these two vertices (call it "upper right edge").

6. In similar fashion, create edges called "top edge", "upper left edge", and "middle left edge".7. Now repeat for the three remaining edges on the lower half, i.e. "lower left edge", "bottom edge",

and "lower right edge". Finally, Close the Create Straight Edge window.8. Note: It is important that the top edge and bottom edge have the same direction. In other

words, if you created the top edge from left to right, create the bottom edge from left to right as well. If these two are backwards from each other, the periodic boundary condition will not work properly in Fluent.

9. To reduce clutter on the screen, we will erase all the vertices, as they are no longer needed. under Graphics / Windows Control, Specify Model Display Attributes-Vertices and Visible-Off. Apply. This does not delete the vertices, but simply removes them from view. Close the Specify Display Attributes window.

Specify the node distribution along these new edges:

1. In Operation, Mesh Command Button-Edge Command Button. Mesh Edges should be the default window that opens; if not, Mesh Edges.

2. Select the upper left edge, the lower left edge, the upper right edge, and the lower right edge. In Mesh Edges, change the Spacing option, if necessary, from Interval Size to Interval Count. We don't need many nodes this far from the airfoil, so enter 3 as the Interval Count. Apply. Blue circles should appear at each created node point along those edges.

3. Now select the edge that runs from the back of the ellipse to the middle right vertex of the outer domain. Change Interval Count to 30 and change Ratio to about 1.4 so that nodes are clustered near the ellipse. (Depending on how you created this edge, it may be necessary to Reverse.) Apply.

4. In similar fashion, put about 20 nodes on the edge that runs from the front of the ellipse to the vertex we called middle left. These nodes should also be clustered near the ellipse. (Depending on how you created this edge, it may be necessary to Reverse.)

5. The top and bottom edges of the domain will now be meshed. However, they must first be linked, so that the node distribution will be identical. This is necessary in order to define the top and bottom edges with periodic boundary conditions. Note: The arrows on these edges must be in the same direction, or else the periodicity will not work. In Edge, R-Link/Unlink Edges-Link.

6. In Link Edge Meshes, select the top edge for Edge. Left click the mouse on the Link With Edge text area, and select the bottom edge. Apply. Close.

Page 7: Modeling External Flow in Airfoil 2D

7. In Edge, Mesh Edges. In Mesh Edges, select the top edge, enter 6 as the Interval Count in Spacing, Set Ratio back to 1, and Apply. Blue nodes should appear on both the top and bottom edges, since they are linked.

8. Check that all the edges are meshed. If any of the edge meshes have mysteriously disappeared, re-do those.

9. Finally, Close the Mesh Edges window. We are now ready to create faces for the top and bottom, and mesh these faces.

Create an upper face, generate a mesh on the face, and repeat for lower face:

1. In Operation, Geometry Command Button. In Geometry, Face Command Button-R-Create Face-Wireframe.

2. Beginning with the edge that goes from the back of the ellipse to the middle right vertex, and proceeding counterclockwise, select the edges that make up the big upper face, concluding with the top half of the ellipse. Label this face "upper" and Apply.

3. Likewise, generate a face called "lower" on the bottom.4. In Operation, Mesh Command Button, and in Mesh, Face Command Button. If not already the

default, Mesh Faces.5. Select the upper face, change Elements to Tri, and Apply. After a while, a triangular unstructured

mesh should grow from the ellipse to the outer domain.6. Repeat for the lower face.7. Zoom in to see how the mesh has been applied around the airfoil. If not satisfied, you can change

some of the node distributions and re-create the mesh.

Specify the boundary conditions on all edges:

1. In order for the mesh to be properly transferred to Fluent, the edges must be assigned boundary conditions, such as wall, inlet, outlet, etc. Actual numerical values, such as inlet velocity, will be specified from within Fluent itself. In Operation, Zones Command Button-Specify Boundary Types Command Button.

2. In the Specify Boundary Types window, change Entity to Edges (the default is usually Faces). In this problem, which is 2-D, boundary conditions will be applied to edges rather than to faces.

3. Select the two left-most edges of the computational domain, which will become an inlet. Change Type to Velocity_Inlet, and type in the name "inlet". Apply. Some words indicating this boundary condition will appear on the screen.

4. Select the two right-most edges. In similar fashion, make this a Pressure_Outlet named "outlet". Be sure to Apply, or the boundary condition will not actually be changed.

5. Select both the top-most edge and the bottom-most edge. Change Type to Periodic, and name this "top and bottom". Apply. The periodic boundary condition will be applied to both the top and bottom edges simultaneously. This ensures that whatever flow exits the top edge enters the bottom edge, and vice-versa.

6. Select the horizontal edges running from the ellipse to the outer domain, select the two edges making up the ellipse, and the two short horizontal edges going from the airfoil to the ellipse (you

Page 8: Modeling External Flow in Airfoil 2D

may need to zoom in first). Label all of these "Interior". All of these must be assigned as Type Interior. (Interior simply means they are fluid edges, not walls or anything else.)

7. Select the two airfoil edges Name these "airfoil", and change Type to Wall. Apply. Close the Specify Boundary Types window.

Write out the mesh in the format used by Fluent, and then exit Gambit:

1. In the main Gambit window, File-Export-Mesh-Accept. (The default file name can be changed here if desired, but the default name is acceptable in this case.)

2. When the Transcript (at lower left) informs you that the mesh is done, File-Exit-Yes.3. When Gambit exits, the UNIX window will re-appear. Enter "ls -la" to see the files created by

Gambit. The airfoil.msh file is the one to be used by Fluent.4. It is a good idea to move this file into the Fluent directory, so that it is ready to be read in. Enter

"cd ..", which will move your working directory up one level to the Fluent directory. To verify, Enter "pwd" (print working directory).

5. Now enter "mv Gambit/airfoil.msh .", which will move the file from the Gambit subdirectory into the working directory. Enter "ls -la" to verify.

6. The mesh file should now be ready for use by Fluent. You may move on to the next learning module, Fluent - Flow over a 2-D Airfoil, which describes how to run this case with the CFD solver, Fluent.

Page 9: Modeling External Flow in Airfoil 2D

Fluent - Flow over a 2-D Airfoil

Introduction and Instructions:

In this document is a procedure that enables students to solve a 2-D airfoil flow problem with the CFD program, Fluent. Readers should already be familiar with the notation used in this module, as described in the learning module, Fluent and Gambit - Introduction and General Information.

Note: This set of instructions assumes that the student has already run the Gambit program, and has generated a grid for the airfoil. (See the learning module, Gambit - Generation of Grid for a 2-D Airfoil.) The file airfoil.msh is assumed to exist on the student's Fluent directory on the SGI cluster.

Log on and launch Fluent:

1. Log onto one of the SGI cluster computers. If you have just completed the Gambit learning module for generating the grid, you should already be logged in, and your working directory should be Fluent. In that case, skip to step 5 below.

2. Create a Unix shell: Desktop-Unix shell.3. Enter "set path = (/disk03/local/Fluent.Inc/bin $path)" to give you access to the Fluent programs.

Note: This line should be added to your .cshrc file so that you won't have to add it manually every time you log in.

4. From your main directory, enter "cd Fluent" to change the working directory to Fluent. (Note: It is assumed that the grid file resides in the Fluent subdirectory.)

5. Enter "fluent 2d &". After a few seconds, the main Fluent window should appear on your screen.

Read the grid points and geometry of the airfoil flow domain:

1. Select File-Read-Case. In Select File, select airfoil.msh from the lisitng of available files shown on the right side. OK. Fluent will read in the grid geometry and mesh that was previously created by Gambit. Some information is displayed on the main screen. If all went well, it should give no errors, and the word Done should appear.

2. Verify the integrity of the grid: Grid-Check. Look for any error messages that indicate a problem with the grid. If the grid is not valid, you will have to return to Gambit and regenerate the grid.

3. Look at the grid: Display-Grid-Display. A new window opens up showing the grid. If this window is too big, rescale it by dragging the edges of the window. It is best if the graphical display window is small enough that both it and the Fluent window are both visible simultaneously. The Fluent window and/or the graphical display window may need to be moved to accomplish this.

4. The graphical display can be zoomed-in or zoomed-out with the middle mouse button. If you start on the upper left and draw a rectangle with the middle mouse button towards the lower right, the display will zoom in on what is included in the rectangle. Meanwhile, the left mouse button can be used to drag the image to a new location. If you draw a rectangle backwards with the middle mouse button, i.e. from the lower right to the upper left, it will zoom out. Play with this feature

Page 10: Modeling External Flow in Airfoil 2D

until your domain is shown nicely in the window. Close the Grid Display window; the display itself will remain.

Define the boundary conditions:

1. Now the boundary conditions need to be specified. In Gambit, the boundary conditions were declared, i.e. wall, velocity inlet, etc., but actual values for inlet velocity, etc. were never defined. This must be done in Fluent. In Fluent, Define-Boundary Conditions, and a new Boundary Conditions window will pop up.

2. In Boundary Conditions, select inlet, which is the left side of the computational domain. Set.3. In Velocity Inlet, change Velocity Specification Method to Magnitude and Direction.

Change Velocity Magnitude to 5 m/s. Change X-component of Flow Direction to the cosine of your angle of attack. Set Y-component of Flow Direction to the sine of your angle of attack. OK.

4. The fluid needs to be defined. In Boundary Conditions, select fluid, and Set. The default fluid is air, which is the fluid we desire in this problem. Select air as the Material Name in the Fluid window, and OK.

5. From the main Fluent window, Define-Materials. Air should be the default material name. Write down the density and viscosity on a piece of paper (these will be needed later on). Close the Materials window.

6. Return to the Boundary Conditions window. At this point it may be hidden under the Fluent window, so some moving around may be required. Alternately, from Fluent, Define-Boundary Conditionsto re-show the window. The default boundary conditions for the airfoil (wall) and the outlet (pressure outlet) are okay, so nothing needs done to those. It is a good idea to verify them, however.

7. Likewise, top-and-bottom, and verify that the top and bottom edges are periodic.8. Finally, Close the Boundary Conditions window.

Set up some parameters and initialize:

1. In Fluent, Solve-Initialize-Initialize. The default initial values of velocity and gage pressure are all zero. The convergence can be sped up slightly be giving more realistic values of the initial velocity distribution. In our problem, the velocity will be that of the uniform stream over most of the flowfield. So, it is wise to enter the x and y components of the freestream velocity here (these will depend on your assigned angle of attack). Apply, Init and Close.

2. Back in Fluent, Define-Models-Viscous. Laminar flow is the default, so we really don't need to do anything here. Later on, however, we will try turbulent flow calculations; this is where the turbulence models are specified in Fluent. OK.

3. Now the convergence criteria need to be set. As the code iterates, "residuals" are calculated for each flow equation. These residuals represent a kind of average error in the solution - the smaller the residual, the more converged the solution. In the main window, Solve-Monitors-Residual. In Residual Monitors, turn on Plot in the Options portion of the window. The Print option should already be on by default. Here, Print refers to text printed in Fluent, and Plot causes the code to plot the residuals on the screen while the code is iterating.

Page 11: Modeling External Flow in Airfoil 2D

4. Since there are three differential equations to be solved in a two-D incompressible laminar flow problem, there are three residuals to be monitored for convergence: continuity, x-velocity, and y-velocity. The default convergence criteria are 0.001 for all three of these. Experience has shown that this value is generally not low enough for proper convergence. Click on each 0.001 individually, and change it to 0.00001 (which will display as 1.E-05) on the window that pops up, each time clicking OK to set it. When all three are set, OK to exit the Residual Monitors window. Finally, the code is ready to iterate!

Save your case information:

1. In Fluent, File-Write-Case. In Select File, the default file name should be airfoil.cas.2. To save disk space, it is wise to check the Write Binary Files option. To really save disk space,

change the file name to "airfoil.cas.gz". On a Unix system, the ".gz" file extension automatically compresses the file.

3. Click OK to write the file onto your directory. The case file will record the grid plus all boundary conditions and other specified parameters.

Iterate towards a solution:

1. Solve -Iterate to open up the Iterate window. Change Number of Iterations to 50, and Iterate. The main screen will list the residuals after every iteration, while the graphics display window will plot the residuals as a function of iteration number. You should see an overall drop in the residuals, although it is normal for them to rise occasionally as the code attempts to zero in on a solution.

2. At the end of 50 iterations, check to see how the solution is progressing. In Fluent, Display-Velocity Vectors-Display. The graphical display window will show the velocity vectors. Zoom in with the middle mouse, as described above, to view the velocity field in more detail if desired. In Velocity Vectors, adjust Scale as needed to make the velocity vectors clearly visible. The Vector Optionsbutton gives you control over the appearance of the arrows. Adjust the arrows as desired to get a nice-looking vector plot

3. Iterate some more - (To restart the iteration, either find the Iterate window, which is probably hidden under some other windows at this point, or in Fluent, Solve-Iterate to re-open the Iteratewindow.) In Iterate, Change Number of Iterations to 100, change Reporting Interval to 10 since there is no need to display every iteration, and Iterate. Check the velocity vectors, as described above after every 100 iterations. It is wise to move the Iterate window someplace out of the way of the other windows so you can easily restart the iteration. After a while the residuals should level off. If the residuals all go below the convergence criteria, the calculations will stop. In most cases, however, the residuals reach a lower limit, and further iterations don't improve the solution. Do not do more than about 300 iterations.

Save your data:

1. In Fluent, File-Write-Case & Data.2. Click OK to write the file onto your directory. Note that Case & Data refers to both the case (the

grid plus all boundary conditions and other specified parameters) and the data (the velocity and

Page 12: Modeling External Flow in Airfoil 2D

pressure fields calculated by the code). The code will actually write out two files, airfoil.cas (or airfoil.cas.gz) and airfoil.dat (or airfoil.dat.gz). It is OK to overwrite the file.

3. Every so often, save your data in case of a crash or a user error.

Refine the grid:

Note: In this particular problem, the grid is already very well refined near the airfoil wall. Depending on your angle of attack, grid adaption may not help. In some cases, it even makes the convergence worse.

1. The grid may not be well-enough resolved near the wall, especially for cases with high angle of attack, in which there is flow separation. Fortunately, Fluent has an "Adapt" feature that automatically adds grid points where needed for better resolution. There are several options for grid adaptation - we shall adapt by velocity gradient.

2. In Fluent, Adapt-Gradient. In Gradient Adaption, change Gradients of to Velocity.3. Select the Compute option. Minimum and maximum velocity gradients will appear in the

window.4. As a good rule of thumb, set the Refine Threshold to about 1/10 of the maximum gradient, and

the Coarsen Threshold to about 1/1000 of the Refine Threshold. Enter these values in the appropriate text boxes.

5. Now Mark. The main Fluent window will display how many cells have been selected for refining and coarsening. The coarsening cells can be ignored since Fluent is unable to coarsen the original grid - it can only refine the original grid.

6. Optional: If you want to see where the grid will be adapted, Manage-Display. Areas destined for grid refinement will be highlighted.

7. Back in the Gradient Adaption window, Adapt. You will be prompted about hanging-node mode. Answer Yes to continue. The main Fluent window will display some information about the grid adaptation.

8. Optional: To see what the refined grid looks like, you can select Display-Grid-Display from the main Fluent window, and zoom in close to the wall. You should see some new cells near the wall where velocity gradients are highest.

9. The Gradient Adaption window can be closed at this point. Or, better yet - move it somewhere on the screen where it can be accessed again, since we will need it again later.

Iterate some more:

1. If the Iterate window is still visible, go to it. If not, Solve-Iterate from the main Fluent window to re-open the Iterate window. Change Number of Iterations to about 200, keep the Reporting Intervalat 10, Apply, and Iterate. It is normal for the residuals to jump up considerably immediately after a grid adaption, but they should soon go down again, hopefully lower than before the adaption.

2. At the end of these iterations, check to see how the solution is progressing. In the main Fluent window, Display-Velocity Vectors-Display. The graphical display window will show the velocity vectors.

Page 13: Modeling External Flow in Airfoil 2D

3. It is wise at this point to save your case and data files again in case further adaption causes problems.

4. If the residuals have leveled off or reached an oscillatory state, you may wish to adapt again. In Gradient Adaption, Compute again, and re-adjust Refine Threshold and Coarsen Threshold as described above. Mark and Adapt.

5. Iterate some more, and adapt some more as necessary until the solution converges. Be careful that you don't adapt too much or you may reach memory limitations on the machine. Save the case and data files regularly in case something goes wrong.

Monitor the lift coefficient:

1. A nice feature in Fluent is that certain results can be monitored as the solution progresses. Here we will set things up so that the lift coefficient is displayed on the screen and plotted in a graphics window as the iterations progress. Report-Reference Values.

2. In Reference Values, type in the correct values of Area (the area here is actually area per unit depth, which is the chord length of the airfoil), Length (the chord length of the airfoil), and Velocity (the freestream velocity magnitude which was assigned as the velocity inlet boundary condition). The values of density and viscosity should be those of our working fluid by default.

3. Hit OK to apply the reference values and to exit the Reference Values window. With these reference values, the lift coefficient should be calculated correctly.

4. Now set up to monitor the lift coefficient: Solve-Monitors-Force.5. In the Force Monitors window, make sure the airfoil wall is highlighted, turn on Plot and Print,

change Coefficient to Lift, and enter the appropriate components of the Force Vector such that the force being calculated is the lift (lift is defined as perpendicular to the freestream velocity vector).

Other options to help convergence:

1. If the solution still seems to not want to converge, there are other options you can try. One option is to reduce the under-relaxation ratios of the variables which are not converging. For example, if continuity is not converging, the under-relaxation ratio for pressure should be reduced. Solve-Controls-Solution.

2. In Solution Controls, try lowering the Under-Relaxation Factor for the appropriate variable by about a factor of two. You may try lowering the other under-relaxation factors as well, but not as much. OK to apply your changes.

3. If lower under-relaxation factors seem to help, lower them some more. Low factors can sometimes help convergence in cases where there is flow separation, but the separation point is not well defined, such as on a rounded surface as in this problem. Fluent may oscillate between solutions as the separation point moves around.

4. Another option in Solution Controls is to change the Discretization scheme for Pressure and Momentum to Second Order and Second Order Upwind, respectively. You can also try changingPressure-Velocity Coupling to SIMPLEC. By the way, with the Help button, you can read more about these options and when they apply. OK to apply your changes.

Page 14: Modeling External Flow in Airfoil 2D

Generate and print the velocity vector field near the airfoil:

1. After the solution has converged adequately, some final results will be documented. The first of these is a plot of the velocity vectors. In Fluent, Display-Velocity Vectors-Display. Zoom in so that the flow is visible around the entire airfoil, plus some of the surrounding fluid. Adjust the scale as necessary to get a nice-looking plot.

2. Add your name and angle of attack to the label at the bottom of the plot. To do this, simply click with the left mouse button just below the title at the bottom of the graphical display. A cursor will appear, where you can start typing. I suggest "A. B. Lastname, Alpha = xx degrees" as your additional label, where you substitute your name and angle of attack, of course.

3. In Fluent, File-Hardcopy. The default graphics display window on the screen shows plots with a black background and colored objects (foreground). If your graphics display window has a black background, make sure that Reverse Foreground/Background is turned on, otherwise the printout will be white on black rather than black on white. Change Coloring to Monochrome, since the printer is only black and white.

4. Optional: The default resolution of the hardcopy printout is set to 75 DPI. This resolution can be improved (150 DPI is recommended - do not exceed 300 DPI).

5. Optional: At this point, if you want to preview the hardcopy, Preview. You should see a reversed image, i.e. white background with dark objects, which is the desired case for hardcopy printouts. A prompt will appear asking if you want to reset the graphics window; Yes, i.e. do reset the graphics window (to return it to its original form with the black background).

6. Caution: Sometimes, and I don't know why, the graphical display does not return properly at this point. Sometimes even if you click on Display again from the Velocity Vectors window, it does not re-display properly. If this happens, close all the graphical windows and re-open. This usually corrects the problem.

7. Now Save. The default file name will be airfoil.ps, but that is too non-descriptive. Name the file "air_vector.ps" or something meaningful, and OK. Finally, Close the Graphics Hardcopy window.

8. Back in the Unix shell window (labeled winterm), Enter "lp -dinky filename.ps" where filename is the name you assigned to this vector plot in the above step. This should print out the file on the laser printer located in the SGI lab.

Examine the pressure and vorticity fields, and the streamlines:

1. In Fluent, Display-Contours. In Contours, the default Contours of is Pressure, so we will look at pressure contours first.

2. Increase Levels to 100 (the limit allowed by Fluent), and Display. Is the pressure lower on the top of the airfoil than on the bottom, as expected?

3. To examine vorticity contours, change Contours of to Velocity, and right below that, Vorticity Magnitude. Display.

4. Where is most of the vorticity in this flow? In light of this result, would the potential flow approximation be good for this problem? Why or why not?

5. To visualize streamlines in the flow, keep Contours of as Velocity, but right below that, Stream Function. Display.

Page 15: Modeling External Flow in Airfoil 2D

Calculate the lift and drag forces on the airfoil:

1. In Fluent, Report-Forces. In Force Reports window, airfoil is the default surface listed under Wall Zones. This is the entire airfoil surface, so the default is okay. You will need to enter the components of the force vector, however. These are simply the x and y components of a unit vector pointing in the direction of the desired force. For example, setting the x-component to 1 and the y-component to 0 would cause Fluent to calculate the force acting on the airfoil in the x-direction. If you set both the x and y components to 0.7071 (one half of the square root of two), this would give you the component of force in a direction parallel to 45 degrees. In our problem, we want lift force, which is defined as perpendicular to the freestream direction. Enter the appropriate x and y components so that the result is the lift force. Note that the calculated force will actually be in units of N/m since this is a 2-D problem (force per unit span).

2. To perform the calculation, Print. The results will be printed to the main Fluent window. You may need to widen that window to see the entire length of the line. Notice that the force is broken into a pressure component and a viscous component.

3. Write down the total lift force, from which the lift coefficient will be calculated.4. In a similar manner, calculate and record the total drag force on the airfoil. (Drag is defined

as parallel to the freestream velocity vector.)5. Now you may Close the Force Reports window.

Save your calculations and exit Fluent:

1. In Fluent, File-Write-Case & Data.2. Click OK to write the case and data files onto your directory. Yes, it is okay to overwrite.3. Exit Fluent by File-Exit. This will return you to the Unix shell.4. To logout completely from the computer, In the Global window on the upper left of the

screen, Desktop-Log Out, and Yes.