34
Tutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external flow over a simple 2D car residing in a wind tunnel. A replay will be employed for recording all the blocking steps. This replay (script) file will be run to model a modified geometry. Figure 1 shows the 2D car geometry. Figure 1: The Parts of 2D Car This tutorial demonstrates how to do the following: Applying mesh parameters. Blocking the geometry. Fitting the body to blocking. Associating to geometry. Aligning the vertices. Generating the mesh. Creating an O-Grid. Adjusting the edge distribution and refining the mesh. c ANSYS, Inc. June 14, 2010 1

Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

Embed Size (px)

Citation preview

Page 1: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

Tutorial: 2D Car Using Hexa Meshing

Introduction

In this tutorial, you will generate a mesh for external flow over a simple 2D car residingin a wind tunnel. A replay will be employed for recording all the blocking steps. Thisreplay (script) file will be run to model a modified geometry. Figure 1 shows the 2D cargeometry.

Figure 1: The Parts of 2D Car

This tutorial demonstrates how to do the following:

• Applying mesh parameters.

• Blocking the geometry.

• Fitting the body to blocking.

• Associating to geometry.

• Aligning the vertices.

• Generating the mesh.

• Creating an O-Grid.

• Adjusting the edge distribution and refining the mesh.

c© ANSYS, Inc. June 14, 2010 1

Page 2: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

• Matching the edges.

• Saving the replay file.

• Using replay for the design iteration.

Prerequisites

This tutorial assumes that you are familiar with the menu structure in ANSYS ICEMCFD and that you have read about this functionality. Some of the steps in setup and theprocedure will not be shown explicitly.

For details about hexa mesh generation, refer to the Chapter, Hexa, in ANSYS ICEMCFD user manual.

Conventions

Some of the basic conventions used in this tutorial are:

• The icon to the left of the text (here, Blocking) suggests that you have to select theoption from the display tree.

Blocking

• The arrow mark with the text LMB in the box suggests that you have to click theleft-mouse button to enable or disable an option (here, Vertices).

LMB −→ Vertices

• The arrow mark with the text RMB in the box suggests that you have to click theright-mouse button to enable or disable an option (here, Numbers).

RMB −→ Numbers

For detailed information about GUI and text conventions, refer to the document, GettingStarted with ANSYS ICEM CFD.

Blocking Strategy

For an external flow model in a wind tunnel, the following steps are usually taken whenblocking the model to obtain the desired results.

• The split function is a common technique when beginning blocking by carving aCartesian set of blocks around the object.

2 c© ANSYS, Inc. June 14, 2010

Page 3: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

• The vertices are then moved onto the geometry in order to fit the shape of the carwith all its features: front bumper, hood, etc.

• An O-Grid block is created around the car to give an orthogonal grid.

• The following Parts are defined in the geometry:

– CAR: Vehicle geometry

– GROUND: Ground surface of the wind tunnel

– INLET: Inlet face of the wind tunnel

– OUTLET: Outlet face of the wind tunnel

– PNTS: Prescribed points associated with the car

– TOP: Top surface of the wind tunnel

Use the replay file for the modified geometry, hexa 2dcar mod.tin. The parts aresame in both the base and modified geometries, allowing the replay file to be runon each identically.

Preparation

1. Download the ICEM hexa 2dcar FILES.zip file from the ANSYS Customer Por-tal. It contains the necessary input geometry files (hexa 2dcar base.tin andhexa 2dcar mod.tin).

2. Start ANSYS ICEM CFD and open the geometry (hexa 2dcar base.tin).

File > Geometry > Open Geometry...

Note: Ensure that the names of Parts that are listed are located in the display tree.

3. Activate the Replay control.

The replay function allows you to record the steps necessary to complete the mesh.

File > Replay Scripts > Replay Control

This opens the Replay control window.

Notes:

• The option of loading is not recorded in the replay script. Record (after current)is enabled by default. It will record all the commands until you select Done.

• The Replay control window may be moved aside or minimized while recording,but the window should be kept active until recording is complete.

4. Select Settings > Selection > Auto Pick Mode to enable or disable this mode.

Note: If it gets enabled by default, you have to exit the selection mode (right ormiddle-mouse key) in order to change some options. Keep this enabled forthis tutorial.

c© ANSYS, Inc. June 14, 2010 3

