Problem Specification
Consider air flowing over NACA 4412 airfoil. The free-stream velocity is 50 m/s and the angle of attack is 2°. Assume standard sea-level values for the free-stream properties: Pressure = 101,325 Pa Density = 1.2250 kg/m3 Temperature = 288.16 K Kinematic viscosity v = v = 1.4607e-5 m2/s We will determine the lift and drag coefficients under these conditions using FLUENT. Step 1: Create Geometry in GAMBIT
This tutorial leads you through the steps for generating a mesh in GAMBIT for an airfoil geometry. This mesh can then be read into FLUENT for fluid flow simulation. In an external flow such as that over an airfoil, we have to define a far-field boundary and mesh the region between the airfoil geometry and the far-field boundary. It is a good idea to place the far-field boundary well away from the airfoil since we'll use the ambient conditions conditions to define the boundary boundary conditions at the far-field. far -field. The farther we are from the airfoil, the less effect it has on the flow and so more accurate is the far-field boundary condition.
The far-field boundary we'll use is the line ABCDEFA ABCDEFA in the figure above. c is c is the chord length. Start GAMBIT Create a new directory called airfoil and start GAMBIT from that directory by typing gambit -id airfoil at the command prompt. Under Main Under Main Menu, Menu , select Solver > FLUENT 5/6 since the mesh to be created is to be used in FLUENT 6.0. Import Edge To specify the airfoil geometry, we'll import a file containing a list of vertices along the surface and have GAMBIT join these vertices to create two edges, corresponding to the upper and lower surfaces of the airfoil. We'll then split these edges into 4 distinct edges to help us control the mesh size at the surface. The file containing the vertices for the airfoil can be downloaded here: naca4412.dat (right click and select Save As...) Let's take a look at the naca4412.dat file:
The first line of the file represents the number of points on each edge (61) and the number of edges (2). The first 61 set of vertices are connected to form the edge corresponding to the upper surface; the next 61 are connected to form the edge for the lower surface. The chord length, c for the geometry in naca4412.dat file is 1, so x varies between 0 and 1. If you are using a different airfoil geometry specification file, note the range of x values in the file and determine the chord length c . You will need this later on. Note: NACA series geometry can be found in many online website. One such website is: http://www.pagendarm.de/trapp/programming/java/profiles/NACA4.html Main Menu > File > Import > ICEM Input ... For For File File Name, Name, brows browse e and and selec selectt the naca4412.dat file. file. Select Select both both Vertice Vertices s and Edges Edges under under Geomet Geometry ry to Create: Create: since these these are the geometri geometric c entities entities we need need to create. Deselect Face. Click Accept.
Create Far-field Boundary Next, Next, we will will creat create e the the follo followin wing g far-f far-fiel ield d bound boundary ary.. This This pi pict ctur ure e of th the e fa farf rfie ield ld nomenclature will be handy. We will create the far-field boundary by creating vertices and joining them appropriately appropriately to form edges. Operation Operation Tool-pad Tool-pad > Geometry Geometry Command Button
> Vertex Command Button
> Create Vertex Create Create the followin following g vertices vertices by enterin entering g the coordina coordinates tes under Global Global and the label label under Label: Label x
y
z
A
c
12.5c
0
B
21c
12.5c
0
C
21c
0
0
D
21c
-12.5c 0
E
c
-12.5c 0
F
-11.5
0
0
G
c
0
0
Click the FIT TO WINDOW button to scale the display so that you can see all the vertices. The resulting image should look like this:
Now we can create the edges using the vertices created. Operation Operation Tool-pad Tool-pad > Geometry Command Button
> Edge Command Button
> Create Edge Create the edge AB by selecting the vertex A followed by vertex B. Enter AB for Label. Click Apply. GAMBIT will create the edge. You will see a message saying something like "Created edge: AB'' in the Transcript window. Transcript window. Similarly, create the edges BC, CD, DE, EG, GA and CG. Note that you might have to zoom in on the airfoil to select vertex G correctly or click on the to select the vertices from the list and move them to the picked list. The rest of the tutorial will use this method for vertices selection. Next we'll create the circular arc AF. Right-click on the Create Edge button and select Arc.
In the Create Real Circular Arc menu, the box next to Center will be yellow. That means that the vertex you select will be taken as the center of the arc. Select vertex G and click Apply. Now the box next to End Points will be highlighted in yellow. This means that you can now select the two vertices that form the end points of the arc. Select vertex A and then vertex F. Enter AF under Label. Click Apply. If you did this right, the arc AF will be created. created. If you look in the transcript window, you'll see a message saying that an edge has been created. Similarly, create an edge corresponding to arc EF.
Create Faces The edges we have created can be joined together to form faces. We will need to define three faces as shown in the image above. Two rectangular faces, rect1 and rect2 lie to the right of the airfoil. The third face, circ1 consists of the area outside of the airfoil but inside of the semi-circular boundary.
Operation Toolpad > Geometry Command Button
> Face Command Button
> Form Face This brings up the Create Face From Wireframe Wireframe menu. Recall that we had selected vertices in order to create edges. Similarly, we will select edges in order to form a face. To create the face rect1, select the edges AB, BC, CG, and GA. Enter rect1for the label and click Apply. GAMBIT will tell you that it has "Created face: rect1'' in the transcript window. Similarly, create the face rect2 by selecting ED, DC, CG and GE. To create the last face we will need to make make two seperate seperate faces, faces, one for the outer boundary and one for the airfoil and then subtract the airfoil from the boundary boundary . Create semi-circular face circ1 by selecting GA, AF, FE and EG and enter circ1 for the label. Create the face for the airfoil by selecting corresponding edges. Subtract the airfoil from circ1. Operati Operation on Tool-pad Tool-pad > Geometr Geometry y Comma Command nd Button Button
> Face Face Command Command Button Button
right right clic click k on the the Boo Boole lean an Ope Operat ration ions s Butto Button n and and selec selectt Subtr Subtract act The Face box will be highlighted yellow. Shift click to select circ1, the outer semi-circular boundar boundary. y. Then select select the lower box labeled labeled Subtract Subtract Faces Faces which which will allow you to select faces to subtract from our outer boundary. Select the airfoil face and click apply. Step 2: Mesh Geometry in GAMBIT Mesh Faces We'll mesh each of the 3 faces separately to get our final mesh. Before we mesh a face, we need to define the point distribution for each of the edges that form the face i.e. we first have to mesh the edges. We'll select the mesh stretching parameters and number of divisions for each edge based on three criteria: 1.
We'd like to cluster points near the airfoil since this is where the flow is modified the most; most; the the mesh mesh resolu resolutio tion n as we appro approach ach the the farfie farfield ld boun boundar daries ies can can become progressively coarser since the flow gradients approach zero.
2. Close Close to the surface surface,, we need the most resolut resolution ion near the leading leading and trailing trailing edges since these are critical areas with the steepest gradients. 3. We want transit transitions ions in mesh size size to be smooth; smooth; large, large, discontinu discontinuous ous changes changes in the mesh size significantly decrease the numerical accuracy. The edge mesh parameters we'll use for controlling controlling the stretching stretching are successive ratio, first length and last length. length. Each edge has a direction as indicated by the arrow in the
graphics window. The successive ratio R is R is the ratio of the length of any two successive divisions in the arrow direction as shown below. Go to the index of the GAMBIT User Guide Guide and look under under Edge>Me Edge>Meshin shing g for this figure figure and accomp accompanyi anying ng explana explanation tion.. This This help help page page also also expla explains ins what what the first and last lengths lengths are; are; make make sure sure you you understand what they are.
Operation Operation Tool-pad > Mesh Command Button
> Edge Command Button
>
Mesh Edges Select the edge GA. The edge will change color and an arrow and several circles will appear on the edge. This indicates that you are ready to mesh this edge. Make sure the arrow is pointing upwards. You can reverse the direction of the edge by clicking on the Reverse button in the Mesh Edges menu. Enter a ratio of 1.15. This means that each successive mesh division will be 1.15 times bigger in the direction of the arrow. Select Interval Interval Count under under Spacing Spacing.. Enter Enter 45 for Interval Interval Count. Click Apply. Apply. GAMBIT GAMBIT will create 45 intervals on this edge with a successive ratio of 1.15. For edges AB and CG, we'll set the First Length (i.e. the length of the division at the start of the edge) rather than the Successive Successive Ratio. Ratio. Repeat the same steps for edges BC, AB and CG with the following specifications: Arro Inter Succes Edg w val sive es Direc Cou Ratio tion nt GA Upwa and 1.15 rds BC
45
Interv Arrow First Edg al Directi Leng es Coun on th t
AB Left to0.02 and 60 Right c CG Note that later we'll select the length at the trailing edge to be 0.02 c so c so that the mesh length is continuous between IG and CG, and HG and CG. Now that the appropriate edge meshes have been specified, mesh the face rect1: Operation Operation Tool-pad > Mesh Command Button
> Face Command Button
>
Mesh Faces Select the face rect1. The face will change color. You can use the defaults of Quad (i.e. quadrilaterals) and Map. Click Apply. The meshed face should look as follows:
Next mesh face rect2 in a similar fashion. The following table shows the parameters to use for the different edges: Succ Inte Ed Arrow essiv rval ge Direct e Co s ion Ratio unt EG Down an ward 1.15 45 d s CD
Interv Arrow First Edge al Directi Leng s Coun on th t DE
Left to0.02 60 Right c
The resultant mesh should be symmetric about CG as shown in the figure below.
Split Edges Next, we will split the top and bottom edges of the airfoil into two edges so that we have better control of the mesh point distribution. Figure of the splitting edges is shown below.
We need to do this because a non-uniform grid spacing will be used for x<0.3c and x<0.3c and a uniform grid spacing for x>0.3c for x>0.3c . To split the top edge into HI and IG, select Operation Operation Tool-pad Tool-pad > Geometry Command Button
> Edge Command Button
> Split/Merge Edge Make sure Point is selected next to Split With in the Split Edge window.
Select the top edge of the airfoil by Shift-clicking on it. You should see something similar to the picture below:
We'll use the point at x =0.3c =0.3c on on the upper surface to split this edge into HI and IG. To do this, enter 0.3 for x: under Global. If your c is not equal to one, enter the value of 0.3*c 0.3*c instead instead of just 0.3.For instance, if c =4, =4, enter 1.2. From here on, whenever you're asked to enter (some factor)* c , calculate the appropriate value for your c and c and enter it. You should see that the white circle has moved to the correct location on the edge.
Click Apply. You will see a message saying ``Edge edge.1 was split, and edge edge.3 created'' in the Transcript window. Transcript window.
Note the yellow marker in place of the white circle, indicating the original edge has been split into two edges with the yellow marker as its dividing point. Repeat this procedure for the lower surface to split it into HJ and JG. Use the point at x =0.3c =0.3c on the lower surface to split this edge. Finally, let's mesh the face consisting of circ1 and the airfoil surface. For edges HI and HJ on the front part of the airfoil surface, use the following parameters to create edge meshes: Arro La Inte Ed w st rval ge Dire Le Co s ctio ngt unt n h Fro 0.0 HI m H 40 2c to I Fro 0.0 HJ m H 40 2c to J For edges IG and JG, we'll set the divisions to be uniform and equal to 0.02 c . Use Interval Size rather than Interval Count and Count and create the edge meshes: Arro Succes Inter Edg w sive val es Direc Ratio Size tion IG Left and to
1
0.02
JG Right
c
For edge AF, the number of divisions needs to be equal to the number of divisions on the line opposite to it, in this case, the upper surface of the airfoil(this is a subtle point; chew over it). To determine the number of divisions that GAMBIT has created on edge IG, select Operati Operation on Toolpad Toolpad > Mesh Command Command Button Button >Summarize Edge Mesh
> Edge Edge Command Command Button Button
Select edge IG and then Elements under Component Component and click Apply. This will give the total number of nodes (i.e. points) and elements (i.e. divisions) on the edge in the Transcript window. The number of divisions on edge IG is 36. (If you are using a different geometry, this number will be different; I'll refer to it as NIG). NIG). So the Interval Count for Count for edge AF is NHI +NIG= 40+36= 76. 76. Similarly, determine the number of divisions on edge JG. This comes out as 35 for the current geometry. So the Interval Count for Count for edge EF is 75. 75. Create the mesh for edges AF and EF with the following parameters: Arro Fir Inter Ed w st val ge Dire Le Cou s ctio ngt nt n h Fro 0.0 40+ AF m A 2c NIG to F Fro 40+ 0.0 EF m E NJ 2c to F G
Mesh the face. The resultant mesh is shown below.
Step 3: Specify Boundary Types in GAMBIT We'll label the boundary AFE as farfield1, farfield1, ABDE as farfield2 and the airfoil surface as airfoil . Recall that these will be the names that show up under boundary zones when the mesh is read into FLUENT. Group Edges We'll create groups of edges and then create boundary entities from these groups. First, we will group AF and EF together. Operation Tool-pad > Geometry Command Button > Group Command Button > Create Group Select Edges and enter farfield1 for Label, which is the name of the group. Select the edges AF and EF. Note that GAMBIT adds the edge to the list as it is selected in the GUI.
Click Apply. In the transcript window, you will see the message “Created group: farfield1 group”.
Similarly, Similarly, create the other two far-field groups. You should have created a total of three groups: Group Name
Edges in Group
farfield1
AF,EF
farfield2
AB,DE
farfield3
BC,CD
airfoil
HI,IG,HJ,JG (name might vary)
Define Boundary Types Now that we have grouped each of the edges into the desired groups, we can assign appropriate boundary types to these groups. Operation Tool-pad > Zones Command Button Under Entity, select Groups.
> Specify Boundary Types
Select any edge belonging to the airfoil surface and that will select the airfoil group. Next to Name:, enter airfoil. Leave the Type as WALL.
Click Apply. In the Transcript Window , you will see a message saying "Created Boundary entity: airfoil". Similar Similarly, ly, create create boundar boundary y entities entities corresp correspondi onding ng to farfield1, farfield1 , farfield2 and farfield3 groups. Set the Type to Pressure Far-field in each case. Save Your Work Main Menu > File > Save Export Mesh Main Menu > File > Export > Mesh...
Save the file as airfoil.msh. Make sure that the Export 2d Mesh option is selected. Check to make sure that the file is created. Step 4: Set Up Problem in FLUENT Launch FLUENT Start > Programs > Fluent Inc > FLUENT 6.3.26 Select 2ddp from the list of options and click Run. Import File Main Menu > File > Read > Case... Navigate to your working directory and select the airfoil.msh file. Click OK. The following should appear in the FLUENT window:
Check that the displayed information is consistent with our expectations of the airfoil grid. Analyze Grid Grid > Info > Size How many cells and nodes does the grid have? Display > Grid Note what the surfaces farfield1, farfield1, farfield2 , etc. correspond to by selecting and plotting them in turn. Zoom into the airfoil. Where are the nodes clustered? Why?
Define Properties Define > Models > Solver... Under the Solver box, select Pressure Based.
Click OK. Define > Models > Viscous Select In-viscid under In-viscid under Model.
Click OK. Define > Models > Energy The speed of sound sound under SSL conditions conditions is 340 m/s so that that our freestream freestream Mach numb number er is arou around nd 0.15 0.15.. This This is low low enou enough gh that that we'l we'lll assu assume me that that the the flow flow is incompressible. So the energy equation can be turned off.
Make sure there is no check in the box next to Energy Equation and click OK. Define > Materials Make sure air is selected under under Fluid Materials. Set Density to constant and equal to 3 1.225 kg/m .
Click Change/Create. Change/Create . Define > Operating Conditions We'll work in terms of gauge pressures in this example. So set Operating Pressure to the ambient value of 101,325 Pa.
Click OK. Define > Boundary Conditions Set farfield1 and farfield2 to farfield2 to the velocity-inlet boundary type. For each, click Set.... Then, choose Components under Velocity Specification Method and set the x- and and y-com y-compo ponen nents ts to that that for for the the freest freestre ream am.. For instanc instance, e, the the x-
component component is 50*cos(1.2)=49.99. 50*cos(1.2)=49.99. (Note that 1.2° is used as our angle of attack instead of 2° to adjust for the error caused by assuming the airfoil to be 2D instead of 3D.)
Click OK. Set farfield3 to pressure-outlet boundary type, click Set... and set the Gauge Pressure at this boundary to 0. Click OK. Step 5: Solve! Solve > Control > Solution Take a look at the options available. Under Under Discret Discretizat ization, ion, set Pressure Pressure to PRESTO PRESTO!! and Momentum Momentum to Second-O Second-Order rder Upwind.
Click OK. Solve > Initialize > Initialize... As you may recall from the previous tutorials, this is where we set the initial guess values (the base case) for the iterative solution. Once again, we'll set these values to be equal to those at the inlet (to review why we did this look back to the tutorial about CFG programs) . Select farfield1 under Compute From.
Click Init . Solve > Monitors > Residual... Now we will set the residual values (the criteria for a good enough solution). Once again, we'll set this value to 1e-06.
Click OK. Solve > Monitors > Force... Under Under Coeffici Coefficient, ent, choose Lift. Under Under Options, Options, select Print Print and Plot. Plot. Then, Then, Choose Choose airfoil under Wall Zones. Lastly, set the Force Vector components components for the lift. The lift is the force perpendicular perpendicular to the direction of the freestream. So to get the lift coefficient, set X to -sin(1.2°)=-020942 and Y to cos(1.2°)=0.9998.
Click Apply for these changes to take effect. Similarly, set the Force Monitor options for the Drag force. The drag is defined as the force force compon component ent in the direction direction of the freestream. freestream. So under under Force Vector, Vector, set X to cos(1.2°)=0.9998 and Y to sin(1.2°)=0.020942 Turn on only Print for it. Report > Reference Values Now, set the reference values to set the base cases for our iteration. Select farfield1 under Compute From.
Click OK. Note Note that that the the refer referenc ence e press pressure ure is zero, zero, indic indicati ating ng that that we are meas measuri uring ng gage gage pressure. Main Menu > File > Write > Case...
Save the case file before you start the iterations. Solve > Iterate Make note of your findings, make sure you include data such as; What does the convergence plot look like? How many iterations does it take to converge? How does the Lift coefficient compared with the experimental data? Main Menu > File > Write > Case & Data... Save case and data after you have obtained a converged solution. Step 6: Analyze Results Plot Velocity Vectors Let's see the velocity vectors along the airfoil. Display > Vectors Use the default setting by clicking Display.
As can be seen, the velocity of the upper airfoil is faster than the velocity on the lower airfoil.
On the leading edge, we see a stagnation point where the velocity of the flow is nearly zero. The fluid accelerates on the upper surface as can be seen from the change in colors of the vectors.
On the trailing edge, the flow on the upper surface decelerates and converge with the flow on the lower surface. Plot Pressure Coefficient Pressur Pressure e Coeffic Coefficien ientt is a dime dimens nsio ionl nles ess s para parame mete terr defi define ned d by the the equa equati tion on
where
is the static pressure, pressure,
is the reference pressure, pressure, and
is the refere reference nce dynam dynamic ic press pressure ure defin defined ed by . The The refere reference nce press pressure ure,, density, and velocity are defined in the Reference Values panel in Step 5. 5. Please refer to FLUENT's help for more information. Go to Help > User's Guide Index for help. Plot > XY Plot...
Change Change the Y Axis Function Function to Pressure Pressure..., ..., followed followed by Pressure Pressure Coefficien Coefficient. t. Then, Then, select airfoil under Surfaces.
Click Plot.
The negative part of the plot is upper surface of the airfoil as the pressure is lower than the reference pressure. Plot Pressure Contours Plot static pressure contours. Display > Contours... Select Pressure... Pressure... and Static Pressure Pressure from under Contours Of. Click Display. Check also the Filled and Draw Grid under Options menu.
From the figure, we see that in one grid, there is no more than 3 different pressure contours which suggests that our mesh is fine enough. How can we compare the pressure contour with velocity vector plot? We see that the pressure on the upper surface is negative while the velocity on the upper surface is higher than the reference velocity. Whenever there is high velocity vectors, we have low pressur pressures es and vise versa. versa. The phenomenon phenomenon that we see comply with the Bernoulli Bernoulli equation. Comparisons With our simulation data, we can now compare the Fluent with experimental data. The summary of result is shown in the table. CL
Cd
FLUENT Experiment Theory
-
0