Chapter 15. Tutorial 4: Re ning a Mesh

26
Chapter 15. Tutorial 4: Refining a Mesh Introduction: TGrid offers several tools to assist you in mesh refinement. There is no right or wrong way to refine a mesh, but the goal remains to improve the quality of the mesh with each mesh refinement operation. With that in mind, you are encouraged to experiment with some of the different mesh refinement options. Using a simple 3D geometry, this tutorial will demonstrate how to use some of TGrid’s mesh refinement tools to fix known deficiencies in an existing boundary mesh. In this tutorial, the mesh refinement will consist of the following steps: 1. Read the mesh file and display the boundary mesh. 2. Check for free and unused nodes. 3. Recreate the missing faces. 4. Learn how to use the rezoning feature. 5. Improve the boundary mesh. 6. Check the skewness of the boundary faces. 7. Refine the boundary mesh. 8. Further refine the boundary mesh. 9. Enable multiple zone meshing. 10. Check the quality of the entire volume mesh. 11. Check and save the volume mesh, and exit from TGrid. Prerequisites: This tutorial assumes that you have used TGrid before and are familiar with the layout of the graphical user interface. c Fluent Inc. January 7, 2004 15-1

Transcript of Chapter 15. Tutorial 4: Re ning a Mesh

Page 1: Chapter 15. Tutorial 4: Re ning a Mesh

Chapter 15. Tutorial 4: Refining a Mesh

Introduction: TGrid offers several tools to assist you in mesh refinement. There is noright or wrong way to refine a mesh, but the goal remains to improve the qualityof the mesh with each mesh refinement operation. With that in mind, you areencouraged to experiment with some of the different mesh refinement options.

Using a simple 3D geometry, this tutorial will demonstrate how to use some ofTGrid’s mesh refinement tools to fix known deficiencies in an existing boundarymesh.

In this tutorial, the mesh refinement will consist of the following steps:

1. Read the mesh file and display the boundary mesh.

2. Check for free and unused nodes.

3. Recreate the missing faces.

4. Learn how to use the rezoning feature.

5. Improve the boundary mesh.

6. Check the skewness of the boundary faces.

7. Refine the boundary mesh.

8. Further refine the boundary mesh.

9. Enable multiple zone meshing.

10. Check the quality of the entire volume mesh.

11. Check and save the volume mesh, and exit from TGrid.

Prerequisites: This tutorial assumes that you have used TGrid before and are familiarwith the layout of the graphical user interface.

c© Fluent Inc. January 7, 2004 15-1

Page 2: Chapter 15. Tutorial 4: Re ning a Mesh

Tutorial 4: Refining a Mesh

Preparation

1. Copy the file

path/Fluent.Inc/tgrid3.⇓x/tut/mesh-repair/problem-surf.msh

from the path directory where you installed TGrid to your working directory. Thevariable x corresponds to your release version, e.g., 6 if you have TGrid 3.6.

2. Start the 3D version of TGrid.

Step 1: Read and Display the Boundary Mesh

1. Read in the boundary mesh file (problem-surf.msh).

File −→ Read −→Boundary Mesh...

2. Display the boundary mesh (Figure 15.0.1).

Display −→Grid...

Z

Y

X

Restrictions: Mesh

TGrid 3.6 (3D)Nov 25, 2003

Figure 15.0.1: Boundary Mesh

15-2 c© Fluent Inc. January 7, 2004

Page 3: Chapter 15. Tutorial 4: Re ning a Mesh

Tutorial 4: Refining a Mesh

3. Display the boundary mesh with hidden lines removed.

Display −→Options...

(a) In the Display Options panel, select Hidden Line Removal under Rendering.

TGrid will display the mesh as shown in Figure 15.0.2.

Z

Y

X

Restrictions: Mesh

TGrid 3.6 (3D)Nov 25, 2003

Figure 15.0.2: Boundary Mesh with Hidden Lines Removed

c© Fluent Inc. January 7, 2004 15-3

Page 4: Chapter 15. Tutorial 4: Re ning a Mesh

Tutorial 4: Refining a Mesh

Step 2: Check for Free and Unused Nodes

After you read in the mesh file, check the boundary mesh for topological problems such asfree and multiple-connected nodes and faces.

Boundary −→Nodes...

1. Click on Count Free Nodes.

