In this tutorial we will learn how to generate a viscous unstructured grid for a NACA0016 airfoil using Gambit.
Open the Gambit GUI by clicking the Gambit icon in Windows or by typing gambit at the Linux prompt.
Step 1. Importing:
1. Change the default tolerance by going to Edit/Defaults/GEOMETRY/TOLERANCE. Change the EDGE_FACET value from 0.001 to 1.0e-08. This helps to build more accurate geometries.
Fig 2, Curves using NURBS |
Step 2. Creating the geometric domain:
1. Gambit is a single precision grid generator, so when we are having a boundary layer with first spacing as small as 1.0e-05 to 1.0e-07 we end up having distorted cells in the boundary layer. To avoid this, scale up the geometry by 1000 times or in other words use a geometry which is in millimeters.
Fig 3, Domain |
3. Create a surface out of the 3 curves representing the airfoil. Go to FACE/Create Face From Wireframe. Pick the 3 airfoil edges in Edges tab and press Apply.
4. Create a circular surface with a radius of 20 chord by going to FACE COMMAND BUTTON/CREATE FACE, right click and choose Create Real Circular Face. In the Radius tab put 20,000 and press Apply.
Fig 4, Airfoil after boolean operation |
Step 3. Meshing the airfoil edges:
2. Two sizing functions will be used to mesh the airfoil. One to capture the curvature of the airfoil and the other to put finer points at the trailing edge. Go to TOOL COMMAND BUTTON/Create Size Function.
3. Sizing function 1: Choose Curvature in Type, for Sources and Attachment pick all the edges of the airfoil. Input the following parameters. Angle = 3, Growth rate = 1.125, Max. size = 13, Min. size = 0.01. Press Apply.
4. Sizing function 2: Choose Fixed in Type. For Source pick the trailing edge vertex and for Attachment pick the edges of the airfoil. Input the following parameters. Start size = 0.5, Growth rate = 1.125, Max. size = 13. Press Apply.
Fig 5, Edge meshing |
5. Now to mesh the airfoil go to MESH COMMAND BUTTON/Mesh Edges. Pick all the 3 airfoil edges and press Apply. Edge mesh as shown in figure 5 is generated.
Step 4. Applying boundary layer padding:
1. To resolve the boundary layer around the airfoil a viscous padding is created using the boundary layer template.
3. Go to MESH COMMAND BUTTON/BOUNDARY LAYER COMMAND BUTTON/Create Boundary Layer. Pick the option of Aspect ratio (last) under Algorithm. Make the following inputs for, First row (a) = 1.0e-02, Rows = 26, Last percent (c/w) = 50. We need a first spacing of 1.0e-05 meters to resolve the boundary layer properly. Since we have already scaled the geometry by 1000 times, the input we will be making under First row (a) will be 1.0e-02.
Fig 6, Boundary layer template |
4. To properly resolve the trailing edge, the option of Wedge corner shape is activated. Pick all the 3 edges forming the airfoil. Press Apply. A white boundary layer template as seen in figure 6 is created.
Step 5. Creating the unstructured grid with boundary layer:
Finally to generate the unstructured hybrid grid we will make use of two more sizing functions.
Fig 7, Mesh around airfoil |
Fig 8, Mesh for complete domain |
Go to TOOLS COMMAND BUTTON /SIZING-FUNCTION COMMAND BUTTON/Create Sizing Function.
1. Sizing function 3: Pick Meshed under Type, pick all the 3 edges of the airfoil as Source and domain surface as Attachment. Let the Growth rate = 1.125 and Max.size = 20000.
2. Sizing function 4: Let Type be Fixed. Pick the trailing edge vertex as Source and the domain surface as Attachment. Input the following parameters, Start size = 0.01, Growth rate = 1.125, Max. size = 20000.
3. Now to mesh the domain go to MESH COMMAND BUTTON/FACE COMMAND BUTTON/Mesh Faces. Pick the domain surface, let Elements be Tri and Type be Pave. Press Apply. A hybrid grid as seen in figures 7, 8, 9 and 10 is generated.
Fig 9, Mesh around leading edge |
Step 6. Quality check :
To check the quality of the cells in the grid pick the right bottom icon under Global Control called EXAMINE MESH.
Fig 11, Skewed cells at trailing edge |
Fig 12, Node movement |
Fig 13, Problem rectified |
2. The color the cells in the grid changes with the skewness quality level. To check the worst cell, activate the button Show worst element. Under Transcript a message saying that the worst element quality value is 0.95. This needs to be corrected.
3. To make corrections, come out of Examine Mesh and go to Move Face Nodes under face meshing options. Here pick the domain face in Face and pick the node which is making the 2 cells skewed and physically move to the proper location. Make sure that the button of Smooth is active. This will rectify the problem.
Step 7. Applying boundary conditions and exporting the mesh :
1. As a last step before exporting the mesh we will apply boundary conditions. Go to ZONE COMMAND BUTTON/Specify Boundary Types.
2. Pick the edges forming the airfoil and Name it as airfoil. Apply Type as WALL.
3. Pick the outer edge and Name it as farfield and apply PRESSURE_FAR_FIELD under Type. Press Apply.
4. Now go to CONTINUUM TYPE COMMAND BUTTON in ZONE. Here pick the domain surface, Name it as fluid and apply FLUID as Type.
This completes applying boundary conditions. To export go to File/Export/Mesh/ and type out the name as naca0016.msh. Make sure to activate the button of Export 2-D(X-Y) Mesh. If all the steps are done properly one will get the message "Mesh was successfully written to naca0016.msh" under Transcript.
This completes the tutorial on viscous grid for Naca0016 airfoil using Gambit.
in Figure4 how to point the exact coordinate for lower and upper surface? or you just point it there?
ReplyDeleteThank you.
Interesting stuff. There are probably more DIY types like me out here doing 3D case setups with Engrid, Blender -> OF and there is a complete dearth of tutorials for that combo with one exception, so an opportunity to score a lot of blog hits if that is of interest. Regards,
ReplyDeletethanks dude...Can u post about generating grid for 3D airfoil / wing
ReplyDeletei want to generate mesh for diamond shape airfoil can any body help,
ReplyDeletechirag.palan1987@gmail.com
Dear sir
ReplyDeleteCould you send me the generated mesh of 3D wing?
sina.yaghubi@gmail.com
Thanks a lot!
Thank You and I have a neat proposal: How Much Renovate House house renos
ReplyDelete