6311271
Computational Fluid Dynamics
04. Grid Generation
Budi Aji Warsiyanto & Muhammad Hadi Widanto
Faculty of Aerospace Technology
Universitas Dirgantara Marsekal Suryadarma
Fundamental Principles
Fluid mechanics is governed by some fundamental principles (differential equations):
Conservation of mass
𝝏𝝆 ⃑ 𝒎
˙ 𝒊𝒏
+𝜵 . 𝝆 𝒖 )=𝟎
( 𝒎
˙ 𝒐𝒖𝒕
𝝏𝒕
Change of density Net mass flow
with respect to time through the
(in incompressible small control
flow): volume
change y
⃑ 𝝏 𝒖 𝝏𝒗 𝝏𝒘
𝜵 . 𝒖= + + =𝟎
𝝏 𝒙 𝝏𝒚 𝝏𝒛
change x change z
Fundamental Principles
Conservation of momentum
force due to
viscosity
𝝆
⃑
𝑫𝒖
𝑫𝒕
𝟐⃑
⃑
=− 𝜵 𝒑 +𝝁 𝜵 𝒖+ 𝝆 𝑭
𝜵 𝒑= ( 𝝏 𝒑 𝝏𝒑 𝝏 𝒑
, ,
𝝏 𝒙 𝝏𝒚 𝝏𝒛 )
similar to pressure body force
or gravity
𝟐⃑
𝝁𝜵 𝒖
Discretization
Because the NS-equations are PDEs that are analytical solution is
almost impossible to find and you have to simplify the problem a lot.
This is why we resort to CFD.
CFD consists of three main steps: pre-processing (discretization),
solution, and post-processing.
Discretization is the process by which a closed-form mathematical
expression, such as a function or a differential or integral equation
involving functions.
Divide domain into a number of discrete sub-domains.
All of which are viewed as having an infinite continuum, is
approximated by analogous expressions which prescribe values at
only a finite number of discrete points or volumes in the domain.
Derive algebraic equations from the governing differential equation.
Solve the system of algebraic equations to obtain values of the
dependent variables ( and ) at the discrete points.
Discretization
Analytical solutions of partial differential equations give
the variation of the dependent variables continuously
throughout the domain.
In contrast, numerical solutions can give answers at only
discrete points in the domain, called grid points.
Assume that the spacing of the grid points in the
direction is uniform and given by (constant) and in is
same.
The grid points are identified by an index which runs in
the direction and an index in the direction.
Hence, if is the index for point , then the point to the
right of is labeled as , the point to the left is , the point
above is , and the point below is .
Discretization
Imagine that we have a two-dimensional flow-field
which is governed by the Navier-Stokes equations (PDE).
An analytical solution of these equation would provide
for etc., as functions of and , which could be used to
give values of the infinite number of () points in the
domain.
On the other hand, if the partial derivatives in the
governing equations are replaced by approximate
algebraic (are expressed strictly in terms of the flow-field
variables at two or more of the discrete grid points
shown in Figure), then the partial differential equations
are totally replaced by a system algebraic equations
which can be solved for the values of flow-field variables
at the discrete grid points only.
Discretization
Difference of method
Analytical solution: continuous function
Numerical solution: discrete function
If your discretization (meshing) is wrong, then you will
probably obtain wrong result (garbage in garbage out).
To understand discretization a little better is given a
simple analogy.
Large number of points to infinity you would be able to
replicate the exact curve, and that is a power of
discretization.
If you don’t discretize your problem optimally, you can’t
expect good results.
Discretization
Graph of velocity vs. time.
More points gives good result.
Example
Given a rod where in the support have 0o K (temp.). If we want to find the distribution of temp. at different
points along the rod, we need to know the differential equation that governs the physics.
For simplicity, consider the differential equation governs the temp. distribution along the rod with as a
boundary conditions.
To solve this problem, discretize the rod into 4 different elements.
1 2 3 4
T = 0o K
1 2 3 4 5
4m
Example
1 2 3 4
1 2 3 4 5
4m
[ ]{ } { }
1 0 0 0 𝑻𝟐 1
−1 1 0 0 𝑻𝟑 1
=
0 −1 1 0 𝑻𝟒 1
0 0 −1 1 𝑻𝟓 1
Set of linear algebraic
Converted a differential equation into a set of linear algebraic equations.
Three main methods are using equal step (to approximate the differential equations), namely Finite
Difference Method, Finite Volume Method, Finite Element Method.
Discretization
Grid can either be structured (hexahedral) or
unstructured (tetrahedral) depends upon type
of discretization scheme and application.
Scheme
Finite differences: structured
Finite volume or element: structured or
unstructured
Application
Unstructured grids useful for complex
geometries, whereas structured only for
the simple geometries.
The flow near the object is very important and
complex so that is needed very fine grid in this
region.
Discretization
The mesh quality can be conclusively determined based on the following factors:
Rate of convergence
Iteration mesh results convergence so that can be used proportional size element.
Solution accuracy
A fine mesh provides a more accurate solution. For example, fine the mesh at certain areas of the
geometry where gradients are high, thus increasing the fidelity of solutions in the region. Also, this means
that if a mesh is not sufficiently refined, then the accuracy of the solution is more limited.
CPU time required
For a highly refined mesh, where the number of cells per unit area is maximum, the CPU time required
will be relatively large. Time will generally be proportional to the number of elements.
Convergence of Iterations
Discretization
Two dimensional
Computationally poor elements have sharp internal angles.
Triangle: consists of 3 sides and is one of the simplest types of mesh. A triangular surface
mesh is always quick and easy to create. It is most common in unstructured grids.
Quadrilateral: consists of 4 sides and common in structured grids.
Type of Elements
Three dimensional
Extruded 2-dimensional models may be represented entirely
by prisms and hexahedra as extruded triangles and
quadrilaterals.
Tetrahedron: consists 4 vertices, 6 edges and is bounded by 4
triangular faces. In most cases a tetrahedral volume mesh can
be generated automatically.
Pyramid: A quadrilateral based pyramid has 5 vertices, 8
edges, bounded by 4 triangular and 1 quadrilateral face.
These effectively used a transition elements between square
and triangular faced elements.
Hexahedron: has 8 vertices, 12 edges, bounded by 6
quadrilateral faces. It is also called a hex or a brick. For the
same cell amount, the accuracy of solution in hexahedral
meshes is the highest.
Applications
The mesh adjacent to the surface are
highlighted by bold lines.
The mesh for the calculation of the subsonic
flow over a airfoil.
The calculation of the hypersonic flow.
Thank You