TGrid will report the number of free nodes in the Message box.

Note: If there are free nodes, the usual practice is to click Merge to remove them.Here, the free nodes are due to seven missing faces in the surface mesh. InStep 3, you will use TGrid mesh repair tools to recreate the missing faces asdescribed.

2. Click on Count Unused Nodes.

3. If there are unused nodes, click on Delete Unused to remove them.

15-4 c© Fluent Inc. January 7, 2004

Page 5: Chapter 15. Tutorial 4: Re ning a Mesh

Tutorial 4: Refining a Mesh

Step 3: Repair the Boundary Mesh

1. Recreate the missing faces.

Boundary −→Modify...

Note: To make the missing faces easier to see, turn on the Free option under Op-tions in the Faces tab of the Display Grid panel. This will cause the immediatelysurrounding faces to become shaded so that you can easily find those that aremissing.

(a) Zoom in on one of the missing faces as shown in Figure 15.0.3.

(b) Under Filter, select node.

(c) Using the right mouse button, select the three nodes that surround the missingface.

If a wrong node is selected, select it again with the right mouse button and thenode will be removed from the Selections list.

(d) When the correct nodes are selected, click Create under Operation.

TGrid will recreate the missing face.

c© Fluent Inc. January 7, 2004 15-5

Page 6: Chapter 15. Tutorial 4: Re ning a Mesh

Tutorial 4: Refining a Mesh

Restrictions: freeMesh

TGrid 3.6 (3D)Nov 25, 2003

Z

Y

X

Figure 15.0.3: Missing Boundary Face

2. Check if the new face is in the proper boundary zone.

(a) Under Filter, select zone.

(b) Using the right mouse button, click on the face just created.

TGrid will respond with the zone name as shown in Figure 15.0.4.

(c) If the face happens to be in wrong zone, click Rezone under Operation andmove the face to the proper zone (see step 4).

15-6 c© Fluent Inc. January 7, 2004

Page 7: Chapter 15. Tutorial 4: Re ning a Mesh

Tutorial 4: Refining a Mesh

Note: TGrid will place the face in the same zone as the majority of the nodesthat make up the face. If two out of the three nodes were in the symmetryzone, then the face just created would have been placed in the symmetryzone. In this example, the three nodes were in the wall2 zone, so the facewas placed in the wall2 zone also.

wall2

Z

Y

X

TGrid 3.6 (3D)Nov 25, 2003

Figure 15.0.4: Check Zone of New Face

3. Repeat steps 1 and 2 for the other missing faces.

4. Save an intermediate mesh file (temp.msh).

! It is not always possible to undo an operation. So it is recommended that yousave the mesh periodically when modifying the boundary mesh.

File −→ Write −→Mesh...

c© Fluent Inc. January 7, 2004 15-7

Page 8: Chapter 15. Tutorial 4: Re ning a Mesh

Tutorial 4: Refining a Mesh

Step 4: Using the Rezone Feature

This step will illustrate how to move a face from one zone to another using the Rezonefeature in the Modify Boundary panel. You will move one face from the wall2 boundary tothe symmetry boundary. When this step is successfully completed, move the selected faceback to the wall2 boundary using Rezone.

Boundary −→Modify...

1. Under Filter, select face.

2. Select the face to be rezoned using the right mouse button (see Figure 15.0.5).

TGrid 3.6 (3D)Nov 26, 2003

Z

Y

X

Figure 15.0.5: Face Selected to be Rezoned

3. Under Filter, select zone.

4. Using the right mouse button, click on the zone where you want to move the selectedface.

In this example, move the face from the wall2 zone to the symmetry zone. Afterselecting the zone to which you want to move the face, the Selections list in theModify Boundary panel should have a face identification number and the name ofthe zone to which you want to move it.

5. Under Operation, click Rezone.

TGrid will move the selected face to the symmetry zone (see Figure 15.0.6).

15-8 c© Fluent Inc. January 7, 2004

Page 9: Chapter 15. Tutorial 4: Re ning a Mesh

Tutorial 4: Refining a Mesh

symmetry

TGrid 3.6 (3D)Nov 25, 2003

Z

Y

X

Figure 15.0.6: Face Rezoned to Symmetry Boundary

Note: Since this step was designed to show you how to use the Rezone feature,move the selected face back to the wall2 zone using Rezone one more time.

