0% found this document useful (0 votes)
17 views18 pages

CFD Assignment 2,3

Uploaded by

f.lalgani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views18 pages

CFD Assignment 2,3

Uploaded by

f.lalgani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

MECH 8290 – 79: Practical CFD and Turbulence Modelling

Semester: Spring 2023

Assignment – 2 & 3

On

Snappy Hex Mesh and cf Mesh on Ahmed Body

Submitted To
Dr. Majed Etemadi

On
Date: July 4, 2023

Submitted By

Shail Dasharathbhai Patel 110028943


Masoumeh Shaghalei 110089940
Dhruvikkumar B. Moradiya 110103032
Mohammed Mukthar Muthaher 110090292
Dhruv Patel 110106602
Table of Contents

Contents
Table of Contents ....................................................................................................................... 1

List of Figures ............................................................................................................................ 1

Overview .................................................................................................................................... 2

1. Introduction ............................................................................................................................ 2

2. Project Inputs ......................................................................................................................... 2

3. BlockMesh Generation .......................................................................................................... 3

4. Snappy Hex Mesh .................................................................................................................. 5

5. cf Mesh................................................................................................................................... 8

6. Post processing data representation of Snappy Hex Mesh .................................................. 10

7. Post processing data representation of cf Mesh ................................................................... 12

8. General Explanations ........................................................................................................... 14

References: ............................................................................................................................... 17

List of Figures

Figure 2.1: AhmedBody............................................................................................................. 2


Figure 3.1: BlockMesh design with nomenclature .................................................................... 4
Figure 3.2: paraView generated BlockMesh on Domain........................................................... 4
Figure 4.2: Snappy Hex Mesh view with whole domain and around AhmedBody .................. 7
Figure 4.3: simpleFoam view of U ............................................................................................ 7
Figure 5.1: cf Mesh view with whole domain and bounding box ............................................. 8
Figure 5.1: cf Mesh view with around AhmedBody.................................................................. 9
Figure 5.3: simpleFoam view of U ............................................................................................ 9
Figure 6.1: Graph between Time and Y+ ................................................................................ 10
Figure 6.2: Graph between Time and Drag ............................................................................. 10
Figure 6.3: Graph between Time and Lift ............................................................................... 11
Figure 6.4: Graph between Time and Residual ....................................................................... 11
Figure 7.1: Graph between Time and Y+ ................................................................................ 12
Figure 7.2: Graph between Time and Drag ............................................................................. 12
Figure 7.3: Graph between Time and Lift ............................................................................... 13
Figure 7.4: Graph between Time and Residual ....................................................................... 13
Figure 8.1: Layer Calculation website [1] ............................................................................... 14
Figure 8.2: Refinement calculation Excel screenshot .............................................................. 15

1|Page
Overview

The report explains the two cases worked with realizable k-Omega SST turbulence model. For
the first case, a Mesh is generated for the ahmedBody using SnappyHexMesh and other using
cfMesh respectively. A Steady-state, incompressible simulation was conducted in open source
CFD tool openFoam to reproduce the aerodynamic drag & lift coefficient of the body.

1. Introduction

SnappyHexMesh : SnappyHexMesh is a tool used in computational fluid dynamics (CFD)


simulations, specifically in the area of mesh generation which is also a part of openFOAM
software package. SnappyHexMesh provides several features and options, such as mesh sizing
controls, refinement areas, and boundary layer generation. It provides a flexible and powerful
toolset for creating high-quality hexahedral meshes suitable for CFD simulations in complex
geometries.

cfMesh:
An open-source mesh-generating library termed cfMesh has been included in the
OpenFOAM® framework. The library facilitates the easy implementation of new meshing
processes and applications. It is accomplished by making use of the flexible idea of mesh
modifiers, which enables effective parallelization utilising both distributed memory
parallelization using MPI and shared memory parallelization (SMP).

It can generate a number of meshes, including polyhedral, tetrahedral, and Cartesian (hex-
dominant) in both 3D and 2D. It is 4-5 times faster than snappyHexMesh and involves
significantly less manual effort. It permits complete covering of the boundary layer.

2. Project Inputs

Following are the inputs:


1. ahmedBody.stl
2. https://www.fluidmechanics101.com/pages/tools.html
3. Selection of Turbulence Model

1. ahmedBody.stl

Figure 2.1: AhmedBody

