You are on page 1of 7

Exercise 4 Using Size Functions and Boundary Layers

Introduction This tutorial provides a brief introduction to the use of size functions and boundary layers to control mesh size and quality. Example 1 Using Size Functions This exercise is designed to introduce you to the application of size functions. 1. Create a 101010 brick centered about the origin. 2. Create a Fixed type size function using the Create Size Function form about one of the vertices. Attach the size function to the brick volume. For this size function, use a Start Size of 0.2, Growth Rate of 1.2, and Size Limit of 1. 3. Create a second Fixed type size function using a face as the source. Choose a face that is opposite the vertex used in the first size function (i.e. the face should not contain the vertex). Attach this size function to the brick volume. For this size function, use a Start Size of 0.5, Growth Rate of 1.2, and Size Limit of 2. 4. Use the View Size Function tool to visualize the scope of the size functions. This function allows you to view the scope of only one size function at a time. You may choose the size function by selecting the defining source entity with the mouse. You must click the Initialize button in order to view the size function.

5. Mesh the volume with tetrahedral elements. You will need to change the Element type to Tet/Hybrid. Specify a spacing defined by Interval Size of 1.0. Note the warning in the transcript window. The spacing size is not used unless the Ignore Size Functions option is enabled in the meshing form.

6. Use the Examine Mesh form to view the mesh and how it is impacted by the size function. This is best seen by viewing the mesh in a plane that contains the vertex source and spans across the volume to the face source. Note that the maximum cell size in the mesh is governed by the smaller of the two size limits employed. Also note that had any of the edges or faces of the volume been premeshed before the size function is applied, these meshes will not be altered by the size function.

Example 2. Blower Meshing with Size Functions This exercise applies a curvature size function to the blower geometry you created and meshed in Tutorials 2 and 3, respectively. It was observed that the mesh at the leading edges of the blades does not adequately represent the geometry, and thus needs further refinement. Here we will attach a curvature size function to the curved leading edges and remesh the geometry. 1. Open up the database file that contains the blower geometry and mesh and delete the face meshes. 2. Attach a curvature size function to the annular face containing the blades. Use the curved leading edges of the blades as the Source entities and the annular face containing the blades as the Attachment entity. Use the following parameters for the curvature size function: Angle = 20, Growth Rate = 1.2, Max. Size = 2. Retain the default Min. Size = 0.001. 3. Mesh the annular bladed face using the Tri Pave Scheme. In the transcript window note the messages that GAMBIT gives you, as well as number of elements required to mesh the face.

4. Mesh the remaining faces using the Quad Pave scheme with a size of 2. 5. Zoom in and observe the finer mesh created at the leading blade edges and the grading of the mesh away from the leading blade edges.

6. Save and close the database file. Example 3. Using 3D Boundary Layers This example demonstrates how to create a simple 3D boundary layer in a duct. 1. Create a 2042 brick that is directed along the + X + Y + Z axes. We will assume that the face that lies in the xy plane will be a symmetry plane and that the inlet will be at x = 0 and the outlet will be at x = 20 . The three remaining faces represent the walls of the duct. 2. In the Attachment section of the Create Boundary Layer form, choose Faces for the entity type. Select the three faces that represent the duct walls. Set the following parameters for the Uniform algorithm: First Row = 0.1, Growth Factor = 1.2, and Rows = 4. The temporary boundary layer should appear in orange. Compare the appearance of the boundary layer both with and without the Internal Continuity option enabled. Apply the boundary layer without the Internal Continuity option.

3. Mesh the volume using the Map scheme and a spacing defined by Interval Size of 0.3. The result is shown below.

4. Remesh the volume with tetrahedral elements using the same spacing. Note in this case that the TGrid algorithm can produce hexahedral elements. Also note that the cell size was chosen such that the variation in cell size from the boundary layer to the tetrahedral elements was not significant. It is important not to allow a large jump in cell size in this area. You can use the Examine Mesh form to isolate the display of the individual element types (hex, tets, and pyramids).

5. Use the Modify Boundary Layer form to enable the Internal Continuity option. 6. Remesh once with tetrahedral elements and once with the Map scheme using the same spacing. You can use the Examine Mesh form to isolate the display of the individual element types (prisms and tets).