Page 4: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

Step 1: Applying Mesh Parameters

Mesh > Curve Mesh Setup > Select curve(s)

1. Click in the Select Geometry toolbar that appears.

You can also type Shift P. The Select part dialog box will open.

Figure 2: Select the Car Part

(a) Set the curve mesh size for CAR.

i. Enable CAR and click Accept.

ii. Set Maximum size to 25 in the Curve Mesh Setup DEZ.

iii. Click Apply.

(b) Set the curve mesh size for INLET, OUTLET, TOP, and GROUND.

i. Enable INLET, OUTLET, TOP, and GROUND.

ii. Click Accept.

iii. Set Maximum size to 500 in the Curve Mesh Setup DEZ.

iv. Click Apply.

4 c© ANSYS, Inc. June 14, 2010

Page 5: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

Step 2: Blocking the Geometry

1. Create initial block.

Blocking > Create Block > Initialize Blocks

(a) Enter FLUID in the Part field.

(b) Change the Type to 2D Planar.

(c) Click Apply.

Figure 3: Initial FLUID Block

2. Associate the four sides of the initial block to the four sides of the wind tunnel.

When using hexa for 2D, boundary line elements are created only if the edges are as-sociated with the boundary curves. You can apply boundary conditions only becauseof these boundary line elements. It is very important to associate all perimeteredges with the perimeter curves before the edges are split. When they are split, theresulting edges will retain the association.

Blocking > Associate > Associate Edge to Curve

c© ANSYS, Inc. June 14, 2010 5

Page 6: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

(a) Select the edge, 11-13 and click middle-mouse button to accept the selection.

(b) Select the curve (INLET) that lay on the top of edge.

(c) Click the middle-mouse button or Apply.

(d) Similarly, associate the remaining edges (13-21, 21-19, and 19-11) to theboundaries (TOP, OUTLET, and GROUND). See Figure 4.

Figure 4: Boundaries of Car Geometry

Disable the display of curves and ensure that all boundaries are turned green.

3. Split the initial block into sub-blocks.

Ensure Curves are enabled (default) in the display tree. Edges should also be dis-played (default) showing the initial block as shown in Figure 3.

(a) Enable the display of Points.

Geometry LMB −→ Points

(b) Select Show Point Names.

Geometry RMB −→ Points LMB −→ Show Point Names

The name of the Points will appear on the screen. Zoom in to the bumper.

(c) Change Split Method to Prescribed point in the Split Block DEZ.

The default Screen select split method is less parametric because it uses a com-mand that split the edges based on a percentage rather than based on a specificpoint selection.

Blocking > Split Block > Split Block

6 c© ANSYS, Inc. June 14, 2010

Page 7: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

(d) Split the block vertically.

i. Click (Select edge(s)).

ii. Select any horizontal edge (top or bottom edge).

iii. Select PNTS/10 at the rear of the bumper.

The new edge will automatically be created as shown in Figure 5.

Note: At any point in time while in selection mode, you can toggle ondynamic mode by selecting F9. This may be necessary in order to zoomin to get a closer view of the points. Toggling F9 again will return toselection mode.

Figure 5: First Split

(e) Similarly, make one more vertical split at the front of the car (choose pointsPNTS/1).

c© ANSYS, Inc. June 14, 2010 7

Page 8: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

(f) Make two horizontal splits at the bottom and top of the vehicle (PNTS/12and PNTS/5) as in shown in Figure 6.

Figure 6: Additional Splits

(g) Split the block using index control.

By default, splits propagate only through the displayed blocks. Blocks can beblanked by setting Index control values. The index control panel will appearin the lower right hand corner. This panel has two columns, Min and Max.All block edges and vertices are assigned an I, J, K value. For example, inFigure 7, the first edge perpendicular to the x- axis of the global co-ordinatesystem has an index of I = 1, while the first edge perpendicular to the y- axishas an index of J=1. For 2D cases, such as this, the K index is undefined.

Figure 7: Index Control

Notes:

• To change the range, toggle the arrows or enter an integer value in theappropriate field. Only the blocks within this range are displayed.

• Select Reset to select all of the block indices.

i. Select Index Control.

Blocking LMB −→ Index Control

ii. Change the Index range to I: 2-3, J: 0-3 to display only the blocks contain-ing the vehicle and those underneath the vehicle.

8 c© ANSYS, Inc. June 14, 2010

Page 9: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

Note: This only restricts the display of the splits. Implied splits are stillpropagated behind the scenes in order to maintain structured blockcontinuity. You can expose these implied splits using Extend Splits.

iii. Select any horizontal edge and create a vertical split through PNTS/7.

iv. Create a vertical split through PNTS/4.

v. Change the Index range to I: 2-5, J: 2-4.

vi. Select any vertical edge and create a horizontal split through PNTS/1.

vii. Change the Index range to I: 2-5, J: 3-4. See Figure 8.

Figure 8: Additional Splits

viii. Create a horizontal split through PNTS/4. See Figure 9.

Figure 9: Horizontal Split at PNTS/4

ix. Create a vertical split through PNTS/8.

c© ANSYS, Inc. June 14, 2010 9

Page 10: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

x. Create a vertical split through PNTS/2.

xi. Click Reset.

xii. Disable the display of points. See Figure 10.

Figure 10: The Block Indices

You can see the recording of the commands in the Replay control window. TheUndo grouping is not important and can be removed clicking the Clean button. Theimportant lines are those start with ic hex split grid. The next two numbers(11 19) are the vertices at the ends of the split edge. The next item (PNTS/1) isthe name of the point controlling the split.

10 c© ANSYS, Inc. June 14, 2010

Page 11: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

4. Delete unnecessary blocks.

Blocking > Delete Block

All of the blocks are in the FLUID volume part. For flow analysis, only the blocksoutside of the car should be retained. The blocks representing the interior of thecars must be reassigned into a different volume part.

(a) Enable the display of Blocks.

Blocking LMB −→ Blocks

This will show the blocks by their numbers.

(b) Select the block to be deleted as shown in Figure 11.

The blocks selected for deletion are 17, 28, 26, 36, 30, 31, 33.

Figure 11: Blocks to be Deleted

(c) Click middle-mouse button or Apply in the Delete Block DEZ.

These blocks will actually be put in the VORFN part since Delete Permanent isdisabled (default).

(d) Save the blocking.

File > Blocking > Save Blocking As...

(e) Provide a filename (car-geometry-1.blk) so that the file can be reloaded ata later time, using File > Blocking > Open Blocking....

c© ANSYS, Inc. June 14, 2010 11

Page 12: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

Step 3: Fitting the Body to Block

To ensure proper projection of the blocking edges onto the geometry, project block verticesto the prescribed points and block edges to the curves.

1. Enable the display of Points and Vertices.

Geometry LMB −→ Points

Blocking LMB −→ Vertices

2. Select Numbers.

Blocking RMB −→ Vertices LMB −→ Numbers

This will show all the vertices by their numbers.

3. Associate the vertices to the points.

Blocking > Associate > Associate Vertex

(a) Ensure that Entity selected is Point in the Blocking Associations DEZ.

(b) Select a vertex (55).

(c) Select the nearest corner point (PNTS/6) to that vertex. See Figure 12.

12 c© ANSYS, Inc. June 14, 2010

Page 13: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

Figure 12: Associating Vertex to Point

The vertex will immediately move to the selected point. Make sure you asso-ciate the vertices that are right on top of their respective points. The verticeswill turn red indicating they are fixed to the prescribed point. The blocks shouldnow better represent the geometry of the car.

(d) Similarly, associate the following Vertex to the Points:

Vertex Associated Point61 PNTS/576 PNTS/784 PNTS/843 PNTS/1154 PNTS/1242 PNTS/1491 PNTS/283 PNTS/992 PNTS/3

Figure 13 shows the blocking.

c© ANSYS, Inc. June 14, 2010 13

Page 14: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

Figure 13: The Blocking Fit to Car

Step 4: Associating to Geometry

1. Disable the display of Points.

Geometry LMB −→ Points

2. Disable the display of Internal Edges.

This is an optional step.

Blocking RMB −→ Edges LMB −→ Internal Edges

3. Associate the edges to the curves.

Blocking > Associate > Associate Edge to Curve

(a) Select all the edges that lie on the car body by dragging a selection box withthe left-mouse button.

(b) Click middle-mouse button to accept the selection of edges.