c© Fluent Inc. January 7, 2004 15-9

Page 10: Chapter 15. Tutorial 4: Re ning a Mesh

Tutorial 4: Refining a Mesh

Step 5: Improve the Boundary Mesh

Boundary −→Faces...

1. Select all zones under Tri Boundary Zones.

2. Click Skew to check if the maximum face skewness is greater than 0.99.

3. Click Check to check for Delaunay violations in the boundary mesh.

4. Click Improve until TGrid reports zero faces improved.

5. Click Skew to check if the maximum face skewness has dropped below 0.9.

15-10 c© Fluent Inc. January 7, 2004

Page 11: Chapter 15. Tutorial 4: Re ning a Mesh

Tutorial 4: Refining a Mesh

Step 6: Check the Skewness Distribution of the Bound-ary Mesh

Display −→ Plot −→Face Distribution...

1. Select all zones under Boundary Zones.

2. Change Partitions from 100 to 10.

3. Click Plot.

TGrid will create the histogram plot shown in Figure 15.0.7.

Z

Y

X

Histogram of Face Quality, Equilateral Volume Deviation MethodTGrid 3.6 (3D)Nov 25, 2003

Quality

Faces

1.000.900.800.700.600.500.400.300.200.100.00

7000.00

6000.00

5000.00

4000.00

3000.00

2000.00

1000.00

0.00

Figure 15.0.7: Histogram Plot of Face Skewness

4. Click on Print.

TGrid will print the histogram information by decades to the text window. Noticethat there are zero faces with a skewness greater than 0.9, four faces with a skewnessgreater than 0.8, two faces with a skewness greater than 0.7, and 11 faces with askewness greater than 0.6.

Extra: The unofficial goal of this tutorial is to get the maximum face skewness below0.6. This tutorial will expose you to some of the mesh repair tools and then leaveit up to you to try and get the maximum face skewness below 0.6.

c© Fluent Inc. January 7, 2004 15-11

Page 12: Chapter 15. Tutorial 4: Re ning a Mesh

Tutorial 4: Refining a Mesh

Step 7: Refine the Boundary Mesh (Part 1)

This step will illustrate how to refine the mesh by merging and smoothing nodes, swappingand splitting edges, and splitting faces.

1. Modify the mesh by merging nodes.

This step will illustrate how to modify a mesh by merging the nodes.

Boundary −→Modify...

(a) Click Skew in the Modify Boundary panel.

TGrid will zoom in on the face with the greatest skewness (see Figure 15.0.8).To repair this face, merge the highlighted node with the corner node.

Note: When merging nodes, the first node selected is the one that remains.Clear the Selections panel and reselect the nodes so that the corner nodeis the first node selected. First select the corner node, and then selectthe neighboring node. Merge the two nodes together. The corner node willremain since it was selected first. The procedure to complete this operationis outlined in the following steps.

(b) Under Operation, click Clear.

(c) Under Filter, select node.

(d) Select the corner node where the symmetry zone meets with the inlet zone andthe wall2 zone.

(e) Select the neighboring node that was highlighted before the Selections panelwas cleared.

(f) Under Operation, click Merge.

TGrid will merge the selected nodes together as shown in Figure 15.0.9.

15-12 c© Fluent Inc. January 7, 2004

Page 13: Chapter 15. Tutorial 4: Re ning a Mesh

Tutorial 4: Refining a Mesh

MeshTGrid 3.6 (3D)Nov 25, 2003

Z

YX

Figure 15.0.8: Face With the Greatest Skewness

Z

YX

MeshTGrid 3.6 (3D)Nov 25, 2003

Figure 15.0.9: Modified Surface Mesh

c© Fluent Inc. January 7, 2004 15-13

Page 14: Chapter 15. Tutorial 4: Re ning a Mesh

Tutorial 4: Refining a Mesh

2. Move to next highly skewed face.

(a) Click Skew in the Modify Boundary panel.

TGrid will zoom in on the next face with the greatest skewness (see Fig-ure 15.0.10). The face highlighted is the face on the opposite corner of theinlet boundary. This face can be modified following the node merging procedureoutlined in the previous step.

MeshTGrid 3.6 (3D)Nov 25, 2003

Z

YX

