Professional Documents
Culture Documents
Write a computer program to generate an O-grid to discretize the domain shown in Figure 1
using Transfinite Interpolation. The domain consists of the outer boundary
and inner
boundary which is a Karman-Treffetz airfoil.
The airfoil surface coordinates are calculated with the attached function. Your computer code
must accept as input the number of points
along the airfoil normal and tangential
directions, respectively.
Note: All submitted work should be entirely yours. Include source code in your report.
Solution:
Figure 2: Mapping from computational domain into physical domain or vice versa
Utilizing this mapping function we can use unidirectional interpolation to generate the
internal grid in the physical domain. However, unidirectional interpolation alone cannot create
the correct shape of the boundary of the physical domain especially if the boundary has curved
shape. This is because unidirectional interpolation will generate a straight boundary instead of
the original curved boundary AB, BC, CD, and DA. This statement will be explained in more
detail in the following paragraphs.
Firstly, let us generate another transformation, , to map points from the
computational domain into the physical domain which will linearly interpolate the values of
between
and
at each value of . The has the following form (Eq. (1)).
(1)
By means of this linear interpolation we will obtain a grid on the physical domain which shows
the curved-boundary AB and CD correctly, while create an incorrect straight-line for boundaries
AC and BD as shown in Figure 3.
Secondly, let us again consider another transformation, , which also maps points from
the computational domain into the physical domain which linearly interpolates the values of ,
instead of the values of , between
and
at each value of .
(2)
This mapping function will result in, in contrary to the previous mapping, the correct curvedboundary for AC and BD, while give incorrect straight line for boundaries AB and CD
(see Figure 4).
2. Composite mapping
By applying composite mapping using and , one will obtain a physical region which
has correct vertices (A, B, C, and D) but with all boundaries replaced by straight lines instead of
the actual curved-boundaries. The composite mapping function and the resulting physical
domain can be seen below (Eq. (3) and Figure 5. This composite mapping is also called bilinear
transformation.
)
[
]
(3)
) from
and
(4)
Figure 6: The cut-physical-domain having four hypothetical sides AB, CD, AC, and BD
Two types of grid are generated, i.e., one with uniform spacing and one with spacing
that is smaller at one face and gradually increases as it approaches the other face. In other
words, there is higher number of grids where the grid spacing is small and it gradually becomes
less as the grid spacing increases. This is done via a stretching function.
In this project, for the uniform grid generation, the computational domain
is a
unit-square uniform grid and then transformed by means of TFI to generate the uniform
grid. However, for the non-uniform grid mentioned above, additional coordinate system
is used as the computational domain that has unit-square uniform grid. Then, via the stretching
function it is transformed to
coordinate system to become a unit-square non-uniform
(clustered) grid. This finally will be transformed to
coordinate system as non-uniform
(clustered) grid in the physical domain.
Figure 7 and Figure 8 show normalized uniform grid with number of grids of 21 X 51 and
21 X 21. It can be seen that the larger the number of grids, the smoother the geometry will be.
Figure 9(a) and (b) show the normalized clustered grid with number of grids of 21x51
and stretching parameter, , of 1.01. Figure 10 shows a normalized clustered grid with the
same number of grids as that in Figure 9, but with
. Comparing Figure 9 and Figure 10,
one can notice that the latter does not show any clustering. This is because high will make the
slope of the stretching function ( ) approaches constant. In order to have clustered grid the
slope,
, must be small to get high density grid and large to get low density grid. This trend can
0.8
x coord
0.6
0.4
0.2
0
0
0.2
0.4
0.6
0.8
z coord
Figure 11: Plot of vs at
. The slope is small near the air foil surface ( value close to zero)
and becomes larger as it approaches the air outer boundary
x coord
0.8
0.6
0.4
0.2
0
0
0.2
0.4
0.6
0.8
z coord
Figure 12: Plot of vs at
. The slope is nearly constant which explains why at this value of , the
grid clustering is not obvious
% Lower Boundary
xLower=ki(1,:);
yLower=0*ki(1,:);
% Upper boundary
xUpper=xLower;
yUpper=0*ki(1,:);
% Left Boundary
[xLeft,yLeft]=Karman_Treffetz_Airfoil(NJ) %given in appendix B
chord = (max(xLeft)-min(xLeft))
% Right Boundary
xRight=4*chord*cos(2*pi*eta(:,1));
yRight=4*chord*sin(2*pi*eta(:,1));