You are on page 1of 65

Computation of Potential Flow around Circular

Cylinder By Finite Element Method


By
S. M. Rashidul Hasan
Student No: 0112013
A Thesis submitted in partial fulfillment
of the requirements for the Degree of
Bachelor of Science in Naval Architecture & Marine Engineering
at the
Bangladesh University of Engineering & Technology (BUET)
MAY 2007
Signature of the Author _______________

Certified by ________________________ Associate Professor Dr. Shahjada Tarafdar
Thesis Supervisor
1
Computation of Potential Flow around Circular
Cylinder By Finite Element Method
by
S. M. Rashidul Hasan
Submitted to the Department of Naval Architecture & Marine Engineering in partial
fulfillment of the requirements for the Degree of Bachelor of Science in Naval
Architecture & Marine Engineering
Abstract
This thesis presents the Galerkin method for calculating the potential flow around the
circular cylinder partially submerged in water. Galerkin method is used to formulate a
sequence of potential problems that are solved using a Finite Element method.
The governing equations for the calculation of the stream and potential functions are
derived mathematically, where the theory developed here is for a crude discretization of
the cylindrical body. The velocity and pressure distributions on or above the cylinder
have been calculated for both stream and potential functions and shown graphically for
further analysis.
2
Acknowledgements
First of all, I would like to say thanks to the ALL MIGHTY ALLAH for his divine help
in completing this thesis. I am grateful to my parents, who have created my base of this
level, and without their inspiration and guidance, I could not be at this stage now.
I would like to express my sincere gratitude to my thesis supervisor, Dr. Shahjada
Tarafder, Associate Professor of the department of Naval Architecture & Marine
Engineering, BUET for his constant support during the production of this thesis, without
whose continuous supervision, help, suggestions, inspiration, this thesis may not be
completed.
I am very much grateful to all of my friends, especially Md. Mukammilur Rahman, Md.
Touhidul Islam, Tayebul Islam, Md. Monjurur Rahman; those helped and supported me a
lot for bringing out this thesis. I also want to pay thanks to all of those people, who have
helped me that I have not mentioned here.
3
Contents
Notation 6
List of Figures 8
Chapter 1 9
Introduction
1.1 History and Motivation 9
1.2 Finite Element Method 10
Chapter 2 11
Confined Flow Around a Circular Cylinder
2.1 Stream Function Formulation 12
2.2 Formation of the Applied Boundary Condition 12
2.3 Stream Function Calculation 12
2.4 Calculation of A
NM
For All Elements 14
2.5 Velocity Potential Function Formulation 20
2.6 Formation of the Applied Boundary Condition 20
2.7 Potential Function Calculation 21
Chapter 3 24
Result and Discussion 24
3.1 Stream Function 24
3.2 Velocity Potential Function 25
3.3 Error Analysis 26
Chapter 4
Conclusion 28
4
References 42
Appendix A 43
Development of the Finite Element Equation 43
Appendix B 44
The Assembly of the Element Matrices 44
Appendix C 47
Modification of the Global Finite Element Equations
for the Boundary Conditions 47
Appendix D 50
Velocity Calculation 50
Appendix E 51
Formation of the Flux vector, F
N
51
Appendix F 54
Output of the Program for Calculating Stream and
Velocity Potential Function 54
5
Notation
U The Fluid Velocity in the Flow Field
Domain
u ,u The Velocity Components
Potential Function
Stream Function
y

Operator
n Direction to the Normal of the Surface
a-b-c-d-e-f-g The boundary points of the domain

N
Nodal value of

N
Interpolation function

A
Stream function value at point A

B
Stream function value at point B

N
The Interpolation Function Corresponding to the Boundary
Flux or the Normal Gradient of the Stream Function
A Area of the Element
x
1,
x
3,
x
2
x Coordinates of the Elementary Triangle
y
1
,y
2,
y
3
y Coordinates of the Elementary Triangle
N Total Number
Residual Value
x Horizontal Direction
y Vertical Direction
A
NM
The Coefficient Matrix
F
N
The Flux Vector
Surface on the Domain
F The Total Number of Nodes
E The Total Number of Elements

(
e
)
The Boolean matrix
6

e
Local Element
G The Total Number of Nodes in the Global Domain of Study
V
x
Velocity at x
7
List of Figures
2.1 Flow Around a Circular Cylinder 29
2.2 The Applied Boundary Conditions on the Domain 29
2.3 Finite Element Discretization for Stream Function Calculation for
Flow around the Circular Cylinder 30
2.4 Crude Discretization 30
2.5 Local and Global Nodes for Elements 1 and 2 31
2.6 Local and Global Nodes for Elements 3 and 4 31
2.7 Local and Global Nodes for Elements 5 and 6 32
2.8 Local and Global Nodes for Elements 7 and 8 32
2.9 Local and Global Nodes for Elements 9 and 10 33
2.10 The Applied Boundary Conditions on the Domain 33
3.1 Stream Function Contours 34
3.2 Velocity Distributions along the Vertical Line above the Crest of Cylinder 34
3.3 Finite Element Discretization for Potential Function Calculation
for Flow around the Circular Cylinder 35
3.4 Velocity Potential Function Contour 35
3.5 Pressure Distributions on the Cylinder 36
3.6 Velocity Profile along Cylinder 36
3.7 Velocity Profile on Crest above Cylinder 37
3.8 Stream Function together with the Velocity Potential
Function, Intersecting themselves Perpendicularly 38
C1 Neumann Boundary Conditions 39
D1 Flow Around a Cylinder. (A) Entire Domain (B) Quadrant Boundaries
(C) Upper Half Boundaries 40
E1 Boundary Velocities for Potential Boundary Conditions 41