2|Page
2. https://www.fluidmechanics101.com/pages/tools.html
This website used to calculate the First Layer and Final Layer .

Figure 2.2: Layer Calculation website [1]

3. Selection of Turbulence Model


For particular this assignment, k-Epsilon or k-Omega SST both turbulence model will work.
Both of the model has individual characteristics.
In this report the used Turbulence Model is k-Omega SST

3. BlockMesh Generation

BlockMesh is a multi-block mesh generator which can be used for Simple Geometries. The
mesh here is generated from a dictionary file name as blockMeshDict, which is in the Constant
directory of the chosen Model. The blockmeshDict can be easily parametrize as per size and
requirements of geometries. Any simulation will require domain to simulate the specific object.
In this report, snappyHexMesh and cfMesh consist of a single rectangular block which is
named as domain, therefore blockMesh need to be used.

In order to generate a BlockMesh, a Domain is created by defining the nodes, block


connectivity and number of cells in each direction in the dictionary file.

For this case below points are considered:


xmin= -3 xmax= 4
ymin= 0 ymax= 2
zmin= -2 zmax= 2

Since this is also a 3D case, faces are defined in blockMeshDict based on the nodes in
counterclockwise direction.

3|Page
Faces:
Min X(left) | Max X(Right)
Min Y(Front) | Max Y(Back)
Min Z(Up) | Max Z(Down)

Figure 3.1: BlockMesh design with nomenclature


Compute blockMesh command in Ubuntu – openfoam2212 and then can generate touch
case.foam.
Touch case.foam command will generate the dummy file in the folder directory. Open that
file in the paraview to check the mesh.

Figure 3.2: paraView generated BlockMesh on Domain


In this picture, that blockMesh is visible for the domain.

4|Page
4. Snappy Hex Mesh

SnappyHexMesh is a split-hex, completely parallel mesh generator that ensures a certain level
of mesh quality. It is especially well suited to batch-driven operation and is controlled via
OpenFOAM dictionaries. The refinement of Feature angle can be adjusted in ParaView in the
properties section.
Workflow of Snappy Hex Mesh:

Figure 4.1: workflow diagram of Snappy Hex Mesh


The castellatedMeshControls, snapControls, addLayersControls, and meshQualityControls
categories make up the five parts that make up the snappyHexMesh dictionary. Each section
controls a step of the meshing process.

The various meshing procedures can be turned on and off in the first three lines.
I. Castellation – Removes cells based on volume of the object.
II. Snapping – It increase the edges perfection.
III. Mesh layers – Create boundary layers(It also called Prism layers)

5|Page
Meshing Process:
Step 1: Creating Background
Now that the blockMesh domain is created, Ahmedbody .stl can be placed by copying it to the
Constant directory in a newly created folder named as “trisurface”. The dictionary
snappyHexMeshDict, which is placed in the System directory, is read by the meshing tool
snappyHexMesh.
Step 2. Castellated Mesh Control
Cell splitting is performed in the castellatedMeshControls sub-dictionary in the
snappyHexMeshDict dictionary. By changing the Input the values of maxLocalCells,
maxGlobalCells, minRefinementCells, maxLoadUnbalance, nCellsBetweenLevels.

Step 3. Change the level number under features. (Level number shows refinements on the
edges)

Step 4. Refinement of Surfaces – Change the values of level(x y), where x depicts minimum
refinement and y depicts maximum refinement. Additionally, x shows Global Refinement level
and y shows Curvature Refinement.

Step 5. Resolve Feature Angles – Change the angle of the refinement.

Step 6. Refinement Regions – Refine the geometry of the box. A region can further divide the
cells into those that are contained by one or more designated volume areas. the data in the
refinementRegions block of the castellatedMeshControls sub-dictionary of the
snappyHexMeshDict dictionary that pertains to the refinement of the volume regions.
Step 7. Location In Mesh - The region in which cells are retained are simply identified by a
location point within the region, specified by the locationInMesh keyword in the
castellatedMeshControls sub-dictionary in the snappyHexMeshDict dictionary.

Step 8. snapControls - The points are snapped on the surface to build a conforming mesh after
removing the cells in the designated region and fine-tuning the volume mesh. The snapping is
controlled in the snapControls sub-dictionary in snappyHexMeshDict.
The following information can be modified:
I. nSmoothPatch –Number of patch smoothing iterations before finding correspondence.
II. Tolerance – Maximum relative distance for points to be attracted by surface.
III. nSolveIter – Number of mesh displacement relaxation iterations. (Recommended 30)
IV. nRelaxIter – Maximum number snapping relaxation iterations.
V. nFeatureSnapIter – Improve the snapping of edges.
This is a valid snapped or body fitted mesh that can be used for a simulation.