(c) Select all curves making up the car body individually or by dragging a selectionbox.

(d) Click middle-mouse button to accept the selection of curves.

4. Select the Internal Edges.

Blocking RMB −→ Edges LMB −→ Internal Edges

5. Disable the display of Curves to confirm that all the edges around the car body areassociated and colored green.

Geometry LMB −→ Curves

14 c© ANSYS, Inc. June 14, 2010

Page 15: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

6. Verify that the correct associations have been set.

Blocking RMB −→ Edges LMB −→ Show association

7. Enable the display of Curves.

Geometry LMB −→ Curves

The projection on the front bumper will resemble Figure 14.

Figure 14: Display of Edge Projection

Step 5: Aligning the Vertices

In this step, line up the vertices of the three blocks underneath the car to obtain optimalmesh quality.

Note: Similar to Split Blocks command, Align Vertices only acts upon the blocks displayed.Therefore, it is important to use the index control to isolate those blocks.

1. Isolate the blocks using index control.

The index control panel is at the bottom right hand corner.

(a) Click Select corners.

(b) Select the two diagonally opposite vertices (corners) as shown in the Figure 15.

Note: This changes the index control values.

c© ANSYS, Inc. June 14, 2010 15

Page 16: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

Figure 15: Adjusting the Index Control from Corners

2. Select Indices.

Blocking RMB −→ Vertices LMB −→ Indices

3. Select Align Vertices.

Blocking > Move Vertex > Align Vertices

(a) Select one vertical (J) edge to define the index align direction.

16 c© ANSYS, Inc. June 14, 2010

Page 17: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

The program assumes the alignment to be along Y of the active coordinatesystem, so only the X and Z (in this case Z is undefined) co-ordinates will beadjusted.

(b) Select any of the top four vertices (e.g. 5 2 1) as shown in Figure 16.

All J=2 vertices will be fixed and all other visible vertices will be adjusted.Observe that XZ under Move in plane is automatically toggled on.

Figure 16: Edge and Reference Vertices Selection

(c) Click Apply.

The bottom vertices are adjusted to line up with those at the top. See Figure 17.

Figure 17: Lined up Vertices

4. Click Reset in the index control panel to display all blocks.

5. Enable the display of Points.

Geometry LMB −→ Points

6. Disable the display of Vertices.

Blocking LMB −→ Vertices

Vertex positions can also be adjusted by setting location of co-ordinates. In thiscase, you will line up one of the vertices near the front bumper.

c© ANSYS, Inc. June 14, 2010 17

Page 18: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

7. Set the location for the moved vertex.

Blocking > Move Vertex > Set Location

(a) Select a reference vertex, PNTS/3, as shown in Figure 18.

Figure 18: Using Set Location to Align Vertices

18 c© ANSYS, Inc. June 14, 2010

Page 19: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

(b) Enable Modify Y only.

(c) Click for Vertices to Set.

(d) Select the vertex corresponding to 0 and click Apply.

The vertex will line up with the other one based on the y-coordinate as shownin Figure 19.

Figure 19: Lined up Vertex After Performing Set Location

You can see the recording of the commands in the Replay control window. The Undogrouping is not important and can be removed clicking the Clean button.

c© ANSYS, Inc. June 14, 2010 19

Page 20: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

Two important commands are as follows:

• The command, ic hex get node location, used vertex 84 to create three vari-ables, tempx tempy tempz.

Note: The location of vertex 84 was set earlier when you associated that vertex togeometry point, PNTS/3 which parametrically links it back to the geometry.

• The command, ic hex set node location, adjusts the y value using the variable,tempy,to align the selected vertices in the globalco-ordinate system. The adjusted

vertices are listed at the end of the command, node numbers 66.

Step 6: Generating the Mesh

Blocking > Pre Mesh Params > Update Sizes

1. Enable Update Sizes.

(a) Select Update All.

This will automatically determine the number of nodes on the edges from themesh sizes set on the curves.

(b) Click Apply.

2. Enable Pre-mesh and recompute as shown in Figure 20.

Blocking LMB −→ Pre-Mesh

This creates a body-fitted blocking that is aligned with indices I and J. This is knownas a Cartesian or H-Grid type of blocking.

20 c© ANSYS, Inc. June 14, 2010

Page 21: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

Figure 20: The H-Grid Blocking