Figure 15.0.10: Next Face with the Greatest Skewness

(b) Clear the Selections list.

(c) Under Filter, select node.

(d) Select the corner node first and then the neighboring node that was originallyhighlighted by TGrid.

(e) Merge the selected nodes.

The modified mesh that results after merging the nodes is shown in Figure 15.0.11.

Note: The next two faces that are selected when clicking on Skew can bemodified using the node merging operation that was outlined for the firsttwo faces. The steps to complete these operations are left to the user.

3. Modify the mesh by smoothing nodes.

(a) Click on Skew.

TGrid selects a face that is located in the middle of one of the internal walls(see Figure 15.0.12).

15-14 c© Fluent Inc. January 7, 2004

Page 15: Chapter 15. Tutorial 4: Re ning a Mesh

Tutorial 4: Refining a Mesh

Z

YX

MeshTGrid 3.6 (3D)Nov 25, 2003

Figure 15.0.11: Modified Surface Mesh

Z

Y

X

MeshTGrid 3.6 (3D)Nov 25, 2003

Figure 15.0.12: Face that can be Modified with Node Smoothing

c© Fluent Inc. January 7, 2004 15-15

Page 16: Chapter 15. Tutorial 4: Re ning a Mesh

Tutorial 4: Refining a Mesh

(b) Under Filter, select node.

(c) Select several of the nodes surrounding the node highlighted by TGrid.

(d) Click Smooth under Operation.

TGrid will use a node smoothing technique to make the surrounding cells asuniform in size as possible (see Figure 15.0.13).

Z

Y

X

MeshTGrid 3.6 (3D)Nov 25, 2003

Figure 15.0.13: Modified Surface Mesh

Note: At this point we will attempt to demonstrate some of the additional facemodification tools that are available in TGrid using the cluster of cells shownin Figure 15.0.13.

4. Modify the mesh by edge swapping.

(a) Under Filter, select edge.

(b) Select the edges shown in Figure 15.0.14.

(c) Under Operation, click Swap.

TGrid will swap the selected edges and retriangulate the mesh as shown inFigure 15.0.15. You can see from Figure 15.0.15 that this operation did littleto produce a better quality mesh. You can do a little node smoothing and fixthis problem.

(d) Under Filter, select node.

(e) Select the nodes shown in Figure 15.0.16.

15-16 c© Fluent Inc. January 7, 2004

Page 17: Chapter 15. Tutorial 4: Re ning a Mesh

Tutorial 4: Refining a Mesh

Z

Y

X

MeshTGrid 3.6 (3D)Nov 25, 2003

Figure 15.0.14: Edges Selected for Swapping

Z

Y

X

MeshTGrid 3.6 (3D)Nov 25, 2003

Figure 15.0.15: Mesh After Edge Swapping

c© Fluent Inc. January 7, 2004 15-17

Page 18: Chapter 15. Tutorial 4: Re ning a Mesh

Tutorial 4: Refining a Mesh

Z

Y

X

MeshTGrid 3.6 (3D)Nov 25, 2003

Figure 15.0.16: Nodes Selected for Smoothing

Z

Y

X

MeshTGrid 3.6 (3D)Nov 25, 2003

Figure 15.0.17: Mesh After Node Smoothing

15-18 c© Fluent Inc. January 7, 2004

Page 19: Chapter 15. Tutorial 4: Re ning a Mesh

Tutorial 4: Refining a Mesh

(f) Click Smooth under Operation.

TGrid will adjust the nodes as shown in Figure 15.0.17.

5. Modify the mesh by splitting edges.

(a) Under Filter, select edge.

(b) Select the edge shown in Figure 15.0.18.

Z

Y

X

MeshTGrid 3.6 (3D)Nov 25, 2003

Figure 15.0.18: Edge Selected for Splitting

(c) Click Split under Operation to split (Figure 15.0.19).

(d) Apply a little node smoothing by selecting some of the nodes around the splitedge and clicking Smooth (Figure 15.0.20).

6. Modify the mesh by splitting faces.

(a) Under Filter, select face.

(b) Select the face shown in Figure 15.0.21.

(c) Click Split under Operation to split the face (Figure 15.0.22).

(d) Swap the edges of the split face (Figure 15.0.23).

(e) Smooth the nodes in the vicinity of the split face (Figure 15.0.24).