8
Chapter 1
Introduction
1.1 History and Motivation
The finite-element method originated from the needs for solving complex elasticity,
structural analysis problems in civil engineering and aeronautical engineering. Its
development can be traced back to the work by Hrennikoff.A (1941).While the
approaches used by these pioneers are dramatically different, they share one essential
characteristic: mesh discretization of a continuous domain into a set of discrete sub-
domains. Hrennikoff's work discretizes the domain by using a lattice analogy while
Courant's approach divides the domain into finite triangular sub regions for solution of
second order elliptic partial differential equations (PDEs) that arise from the problem of
torsion of a cylinder. Courant's contribution was evolutionary, drawing on a large body of
earlier results for PDEs developed by Rayleigh, Ritz, and Galerkin. Development of the
finite element method began in earnest in the middle to late 1950s for airframe and
structural analysis and picked up a lot of steam at Berkeley in the 1960s for use in civil
engineering. An analysis of The Finite Element Method, and has since been generalized
into a branch of applied mathematics for numerical modeling of physical systems in a
wide variety of engineering disciplines, e.g., electromagnetism and fluid dynamics.
The main difficulties of the requirements of using the method for the fluid dynamical
problems are because of the requirement to solve Neumann boundary condition for an
inviscid flow problem, and Dirichlet boundary condition in a fourth order partial
differential equation with the stream function.
The development of the finite element method in structural mechanics is often based on
an energy principle, e.g., the virtual work principle or the minimum total potential energy
principle, which provides a general, intuitive and physical basis that has a great appeal to
structural engineers.
9
1.2 Finite Element Method
Mathematically, the finite element method (FEM) is used for finding approximate
solution of partial differential equations (PDE) as well as of integral equations such as the
heat transport equation. The solution approach is based either on eliminating the
differential equation completely (steady state problems), or rendering the PDE into an
equivalent ordinary differential equation, which is then solved using standard techniques
such as finite differences, etc.
In solving partial differential equations, the primary challenge is to create an equation
that approximates the equation to be studied, but is numerically stable, meaning that
errors in the input data and intermediate calculations do not accumulate and cause the
resulting output to be meaningless. There are many ways of doing this, all with
advantages and disadvantages. The Finite Element Method is a good choice for solving
partial differential equations over complex domains (like cars and oil pipelines), when the
domain changes (as during a solid state reaction with a moving boundary), or when the
desired precision varies over the entire domain. For instance, in simulating the weather
pattern on Earth, it is more important to have accurate predictions over land than over the
wide-open sea, a demand that is achievable using the finite element method.
10
Chapter 2
Confined Flow around a Circular Cylinder
The irrotational flow of an ideal fluid about a circular cylinder, placed with its axis
perpendicular to the plane of the flow between two long horizontal walls as shown in
Figure 2.1, is to be analyzed using the finite element method.
The equation governing the flow is
- U = 0 in
where, U is the fluid velocity in the flow field. The velocity components u and v with
respect to the stream and velocity potential functions and can be expressed as
y
u

,
y
v

and
x
u

,
y
v



Now the problem can be constructed by specifying the following boundary condition.
In either case, the velocity field is not affected by a constant term U. To determine the
constant state of the solution, which does not affect the velocity field, we arbitrarily set
the functions and equal to zero (or a constant) on appropriate boundary lines. We
analyze the problem using both formulations. For both, symmetry exists about the
horizontal and vertical centerlines; therefore, only a quadrant of flow region is used as the
computational domain.
2.1 Stream Function Formulation
11
The problem of flow around a circular cylinder with respect to the stream function as
shown in Figure 2.2 can be defined by the Laplace equation
0
y x
2
2
2
2


with the following boundary conditions:
(a) = (y) on ab
(b) = 2 on bd
(c)
0
n


on dc
(d) = 0 on agc
2.2 Formation of the Applied Boundary Condition
he value of stream function
a
at a particular point a is referenced as zero, we have

b
= 2 for the free stream velocity V
x
= 1, with values of linearly varying from 0 to 2
between a-b and 2 between b-d as shown in Figure 2.2. Thus the values can be
prescribed along the boundaries g-a-b-d to be imposed as Dirichlet boundary conditions.
All Neumann boundary conditions as calculated are zero (n
1
=1, n
2
= 0) along the
boundaries a-b and c-d
2.3 Stream Function Calculation
Choice of domains in the direction of flow is arbitrary, but the free stream velocity is
considered to prevail at distances sufficiently far from the cylinder. Triangular elements
and nodes are numbered in the shorter direction, rather than longer. Moreover, the
numbering does not zigzag but moves toward the same direction as shown in the Figure
2.3. These schemes reduce the adjacent nodes number differences to a minimum and
contribute to a narrowly banded matrix such that more stable and accurate solutions may
be obtained. Since the realistic discretization yields a large number of equations, let us
consider a crude approximation represented in Figure 2.4 for numerical demonstration
12
purposes.
The stream function is considered to vary linearly within an element and is related by
) 3 , 2 , 1 N (
N N


where,
N
is the nodal value of and
N
is an interpolation function. The
interpolation function
N
for the triangular element can be written as,
N N N N
c x b a + +
(2.1)
where,
A 2
y x y x
a
2 3 3 2
1

A 2
y x y x
a
3 1 1 3
2

A 2
y x y x
a
1 2 2 1
3

A 2
y y
b
3 2
1

A 2
y y
b
1 3
2

A 2
y y
b
2 1
3

(2.2)
A 2
x x
c
2 3
1

A 2
x x
c
3 1
2

A 2
x x
c
1 2
3

with A, the area of the triangular element. The finite element equation is of the form of
A
NM

M
= F
N
(see Appendix-A) (2.3)
in which A
NM
and F
N
the are called the coefficient matrix and the flux vector
respectively.

d A
i , M i , N NM
and

d n , F
N i i N
Expanding the finite element equation (2.3) we obtain,
13
1
1
1
]
1

1
1
1
]
1

1
1
1
]
1

3
2
1
3
2
1
3 3 3 2 3 1
1 3 2 2 2 1
1 2 1 2 1 1
F
F
F
A A A
A A A
A A A
(2.4)
where,
( )


+ d d A
2 , 1 2 , 1 1 , 1 1 , 1 i , 1 i , 1 11
( ) ( )


+ + dz dx dy c b d c b
2
1
2
1
2
1
2
1
For unit thickness perpendicular to the x-y plane, we obtain
( )
2
1
2
1 11
c b A A + (2.5)
All the other coefficients can be determined similarly and we have
14
1
1
1
]
1

+ + +
+ + +
+ + +

2
3
2
3 2 3 2 3 1 3 1 3
2 3 2 3
2
2
2
2 1 2 1 2
1 3 1 3 1 2 1 2
2
1
2
1
N M
c b c c b b c c b b
c c b b c b c c b b
c c b b c c b b c b
A A
(2.6)
To calculate A
NM
for all elements, it is necessary first to number the element nodes
arbitrarily but counterclockwise. The counterclockwise numbering of the element nodes
is required as the area A becomes negative in the equation 2.1 otherwise.
2.4 Calculation of A
NM
for All Elements
Element 1
The coordinate values of element 1 and 2, as shown in the Figure2.5, are
x
1
= 0 x
2
= 0 x
3
= 2.5
y
1
= 2 y
2
= 1 y
3
= 2
and
b
1
= -0.4 b
2
= 0 b
1
= 0.4
c
1
= 1 c
2
= -1c
3
= 0
1
1
1
]
1

2 . 0 0 2 . 0
0 2 5 . 1 2 5 . 1
2 . 0 2 5 . 1 4 5 . 1
1 A
N M
15
Element 2
x
1
= 0 x
2
= 2.5x
3
= 2.5
y
1
= 1 y
2
= 1 y
3
= 2
and
b
1
= -0.4 b
2
= 0.4 b
3
= 0
c
1
= 0 c
2
= -1 c
3
= 1
1
1
1
]
1

2 5 . 1 2 5 . 1 0
2 5 . 1 4 5 . 1 2 . 0
0 2 . 0 2 . 0
2 A
N M
Element 3
The coordinate values of element 3 and 4, as shown in the Figure2.6, are
x
1
= 0 x
2
= 2.5 x
3
= 2.5
y
1
= 1 y
2
= 0 y
3
= 1
and
b
1
= -0.4 b
2
= 0 b
3
= 0.4
c
1
= 0 c
2
= -1 c
3
= 1
1
1
1
]
1



4 5 . 1 2 5 . 1 2 . 0
2 5 . 1 2 5 . 1 0
2 . 0 0 2 . 0
3 ) A (
N M
16
Element 4
x
1
= 0 x
2
= 0 x
3
= 2.5
y
1
= 1 y
2
= 0 y
3
= 0
and
b
1
= 0 b
2
= -0.4 b
3
= 0.4
c
1
= 1 c
2
= -1 c
3
= 0
1
1
1
]
1

2 . 0 2 . 0 0
2 . 0 4 5 . 1 2 5 . 1
0 2 5 . 1 2 5 . 1
4 ) A (
N M
Element 5
The coordinate values of element 5 and 6, as shown in the Figure2.7, are
x
1
= 2.5 x
2
= 3 x
3
= 3.5
y
1
= 2 y
2
= 1.5 y
3
= 2
and
b
1
= -1 b
2
= 0 b
3
= 1
c
1
= 1 c
2
= -2 c
3
= 1
17
1
1
1
]
1

5 . 0 5 . 0 0
5 . 0 1 5 . 0
0 5 . 0 5 . 0
5 ) A (
N M
Element 6:
x
1
= 2.5 x
2
= 2.5 x
3
=3
y
1
= 2 y
2
= 1 y
3
= 1.5
and
b
1
= -1 b
2
= -1 b
3
= 2
c
1
= 1 c
2
= -1 c
3
= 0
1
1
1
]
1

1 5 . 0 5 . 0
5 . 0 5 . 0 0
5 . 0 0 5 . 0
6 ) A (
N M
Element 7
The coordinate values of element 7 and 8, as shown in the Figure2.8 are
x
1
= 3 x
2
= 3.5 x
3
= 3.5
y
1
= 1.5 y
2
= 1.5 y
3
= 2
and
18
b
1
= -2 b
2
= 2 b
3
= 0
c
1
= 0 c
2
= -2 c
3
= 2
1
1
1
]
1

5 . 0 5 . 0 0
5 . 0 1 5 . 0
0 5 . 0 5 . 0
7 ) A (
N M
Element 8
x
1
= 3 x
2
= 3.5 x
3
= 3.5
y
1
= 1.5 y
2
= 1 y
3
= 1.5
and
b
1
= -2 b
2
= 0 b
3
= 2
c
1
= 0 c
2
= -2 c
3
= 2
1
1
1
]
1

1 5 . 0 5 . 0
5 . 0 5 . 0 0
5 . 0 0 5 . 0
8 ) A (
N M
Element 9
The coordinate values of element 9 and 10, as shown in the Figure2.9, are
x
1
= 2.5 x
2
= 3.5 x
3
= 3
y
1
= 1 y
2
= 1 y
3
= 1.5
19
and
b
1
= -1 b
2
= 1 b
3
= 0
c
1
= -1 c
2
= -1 c
3
= 2
1
1
1
]
1

1 5 . 0 5 . 0
5 . 0 5 . 0 0
5 . 0 0 5 . 0
9 ) A (
N M
Element 10:
x
1
= 2.5 x
2
= 2.5 x
3
= 3.5
y
1
= 1 y
2
= 0 y
3
= 1
and
b
1
= -1 b
2
= 0 b
3
= 1
c
1
= 1 c
2
= -1 c
3
= 0
20
1
1
1
]
1

5 . 0 0 5 . 0
0 5 . 0 5 . 0
5 . 0 5 . 0 1
1 0 ) A (
N M
These element matrices are now to be assembled with the help of the following equation

(see Appendix-B)
(2.7)
where,



10
1 e
) e (
M
) e (
N
) e (
NM
A A
and,


) e (
NM
) e (
N
F F
with N, M = 1,2,3 and , 1,2,.10 . Since, the line 8-9-10 is the constant
streamline, we may set 0 along this line. Thus we must have 1 , at node 4
and 2 at nodes 1,2 and 3 as calculated from the equation D2 of Appendix-D.
These are the Dirichlet Boundary conditions. All the Neumann boundary conditions are
satisfied by setting ,
i
n
i
= 0 or F
N
= 0 for the entire vertical boundary nodes. The
assembled global finite element equations (2.7) must now be modified for the boundary
conditions. Now we can write using the method described at Appendix-C,
21
1
1
1
1
1
1
1
1
1
]
1

2 1 0 0 0 0 0
1 4 1 0 0 0 0
0 1 9 . 4 0 0 0 0
0 0 0 1 0 0 0
0 0 0 0 1 0 0
0 0 0 0 0 1 0
0 0 0 0 0 0 1

1
1
1
1
1
1
1
1
1
]
1

7
6
5
4
3
2
1
= ) 8 . 2 (
1
1 2
4 . 0 5 . 2
1
2
2
2
1
1
1
1
1
1
1
1
1
]
1

+
+

Discarding the first four equations, we only need to solve
1
1
1
]
1

2 1 0
1 4 1
0 1 9 . 4

1
1
1
]
1

7
6
5
=
1
1
1
]
1

1
3
9 . 2
(2.9)
From the matrix above, we get the following equations,
4.9
5

6
2.9 (2.10)

5
+ 4
6

7
3
(2.11)

6
+ 2
7
1
(2.12)
Solving the above equations, we get,

5
= 0.845
22

6
= 1.241

7
= 1.120
Since the stream function is assumed to be linear between the nodes, velocity is constant.
Therefore, we may use the formula as described in the Appendix-D
)
y y
( V
a b
a b
x

(2.13)
Putting the values of stream function for different points we get
(V
x
)
3-7
= 1.76
(V
x
)
7-10
= 2.24
(V
x
)
4-8
= 1
(V
x
)
9-10
= 0
where,
1

2

3
2

4
1 ,
5
0.845,
6
1.241,
7
1.12,

8

9

10
0
2.5 Velocity Potential Function Formulation
Calculation with the velocity potential formulation differs very slightly from those of
stream function formulation. The globally assembled coefficient matrix is identical. Only
the boundary conditions are different. The problem of flow around a circular cylinder
with respect to the stream function as shown in Figure 2.10 can be defined by the Laplace
equation
0
y x
2
2
2
2


with the following boundary conditions:
a)
1

on ab
b)
0

on bd
c)
0
on dc
23
d)
0

on agc
2.6 Formation of the Applied Boundary Condition
If the velocity function used in the finite element equations, the apparent boundary
conditions is that is constant along a-b and d-c (only a quadrant is used). The reference
values may be specified as Dirichlet conditions along d-c. However, the entrance face
subject to the Neumann condition of the type. The condition = constant along a-b need
not to be applied because the Neumann condition must be applied here to introduce the
input information. Along the boundaries b-d and a-g-c, the Neumann conditions ,
i
n
i
=
V
i
n
i
= 0 are automatically satisfied by setting
F
N
= 0.
If the entire upper- half domain is used, then
x
v
n


must also be applied along e-f.
2.7 Potential Function Calculation
For the problem of the potential function calculation shown in Figure 2.4, we may set
3
=
7
=
10
= 0, or any convenient number for a reference value. We now have the
Neumann boundary condition F
N
0

d n v d n , F
N i i N i i N
(See Appendix-E)
(2.14)
From the equation 2-35 with V
x
= 1, V
y
= 0, n
1
= 1, n
2
= 0, and l = 1 for boundaries 1-4
and 4-8, we obtain
24
1
]
1

1
]
1

1
1
2
1
1
1
2
l V
F
x
N
(See Appendix-E)
For all other boundaries F
N
= 0 and thus the assembled input vector is of the form
F

E
1 e
) e (
N
) e (
N
F

1
]
1


1 0 . , . . . . . . . . . . 2 , 1 E
1 0 . , . . . . . . . . . . 2 , 1
or,
T
F
1
]
1

0 0
2
1
0 0 0 1 0 0
2
1

25
Thus the global equations take the form
26
1
1
1
1
1
1
1
1
1
1
1
1
1
1
]
1

1
1
1
1
1
1
1
1
1
1
1
1
1
1
]
1

1
1
1
1
1
1
1
1
1
1
1
1
1
1
]
1

0 . 0
0 . 0
5 . 0
0 . 0
0 . 0
0 . 0
0 . 1
0 . 0
0 . 0
5 . 0
1 0
9
8
7
6
5
4
3
2
1
5 . 1
0 . 0
0 . 0
5 . 0
5 . 0
5 . 0
0 . 0
0 . 0
0 . 0
0 . 0
0 . 0
9 5 . 1
2 . 0
0 . 0
0 . 0
7 5 . 1
0 . 0
0 . 0
0 . 0
0 . . 0
0 . 0
2 . 0
4 5 . 1
0 . 0
0 . 0
0 . 0
2 5 . 1
0 . 0
0 . 0
0 . 0
5 . 0
0 . 0
0 . 0
0 . 2
0 . 1
0 . 0
0 . 0
5 . 0
0 . 0
0 . 0
5 . 0
0 . 0
0 . 0
0 . 1
0 . 4
0 . 1
0 . 0
5 . 0
0 . 1
0 . 0
5 . 0
7 5 . 1
0 . 0
0 . 0
0 . 1
9 . 4
4 . 0
0 . 0
2 5 . 1
0 . 0
0 . 0
0 . 0
2 5 . 1
0 . 0
0 . 0
4 . 0
9 . 2
0 . 0
0 . 0
2 5 . 1
0 . 0
0 . 0
0 . 0
5 . 0
5 . 0
0 . 0
0 . 0
0 . 1
0 . 0
0 . 0
0 . 0
0 . 0
0 . 0
0 . 0
1
2 5 . 1
0 . 0
0 . 0
4 5 . 2
2 . 0
0 . 0
0 . 0
0 . 0
0 . 0
0 . 0
0 . 0
2 5 . 1
0 . 0
2 . 0
4 5 . 1
F
27
Because
3
=
7
=
10
=0, we may either zero the 3
rd
, 7
th
, and 10
th
rows and columns
with ones at the diagonal or leave them out completely and solve the remaining 7 7
equations. Thus the 7 7 matrix becomes,
28

) 1 5 . 2 (
0 . 0
5 . 0
0 . 0
0 . 0
0 . 1
0 . 0
5 . 0
9
8
6
5
4
2
1
9 5 . 1
2 . 0
0 . 0
7 5 . 1
0 . 0
0 . 0
0 . . 0
2 . 0
4 5 . 1
0 . 0
0 . 0
2 5 . 1
0 . 0
0 . 0
0 . 0
0 . 0
0 . 4
0 . 1
0 . 0
0 . 1
0 . 0
7 5 . 1
0 . 0
0 . 1
9 . 4
4 . 0
2 5 . 1
0 . 0
0 . 0
2 5 . 1
0 . 0
4 . 0
9 . 2
0 . 0
2 5 . 1
0 . 0
0 . 0
1
2 5 . 1
0 . 0
4 5 . 2
2 . 0
0 . 0
0 . 0
0 . 0
0 . 0
2 5 . 1
2 . 0
4 5 . 1
F
1
1
1
1
1
1
1
1
1
]
1

1
1
1
1
1
1
1
1
1
]
1

1
1
1
1
1
1
1
1
1
]
1


29

The equations are
1.45 1 0.2 2 1.25 4 = 0.5
(2-16)
-0.2 1 + 2.45 2 1.25 5 6 = 0
(2-17)
-1.25 1 +2.9 4 - 0.4 5 1.25 8 = 1
(2-18)
-1.25 2 0.4 4 + 4.9 5 6 1.75 9 = 0
(2-19)
- 2 5 + 4 6 = 0 (2-20)
-1.25 4 +1.45 8 0.2 9 = 0.5 (2-21)
-1.75 5 0.2 8 +1.95 9 = 0
(2-22)
Solving the above equations, we get
1 3. 787, 2 1. 204, 3 0, 4 3. 841, 5 1. 261,
6 6. 161, 7 0, 9 1. 49, 10 0
From these values, the average x-velocity between the nodes 6 and 7 is calculated as
(V
x
)
6-7
=
7 6
7 6
x x

=
5 . 0
0 161 . 6
= 1.2322
30
Chapter 3
Result and Discussion
According to the theory developed in chapter two, programs have been done using the
FORTRAN 90 language for the calculation of stream function and velocity potential
function and the output of the program, has been shown in the appendix-F. With the help
of the program, the stream and potential function contours, velocity and pressure of the
flow for all nodes have been calculated, those have been shown graphically bellow.
3.1 Stream Function
The program for stream function formulation has been developed for the discretization,
as shown in the Figure 2.3. The section has been subdivided into 100 elements and 67
nodes in the form of a triangle for the calculation of stream function. Calculation is
carried out for the one-fourth side of the circular cylinder, where the circle radius is a
unit. Total length and height have been taken 3.5 units and 2.0 units respectively and the
height above the cylinder is 1.0 unit. A uniform flow of 1unit length/sec is flowing from
the left side of the cylinder, as show in the Figure 2.3. The elements are taken in the form
31
of a triangular and for the convenience of discretization, thus the edge of the circle here
in this discretization may not appear as a circle.
Two curves has been drawn for stream function calculation, found from the output of the
program, namely stream function contours and velocity distribution. The velocities along
the vertical line above the crest of the cylinder calculated by the equation D2 of the
appendix-D.
It is unfair to compare the results of the present example with the exact solution because
the problem has been solved for the flow around a circular cylinder without discretization
with the help of the interpolation function; rather it has been discretized linearly. The
curve will be farer, if the discretization has been done with the help of interpolation
function.
Figure 3.1 shows us the stream function contours, in which the values have been plotted
in the y-axis against the x coordinate of the node The values of the stream function have
been started from 0.0 to 2.0 at the interval of 0.2. If we need the value of stream function
for other streamline against the x axis, we can find that value by interpolating.
Figure 3.2 shows us the velocity diagram has been drawn against height of the flow point
above the cylinder, where the velocity is plotted in x-axis, and the height is plotted in the
y-axis. The value of velocities has been found here on the crest of the cylinder.
3.2 Velocity Potential Function
The program for the velocity potential function formulation has done for the
discretization as shown in the Figure 3.3. The section has been subdivided into 50
elements and 67 nodes in the form of a quadruple for the calculation of velocity potential
function. Calculation is done for the one-fourth side of the circular cylinder, where the
circle radius is a unit. Total length and height have been taken 3.5 units and 2.0 units
32
respectively and the height above the cylinder is 1.0 unit. A uniform flow of 1unit
length/sec is flowing from the left side of the cylinder, as show in the figure below. The
elements are taken in the form of a rectangle and for the convenience of discretization;
the edge of the circle here in this figure may not appear as a circle.
Figure 3.4 shows the velocity potential function contour. The potential function values
have started from 0.0 to 3.5 at the interval of 0.32. The other values of the velocity
potential function contour can be found by interpolating the two given contour here. The
contours of the velocity potential function are perpendicular to the streamline function
contours.
Figure 3.5 shows us the pressure distribution on the cylinder. The curve is drawn by the
nodal pressure values, found by calculation. The values of pressure is plotted in the x-axis
against the height, in the y-axis
Figure 3.6 shows the velocity profile along the cylinder. The curve is drawn by the nodal
values, found by calculation. The value of the velocity is plotted in the x-axis against the
height, in the y-axis.
The velocity profile on crest above cylinder is drawn in Figure 3.7. The curve is drawn by
the nodal values, found by calculation. The values of velocity is plotted in the x-axis
against the height, in the y-axis
As now we have drawn the stream function and velocity potential function contour, we
can now show that, the streamlines and velocity potential lines cut themselves
perpendicularly, as shown in the Figure 3.8.
3.3 Error Analysis
The results found by the above calculation may be compared with an approximate
analytical solution via the method of images.
33
Formulation

'


)]
H
y
( cos )
H
x
( [cosh
)
H
y 2
sin( )
H
b
( sinh
2
H
y U
2 2
2
(3.1)
) 2 . 3 (
)]
H
y
( cos )
H
x
( [cosh
)
H
y 2
( sin )
H
b
( sinh
2
1
)
H
y
( cos )
H
x
( cosh
)
H
y 2
cos( )
H
b
( sinh
1 U
y y
V
2 2 2
2 2
2 2
2
N
N
x

'

) 3 . 3 (
)]
H
y
( cos )
H
x
( [cosh
)
H
y 2
( sin )
H
b
( sinh
2
1
)
H
y
( cos )
H
x
( cosh
)
H
y 2
cos( )
H
b
( sinh
1 U
x x
V
2 2 2
2 2
2 2
2
N
N
y

'




Formulation
(3.4)
)] ( cos ) ( [cosh
)
2
( sin ) ( sinh
2
1
) ( cos ) ( cosh
)
2
cos( ) ( sinh
1
2 2 2
2 2
2 2
2

'

H
y
H
x
H
y
H
b
H
y
H
x
H
y
H
b
U
x x
V
N
N
x



(3.5)
)]
H
y
( cos )
H
x
( [cosh
)
H
y 2
( sin )
H
b
( sinh
2
1
)
H
y
( cos )
H
x
( cosh
)
H
y 2
cos( )
H
b
( sinh
1 U
y y
V
2 2 2
2 2
2 2
2
N
N
y

'

in which x and y are the coordinates with origin at the centers of the cylinder, b is the
radius and H is the vertical distance between the two plates
34
Chapter 4
Conclusions
The objectives of this paper were met with mixed success. In this case, a decent result
was obtained for stream function contour, velocity distributions along the vertical line
above the crest for stream function, velocity potential function contour, pressure
distribution on the cylinder, velocity profile along the cylinder, velocity profile on crest
above cylinder.
Generally, the accuracy of the finite element solution is expected to improve with finer
mesh and higher order interpolation functions. Irregular mesh configurations with needle-
like elements contribute to deterioration of the accuracy.
35
Figures

Figure 2.1 Flow around a Circular Cylinder


36
0

2
( y)
2
0
( y)
( y)
0
Figure 2.2 The Applied Boundary Conditions on the Domain
Figure 2.3 Finite Element Discretization for Stream Function Calculation
for Flow around the Circular Cylinder
37
Figure 2.4 Crude discretization
Figure 2.5 Local and Global Nodes for Elements 1 and 2
38
Figure 2.6 Local and Global Nodes for Elements 3 and 4
Figure 2.7 Local and Global Nodes for Elements 5 and 6
39
Figure 2.8 Local and Global Nodes for Elements 7 and 8
Figure 2.9 Local and Global Nodes for Elements 9 and 10
1

1
n


0
n


40
Figure 2.10 The Applied Boundary Conditions on the Domain
0 . 8
0 . 4
0 . 0
2 . 0
1 . 6
1 . 2
Figure 3.1 Stream Function Contours
41
Figure 3.2 Velocity Distributions along the Vertical Line above the Crest of Cylinder

Figure 3.3 Finite Element Discretization for Potential Function Calculation
for Flow around the Circular Cylinder
42

Figure 3.4 Velocity Potential Function Contour


43
Figure 3.5 Pressure Distributions on the Cylinder
0
0.2
0.4
0.6
0.8
1
1.2
0 0.5 1 1.5 2
VELOCITY
Y
Figure 3.6 Velocity Profile along Cylinder
44
0
0.5
1
1.5
2
2.5
0 0.5 1 1.5 2
velocity
y
Figure 3.7 Velocity Profile on Crest above Cylinder
45
0.8

0.4
0.0

2.0
1.6

1.2

1.6
2.0
0.4

0.8

1.2

Figure 3.8 Stream Function together with the Velocity Potential Function,
Intersecting Themselves Perpendicularly Boundary Conditions
46
i i
n u,


l
ds s
e
n
g
e
b N
F
0
) (
) ( ) (
) (
Figure C1 Neumann Boundary Conditions
47

(y)
0
2
( y)
( y)
Figure D1 Flow around a Cylinder. (a) Entire Domain (b) Quadrant Boundaries
(c) Upper Half oundaries
48
2
x
V
2
y
V
i i
n V N
2 2

i i
n V N
1 1

1
x
V
1
y
V
Figure E1 Boundary Velocities for Potential Boundary Conditions
49
References:
Anon (1982): Finite Element Methods in Engineering, 1982, CP
Arfken, G. (1985): Mathematical Methods for Physicists, 3rd ed. Orlando, FL: Academic
Press, pp. 502~504
Bose T. K. (1988): Computational Fluid Dynamics, Wigley Eastern Limited,
pp.186~189.
Chung, T.J: Finite Element Analysis in Fluid Dynamics: pp. 68~79, 103~110, 171~184.
Hrennikoff, A. (1941): Solution of problems of elasticity by the frame-work method,
ASME Journal, Applied Mechanics, Vol. 8, A619A715.
Morse, P. M. and Feshbach H. (1953): Boundary Conditions and Eigen functions,
Chapter 6 in Methods of Theoretical Physics, Part I. New York: McGraw-Hill, pp. 495-
498 and 676-790
Reddy, J. N. (1993): An Introduction to the Finite Element Method, McGraw-Hill, Inc.
pp.355-364
Vallentine H. R (1963): Applied Hydrodynamics, Butterworth & Co. Limited.
50
Appendix A
Development of the Finite Element Equation
In the potential flow problem, either stream functions or velocity potentials are
calculated. Velocity distributions then follow from
j ij i
V
(A1)
The stream function may be approximated from the Laplace equation within a finite
element in the form
N N

(A2)
with N = 1, 2, 3.r (r is the total number of nodes in the elements). Let the residual be
equated to a residual . Then we have

2
( A2)
Let us now consider an orthogonal projection of the residual space (equation A2), onto a
subspace spanned by the interpolation function

acting as weighting function in the


sense of Galerkin. This process is represented by
( ) 0 d , ,
N ii N

(A3)
Using Green-Gauss theorem in the equation A3, we get,

0 d , d n ,
i , N i N i i

'

d n , d
N i i M i , M i , N (A4)
where,

N
is the interpolation function corresponding to the boundary flux or the
normal gradient of the stream function. Using the simplified notations, we write
A
NM

M
= F
N
(A5)
in which A
NM
and F
N
the are called the coefficient matrix and the flux vector
respectively.

d A
i , M i , N NM

and

d n , F
N i i N
51
Appendix-B
The assembly of the element matrices
Consider the second order partial differential equations of the form:
0 f u
2
+ in (B1)
u = 0 on
1
(B2a)
u = u
0
on
2
(B2b)
0
n
u

on
3
(B3a)
g
n
u

on
4

(B3b)
Recall that equation (B2) and (B3) are Dirichlet (essential) and Neumann (natural)
boundary conditions, respectively. Using index notations, we re-write equation (B1) as
u,
ii
+ f = 0 (B4a)
and the normal derivative takes the form
i i
n , u
n
u


(B4b)
where i = 1,2 for two-dimensional problems and i = 1,2,3 for three dimensional problems,
and n
i
denotes the component of a vector normal to the boundary surface.
The local and global interpolation functions
N
(e) and

for the variable u are related


by
) ( ) ( ) (
,
e
N
e
N
e
u u

(B5a)



E
e
e
N
e
N
E
e
e
N
e
N
E
e
e
u u u u
1
) ( ) (
1
) ( ) (
1
) (

or,
u u

(B5b)
52


E
e
e
N
e
N
1
) ( ) (

(B5c)
where N = 1,2,3..F and =1,2.G with F = the total number of nodes in
a local element
e
and G = the total number of nodes in the global domain of study ( ),
E is the total number of elements and

(
e
)
is the Boolean matrix.
If approximations of equation B5 are inserted into B4, then B4 may not be satisfied. Thus
we introduce residual such that
U,ii + f =
The Galerkin finite element equation takes the form
0 ) ( ) , (
,
+

d f u
ii

Integrating by parts yields




d ) f , u ( n , u ) , (
i , i i i
(B6)



+ 0 d f u ) d ( d ) s ( g
i , i ,
Here the interpolation function

, which interpolates u in, changes its role on
the boundaries. Namely, by virtue of the Green-Gauss theorem, the variation of g = u,
i
n
i
is to be interpolated along the boundary surface , not within the domain . Thus

( x) is changed to

(s), which regard as an interpolation function for u,


i
n
i
.
The local boundary interpolation function

(
e
)
is related by



E
e
e
N
e
N
s s
1
) ( ) (
) ( ) (

It should be noted that the indices and N refer only the boundary nodes and the
summation

E
e 1
also involves only boundary surface elements. An example of

(
e
)
( s)
for a linear variation of g = u,
i
n
i
between the two boundary nodes in two dimensional
problems may taken as
53
2 , 1 N
l
s
,
l
s
1
) e (
N

Where l is the length of the boundary line within an element. With these in mind and in
view of equation (B5c), we obtain global finite element equations

F u A
(7)
Where,



E
1 e
) e (
M
) e (
N
) e (
NM
k A A
(B8a)


E
1 e
) e (
NM
) e (
N
F F
(B8b)


e
e
) e (
i , M
) e (
i , N
) e (
NM
d A
(B9a)

+
e e
e
) e (
N
) e (
N
) e (
N
d f d f F
(B9b)
Equation B6 can be replaced by

+
e
0 d ) f , u ( ) , (
e
) e (
N
) e ( ) e (
ii
) e (
N
) e (
Proceeding similarly, we obtain
0 d ) f , u ( n , u
e N i , N
) e (
i ,
) e (
N
i
) e (
i
e e



In view of equation B5 we arrive at the local finite element equations as
) e (
N
) e (
M
) e (
NM
F u A
(B10)
The equation B10 can be written in the form

(B11)
where,



10
1 e
) e (
M
) e (
N
) e (
NM
A A
and,


) e (
NM
) e (
N
F F
54
Appendix C
Modification of the Global Finite Element Equations
for the Boundary Conditions
According to the Galerkin methods, the natural boundary conditions automatically appear
in the resulting local finite element equation in the form



d g d n , u F
) e (
N
) e (
N i i
) e (
) b ( N
(C1)
For two-dimensional problems, this integral takes the form as


l
0
) e (
n
) e (
) b ( N
ds ) s ( g F

(C2)
which has schematically shown in the Figure C1
If g = u,
i
n
i
= 0 , then this boundary integral is simply dropped. For the case of ideal flow
(Laplace equation), u is the velocity potential , and we have ,
i
n
i
= V
i
n
i
representing the velocity normal to the boundary surface or prescribed free stream
velocity.
Often in the boundary value problems, there are instances in which the Dirichlet and
Neumann boundary conditions are combined at the same location. For example, in the
heat transfer problems with a resistance layer on the boundary, we may specify
q u n , u
i i
+
(C3)
This is referred to as Cauchy boundary condition and can be handled by substituting
55
u,
i
n
i
= - u - q into equation C1
Since calculating equation C1 and C2 as a part of the finite element equations
automatically satisfies the Neumann boundary conditions, we describe below how to
impose Dirichlet boundary conditions by modifying the global equation. To ward this
end, let us consider global equations of the type.
A
ij
u
j
= F
i
I,j = 1,2,n (C4)
With n being the total number of nodes in the entire domain of study . Let us take the
4 4 equations given by
1
1
1
1
]
1

4 4 4 3 4 2 4 1
3 4 3 3 3 2 3 1
2 4 2 3 2 2 2 1
1 4 1 3 1 2 1 1
A A A A
A A A A
A A A A
A A A A

1
1
1
1
]
1

4
3
2
1
u
u
u
u
=
1
1
1
1
]
1

4
3
2
1
F
F
F
F
(C5)
Assuming that the given boundary conditions requires u
2
= 0. Substituting u
2
= 0 into
equation C5 and replacing the second equation by u
2
= 0, we obtain
1
1
1
1
]
1

4 4 4 3 4 1
3 4 3 3 3 1
1 4 1 3 1 1
A A 0 A
A A 0 A
0 0 1 0
A A 0 A

1
1
1
1
]
1

4
3
2
1
u
u
u
u
=
1
1
1
1
]
1

4
3
1
F
F
0
F
(C6)
56
It is quite obvious that the values of u
1,
u
3,
u
4
are not affected if we strike out the second
row and second column and write
1
1
1
]
1

4 4 4 3 4 1
3 4 3 3 3 1
1 4 1 3 1 1
A A A
A A A
A A A

1
1
1
]
1

4
3
1
u
u
u
=
1
1
1
]
1

4
3
1
F
F
F
(C7)
We may now solve either equation 6 and equation 7. A set of equations can also be
modified if u
2
is not zero but u
2
= a. The same operations as above lead to
1
1
1
1
]
1

4 4 4 3 4 1
3 4 3 3 3 1
1 4 1 3 1 1
0
0
0 0 1 0
0
A A A
A A A
A A A

1
1
1
1
]
1

4
3
2
1
u
u
u
u
=
1
1
1
1
]
1

a A F
a A F
a
a A F
4 2 4
3 2 3
1 2 1
(C8)
Once again, if desired, the second equation may be discarded such that
57
1
1
1
]
1

4 4 4 3 4 1
3 4 3 3 3 1
1 4 1 3 1 1
A A A
A A A
A A A

1
1
1
]
1

4
3
1
u
u
u
=
1
1
1
]
1

a A F
a A F
a A F
4 2 4
3 2 3
1 2 1
(C9)
58
Appendix D
Velocity Calculation
Because of the symmetry as shown in the Figure D1 below, the quadrant a-b-c-d-e-f-g is
used. By inspection we note that the boundaries a-g-c and b-d are streamlines and they
are constants. For the purpose of reference, let 0 along a-g-c. Since the input free
stream velocity is constant along a-b, we may set

b
a
B
A
y
y
x
dy V d
(D1)
Integrating between the limits indicated, we obtain
a b
a b
x
y y
V

(D2)
Since
a
is referenced as zero, we have
b
= 2 for the free stream velocity V
x
= 1
with values of linearly varying from 0 to 2 between a-b and 2 between b-d.
Thus the values can be prescribed along the boundaries g-a-b-d to be imposed as
Dirichlet boundary conditions. All Neumann boundary conditions as calculated are zero
(n1 =1, n2 = 0) along the boundaries a-b and c-d.
If the free stream velocity is not constant but still perpendicular to the entrance face, then
the integral from equation 1 must be evaluated with V
x
as a function of y. If the free
stream velocity is not perpendicular to the entrance face, then F, representing the
Neumann boundary conditions is nonzero. In both of these cases, the symmetry is no
longer maintained and the entire domain must be analyzed. Thus Dirichlet boundary
conditions such as = 0 can be specified along either the top or bottom plate.
59
Appendix E
Formation of the Flux vector, F
N
Let us consider the inclined boundary nodes 1 and 2, as shown in the Figure E1.
Assuming that the velocity distribution between the two nodes is linear, for unit
thickness, we have the following equation of the flux vector,
[ ]



l
0
N y x
l
0
N i j ij N
ds ) x , n cos( V ) y , n cos( V ds n V F
(E1)
In this case, F
N
vanishes regardless of the orientations of the boundary entrance surface.
Physically, F
N
represents the amount of flow parallel to the boundary surface. Obviously
such a flow quantity does not exist. For example parallel to the boundary entrance when
the incoming flow is perpendicular to the entrance.
For boundary velocities with variable magnitude and arbitrary angles to the entrance, we
may approximate
i
M
j M ji i j ji
n V n V


where
l
s
1
1

and
l
s

. Then



l
0
l
0
N i
M
j M ji N i j ji N
ds n V ds n V F
or



l
0
M 2
M
x M N
ds ) n V ( F
(E2)
Integration gives
60
1
1
1
1
]
1

+
+

1
]
1

1
2
y 2
2
x
1
1
y
2
1
x
1
2
y
2
2
x
1
1
y 2
1
x
2
1
N
n V n V
2
n V
2
n V
2
n V
2
n V
n V n V
3
l
F
F
F
(E3)
Here the direction cosines n
1
and n
2
corresponds to the associated nodal velocity. When
the velocity potential is used, we have N N

.
Velocity distributions then follow from
V
i
= ,
i
(for potential function)
The stream function may be approximated from the Laplace equation within a finite
element in the form
N N

. (E4)
with N = 1,2,3.r (r is the total number of nodes in the element),

are the
interpolation functions, and
N
are the nodal values of . Let the residual be equated to
a residual . Then we have

2
(E5)
Let us now consider an orthogonal projection of the residual space (equation E5), onto a
subspace spanned by the interpolation function

acting as weighting function in the


sense of Galerkin. This process is represented by
61
( ,
N
)

,
ii

d 0
(E6)
Using Green-Gauss theorem in the equation E6, we get,


,
i
n
i

N

d

,
i

,
i
d 0
or,

'

d n , d
N i i M i , M i , N (E7)
Here,

N
is the interpolation function corresponding to the boundary flux or the normal
gradient of the stream function.
Using the simplified notations, we write
M M NM
F A
(E8)
Where, A
NM
and F
N
the are called the coefficient matrix and the flux vector respectively.
Thus
A
NM
=

,
i

, i
d
And



d n V F , or
d n , F
N i i N
N i i N
(E9)
It should be noted that
i i
n V
represents the component of the boundary velocities normal
to the surface as shown in the figure E1.Therefore, i i
n V
may be approximated by
i
N
i M
n V

and we have
62



l
0
N i
M
i M N
ds n V F
( E 1 0 )
n V n V
2
n V
2
n V
2
n V
2
n V
n V n V
3
l
F
F
F , o r
2
2
y 1
2
x
2
1
y
1
1
x
2
2
y
1
2
x
2
1
y 1
1
x
2
1
N
1
1
1
1
]
1

+ + +
+ + +

1
]
1

63
Appendix F
Output of the Program for Calculating Stream and Velocity Potential
Function
64
65

You might also like