3. Set the edge parameters.

Blocking > Pre-Mesh Params > Edge Params

(a) Disable Pre-Mesh.

Blocking LMB −→ Pre-Mesh

(b) Enable the display of Vertices.

Blocking LMB −→ Vertices

(c) Click and select edge 11-37.

(d) Set number of Nodes to 50.

(e) Click Apply.

(f) Click and select edge 48-38.

(g) Set number of Nodes to 50.

(h) Enter 1.2 for Ratio1 and Ratio2.

(i) Click Apply.

(j) Click and select edge 49-50.

(k) Set number of Nodes to 75.

(l) Enter 1.2 for Ratio1 and Ratio2.

(m) Click Apply.

c© ANSYS, Inc. June 14, 2010 21

Page 22: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

(n) Enable Pre-Mesh. See Figure 21.

Blocking LMB −→ Pre-Mesh

Figure 21: 2D Car Mesh

Step 7: Creating an O-Grid

In this step, you will create an O-Grid, where the mesh radially propagates from thesurface of the car towards the outer domain. This will result in an orthogonal mesh tobetter capture near-wall or boundary layer flow.

1. Disable Pre-Mesh.

Blocking LMB −→ Pre-Mesh

2. Enable the VORFN part to enable you to select the interior blocks.

Parts LMB −→ VORFN

3. Create an O-Grid around the car.

Blocking > Split Block > Ogrid Block

(a) Click (Select block(s)).

(b) Select the blocks inside the car and below the car as shown in Figure 22.

22 c© ANSYS, Inc. June 14, 2010

Page 23: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

Figure 22: Blocks to be Selected for the O-Grid

(c) Press the middle-mouse button to accept the blocks.

(d) Click (Select edge(s)).

(e) Select the edges along the ground under the car.

(f) Press the middle-mouse button. See Figure 23.

Figure 23: Selecting the Blocks and Edges for the O-Grid

(g) Enable Around block(s).

(h) Ensure that Offset is set to 1 and click Apply.

c© ANSYS, Inc. June 14, 2010 23

Page 24: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

(i) Disable VORFN.

Parts LMB −→ VORFN

Figure 24 shows the O-Grid passing through the floor.

Figure 24: External O-Grid of the Car

Step 8: Adjusting the Edge Distribution and Refining the Mesh

1. Set the edge meshing parameters.

Blocking > Pre-Mesh Params > Edge Params

24 c© ANSYS, Inc. June 14, 2010

Page 25: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

(a) Select one of the radial edges of the O-Grid as shown in Figure 25.

Figure 25: Setting the Meshing Parameters on the Edge

c© ANSYS, Inc. June 14, 2010 25

Page 26: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

(b) Increase Nodes to 7 in the Pre-Mesh Params DEZ.

(c) Select Geometric2 from Mesh law drop-down list.

(d) Enter 1 for Spacing 2.

(e) Enter 1.5 for Ratio 2.

This will bunch the elements close to the car.

(f) Enable Copy Parameters.

(g) Set Method to To All Parallel Edges (default) and click Apply.

This node distribution will be applied throughout the O-Grid.

(h) Click and select one of the vertical edges between the car and the ground.

(i) Increase Nodes to 15.

(j) Ratain the other default settings.

(k) Click Apply.

The ratios presented in the second column (actual) were not attained.

2. Enable Pre-Mesh and recompute. See Figure 26.

Figure 26: Mesh Before Matching the Edges

26 c© ANSYS, Inc. June 14, 2010

Page 27: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

Step 9: Matching the Edges

1. Disable Pre-Mesh.

Blocking LMB −→ Pre-Mesh

2. Set the index control values as shown.

3. Match the edge spacing of a Reference Edge to a connecting Target Edge.

Blocking > Pre-Mesh Params > Match Edges

(a) Enable Link spacing.

(b) Select the Reference Edge and Target Edge as shown in Figure 27.

Figure 27: Match the Edges

(c) Click the middle-mouse button.

(d) Set the edge parameters for the target edge.

Spacing 2 is now linked to the end spacing of the reference edge (linked 98 42).Changes to the reference edge distribution will automatically affect the edgedistribution for this target edge.

c© ANSYS, Inc. June 14, 2010 27

Page 28: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

Blocking > Pre-Mesh Params > Edge Params

(e) Select the earlier target edge.

(f) Ensure that Copy Parameters is enabled.

(g) Select To Visible Parallel Edges from the Method drop-down list.

Copy distribution To All Parallel Edges includes adjusting the distribution atthe ceiling of the tunnel. As the index control is set to specific value, you canlimit the copy To Visible Parallel Edges so that just the edges near the car areaffected and not the ceiling of the tunnel which is not visible.

(h) Click Apply.

4. Repeat step 2 for edge behind the car. See Figure 28.

In this case, it is spacing one of the target edges that is linked during match edges.

28 c© ANSYS, Inc. June 14, 2010

Page 29: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

Figure 28: Match Edges Behind the Car

5. Enable Pre-Mesh and recompute the mesh.

Figure 29 shows the final mesh of the baseline model.

Figure 29: Final Mesh of the Baseline Model

Step 10: Saving the Replay File

1. Bring the Replay control window to the foreground.

2. Right-click on the Replay control window (above the text) and select Edit filter.

It shows the list of the sort of commands those can be cleaned.

c© ANSYS, Inc. June 14, 2010 29

Page 30: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

Note: The replay file can contain all steps for outputting the mesh and can beused in batch mode from the command line using icemcfd-batch-script

replay-file.rpl.

3. Right-click again to go back to the replay script.

4. Click Clean to remove the undo group commands.

5. Click Renumber to number the commands properly.

6. Disable Record (after current).

7. Click Save and enter the filename replay file.rpl.

Step 11: Using Replay for the Design Iteration

You can rebuild the block topology on a similar geometry, or design iteration. Instead ofrepeating the same commands manually, run the replay file.

1. Start a new ANSYS ICEM CFD session and open the geometry (hexa 2dcar mod.tin).

File > Geometry > Open Geometry...

In hexa 2dcar mod.tin, the trunk or deck-lid is extended rearward, the rearwindshield (backlight) angle is changed and the windshield is moved slightly rear-ward. See Figure 30.

Figure 30: The Modified Car Model Geometry

2. Load the replay file, replay-file.rpl.

File > Replay Scripts > Load script file

3. In the Replay control window, highlight line no. 1.

4. Click Do all.

If the Always update option is enabled, you can see each step. Disabling that op-tion will be faster (without display delays). This is the real power of replay. Theblocking file is parametric and you can load the saved blocking file from the otherconfiguration and update it to get a similar result.

30 c© ANSYS, Inc. June 14, 2010

Page 31: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

5. Enable Pre-Mesh and recompute.

This mesh will be generated using exactly the same parameters as earlier, so thedifferences in solutions may be attributed to the changes in the geometry, ratherthan to any dissimilarity in the grids. See Figure 31.

Figure 31: Final Mesh

6. Save the unstructured mesh.

Blocking RMB −→ Pre-Mesh LMB −→ Convert to Unstruct

7. Save the project file (hexa-2Dcar-final.prj).

File > Save Project As...

8. Export the mesh to the solver.

Output > Select solver

(a) Select Fluent V6 from the Output Solver drop-down list.

(b) Click Apply.

9. Set the boundary conditions.

Output > Boundary conditions

c© ANSYS, Inc. June 14, 2010 31

Page 32: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

(a) Set velocity-inlet as a boundary condition for INLET.

(b) Set pressure-outlet, exhaust-fan, outlet-vent as a boundary condition for OUT-LET.

(c) Set wall as a boundary condition for TOP and GROUND.

(d) Click Accept to set the boundary conditions.

10. Write the input file for ANSYS FLUENT.

Output > Write input

(a) Open .uns file.

The Fluent V6 window will appear.

32 c© ANSYS, Inc. June 14, 2010

Page 33: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

(b) Select 2D for Grid dimension.

(c) Enter appropriate name for the Output file.

(d) Click Done.

You can use this .msh file in ANSYS FLUENTto set up and solve.

c© ANSYS, Inc. June 14, 2010 33

Page 34: Tutorial: 2D Car Using Hexa Meshing - lost- ... · PDF fileTutorial: 2D Car Using Hexa Meshing Introduction In this tutorial, you will generate a mesh for external ow over a simple

2D Car Using Hexa Meshing

34 c© ANSYS, Inc. June 14, 2010