Step 9. addLayersControls – introducing the boundary layer meshing in selected parts of the
mesh. This below information can be modified in the addLayersControls sub-dictionary in the
snappyHexMeshDict dictionary:
I. relativeSizes – help to create smooth transition.
II. expansionRatio – Geometric gross ratio
III. finalLayerThickness
IV. minThickness – input the minimum value as possible.

6|Page
V. featureAngle – To avoid boundary layer collapsing close to the corners, increase the
value of it.

MeshQualityDict
MeshQualityDict depicts the quality of the mesh. During the mesh generation process, the mesh
quality is continuously monitored. snappyHexMesh will try to generate a mesh using the mesh
quality Parameters and these parameters can modified as per the requirements.

Compute command “snappyHexMesh” in openFoam. This will create three folders inside the
KOmega directory.
1. Castellation
2. Snapping
3. Prism Layer
Copy the polyMesh from folder 3 (Prism Layer) and paste it to constant folder (remove the
existing polyMesh folder). Now, delete all three folders which were generated.

Figure 4.2: Snappy Hex Mesh view with whole domain and around AhmedBody

Figure 4.3: simpleFoam view of U

7|Page
5. cf Mesh

Step 1. Deleting sub-Folders and Files – A Copy of kOmega directory to be created and sub
directories with name polyMesh, trisurface, extendedFeatureEdgeMesh, postprocessing and
Allrun files are to be deleted.

Step 2. openFoam Commands - Commutation of Following command in openFoam –


“surfaceGenerateBoundBox – ahmedBody.stl – ahmedBodyBox.stl xmin xmax ymin ymax
zmin zmax”.
This creates the internal box around the body.

Step 3. Commute command - “surfaceFeatureEdges –angle 15 ahmedBodyBox.stl


ahmedBody.fms”

Step 4. Modify the Value in meshDict – Open System Directory and change the values of
maxCellSize, minCellSize, boundryCellSize according to the specifications.
The values in Object Refinements, localRefinements are be modified.
The boundryLayers to be updates as {patchBoundryLayers}
In order to increase the level of refinement the value under optimiseLayer need to be increased.
The values to be changes under renameBoundry

Step 5. Commute Command in openFoam - “cartesianMesh”

Figure 5.1: cf Mesh view with whole domain and bounding box

8|Page
Figure 5.1: cf Mesh view with around AhmedBody

Figure 5.3: simpleFoam view of U

9|Page
6. Post processing data representation of Snappy Hex Mesh

Y+
1.00E+03

8.00E+02

6.00E+02

4.00E+02

2.00E+02

0.00E+00 1550
50
150
250
350
450
550
650
750
850
950
1050
1150
1250
1350
1450

1650
1750
1850
1950
2050
2150
2250
2350
2450
2550
2650
2750
2850
2950
Y+

Figure 6.1: Graph between Time and Y+

Drag
1.00E+07

5.00E+06

0.00E+00

-5.00E+06

-1.00E+07
1 501 1001 1501 2001 2501

Drag

Figure 6.2: Graph between Time and Drag

10 | P a g e
Lift
6.00E+04

2.00E+04

-2.00E+04

-6.00E+04
1 501 1001 1501 2001 2501

Lift

Figure 6.3: Graph between Time and Lift

Residual
4.00E-01

3.00E-01

2.00E-01

1.00E-01

0.00E+00
1 501 1001 1501 2001 2501

Ux_Final Uy_Final Uz_Final k-Final p-Final Omega-Final

Figure 6.4: Graph between Time and Residual

11 | P a g e
7. Post processing data representation of cf Mesh

Y+
6.00E+02

4.00E+02

2.00E+02

0.00E+00 1550
50
150
250
350
450
550
650
750
850
950
1050
1150
1250
1350
1450

1650
1750
1850
1950
2050
2150
2250
2350
2450
2550
2650
2750
2850
2950
Y+

Figure 7.1: Graph between Time and Y+

Drag

8.00E+06

2.00E+06

-4.00E+06

-1.00E+07
1 501 1001 1501 2001 2501

Drag

Figure 7.2: Graph between Time and Drag