Example 4. Flow Probe Meshing with Size Functions and Boundary Layers This exercise applies a size function to the flow probe geometry created in the first tutorial. In this exercise, you will create two size functions and then mesh the geometry with a tetrahedral mesh. 1. Open the database file that contains the flow probe geometry. You should have two volumes, one representing the probe core and the second volume representing the

remainder of the fluid region. If you were unable to achieve this or if you have altered the geometry, you can use a database file stored locally on your computer. Consult your instructor to retrieve this file. 2. Both size functions will be of the type Fixed. The first size function will allow for a finer mesh around the flow probe support and housing. Use the set of faces that defines the probe support, the probe housing exterior, and the inlet and outlet faces of the probe core (not the inlet and outlet of the pipe) for the Source entities. Attach it to the main fluid volume. Use the following parameters: Start size = 0.3, Growth Rate = 1.2, Size Limit = 2.0. 3. Use the pipe wall as the Source entity for the second size function. Do not include the pipe inlet and outlet faces. This size function will also be attached to the main fluid volume. Use the following parameters: Start size = 0.4, Growth rate = 1.2, Size Limit = 2.0. 4. Mesh the main fluid volume with tetrahedral elements. This may take a few minutes to complete. Note that the spacing information will not matter unless the Ignore Size Functions option is enabled. 5. Mesh the probe core volume with tetrahedral elements. Since this volume does not have a size function defined, the spacing definition is important. Choose a spacing defined by Interval Size of 0.3 to remain consistent with the mesh on the faces of the probe core. 6. View the mesh using the Examine Mesh form in the z = 0 plane and note the distribution and size of the cells. Note that it would have been preferable to generate boundary layers along all walls to force prism elements in addition to using size functions. Now, we will create a 3D boundary layer and remesh the main fluid volume. 7. Delete the mesh in the main fluid volume. 8. Attach a boundary layer to the set of faces, which were the Source entities for the first size function. Use the following parameters for the boundary layer: Uniform algorithm, First Row = 0.1, Growth Factor = 1.2, and Rows = 4. Turn on the Internal Continuity toggle. In the Attachment section of the Create Boundary Layer form, choose Faces for the entity type. Select the faces defining the probe support, the probe housing exterior, and the inlet and outlet faces of the probe core. 9. Remesh the main fluid volume with tetrahedral elements. You will observe that the size function regenerates the background grid. Read the GAMBIT report for the background grid generation in the transcript window. 10. View the mesh using Examine Mesh form with the Range option. Select Prisms, the last option in 3D Elements, and observe the prism layers enveloping the probe housing. Turn on Show Worst Element and note the shape and skewness of the worst prism element.

11. Select Tetrahedrons and observe the grading and the interface at the prism layers. You can unselect Prisms, and using Show Worst Element, determine the location and shape of the worst tetrahedral element. You can also sweep planes for a detailed look at the hybrid unstructured mesh generated here. The boundary layer prisms are used to resolve important fluid flow phenomena at the probe walls, while the unstructured tetrahedral mesh is grown away from the walls using the size functions. Example 5. Hexahedral Meshing the Flow Probe In this tutorial, you are asked to generate a hexahedral mesh in the flow probe geometry with minimal guidance. It should be recognized that the geometry is sufficiently complex to require some volume decomposition. Additional decomposition may be required to improve the quality of the mesh; however, before concerning yourself with a high quality mesh, you need to first arrive at an approach to generate an initial mesh. In the time allotted, you are not expected to generate a complete, high quality hex mesh. The intent of this tutorial is to exercise the meshing theories and tools on a practical problem. There is no single correct way to mesh a model. For complex geometries, it is often helpful to isolate the regions of complicated geometry from other simpler regions. By splitting the upstream and downstream regions from the main geometry, you can reduce the problem to that of meshing the fluid region around the probe housing and support. This fluid region can be meshed with hex elements using the Cooper scheme if you recognize that one possible Cooper direction is the radial direction. You may need to generate one or more side faces before GAMBIT recognizes that the volume is Cooperable. Later, you may need to generate additional side faces to improve upon the mesh quality.

If you are able to mesh the entire geometry with hex elements, then you should review your procedure and focus on mesh quality. Mesh quality can potentially be improved by using additional boundary faces (e.g. side faces for the Cooper scheme), grading edge meshes, size functions, and boundary layers. The latter three methods directly affect cell size distribution. Be aware that if not used carefully, these methods can easily backfire and create even more highly skewed elements. You also need to moderate the variations in cell size from one cell to the next.

You might also like