Workshop 1: Basic Skills 14.5 Release Introduction to ANSYS Fluent Meshing © 2011 ANSYS, Inc. December 21, 2012 1 Release 14.0 I Introduction Workshop Description: This workshop shows some of the clean up tools in Tgrid for boundary meshes. Learning Aims: You are going to use the tools to clean up the given surface mesh and generate a volume mesh. This workshop will cover how to – Create and display groups – Visualize problem areas – Use global and local tools for cleaning up the mesh – Using text commands – Checking quality of mesh – Improving quality using global and local tools – Using hot keys – Troubleshooting techniques – Generating mesh and improving its quality – Setting zones and boundary conditions © 2011 ANSYS, Inc. December 21, 2012 2 Release 14.0 Starting ANSYS Fluent in Meshing Mode – Open the Fluent Launcher by clicking the Windows Start menu, then selecting Fluent. 14.5 in the Fluid Dynamics sub-menu of the ANSYS 14.5 program group. – Enable Meshing Mode under Options. – Set Working Directory to the area where files are – Click OK to start Fluent in meshing mode. © 2011 ANSYS, Inc. December 21, 2012 3 Release 14.0 Read and display the mesh File Read Mesh... • Select the mesh file WS1_asmoNS-for-repair.msh.gz and click Open. • Display the mesh Display Grid... opens the Display Grid panel In the Faces tab, select all the items under Face Zones using the Boundary filter and click Display. As you rotate the geometry you can see the edges of the model as wireframe rotation is activated. It is a car in a wind tunnel. © 2011 ANSYS, Inc. December 21, 2012 4 Release 14.0 Displaying Different Zones In the Face Zones list all the car zones have the prefix car-* and all the wind tunnel zones have the prefix wt-*. This will help to switch the visibility on and off between the two areas. So you can select all the car-* zones and display the car . Or you can select all the wt-* zones to display only the wind tunnel. © 2011 ANSYS, Inc. December 21, 2012 5 Release 14.0 Creating and Displaying Groups To make things easier you can create two groups, one for car Face Zones and another for wind tunnel Face Zones • You can use the Selection Helper... option under Display menu to aid selection of multiple boundaries Display Selection Helper... • Enter the wild card option car* or wt* for Zone Name Pattern and click Select to select all the zones with that prefix. • Use the Groups... key inside the Create group box. • Click Groups.... – Use the Zone Selection Helper to select all the zones starting with car-* in the list under Face Zones in the User Defined Groups dialog box and click Create. – Enter _car for Name in the Group Name dialog box and click OK. – Similarly create a group _wt for the wind tunnel zones. © 2011 ANSYS, Inc. December 21, 2012 6 Release 14.0 Visualization of Problem Areas You are going to use the visualization tools inside Fluent meshing to see where the issues are with the surface mesh. • Enable Free under Options and display all the zones through the Display Grid dialog box. The zones marked in blue are the free faces which you have to fix. • Disable All from the Options list to easily check for the problem areas. There are various global and local tools inside Fluent Meshing which can be used to fix such connectivity issues. © 2011 ANSYS, Inc. December 21, 2012 7 Release 14.0 Merge Nodes Open Boundary Merge Nodes... This option will merge the nodes within a specific tolerance. • Enable the option of Percent of shortest connected edge length (recommended for CFD quality surface meshes) • Retain the default value of 10% • Click Merge. • The Message displays the number of boundary nodes and faces merged. • Click Display in the Display Grid dialog box to redisplay the free nodes. You can observe that the number of free nodes has reduced considerably. All the ones on the wind tunnel boundary are fixed. © 2011 ANSYS, Inc. December 21, 2012 8 Release 14.0 Merge Nodes with Increased Tolerance If you zoom in you can observe that some of the nodes with bigger tolerance difference will not be affected. They require more than 10 % tolerance to be merged. You will increase the tolerance in steps of 10 till you reach 50 % and observe the change. • Select all the Boundary Face Zones in the Compare... group box and increase Tolerance by 10. • Merge and redisplay. • Ensure all boundaries are selected in each list • Repeat for 20%, 30%, 40% and 50% Write the mesh File Write Mesh nodesmerged.msh.gz Each step improves the connectivity of the mesh, reducing the number of free faces. © 2011 ANSYS, Inc. December 21, 2012 9 Release 14.0 Faceted Stitch Nodal mismatches can be too big for Node Merge to deal with. You can instead use a global tool of Faceted stitch for large tolerance node merging. We advise saving the mesh before this is used as it can destroy geometry if used incorrectly. Always Merge Nodes first. Boundary Mesh Faceted Stitch • In the Faceted Stitch dialog box select all the zones under Tri Boundary Zones. • Enter a low value for the Tolerance = 0.01. • Click Stitch. • Observe that this fixes most of the free faces. • We will now fix the remaining issues with local, manual methods. © 2011 ANSYS, Inc. December 21, 2012 Faceted Stitch Write the mesh File Write Mesh stitched.msh.gz 10 Release 14.0 Clean Up “Multi” Connected Faces • In Display Grid deselect All Face Zones and check only Multi for options • Hit Display • Use ctrl-a hotkey to autoscale the view • Switch to Face Filter by using hotkey ctrl-f and select face as shown which will populate “Selection” in the Bounds tool • Select delta of 150 and click Set Ranges. Note this is linked to Bounds in Display Grid. • Click Display in Display Grid • The “hanging” face seen is not required. Select it and ctrl-a to autoscale with ctrl-f and then Ctrl-w deletes or you can use © 2011 ANSYS, Inc. December 21, 2012 Release 14.0 11 Boundary Modify to select the face and Delete Fixing Final Free Faces • In Display Grid select all boundaries, check Free and Display • There are a number of Free faces and some groups stand out as being indicative of holes – see red rings • We will zoom on each of these holes to close them • Remember, middle mouse click centres the view on a point and then you can rotate or zoom on that point easily • Read the next two slides to see how this can be done with Boundary Modify © 2011 ANSYS, Inc. December 21, 2012 12 Release 14.0 Using Node Filter to Fix the Holes Now you will try to fix the holes. •In the Display Grid dialog box select the group _car from the Face Zone Groups. •Enable All and Free from the Options list. As you can see it has some missing facets. You can use the Modify Boundary dialog box to fix the holes. • Select node from the list under Filter. • Select 3 nodes as shown and click Create operation to create triangles. •Another option is to select Edge filter and click Create. It will to fill a structure from any free edge loop. Hot Key for Deselect Last is Escape This will fix the hole above. You can use similar methods to fix the rest of the holes. © 2011 ANSYS, Inc. December 21, 2012 13 Release 14.0 Repair Holes Hotkey • Instead of selecting the hole edges manually we can use a “repair zones” hotkey to fill multiple holes at once • Select some random faces using face filter in your model (ctrl-f) • Delete these faces with the delete hotkey (ctrl-w) • Switch to zone filter (ctrl-z) and pick the zone(s) you have created holes in (carmain-body in the example) • Use ctrl-r hotkey to fill the holes you created © 2011 ANSYS, Inc. December 21, 2012 14 Release 14.0 Local Clean Up Tools[1] We will use some of the operations in Modify Boundary to clean up the final issues with the mesh. • Boundary Modify... • In the Modify Boundary panel select node from the list under Filter. • Select the master node and a slave node to merge with and click Merge. This will fix the problem there. • Note the master’s position is kept so if near a feature the node on a feature should be chosen first. Collapse would merge the two to the mid-point instead. • Similarly fix the other free nodes In the geometry. © 2011 ANSYS, Inc. December 21, 2012 15 2. Slave 1. Master Hot Key for Node Merge is F9 Release 14.0 Local Clean Up Tools[2] • Sometimes you reach a stage as shown in the figure where there is no node pair to merge. • Switch to Edge Filter, select the edge as shown and click Split to split the edge. Select node Filter and select the two nodes to merge. The two nodes are at virtually the same location. Always click into the corner of the tri nearest the node you wish to select rather than trying to directly click the node position itself. • Click Merge to fix. This is to demonstrate some of the local operations. Local operations should be minimized as much as possible. You should try to fix most problems using the global operations. © 2011 ANSYS, Inc. December 21, 2012 16 Release 14.0 Verify Connectivity • Once there are no Free or Multi faces we can verify connectivity and move on to worry about the quality of the surface mesh • Ensure that you have bounds reset and check one last time for Free and Multi faces • Use ctrl-a hotkey to autoscale the view to the screen • Fix any remaining issues © 2011 ANSYS, Inc. December 21, 2012 17 Release 14.0 Fixing Poor Features • • • • • • • • Here we fix a kink in the roof Zoom on the area highlighted Open Boundary Modify Switch to Node Filter Select two nodes as shown Click Set Choose node to move Click Project © 2011 ANSYS, Inc. December 21, 2012 18 Release 14.0 Rezoning Triangles • In Display Grid choose only the car-front boundary and hit Display • You can see that the feature edge is not smooth and some triangles should belong to car-main-body • Open Boundary Modify and using face Filter, select the faces required to rezone into car-main-body (hint: rotate shows them clearly by their edges) • Switch to Zone Filter and select the car-main-body in the graphics window with RMB or type car-main-body into the “Enter Selection” window and press <Enter> to add to Selections list • Click Rezone Operation to move the faces © 2011 ANSYS, Inc. December 21, 2012 19 Release 14.0 Checking Quality[1] • To check the quality Report Face Limits... • Select all the zones under Face Zones. Click Compute. You can see that there are some highly skewed elements. We will aim to bring the Maximum value below ‘0.7’ before creating a volume mesh. • You can also plot the histogram of quality. Display Plot Face Distribution... • Select all the zones under Boundary Zones. • Click Plot. You can see that most of the faces are of very good quality. If you change the Minimum and Maximum values you can concentrate on the high skewness end. You can see that there are elements with skew > 0.8. some © 2011 ANSYS, Inc. December 21, 2012 20 Release 14.0 Checking Quality[2] • If you change the number of Partitions to 1 in Face Distribution dialog box, you can observe the number of elements above 0.8 Skew. If you click Print the info is printed to the console. You need to fix these poor quality faces before going ahead with the volume mesh. We will go further and aim for skew < 0.7. • To display the skewed elements enter 0.7 for Minimum in the Face Quality Range group box in the Display Grid dialog box. • Enable Quality in the Options group box. • Select _car In the Face Zone Groups list. • Click Display to check the low quality area. • Disable All and click Display to see where the elements are in the model. • Zoom to a bad element then enable all and redisplay to see the context © 2011 ANSYS, Inc. December 21, 2012 21 Some skewed elements Release 14.0 Improving Quality (Use Global Method) Boundary Mesh Improve… • In the Boundary Improve dialog box, select all the zones under Tri Boundary Zones. • Ensure that the Quality Limit is set to 0.7. Click Apply. You can see from the message printed in the console that you started out with a quality of 0.98 and after a few iterations that quality has been improved considerably. Display the skewed faces to check if the quality there is improved. As you can see the boundary improve command has stretched out the triangles by node smoothing smoothing. There is still a tiny cell remaining which is shown in ‘red’. © 2011 ANSYS, Inc. December 21, 2012 22 Release 14.0 Improving Quality Some faces may not have improved because the settings in the Boundary Improve dialog box constrain the improvement algorithm to avoid distortion of any feature/patch edges. •If the skewed elements are around a feature, you need to be a little more delicate to preserve the feature. You can move the nodes with the Move To Operation. • In Boundary Modify hit First to zoom on the worst skewed face • Switch to node Filter and select the node you will move • Select position Filter. • Right-click to select the position where you would like to move the node to. • Click Move To • If the operation is successful the face should no longer be highlighted red • Click Next to proceed to next worst face © 2011 ANSYS, Inc. December 21, 2012 23 Position Node Release 14.0 Hot Keys If you click in the graphics window and press ‘Ctrl+h’ you can get the list of hot keys printed on the console. You can use these hot keys to speed up cleanup operations considerably. When you execute the hotkeys, you can see that it prints in the console the equivalent textinterface command you would use for the hotkeys. • After cleaning up some of the faces using the Boundary Modify panel, check the quality again Report Face Limits... • Select all the zones under Face Zones. • Click Compute. © 2011 ANSYS, Inc. December 21, 2012 24 Release 14.0 Troubleshooting [1] When the Maximum skewness is computed below 0.7 then you can generate a Tet mesh. Mesh Tet... • You can retain all the default settings and click Init&Refine in the Tet dialog box. You should get an error informing that an edge is intersecting a face. If you click OK, you will be informed that mesh init and refine is not completed. • Click Cells tab in the Display Grid dialog box. • You can see that a dead cell zone is created since refinement was not completed. © 2011 ANSYS, Inc. December 21, 2012 25 Release 14.0 Troubleshooting [2] In the Faces tab you can see that a virtual-face is created. If you display this face we see the tet init mesh is exploding out to some bounding box. Clear the mesh so that the cell zones (dead) and virtualface are removed. • Mesh Clear Use the error message in the console window to locate the problematic area. • Copy the face ID from the console and paste it to the Selection area in the Bounds group box on the task page, set +/- Delta to 5 and click Set Ranges. • Click Display in the Display Grid dialog box. • You can increase/decrease the display bounds by clicking the up/down arrow key. You can see a node projecting through a surface, which confirms that an edge is intersecting a face. © 2011 ANSYS, Inc. December 21, 2012 26 Increase bounds Release 14.0 Troubleshooting [2] You could have found out this before initializing the mesh by using a text command. • Press ‘Enter’ to see the list of commands. • Mark intersecting faces using • /meshing/boundary/mark-face-intersection • Enter ‘*’ to select all when prompted to enter Boundary Face Zones, as shown • Press ‘Enter’ for the remaining prompts. You get a message in the console that 11 faces are marked. • To display marked faces, you can disable everything in the Display Grid panel under Options, highlight all Face Zones in the list and then click Display. Ensure that you have Reset the bounds. All the 11 marked faces are displayed. These require fixing. © 2011 ANSYS, Inc. December 21, 2012 27 Release 14.0 Fixing Face Intersection To fix the face intersection you can select the faces and delete them or smooth the apex node • Switch to face Filter in the Modify Boundary dialog box and select the five faces shown • Click Delete to remove the faces Click Yes in the Question dialog box that appears for confirmation of deletion. You can see that a hole is formed in the face. You can select Free from the Options list and display the hole with the free nodes. • To fix the hole select one edge of the hole in the Modify Boundary dialog box by selecting the edge Filter. • Click Create. If marked faces are still left. You can use the /bo/clear-marked-faces TUI command to remove the marks © 2011 ANSYS, Inc. December 21, 2012 28 Release 14.0 Generate Tet Mesh You can now again try generating the Tet mesh • Retain all the default settings and click Init&Refine in the Mesh Tet dialog box. After you have the Tet mesh you can see from the report generated in the console that there are still some skewed elements. • In Display Grid • In the Cells tab select the zone under Cell Zones. • Under Options disable everything other than Quality • Set Minimum to 0.9 to view skewed cells over this value • Click Display • In the Faces tab highlight the _car group and Display The skewed elements that are above the limit are displayed. The cells seem to be centered around the area of the wheel ground. To look at that in more detail you can check by looking at the cut plane through the wheels as described next. © 2011 ANSYS, Inc. December 21, 2012 29 Release 14.0 Generate Cut Plane To view the cut plane through the wheels: • Zoom in on the elements. • Select position Filter in Modify Boundary dialog box, (or use ‘ctrl-x’ hot key), and right-click to select a position at the center of the element group as shown. Since you want to look at a cut plane in Y direction, you extract the Y coordinates from the dialog box or the message printed in the console. • In the Bounds tab of Display Grid dialog box enable Limit by Y and paste the Y coordinates for Minimum and Maximum. This will limit it to a plane in that coordinate direction. • In the Cells tab enable All and click Display. You can see the problem areas down in the corners where there are sharp angles. Zoom In © 2011 ANSYS, Inc. December 21, 2012 Zoom In 30 Release 14.0 Using Auto Node Tool To fix the skewed cells we can: • Clear the mesh and repair the boundary or • Do local smoothing using the Auto Node Move tool This will move the local nodes to improve quality. We will select boundaries to allow movement but we will restrict movement along the surfaces to avoid changes to the geometry Mesh Tools Auto Node Move… • Select all the Boundary Zones. • Retain the default settings and click Apply. A message will be printed in the console about improved quality. Click Apply for few more iterations and the quality will improve. Once it is brought to an acceptable level the mesh is ready for the solver. Dropping Dihedral Angle and deselection of “restrict boundary nodes along surface” will allow more aggressive improvements and better quality but risks loss of features © 2011 ANSYS, Inc. December 21, 2012 31 Release 14.0 Cell Zones and Boundary Conditions • Mesh Manage… In the Manage Cell Zones dialog box you can rename the cell zone by giving it a proper name. There could be multiple cell zones • Select the Cell Zone. • Select Rename from the list of Options. • Enter the name “main-fluid” under Name and click Apply. • List will print info on the cell zone to console • Boundary Manage… In the Manage Face Zones dialog box you can change the face zones to a boundary condition type. • Select wt-inlet (wind tunnel inlet) from Face Zones. • Ensure that Change Type is selected from the Options list. • Select velocity-inlet from the Type drop-down list. • Click Apply. • Similarly set wt-outlet to pressure-outlet type, and wtsymmetry to symmetry type © 2011 ANSYS, Inc. December 21, 2012 32 Release 14.0 Mesh Ready • Open Boundary Manage • Select all the Face Zones • Click List to see the summary of all the boundary condition types. The details will be printed in the console. You can select the Face Zone Groups and list the summary for each group. Now write the volume mesh. File Write Mesh… • Enter a proper name for the mesh and click OK. • Optionally, switch to Fluent solution mode and continue to solve © 2011 ANSYS, Inc. December 21, 2012 33 Release 14.0