c© Fluent Inc. January 7, 2004 15-19

Page 20: Chapter 15. Tutorial 4: Re ning a Mesh

Tutorial 4: Refining a Mesh

Z

Y

X

MeshTGrid 3.6 (3D)Nov 25, 2003

Figure 15.0.19: Split Edge

Z

Y

X

MeshTGrid 3.6 (3D)Nov 25, 2003

Figure 15.0.20: Effect of Node Smoothing After Splitting the Edge

15-20 c© Fluent Inc. January 7, 2004

Page 21: Chapter 15. Tutorial 4: Re ning a Mesh

Tutorial 4: Refining a Mesh

Z

Y

X

MeshTGrid 3.6 (3D)Nov 25, 2003

Figure 15.0.21: Face Selected for Splitting

Z

Y

X

MeshTGrid 3.6 (3D)Nov 25, 2003

Figure 15.0.22: Split Face

c© Fluent Inc. January 7, 2004 15-21

Page 22: Chapter 15. Tutorial 4: Re ning a Mesh

Tutorial 4: Refining a Mesh

Z

Y

X

MeshTGrid 3.6 (3D)Nov 25, 2003

Figure 15.0.23: Effect of Edge Swapping

Z

Y

X

MeshTGrid 3.6 (3D)Nov 25, 2003

Figure 15.0.24: Effect of Node Smoothing

15-22 c© Fluent Inc. January 7, 2004

Page 23: Chapter 15. Tutorial 4: Re ning a Mesh

Tutorial 4: Refining a Mesh

Step 8: Refine the Boundary Mesh (Part 2)

Note: The maximum face skewness at this point in the mesh refinement process is lessthan 0.65. There are nine faces with a skewness greater than 0.6. This informationwas obtained from the Face Distribution window. Using the face modification toolsin the steps above, try and reduce the maximum face skewness to a value less than0.6.

1. Check the maximum face skewness.

Report −→Face Limits...

2. Select all the zones under Face Zones.

3. Under Options, select Quality.

4. Click Compute.

TGrid will report the Minimum, Maximum, and Average face skewness.

c© Fluent Inc. January 7, 2004 15-23

Page 24: Chapter 15. Tutorial 4: Re ning a Mesh

Tutorial 4: Refining a Mesh

Step 9: Enable the Meshing of Multiple Zones

Note: Since there are multiple regions in this mesh (four to be specific), you will haveto change the non-fluid type declaration to fluid in the Init/Mesh Controls window.After completing that step, you will generate the volume mesh.

1. Change the Non-Fluid Type from dead to fluid.

Mesh −→ Tri/Tet −→ Controls −→Init/Mesh...

(a) Select fluid in the Non-Fluid Type drop-down list.

(b) Click OK.

Note: By default, TGrid automatically makes the cell zone with the largestvolume the active fluid zone. TGrid treats the rest of the cell zones (non-fluid zones) as dead zones and will not refine them. If you want to meshmultiple zones, change the Non-Fluid Type to solid or fluid depending onthe problem.

When Non-Fluid Type is set to some value other than dead, TGrid will treatall zones as active zones and automatically refine these zones.

If your mesh has only one zone, this step is not necessary.

2. Generate the volume mesh.

Mesh −→ Auto Mesh −→Init & Refine...

15-24 c© Fluent Inc. January 7, 2004

Page 25: Chapter 15. Tutorial 4: Re ning a Mesh

Tutorial 4: Refining a Mesh

Step 10: Check the Volume Mesh

Report −→Cell Limits...

1. Select all zones under Cell Zones.

2. Click Compute to report the Maximum, Minimum, and Average cell skewness value.

3. Close the Report Cell Limits panel.

c© Fluent Inc. January 7, 2004 15-25

Page 26: Chapter 15. Tutorial 4: Re ning a Mesh

Tutorial 4: Refining a Mesh

Step 11: Check and Save the Volume Mesh

1. Check the mesh.

Before saving the mesh file, check it to be sure it has no negative cell volumes orleft-handed faces.

Mesh −→Check...

The printed results of the check show no problems, so the mesh is valid for use inthe solver.

2. Save the mesh.

File −→ Write −→Mesh...

3. Exit from TGrid.

File −→Exit...

15-26 c© Fluent Inc. January 7, 2004