Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
27-Mar15
34
35
Domain Definition
There many ways to creating a geometry, this
27-Mar-1527-Mar-1
27-Mar-1527-Mar-15
3
6
Cracks.
Small faces.
Misaligned faces.
Overlapping faces.
Sliver faces (high
aspect-ratio).
Repeated faces.
Several surfaces
connected to a single
surface.
Gaps.
Free faces, edges,
nodes.
Hard edges.
Small edges.
Sharp angles.
Repeated edges.
High curvature NURBS.
37
NURBS
Non-uniform rational basis spline (NURBS) is a mathematical model commonly used in computer graphics for generating and
representing curves and surfaces.
It is a mathematically precise representation of freeform surfaces which could be exactly reproduced whenever technically needed,
like those used for
-
ship hulls,
aerospace exterior surfaces, and
car bodies,
Computational Fluid Dynamics
38
practices, we should not experience these geometry issues. At the end, we should
get a smooth, clean, watertight body.
Usually, we find these issues when importing or exporting the geometry from/to
different formats.
39
27-Mar-1527-Mar-1
41
42
27-Mar-1527-Mar-1
43
44
27-Mar-1527-Mar-1
45
\
High aspect ratio face/Sliver face
46
27-Mar-1527-Ma
47
Many times, it is not necessary to model all the details of the geometry.
48
27-Mar-1527-Mar
49
MESHING
50
Meshing Preliminaries
Mesh generation consist in dividing the physical domain into a finite number of discrete regions,
called control volumes or cells in which the solution is sought.
Meshes used for the FVM method can consist of tetrahedras, pyramids, prisms, hexahedras
or any kind of polyhedral element (or a mix of all of them).
The meshes can be unstructured or structured. In our discussion, when we talk about
unstructured or structured meshes we refer specifically to the method used to generate them.
27-Mar-15
51
Meshing Preliminaries
The data structure of the meshes used in the FVM is
represented by the points and faces that make up each control
volume.
The connectivity information of each cell (how faces and cells are connected) and cell/face
neighbor information is also needed for FVM unstructured meshes.
Meshes used for the FDM method are made of hexahedra and they are known as single and/or
multi-block structured meshes.
The connectivity information of the meshes used in the FDM is expressed as a two or three
dimensional array, this is highly memory efficient as we do not need to store all the connectivity
information of the faces and cells.
Meshing Examples
Single-block C-type structured grid around a NACA 4412 airfoil
53
27-Mar-1527-Mar-1
54
Meshing Examples
Multi-block structured grid around a NLR 7301 airfoil with flap
55
Meshing Examples
Unstructured triangular mesh around a NHLP-2D
three element airfoil
27-Mar-1527-Mar-1
56
Meshing Examples
Overlapping structured grid around a NLR
7301 airfoil with flap
Meshing Examples
Cartesian mesh around a
Drela DAE11 low
Reynolds airfoil
57
27-Mar-1527-Mar-1
58
Meshing Comparison
STRUCTURED UNSTRUCTURED CARTESIAN OVERLAPPING
Geometric Flexibility/
Adaptation
Grid Adaptation/ Local
Refinement
Viscous Computation
Moving/Deforming
Meshes Quality
Interpolation/
Conservation
Grid generation
easiness
V Good
V Good
Average
Bad
V Good
V Good
V Good
Good
Good
Average
V Good
V Good
V Good
Good
Bad
V Good
V Good
Bad
V Good
Bad
V Good
V Good
Bad
V Good
V
Goo
d
V
Goo
V Bad
Memory
Requirements
CPU Requirements
V
Goo
d
V
Goo
d
V
Goo
V
Goo
d
Goo
d
59
A single block structured mesh may comprise of square elements (2D) or hexahedral elements (3D) which are orthogonal in i, j space (2D) or i, j, k space (3D).
Although it is also possible to have wedges (3D), triangles (2D) and pyramids (3D) in a structured mesh.
Looking at a 2D example, for simplicity:
Every node in a 2D structured mesh has a corresponding integer i and j index value which is unique.
The physical locations of the nodes are stored in a table or are functionally related to the mesh space (ie
(x,y)= f(i,j)).
The neigbours of node (ij) are (i-1,j), (i+1,j), (ij-1), (ij+1), (i-1,j-1), and (i+1,j+1).
A structured mesh makes it very easy to loop through neighbours and can be efficient with memory.
A structured mesh has many coding advantages, but it may be difficult to conform a single block to a complicated shape. Code developers have got around this by
allowing multiple blocks (multiblock unstructured), but this can make the internal memory strucutres more inefficient.
Another way to make the mesh generation simpler, and improve code performance is to throw away the block structure and replace indices with node numbers and a
connectivity table. This is known as an unstructured mesh, because it lacks the i,j,k structure.
27-Mar-1527-Mar-1
60
Unstructured Hybrid
Mesh (tetras, prisms
and hexs)
Structured Mesh
(hexahedrals)
61
27-Mar-1527-Mar-1
62
63
At the end of the day, the mesh you use must has a good overall quality and must
be smooth.
The mesh density should be high enough to capture all relevant flow features.
27-Mar-1527-Mar-1
65
Mesh Quality
There is no written theory when it comes to mesh generation and the whole
process depends on user experience.
Rule of thumb: the elements shape and
distribution should be pleasing to the eye.
The user can rely on grid dependency studies, but they are time consuming
and expensive.
No single standard benchmark or metric exists that can effectively assess the
quality of a mesh, but you can rely on suggested best practices.
Mesh Quality
The most common mesh quality metrics are:
-
Orthogonality.
Skewness.
Aspect Ratio.
Smoothness.
66
27-Mar-1527-Mar-1
67
Mesh Quality
Mesh orthogonality
-
68
Mesh Quality
Mesh skewness
- Skewness is the deviation of the vector d that connects the two cells P and N, from the face
center f. The deviation vector is represented with A and the point where the vector d intersects
- It affects the interpolation of the cell centered
quantities to the face center f.
27-Mar-1527-Mar-1
69
Mesh Quality
Mesh aspect ratio AR
-
Mesh aspect ratio AR is the ratio between the longest side Ax and the shortest side Ay .
Large AR are fine if gradients in the long direction are small.
High AR smear gradients.
Mesh Quality
Smoothness
Smoothness, also known as expansion rate, growth factor or
uniformity, defines the transition in size between contiguous cells.
Large transition ratios between cells add diffusion to the solution.
70
27-Mar-1527-Mar-1
71
Mesh Quality
The mesh density should be high enough to capture all relevant flow features. In areas where the
solution change slowly, you can use larger elements.
To keep cell count down, use non-uniform meshes to cluster cells only where they are needed. Use
local refinements and solution adaption to further refine only on selected areas.
72
Mesh Quality
In
- WM_PROJ ECT_DIR/src/OpenFOAM/meshes/primitive
Mesh/primitiveMeshCheck/primitiveMeshCheck.C you will
find the quality metrics used in OpenFOAM.
27-Mar-1527-Mar-15
73
Mesh Quality
OpenFOAM comes with the utility checkMesh which
checks the validity of the mesh.
checkMesh will look for/check for:
-
74
Mesh Quality
Mesh topology and patch topology errors must be
repaired.
27-Mar-1527-Mar-15
75
Mesh Conversion
It is also possible to export a mesh generated with a third party
software and use it in OpenFOAM. Some of the utilities available
formesh conversion are listed below:
76
Mesh Conversion
OpenFOAM also comes with many mesh manipulation
utilities.
Some of them are listed below:
-
27-Mar-1527-Mar-15
77
Mesh Conversion
-
blockMesh
snappyHexMesh
78
Meshing Examples
Working with lid driven cavity
blocks
(
hex (0 1 2 3 4 5 6 7) (20 20 1) simpleGrading (1 1 1)
);
27-Mar-1527-Mar-15
79
average: 0
80
27-Mar-1527-Mar-15
81
82
27-Mar-1527-Mar-15
83
Dense Cavity
84
27-Mar-1527-Mar-15
85
Arched Cavity
86
27-Mar-1527-Mar-15
Computational Fluid Dynamics
89
Problem
27-Mar-1527-Mar-15
90
Partial Solution
(0,2,0)
(2,0,0)
91
27-Mar-1527-Mar-15
92
93
27-Mar-1527-Mar-15
94
95
27-Mar-1527-Mar-15
96
97
27-Mar-1527-Mar-15
99
QUIZ
Problem
You are required to
simulate a 2D domain
shown.
Draw a figure
highlighting the vertices
that will be used in the
blockMeshDict to create
the geometry in OF.
100
Partial Solution
27
M
ar15
102