12 | P a g e
Lift
6.00E+03

3.00E+03

0.00E+00

-3.00E+03

-6.00E+03
1 501 1001 1501 2001 2501

Lift

Figure 7.3: Graph between Time and Lift

Residual
4.00E-01

3.00E-01

2.00E-01

1.00E-01

0.00E+00
1 501 1001 1501 2001 2501

Ux-Final Uy-Final Uz-Final k-Final p-Final Omega-Final

Figure 7.4: Graph between Time and Residual

13 | P a g e
8. General Explanations

1. Selection of First Layer size and Final Layer size also selection of refinement layer
Ans: First layer size and Final Layer size is calculated using an opensource website as
screenshot attached.

Following input parameters are required:


- Velocity
- Length Scale
- Viscosity
- Density
- Target Y+
- Layers

Figure 8.1: Layer Calculation website [1]


- Velocity: In the velocity block need to write the value of the velocity in m/s
- Length Scale: in this need to write the value of the length of the object in m
- Viscosity: Need to enter the viscosity in Pa s
- Density: Need to enter the density in kg/m3
- Target Y+ : Need to enter the value as per the turbulence model like k-
Epsilon or k-Omega SST. Mostly for k-Epsilon preferred value of Y+ need to
be more than 30 and for k-Omega need to be less than 5. Ideally for k-Omega
preferred value is 1.
- Layers: Need to be enter the value of the number of layers are required.

Refinement Levels: Refinement levels are calculated in the Excel sheet. For reference
screenshot is attached below.

14 | P a g e
Figure 8.2: Refinement calculation Excel screenshot
2. Use of Wall Function
Ans: The Wall function is employed in this simulation of the AhmedBody.
Wall function is essentially utilised to obtain exact mesh refinement.

Utilising the wall function


1) Normal y+ rules for high Re models need the use of wall functions
2) Normal y+ rule for low Re models, no wall functions, and explicit BCs
3) Menter's k-omega, special SST = either low Re or high Re with wall functions, however
you must employ a "wall function" to combine the viscosity from the k-omega
implementation with the k-e implementation. In addition, even though explicit BCs can be
used for the other low Re models, you should utilise the kqRWallFunction for k and the
omegaWallFunction for omega.

In other words, wall functions are not required if the grid close to the wall is fine enough
(y+1 everywhere and at least 4-5 nodes below y+=5). Low Re values should also be suitable
for SA and kOmegaSST, which are needed for kEpsilon.

1. Calculate the boundary layer profile and resolve the near-wall flow by adding a layer of
cells that is increasing. It costs a lot to compute.

2. Wall functions, the specified function of the boundary layer (logarithmic), can be used in
the turbulence model. One boundary layer cell (not smaller and not more significant than the
BL itself) is required for this. Then, though, it is computationally less expensive and could be
less precise.

Therefore, it's crucial to simplify meshing and lower CPU usage when dealing with huge
models.

3. Drag Coefficient and Lift Coefficient

Drag Coefficient
The air resistance for a certain form is determined by the drag coefficient, which is a
dimensional number. It is computed by dividing the drag force (Fd) by dynamic pressure
(which is equal to 1/2 air density times the square of the speed v), then multiplying the result
by the reference area A of the form.
2𝐹𝑑
𝐶𝑑 = 2
𝜌𝑢 𝐴

15 | P a g e
Lift Coefficient
A lifting body's lift is related to the fluid density, fluid velocity, and an associated reference
area through the lift coefficient (CL), a dimensionless variable.
2𝐹𝑙
𝐶𝑙 = 2
𝜌𝑢 𝐴
Snappy Hex Mesh: Resulting Drag = ~24 N and Resulting Lift = ~28 N
Co efficient of drag = 0.27 and lift = 0.09
Cf Mesh: Resulting Drag = ~29 N and Resulting Lift = ~ 33 N
Co efficient of drag = 0.25 and lift = 0.08

4. Conclusion of flow:
Ans: As all graphs of drag, lift, residual and y+ mentioned in the chapter 6 (Snappy Hex
Mesh resulting graph) and chapter 7 (cf Mesh resulting graph).
Graphs clearly represents that the mean value of the terms are constant so that conclude that
the flow is converged.

16 | P a g e
References:
[1]“Fluid Mechanics 101,” Fluid Mechanics 101. [Online]. Available:
https://www.fluidmechanics101.com/pages/tools.html

17 | P a g e

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy