Download as pdf or txt
Download as pdf or txt
You are on page 1of 81

NAME 363: Computational Fluid Dynamics

Finite Difference Method


Finite Element Method

Prepared by
Dr. Md. Shahjada Tarafder

Department of Naval Architecture and Marine Engineering


Bangladesh University of Engineering & Technology
Dhaka-1000, Bangladesh

Prepared by Dr. Md. Shahjada Tarafder Page 1


Lecture Plan for NAME 363
Lectures Topics to be covered Class Test
1st week Introduction. Governing equations of fluid flow.
nd
2 week Green’s theorem, Boundary integral methods and its application to
radiation and diffraction problems,
Class Test 1
Finite difference method
3rd week Discretization schemes, grid generation, Transformation of physical
domain into computational domain
4th week Finite volume methods Class Test 2
5th week Steady diffusion problems
th
6 week Steady convection-diffusion problems
th
7 week Solution algorithms for pressure-velocity coupling in steady flows Class Test 4
Finite volume method for unsteady flows
th
8 week Free surface flow, free surface computation with linear and fully nonlinear
conditions.
9th week Numerical treatment of fluid-body interface, turbulence modeling.
th
10 week Flow visualization and frictional resistance computation for double body Class Test 4
flows using Navier-Stokes equations
11th week CFD application to free surface flow past ship shape objects using
Reynolds Averaged Navier Stokes Equation (RANSE)
12th week Discretization schemes: Finite Element Method
th
13 week Discretization schemes: Spectral Method
14th week

Materials Distributed into Internal and External Examiners


Internal No. Topics Page No.
Book Versteeg, H. K. and Malalasekera, W.: An introduction to
computational fluid dynamics: The finite volume method
1. Chapter 6: Solution algorithms for pressure-velocity coupling in 135-154
steady flows
2. Chapter 7: Solution of discretized equations 162-165
3. Chapter 8: The Finite volume method for unsteady flows 168-182
4. Chapter 11: Methods for dealing with complex geometries 318-356
External
5. Chapter 2: Conservation laws of fluid motion and boundary 24-26
conditions
6. Chapter 4: The finite volume method for diffusion Problems 85-102
7. Chapter 5: The finite volume method for convection-diffusion 103-134

Prepared by Dr. Md. Shahjada Tarafder Page 2


problems
Book Klaus A Hoffman and Steve T. Chiang: Computational Fluid
Dynamics Volume I
8. Chapter 2: Finite difference formulations 29-54
9 Chapter 9: Grid generation-Structured grids 358-368
Book John D. Anderson: Fundamentals of Aerodynamics
10 Chapter 4: Incompressible flow over airfoils 218-227

Course Outcomes:
Upon completion of the course, the students will be able
• To formulate and solve computational problems arising in the flow of fluids
• To assess the accuracy of a numerical solution by comparison to known solutions of
simple test problems and by mesh refinement studies.
• To predict forces on the airfoils, ship hulls etc.
• To interpret computational results and to write a report conveying the result of the
computational analysis

Course Outcomes:
After successful completion of this course the student should be able:
• To be familiar with the differential equations for flow phenomena and numerical
methods for their solution
• To use and develop flow simulation software for the most important classes of flows in
engineering and science
• To analyze different mathematical models and computational methods for flow
simulations critically
• To undertake flow computations using current best practice for model and method
selection, and assessment of the quality of results obtained.

Finite Element Method


The course provides advanced knowledge on the application of finite element analysis to
engineering applications in linear structural mechanics and heat transfer problems. The course
analyses critically problems involving one, two- and three-dimensional idealizations. The topics
covered include steps in finite element modelling process, behaviour of spring, truss, beam,
plane stress/strain and three-dimensional finite element modelling approaches in structural
mechanics. The heat transfer part of the course examines the conduction and convection
behaviour and analyzing these mechanisms using finite element analysis. Advanced topics
covered include iso parametric formulations and efficient modelling strategies. An individual cap
stone design project applies the finite element methodology to practical engineering design in
structural mechanics through a state of art commercial finite element software.
Prepared by Dr. Md. Shahjada Tarafder Page 3
Learning Outcomes
On successful completion of this course, students should have the skills and knowledge to:
• Interpret the philosophy behind principles, design and modelling considerations in using
finite element analysis.
• Develop stiffness matrices for spring, truss, beam, plane stress problems and three-
dimensional problems using the concept of direct equilibrium and potential energy
methods.
• Develop the finite element formulations for heat transfer problems.
• Evaluating the convergence of solutions using finite element analysis and assess the
accuracy of simulated results.
• Be proficient in the use of commercial finite element software.
• Create and design engineering structures using finite element methods, considering of
safe design limits.
• Communicate effectively through written reports on the creation of optimized design of
engineering structures.
Pre-requisite courses: Numerical Analysis, Mechanics of Water Waves
Reference books:
• Bhavikatti, S. S.: Finite Element Analysis, New Age International Ltd., New Delhi, 2005.
• Dhanaraj, R. & Nair, K. P.: Finite Element Method, Oxford University Press, YMCA
Building, India, 2015.
• Dixit, U. S.: Finite Element Methods for Engineers, Cengage Learning India Pvt. Ltd.,
2009.
• Logan, D. L.: A First Course in the Finite Element Method, PWS Publishing Company,
2nd Edition, USA, 1993.
• Massarotti, N., Arpino, F., Mauro, A. & Nithiarasu, P.: Fundamentals of the Finite
Element Method for Heat and Mass Transfer, Wiley; 1st edition, February 21, 2023.
• Pepper, D. W. and Heinrich, J. C.: The Finite Element Method-Basic Concepts and
Applications, 2nd Edition, Taylor & Francis, New York, 2006.
• Rao, S. S.: The Finite Element Method in Engineering, Fifth Edition, Elsevier Inc. 20011
• Sastry, S. S.: Introductory Methods of Numerical Analysis, PHI Learning Private Ltd.,
New Delhi, 2012.
• Seshu, P.: Textbook of Finite Element Analysis, PHI Learning Private Ltd., New Delhi,
2012.
• Thomson, E. G.: Introduction to the Finite Element Method: Theory, Programming and
applications, John Wiley & Sons, Inc. USA, 2005.
Prepared by Dr. Md. Shahjada Tarafder Page 4
Chapter 1
Introduction

A fluid is said to be a continuous substance (continuum) that begins to form when a shear
force is applied and continues to deform as long as force is applied. Forces imposed on a
fluid may be either surface forces or body forces. A continuum prevails if the number of
molecules in a volume much smaller than the sphere’s sufficiently great so that the
average effects on the fluid properties like pressure, density etc. within the volume are
constant or change smoothly with time.

Fluid flow is caused by the action of externally applied forces like pressure differences,
gravity, shear force, rotation and surface tension. Surface force and body force. The
properties of fluids include density, viscosity, specific heat and surface tension. While all
fluids behave similarly under action of forces, their macroscopic properties differ
considerably. The effects of viscosity are important only near walls, so that the flow in
the largest part to the domain can be considered as inviscid. Fluid obeying Newton’s law
of viscosity is called Newtonian fluid.

Many other phenomena affect fluid flow. These include temperature differences which
lead to heat transfer and density differences which give rise to buoyancy. They and
differences in concentration of solutes may affect flows significantly or even be the sole
cause of the flow. Phase changes (boiling, condensation, melting and freezing) when they
always lead to important modifications for the flow and give rise to multiphase flow.
Variation of other properties such as viscosity, surface tension may also play important
role in determining the nature of the flow. The basic conservation principles and laws
used to derive the governing equations of fluid flow and the techniques for the numerical
solution of the governing equations. The flow within a certain spatial region is called a
control volume and the method analysis is called the control volume approach.

Prepared by Dr. Md. Shahjada Tarafder Page 5


The non-conservative form of equations is often used in finite difference method. To
obtain an approximate solution numerical we have to use a discretization method which
approximates the differential equations by a system of algebraic equations which can be
solved on a computer. The approximations are applied to small domains in space and or
time so the numerical solutions provide results at discrete locations in space and time.
Much as the accuracy of experimental data depends on the quality of the tools used, the
accuracy of numerical solutions is dependent on the quality of discretization used.

Fluid flows are governed by the partial differential equation or integral equation (PDE)
which is derived on the basis of the conservation laws of mass, momentum, and energy.
Computational Fluid Dynamics (CFD) is the art of replacing such PDE systems by a
set of algebraic equations which is be solved by using digital computers. Now-a-days
the various types of CFD techniques have been developed to simulate the fluid flows
involving a wide range of applications. These include
(a) Finite Difference Method (FDM)
(b) Finite Element Method (FEM)
(c) Finite Volume Method (FVM)
(d) Boundary Element Method (BEM)
(e) Spectral Method (SM) and so on.

(a) Potential flow theory: The fluid is continuum, inviscid and obeying Newton’s
law.
(b) Viscous flow theory: The fluid is continuum, viscous and obeys Stokes
postulations for stress and Fourier’s postulation for heat conduction.
(c) Turbulent flow theory: The fluid is continuum, viscous and obeys a set of
turbulent postulations for turbulent Reynolds stress and heat flux respectively.

Prepared by Dr. Md. Shahjada Tarafder Page 6


Mathematical modeling of fluid flow:

Discretization method
This is a method of approximating the differential equations by a system of algebraic
equations for the variables at some sent of discrete locations in space and time. The most
common discretization methods are finite difference method, finite volume method, finite
element method and the boundary element method.

Numerical grid or mesh generation:


In a finite difference method, approximations for the derivatives at the grid points have to
be selected. In a finite volume method, one has to select the methods of approximating
surface and volume integrals. In finite element method, one has to choose the shape
functions and weighting functions.

Solution method:

Prepared by Dr. Md. Shahjada Tarafder Page 7


Convergence criteria:

Prepared by Dr. Md. Shahjada Tarafder Page 8


Chapter 2
Governing Equations of Fluid Flows
One dimensional fluid flow
In case of one-dimensional flow, we have the net mass flow the same at every cross-
section that is
𝜌𝐴𝑢 = 𝑐𝑜𝑛𝑠𝑡𝑎𝑛𝑡
Where  is the density, A is the cross-sectional area and u is the flow velocity.
Differentiating Eq. () we have
𝑑(𝜌𝐴𝑢)
=0
𝑑𝑥
If the fluid is inviscid, there exists a potential function (x) such that
𝑑𝜙
𝑢=
𝑑𝑥
Hence Eq. () becomes
𝑑 𝑑𝜙
(𝜌𝐴 ) = 0
𝑑𝑥 𝑑𝑥

Prepared by Dr. Md. Shahjada Tarafder Page 9


Chapter 3
Finite Difference Method

2.1 Introduction
The derivatives of the dependent variables appearing in the governing partial differential
equation of fluid flows are replaced by algebraic finite difference approximations which
change the differential equation into an algebraic equation that can be solved by simple
arithmetic.

The starting point is the conservation equation in differential form. The solution domain
is covered by a grid. At each grid point, the differential equation is approximated by
replacing the partial derivatives by approximations in terms of the nodal values of the
functions. The result is a system of algebraic equations per grid node in which the
variable value at a certain number of nodes appear as unknowns. Taylor’s series
expansion or polynomial is used to obtain approximations to the first and second
derivatives of the variables with respect to the co-ordinates.

2.2 Finite difference by Taylor series expansion


2.2.1 First order derivative
Using Taylor’s series expansion, the function 𝑢(𝑥 + Δ𝑥) can be expressed as
Δ𝑥 𝜕𝑢 (Δ𝑥)2 𝜕2 𝑢 (Δ𝑥)3 𝜕3 𝑢
𝑢(𝑥 + Δ𝑥) = 𝑢(𝑥) + ( )+ ( 2
)+ ( ) + ⋯⋯⋯ (2.1)
1! 𝜕𝑥 2! 𝜕𝑥 3! 𝜕𝑥 3

(b)
(a)

Prepared by Dr. Md. Shahjada Tarafder Page 10


Fig. 2.1 Geometric interpretation of difference formula

If the points are numbered as i and i+1 as shown in Fig. 2.1(b), Eq. (2.1) can be written
as
𝜕𝑢 (Δ𝑥)2 𝜕2 𝑢 (Δ𝑥)3 𝜕3 𝑢
𝑢𝑖+1 = 𝑢𝑖 + Δ𝑥 ( ) + ( 2
) + ( ) + ⋯⋯⋯ (2.2)
𝜕𝑥 𝑖 2! 𝜕𝑥 𝑖 3! 𝜕𝑥 3 𝑖

Solving for 𝜕𝑢/𝜕𝑥, one obtains


𝜕𝑢 𝑢𝑖+1 −𝑢𝑖 Δ𝑥 𝜕2 𝑢 (Δ𝑥)2 𝜕3 𝑢
( ) = − ( ) − ( ) + ⋯⋯⋯ (2.3)
𝜕𝑥 𝑖 Δ𝑥 2 𝜕𝑥 2 𝑖 6 𝜕𝑥 3 𝑖

The terms with factors of Δ𝑥 and its higher order can be written as 𝑂(Δ𝑥) and is referred
to as the truncation error and is defined as the difference between the exact value and its
numerical approximations.
𝜕𝑢 𝑢𝑖+1 −𝑢𝑖
( ) = + 𝑂(Δ𝑥) (2.4)
𝜕𝑥 𝑖 Δ𝑥

This is known as forward difference formula as the derivative is approximated at point i


using the forward value 𝑢𝑖+1 at point 𝑖 + 1. Similarly, the function 𝑢(𝑥 − Δ𝑥 ) can be
expressed as
Δ𝑥 𝜕𝑢 (Δ𝑥)2 𝜕 2 𝑢 (Δ𝑥 )3 𝜕 3 𝑢
𝑢(𝑥 − Δ𝑥 ) = 𝑢 (𝑥) − ( )+ ( 2) − ( 3) + ⋯ ⋯ ⋯
1! 𝜕𝑥 2! 𝜕𝑥 3! 𝜕𝑥
Writing in terms of node number yields
𝜕𝑢 (Δ𝑥)2 𝜕2 𝑢 (Δ𝑥)3 𝜕3 𝑢
𝑢𝑖−1 = 𝑢𝑖 − Δ𝑥 ( ) + ( ) − ( ) + ⋯⋯⋯ (2.5)
𝜕𝑥 𝑖 2! 𝜕𝑥 2 𝑖 3! 𝜕𝑥 3 𝑖

Solving for 𝜕𝑢/𝜕𝑥, one obtains


𝜕𝑢 𝑢𝑖 −𝑢𝑖−1 Δ𝑥 𝜕2 𝑢 (Δ𝑥)2 𝜕3 𝑢
( ) = + ( ) − ( ) + ⋯⋯⋯ (2.6)
𝜕𝑥 𝑖 Δ𝑥 2 𝜕𝑥 2 𝑖 6 𝜕𝑥 3 𝑖

Prepared by Dr. Md. Shahjada Tarafder Page 11


𝑢𝑖 −𝑢𝑖−1
= + 𝑂(Δ𝑥 ) (2.7)
Δ𝑥

This is known as backward difference formula as the derivative is evaluated at point i


using the backward value 𝑢𝑖−1 . Subtracting Eq. (2.5) from Eq. (2.2) one obtains
𝜕𝑢 (Δ𝑥)3 𝜕3 𝑢
𝑢𝑖+1 − 𝑢𝑖−1 = 2 Δ𝑥 ( ) + 2 ( ) + ⋯⋯⋯ (2.8)
𝜕𝑥 𝑖 3! 𝜕𝑥 3 𝑖

Solving for 𝜕𝑢/𝜕𝑥, one obtains


𝜕𝑢 𝑢𝑖+1 −𝑢𝑖−1
( ) = + 𝑂(Δ𝑥)2 (2.9)
𝜕𝑥 𝑖 2 Δ𝑥

This is known as central difference formula as the derivative is approximated at the


central point i using the forward functional value 𝑢𝑖+1 and the backward functional value
𝑢𝑖−1 .

2.2.2 Second order derivative


Again, consider the Taylor series expansion
𝜕𝑢 (Δ𝑥)2 𝜕2 𝑢 (Δ𝑥)3 𝜕3 𝑢
𝑢𝑖+1 = 𝑢𝑖 + Δ𝑥 ( ) + ( 2
) + ( ) + ⋯⋯⋯ (2.10)
𝜕𝑥 𝑖 2! 𝜕𝑥 𝑖 3! 𝜕𝑥 3 𝑖

𝜕𝑢 (2 Δ𝑥)2 𝜕2 𝑢 (2 Δ𝑥)3 𝜕3 𝑢
𝑢𝑖+2 = 𝑢𝑖 + 2 Δ𝑥 ( ) + ( 2
) + ( ) + ⋯⋯⋯ (2.11)
𝜕𝑥 𝑖 2! 𝜕𝑥 𝑖 3! 𝜕𝑥 3 𝑖

Multiplying Eq. (2.10) by 2 and then subtracting it from Eq. (2.11) we obtain
𝜕2 𝑢 𝜕3 𝑢
𝑢𝑖+2 − 2 𝑢𝑖+1 = −𝑢𝑖 + (Δ𝑥)2 ( ) + 2 (Δ𝑥)3 ( ) + ⋯⋯⋯ (2.12)
𝜕𝑥 2 𝑖 𝜕𝑥 3 𝑖

Solving for 𝜕 2 𝑢/𝜕𝑥 2


𝜕2 𝑢 𝑢𝑖+2 −2 𝑢𝑖+1 +𝑢𝑖
( ) = + 𝑂(Δ𝑥) (2.13)
𝜕𝑥 2 𝑖 (Δ𝑥)2

This equation represents the forward difference approximation for the second derivative
of order Δ𝑥 . A similar approximation for the second derivative for backward difference
approximation can be produced by using the Taylor series expansions of 𝑢𝑖−1 𝑎𝑛𝑑𝑢𝑖−2 as
𝜕2 𝑢 𝑢𝑖 −2𝑢𝑖−1 +𝑢𝑖−2
( ) = + 𝑂(Δ𝑥) (2.14)
𝜕𝑥 2 𝑖 (Δ𝑥)2

Adding Eq. (2.5) and Eq. (2.2) one obtains


(Δ𝑥)2 𝜕2 𝑢 (Δ𝑥)4 𝜕4 𝑢
𝑢𝑖+1 + 𝑢𝑖−1 = 2𝑢𝑖 + 2 ( 2
) +2 ( ) + ⋯⋯⋯ (2.15)
2! 𝜕𝑥 𝑖 4! 𝜕𝑥 4 𝑖

Prepared by Dr. Md. Shahjada Tarafder Page 12


𝜕2 𝑢
Solving for one obtains
𝜕𝑥 2
𝜕2 𝑢 𝑢𝑖+1 −2𝑢𝑖 +𝑢𝑖−1
( ) = + 𝑂(Δ𝑥 )2 (2.16)
𝜕𝑥 2 𝑖 (Δ𝑥)2

This is central difference formula for second derivative of order (Δ𝑥 )2 .

2.3 Finite difference by polynomials


The functions are usually approximated by fitting a polynomial of equally spaced points
as shown in Fig. Now the equation for a second-degree polynomial is
𝑢 = 𝑎0 + 𝑎1 𝑥 + 𝑎2 𝑥 2 (2.17)
Applying Eq. (2.17) at node 𝑖, 𝑖 + 1 𝑎𝑛𝑑 𝑖 + 2 we obtain
𝑢𝑖 = 𝑎0 (2.18)
𝑢𝑖+1 = 𝑎0 + 𝑎1 ∆𝑥 + 𝑎2 (∆𝑥)2 (2.19)
𝑢𝑖+2 = 𝑎0 + 2 𝑎1 ∆𝑥 + 𝑎2 (2 ∆𝑥)2 (2.20)
Solving Eq. 2.18, Eq. 2.19 and Eq. 2.20 one obtains
𝑎0 = 𝑢𝑖 (2.21)
−𝑢𝑖+2 +4𝑢𝑖+1 −3𝑢𝑖
𝑎1 = (2.22)
2 ∆x
𝑢𝑖+2 −2𝑢𝑖+1 +𝑢𝑖
𝑎2 = (2.23)
2 (∆x)2

Differentiating with respect to x one obtains


𝜕𝑢
= 𝑎1 + 2 𝑎2 𝑥 (2.24)
𝜕𝑥
𝜕2 𝑢
= 2 𝑎2 (2.25)
𝜕𝑥 2

Now the first order derivative at 𝑥𝑖 = 0 can finally be expressed as


𝜕𝑢 −𝑢𝑖+2 +4𝑢𝑖+1 −3𝑢𝑖
= 𝑎1 = (2.26)
𝜕𝑥 2 ∆x

And the second derivative as


𝜕2 𝑢 𝑢𝑖+2 −2𝑢𝑖+1 +𝑢𝑖
= (2.27)
𝜕𝑥 2 (∆x)2

Prepared by Dr. Md. Shahjada Tarafder Page 13


2.4 Finite difference by general approach
A first–order accurate finite difference approximation of the derivative at xi can be
derived by considering the value of u at three different points like xi, xi-1 and xi-2. The
approximation is constructed as weighted average of the values of 𝑢𝑖 , 𝑢𝑖−1 𝑎𝑛𝑑𝑢𝑖−2 such
as
𝑎𝑢𝑖 +𝑏𝑢𝑖−1 +𝑐𝑢𝑖−2
( 𝑢𝑥 ) 𝑖 = + 𝑂(∆𝑥)2 (2.28)
∆𝑥
1 1
𝑢𝑖−1 = 𝑢𝑖 − ∆𝑥 (𝑢𝑥 )𝑖 + (∆𝑥 )2 (𝑢𝑥𝑥 )𝑖 − ( ∆𝑥 )3 (𝑢𝑥𝑥𝑥 )𝑖 + ⋯ ⋯ ⋯ ∞ (2.29)
2! 3!
1 1
𝑢𝑖−2 = 𝑢𝑖 − 2 ∆𝑥(𝑢𝑥 )𝑖 + (2 ∆𝑥 )2 (𝑢𝑥𝑥 )𝑖 − (2 ∆𝑥 )3 (𝑢𝑥𝑥𝑥 )𝑖 + ⋯ ⋯ ⋯ ∞ (2.30)
2! 3!

Substituting Eq. (2.4.2) and (2.4.3) in Eq. (2.4.1) we obtain


1 1
(𝑢𝑥 )𝑖 ∆𝑥 = 𝑎𝑢𝑖 + 𝑏 [𝑢𝑖 − ∆𝑥 (𝑢𝑥 )𝑖 + (∆𝑥)2 (𝑢𝑥𝑥 )𝑖 − (∆𝑥)3 (𝑢𝑥𝑥𝑥 )𝑖 + ⋯ ⋯ ⋯ ∞]
2! 3!
1 1
+ 𝑐 [𝑢𝑖 − 2 ∆𝑥 (𝑢𝑥 )𝑖 + (2 ∆𝑥 )2 (𝑢𝑥𝑥 )𝑖 − (2 ∆𝑥 )3 (𝑢𝑥𝑥𝑥 )𝑖
2! 3!

+ ⋯ ⋯ ⋯ ∞]

(∆𝑥)2
= (𝑎 + 𝑏 + 𝑐 )𝑢𝑖 − (2𝑐 + 𝑏)∆𝑥 (𝑢𝑥 )𝑖 + (4𝑐 + 𝑏)(𝑢𝑥𝑥 )𝑖 + ⋯ ⋯ ⋯ ∞
2
Taking the coefficients of similar terms from both sides of above equation we obtain
𝑎+𝑏+𝑐 =0
2𝑐 + 𝑏 = −1
4𝑐 + 𝑏 = 0
After solving we get
3 1
𝑎= ; 𝑏 = −2 and 𝑐 =
2 2

Therefore, from Eq. (2.4.1)


3 1
𝑢𝑖 − 2𝑢𝑖−1 + 𝑢𝑖−2
2 2
( 𝑢𝑥 ) 𝑖 = + 𝑂(∆𝑥)2
∆𝑥
3 𝑢𝑖 − 4𝑢𝑖−1 + 𝑢𝑖−2
= + 𝑂(∆𝑥)2
2 ∆𝑥

Prepared by Dr. Md. Shahjada Tarafder Page 14


Similarly, a second–order central finite difference approximation of the derivative at xi
can be derived as
𝜕2𝑢 𝑢𝑖+1 − 2𝑢𝑖 + 𝑢𝑖−1
( 2
) = + 𝑂(Δ𝑥 )2
𝜕𝑥 𝑖 (Δ𝑥)2

2.5 Finite difference approximation for mixed derivatives


The approximation of mixed partial derivatives will be performed by Taylor series
expansion first and second by the use of approximation of partial derivatives derived
earlier.

2.5.1 Mixed derivative by Taylor Series Expansion


The Taylor series expansion for a function 𝑢(𝑥 + ∆𝑥, 𝑦 + ∆𝑦) of two variables x and y
can be expressed as
𝜕𝑢 𝜕𝑢 (∆𝑥)2 𝜕2 𝑢 ∆𝑥∆𝑦 𝜕2 𝑢
𝑢(𝑥 + ∆𝑥, 𝑦 + ∆𝑦) = 𝑢 (𝑥, 𝑦) + ∆𝑥 + ∆𝑦 + 2
+2
𝜕𝑥 𝜕𝑦 2! 𝜕𝑥 2! 𝜕𝑥𝜕𝑦

(∆𝑦)2 𝜕2 𝑢
+ + 𝑂[(∆𝑥)3 , (∆𝑦)3 ] (2.31)
2! 𝜕𝑦 2

Using indices i and j to represent a grid point at x and y plane one obtains
(∆𝑥)2 ∆𝑥∆𝑦
𝑢𝑖+1,𝑗+1 = 𝑢𝑖,𝑗 + ∆𝑥 (𝑢𝑥 )𝑖,𝑗 + ∆𝑦(𝑢𝑦 )𝑖,𝑗 + (𝑢𝑥𝑥 )𝑖,𝑗 + 2 (𝑢𝑥𝑦 )
2! 2! 𝑖,𝑗

(∆𝑦)2
+ (𝑢𝑦𝑦 ) + 𝑂[(∆𝑥)3 , (∆𝑦)3 ] (2.32)
2! 𝑖,𝑗

Similarly, the expressions of 𝑢𝑖−1,𝑗−1 , 𝑢𝑖+1,𝑗−1 and 𝑢𝑖−1,𝑗+1 can be written as


(∆𝑥)2 ∆𝑥∆𝑦
𝑢𝑖−1,𝑗−1 = 𝑢𝑖,𝑗 − ∆𝑥 (𝑢𝑥 )𝑖,𝑗 − ∆𝑦(𝑢𝑦 )𝑖,𝑗 + (𝑢𝑥𝑥 )𝑖,𝑗 + 2 (𝑢𝑥𝑦 )
2! 2! 𝑖,𝑗

(∆𝑦)2
+ (𝑢𝑦𝑦 ) + 𝑂[(∆𝑥)3 , (∆𝑦)3 ] (2.33)
2! 𝑖,𝑗

(∆𝑥)2 ∆𝑥∆𝑦
𝑢𝑖+1,𝑗−1 = 𝑢𝑖,𝑗 + ∆𝑥 (𝑢𝑥 )𝑖,𝑗 − ∆𝑦(𝑢𝑦 )𝑖,𝑗 + (𝑢𝑥𝑥 )𝑖,𝑗 − 2 (𝑢𝑥𝑦 )
2! 2! 𝑖,𝑗

(∆𝑦)2
+ (𝑢𝑦𝑦 ) + 𝑂[(∆𝑥)3 , (∆𝑦)3 ] (2.34)
2! 𝑖,𝑗

(∆𝑥)2 ∆𝑥∆𝑦
𝑢𝑖−1,𝑗+1 = 𝑢𝑖,𝑗 − ∆𝑥 (𝑢𝑥 )𝑖,𝑗 + ∆𝑦(𝑢𝑦 )𝑖,𝑗 + (𝑢𝑥𝑥 )𝑖,𝑗 − 2 (𝑢𝑥𝑦 )
2! 2! 𝑖,𝑗

Prepared by Dr. Md. Shahjada Tarafder Page 15


(∆𝑦)2
+ (𝑢𝑦𝑦 ) + 𝑂[(∆𝑥)3 , (∆𝑦)3 ] (2.35)
2! 𝑖,𝑗

Combining Eq. (2.5.2) to (2.5.5) we get


𝜕2𝑢 𝑢𝑖+1,𝑗+1 − 𝑢𝑖+1,𝑗−1 − 𝑢𝑖−1,𝑗+1 + 𝑢𝑖−1,𝑗−1
= + 𝑂[(∆𝑥)2 , (∆𝑦)2 ]
𝜕𝑥𝜕𝑦 4 ∆𝑥∆𝑦

2.5.2 Mixed derivative by the use of approximation of partial derivatives


The first order central difference approximation from Eq. (2.2.9) as
𝜕𝑢 𝑢𝑗+1 −𝑢𝑗−1
= + 𝑂(Δy)2 (2.36)
𝜕𝑦 2 Δy

Now for a mixed partial derivative


𝜕2 𝑢 𝜕 𝑢𝑗+1 −𝑢𝑗−1 1 𝜕𝑢 1 𝜕𝑢
= [ + 𝑂 (Δy)2 ] = [ ] − [ ] + 𝑂(Δy)2 (2.37)
𝜕𝑥𝜕𝑦 𝜕𝑥 2 Δy 2 Δy 𝜕𝑥 𝑗+1 2 Δy 𝜕𝑥 𝑗−1

𝜕𝑢
Substituting a central differencing scheme of of order (x)2we have
𝜕𝑥
𝜕2 𝑢 1 𝑢𝑖+1,𝑗+1 −𝑢𝑖−1,𝑗+1 𝑢𝑖+1,𝑗−1 −𝑢𝑖−1,𝑗−1
= [ − ] + 𝑂[(Δx)2 , (Δy)2 ] (2.38)
𝜕𝑥𝜕𝑦 2 Δy 2 Δx 2 Δx

Thus
𝜕2 𝑢 𝑢𝑖+1,𝑗+1 −𝑢𝑖−1,𝑗+1 −𝑢𝑖+1,𝑗−1 +𝑢𝑖−1,𝑗−1
=[ ] + 𝑂[(Δx)2 , (Δy)2 ] (2.39)
𝜕𝑥𝜕𝑦 4 ΔxΔy

Example 2.1Derive the discretized form of Laplace equation in a region of xy-plane as


shown in Fig.
𝜕2 𝑢 𝜕2 𝑢
2
+ =0 (2.40)
𝜕𝑥 𝜕𝑦 2

Using second-order central difference scheme at point (𝑥𝑖 , 𝑦𝑖 ), we obtain


𝑢𝑖+1,𝑗−2𝑢𝑖,𝑗 +𝑢𝑖−1,𝑗 𝑢𝑖,𝑗+1 −2𝑢𝑖,𝑗+𝑢𝑖,𝑗−1
(Δ𝑥)2
+ (Δy)2
=0 (2.41)

If we assumeΔ𝑥 = Δ𝑦, we get


𝑢𝑖+1,𝑗 − 2𝑢𝑖,𝑗 + 𝑢𝑖−1,𝑗 + 𝑢𝑖,𝑗+1 − 2𝑢𝑖,𝑗 + 𝑢𝑖,𝑗−1 = 0 (2.42)
Eq. contains four neighboring points around the central points (𝑥𝑖 , 𝑦𝑖 ) and is known as
the five-point difference formula for Laplace equation. Rearranging Eq. () we obtain

Prepared by Dr. Md. Shahjada Tarafder Page 16


1
𝑢𝑖,𝑗 = (𝑢𝑖+1,𝑗 + 𝑢𝑖−1,𝑗 + 𝑢𝑖,𝑗+1 + 𝑢𝑖,𝑗−1 ) (2.43)
4

We can observe from above equation that the function value at the grid point is the
average of the values at the four adjoining points. To evaluate numerically the solution of
Laplace’s equation at the grid points we can apply Eq. () at the grid points where 𝑢𝑖,𝑗 is
unknown, thus obtaining a system of linear equations. The system of linear equations
may be solved using either direct methods or iterative methods.

Ex. 2.2 The steady state two-dimensional heat flow in a metal plate is given by
𝜕2 𝑇 𝜕2 𝑇
2
+ =0 (2.44)
𝜕𝑥 𝜕𝑦 2

Find the temperatures T1, T2, T3 and T4 using the


boundary conditions as shown in Fig.

The discretized form of Eq. (2.44) can be written as


1
𝑇𝑖,𝑗 = (𝑇𝑖+1,𝑗 + 𝑇𝑖−1,𝑗 + 𝑇𝑖,𝑗+1 + 𝑇𝑖,𝑗−1 ) (2.45)
4

Applying Eq. (2.45) at node 1, 2, 3, and 4 we obtain


Node 1: 4 𝑇1 = 0 + 100 + 𝑇2 + 𝑇3
4 𝑇1 − 𝑇2 − 𝑇3 + 0 ∙ 𝑇4 = 100 (2.46)

Node 2: 4 𝑇2 = 𝑇1 + 100 + 200 + 𝑇4


𝑇1 − 4𝑇2 + 0 ∙ 𝑇3 + 𝑇4 = −300 (2.47)

Node 3: 4 𝑇3 = 0 + 𝑇1 + 𝑇4 + 50
𝑇1 + 0 ∙ 𝑇2 − 4𝑇3 + 𝑇4 = −50 (2.48)

Node 4: 4 𝑇4 = 𝑇3 + 𝑇2 + 200 + 100


0 ∙ 𝑇1 + 𝑇2 + 𝑇3 − 4𝑇4 = −300 (2.49)
Prepared by Dr. Md. Shahjada Tarafder Page 17
Eq. (2.46) to (2.49) can be written into a matrix form as
4 −1 −1 0 𝑇1 100
1 −4 0 1 𝑇2 −300
[ ][ ] = [ ] (2.50)
1 0 −4 1 𝑇3 −50
0 1 1 −4 𝑇4 −300
Solving Eq. (2.50) we obtain
T1 = 70.82 T2 = 122.91
T3 = 60.42 T4 = 120.82

Ex. 2.3 Using finite difference method solve the Poisson equation ∇2 𝑢 = 2𝑥 2 𝑦 2 over the
square domain 0 ≤ x ≤3 and 0 ≤ y ≤3 with u = 0 on the boundary. The domain is to be
divided into squares of unit sizes.
∇2 𝑢 = 2𝑥 2 𝑦 2 (2.51)
𝜕2𝑢 𝜕2𝑢
2
+ 2 = 2𝑥 2 𝑦 2
𝜕𝑥 𝜕𝑦
𝑢𝑖+1,𝑗−2𝑢𝑖,𝑗 +𝑢𝑖−1,𝑗 𝑢𝑖,𝑗+1 −2𝑢𝑖,𝑗+𝑢𝑖,𝑗−1
(Δ𝑥)2
+ (Δy)2
= 2𝑥 2 𝑦 2 (2.52)

If we assumeΔ𝑥 = Δ𝑦, we get


𝑢𝑖+1,𝑗 − 4𝑢𝑖,𝑗 + 𝑢𝑖−1,𝑗 + 𝑢𝑖,𝑗+1 + 𝑢𝑖,𝑗−1 = 2𝑥 2 𝑦 2 (Δ𝑥)2 (2.53)
Applying Eq. (2.53) at each grid points, we get
Node 1: 0 + 0 + 𝑢2 + 𝑢3 − 4 𝑢1 = 2 (1)2 (2)2 (1)2
−4 𝑢1 + 𝑢2 + 𝑢3 = 8 (2.54)
Node 2: 0 + 0 + 𝑢1 + 𝑢4 − 4 𝑢2 = 2 (2)2 (2)2 (1)2
𝑢1 − 4 𝑢2 + 𝑢4 = 32 (2.55)
Node 3: 0 + 0 + 𝑢1 + 𝑢4 − 4 𝑢3 = 2 (1)2 (1)2 (1)2
𝑢1 − 4 𝑢3 + 𝑢4 = 2 (2.56)
Node 4: 0 + 0 + 𝑢2 + 𝑢3 − 4 𝑢4 = 2 (2)2 (1)2 (1)2
𝑢2 + 𝑢3 − 4 𝑢 4 = 8 (2.57)
Eq. (2.54) to (2.57) can be written into a matrix form as

Prepared by Dr. Md. Shahjada Tarafder Page 18


4 −1 −1 0 𝑢1 8
1 −4 0 1 𝑢 2 32
[ ] [𝑢 ] = [ ] (2.50)
1 0 −4 1 3 2
0 1 1 −4 𝑢 4 8
Solving Eq. (2.50) we get
22 43
𝑢1 = − 𝑢2 = −
4 4
13 22
𝑢3 = − 𝑢4 = −
4 4

Problems
Derive a forward difference approximation of order (∆𝑥) with the use of second order
polynomial.

Prepared by Dr. Md. Shahjada Tarafder Page 19


Chapter 4
Interpolation

3.1 Introduction
The basic idea of the finite element method is to seek a piecewise approximate solution
by dividing the region of interest into small regions called elements. The functions used
to represent the behavior of the solution within an element are called the interpolation
functions.

The choice of the finite element depends on the geometry of the global domain. A one-
dimensional domain is discretized by line elements where linear elements are restricted to
straight sides and quadratic and higher-order elements can have curved surfaces. Two-
dimensional domain is subdivided into triangular, rectangular and quadrilateral elements.
The most common types of three-dimensional elements are the tetrahedron and the
hexahedron. The finite element interpolations are characterized by the shape of the finite
element and order of approximations.

In a one-dimensional domain, discretization into an array of elements is not difficult to


grasp—small element size is generally needed where variables change rapidly. In two-
dimensional regions, generation of an acceptable mesh becomes more troublesome;

Prepared by Dr. Md. Shahjada Tarafder Page 20


several meshes may need to be made before a suitable mesh is created that yields
reasonable results. In a three-dimensional domain, the mesh is not only more
cumbersome to make, but also difficult to visualize—many trial meshes may be required
if the problem domain is complex.

3.2 One-dimensional interpolation


Global co-ordinate system: The polynomial expressions of variable u to be
approximated for one-dimensional element can be written as
𝑢 = 𝛼0 + 𝛼1 𝑥 + 𝛼2 𝑥 2 + ⋯ ⋯ ⋯ + 𝛼𝑛 𝑥 𝑛 (3.1)
= ∑𝑛𝑖=0 𝛼𝑖 𝑥 𝑖

Fig. 3.1 Linear interpolation in global co-ordinate system

For a linear variation we have


𝑢 = 𝛼0 + 𝛼1 𝑥 (3.2)
Applying Eq. (3.1) at node 1 and 2 we obtain
Node 1: 𝑢 = 𝑢1 at 𝑥 = 𝑥1
𝑢1 = 𝛼0 + 𝛼1 𝑥1 (3.3)
Node 2: 𝑢 = 𝑢2 at 𝑥 = 𝑥2
𝑢2 = 𝑎0 + 𝛼1 𝑥2 (3.4)
Solving Eq. (3.3) and (3.4) we get
𝑢1 𝑥2 −𝑢2 𝑥1
𝛼0 =
𝑥2 −𝑥1

Prepared by Dr. Md. Shahjada Tarafder Page 21


𝑢2 −𝑢1
𝛼1 =
𝑥2 −𝑥1

Substituting the values of 𝛼0 and𝛼1 in Eq. (3.2) we obtain


𝑢 = 𝛼0 + 𝛼1 𝑥
𝑢1 𝑥2 −𝑢2 𝑥1 𝑢2 −𝑢1
= + 𝑥
𝑥2 −𝑥1 𝑥2 −𝑥1
𝑥2 −𝑥 𝑥−𝑥1
= 𝑢1 + 𝑢2 (3.5)
𝑥2 −𝑥1 𝑥2 −𝑥1

= N1 𝑢1 + N2 𝑢2
𝑥2 −𝑥 𝑥−𝑥1
Where N1 = and N2 =
𝑥2 −𝑥1 𝑥2 −𝑥1

1 at x = 𝑥1 1 at x = 𝑥2
Note that N1 = { and N2 = {
0 at x = 𝑥2 0 at x = 𝑥1
The terms 𝑁1 and 𝑁2 are called the interpolation function (also known as trial function,
shape function and base function). The property of the shape function is given by
𝑥2 −𝑥 𝑥−𝑥1
∑2𝑖=1 Ni = + =1 (3.6)
𝑥2 −𝑥1 𝑥2 −𝑥1

Local co-ordinate system: Let the origin of the co-ordinate system placed at node of the
element so that x1 = 0 and defining ℎ = 𝑥2 − 𝑥1 = 𝑥2 , we get from Eq. (3.5)
𝑥 𝑥
= (1 − ) 𝑢1 + 𝑢2 (3.7)
ℎ ℎ

Natural or non-dimensional co-ordinate system: The co-ordinate system where the


interpolation functions are derived in terms of non-dimensional spatial variables is called
a natural co-ordinate system.
𝑥
Letting 𝜉 = the polynomial expansion for a variable u in non-dimensional co-ordinate
𝑙

system can be written as


𝑢 = 𝛼0 + 𝛼1 𝜉 + 𝛼2 𝜉 2 + ⋯ ⋯ ⋯ + 𝛼𝑛 𝜉 𝑛 (3.8)
= 𝛼0 + 𝛼1 𝜉 for linear variation
Let ℎ = 2𝑙 and  = 0 at the centre of the element as shown Fig. we obtain from Eq. (3.8)

Prepared by Dr. Md. Shahjada Tarafder Page 22


u= 0 1
U u u = u(x)

u1 u2
h

x/h
1 2 x
0 1
1 2
x2
Fig. 3.2 Linear interpolation in
natural coordinate system Fig. 3.2 Linear interpolation in natural
coordinate system

Node 1: 𝑢 = 𝑢1 𝑤𝑖𝑡ℎ 𝜉 = −1
𝑢1 = 𝛼0 − 𝛼1 (3.9)
Node 2: 𝑢 = 𝑢2 𝑤𝑖𝑡ℎ 𝜉 = +1
𝑢2 = 𝛼0 + 𝛼1 (3.10)
Solving Eq. (3.9) and Eq. (3.10) we get
1
𝛼0 = (𝑢 +𝑢 )
2 1 2
1
𝛼1 = (𝑢2 −𝑢1 )
2
Substituting the values of 𝛼0 and 𝛼1in Eq. (3.8) we get
1 1
𝑢= (1 − 𝜉 )𝑢1 + (1 + 𝜉 )𝑢2
2 2
= N1 𝑢1 + N2 𝑢2 (3.11)
where
1
N1 = (1 − 𝜉 )
2
1 } (3.12)
N 2 = (1 + 𝜉 )
2
1 1
N1 + 𝑁2 = (1 − 𝜉 ) + (1 + 𝜉 ) = 1
2 2

Prepared by Dr. Md. Shahjada Tarafder Page 23


Quadratic variation: The polynomial expansion for a variable u in non-dimensional co-
ordinate system can be written as
2

u= 0 1 2

h=2l

x/l
1 2 3
-1 0 1
1 2 3

Fig. 3.2 Linear interpolation in natural coordinate system


𝑢 = 𝛼0 + 𝛼1 𝜉 + 𝛼2 𝜉 2 (3.13)
Node 1: 𝑢 = 𝑢1 𝑤𝑖𝑡ℎ 𝜉 = −1
𝑢1 = 𝛼0 − 𝛼1 + 𝛼2 (3.14)
Node 2: 𝑢 = 𝑢2 𝑤𝑖𝑡ℎ 𝜉 = 0
𝑢2 = 𝛼 0 (3.15)
Node 3: 𝑢 = 𝑢3 𝑤𝑖𝑡ℎ 𝜉 = +1
𝑢3 = 𝛼0 + 𝛼1 + 𝛼2 (3.16)
Solving Eq. (3.14), (3.15) and (3.16) we get
𝛼 0 = 𝑢2
1
𝛼1 = (𝑢 − 𝑢1 )
2 3
1
𝛼2 = (𝑢1 + 𝑢3 ) − 𝑢2
2
Substituting the values of α0 , α1 and α2 in Eq. (3.13) and then rearranging we get 𝑢 =
1 1 1
𝜉 (1 − 𝜉 )𝑢1 + (1 − 𝜉 2 )𝑢2 + 𝜉 (1 + 𝜉 )𝑢3
2 2 2

= N1 𝑢1 + N2 𝑢2 + N3 𝑢3 (3.17)
Where the interpolation functions are

Prepared by Dr. Md. Shahjada Tarafder Page 24


1
N1 = 𝜉 (𝜉 − 1)
2
N 2 = (1 − 𝜉 2 ) } (3.18)
1
𝑁3 = 𝜉 (1 + 𝜉 )
2

Lagrange Interpolation: The Lagrange interpolation function LN is of the form


𝑛
𝑥 − 𝑥𝑀
𝑁𝑁 = 𝐿𝑁 = ∏
𝑥𝑁 − 𝑥𝑀
𝑀=1 𝑀≠𝑁
(𝑥−𝑥1 )(𝑥−𝑥2 )⋯⋯(𝑥−𝑥𝑁−1 )(𝑥−𝑥𝑁+1 )⋯⋯(𝑥−𝑥𝑛 )
= (3.19)
(𝑥𝑁 −𝑥1 )(𝑥𝑁 −𝑥2 )⋯⋯(𝑥𝑁 −𝑥𝑁−1 )(𝑥𝑁 −𝑥𝑁+1 )(𝑥𝑁 −𝑥𝑀 )

The element is divided into equal length segments with m and n equal to order of
approximations and the number of nodes in an element respectively. Let us consider a
first order approximation of a dependent variable u such as Eq. (3.5)
u = L1 𝑢1 + L2 𝑢2 (3.20)
Where L1 and L2 from Eq. (3.19) as

Prepared by Dr. Md. Shahjada Tarafder Page 25


𝑥−𝑥2
L1 =
𝑥1 −𝑥2
𝑥−𝑥1 } (3.21)
L2 =
𝑥2 −𝑥1

Placing the origin of the co-ordinate system is at node 1 so that x1= 0 and defining x2 = h,
we have
𝑥−ℎ 𝑥
L1 = =1−
−ℎ ℎ
𝑥
L2 =

𝑥
If 𝜉 = , the interpolation function in natural co-ordinate system can be written as

𝜉−𝜉𝑀
𝐿𝑁 = ∏𝑛𝑀=1 𝑀≠𝑁 (3.22)
𝜉𝑁 −𝜉𝑀

Where
𝜉−𝜉2
L1 = = (1 − 𝜉); (3.23)
𝜉1 −𝜉2
𝜉−𝜉1
L2 = =𝜉 (3.24)
𝜉2 −𝜉1

Quadratic approximation: n = 3
(𝜉−𝜉2 )(𝜉−𝜉3 )
L1 = ; (3.25)
(𝜉1 −𝜉2 )(𝜉1 −𝜉3 )
(𝜉−𝜉1 )(𝜉−𝜉3 )
L2 = (𝜉 ; (3.26)
2 −𝜉1 )(𝜉2 −𝜉3 )

(𝜉−𝜉1 )(𝜉−𝜉2 )
L3 = (3.27)
(𝜉3 −𝜉1 )(𝜉3 −𝜉2 )
2

u= 0 1 2

h=2l

x/l
1 2 3

0 1/2 1
1 2 3

If the origin is taken at node 1 of the element as shown in Fig. 1 we have

Prepared by Dr. Md. Shahjada Tarafder Page 26


1
𝜉1 = 0, 𝜉2 = 𝑎𝑛𝑑 𝜉2 = 1
2
Now from Eq. ( 3.25-3.27)
1
L1 = 2 (ξ − ) (ξ − 1); (3.28)
2

L2 = −4ξ(ξ − 1); (3.29)


1
L3 = 2ξ (ξ − ) (3.30)
2

If the origin is taken at node 2 of the element as shown in Fig. 1 we have


𝜉1 = −1, 𝜉2 = 0 𝑎𝑛𝑑 𝜉2 = 1
Now from Eq. (3.25-3.27)
1
L1 = ξ(ξ − 1); (3.31)
2

L2 = (1 − ξ2 ); (3.32)
1
L3 = ξ ( ξ + 1 ) (3.33)
2

3.3 Two-dimensional interpolation


3.3.1 Global Co-ordinate Triangular element
Assume an interpolation function for the variation of u as
𝑢 = 𝛼0 + 𝛼1 𝑥 + 𝛼2 𝑦 (3.34)
𝛼0
= [1 𝑥 𝑦] [𝛼1 ]
𝛼2
= [1 𝑥 𝑦][𝛼] (3.35)
The boundary conditions in terms of nodal point values of u are
Node 1: 𝑢 = 𝑢1 𝑎𝑡 𝑥 = 𝑥1 ; 𝑦 = 𝑦1
Node 2: 𝑢 = 𝑢2 𝑎𝑡 𝑥 = 𝑥2 ; 𝑦 = 𝑦2
Node 3: 𝑢 = 𝑢3 𝑎𝑡 𝑥 = 𝑥3 ; 𝑦 = 𝑦3
Applying the boundary conditions in Eq. (3.34) we get
𝑢1 = 𝛼0 + 𝛼1 𝑥1 + 𝛼2 𝑦1
𝑢2 = 𝛼0 + 𝛼1 𝑥2 + 𝛼2 𝑦2

Prepared by Dr. Md. Shahjada Tarafder Page 27


𝑢3 = 𝛼0 + 𝛼1 𝑥3 + 𝛼2 𝑦3

The above equation can be written into a matrix form as


𝑢1 1 𝑥1 𝑦1 𝛼0
𝑢
[ 2 ] = [1 𝑥2 𝑦2 ] [𝛼1 ]
𝑢3 1 𝑥3 𝑦3 𝛼2
[𝑢] = [𝐷 ][𝛼]
Multiplying both sides by [𝐷 ]−1 yields
[𝛼] = [𝐷 ]−1 [𝑢]
From Eq. (3.35)
𝑢 = [1 𝑥 𝑦][𝐷 ]−1 [𝑢 ] (3.36)
Now consider the matrix
1 𝑥1 𝑦1
[𝐷 ] = [1 𝑥2 𝑦2 ]
1 𝑥3 𝑦3
The inverse of the matrix [𝐷 ] is obtained as

𝐴𝑑𝑗𝐷 1 𝐴11 𝐴12 𝐴13 𝑇


[𝐷 ]−1 = = [𝐴 𝐴22 𝐴23 ]
|𝐷 | |𝐷 | 21
𝐴 31 𝐴32 𝐴33
where
𝐴11 = (𝑥2 𝑦3 − 𝑥3 𝑦2 ) 𝐴12 = (𝑦2 − 𝑦3 ) 𝐴13 = (𝑥3 − 𝑥2 )
𝐴21 = (𝑥3 𝑦1 − 𝑥1 𝑦3 ) 𝐴22 = (𝑦3 − 𝑦1 ) 𝐴23 = (𝑥1 − 𝑥3 )
𝐴31 = (𝑥1 𝑦2 − 𝑥2 𝑦1 ) 𝐴32 = (𝑦1 − 𝑦2 ) 𝐴33 = (𝑥2 − 𝑥1 )

Prepared by Dr. Md. Shahjada Tarafder Page 28


The area of the triangular element is
1 𝑥1 𝑦1
1 1
Δ = [1 𝑥2 𝑦2 ] = |𝐷 | and
2 2
1 𝑥3 𝑦3
𝐴 𝐴21 𝐴31
1 11
[𝐷 ]−1 = [𝐴12 𝐴22 𝐴32 ]
2Δ 𝐴 𝐴23 𝐴33
13

Now from Eq. (3.36)


𝑢 = [1 𝑥 𝑦][𝐷 ]−1 [𝑢 ]
𝑥 𝑦 − 𝑥3 𝑦2 𝑥3 𝑦1 − 𝑥1 𝑦3 𝑥2 𝑦1 − 𝑥1 𝑦2 𝑢1
1 2 3
𝑢 = [1 𝑥 𝑦] [ 𝑦2 −𝑦3 𝑦3 − 𝑦1 𝑦1 −𝑦2 ] [𝑢2 ]
2Δ 𝑥3 − 𝑥2 𝑥1 − 𝑥3 𝑥2 − 𝑥1 𝑢3
1
u= [(𝑥2 𝑦3 − 𝑥3 𝑦2 ) + 𝑥(𝑦2 −𝑦3 ) + 𝑦(𝑥3 − 𝑥2 )]𝑢1 +

1
[(𝑥 𝑦 − 𝑥1 𝑦3 ) + 𝑥 (𝑦3 − 𝑦1 ) + 𝑦(𝑥1 − 𝑥3 )]𝑢2 +
2Δ 3 1
1
[𝑥 𝑦 − 𝑥1 𝑦2 ) + 𝑥 (𝑦1 −𝑦2 ) + 𝑦(𝑥2 − 𝑥1 )]𝑢3
2Δ 2 1
u = 𝑁1 𝑢1 + 𝑁2 𝑢2 + 𝑁3 𝑢3
where
1
𝑁1 (𝑥, 𝑦) = [(𝑥 𝑦 − 𝑥3 𝑦2 ) + 𝑥 (𝑦2 −𝑦3 ) + 𝑦(𝑥3 − 𝑥2 )]
2Δ 2 3
1
𝑁2 (𝑥, 𝑦) = [(𝑥 𝑦 − 𝑥1 𝑦3 ) + 𝑥 (𝑦3 − 𝑦1 ) + 𝑦(𝑥1 − 𝑥3 )]
2Δ 3 1
1
𝑁3 (𝑥, 𝑦) = [(𝑥 𝑦 − 𝑥2 𝑦1 ) + 𝑥 (𝑦1 − 𝑦2 ) + 𝑦(𝑥2 − 𝑥1 )]
2Δ 1 2 }
Defining
𝑎1 = 𝑥2 𝑦3 − 𝑥3 𝑦2 𝑏1 = 𝑦2 −𝑦3 𝑐1 = 𝑥3 − 𝑥2
𝑎2 = 𝑥3 𝑦1 − 𝑥1 𝑦3 𝑏2 = 𝑦3 − 𝑦1 𝑐2 = 𝑥1 − 𝑥3
𝑎3 = 𝑥1 𝑦2 − 𝑥2 𝑦1 𝑏3 = 𝑦1 −𝑦2 𝑐3 = 𝑥2 − 𝑥1

the shape functions can be expressed as


1
𝑁1 = [𝑎 + 𝑏1 𝑥 + 𝑐1 𝑦]
2Δ 1

Prepared by Dr. Md. Shahjada Tarafder Page 29


1
𝑁2 = [𝑎 + 𝑏2 𝑥 + 𝑐2 𝑦]
2Δ 2
1
𝑁3 = [𝑎 + 𝑏3 𝑥 + 𝑐3 𝑦]
2Δ 3
Moreover, From Eq. () the shape function can also be written into a matrix form as
1 𝑥 𝑦
1 Δ1
𝑁1 = |1 𝑥2 𝑦2 | =
2Δ 1 𝑥3 𝑦3 Δ

1 𝑥 𝑦
1 Δ
𝑁2 = |1 𝑥3 𝑦3 | = 2
2Δ Δ
1 𝑥1 𝑦1
1 𝑥 𝑦
1 Δ
𝑁3 = |1 𝑥1 𝑦1 | = 3
2Δ 1 𝑥2 𝑦2 Δ

Where Δ1 , Δ2 and Δ3 are the areas of PCB, PAC and PAB which are opposite to
nodes 1, 2 and 3 respectively.
3.3.2 Natural Co-ordinate Triangular element
Let us consider a triangle with the natural co-ordinate 𝐿𝑁 whose values are zero along the
sides and one on the vertices with a linear variation in between ash shown in Fig. 5.3.

The co-ordinates are defined as


𝐴1
𝐿1 =
𝐴
𝐴2
𝐿2 =
𝐴
𝐴3
𝐿3 = }
𝐴

Prepared by Dr. Md. Shahjada Tarafder Page 30


Where 𝐴1 , 𝐴2 and 𝐴3 are the partial areas defined by joining point P in the triangle with
the corner nodes. Now the total area A is
𝐴1 + 𝐴2 + 𝐴3 = 𝐴 (𝐿1 + 𝐿2 + 𝐿3 )
𝐴1 + 𝐴2 + 𝐴3 = 𝐴
𝐿1 + 𝐿2 + 𝐿3 = 1
The global co-ordinate (x, y) are related the natural co-ordinate through the expressions:
𝑥 = 𝐿1 𝑥1 + 𝐿2 𝑥2 + 𝐿3 𝑥3
𝑦 = 𝐿1 𝑦1 + 𝐿2 𝑦2 + 𝐿3 𝑦3
Now
1 = 𝐿1 + 𝐿2 + 𝐿3
𝑥 = 𝐿1 𝑥1 + 𝐿2 𝑥2 + 𝐿3 𝑥3
𝑦 = 𝐿1 𝑦1 + 𝐿2 𝑦2 + 𝐿3 𝑦3

1 1 1 1 𝐿1
[𝑥 ] = [𝑥1 𝑥2 𝑥3 ] [𝐿2 ]
𝑦 𝑦1 𝑦2 𝑦3 𝐿3

1 1 1 −1 1 1 1 1 −1 1 1 1 𝐿1
[𝑥1 𝑥2 𝑥3 ] [𝑥 ] = [𝑥1 𝑥2 𝑥3 ] [𝑥1 𝑥2 𝑥3 ] [𝐿2 ]
𝑦1 𝑦2 𝑦3 𝑦 𝑦1 𝑦2 𝑦3 𝑦1 𝑦2 𝑦3 𝐿3

1 1 1 −1 1 𝐿1
[𝑥1 𝑥2 𝑥3 ] [𝑥 ] = [𝐿2 ]
𝑦1 𝑦2 𝑦3 𝑦 𝐿3

After solving the matrix, we get


1
𝐿1 = [(𝑥 𝑦 − 𝑥3 𝑦2 ) + 𝑥 (𝑦2 −𝑦3 ) + 𝑦(𝑥3 − 𝑥2 )]
2Δ 2 3
1
𝐿2 = [(𝑥 𝑦 − 𝑥1 𝑦3 ) + 𝑥 (𝑦3 − 𝑦1 ) + 𝑦(𝑥1 − 𝑥3 )]
2Δ 3 1
1
𝐿3 = [(𝑥 𝑦 − 𝑥1 𝑦2 ) + 𝑥 (𝑦1 − 𝑦2 ) + 𝑦(𝑥2 − 𝑥1 )]
2Δ 2 1 }

Prepared by Dr. Md. Shahjada Tarafder Page 31


So the interesting result is obtained as

𝐿1 = 𝑁1
𝐿2 = 𝑁2 }
𝐿3 = 𝑁3

For quadratic approximation we may write


𝑥 = 𝑎1 𝐿1 + 𝑎2 𝐿2 + 𝑎3 𝐿3 + 𝑎4 𝐿1 𝐿2 + 𝑎5 𝐿2 𝐿3 + 𝑎6 𝐿3 𝐿1 (3.34)

Fig. Natural co-ordinate triangular Fig. Natural co-ordinate triangular


element with quadratic variation element with cubic variation

Referring to Fig. () with three additional nodes installed at mid-sides of the triangle, we
may write at each corner and mid-side node
𝑥1 = 𝑎1 𝑥2 = 𝑎2 𝑥3 = 𝑎3
1 1 1 1 1 1 1 1 1
𝑥4 = 𝑎1 + 𝑎2 + 𝑎4 𝑥5 = 𝑎2 + 𝑎3 + 𝑎5 𝑥6 = 𝑎1 + 𝑎3 + 𝑎6
2 2 4 2 2 4 2 2 4

Solving for the constant and substituting into Eq. (3.34) we obtain
𝑁1 = (2𝐿1 − 1)𝐿1 𝑁2 = (2𝐿2 − 1)𝐿2 𝑁3 = (2𝐿3 − 1)𝐿3
𝑁4 = 4𝐿1 𝐿2 𝑁5 = 4𝐿2 𝐿3 𝑁6 = 4𝐿3 𝐿1

Prepared by Dr. Md. Shahjada Tarafder Page 32


3.3.3 Integration of Functions of Natural Co-ordinates
The integration of the interpolation functions constructed for various degrees of
approximation over the domain can be expressed as

∬ 𝑓(𝑁) 𝑑𝑥 𝑑𝑦 = ∬ 𝑓(𝑥, 𝑦) 𝑑𝑥 𝑑𝑦

If the functions 𝑓 (𝑥, 𝑦) are of higher order, the explicit integration becomes extremely
cumbersome. Let us consider an integral

𝐼 = ∬ 𝑥 𝑝 𝑦 𝑞 𝑑𝑥 𝑑𝑦

The limit of this integral must be calculated from the slope of each side of the triangle
oriented from the reference Cartesian coordinates. The final form of the integral consists
of the sum of the integrals performed along all three sides of the triangle. With the origin
of the Cartesian co-ordinates at the centroid the following results are obtained:

𝑛=1 𝐼 = ∬ 𝑥 𝑑𝑥 𝑑𝑦 = ∬ 𝑦 𝑑𝑥 𝑑𝑦 = 0
𝐴 𝑝 𝑞 𝑝 𝑞 𝑝 𝑞
𝑛=2 𝐼= (𝑥1 𝑦1 + 𝑥2 𝑦2 + 𝑥3 𝑦3
12
𝐴 𝑝 𝑞 𝑝 𝑞 𝑝 𝑞
𝑛=3 𝐼= (𝑥1 𝑦1 + 𝑥2 𝑦2 + 𝑥3 𝑦3
30
𝐴 𝑝 𝑞 𝑝 𝑞 𝑝 𝑞
𝑛=4 𝐼= (𝑥1 𝑦1 + 𝑥2 𝑦2 + 𝑥3 𝑦3
60
2𝐴 𝑝 𝑞 𝑝 𝑞 𝑝 𝑞
𝑛=4 𝐼= (𝑥1 𝑦1 + 𝑥2 𝑦2 + 𝑥3 𝑦3
105

For one-dimensional element with two co-ordinates L1 and L2 takes the form

Prepared by Dr. Md. Shahjada Tarafder Page 33


𝑚! 𝑛!
𝐼 = ∫ 𝐿𝑚 𝑛
1 𝐿2 𝑑𝐴 = 𝐿
(𝑚 + 𝑛 + 1)!
𝐴

The integration of the interpolation function over the two-dimensional triangular element
with co-ordinate L1, L2 and L3can be represented as

∫ 𝑓 (𝑁) 𝑑𝐴 = ∫ 𝑓(𝐿𝑁 ) 𝑑𝐴
𝐴 𝐴

𝑝 𝑚! 𝑛! 𝑝!
𝐼 = ∫ 𝐿𝑚 𝑛
1 𝐿2 𝐿3 𝑑𝐴 = 2𝐴
(𝑚 + 𝑛 + 𝑝 + 2)!
𝐴

3.3.4 Rectangular Element


The interpolation function for a four-node bilinear rectangular element in global co-
ordinate system is given by
𝑢 = 𝛼0 + 𝛼1 𝑥 + 𝛼2 𝑦 + 𝛼3 𝑥𝑦
and the nodal values of the element are
𝑢 = 𝑢1 𝑎𝑡 𝑥 = −𝑏, 𝑦 = −𝑎
𝑢 = 𝑢2 𝑎𝑡 𝑥 = 𝑏, 𝑦 = −𝑎
𝑢 = 𝑢3 𝑎𝑡 𝑥 = 𝑏, 𝑦= 𝑎
𝑢 = 𝑢4 𝑎𝑡 𝑥 = −𝑏, 𝑦= 𝑎

Fig. Rectangular element

Applying these boundary conditions in to Eq. () we

Prepared by Dr. Md. Shahjada Tarafder Page 34


𝑢1 + 𝑢2 + 𝑢3 + 𝑢4
𝛼0 =
4
𝑢1 − 𝑢2 − 𝑢3 + 𝑢4
𝛼1 =
4
𝑢1 + 𝑢2 − 𝑢3 − 𝑢4
𝛼2 =
4
𝑢1 − 𝑢2 + 𝑢3 − 𝑢4
𝛼3 =
4
Substituting the values of 𝛼0 , 𝛼1 , 𝛼2 𝑎𝑛𝑑 𝛼3 in Eq. () and then rearranging we get
𝑢 = 𝑁1 𝑢1 + 𝑁2 𝑢2 + 𝑁3 𝑢3 + 𝑁4 𝑢4
Where the shape function are given as
1
𝑁1 = (𝑏 − 𝑥)(𝑎 − 𝑦)
4𝑎𝑏
1
𝑁2 = (𝑏 + 𝑥)(𝑎 − 𝑦)
4𝑎𝑏
1
𝑁3 = (𝑏 + 𝑥)(𝑎 + 𝑦)
4𝑎𝑏
1
𝑁4 = (𝑏 − 𝑥)(𝑎 − 𝑦)
4𝑎𝑏
𝑥 𝑦
The shape functions can also be expressed in terms of length ratio 𝜉 = and 𝜂 = , we
𝑏 𝑎

obtain
1
𝑁1 = (1 − 𝜉 )(1 − 𝜂 ) with −1 < 𝜉 ≤ 1 𝑎𝑛𝑑 − 1 < 𝜂 ≤ 1
4
1
𝑁2 = (1 + 𝜉 )(1 − 𝜂 ) with −1 < 𝜉 ≤ 1 𝑎𝑛𝑑 − 1 < 𝜂 ≤ 1
4
1
𝑁3 = (1 + 𝜉 )(1 + 𝜂 ) with −1 < 𝜉 ≤ 1 𝑎𝑛𝑑 − 1 < 𝜂 ≤ 1
4
1
𝑁4 = (1 − 𝜉 )(1 − 𝜂 ) with −1 < 𝜉 ≤ 1 𝑎𝑛𝑑 − 1 < 𝜂 ≤ 1
4

Prepared by Dr. Md. Shahjada Tarafder Page 35


3.3.5 Quadrilateral Isoperimetric Element
In Isoperimetric elements the interpolation functions which are used to define the
geometry of element are also used to describe the variation of the dependent variable
within the element. The isoperimetric co-ordinates (𝜉, 𝜂 ) islocated at the centroid of the
element and its nodal values (𝜉𝑖 , 𝜂𝑖 ) varies from 0 to ±1. The relationship between
Cartesian co-ordinate p(x, y) and isoperimetric co-ordinate 𝑠(𝜉, 𝜂 )can be expressed as
𝑥
𝑦} = 𝛼0 + 𝛼1 𝜉 + 𝛼2 𝜂 + 𝛼3 𝜉𝜂

Fig. Quadrilateral element


The variation of the variable u over the element may also be written as
𝑢 = 𝛼0 + 𝛼1 𝜉 + 𝛼2 𝜂 + 𝛼3 𝜉𝜂
𝛼0
𝛼
= [1 𝜉 𝜂 𝜉𝜂] [𝛼1 ]
2
𝛼3
= [1 𝜉 𝜂 𝜉𝜂][𝛼]
Applying the boundary conditions in terms of nodal values we obtain
Node 1: 𝑢1 = 𝛼0 − 𝛼1 − 𝛼2 + 𝛼3
Node 2: 𝑢2 = 𝛼0 + 𝛼1 − 𝛼2 − 𝛼3
Node 3: 𝑢3 = 𝛼0 + 𝛼1 + 𝛼2 + 𝛼3
Node 4: 𝑢4 = 𝛼0 − 𝛼1 + 𝛼2 − 𝛼3
The above equations can be written into a matrix form as

Prepared by Dr. Md. Shahjada Tarafder Page 36


𝑢1 1−1 −1 1 𝛼0
𝑢2 𝛼
[𝑢 ] = [1 1 −1 −1 ] [𝛼1 ]
3 1 1 1 1 2
𝑢4 1 −1 1 −1 𝛼 3

[𝑢] = [𝐷 ][𝛼]
[𝑎] = [𝐷 ]−1 [𝑢]
1 1 1 1
1
[𝐷 ]−1 = [−1 1 1 −1 ]
4 −1 −1 1 1
1 −1 1 −1
𝑢 = [1 𝜉 𝜂 𝜉𝜂][𝐷 ]−1 [𝑢]
1 1 1 1 𝑢1
1 −1 1 1 −1 𝑢2
= [1 𝜉 𝜂 𝜉𝜂] [ ][ ]
4 −1 −1 1 1 𝑢3
1 −1 1 −1 𝑢4
1
= [(1 − 𝜉 − 𝜂 + 𝜉𝜂 )𝑢1 + (1 + 𝜉 − 𝜂 − 𝜉𝜂 )𝑢2 +(1 + 𝜉 + 𝜂 + 𝜉𝜂 )𝑢3
4
+ (1 − 𝜉 + 𝜂 − 𝜉𝜂 )𝑢4 ]
1
= [(1 − 𝜉)(1 − 𝜂)𝑢1 + (1 + 𝜉)(1 − 𝜂)𝑢2 +(1 + 𝜉 )(1 + 𝜂 )𝑢3 + (1 − 𝜉)(1 + 𝜂)𝑢4 ]
4
= 𝑁1 𝑢1 + 𝑁2 𝑢2 + 𝑁3 𝑢3 + 𝑁4 𝑢4
Now the shape functions for quadrilateral element are
1 1
𝑁1 = (1 − 𝜉 )(1 − 𝜂 ) 𝑁2 = (1 + 𝜉)(1 − 𝜂)
4 4
1 1
𝑁3 = (1 + 𝜉)(1 + 𝜂) 𝑁4 = (1 − 𝜉)(1 + 𝜂)
4 4

In general, the shape functions can be written as


1
𝑁𝑖 = (1 + 𝜉𝑖 𝜉 )(1 + 𝜂𝑖 𝜂 ); 𝑖 = 1, 2, 3,4
4
Writing Eq. (1) in terms of nodal values we shall get similar expression of Eq. ()
4

𝑥 = 𝑁1 𝑥1 + 𝑁2 𝑥2 + 𝑁3 𝑥3 + 𝑁4 𝑥4 = ∑ 𝑁𝑖 𝑥𝑖
𝑖=1
4

𝑦 = 𝑁1 𝑦1 + 𝑁2 𝑦2 + 𝑁3 𝑦3 + 𝑁4 𝑦4 = ∑ 𝑁𝑖 𝑦𝑖
𝑖=1

Prepared by Dr. Md. Shahjada Tarafder Page 37


Chapter 5
Finite Element Method
4.1 Introduction
In finite element method, the fluid domain under consideration in divided into finite
number of sub-domain known as elements. A simple function assumed for the variation
of each dependent variable inside each element. The summation of variation of the
dependent variable in each element used to describe the whole flow field. If u is assumed
to vary linearly inside an element, we can define a second derivative for it. Since most
fluid problems include second derivative, the following techniques is designed to over
this problem. The partial differential equation is multiplied by an unknown function and
then the whole equation can be integrated over the domain which it applies. Finally, the
terms that need to have the order of their derivatives reduced are integrated by parts. This
is known as producing a variation formulation.

The governing equations are multiplied by a weight function before they are integrated
over the entire domain. The solution is approximated by a linear shape function within
each in a way that guarantees continuity of the solution across element boundaries. Such
a function can be constructed from its values the corners of the element.

This approximation is then substituted into the weighted integral of the conservations law
and the equations to be solved are derived by requiring the derivative of the integral with
respect to each nodal value to be zero. This corresponds to selecting the best solution
with the set of the allowed functions.

Calculus of variations, branch of mathematics concerned with the problem of finding


a function for which the value of a certain integral is either the largest or the smallest
possible. Many problems of this kind are easy to state, but their solutions commonly
involve difficult procedures of the differential calculus and differential equations.

Prepared by Dr. Md. Shahjada Tarafder Page 38


The calculus of variations is a field of mathematical analysis that uses variations, which
are small changes in functions and functionals, to find maxima and minima of
functionals: mappings from a set of functions to the real numbers. Functionals are often
expressed as definite integrals involving functions and their derivatives. Functions that
maximize or minimize functionals may be found using the Euler–Lagrange equation of
the calculus of variations.

Prepared by Dr. Md. Shahjada Tarafder Page 39


4.2 Variational operator
Let us consider a function 𝐹 (𝑥, 𝑢, 𝑢′ ) and the variation of u for a constant value of  is
denoted by 𝛿𝑢 = 𝜖 𝜂 of which  is a function of 𝜂(𝑥). Now the change in value of the
function 𝐹 (𝑥, 𝑢, 𝑢′ ) at a fixed-point x is
Δ𝐹 = 𝐹 (𝑥, 𝑢 + 𝜖 𝜂, 𝑢′ + 𝜖 𝜂 ′ ) − 𝐹 (𝑥, 𝑢, 𝑢′ ) (4.1)
Using Taylor’s series expansion the function 𝐹 (𝑥, 𝑢, 𝑢′ ) can be expanded as
𝜕𝐹 𝜕𝐹 ′) ′
1 2
𝜕2𝐹 ′
𝜕2𝐹
Δ𝐹 = 𝐹 (𝑥, 𝑢, 𝑢 + ( 𝜀 𝜂 + ′ 𝜀 𝜂 ) + (𝜀𝜂 ) + (𝜀𝜂 𝜀𝜂 )
𝜕𝑢 𝜕𝑢 2 𝜕𝑢2 𝜕𝑢 𝜕𝑢𝑦 ′
1 ′ 2
𝜕2𝐹
+ (𝜀𝜂 ) + ⋯ ⋯ − 𝐹 (𝑥, 𝑢, 𝑢′ )
2 𝜕𝑢′ 2
𝜕𝐹 𝜕𝐹 ′
1 2
𝜕2𝐹 ′
𝜕2𝐹 1 ′ 2
𝜕2𝐹
= 𝜀 𝜂 + ′ 𝜀 𝜂 + (𝜀𝜂 ) + (𝜀𝜂 𝜀𝜂 ) + (𝜀𝜂 ) +⋯
𝜕𝑢 𝜕𝑢 2 𝜕𝑢2 𝜕𝑢 𝜕𝑢′ 2 𝜕𝑢′ 2
𝜕𝐹 𝜕𝐹
= 𝜀𝜂+ 𝜀 𝜂 ′ + 𝜖 𝑅1 (𝜀) in which lim 𝑅1 (𝜀) = 0
𝜕𝑢 𝜕𝑢′ 𝜖→0

u(x) = u(x) + (x)


u
(x) P1 (x ,y )
1 1

(x0,y0) P0

y(x)

x0 x1 x

The first variation of F is defined by


𝐹 (𝑥, 𝑢 + 𝜖 𝜂, 𝑢′ + 𝜖 𝜂 ′ ) − 𝐹 (𝑥, 𝑢, 𝑢′ ) Δ𝐹
𝛿𝐹 = 𝜖 [lim ] = 𝜖 lim
𝜖→0 𝜀 𝜖→0 𝜀

𝜕𝐹 𝜕𝐹 𝜕𝐹 𝜕𝐹
𝛿𝐹 = 𝜖 ( 𝜂 + ′ 𝜂′ ) = 𝜖𝜂 + ′ 𝜖𝜂 ′
𝜕𝑢 𝜕𝑢 𝜕𝑢 𝜕𝑢

Prepared by Dr. Md. Shahjada Tarafder Page 40


𝜕𝐹 𝜕𝐹
𝛿𝐹 = 𝛿𝑢 + 𝛿𝑢′ (4.2)
𝜕𝑢 𝜕𝑢′

The total differential of 𝐹 (𝑥, 𝑢, 𝑢′ ) isobtained as


𝜕𝐹 𝜕𝐹 𝜕𝐹
𝑑𝐹 = 𝑑𝑥 + 𝑑𝑢 + 𝑑𝑢′ (4.3)
𝜕𝑥 𝜕𝑢 𝜕𝑢′

Since x is fixed varied during the variation from u to 𝑢 + 𝛿𝑢, 𝑑𝑥 = 0. Now from Eq.
(4.3)
𝜕𝐹 𝜕𝐹
𝑑𝐹 = 𝑑𝑦 + ′ 𝑑𝑢 ′
𝜕𝑢 𝜕𝑢
= 𝛿𝐹
The operator  acts as differential operation with respect to dependent variables and the
laws of variation of sums, products, ratios and powers are completely analogous to the
corresponding laws of differentiation as follows:
(a) 𝛿 (𝐹1 ± 𝐹2 ) = 𝛿𝐹1 ± 𝛿𝐹2
(b) 𝛿 (𝐹1 ∙ 𝐹2 ) = 𝐹2 𝛿𝐹1 + 𝐹1 𝛿𝐹2
𝐹 𝐹2 𝛿𝐹1 −𝐹1 𝛿𝐹2
(c) 𝛿 ( 1) =
𝐹2 𝐹22

(d) 𝛿 (𝐹1𝑛 ) = 𝑛(𝐹1 )𝑛−1 𝛿𝐹1

𝑑 𝑑𝑢
(e) (𝛿𝑢) = 𝛿 ( )
𝑑𝑥 𝑑𝑥

𝑑 𝑑 𝑑𝜂
(𝛿𝑢) = (𝜖𝜂 ) = 𝜖
𝑑𝑥 𝑑𝑥 𝑑𝑥
𝑑𝑢 𝑑 𝑑𝑢 𝑑𝜂
𝛿( )= (𝑢 + 𝜖𝜂 ) − =𝜖
𝑑𝑥 𝑑𝑥 𝑑𝑥 𝑑𝑥
𝑑 𝑑𝑢
(𝛿𝑢) = 𝛿 ( )
𝑑𝑥 𝑑𝑥

𝑏 𝑏 𝑏
(f) 𝛿 ∫𝑎 𝑢(𝑥)𝑑𝑥 = ∫𝑎 (𝑢 + 𝜖𝜂 ) 𝑑𝑥 − ∫𝑎 𝑢 𝑑𝑥
𝑏 𝑏 𝑏

= ∫ 𝑢𝑑𝑥 + ∫ 𝜖𝜂𝑑𝑥 − ∫ 𝑢 𝑑𝑥
𝑎 𝑎 𝑎

Prepared by Dr. Md. Shahjada Tarafder Page 41


𝑏

= ∫ 𝜖𝜂𝑑𝑥
𝑎
𝑏 𝑏

𝛿 ∫ 𝑢(𝑥)𝑑𝑥 = ∫ 𝛿𝑢𝑑𝑥
𝑎 𝑎

𝑏 𝑏 𝑏
(g) 𝛿 ∫𝑎 𝑥 𝑢(𝑥)𝑑𝑥 = ∫𝑎 𝑥 (𝑢 + 𝜖𝜂 )𝑑𝑥 − ∫𝑎 𝑥𝑢𝑑𝑥
𝑏 𝑏 𝑏 𝑏
= ∫𝑎 𝑥 𝑢 𝑑𝑥 + ∫𝑎 𝑥 𝜖𝜂𝑑𝑥 − ∫𝑎 𝑥 𝑢 𝑑𝑥 = ∫𝑎 𝑥 𝜖𝜂𝑑𝑥
𝑏 𝑏

𝛿 ∫ 𝑥 𝑢 (𝑥)𝑑𝑥 = ∫ 𝑥 𝛿𝑢𝑑𝑥
𝑎 𝑎

(h) 𝑔𝑟𝑎𝑑 (𝛿𝐹 ) = 𝛿(𝑔𝑟𝑎𝑑𝐹)


𝜕 𝜕
∇(𝛿𝐹 ) = 𝑖 (𝛿𝐹) + 𝑗 (𝛿𝐹)
𝜕𝑥 𝜕𝑦
𝜕𝐹 𝜕𝐹
=𝑖𝛿( )+𝑗𝛿( )
𝜕𝑥 𝜕𝑦

𝜕𝐹 𝜕𝐹
= 𝛿 [𝑖 ( ) + 𝑗 ( )]
𝜕𝑥 𝜕𝑦

= 𝛿(∇𝐹)

1
(i) 𝑔𝑟𝑎𝑑(𝛿𝐹) ∙ 𝑔𝑟𝑎𝑑𝐹 = 𝛿 |𝑔𝑟𝑎𝑑𝐹 |2
2
𝜕 𝜕 𝜕𝐹 𝜕𝐹
∇(𝛿𝐹) ∙ ∇𝐹 = [𝑖 𝛿𝐹 + 𝑗 𝛿𝐹] ∙ [𝑖 +𝑗 ]
𝜕𝑥 𝜕𝑦 𝜕𝑥 𝜕𝑦
𝜕𝐹 𝜕𝐹 𝜕𝐹 𝜕𝐹
= [𝑖𝛿 ( ) + 𝑗𝛿 ( )] ∙ [𝑖 +𝑗 ]
𝜕𝑥 𝜕𝑦 𝜕𝑥 𝜕𝑦

𝜕𝐹 𝜕𝐹 𝜕𝐹 𝜕𝐹
=𝛿( ) +𝛿( )
𝜕𝑥 𝜕𝑥 𝜕𝑦 𝜕𝑦
𝜕𝐹 𝜕𝐹
Applying the formula 𝛿𝐹 = 𝛿𝑢 + 𝛿𝑢′
𝜕𝑢 𝜕𝑢′
𝜕 𝜕𝐹 𝜕 𝜕𝐹 𝜕𝐹 𝜕 𝜕𝐹 𝜕 𝜕𝐹 𝜕𝐹
∇(𝛿𝐹) ∙ ∇𝐹 = [ ( ) 𝛿𝑥 + ( ) 𝛿𝑦] +[ ( ) 𝛿𝑥 + ( ) 𝛿𝑦]
𝜕𝑥 𝜕𝑥 𝜕𝑦 𝜕𝑥 𝜕𝑥 𝜕𝑥 𝜕𝑦 𝜕𝑦 𝜕𝑦 𝜕𝑦

Prepared by Dr. Md. Shahjada Tarafder Page 42


𝜕𝐹 𝜕 𝜕𝐹 𝜕𝐹 𝜕 𝜕𝐹 𝜕𝐹 𝜕 𝜕𝐹 𝜕𝐹 𝜕 𝜕𝐹
=[ ( )+ ( )] 𝛿𝑥 + [ ( )+ ( )] 𝛿𝑦
𝜕𝑥 𝜕𝑥 𝜕𝑥 𝜕𝑦 𝜕𝑥 𝜕𝑦 𝜕𝑥 𝜕𝑦 𝜕𝑥 𝜕𝑦 𝜕𝑦 𝜕𝑦

1 𝜕 𝜕𝐹 2 𝜕𝐹 2 1 𝜕 𝜕𝐹 2 𝜕𝐹 2
= [( ) + ( ) ] 𝛿𝑥 + [( ) + ( ) ] 𝛿𝑦
2 𝜕𝑥 𝜕𝑥 𝜕𝑦 2 𝜕𝑦 𝜕𝑥 𝜕𝑦

𝜕𝐹 𝜕𝐹
Applying the formula 𝛿𝐹 = 𝛿𝑢 + 𝛿𝑢′
𝜕𝑢 𝜕𝑢′

1 𝜕𝐹 2 𝜕𝐹 2
= 𝛿 [( ) + ( ) ]
2 𝜕𝑥 𝜕𝑦
1
= 𝛿 |∇ 𝐹 |2
2

4.3 Functional
The definite integral of the form
𝑏 𝑑𝑢
𝐼(𝑢) = ∫𝑎 𝐹(𝑥, 𝑢, 𝑢́ ) 𝑑𝑥, 𝑢 = 𝑢 (𝑥 ) , 𝑢́ =
𝑑𝑥

is called a functional in which the integrand 𝐹(𝑥, 𝑢, 𝑢́ ) is a function of the argument x, u


𝑑𝑢
and . Mathematically, a functional is an operator mapping u into a scalar 𝐼(𝑢)and the
𝑑𝑥

functions 𝑢 = 𝑢(𝑥) maps u with respect to x. The integrand 𝐹(𝑥, 𝑢, 𝑢́ ) is a function of


functions of u(x).

(a) A functional 𝐼(𝑢) is said to be linear in u if and only if it satisfies the following
relation.

𝑙 (𝛼𝑢 + 𝛽𝑣 ) = 𝛼 𝑙(𝑢 ) + 𝛽 𝑙(𝑣)

for any scalars  and  and dependent variables u and v. An example for a linear
functional is
𝐿
dv
𝐼(𝑣) = ∫ 𝑣 𝑓 𝑑𝑥 + 𝐿 𝑀0
0 dx

where f and M0 are known quantities.

(b) A functional 𝐵(𝑢, 𝑣 ) is said to be bilinear if it is linear in each of its arguments u and
v.

Prepared by Dr. Md. Shahjada Tarafder Page 43


𝐵(𝛼𝑢1 + 𝛽𝑢2 , 𝑣 ) = 𝛼 𝐵(𝛼𝑢1 , 𝑣 ) + 𝛽 𝐵(𝑢2 , 𝑣 ) Linearity in the first argument

𝐵(𝑢, 𝛼𝑣1 + 𝛽𝑣2 , ) = 𝛼 𝐵(𝑢, 𝑣1 ) + 𝛽 𝐵(𝑢, 𝑣2 ) Linearity in the second argument

𝑤ℎ𝑒𝑟𝑒 𝑢, 𝑢1 , 𝑢2 , 𝑣, 𝑣1 𝑎𝑛𝑑 𝑣2 are dependent variables.

(c) A bilinear functional is said to be symmetric its u and v if 𝐵(𝑢, 𝑣 ) = 𝐵(𝑣, 𝑢). An
example of a symmetric functional is as follows:
𝑏 du dv
𝐼 (𝑢, 𝑣 ) = ∫𝑎 𝐸𝐴 𝑑𝑥
dx dx

Example 3.1 Determine the functional of the following boundary value problem
d2 u
= 𝑓(𝑥) with 𝑢(𝑎) = 𝑢(𝑏) = 0
dx2

Solution:
𝑏 𝑏
𝛿 ∫ 𝑓 (𝑥) 𝑢 𝑑𝑥 = ∫ 𝑓 (𝑥) 𝛿𝑢 𝑑𝑥
𝑎 𝑎
𝑏
= ∫ 𝑓 (𝑥) 𝛿𝑢 𝑑𝑥
𝑎
𝑏
d2 u
=∫ 2
𝛿𝑢 𝑑𝑥
𝑎 dx

du 𝑏 𝑏 du d
= [𝛿𝑢 ] − ∫𝑎 (𝛿𝑢)𝑑𝑥
dx 𝑎 dx dx

𝑏 du du
= − ∫𝑎 𝛿 ( ) 𝑑𝑥
dx dx

1 𝑏 du 2
= − ∫ 𝛿 ( ) 𝑑𝑥
2 𝑎 dx
1 du 2
𝑏
= −𝛿 ∫ ( ) 𝑑𝑥
𝑎 2 dx
𝑏
1 du 2
𝛿 ∫ [𝑓 (𝑥) 𝑢 + ( ) ] 𝑑𝑥 = 0
𝑎 2 dx
Now the functional defined by the minimum value of the integral can be obtained as

Prepared by Dr. Md. Shahjada Tarafder Page 44


b
1 du 2
𝐼(𝑢) = ∫ [ ( ) + u(x)𝑓(𝑥)] 𝑑𝑥
2 dx
a

Example 3.2 Determine the functional of the following boundary value problem
∇2 u = −𝑓(𝑥, 𝑦) with u = 0 on the boundary C of the region S.
Solution:
Method 1:

𝛿 ∬ 𝑓 𝑢 𝑑𝑥 𝑑𝑦 = ∬ 𝑓 𝛿𝑢 𝑑𝑥 𝑑𝑦
𝑆 𝑆

Substituting the values of f in right hand side of above equation we obtain

𝛿 ∬ 𝑓𝑢 𝑑𝑥 𝑑𝑦 = − ∬ ∇2 u 𝛿𝑢 𝑑𝑥 𝑑𝑦
𝑆 𝑆

Vector identity: ∇ ∙ (𝐹 ∇𝐺 ) = ∇𝐹 ∙ ∇𝐺 + 𝐹 ∇2 G
Replacing F by u and G by u, we get ∇ ∙ (𝛿𝑢∇u) = ∇𝛿𝑢 ∙ ∇u + 𝛿𝑢∇2 u and hence

𝛿 ∬ 𝑓𝑢 𝑑𝑥 𝑑𝑦 = ∬ ∇𝛿𝑢 ∙ ∇u 𝑑𝑥 𝑑𝑦 − ∬ ∇ ∙ (𝛿𝑢∇u) 𝑑𝑥 𝑑𝑦
𝑆 𝑆 𝑆
1
Applying Gauss divergence theorem and ∇(𝛿𝐹 ) ∙ ∇ 𝐹 = = 𝛿 |∇ 𝐹 |2 we have
2

1
𝛿 ∬ 𝑓 𝑢 𝑑𝑥 𝑑𝑦 = ∬ δ|∇u|2 dx dy − ∫ 𝛿𝑢(∇u ∙ n) dS
2 𝐶
𝑆 𝑆
1
𝛿 ∬𝑆 𝑓 𝑢 𝑑𝑥 𝑑𝑦 = δ ∬𝑆 |∇u|2 dx dy
2

1 ∂u 2 ∂u 2
δ ∬ [ {( ) + ( ) } − 𝑓𝑢] dx dy = 0
2 ∂x ∂y
𝑆

So, the required functional is

Prepared by Dr. Md. Shahjada Tarafder Page 45


1 ∂u 2 ∂u 2
𝐼(𝑢) = ∬ [ {( ) + ( ) } − 𝑓𝑢] dx dy
2 ∂x ∂y
𝑆

Method 2:
Let us consider a function v(x, y) that satisfies the boundary condition 𝑣 = 0 𝑜𝑛 𝐶.
∇2 u = −𝑓(𝑥, 𝑦)
Multiplying both sides by v(𝑥, 𝑦) and then integrating we obtain

∬ 𝑣 ∇2 u dx dy = − ∬ 𝑣 𝑓𝑑𝑥 𝑑𝑦
S S

Using the vector identity ∇ ∙ (𝐹 ∇𝐺 ) = ∇𝐹 ∙ ∇𝐺 + 𝐹 ∇2 G and letting 𝐹 = 𝑣 and 𝐺 =


𝑢, we get

∬ ∇v ∙ ∇u 𝑑𝑥 𝑑𝑦 − ∬ ∇ ∙ (𝑣∇u) 𝑑𝑥 𝑑𝑦 = ∬ 𝑣 𝑓𝑑𝑥 𝑑𝑦
S S S

Applying Gauss-divergence theorem in the second integral of above equation we get

∂v ∂u ∂v ∂u
∬( + ) dx dy − ∫ 𝑣 (∇u ∙ n)𝑑𝑠 = ∬ 𝑣 𝑓𝑑𝑥 𝑑𝑦
∂x ∂x ∂y ∂y C
S S

Where n is the unit normal vector on the arc and the terms inside the first bracket of Eq.
() are bilinear and setting 𝑣 = 𝑢 in the bilinear terms and then multiplying by ½ we get
the functional as

1 ∂u 2 ∂u 2
I(u) = ∬ [ {( ) + ( ) } − u 𝑓] dx dy
2 ∂x ∂y
S

Prepared by Dr. Md. Shahjada Tarafder Page 46


Boundary value problems with associated functionals
No.
(a) d2 u
= 𝑓 (𝑥)with 𝑢(𝑎) = 𝑢(𝑏) = 0
dx2
b
1 du 2
𝐼(𝑢) = ∫ [ ( ) + u(x)𝑓(𝑥)] 𝑑𝑥
2 dx
a
b

𝐼(𝑢) = ∫ 𝑢(2𝑓 − 𝑢′′ )𝑑𝑥


a

(b) d2 u 𝑑𝑢
+ 𝑘𝑢 = 𝑓(𝑥) with 𝑢(0) = 0, | =1
dx2 𝑑𝑥 𝑥=1

b
1 du 2
𝐼(𝑢) = ∫ [( ) − k u2 + 2 u x 2 ] 𝑑𝑥 − 𝑢(1)
2 dx
a

(c) ∇2 u = 0 with u = 0 on the boundary C of R

1 ∂u 2 ∂u 2
I(u) = ∬ [ {( ) + ( ) }] dx dy
2 ∂x ∂y
S

(d) ∇2 u = −𝑓(𝑥, 𝑦) with u = 0 on the boundary C of R

1 ∂u 2 ∂u 2
I(u) = ∬ [ {( ) + ( ) } − u 𝑓] dx dy
2 ∂x ∂y
S

(e) 𝑑4 𝑢 𝑑2 𝑢
𝐸𝐼 4 + 𝑘𝑢 = 𝑓 (𝑥) 𝑤𝑖𝑡ℎ 𝑢 = 2 = 0 𝑎𝑡 𝑥 = 0, 1
𝑑𝑥 𝑑𝑥
2
1 𝑑2 𝑢
I(u) = ∬ [( 2
) + 𝑘𝑢2 − 2𝑢𝑓] dx
2 𝑑𝑥
S

Prepared by Dr. Md. Shahjada Tarafder Page 47


4.4 Euler-Lagrange Equation
Consider a functional I such that
𝑏
𝑑𝑢
𝐼 = ∫ 𝐹 (𝑥, 𝑢, ) 𝑑𝑥
𝑑𝑥
𝑎

The relation between u and x is not known and the problem consists of finding the
relation so that I becomes either a maximum or a minimum. The necessary condition for
extremum of the function is
𝑑𝐼
| =0
𝑑𝜀 𝜀=0
Let 𝑢 = 𝜂 (𝑥) be any function with continuous second derivative which vanishes at the
end points of the interval (𝑥0 , 𝑥1 ) and 𝑢 = 𝑢0 (𝑥) + 𝜀 𝜂 (𝑥) represents a family of curves
passing through(𝑥0 , 𝑢0 )and (𝑥1 , 𝑢1 ). Now from Eq. () one obtains
𝑏

𝐼 = ∫ 𝐹 (𝑥, 𝑢0 + 𝜀 𝜂, 𝑢0′ + 𝜀 𝜂 ′ ) 𝑑𝑥
𝑎

The Taylor’s series expansion for a multivariable function 𝐹 (𝑥, 𝑢0 + 𝜀 𝜂, 𝑢0′ + 𝜀 𝜂 ′ )about
a point (𝑥0 , 𝑢0 , 𝑢0′ ) can be expressed as
𝜕𝐹 𝜕𝐹 1 𝜕2 𝐹 𝜕2 𝐹
𝐹 (𝑥, 𝑢, 𝑢′ ) = 𝐹 (𝑥, 𝑢0 , 𝑢0′ ) + [ 𝜀𝜂+ ′
′ 𝜀 𝜂 ]+
(𝜀𝜂 )2 (
2 + 𝜀𝜂 𝜀𝜂
′)
+
𝜕𝑢0 𝜕𝑢0 2 𝜕𝑢0 𝜕𝑢0 𝜕𝑢0′

1 𝜕2 𝐹
(𝜀𝜂 ′ )2 2 + ⋯⋯
2 𝜕𝑢0′

Integrating Eq. () between a and b and taking the derivative with respect to , we obtain
𝑏
𝑑𝐼 𝜕𝐹 𝜕𝐹 𝜕2𝐹 𝜕2𝐹 𝜕2𝐹
= ∫ [0 + ( 𝜂 + ′ 𝜂 ′ ) + (𝜀𝜂 2 + 2𝜀 𝜂𝜂 ′ ′ + 𝜀𝜂 ′
′2
) + ⋯ ⋯ ] 𝑑𝑥
𝑑𝜀 𝑎 𝜕𝑢 0 𝜕𝑢 0 𝜕𝑢 0 𝜕𝑢 0 𝜕𝑢 0 𝜕𝑢 0

Applying the condition for extremum, we get


𝑏
𝜕𝐹 𝜕𝐹 ′ 𝜕2𝐹 ′
𝜕2𝐹 ′
𝜕2𝐹
∫ [( 𝜂 + ′ 𝜂 ) + {𝜀𝜂 2 + 2𝜀 𝜂𝜂 + 𝜀𝜂 2 } + ⋯ ⋯ ] 𝑑𝑥 = 0
𝑎 𝜕𝑢0 𝜕𝑢0 𝜕𝑢0 𝜕𝑢0 𝜕𝑢0′ 𝜕𝑢0′
The terms within the first bracket is called the first variation of I and is written as
𝑏
𝜕𝐹 𝜕𝐹
𝛿𝐼 = ∫ ( 𝜂 + ′ 𝜂 ′ ) 𝑑𝑥 = 0
𝑎 𝜕𝑢0 𝜕𝑢0
Prepared by Dr. Md. Shahjada Tarafder Page 48
And the second variation of I is
𝑏
2
𝜕2𝐹 ′
𝜕2𝐹 ′
𝜕2𝐹
𝛿 𝐼 = ∫ (𝜀𝜂 2 + 2𝜀 𝜂𝜂 + 𝜀𝜂 2 ) 𝑑𝑥 = 0
𝑎 𝜕𝑢0 𝜕𝑢0 𝜕𝑢0′ 𝜕𝑢0′
As 𝜀 = 0, 𝑢0 + 𝜀 𝜂 = 𝑢 and Eq. () can finally be written as
𝑏
𝜕𝐹 𝜕𝐹
∫ ( 𝜂 + ′ 𝜂 ′ ) 𝑑𝑥 = 0
𝑎 𝜕𝑢 𝜕𝑢
𝑏
𝑏
𝜕𝐹 𝜕𝐹 𝑑 𝜕𝐹
∫ 𝜂 𝑑𝑥 + ′ 𝜂 |𝑏𝑎 − ∫ ( ′ ) 𝜂 𝑑𝑥 = 0
𝑎 𝜕𝑢 𝜕𝑢 𝑑𝑥 𝜕𝑢
𝑎
𝑏
𝜕𝐹 𝑑 𝜕𝐹 𝜕𝐹 𝜕𝐹
∫ [ − ( ′ )] 𝜂 𝑑𝑥 + ′ 𝜂 (𝑏) − ′ 𝜂 (𝑎) = 0
𝑎 𝜕𝑢 𝑑𝑥 𝜕𝑢 𝜕𝑢 𝜕𝑢
As the value of  is zero on the boundary x = a and x = b, we obtain
𝑏
𝜕𝐹 𝑑 𝜕𝐹
∫ [ − ( )] 𝜂 𝑑𝑥 = 0
𝑎 𝜕𝑢 𝑑𝑥 𝜕𝑢′
𝜕𝐹 𝑑 𝜕𝐹
− ( )
𝜕𝑢 𝑑𝑥 𝜕𝑢′
Similar operations when performed on the integral
𝑏

𝐼 = ∫ 𝐹 (𝑥, 𝑢, 𝑢′ , 𝑢′′ ⋯ ⋯ 𝑢𝑛 )𝑑𝑥


𝑎

yield the Euler-Lagrange of the form


𝜕𝐹 𝑑 𝜕𝐹 𝑑 2 𝜕𝐹 𝜕𝐹
− ( ′ ) + 2 ( ′′ ) − ⋯ ⋯ ⋯ ⋯ ⋯ ⋯ + (−1)𝑛 𝑛 = 0
𝜕𝑢 𝑑𝑥 𝜕𝑢 𝑑𝑥 𝜕𝑢 𝜕𝑢
The equation can also be generalized to the problems of minimizing double integral over
the region R as

𝜕𝑢 𝜕𝑢
𝐼(𝑢) = ∫ 𝐹 (𝑥, 𝑦, 𝑢, , ) 𝑑𝑥𝑑𝑦
𝜕𝑥 𝜕𝑦
𝑅

The Euler-Lagrange equation corresponding to Eq. () may be derived as

Prepared by Dr. Md. Shahjada Tarafder Page 49


𝜕𝐹 𝜕 𝜕𝐹 𝜕 𝜕𝐹
− [ 𝜕𝑢 ] − [ 𝜕𝑢 ] = 0
𝜕𝑢 𝜕𝑥 𝜕 ( ) 𝜕𝑦 𝜕 ( )
𝜕𝑥 𝜕𝑥

Example: Find out the Euler Lagrange equation that extremizes the following functional
1 𝑏
du 2 𝑑𝑢
𝐼(𝑢) = ∫ [( ) + u2 + 2 u x] 𝑑𝑥 = ∫ 𝐹 (𝑥, 𝑢, ) 𝑑𝑥
dx 𝑑𝑥
0 𝑎

𝑑𝑢 du 2
Now 𝐹 (𝑥, 𝑢, ) = ( ) + u2 + 2 u x
𝑑𝑥 dx

𝐹 (𝑥, 𝑢, 𝑢′) = (𝑢′)2 + u2 + 2 u x


𝜕𝐹
= 2𝑢 + 2𝑥
𝜕𝑢
𝜕𝐹
= 2𝑢′
𝜕𝑢′
The extremization of the functional 𝐼 (𝑢) requires to satisfy the condition below:
𝜕𝐹 𝑑 𝜕𝐹
− ( )=0
𝜕𝑢 𝑑𝑥 𝜕𝑢′
𝑑 du
2𝑢 + 2𝑥 − (2 ) = 0
𝑑𝑥 dx
𝑑 du
( )=𝑢+𝑥
𝑑𝑥 dx

Prepared by Dr. Md. Shahjada Tarafder Page 50


4.5 Rayleigh-Ritz method:
The Rayleigh-Ritz method begins with finding a functional based on the branch of
mathematics of calculus of variations. A minimization of such a functional provides the
solution of the differential equations. Actually, the calculus of variations determines the
particular function u(x) which extremizes the functional.
𝜕2 𝑢 𝜕2 𝑢
Consider the poisons equation ( 2
+ ) = −𝑓(𝑥, 𝑦) with u = 0 on the boundary
𝜕𝑥 𝜕𝑦 2

condition of the square (0 < 𝑥 ≤ 1, 0 < 𝑦 ≤ 1). The functional of the Poisons equation
is given by

𝜕𝑢 2 𝜕𝑢 2
𝐼(𝑢) = ∬ {( ) + ( ) − 2𝑢𝑓} 𝑑𝑥𝑑𝑦
𝜕𝑥 𝜕𝑦

Let the exact solution 𝑢 be approximated by


𝑢 ≈ ∑𝑛𝑖=0 𝛼𝑖 𝜙𝑖 .
Now from the equation of the functional we have
2 2
𝜕𝜙𝑖 𝜕𝜙𝑖
𝐼(𝑢) = ∬ {(∑ 𝛼𝑖 ) + (∑ 𝛼𝑖 ) − 2 ∑ 𝛼𝑖 𝜙𝑖 𝑓} 𝑑𝑥𝑑𝑦
𝜕𝑥 𝜕𝑦

𝜕𝜙𝑖 2 𝜕𝜙𝑖 2 𝜕𝜙𝑖 𝜕𝜙𝑗 𝜕𝜙𝑖 𝜕𝜙𝑗


= ∬ ∑ 𝛼𝑖2 {( ) +( ) } 𝑑𝑥𝑑𝑦 + 2 ∬ ∑𝑗≠𝑖 𝛼𝑖 𝛼𝑗 ( + ) 𝑑𝑥 𝑑𝑦
𝜕𝑥 𝜕𝑦 𝜕𝑥 𝜕𝑥 𝜕𝑦 𝜕𝑦

−2 ∬ ∑ 𝛼𝑖 𝜙𝑖 𝑓 𝑑𝑥 𝑑𝑦

𝜕𝐼
= 2𝐴𝑖𝑖 𝛼𝑖 + 2 ∑ 𝐴𝑖𝑗 𝛼𝑗 − 2 ℎ𝑖
𝜕𝛼𝑖
𝑗≠𝑖

Where

𝜕𝜙𝑖 𝜕𝜙𝑗 𝜕𝜙𝑖 𝜕𝜙𝑗


𝐴𝑖𝑗 = ∬ ( + ) 𝑑𝑥 𝑑𝑦
𝜕𝑥 𝜕𝑥 𝜕𝑦 𝜕𝑦

And

Prepared by Dr. Md. Shahjada Tarafder Page 51


ℎ𝑖 = ∬ 𝜙𝑖 𝑓 𝑑𝑥 𝑑𝑦

Now the variation parameters are to be chosen such that 𝐼(𝛼𝑖 ) is a minimum. Thus
𝜕𝐼
=0
𝜕𝛼𝑖

2𝐴𝑖𝑖 𝛼𝑖 + 2 ∑ 𝐴𝑖𝑗 𝛼𝑗 − 2 ℎ𝑖 = 0
𝑗≠𝑖
𝑛

∑ 𝐴𝑖𝑗 𝛼𝑗 = ℎ𝑖
𝑗=0

The above equation is a system of linear algebraic equations for the unknown parameters
𝛼𝑗 which has a unique solution.

Example 3.4 Solve the following problem by Rayleigh-Ritz method


𝑑2 𝑢
+𝑢+𝑥 =0
𝑑𝑥
subject to 𝑢(𝑥) = 0 𝑎𝑡 𝑥 = 0, 1
Solution:
The functional I(u) is given by
1
1 du 2
𝐼(𝑢) = ∫ [− ( ) + u2 + 2 u x] 𝑑𝑥
2 dx
0

Let the solution be approximated by


𝑢(𝑥) ≈ 𝛼1 𝑥(1 − 𝑥) + 𝛼2 𝑥 2 (1 − 𝑥)
where 𝛼1 and 𝛼2 are the constants and the approximate solution 𝑢(𝑥) satisfies the
boundary conditions. Now from above equation
𝑑𝑢 2
( ) ≈ [𝛼1 (1 − 2𝑥) + 𝛼2 (2𝑥 − 3𝑥 2 )]2
𝑑𝑥
≈ 𝛼12 (1 − 4𝑥 + 4𝑥 2 ) + 𝛼22 (4𝑥 2 − 12𝑥 3 + 9𝑥 4 ) + 2 𝛼1 𝛼2 (2𝑥 − 7𝑥 2 + 6𝑥 3 )

Prepared by Dr. Md. Shahjada Tarafder Page 52


1 1
du 2 1
∫ ( ) 𝑑𝑥 = ∫ 𝛼1 1 − 4𝑥 + 4𝑥 𝑑𝑥 + ∫ 𝛼22 (4𝑥 2 − 12𝑥 3 + 9𝑥 4 ) 𝑑𝑥
2( 2)
dx 0
0 0
1
+ ∫ 2 𝛼1 𝛼2 (2𝑥 − 7𝑥 2 + 6𝑥 3 ) 𝑑𝑥
0
1 1 1
du 2 2
𝑥2 𝑥3 2
𝑥3 𝑥4 𝑥5
∫ ( ) 𝑑𝑥 = 𝛼1 [𝑥 − 4 + 4 ] + 𝛼2 [4 − 12 + 9 ]
dx 2 3 0 3 4 5 0
0
1
𝑥2 𝑥3 𝑥4
+ 2 𝛼1 𝛼2 [2 − 7 + 6 ]
2 3 4 0
1 1

∫ u2 𝑑𝑥 = ∫[𝛼12 (𝑥 2 − 2𝑥 3 + 𝑥 4 ) + 2 𝛼1 𝛼2 (𝑥 3 − 2𝑥 4 + 𝑥 5 ) + 𝛼22 (𝑥 4 − 2𝑥 5 + 𝑥 6 ) ] 𝑑𝑥
0 0
1 1 1 1
2 2
𝑥3 𝑥4 𝑥5 𝑥4 𝑥5 𝑥6 2
𝑥5 𝑥6 𝑥7
∫ u 𝑑𝑥 = 𝛼1 [ − 2 + ] + 2 𝛼1 𝛼2 [ − 2 + ] + 𝛼2 [ − 2 + ]
3 4 5 0 4 5 6 0 5 6 7 0
0
1 1

∫ u x 𝑑𝑥 = ∫[𝛼1 𝑥 (1 − 𝑥) + 𝛼2 𝑥 2 (1 − 𝑥)] x 𝑑𝑥
0 0
1 1 1
𝑥3 𝑥4 𝑥4 𝑥5
∫ u x 𝑑𝑥 = 𝛼1 [ − ] + 𝛼2 [ − ]
3 4 0 4 5 0
0

Eq. () can be written as


1 1 1 1 1 1 1 1 1 1
𝐼(𝑢) ≈ − 𝛼12 [1 − 4 + 4 ] − 𝛼22 [4 − 12 + 9 ] − 𝛼1 𝛼2 [2 − 7 + 6 ]
2 2 3 2 3 4 5 2 3 4
1 1 1 1 1 1 1 1 1 1 1
+ 𝛼12 [ − 2 + ] + 𝛼1 𝛼2 [ − 2 + ] + 𝛼22 [ − 2 + ]
2 3 4 5 4 5 6 2 5 6 7
1 1 1 1
+ 𝛼1 [ − ] + 𝛼2 [ − ]
3 4 4 5
9 13 2 126 1 1
≈ − 𝛼12 − 𝛼2 − 𝛼1 𝛼2 + 𝛼1 + 𝛼
60 210 840 12 20 2
Using the conditions for the extremization of I, we obtain

Prepared by Dr. Md. Shahjada Tarafder Page 53


𝜕𝐼 3 3 1
= − 𝛼1 − 𝛼2 + = 0
𝜕𝛼1 5 10 6
𝜕𝐼 3 26 1
= − 𝛼1 − 𝛼2 + =0
𝜕𝛼2 10 105 10
Solving these two equations we get
1988 7
𝛼1 = = 0.1924 and 𝛼2 = = 0.1707
10332 41

Thus, the approximate solution becomes

𝑢(𝑥) ≈ 0.1924 𝑥 (1 − 𝑥) + 0.1707𝑥 2 (1 − 𝑥)

The exact solution can be obtained as

𝑠𝑖𝑛𝑥
𝑢= −𝑥
𝑠𝑖𝑛1

Example 3.5 Solve the boundary value problem by Rayleigh-Ritz method


𝑑2 𝑢
+𝑥 =0 with 𝑢(𝑥) = 0 𝑎𝑡 𝑥 = 0, 1
𝑑𝑥

Solution:
The functional of the problem is given by
1
d2 u
𝐼(𝑢) = − ∫ u [2x + ] 𝑑𝑥
dx 2
0

Let the solution be approximated by the equation as


𝑛

𝑢(𝑥) ≈ ∑ 𝛼𝑖 𝜙𝑖 (𝑥)
𝑖=1

Substituting Eq. () in Eq. () we obtain


1 𝑛 𝑛
d2 𝜙𝑗
𝐼(𝑢) ≈ − ∫ ∑ 𝛼𝑖 𝜙𝑖 [2x + ∑ 𝛼𝑖 ] 𝑑𝑥
dx 2
0 𝑖=1 𝑗=1

Prepared by Dr. Md. Shahjada Tarafder Page 54


1 𝑛 1 𝑛 𝑛
d2 𝜙𝑗
≈ −2 ∫ ∑ 𝛼𝑖 𝑥 𝜙𝑖 𝑑𝑥 − ∫ ∑ ∑ 𝛼𝑖 𝛼𝑗 𝜙𝑖 𝑑𝑥
dx 2
0 𝑖=1 0 𝑖=1 𝑗=1

Defining
1

𝑝𝑖 = ∫ 𝑥 𝜙𝑖 𝑑𝑥
0

1 d2 𝜙𝑗 𝑑𝜙𝑗 1 1 𝑑𝜙𝑖 𝑑𝜙𝑗 1 𝑑𝜙𝑖 𝑑𝜙𝑗


𝑞𝑖𝑗 = ∫0 𝜙𝑖 𝑑𝑥 = [𝜙𝑖 ] − ∫0 𝑑𝑥 = − ∫0 𝑑𝑥
dx2 𝑑𝑥 0 𝑑𝑥 𝑑𝑥 𝑑𝑥 𝑑𝑥

we can write the above equation as


𝐼(𝑢) ≈ −2 𝛼𝑖 𝑝𝑖 − 2 𝛼𝑖 𝛼𝑗 𝑞𝑖𝑗
Applying the condition of extremization we get
𝑑𝐼
≈ −2 𝑝𝑖 − 2 𝛼𝑗 𝑞𝑖𝑗 = 0
𝑑𝛼𝑖

𝑖 = 1: 𝑝1 + 𝛼1 𝑞11 + 𝛼2 𝑞12 = 0
𝑖 = 2: 𝑝2 + 𝛼1 𝑞21 + 𝛼2 𝑞22 = 0
For n = 2
we have 𝑢(𝑥) ≈ 𝛼1 𝜙1 (𝑥) + 𝛼2 𝜙2 (𝑥) with 𝜙1 (𝑥) = 𝑥(1 − 𝑥) and 𝜙2 (𝑥) = 𝑥 2 (1 − 𝑥)
𝜙1′ (𝑥) ≈ (1 − 2𝑥) and 𝜙2′ (𝑥) ≈ (2𝑥 − 3𝑥 2 )
Now
1 1
1
𝑝1 = ∫ 𝑥 𝜙1 𝑑𝑥 = ∫ 𝑥 2 (1 − 𝑥) 𝑑𝑥 =
12
0 0
1 1
1
𝑝2 = ∫ 𝑥 𝜙2 𝑑𝑥 = ∫ 𝑥 3 (1 − 𝑥) 𝑑𝑥 =
20
0 0
1 1
𝑑𝜙1 2 1
𝑞11 = −∫( ) 𝑑𝑥 = − ∫(1 − 2𝑥)2 = −
𝑑𝑥 3
0 0
1 1
𝑑𝜙2 2 2
𝑞22 = −∫( ) 𝑑𝑥 = − ∫(2𝑥 − 3𝑥 2 )2 𝑑𝑥 = −
𝑑𝑥 15
0 0

Prepared by Dr. Md. Shahjada Tarafder Page 55


1
1
𝑞12 = 𝑞21 = − ∫(1 − 2𝑥) (2𝑥 − 3𝑥 2 ) 𝑑𝑥 = −
6
0

Now from Eq. () and () we obtain


1 1 1
𝑖 = 1: − 𝛼1 − 𝛼2 = 0
12 3 6
1 1 2
𝑖 = 2: − 𝛼1 − 𝛼 =0
20 6 15 2
1
Solving above two equations we get 𝛼1 = 𝛼2 =
6

Now the approximate solution is obtained as


𝑢(𝑥) ≈ 𝛼1 𝜙1 (𝑥) + 𝛼2 𝜙2 (𝑥)
1 1
≈ 𝑥(1 − 𝑥) + 𝑥 2 (1 − 𝑥)
6 6
1
≈ 𝑥(1 − 𝑥 2 )
6

Prepared by Dr. Md. Shahjada Tarafder Page 56


Galerkin method:
The idea of weighted residual method is to multiply the residual by a weighting function
and force the integral of the weighted expression to zero. Consider the problem
d2 u
= 𝑓(𝑥) with 𝑢 ( 𝑎 ) = 𝑢 (𝑏 ) = 0
dx2

Let the solution is approximated by an interpolation function 𝑢(𝑥) ≈ ∑∞


𝑛=1 αi Ni (x). The

substitution of 𝑢 into the differential equation gives the residual R(x) as


d2 u
𝑅(𝑥) = 2 − 𝑓(𝑥)
dx
Taking a weight function N(x), we have
𝑏
∫ 𝑅 (𝑥) 𝑁(𝑥) 𝑑𝑥 = 0
𝑎

Choosing different weighting functions and replacing each of them in Eq. (), we can
generate a system of linear equations in the unknown parameters αi that will determine an
approximation of 𝜙 in form of finite series given in Eq. (). The type of weighting
function chosen depends on the type of weighted residual technique selected. In the
Galerkin method, the weights are set equal to the shape functions 𝑁𝑖 (𝑥).

Example 3.4:
𝑑2 𝑢
+𝑢+𝑥 =0 with 𝑢(𝑥) = 0 𝑎𝑡 𝑥 = 0, 1
𝑑𝑥

Let us consider an approximate solution given by 𝑢(𝑥) ≈ 𝛼1 𝑁1 (𝑥) + 𝛼2 𝑁2 (𝑥). The


interpolation functions N1(x) and N2(x) are defined by
𝑁1 (𝑥) = 𝑥 (1 − 𝑥) and
𝑁2 (𝑥) = 𝑥 2 (1 − 𝑥) in such a way that satisfies the boundary conditions,
𝑁1 (x) = 𝑁2 (𝑥) = 0 𝑎𝑡 𝑥 = 0, 1.
Now the approximate solution and the residual R(x) are respectively written as
𝑢 = 𝛼1 𝑥(1 − 𝑥) + 𝛼2 𝑥 2 (1 − 𝑥) = 𝛼1 𝑁1 + 𝛼2 𝑁2
𝑑2 𝑢
𝑅 (𝑥 ) = +𝑢+𝑥
𝑑𝑥
Prepared by Dr. Md. Shahjada Tarafder Page 57
Setting the integrals of the product of the Residual and the weighted functions 𝑁1 (𝑥) and
𝑁2 (𝑥) gives
1
∫ 𝑅(𝑥) 𝑁1 (𝑥) = 0
0
1
∫ 𝑅(𝑥) 𝑁2 (𝑥) = 0
0

Now from Eq. () we obtain


1
𝑑2 𝑢
∫ [ + 𝑢 + 𝑥] 𝑁1 (𝑥) = 0
0 𝑑𝑥2

𝑑𝑢 1 1
𝑑𝑢 𝑑𝑁1 (𝑥) 1 1
[𝑁1 (𝑥) ] − ∫ 𝑑𝑥 + ∫ 𝑢 𝑁1 (𝑥) 𝑑𝑥 + ∫ 𝑁1 (𝑥) 𝑥 𝑑𝑥 = 0
𝑑𝑥 0 0 𝑑𝑥 𝑑𝑥 0 0

Applying the boundary conditions, we have


1 1 1
𝑑𝑢 𝑑𝑁1 (𝑥)
∫ 𝑑𝑥 − ∫ 𝑢 𝑁1 (𝑥) 𝑑𝑥 − ∫ 𝑁1 (𝑥) 𝑥 𝑑𝑥 = 0
0 𝑑𝑥 𝑑𝑥 0 0
1
∫ [𝛼1 (1 − 2𝑥) + 𝛼2 (2𝑥 − 3𝑥 2 )](1 − 2𝑥)𝑑𝑥
0
1 1
− ∫ [𝛼1 𝑥(1 − 𝑥) + 𝛼2 𝑥 2 (1 − 𝑥)] 𝑥 (1 − 𝑥) 𝑑𝑥 − ∫ 𝑥(1 − 𝑥) 𝑥 𝑑𝑥 = 0
0 0
1
𝛼1 ∫ [(1 − 2𝑥)2 − 𝑥 2 (1 − 𝑥)2 ]𝑑𝑥
0
1 1
+ 𝛼2 ∫0 [(2𝑥 − 3𝑥 2 )(1 − 2𝑥) − 𝑥 3 (1 − 𝑥)2 ]𝑑𝑥 − ∫0 𝑥 2 (1 − 𝑥) 𝑑𝑥 = 0
3 3 1
𝛼1 + 𝛼2 =
10 20 12
Similarly, from Eq. ()
1 1 1
𝑑𝑢 𝑑𝑁2 (𝑥)
∫ 𝑑𝑥 − ∫ 𝑢 𝑁2 (𝑥) 𝑑𝑥 − ∫ 𝑁2 (𝑥) 𝑥 𝑑𝑥 = 0
0 𝑑𝑥 𝑑𝑥 0 0
1
∫ [𝛼1 (1 − 2𝑥) + 𝛼2 (2𝑥 − 3𝑥 2 )](2𝑥 − 3𝑥 2 )𝑑𝑥
0
1 1
− ∫ [𝛼1 𝑥(1 − 𝑥) + 𝛼2 𝑥 1 − 𝑥)] 𝑥 1 − 𝑥) 𝑑𝑥 − ∫ 𝑥 2 (1 − 𝑥) 𝑥 𝑑𝑥 = 0
2( 2(
0 0
Prepared by Dr. Md. Shahjada Tarafder Page 58
1
𝛼1 ∫ [(1 − 2𝑥)(2𝑥 − 3𝑥 2 ) − 𝑥 3 (1 − 𝑥)2 ]𝑑𝑥
0
1 1
+ 𝛼2 ∫ [(2𝑥 − 3𝑥 2 )2 − 𝑥 4 (1 − 𝑥)2 ] 𝑑𝑥 − ∫ 𝑥 3 (1 − 𝑥) 𝑑𝑥 = 0
0 0

3 13 1
𝛼1 + 𝛼2 =
20 105 20
Solving Eq. () and () we obtain
71 7
𝛼1 = and 𝛼2 =
369 41

So, the approximate solution is


71 7 2
𝑢≈ 𝑥 (1 − 𝑥 ) + 𝑥 (1 − 𝑥 )
369 41

Prepared by Dr. Md. Shahjada Tarafder Page 59


Finite Element Method
Consider the following boundary value problem
𝑑2 𝑢 𝑑𝑢
= −𝑓(𝑥) with 𝑢(𝑥) = 0 𝑎𝑡 𝑥 = 0 𝑎𝑛𝑑 = 0 𝑎𝑡 𝑥 = 1
𝑑𝑥 2 𝑑𝑥

Multiplying both sides by the shape function N(x) and then integrating over the element
we get
𝑥𝑖+1 𝑥𝑖+1
𝑑2 𝑢
∫ 𝑁(𝑥) 2 𝑑𝑥 = − ∫ 𝑁(𝑥) 𝑓 (𝑥) 𝑑𝑥
𝑑𝑥
𝑥𝑖 𝑥𝑖
𝑥𝑖+1 𝑥𝑖+1
𝑑𝑢 𝑥𝑖+1 𝑑𝑁(𝑥) 𝑑𝑢
[𝑁(𝑥) ] −∫ 𝑑𝑥 = − ∫ 𝑁(𝑥) 𝑓 (𝑥) 𝑑𝑥
𝑑𝑥 𝑥𝑖 𝑑𝑥 𝑑𝑥
𝑥𝑖 𝑥𝑖

Simplifying the above equation yields


𝑥𝑖+1 𝑥𝑖+1
𝑑𝑁(𝑥) 𝑑𝑢 𝑑𝑢 𝑑𝑢
∫ 𝑑𝑥 = ∫ 𝑁(𝑥) 𝑓(𝑥) 𝑑𝑥 + [𝑁(𝑥) ] − [𝑁(𝑥) ]
𝑑𝑥 𝑑𝑥 𝑑𝑥 𝑥𝑖+1 𝑑𝑥 𝑥𝑖
𝑥𝑖 𝑥𝑖

Let the solution over the i-th element be approximated by


𝑛
(𝑖)
𝑢(𝑥) ≈ ∑ 𝑁𝑗 (𝑥) 𝑢𝑗
𝑗=1

in which 𝑁𝑗 are the shape functions and j represents the number of nodes over the
element. Substituting Eq. () into Eq. () we obtain
𝑛 𝑥𝑖+1 𝑥𝑖+1
(𝑖) 𝑑𝑁𝑖 (𝑥) 𝑑𝑁𝑗 (𝑥) 𝑑𝑢 (𝑖) 𝑑𝑢 (𝑖)
∑ 𝑢𝑗 ∫ 𝑑𝑥 = ∫ 𝑁𝑖 (𝑥) 𝑓(𝑥)𝑑𝑥 + [𝑁(𝑥) ] − [𝑁(𝑥) ]
𝑑𝑥 𝑑𝑥 𝑑𝑥 𝑥𝑖+1 𝑑𝑥 𝑥𝑖
𝑗=1 𝑥𝑖 𝑥𝑖

(𝑖 = 1, 2, 3 ⋯ ⋯ 𝑛)
Eq. () for the i-th element can be finally written into a matrix form as
Prepared by Dr. Md. Shahjada Tarafder Page 60
𝑛
(𝑖) (𝑖) (𝑖)
∑ 𝐾𝑖𝑗 𝑢𝑗 = 𝐹𝑖
𝑗=1
(𝑖) (𝑖)
Where 𝐾𝑖𝑗 and 𝐹𝑖 are called the stiffness matrix and force vector respective and are
given by
𝑥𝑖+1
(𝑖) 𝑑𝑁𝑖 (𝑥) 𝑑𝑁𝑗 (𝑥)
𝐾𝑖𝑗 = ∫ 𝑑𝑥
𝑑𝑥 𝑑𝑥
𝑥𝑖
𝑥𝑖+1
(𝑖) 𝑑𝑢 (𝑖) 𝑑𝑢 (𝑖)
𝐹𝑖 = ∫ 𝑁𝑖 (𝑥) 𝑓(𝑥)𝑑𝑥 + [𝑁(𝑥) ] − [𝑁(𝑥) ]
𝑑𝑥 𝑥𝑖+1 𝑑𝑥 𝑥𝑖
𝑥𝑖

Eq. () is a system of linear algebraic equations and can be solved by Cramer’s rule or L-U
(𝑖)
decomposition method for the value of 𝑢𝑗 .

Prepared by Dr. Md. Shahjada Tarafder Page 61


𝑑2 𝑢
Example 3.6 Solve the boundary value problem = −2 with 𝑢(𝑥) = 0 𝑎𝑡 𝑥 =
𝑑𝑥 2
𝑑𝑢
0 𝑎𝑛𝑑 = 0 𝑎𝑡 𝑥 = 1 by finite element method and then compare the numerical result
𝑑𝑥

with the analytical one.

Solution:
In order to get an approximate solution, the discretized form of the above differential
equation can be expressed as
𝑛
(𝑖) (𝑖) (𝑖)
∑ 𝐾𝑖𝑗 𝑢𝑗 = 𝐹𝑖
𝑗=1

Where
𝑥𝑖+1
(𝑖) 𝑑𝑁𝑖 (𝑥) 𝑑𝑁𝑗 (𝑥)
𝐾𝑖𝑗 = ∫ 𝑑𝑥
𝑑𝑥 𝑑𝑥
𝑥𝑖
𝑥𝑖+1
(𝑖) 𝑑𝑢 (𝑖) 𝑑𝑢 (𝑖)
𝐹𝑖 = ∫ 𝑁𝑖 (𝑥) 𝑓(𝑥)𝑑𝑥 + [𝑁(𝑥) ] − [𝑁(𝑥) ]
𝑑𝑥 𝑥𝑖+1 𝑑𝑥 𝑥𝑖
𝑥𝑖

Let the solution over 𝑖-th element be approximated by


𝑛
(𝑖)
𝑢(𝑥) ≈ ∑ 𝑁𝑗 (𝑥) 𝑢𝑗
𝑗=1

If the region of interest [0, 1] is divided into two equal intervals as shown in Fig the
shape functions at node 𝑖 and 𝑖 + 1can be obtained as
𝑥𝑖+1 −𝑥 𝑥−𝑥𝑖
Ni (x) = Ni+1 (x) =
𝑥𝑖+1 −𝑥𝑖 𝑥𝑖+1 −𝑥𝑖

Now the derivatives of the shape functions are


dNi 1 dNi+1 1
=− =
dx 𝑥𝑖+1 −𝑥𝑖 dx 𝑥𝑖+1 −𝑥𝑖

Application of Eq. () at node (1) and (2) for element 1 gives


(1) (1) (1) (1)
𝐾11 𝐾12 𝑢1 𝐹1
[ (1) (1)
][ (1)
]=[ (1)
]
𝐾21 𝐾22 𝑢2 𝐹2

Prepared by Dr. Md. Shahjada Tarafder Page 62


Similarly, for element 2 we have
(2) (2) (2) (2)
𝐾11 𝐾12 𝑢1 𝐹1
[ (2) (2)
][ (2)
]=[ (2)
]
𝐾21 𝐾22 𝑢2 𝐹2
1
Now for element 1: 𝑥𝑖 = 0 and 𝑥𝑖+1 =
2

The components of the stiffness matrix at node nodes 1 and 2 are


(1) 𝑥 𝑑𝑁1 𝑑𝑁1 (1) 𝑥 𝑑𝑁1 𝑑𝑁2
𝐾11 = ∫𝑥 𝑖+1 𝑑𝑥 = 2 𝐾12 = ∫𝑥 𝑖+1 𝑑𝑥 = −2,
𝑖 𝑑𝑥 𝑑𝑥 𝑖 𝑑𝑥 𝑑𝑥
(1) (1)
𝐾21 = 2, 𝐾22 = 2
And the force vectors at nodes 1and 2 are
𝑥𝑖+1
(1) 𝑑𝑢 (1) 𝑑𝑢 (1) 1 𝑑𝑢 (1)
𝐹1 = −2 ∫ 𝑁1 𝑑𝑥 + [𝑁(𝑥) ] − [𝑁(𝑥) ] = − [𝑁(𝑥) ]
𝑑𝑥 𝑥𝑖+1 𝑑𝑥 𝑥𝑖 2 𝑑𝑥 𝑥𝑖
𝑥𝑖

[𝑠𝑖𝑛𝑐𝑒 𝑁𝑖 = 1, 𝑁𝑖+1 = 0]
𝑥𝑖+1
(1) 𝑑𝑢 (1) 𝑑𝑢 (1) 1 𝑑𝑢 (1)
𝐹2 = −2 ∫ 𝑁2 𝑑𝑥 + [𝑁(𝑥) ] − [𝑁(𝑥) ] = + [𝑁(𝑥) ]
𝑑𝑥 𝑥𝑖+1 𝑑𝑥 𝑥𝑖 2 𝑑𝑥 𝑥𝑖+1
𝑥𝑖

[𝑠𝑖𝑛𝑐𝑒 𝑁𝑖 = 0, 𝑁𝑖+1 = 1]
Now the matrix for element 1 can be expressed as
1 𝑑𝑢 (1)
(1) − |
2 −2 𝑢1 2 𝑑𝑥 1
[ ][ ]=
−2 2 𝑢(1) 1 𝑑𝑢 (1)
2
+ |
[2 𝑑𝑥 2 ]
1
Similarly, for element 2: 𝑥𝑖 = and 𝑥𝑖+1 = 1
2

The components of the stiffness matrix and the force vectors are
(2) (2) (2) (2)
𝐾21 = 2, 𝐾22 = 2, 𝐾21 = 2, 𝐾22 = 2
(2) 1 𝑑𝑢 (2) 1 𝑑𝑢
𝐹1 = −[ ] , 𝐹2 = +[ ]
2 𝑑𝑥 𝑥𝑖 2 𝑑𝑥 𝑥𝑖+1

Now the matrix for element 2

Prepared by Dr. Md. Shahjada Tarafder Page 63


1 𝑑𝑢 (2)
(2) − |
2 −2 𝑢1 2 𝑑𝑥 1
[ ][ ]=
−2 2 𝑢(2) 1 𝑑𝑢 (2)
2
+ |
[2 𝑑𝑥 2 ]
The element 1 and 2 are connected at the node 2 in a way that the global solutions can be
mathematically expressed as
(1) (1) (2) (2)
𝑢1 = 𝑢1 , 𝑢2 = 𝑢2 = 𝑢1 , 𝑢2 = 𝑢 3
Now the global finite element model is
(1)
1 𝑑𝑢
− |
2 𝑑𝑥 1
2 −2 0 𝑢1 (1) (2)
1 𝑑𝑢 1 𝑑𝑢
[−2 2+2 −2] [𝑢2 ] = + | + − |
0 −2 2 𝑢3 2 𝑑𝑥 2 2 𝑑𝑥 1
1 𝑑𝑢 (2)
+ |
[ 2 𝑑𝑥 2 ]
𝑑𝑢 (1) 𝑑𝑢 (2) 𝑑𝑢 (2)
The terms | and | will cancel each other and the term | is zero for the
𝑑𝑥 2 𝑑𝑥 1 𝑑𝑥 2

boundary condition. The solution from the boundary condition gives 𝑢1 = 0 and the
global matrix can finally be written as
1
4 −2 𝑢2
[ ] [ ] = [1]
−2 2 𝑢3
2
Now the solution of the matrix system is
3
𝑢2 = , 𝑢3 = 1
4

The approximate solution throughout the interval [0, 1]is finally obtained as

2 (1) (1) 1
𝑁1 (𝑥)𝑢1 + 𝑁2 (𝑥)𝑢2 0<𝑥≤
𝑢(𝑥) ≈ ∑ 𝑁𝑗 (𝑥) 𝑢𝑗 = { 2
(2) (2) 1
𝑗=1 𝑁1 (𝑥)𝑢1 + 𝑁2 (𝑥)𝑢2 <𝑥≤ 1
2
3 1
𝑥 0<𝑥≤
={ 2 2
𝑥+1 1
<𝑥≤ 1
2 2
Prepared by Dr. Md. Shahjada Tarafder Page 64
𝜕2 𝑢 𝜕2 𝑢
Example 3.7 Solve the poisons equation by the finite element method ( 2
+ )=
𝜕𝑥 𝜕𝑦 2
−𝑓(𝑥, 𝑦) with u = 0 on the boundary condition of the square (0 < 𝑥 ≤ 1, 0 < 𝑦 ≤ 1)

Solution:
∇2 𝑢 = −𝑓(𝑥, 𝑦)
Multiplying both sides of the equation by the shape function−𝑁(𝑥, 𝑦) and integrating, we
obtain

− ∬ 𝑁(𝑥, 𝑦) ∇2 𝑢 𝑑𝑥 𝑑𝑦 = ∬ 𝑁(𝑥, 𝑦) 𝑓 (𝑥, 𝑦)𝑑𝑥 𝑑𝑦

From the vector identity ∇ ∙ (𝑁 ∇𝑢) = ∇N ∙ ∇𝑢 + 𝑁 ∇2 𝑢we get

∬ ∇N. ∇u 𝑑𝑥 𝑑𝑦 𝑑𝑧 − ∬ ∇ ∙ (𝑁 ∇𝑢) 𝑑𝑥 𝑑𝑦 = ∬ 𝑁 𝑓(𝑥, 𝑦) 𝑑𝑥 𝑑𝑦

Using Gauss-divergence theorem in the second integral we obtain

𝜕𝑢 𝜕𝑁 𝜕𝑢 𝜕𝑁
∬( + ) 𝑑𝑥 𝑑𝑦 − ∫ (𝑁 ∇u) ∙ 𝑛 𝑑𝑥 𝑑𝑦 = ∬ 𝑁 𝑓 (𝑥, 𝑦)𝑑𝑠
𝜕𝑥 𝜕𝑥 𝜕𝑦 𝜕𝑦
Ω 𝐶 Ω

𝜕𝑢 𝜕𝑁 𝜕𝑢 𝜕𝑁
∬( + ) 𝑑𝑥 𝑑𝑦 = ∫ 𝑞𝑛 𝑁 𝑑𝑠 + ∬ 𝑁𝑓 𝑑𝑥 𝑑𝑦
𝜕𝑥 𝜕𝑥 𝜕𝑦 𝜕𝑦
Ω 𝐶 Ω

Prepared by Dr. Md. Shahjada Tarafder Page 65


𝜕𝑢 𝜕𝑢
Where 𝑞𝑛 = ∇u ∙ 𝑛 = 𝑛𝑥 + 𝑛𝑦 and n is the unit normal vector on the boundary C
𝜕𝑥 𝜕𝑦

and dS is the arc length of an infinitesimal element along the boundary. Let the solution 𝑢
be approximated as
𝑛
(𝑖)
𝑢 ≈ ∑ 𝑁𝑗 𝑢𝑗
𝑗=1

in which 𝑁𝑗 are the the shape functions and j represents the number of nodes over the
element. Eq. () for i-th element can be expressed as
𝑛
𝜕𝑁𝑖 𝜕𝑁𝑗 𝜕𝑁𝑖 𝜕𝑁𝑗 (𝑖)
∑∬( + ) 𝑢 𝑑𝑥 𝑑𝑦 = ∬ 𝑓 𝑁𝑖 𝑑𝑥 𝑑𝑦 + ∫ 𝑞𝑛 𝑁𝑖 𝑑𝑆
𝜕𝑥 𝜕𝑥 𝜕𝑦 𝜕𝑦 𝑗
𝑗=1 Ω Ω 𝐶

Eq. () can be written as


𝑛
(𝑖) (𝑖) (𝑖)
∑ 𝐾𝑖𝑗 𝑢𝑗 = 𝐹𝑖
𝑗=1
(𝑖) (𝑖)
Where𝐾𝑖𝑗 and 𝐹𝑖 are called the stiffness matrix and force vector respectively and are
given by

(𝑖) 𝜕𝑁𝑖 𝜕𝑁𝑗 𝜕𝑁𝑖 𝜕𝑁𝑗


𝐾𝑖𝑗 = ∬ ( + ) 𝑑𝑥 𝑑𝑦
𝜕𝑥 𝜕𝑥 𝜕𝑦 𝜕𝑦
Ω

(𝑖)
𝐹𝑖 = ∬ 𝑓 𝑁𝑖 𝑑𝑥 𝑑𝑦 − ∫ 𝑞𝑛 𝑁𝑖 𝑑𝑠
Ω 𝐶

We apply Eq. () at each of three nodes of element 1 and write these equations into a
matrix form as
(1) (1) (1) (1) (1)
𝑘11 𝑘12 𝑘13 𝑢1 𝐹1
(1) (1) (1) (1) (1)
[𝑘21 𝑘22 𝑘23 ] [𝑢2 ] = [𝐹2 ]
(1) (1) (1) (1) (1)
𝑘31 𝑘32 𝑘33 𝑢3 𝐹3
Where
(1) 𝜕𝑁1 𝜕𝑁1 𝜕𝑁1 𝜕𝑁1 (1) (1) 𝜕𝑁1 𝜕𝑁2 𝜕𝑁1 𝜕𝑁2
𝑘11 = ∬Ω ( + ) 𝑑𝑥 𝑑𝑦; 𝑘12 = 𝑘21 = ∬Ω ( + ) 𝑑𝑥 𝑑𝑦
𝜕𝑥 𝜕𝑥 𝜕𝑦 𝜕𝑦 𝜕𝑥 𝜕𝑥 𝜕𝑦 𝜕𝑦

Prepared by Dr. Md. Shahjada Tarafder Page 66


(1) (1) 𝜕𝑁1 𝜕𝑁3 𝜕𝑁1 𝜕𝑁3 (1) 𝜕𝑁2 2 𝜕𝑁2 2
𝑘13 = 𝑘31 = ∬Ω ( + ) 𝑑𝑥 𝑑𝑦; 𝑘22 = ∬Ω [( ) + ( ) ] 𝑑𝑥 𝑑𝑦
𝜕𝑥 𝜕𝑥 𝜕𝑦 𝜕𝑦 𝜕𝑥 𝜕𝑦

(1) (1) 𝜕𝑁2 𝜕𝑁3 𝜕𝑁2 𝜕𝑁3 (1) 𝜕𝑁3 2 𝜕𝑁3 2


𝑘23 = 𝑘32 = ∬Ω ( + ) 𝑑𝑥 𝑑𝑦; 𝑘33 = ∬Ω ( ) + ( ) 𝑑𝑥 𝑑𝑦
𝜕𝑥 𝜕𝑥 𝜕𝑦 𝜕𝑦 𝜕𝑥 𝜕𝑦

(𝒊) (𝒊)
Calculation of 𝑲𝒊𝒋 and 𝑭𝒊 for Element 1:
Area of the triangular element 1 is
1 𝑥1 𝑦1 1 0 0
1 1 1
∆ = |1 𝑥2 𝑦2 | = |1 1/2 0 |=
2 2 8
1 𝑥3 𝑦3 1 1/2 1/2
And the corresponding shape functions for this element are
1 𝑥 𝑦 1 𝑥 𝑦
1
𝑁1 = |1 𝑥2 𝑦2 | = 4 |1 1/2 0 | = (1 − 2𝑥)
2∆ 1 𝑥3 𝑦3 1 1/2 1/2
1 𝑥 𝑦 1 𝑥 𝑦
1
𝑁2 = |1 𝑥3 𝑦3 | = 4 |1 1/2 1/2| = 2(𝑥 − 𝑦)
2∆ 1 𝑥1 𝑦1 1 0 0
1 𝑥 𝑦 1 𝑥 𝑦
1
𝑁3 = |1 𝑥1 𝑦1 | = 4 |1 0 0| = 2𝑦
2∆ 1 𝑥2 𝑦2 1 1/2 0
The components of the stiffness for element 1 can be obtained as
1 1
𝐾11 = ∬Ω 4 𝑑𝑥 𝑑𝑦 = 𝐾12 = 𝐾21 = − ∬Ω 4 𝑑𝑥 𝑑𝑦 = − 𝐾13 = 𝐾31 = 0
2 2
1 1
𝐾22 = 1 𝐾23 = 𝐾32 = − 𝐾33 =
2 2

The force vectors at node 1 for element 1 is

𝐹1 = 2 ∬𝑆 𝑁1 𝑑𝑥 𝑑𝑦 + ∬𝑆 𝑁1 𝑞𝑛 𝑑𝑆 = 2 ∬𝑆 𝐿11 𝐿02 𝐿03 𝑑𝑥 𝑑𝑦 + ∬𝑆 𝐿1 𝑞𝑛 𝑑𝑆


1! 0! 0!
= 2 (1+0+0+2)! 2𝐴 + ∬𝑆 𝐿1 𝑞𝑛 𝑑𝑆
1! 0! 0! (1)
= 2 (1+0+0+2)! 2𝐴 + 𝑙1
1 (1)
= + 𝑙1
12

Similarly, the force vectors at node 2 and 3are

Prepared by Dr. Md. Shahjada Tarafder Page 67


1 (1)
𝐹2 = 2 ∬Ω 𝑁2 𝑑𝑥 𝑑𝑦 + ∫ 𝑁2 𝑞𝑛 𝑑𝑠 = + 𝑙2
12
1 (1)
𝐹3 = 2 ∬Ω 𝑁3 𝑑𝑥 𝑑𝑦 + ∫ 𝑁3 𝑞𝑛 𝑑𝑠 = + 𝑙3
12
(1) (1) (1)
Where 𝑙1 = ∬𝑆 𝑁1 𝑞𝑛 𝑑𝑆; 𝑙2 = ∬𝑆 𝑁2 𝑞𝑛 𝑑𝑆 and 𝑙3 = ∬𝑆 𝑁3 𝑞𝑛 𝑑𝑆. Now
the matrix for element 1 can finally be written as
1 1 1 (1)
− 0 (1) + 𝑙1
2 2 𝑢1 12
1 1 1
1 − [𝑢2(1) ] = (1)
+ 𝑙2
2 2 (1)
12
1 1 𝑢3 1 (1)
[0 −
2 2] [12 + 𝑙3 ]
Let the global solutions be 𝑢1 , 𝑢2 , 𝑢3 , 𝑢4 , 𝑢5 𝑎𝑛𝑑 𝑢6 at the respective six vertices. Now
the matrix with respect to global co-ordinate system can be written as
Matrix for Element 1:
1 1 
2 − 0 0 0 0
2 1  l1(1) 
   u1 
1   1   (1) 
0 0  u2 
1
1 − 0    l2 
2 2 
   u3  1 1  l3 
(1)

0 −
1 1
0 = +
0 0  u  12 0   0 
 2 2  4    
0 0 0 0 
0 0  u5  0  0 
       
0 0 0 0 0 0  u6  0   0 
0 0 0 
 0 0 0

Matrix for Element 2:


0 0 0 0 0 0
 
0 1
0 −
1
0 0   u1  0  0 
 2 2  u  1   (2) 
0 0 0 0 0 0  2   l1 
  u3  1 0   0 
0 − 1

1  u  = 12 1  + l (2) 
 2
0 1
2
0  4   2 
 
 u5  1  l3(2) 
0 0 0
1 1 
0  u      
 2 2   6  0   0 
0 0 0 
 0 0 0

Prepared by Dr. Md. Shahjada Tarafder Page 68


Matrix for Element 04
0 0 0 0 0 0
0 0   u 
 0 0 0 0
1 0  0 
 1 1  u  1   
0 0 0 − 0 2   0
 2 2  u3  1 0  l1 
(4)

0 0 0 0 0 0  =  + 
 u4  12 1   0 
1 1   1  l2(4) 
0 0 − 0 1 −  u5
 2 2      (4 ) 
  u6  0  l3 
1 1
0 0 0 0 − 
 2 2

Matrix for element 3:


0 0 0 0 0 0
 
0 1

1
0 0 0   u1  1   0 
 2 2 
 u  1   (3) 
 1 1   2   l3 
0 − 1 0 − 0  u3  1 1  l2(3) 
 2 2  u  = 12 0  +  0 
0 0 0 1 0 0  4     
 
 u5  0  l1(3) 
0 0 −
1
0
1
0  u     
 2 2   6  0   0 
0 0 0 
 0 0 0

Assembling the element matrices, we obtain the global matrix as


 1 −1 0 0 0 0   u1  1  l1(1) 
 −1       (1) (2) (3) 
 4 −2 −1 0 0  u2  3  l2 + l1 + l3 
 0 −2 4 0 − 2 0  u3  1 3  l3(1) + l2(3) + l1(4) 
   =  + 
 0 −1 0 2 −1 0  u4  12 1  l2(2) 
 0 0 −2 −1 
4 −1 u5   3   l + l1 + l2
(2) (3) (4 ) 

     3 
 0 0 0 0 − 1 1  u6  1  l3(4) 

From the boundary conditions we have 𝑢1 = 𝑢2 = 𝑢4 = 𝑢5 = 𝑢6 = 0. Now Eq. () gives

Prepared by Dr. Md. Shahjada Tarafder Page 69


1 (1) (2) (3)
𝑢3 = + 𝑙2 + 𝑙1 + 𝑙3
4
1 (1) (3) (4)
2𝑢3 = + 𝑙3 + 𝑙2 + 𝑙1
4
1 (2) (3) (4)
− 𝑢3 = + 𝑙3 + 𝑙1 + 𝑙2
4
From Eq. () we obtain
1 1 (1) (3) (4)
𝑢3 = + [𝑙3 + 𝑙2 + 𝑙1 ]
8 2
(1) (1)
But 𝑙3 = ∫𝐶123 𝑞𝑛 2𝑦 𝑑𝑠
0.5 0.5 0
(1) (1) (1)
= ∫ [𝑞𝑛 2𝑦]𝑦=0 𝑑𝑥 + ∫ [𝑞𝑛 2𝑦]𝑥=0.5 𝑑𝑥 + ∫[𝑞𝑛 2𝑦]𝑦=𝑥 𝑑𝑥 = 0
0 0 0.5
(3) (4)
Similarly, 𝑙2 = 𝑙1 = 0
1
So, the final solution is 𝑢3 =
8

-----------------------------------------------------------------------------------------------------------
Alternative derivation:
The stiffness matrix can also be derived as:

(𝑖) 𝜕𝑁𝑖 𝜕𝑁𝑗 𝜕𝑁𝑖 𝜕𝑁𝑗


𝐾𝑖𝑗 = ∬ ( + ) 𝑑𝑥 𝑑𝑦
𝜕𝑥 𝜕𝑥 𝜕𝑦 𝜕𝑦
Ω

The shape functions for a linear triangular element at node 1, 2 and 3 are as follows:
1
𝑁1 (𝑥, 𝑦) = [𝑎 + 𝑏1 𝑥 + 𝑐1 𝑦]
2Δ 1
1
𝑁2 (𝑥, 𝑦) = [𝑎 + 𝑏2 𝑥 + 𝑐2 𝑦]
2Δ 2
1
𝑁3 (𝑥, 𝑦) = [𝑎 + 𝑏3 𝑥 + 𝑐3 𝑦]
2Δ 3
(𝑖)
𝐾𝑖𝑗 is symmetric and all terms under the integral are constant. Differentiating the shape
functions with respect to x and y we have from Eq. () as

Prepared by Dr. Md. Shahjada Tarafder Page 70


(𝑖) 𝐾
𝐾𝑖𝑗 = ∬(𝑏𝑖 𝑏𝑗 + 𝑐𝑖 𝑐𝑗 ) 𝑑𝐴
4𝐴2
Ω

𝑏1 𝑏1 + 𝑐1 𝑐1 𝑏1 𝑏2 + 𝑐1 𝑐2 𝑏1 𝑏3 + 𝑐1 𝑐3
𝐾
= 2 [𝑏2 𝑏1 + 𝑐2 𝑐1 𝑏2 𝑏2 + 𝑐2 𝑐2 𝑏2 𝑏3 + 𝑐2 𝑐3 ]
4𝐴
𝑏3 𝑏1 + 𝑐3 𝑐1 𝑏3 𝑏2 + 𝑐3 𝑐2 𝑏3 𝑏3 + 𝑐3 𝑐3

And the co-efficient values of the shape functions of a linear triangular element are

i 𝑎𝑖 𝑏𝑖 𝑐𝑖
1 𝑥2 𝑦3 − 𝑥3 𝑦2 𝑦2 −𝑦3 𝑥3 − 𝑥2
2 𝑥3 𝑦1 − 𝑥1 𝑦3 𝑦3 − 𝑦1 𝑥1 − 𝑥3
3 𝑥2 𝑦1 − 𝑥1 𝑦2 𝑦1 −𝑦2 𝑥2 − 𝑥1

Prepared by Dr. Md. Shahjada Tarafder Page 71


Chapter 6
Finite volume method

5.1 Introduction
The FV method uses the integral form of the conservation equations as its starting point.
The solution domain is subdivided into a finite number of control volumes and the
consecration equations are applied to each CV. At the centroid of each CV lies a
computational node at which the variable values are to be calculated. An interpolation is
used to express variable values the CV surface in terms of the nodal values. Surface and
volume integrals are approximated using suitable quadrature formulae.

Prepared by Dr. Md. Shahjada Tarafder Page 72


Two-dimensional problem

1. Consider the computation of the heat transfer in a trapezoidal plate with a constant
heat source q all over the plate. At three sides the temperature T is prescribed and at
the fourth side the heat flux is given equal to zero. The problem of heat conduction of
the plate is given by
 2T  2T
−k 2 − k 2 =  q
x y
with the boundary conditions prescribed as shown in Fig. 1

Fig. 1 Configuration of trapezoidal plate Fig. 2 CV definition for


heat conduction trapezoidal plate

For the discretization employ a grid with only two control volumes (CVs) as illustrated in
Fig. 2. The required coordinates for the distinguished points for both Cvs are indicated in
Table 1 below:
Table 1. Coordinates of distinguished points for discretized trapezoidal plate

Prepared by Dr. Md. Shahjada Tarafder Page 73


Solution:

Fig. 1 Notation of neighboring control


volumes
Fig. 2 Quadrilateral control volume

Fig. 3 Discretized trapezoidal plate

Prepared by Dr. Md. Shahjada Tarafder Page 74


(a) Surface area  Sn = (5 − 2)2 + (4 − 4)2 = 3
 Se = (6 − 5)2 + (0 − 4)2 = 14
 Ss = (0 − 6)2 + (0 − 0)2 = 6
 Sw = (2 − 0)2 + (4 − 0)2 = 2 5
(b) Unit normal vector
→ →
ab = (2 − 0)i + (4 − 0) j = 2i + 4 j bc = (5 − 2)i + (4 − 4) j = 3i + 0 j
→ i j → i j
wn = − = −4i + 2 j nn = − = 0i + 3 j
2 4 3 0
4 2 2 1 0 3
nˆw = − i+ j=− i+ j nˆn = i+ j = 0i + j
20 20 5 5 9 9

→ →
cd = (6 − 5)i + (0 − 4) j = i − 4 j da = (0 − 6)i + (0 − 0) j = −6i + 0 j
→ i j → i j
en = − = 4i + j sn = − = 0i + 6 j
1 −4 −6 0
4 1 nˆs = 0i + j
nˆe = i+ j
17 17
(c) Discretization of governing differential equation
 2T  2T
−k − k = q
x 2 y 2
  2T  2T 
−  k 2 + k 2  dV =   q dV
 x y 
Denoting the unit normal vector nˆe = ne i + ne j and then applying Gauss divergence
x y

theorem in the left part of above equation we get


 T T 
−k   ne + ne  dS =   q dV
 x x
y 
y

 T T 
−k    ne + ne  dS =   q dV
C S
 x yx

y

Applying the midpoint rule we get


Prepared by Dr. Md. Shahjada Tarafder Page 75
Fe + Fw + Fn + Fs =   q  V

East face:

 4 T 1 T   4 TE − TP 1 Tne − Tse 
Fe = −k   +  dSe = −k 

+
   Se
S 
e 17 x 17 y   17 x 17 y 
= De (TE − TP ) + N e (Tne − Tse )
17
=− (TE − TP ) − 0.5 ( 20 − 0 )
9
17
= − (TE − TP ) − 10
9
West face:

 2 T 1 T 
Fw = −k   − +  dSw
S  w5 x 5 y 
5
For the west side 𝑇 = 𝑦3
16

The equation of the line passing through the points (0, 0) and (2, 4) on the west boundary
is
4−0
y= x = 2x
2−0
5 3 5 40 3
T= y = (2 x)3 = x
16 16 16
T 120 2
= x
x 16
T 15
= y2
x 16
2 4
 2 120 1 15 2 
Fw = −2   − + y dx dy
0 0 5 16 
2
5 x
= 60

South face:

Prepared by Dr. Md. Shahjada Tarafder Page 76


 T T   TP − TS 
Fs = −k   0  − 1  s
dS = k   ( xse − xsw )
S  s x y   yP − yS 
T −0
= 2 P  (6 − 0)
 2 − 0 
= 6TP

North face:

 T   T − TP 
Fn = −k   dS n = −k  N  ( xne − xnw )
S  y  −
s  N
y y P 

 20 − TP 
= −2   (5 − 2)
 4−2 
= 3TP − 60

Similarly, for CV2:


17
Fe = 0, Fw = (TP − TW ), Fs = 6TP , Fn = 3TP − 60
9
Volume calculation
1
V = (5 − 2) + (6 − 0)  4 = 18
2
The cross product of the diagonal vector is
i j k
( )
→ →
ac  bd = xne − xsw yne − ysw 0
xse − xnw yse − xnw 0

1 → → 1 xne − xsw yne − ysw 1 4 −4


V = ac  bd = = = 18
2 2 xse − xnw yse − xnw 2 5 4

The discretized equation for CV1 results

Prepared by Dr. Md. Shahjada Tarafder Page 77


 Fc =   q  V
c

Fe + Fw + Fn + Fs =   q  V

17
− (T2 − T1 ) − 10 + 6T1 + 3T1 − 60 = 8  18
9
98 17
T1 − T2 = 154
9 9

For CV 2
Fe + Fw + Fn + Fs =   q  V
17
0+ (T2 − T1 ) − 10 + 6T2 + 3T2 − 60 = 8  18
9
98 17
T2 − T1 = 194
9 9
After solving we get
T1 = 17.77
T2 = 20.90

(d) General transformation of equations from physical plane to computational plane


Since along the normal direction in general there are not nodal points, the normal
derivative has to be expressed by derivatives along other suitable directions. For this we
use the coordinates  and  defined according to Fig. 3.

The direction  is determined by the connecting line between points P and E, and the

direction  is determined by the direction of the CV face. Note that  and  , because of a

distortion of the grid, can deviate from the directions  and  which are defined by the connecting lines
of P with the CV face centers e and n.

Prepared by Dr. Md. Shahjada Tarafder Page 78


Fig. 3 Approximation of diffusive flues for non-Cartesian control volumes
A coordinate transformation from (x, y) to ( ,  ) results for the normal derivative in the
following representation:

 T T  k  y x  T  x y  T 
k  nex + ne  =  ne − ne  + ne − ne   
 x y  J   y
      x y y x
 
With the Jacobi determinant
x y y x
J= −
   
The metric quantities can approximated according to
x xE − xP x xne − xse
= and =
  E −  P   Se
This results for the Jacobi determinant in the approximation as
xE − xP y y xne − xse xE − xP yne − yse yE − yP xne − xse
J= − = −
 E −  P    Se  E −  P  Se  E −  P  Se

=
(x E
− xP )( yne − yse ) − ( yE − yP )( xne − xse )
( E
−  P )  Se

Prepared by Dr. Md. Shahjada Tarafder Page 79


1
=
(  E −  P )  Se
J ( xE − xP )( yne − yse ) − ( yE − yP )( xne − xse )

The derivatives of T with respect to  and  can be approximated as


T TE − TP T Tne − Tse
= and =
  E −  P   Se

dSe = ( xne − xse ) i + ( yne − yse ) j


^

^
The vector normal to dS e is
 i j
dSn = − = − ( yne − yse ) i + ( xne − xse ) j
xne − xse yne − yse
^
The unit vectors tangential and normal to dS e are

tˆe =
( xne − xse ) ( yne − yse )
i+ j
 Se  Se

nˆe = −
(y − yse ) ( xne − xse )
ne
i+ j = ne i + ne j
 Se  Se x y

Where
(y − yse ) ( x − xse ) and  S =
ne = − ; ne = ne (x − xse ) + ( yne − yse )
ne 2 2
x
 Se  Se
y e ne

Now
 T T 
k  ne +
y 
ne
 x
x y

k  y x  T  x y  T 
=  ne − ne  + ne − 
   
ne
J       
x y y x

Prepared by Dr. Md. Shahjada Tarafder Page 80


=
(
k  E −  P  Se )  yne − yse x − xse
ne − ne
 TE − TP
 n 
( xE − xP )( yne − yse ) − ( yE − yP )( xne − xse )   Se  Se e x y
 E − P

+
(
k  E −  P  Se )  xE − xP y − yP
ne − E
 Tne − Tse
 n 
( xE − xP )( yne − yse ) − ( yE − yP )( xne − xse )   E −  P E − P e y x
  Se
Putting the value of ne and ne we obtained x y

 T T 
k  ne + ne  = De (TE − TP ) + Ne (Tne − Tse )
 x y x

y

Where

(x − x ) + ( y − y )
2 2

De = −k ne se ne se

( x − x )( y − y ) − ( y − y )( x − x )
ne se E P ne se E P

Ne =k
( y − y )( x − x ) + ( x − x )( y − y )
ne se E P ne se E P

( y − y )( x − x ) − ( x − x )( y − y )
ne se E P ne se E P

(x − x ) + ( y − y )
2 2

De = −k ne se ne se

(x ne
− xse )( y − y ) − ( y − y )( x
E P ne se E
− xP )
(5 − 6) + ( 4 − 0)
2 2

= −2.0
( 5 − 6 )( 2 − 2 ) − ( 4 − 0 ) 
31 13 
− 
 4 4
17

9

Ne = k
( y − y )( x − x ) + ( x − x )( x − x )
ne se E P ne se E P

( y − y )( x − x ) − ( x − x )( y − y )
ne se E P ne se E P

= 2.0
( 4 − 0 )( 2 − 2 ) + ( 5 − 6 )( 31 / 4 − 13 / 4 )
( 4 − 0 )( 31 / 4 − 13 / 4 ) − ( 5 − 6 )( 2 − 2 )
1
=−
2

Prepared by Dr. Md. Shahjada Tarafder Page 81

You might also like