Transcript
Page 1: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

University of Nigeria Virtual Library

Serial No ISBN:978-35097-4-x

Author 1 OBIKWELU, D.O.N.

Author 2 Author 3

Title

Introduction to Computational Methods in Engineering

Keywords

Description

Introduction to Computational Methods in Engineering

Category Engineering

Publisher Policy Publishing Co. Publication Date 2003

Signature

Page 2: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation
Page 3: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation
Page 4: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

POLICY I c D. 0. h ISBN 978 First Pub1

All right5 --ww-- . --. .- p-. . rwl..w-..v.. ...- be J

reproduced, stored i ral system or transmitted in any form or by i s, electronic, mechanical, photocopy in^. recorainp or otherwise without the orior 7

permissim

Policy Prir 1 5B Adeol Sapele, De Tel: 054 - E-mail: po

Page 5: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Dedicated to my wife Victoria, my children and to the Almighty God, the source of all knowledge.

iii

Page 6: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Preface -..

Computational methods in Engineering fonn the ciiinax of the

Engineer's dexterity in looking at the Engineer's problem through

inathematical eyes.

Formulation of differential equations to simulate a physical problem may be tortuous and sometimes impossible. Skills in computational techniques and knowledge of the basic laws of science simplifj a rather intractable problem. Use of finite difference method in solving transient problems in heat transfer is a good example. Differential equations can be successfully set up but the possibility of their exact analytical solution may not exist and the computational techniques become handy.

Introduction to computational methods in Engineering forms the core of the one semester lecture the author gave to the final year students of Mechanical Engineering in the University of Port Harcourt. The course really is two-semester course when the use . of the computer (which is part of the course) is religiously and inevitably integrated.

The text on "Introduction to Computational Methods in Engineering" starts with basic appreciation of types of equations that apply to Engineering and Science problems.

Page 7: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

The text covers, from the onset simulation terms elliptic, parabolic and hyperbolic differential equations, Boundary value

, expressions, Discretization and Grid systems, Basic ~lements of computing, Flow Charting, solving Quadratic equations, using FORmular TRANslation (FORTRAN), computing for solution of algebraic expressions (Simultaneous linear equations - the end point form of all computation, modeling and simulation and setting up algorithm for solving a polynomial expressions, Finite b:fference method for both steady and non-steady state situation, Finite Element Method and Computer flow chart application to finite elemen solution. \

t Introduction to computational methods in Engineering endears Engineering and Science students to the essential tools in the simulation, modeling and computation of simple to complex problems in their chosen fields.

Professor Chinyere Ikoku's special interest in the text and his careful reading of the manuscript are highly appreciated. 'The author immensely recognizes the useful contribution' of the final year and master degree students of Mechanical Engineering of the University of Port Harcourt.

The contribution of Dr. Nick. Oforka, of the University of Port

Harcourt' is gratefully acknowledged. The author is greatly

indebted to my wife, Victoria and Juliet Ogunka for their

encouraging efforts in the various stages of bringing to reality this

Page 8: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Introduction to computational methods in Engineering is recommended not only to the final year and graduate students of Engineering but also to practicing and highly motivated engineers who are determined to advance the frontier of knowledge in the -

Engineering profession. D.O.N OBIKWELU .

Page 9: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

CONTENTS

PREFACE

CHAPTER ONE:

TYPES OF EQUATIONS FOR COMPUTATIONAL SOLUTIONS I .O ' Introduction 1. i Ordinary Differential Equations (ODE) 1.2 Partial Differential Equation (PDE) 1.2.1 Classification of PDE 1.3 Boundary Value Expressions 1.3.0 Introduction 1.3.1 Classification of Boundary conditions 1.4 Partial Differential Equation in Dimensionless form 1.5 Simultaneous Linear Equations. 1.6 Discretization, Grid System 1.6.1 Grid system

Exercises

CHAPTER TWO:

TYPICAL COMPUTATION PROCEDURE 2.0 Introduction 2.1 Setting up a typical computation procedure 2.1.1 Basic Elements of Fortran Operation (Flow Charting) 2.1.2 Flow chart of the procedure for computing the roots

of the akebraic equation ax2 + bx + c = 0. 2.1.3 Polyno~nials 2. '1 *4 Numerical solution of algebraic expressions

vii

Page 10: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

2.1.4.1 Convergency criterion 2.1.4.2 Newton - Raphson Method ( Newton's method) 2.1.4.3 The method of Bisection (Interval Halving) 2.1.5 Algorithm for finding the roots of a polynomial expression

Exersises

CHAPTER THREE: METHODS OF SOLVING DIFFERENTIAL EQUATIONS RELATING TO TRANSPORT PHENOMENA

Introduction Finite Difference method: Discretization Taylor's series Expansion f (x, + Ax) Graphical illustration of forward, backward and central difference approximation Finite Difference Approximation of second derivative Dicretization in time Explicit and implicit formulation Crank - Nicholson method Examples Finite Difference methods in steady state conditions Introduction Problem 1.0 Problem 2.0 Probkm 3.0 Non Regular Boundaries Problem 4.0 Solution of Finite Difference Equations Relaxation Analysis Problem 4.0

viii

Page 11: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Tntrotluction Funtli~~iiental concept of'FERI 1)iscrctc Model Elcincnts i ~ . 2- or 3- tli~ncnsional domain Scope of FEM I)iscrctiz;ltion of ;I region I)ivisio~l of the clo~ni~in iuto E l c n ~ c ~ ~ t s Lal)clling the Noclcs 1,illc;lr interpolation ~)ol!~non~i;~ls 011c tlimcnsioniil si111l)les clc~nents Threc tli~\icnsionid si~nplcx c t cmc~~ t s TIII-cc dinicnsioni~l simplex cle~nents Interpolatioo for vector qua~~t i t ics l ,oci~l coorclina tcs AI-ci~ coordinates Voltrr~~c coordin;~tors I ' I -o~~I - t i cs oSlnterpol :~t i~~g l'oIyno111i:11 ('ouvcrgcucc

Page 12: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

CHAPTER FIVE INTEIII'OLATINC; I'OI,I'NONIIALS FOR A 1)ISCIIETIZEI) REGION IN HEAT CONDUC.TION

5.1 Introduction 5.2 Vector Qoi~ntitics 5.3 Finite Element Forr~~ol;~tioo to houedary

\ d u e problen~s 5.4 I)eri\latioa of the finite elelllent equation using

the minimization of i ~ n i~~tegra l qua~~t i ty . 5.5 Altcl-nil tivc to R4inin1iz;l ti011 5.6 Finite E l e ~ n c ~ ~ t Analysis in Ehsticity prol)lc~ns

1Sscrciscs

Page 13: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

CHAPTER SIX: BOUNDARY VALUE PROBLEMS

6.1 Introduction 6.2 Methods for ordinary Differential Equations 6.3 Methods for partial differential equations

Exercise

CHAPTER SEVEN: PRINCIPLE OF CHARACTERISTICS

7.1 Introduction 7.2 Linear First Order Equation 7.3 Linear Second Order Equation 7.4 Characteristics of a particular quasi - lineal

problem Exercise

ANSWERS TO SELECTED QUESTIONS APPENDIX - Cramer's Rule - Gausian Elimination - General Computer Flow Diagram for A Finitc

Element Progamme - Program for Heat

Transfer Problems

Page 14: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

CHAPTER ONE A: t

- < TYPES OF EQUATIONS FOR COMPUTATIONAL SOLUTIONS

' I

1.0 Introduction

Engineering and scientific problems appear in many forms of equations. These equations are formulated to simulate the engineering situation and when these equations are solved, the engineering and scientific disciplines are pushed over frontiers of knowledge. Sometimes these equations are difficult to solve and simplitjring assumption are made to facilitate their solution.

Latter in this book, polynomial expression would .be mentioned as

form in which engineering and scientific problems may

appear. Other forms in which engineering and scientific problems

may appear are listed below:

i) Ordinary differential equation

ii) Partial differential equation . . 6 . A .

iii) Boundary value expression . . ' iv) Simultaneous linear equation

Page 15: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

1.1 ORDINARY I)IFFERENTIAL.EQUATIONS (ODE):

This has been treated in reasonable detail in a text, "Differential Equations and Application" by the same author. In ODE, there is only one independent variable and one dependent variable. For example: dyldx = x + 5.

, y is dependent variable, x is independent variable. Also d4/dx2 + 3 dyhix + 2y = 0 is an ordinary differential equation of order 2 and degree 1 while (d'y/dx2)3 + 2 dyldx = 0 is of order 2 and degree 3.

Other examples are: (i) Q . -kA a, Q = quantity of heat flowing through a wall

dx (Calories per second),

A = surface area of the wall [surface], K = The conductivity of the material,

dT1dx .- temperature gradient.

v = dependent variable (ii). nMdv/dt = mg - kx, tn=independent variable

Where v is.the velocity in metrelsec g = acceleration due to gravity k =sjwing's constant

, m = mass attached to the spring

Page 16: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

& + 5 0 Q = E : Q = charge = dependent variable E = potential drop t = independent variable

P = dependent variable (iv) i& - 2p = 0 , z = independent variable

-, az2

(v) & = 0, T = dependent variable d x2 x = independent variable

(vi) J = -D & , C = dependent variable X = independent variable

I .

Ordinary differential equations can be linear or non-linear and this d e p d s on the nature of the dependent variables. Linear ordinary differential equation can be written in the fom:

Where Po , P1 etc are functions of x only or constants.

Linear ordinary differential equation thus:

WherePo= 1 and P1 =P2 =P3 = Pn-1= 0 andn= 1.

3

Page 17: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

reduces to @I& + P(x) y = Q(x) ............. (9)

Which is a simple linear ordinary differential equation. It is also non-homogenous equation (9) is therefore a non-homogenous linear ordinary differential equation usually written in the form dy .

............... aY + [P(x) Y - QWl = 0 (1 0) or [P(x),. - Q(x) ] ax + i3y = 0 converting it to separable variable equation to facilitate its solution.

If Q(x) = 0, equation (9) becomes a homogenous linear ordinary differential equation hence

1.2 PARTIAL DIFFERENTIAL EQUATION (PDE):

While ODE has one independent' varhble PDE has two or more independent variables. In PDE the dependent variable is changing with many other independent variables at the same time. PDE is very useful in *. science and engineering fields.

Examples: - & = - D & at ax2

Page 18: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

. s, D (poison equation)

(Laplace Equation)

a: 2 + H - - H~ & Magnetic Transoort equation

?Yh

(see Article 1.2.1)

Non-Linear PDE: 8 T = o c & + b T J + c ~ - (3t tk2 dx

5

Page 19: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Note: The student is expected to identi@ the independent-and dependent variables in the above examples. The meaning of the letter is not important at this stage.

1.2.1 Classification of PDE

For completeness we can use these two equaGons Viz . .,

where a,h,b,i',g and e may be constants or functions of x and y

Equation (12) can be compared with the conic section equivalent, viz

ax2 + 2hxy +by2 +2fx +2gy + e = 0 .............. (1 3)

The conic is Elliptic if ab - h2.> 0 Parabolic if ab - h2 = 0

2

Page 20: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

partial differential equations of practical importance may be written in the general form

a&! + b a 2 U + c&! = o ............. ( 1 4)

6- dx2 &?Y ay2

wnere a,b,C, and g are functions of x,y,u, & , & only and are ax ay

s of the second derivative.

4) is non-linear but usually referred to as quasi -

befficients, a,b,c, and g are constant's or functions of x the partial differential equation is LINEAR, otherwise INEAR.

cation of the equation of the form equation (14) is based on the value of b2-4ac. i.e

When b2 - 4ac is negative the equation is ELLIPTIC

b2 - 4ac is zero the equation is PARABOLIC

tac is positive the equation is HYPERBOLIC.

Page 21: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

This classification is important because the computational methods for solution of a differential equation depends upon the type of equation it is.

1.3. BOUNDARY VALUE EXPRESSIONS OR PROBLEM

1.3.0 INTRODUCTION

The solution to any differential equation is defined on the boundaries of the region of integration.

If the region of integration is open and the conditions are

specified at the start of the region only, the differential equation is

said to be defined by initial conditions, while if the condition~are

completely specified on the boundaries of the region of

integration, the equation is said to be defined. by the

BOUNDARY CONDITIONS.

1.3.1 Classification Of Boundary Conditions:

( 1 ) Dirichlet:

The value of the dependent variable is specified at

the boundary, that is specifying the values of y at

the boundary, y the dependent variable.

Page 22: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

nn: rmal derivative of the dependent variable d at the boundary, that is dyldx is given at mdary, y is the dependent variable. For :, specifying the flux at the boundary of ~nsport across an interface.

ry - Type: of the dependent variables is t (time, for :), and the value of both y and dyldt on a y at t = 0 are given (initial conditions), and ~ g o f the dependent variable and the normal ve of the dependent variable &specified at ldary (boundary conditions)

Mixed: A combination of the above boundary conditions may be used, E.g the Dirichlet boundary condition may be specified at one end, while the Neumann boundary condition is specified at another part of the boundary.

... I

lifferential equation with associated boundary conditions is saia to be well stated if the solution is unique and stable.

For a stable solution, small changes in the boundary condition produce small changes in the solution. Unique and stable solutions of both elliptical and parabolic differential equation may be obtained by using either Dirichlet or Neumann boundary conditions. For hyperbolic equation, the mixed type may be used.

9

Page 23: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

In considering differential equation of a physical problem of , interest. a control value or black box is chosen within the

medium. If boundary conditions are not considered, the solution is a general solution, for example:

The general solution of & = 6x5 + 2Dx + E;. . .(15) dx

I S ~ = X ~ + D X ~ + E X + C .

D,E,C are arbitrary constants and can only be evaluated if boundary conditions are stated.

If boundary conditions are stated, C,D and E can be evaluated and a unique solution of the differential equation results.

In physical application, the initial and boundary condition are determined by the constraints of the physical problem. For a typical problem, the function or a derivative of the function or a relationship between function and derivative is defined at the boundary.

The region of integration is first divided by means of a mesh. The

function will be evaluated at the nodes of the mesh and the

intervals of the mesh represent increments of the independent

variables. When ;he mesh over the region of integration is fine,

the increments are small and therefore one truncation error for a

given finite difference approximate is small. When the mesh is

coarse the probability of significant error is greater.

Page 24: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

l l l l l

arr an at -..i

liar or triangular meshes could be used on the area of In with the exterior modes lying on the boundaries of the

-eglull. As this is usually possible because most times area of -tgration are irregular and the mode of the mesh cannot be

anged to coincide with the boundary and it is necessary to use interpolation formula (usually linear) to relate the fixed value the boundary to the value of the function at the node that lies

"&ide the boundary.

ati&f a function is defined.at the boundary, the ction at the boundary, the value node and the mesh increment

of the function at are related to the

ingle finite difference formula. 1 V' + 1 V? ...) y ,.... (16) -

, , V = backward differences, h = mesh I I X o increment (see Fig 6 )

LL DIFFERENTIAL EQUATION IN SIONLESS FORM:

to write differential equation into dimensionless :mpting the solution of physical problem.

the transient or differential equation thus:-

Page 25: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

where K I is a diffusion coefiicient K2 is a capacity coefficient c is the concentration or temperature t is time. < .

If the medium is a flat slab of thickness L. Initial condition3 describe the distribution of concentration or

temperature in the slab at a time taken at the start of the experiment. The condition at the face, x = 0 and x = L are specified as function of time and known as boundary conditions.

For times later, like infinity, boundary conditions are specified and initial conditionjdefine C or T at the start.

Equation (17) is a parabolic equation and can be expressed in dimensionless form by introducing dimensionless variables U, Z and 0 where

co is a convenient reference temperature or composition. The dimension form of equation ( 1 7) thus becomes

Page 26: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Note: All d S aKc 2 partials, d in the above equatioim.

and the boundai

the dimensionle

The dimension1

the units of the .

Concentration : Concentration

K * L ~ / ~ , is taken

Several methoc equationqbut wi,

To solve the r (19), the dimen

difference appr~

equations so f;

methods of rc

approximation

of solution to bc

ry and initial conditions are expressed in terms of

ss variables u, z and 8.

ess variables are derived from the knowledgeof

variables in equation (17) hence

; length , give dimensionless qualities. length

I as a characteristic time.

As are available for the solution of parabolic th some there may be pronounced instability.

jarabolic equation first, the differential equation 1

~sionless equivalent of (17) is replaced with finite

oximation to the derivatives and the simultaneous

ormed are solved by appropriate methods. The

splacing the differentials by finite difference

lead either to EXPLICIT or to IMPLICIT method

2 discussed later.

Page 27: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

1.5 SIMULTANEOUS LINEAR EQUATIONS:

Systems of linear equations occur very frequently in the solution of physical problems in Engineering and Science d~sci~l ines . Difficulties arise in various methods of solution because of the propagation of errors. One has to select well-tested and tried methods of other particular methods of solution to ensure greater precision of computation.

Operation upon system of linear equations are described by matrix rotation.

For example: 3x1 + 2x2 - X; = 4 2x1.- X2 f x ; = 3 ............................. (20)

X I + x2 - 2x3 = 3

The explicit matrix form of equation (20)

conveniently by matrix rotation

Page 28: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

; composed of the coefficients (elements of the matrix, 3 rows and 3 columns.

natrix and ni3trix b, 3 x 1 are called column

TIZATION, GRID SYSYTEMS

In the finite eleme or body is the dete region used to rr balance precision precise results in enough and large final values of the decrease the elern may vary quite ra areas, corners or desired result is re

process of finding solution to a given problem vithin the domain of interest. '~iscretization in mposing a grid or mesh system on the domain @est and obtaining solution at discrete points I of interest. Discretization in time is done by ,s at which the solution is sought. This is done the time as one of the independent variables. steps may not be of the same size and the steps and grid sizes the more accurate the obtained.

:nt method, discretization of a domain or region rrnination of the number, size and shape of sub- lode1 the real body. As Engineers, we must and cost, while we must achieve usable and

our modelling by making the sub-region small in number, we must have an idea of what the

: solution of the problem will be so that we can lent size in the areas where the desired result pidly (high gradient value, stress concentration fillets) and can increase it in regions where the latively constant.

15

Page 29: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Thus discretization into elements in the finite Element analysis is divided into two general parts: the division of the body into elements and the labelling of the elements and node numbers. dealtjfully later.

f',

1.6.1 GRID SYSTEM:

Grids or meshes or finite elements are media for dicretization d domain or region of interest of a physical problem in the form of '+ differential equation.

There are point distributed (letter) grid and block - centred grids. The finite elements can be linear, triangular, quadrilateral and axisymmetric.

Point - Distributed (Lattice) Grid:- Here the grid points are first placed at the boundaries. The other points are then distributed uniformly between the grids at the boundaries as shown below:

Fig 4: Point distributed Grid 16

1 2 ' 3

O * ' ot - A x

Grid point

Page 30: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

: block boundaries are placed midway between the grid points I each block has a volume of A . X except the blocks at the

boundaries which are each '4 A X) there are four full blocks and two half blocks, 11-e A = d'241 )C R k a " c c -- t-yE q- Ax = L - & ,.,-, dl

M - I

Where Ax is the grid size L = length of the system M = number of points

This type of grid system is preferred for problem with Dirichlet boundary conditions.

- BLOCK CENTRED GRID:

The system is divided into M equal blocks and the grid points are located at the centre of the blocks. For block - centred grid, the blocks are smaller than in the case of point distributed grid because the volume of each block is A X and there are no points at the boundary. Fig. 3 Block centred grid.

Page 31: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

For uniform grid spacing, the only difference between the two methods is in the treatment of the boundary conditions.

Exercise

1. Distinguish between

a. Ordinary Differential Equations and partial differential equations.

b. Linear and non-linear partial differential equations.

.. c. Elliptic and hyperbolic partial differential equations.

2. What are Boundary Value Problems Illustrate the classes of Boundary Value Problems

3. List methods of solving systems of linear equations

4. Illustrate the point Distributed Grid and explain briefly how it can be applied to show the temperature of a piece of rod

"q, being heated at one end.

--

Page 32: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

ICAL COMPUTATIONAL PROCEDURE.

The use of digital computer to solve computational problems requires more than the ability to code mathematical formulas in

LAN language. It requires the ability to analyse oblems and to formulate detailed mathematical

for their . solution. FORTRAN (FORmula n) originally developed by IBM, is a procedure- lmputer language that is specifically suited for mputations.

[NG UP TYPICAL COMPUTATION PROCEDURE:

:a1 method is to be employed efficiently, it must be an unambiguous, ordered sequencc of computational

iecision instruction provided to include all forseable Such step by step computation procedure is -called

[M.

the process of setting up an algorithm, let us consider tion of the roots of an algebraic equation: ax2 + bx ?ere a, b and c are known constants such that a and b zero.

of computation depends on the assigned value for a, " a,,u, .pbbifically.

Page 33: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

I ) If a = 0 (and b+c t 0 ) there will be one real root, given by bx + c = 0, x = - c/b.

2) If a = 0 and b2 > 4ac, there will be one ( real, repeated ) root, given by x = - bl2a.

3) If a + 0 and b2 > 4ac, there will be two real roots given by

4) If a # 0 and b2 < 4ac there will be two complex roots given . by,

where, i = I

outline of the computational procedure: - .

1. Read values of a, b, and c. 2. Print the values for a, b, and c. ( in order to identify the

problem) 3. ~ e t e r m h e if a = 0

(a) If a = 0, calculate x = = -b/2a. then print the value and stop.

(b) If a # 0, continue with step 4 below.

Page 34: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

3re b2 with 4ac b2 = 4ac, calculate x = -b/2a, then print the value

)r x and stop. 'b' > 4ac, calculate

"hen print the values for xl and x2 and stop.

b: < 4ac, calculate

he values for xl and x2 and stop.

ASIC ELEMENTS OF FORTRAN OPERATION

Vow Charting)

- . data input symbol m

Page 35: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Counter manipulation symbol ( index increment, decrement )

Computation symbol

Direction of flow symbol

Connector symbol

Decision symbol ( algebraically compare a and b )

Output symbol

................................................................. ....... ...............

Storage symbol 1 ..................................................................................... . .

I

Subroutine symbol

Fig 3. Basic Elements of Fortran Operations. 2 2

Page 36: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

procedure for computing the roots of

PRINT h I

Page 37: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Note: One needs not be a skilled computer programmer in otl to design a programme. What is required is a clear view of 1

desired programme features and an overall understanding of 1 computational methods that are required to -implement th( features. Infact a computer programme is designed by 1

Engineer or manager in charge of the project whereas the detail programme is usually carried out by a programming specialist.

The student is advised to review the features of Fort1 programming, namely constants, variables, subscripted variabl functions, exponent form, basic arithmetic operation in Fortr, arithmetic expression in Fortran, Storage reservation (Dimensi Statements), Formatting, executable instructions in Fortran, In] Statements forms, control instructions, in FORTRAN, in]

. Statement forms, control instructions, looping and the Do statements, Nested Do Loops, CONTINUE statements, Stop and End Statements, Pause Statements, Output instructions and others

2.1.3. POLYNOMIALS:

A polynomial is an algebraic expression ( a monomial, only one term) or (multinomial, two or more terms ) in which every term is integral and rational in the literals (letters which represent numbers ).

For example, 7xy, 3xyz, 4x2ly are monomials

2x + 4y, 3x4 - 4xyd/ are binomials and 3xZy3 - 4x4y + 2, 2xr - 7x3 + 3x2 - 5x +l are polynomials.

Page 38: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

gree polynomial is expressed thus:

ccur extensively in scientific and Engineering xially in connection with differential equations.

.function in the Finite Element Method of a polynomial expression thus:

function for two dimensional triangular element. 1 is linear in x and y and contains three coefficients lngle has three nodes.

fference method of computation and discretization #, second differential equation like

3du - 5u = 0, linear algebraic equations - dx

should be solved. .

e use of operator method for solving differential iee pp. 57-60 of Differential Equation And the same Author ) like

4y = 0, a quadratic polynomial expression

Page 39: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

results.

Where, D = dldx = D - operator.

D' + 3D -4 is a characteristic equation which obeys all the laws of a quadratic polynomial expression including complex properties. The roots of the characteristic equation are called eigen values of the differential equation, namely h l = 1, A2 = -4 .

Therefore to solve a polynomial, the roots are simply found.

' 2.1.4 NUMERICAL SOLUTION OF ALGEBRAIC EQUATIONS:

. .

Non-linear algebraic equations can be solved to very high degrees of accuracy by means of various computational procedures which have been devised for this purpose.

These methods are based on the use of repeated calculations to successively refine earlier results. Each successive calculation is called on . ITERATION. Hence these methods are sometimes referred to as iterative Techniques. Such methods are useful when the solution obtained by graphical procedures are not sufficiently accurate.

Page 40: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

ive Substitution:

Then a 1

Estimate

proximate solution to an algebraic expression is assumed iually the solution is refined through trial-and-error type ons.

his method, the given equation is written in the form.

x = g (x) . . . . . . . . . . . . . . . . . . . . .. . . . ... ...... .... (1)

ralue for the desired root is guessed, say, x,

value of x by plotting the graph of f(x) = x2 - 10 cos x = 0,

~y otxerva

revealing tt

and x = 1.5

n tion, there is change of sign between x=1.0 and x=1.5

lat there is a positive root somewhere between x = 1.0

. More value will be evaluated with this interval.

Page 41: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Root of R x ) = 0

' Fig,+. graph f(x) versus x

This graph shows that f(x) crosses the x - axis at about x = 1.38, thus x = 1.38 is the desired root. Thus for the computation of the positive real root of x2 = 10 cos x we choose xo = 1.4 and we write Substitute xo on the right hand side (R.H.S) or (1) a new value of x, xl is computed

If the chosen (guessed) valued, XQ, is the exact value-of root, then xi will not differ from Q, and the computation will* cease. If xl differs from xo, say / xo - xl/< E where E is a preestablished, small positive number. xl is substitutedon the R.H.S of (I)

Page 42: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

again to get x2 This. procedure electronic calc close together the difference some specific !

hence xz = g(xl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (3 2 is repeated over and over. using computer or an ulator, until two values of x that are sufficiently are obtained; The computation terminates when

between XI,! and XI (disregarding sign) is less than ;mall value.

Matnematlcaliy written /xl - xl.1 / I E, E defined as before. Generally x = g(xt - 1) . . .

Where xt - I represents the currently, assumed value ,of x and x, represents the newly calculated value.

. ,

Example i t . ! root. -Use the r

Solve the equation x2 = 10 cos x for a positive real nethod of successive substitution with E = 0.00 1.

[(o. 1) (1 .4)2]s= 1.3735 19-

itopping criterion or conveyance criterion it is seen

/I ,3735 19 - 1;41= 0.02648 1 which is larger

~t perform, additional iteration as shown below 29

Page 43: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

x2=cos-' 1(0.1)(1.373519)~1= 1.3810031~~-xI 1=0.007484 x3 = cos" 1 (0.1) (1.38 1003)' I = 1.378904 1 xl -x2 I = 0.002099 s4 = cos-' I (0.1) (1.378904) ' 1 = 1.0379494, 1 - x31= 0.000590

Since 1 x4 - X; 1 = 0.000590 c 0.00 1 the stopping or convergence criterion is satisfied then the final and accurate solution is the value x = 1.379494.

If more accuracy is required, E may be made SI

until the right accuracy is attained.

2.1.4.1 CONVERGENCE CRITERION

The assumption has been that the calculated closer and closer to the desired root as the con

. from one iteration to another. This condition desired value is the convergence.

It is not always true that the computation wi desired root, in some cases the computation another root or it may "blow out", that is the ca may not approach any value whatsoever. This called divergence. Whether the iteration will or not depends upon the particular way in equation is rearranged into the forrn x = g(x)

Exam le 2: P If x = 10 cos x is rearranged in the forrn.

x 4 s solving for a positive real

Page 44: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

the method of successive substitution with E = 0.00 1

ssumed to be 1.4 as before.

jllowing reference calculations are obtained

nl - J l O c o s 4 = 1.303714/~1 -xo/ = 0.096286

x, = 410 cos 1.303714 = 1.624555 1x2 - xll = 0.320841

x3 = 10 cos 1.624555 = -0.537327

Further computation after x2, involves imaginary roots. Even if complex arithmetic is considered, the computation will not necessarily converge to the correct answer. If the minus sign is neglected, the computation does conwerge at x = 3.16194 after 7 iterations which is not a root of the given equation, ( it is a root of x2 = lO/cos X/).

whether the method when applied to a particular form, ) will converge to the desired root or not, provided the x,, value reasonably close to the desired root, depends on ierivation of g(x).

lod will converge if and only if the magnitude of g'(x) is I 1 in the vicinity of desired root. Mathematically the :nce criterion can be written as lg1(x)/ < 1 . . . . . . . . . .. (4)

Page 45: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Example 3: Apply to 'convergence theorem

I g'(x) / < 1 to the equation x' ' = I 0 cos x. compare with the result obtained in Example 1 and 2

In Example 1, we wrote x = cos " (0.1 x2) and g' (x) = - d 1 (cos " (0.1 x2) / = - 0 . 2 ~

dx d m since the root has the va1ue.x = 1.379365 from Example 1

I g' (x) / < 1, therefore the c&nputation will converge and this is consistent with the result obtained.

In Example 2, x =\I 10 cos x , ,

thus g(x) = Jw . . - ,

evaluating g' (x) at x = 1.379365

1 g' (x) I = 5 sin 1.379365 = 3.56 $0 cos 1.379365

Page 46: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

I g' (x) I > 1, the computation will not converge. If ) 1 is plmed against x, the magnitude of the dope of the to g(x) must be less than unity,

- this is the graphical interpretation of the convergence criterion.

2.4.1.2 ' Newton - Raphsm method (also known as Newton's method j : .

it is a special case of the method of successive substitution for solving equation. For many probleq the method converges mnirlly,

Jewton's method the function P(X) = x- f(x) -- - x .- -+fa bk < . h b ;

' f' (x) Y

LcWCc chaGVr 4 ~ S j % & l a ,

0 represent the original algebraic equation. In equation xi = g(x i , ,) because

7 ion x- = 10 cos x for a positive real. rootLusing aphson method: choose E = 0.001 a

Page 47: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

S o h tion: :f(x) = x2 - 10 cos s. f' (x) = 2x -I- 10.sin x Thereforc:

g(x) = x - . = s - x2- locos x .

fl(s) 2 x + 10 sin x

, . , = x2 + 10 (X sin x + cos x): -

2x + 10 sin x

Beginning with x, = 1.4

X I = m2 + 10 (1.4 sin 1.4 + cos 1.4) = 1.379428 (2) ( 1.4 ) + 10 sin 1.4 . .

applying the stopping criterion /xl - xd = 11.379428 - . 1.41 =0.020572 which is larger than E.

. . Addition iteration continues , . ., .

xz = (1,.3794283 +lo( 1.379428 sin 1.379428 + cos 1 1.379428 (2) ( 1.379428 ) +lc sin 1.379428

= 1.379365, /x2 - xl 1 = 0.000063 which is less than E, so this is the exact value of x. Thus Newton - Raphson method (Newton method) converges very rapidly - in solving this problem. Only two iteration were required to obtain the answer whereas eight iteration were required in . I . I

Page 48: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

ble I . n's method cannot be used to solve every algebraic In. The method tends to " blow up " when the value for is A closec to zero. The method is ,.recommended when .ging type of iteration procedure is desired. The method is ally well suited for computer implementation.

2.4.1.3 The Method of Bisection (Interval Halving):

method is better illustrated through an example. lple 5:

: the equation x2 = 10 cos x for a positive real root within lterval 1 1 x 1 2

1 " I +*...-. t ion

Using the interval 15 x 5 2 a = l x, = 1.5 .b = z

fla)=-4.403 f(xm) = 1.543 f(b) = 8.161

that /b-a/ exceeds E so' additional iteration are required, g w i t h l < x 5 1.5 ' '

2nd Iteration x, = 1.25 b = 1.5

- 4.403 f(xm) = -1~~59 1 f(b) = 11,543 /b-a/ = 0.5 exceeds E

Page 49: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

3rd Iteration x, = 1.375 b = 1.5 f(xm) = 0.0549 qb) = 1.543 lb-a/ = 0.25 1 exceeds E

4th Iteration x, = 1.4375 b = 1.5 f(x,) = 0.737 -f(b) = 1.543

5th Iteration x, = 1.40625 b = 1.4375 f(x,) = 0.339 f(b) = 0.737 /'-a/ = 0.0625 exceeds E

* I i ..

6th Iteration x, = 1.39063 b = 1.40625 Qx,) .. 0.142 f(b) z &339 1 ) -

ba/ .= 0.03 125 exceeds E . ,

6 . 7th Iteration x,,, =-1.38281 b = 1 .39063 fixd) = 0.0434 qb) = 0,142 i

lb-a/ = 0.01 5625 exceeds E

8th Iterdtion x, ='I .37891 b = 1.38281 qx,) = 0.00572 f(b) = 0.0434 /b-a/ = 0.0078125 exceeds E

Page 50: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

9th Iteration s , = 1.38086 b = 1.38281

i72 f(x,) = 0.0 188 f(b) = 0.0434 /b-a/ = 0.00390625 exceeds E

10th Iteration x, = 1.37989 b = 1.38086

72 f(x,) = 0.00661 f(b) - 0.0 188 /b-a/ = 0.001 953 125 exceeds E

1 1 th I t e ra ta x, = 1.37940 b = 1.37989

72 f(x,) = 0.00445 f(b) = 0.00661 /b-a/ = 0.0009765625 exceeds E

: 0.001 after 1 lth iteration, the computation ends and iyer is assured to be x = 1.37940 because

ltation continues to the 1 7Ih iteration, the right answer ned, thus x = 1.379365. This is the correct root to 7 Igures, though x = 1.37940 represents an error of less t is obtained at the 1 1 lh iteration.

~erits of the Bisection method are lot make use of trial - and error procedure which may rot converge. Hence-divergence is not a problem.

Page 51: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

(b) By this method, it can be determined in advmce the number of iterations required to reduce the error to less than prescribed size.

To predict the number (n) of iteration, it is known that

1, = first iteration = the original interval of size = Ib - a/

Therefore I2 = second iteration = - 11, I j = I2 = - I as I2 = - 1,

(6) Therefore 1, = 1, . . . . . . . . . . . . . . n-r 2

For stopping criterion In must be less than E So I , <Earn> =log(I,/E) + I n-l - 2 log 2

The smallest integer of n that satisfies this last quantity will be the.required numberof iteration. For the calculation in example 5 I l = b - a = 2 - 1 E = 0.001 I I

So log - (I JE) + 1 = LogJ(2- 1)/0.00 I / + 1 Log 2 log 2

The smallest integer that exceeds this value is 1 1 hence n = 1 1 as in example 5.

Page 52: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

ORITHM FOR FINDING THE ROOT OF A YNOMIAL EXPRESSION:

nputer programme is set up to find the roots of the o~nial thus

:x) = ax" + bx3 + cx2 + dx + e . . . . . . . . . . . . . . . (7)

steps in programme:

Dimensioning and formatting Dimension y (10)

Divide the range xl to x2 into 10 equal increments

called H

The function y is called at x = xl and the sign of the

function is tested. If negative k is set. to 1, if

positive k is set to 2.

The function is calculated at x = xi x H and the sign

is again tested. If the sign of the function has not

changed, x is again incremented and y is again

calculated and tested until y is found to change sign.

39

Page 53: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

5 If y changes sign, say between x = X I x(n- 1 ) H and

a = XI + nH, the root is assumed to lie between

these two values. The size, of the increment H is

then compared with ERROR, a variable that is set to

the desired accuracy.

(6) If H is smaller than or equal to ERROR, the correct

value of x is printed as the root. If H is greater than

ERROR a new value of increment equal to H/10 is

set and the above steps are repeated over the range

X I + (n-1) H to X I + nH until the increment chosen

become equal to or smaller than ERROR

(7) If the sign of y does not change over the range, X to

X than the line printer is ceased to print NO ROOT

FOUND.

(8) At the close of step 5 or step 6 the computer stops.

Page 54: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

is the flow chart for

at start of

I fy is-ve set, k= 1 If y is +ve set k=2

\ /

Increment x and calculate y <

\/

ralue y changed

smaller

rcnched

range x, + (n-I) HI tox , + n H Print No

Set the New interval = \

/

HI10 4 1

Page 55: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

THE PROGRAMME IN FOKTR4N:

Do61=2,10 y ( l ) = E + X* (D + X* (C t X* (B + A* x))) WRITE (2, 15) X, ERROR, H, y( I), 1

FORMAT (4(5x, E 1 1.4), 13) GO TO (7, 8,), K

x = X - H IF ( H - ERROR) 3,3, 10

If function y does not,change sign in the first I0 calculation, the next instruction cause the live printer to show thai no root has been found.

WRITE (2,13) 13. FORMAT (14H NO ROO'T FOUND)

STOP If the value of the root is found to the desired accuracy the next instruction will be reached

42

Page 56: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

I a polynomial expressed and develop ow diagram for finding the roots. rogramme for finding the values of the roots and try ing the problem via computer

x - 1.38 is an approximate root of x2 = 10 cos x.

the Newton - Raphson method can be used to hree real roots of the equation

Page 57: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

CHAPTER THREE

METHODS O F SOLVING DIFFERENTIAL EQUATIONS RELATING T O TRANSPORT PHENOMINA:

3.0 INTRODUCTION In this chapter tinite Difference and Finite Element Methods will be used in solving differential equations describing physical situation in Heat Transfer and fluid mechanics. With Finite differences method, differential equations are replaced with finite difference equivalents which are in the form of polynomial expressions. The derivatives are expressed as functions of independent parameters at discrete points in the grid or mess system. The finite difference method can be derived using

(i) Taylor's series expansion (i i ) The integral method (iii) Variational method

3.1 FINITE DIFFERENCE METHOD: DISCRETIZATION

. . This method is characterized by forward Difference. Backward Difference and Central Differerice Approximations. Applying Taylor's series ~ x ~ i k . sion method to f(x + Ax) about xo, the following results

Page 58: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

lacing x - xo with Ax Ax=x-xo x = xo + Ax

xo) + Ax f (xo) ..................... (22)

high power of Ax ) for f (xo)

x + Ax) - f (x0) - f'(x0) & - f"'(xo@x2 Ax 2! 3!

Page 59: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

n.here Ef = truncation error 7 ' 3

........... . . - - f'(so&x SO) - Ax- f" (xo) - Ax 2! 3! J!

Equation (24) is the forward difference approximation of f (s) anf Ef is called the forward difference truncation error.

The lowest degree of Ax in the truncation esror expression is 1 and the forward difference truncation error is said to be of order 1 and written thus

Using this notation in the grid system below . (D,iscretization in space):

F i g s Finite Difference notation in Block centered Grid. 1 = order of the truncation error

Approximation of d f , from (24) - d x

= f(xo + Ax) - f'(xo) + Ef Ax

Page 60: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

i\re at point i using finite differences method can d o n of the irldependent parameters at point i and i + 1 is ahead of point i, The formation in (26) is :reme approximation.

is usually not known, thus the approximation in 'ference method. In discretized form is as follows:

,es expansion of f(x - Ax) F(x,) - f (xo) - Ax + ff(xo) - AX' -

1 ! 2! ... ............... (28)

Page 61: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

1 Therefore f (xo) = f(xo) - f(xo - A s ) +- El, .......... (29)

Ax

where Eh = f" (XO) Ax - f"'(xo) AX' + ............. - - 2! 3 !

= 0 (AX) ............... (30) order = 1

The approximation in the backward finite difference method in discretized form is

The derivative at point i is approximated using parameter valuesat point i and i - I. hence the approximation known as backward difference formula. The order of error is one. Hence Eb = 0 (AX) .................. (3 1 )(b)

To derive central difference Approximation equation (28) is substracted from equation (21)

f(x0 + Ax) - f(x - Ax) = 2f(x,) Ax + 2fff(&) - AX' + 2 f (x,) AX:' + ....... -

Solving for f (x) ........... - - f (x) = f(x + Ax) f(x Ax) + E, (32)

2Ax

Page 62: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Terence approximation has an error of order 2, it is

n the forward or backward difference approximations

r one. This is so because the higher the order of the

Ie truncation error.

Page 63: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

3.1.2 GRAPHICAL ILLUSTRATION OF FORWARD, BACKWARD AND CENTRAL DIFFERENCE APPROXI MATION

Fig 6: Graphical illustration of backward, forward and Central difference approximation.

The forward difference approximation of - df at dx

Point i + 1 is the slope of ABC which is parallel to J E D K, the

central Difference approximation is the slope of the live JEDK

and i s used to approximate the derivative at point i given by the

slope of the line ABC.

Page 64: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

'E DIFFERENCE APPROXIMATION OF SECOND TIVE"

+ AX) - f(~,, - AX) 2f (xJ + 2f'"(xJ - AX^ - 2f" (x,) AX)^ + . 4 3 5 ) -

2 ! 4! ~Iving for f '(x,) gives (x,) = f(x, + AX) - 2f(xo) + f(x, - Ax) + E

(AX) '

truncation error = 2.

(37) is the discretized form of& dx2

: finite - differknce approximate of the differential

in the interval 0 to L 5 1

Page 65: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Using a more accurate central dit'ferences approximation to represent the first derivative, the finite difference equation is as follows:

Evaluating and collecting term equal (38) becomes

(1 - 312Ax) fi+, - 2fj + (1+ 312Ax) 4+, = AX) * .. . . . . .... (39) If A = 1 - 312Ax

B = 1 + 312Ax " and C = (Ax)

As there are three equation and five unknowns, within the interval 0 , L. i can assume three values, say 1,2 ,3

Thus using the finite Difference Method, the above system of algebraic expression result. Solving them at the discrete point i = 1, 2,3, a numerical solution of the differential equation d2f + 3df - 5 = 0 can be obtained dX2dx

52

Page 66: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

quations and five unknown Fu, FI , Fz, F3. F4. Some of re usually eliminated from the boundary conditions of

se is discretization process in space, using the block :n1.

rIZATION IN TIME: $neering problems are not only space (x, y, z) t but also time dependent. Discretization in time is hoosing time steps and obtaining solution of the it various times.

'esent the value of the function f, at the grid point, i I and time level - and (don /(dt)in means the derivative ~ction, .f with respect to time 1 point, i and time level - forward difference approximation in time at point i is

n+' - fil' + 0 (At) ........... (41 At

ward difference approximation in time f in - f i n + 0 (At) ........... (41)

At I

. ,

. LA= L~LIT AND IMPLICIT FORMULATIONS: This concept can be illustrated through examples. To solve the second order differential equation

Page 67: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Using the finite difference method.

Using the forward difference in time equation (43) can be written as

Discretizing equation (44)

f n i -1 -2 f in - + f n i + , =f i " ' . f in - ............ (45) Ax' At

If = &equation (45) becomes .. Ax2 ,

fln+' - fln=oC fni+, -2e fni + Xfni+l f l nc l = o~ fnl-!+ f ln - 2 ~ f n i + + f n , + l f 111+1 = oc fnl-1 + ( 1 - 2 ~ ) f in + + ani+, . . . . . . ~ ~ . . ~ ~ ~ . - o (45)

Using the parameter, cc, the discretized equation(48) shows that the value of function, f, at point I at five level n+l can be calculated from values of the function f a t old time level n. This formulation is known as an explicit formulation. It is important to note that in the explicit formulation, the valuesof the function, f, at different points at any time level have no relationship with each other, aIso there is just one equation and one unknown..

Page 68: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

the backward difference in time. ion (43) becomes

Discretizing equation (46) becomes

putting a = At AX^

8 kquation (47) becomes

he values of the function at the new time level n + 1 are known. ion (48) contains three unknowns and solution can only be led if the equation for all the points are written and solved taneously. Hence this formulation is known as the implicit 11ation.

domain or interval in which equation (43) applies, is divided into ,oints or nodes, namely i = 1, 2, 3, equation (48) in discretized becomes

Page 69: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

A simultaneous linear equation results.

Boundaiy conditions specially usually at the boundaries of the grid reduce the five unknowns, f,, f l , f2, f3 and f4 to three, resulting in three equations and three mknowns. The resulting system of equation in matrix form is thus:

+2a) cc

-(I + 2oc)

cc (

n+P

3.3 CRANK - NICHOLSON METHOD: This uses the central difference approximation method in

" discretizing in times, second order differential equation, using n+le times level.

Applying this method to equation (43)

d f = df it becomes dX2 ZF

' Discretizing

Right hand side of (49) becomes

Page 70: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

le left hand side of (49) is approsimated to

. . . . . . . . , . . i - I

(52)

bmbining equation (50) and (52) in discretized form dropping e truncation error we have

(53) becomes

(54) is the Grank -Nicholson method and it is an implicit on.

le implicit, explicit and crank - Nicholson methods in general

Page 71: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

where 8 is the weighting factor lying within 0 and 1

when 8 = 0 it is implicit formulation 8 = % it is crank - Nicholson 8 = 1 it is explicit

EXAMPLES: ........... Discretize &f = - df + q (57)

dx2 dt

Solution: (using explicit formulation)

becomes f"2fi"ff" = f"+' - f " + q n ...........

i - 1 i - I I I I (51

dx2 Ax q = the source term

LXscretize the two dimensional second order differential equation d2f + &f = - df ........... (59) dx2 dy2 dt

Solution: Hzre the grid system is two dimensional - i j and node separation are Ax and Ay

58

Page 72: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

i - direction ->

1 dimensional grid systems

t formulation

)r simplicity let the node separation be equal in the two

rections, that is, Ax = Ay

lerefor as usual, oc is defined = At -

AX*

1 evaluating the discretized equation of (59)

Page 73: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

The unknowns can be reduced. applying boundary conditions and using i = 1.2,3

j = 1 . 2 3

-(4 + x) rC

i 0 % 0 0 0 . 0 0

% 4 4 + K) % 0 K O 0 0 0 0 x -(4 + x ) 0 0 X O O O K 0 0 - ( 4 + ~ ) .X. 0 Y- 0 0

---- 1

3.5 FINITE DIFFERENCE METHODS IN STEADY STATE CONDITIONS

3 . 5 . 1 INTRODUCTION: In many practical problen~s involving steady state heat transfer in solid conduction region, an exact mathematical solution is

precluded as a result of the complex shape of the conduction region. the type of boundary conditions, the energy generation rate per unit volume.

Page 74: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

'n such conditions. the temperature distribution can frequently : determined by an approximate finite difference analysis. lis analysis approximates the governing partial differential luation at a finite number of points within the conduction gion, called nodes or nodal pcints, grid point or lattice points an algebraic finite difference equation at each point.

lus if n nodes are selected at which a solution for the proximate steady state temperature is desired, n simultaneous gebraic equations for the n unknown temperatures are solved. lere are two approaches to arrive at the finite difference pation for a node.

ne approach is to take the governing partial differential luation such as for contact thermal conductivity.

T + 87' + ~ Z T + q"' = 0 ... .... (62) - - (Z dy2 dz2 k

lange "ds" to "3"

td since it must be satisfied everywhere in the conduction gion, it must be satisfied at each node, say node j so that 'T - l j + 8 ~ - . 1 , + 8di + qof = O - (63) c2 dy2 i3z2 k \

q"' is the generation term in the x.y,z space

. e various terms such a m 1, i re approximated by

ax2 Ffinition of the derivative, except that the spacing Ax

6 1

Page 75: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

between the nodes in the x - direction does not approach zero but remains finite.

The other approach defines the volume of material associated with each node and then applies the law of conservation of energy to this volun~c of material to derive finite difference equation for each node.

(considering a control volume, like a gear bos) and.

Rll, + Ryn = R,,,, + R ,,,,,(j ................... (64) Can be used. For steady state there is no time rate of change of stored energy within the control volume itself, therefore R ,torcd or R accur = 0 and (64) becomes

R ... + R gel, = R our ................ (65 )

Where R represe~lts rate of change of material or stored energy)

the 'material associated with each node" means the material considered to be essentially at the temperature of the node.

3.5.2 PROBLEM 1.0;

Derive the governing finite dilrkrences equation for an interior

node of a three dimensional steady state conduction region with

generation, but with constant thermal conductivity.

SOLUTION:

Fig 8 shows six nodes or grid points or lattice points surrounding the interior node, 0. On all six sides (like the

62

Page 76: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

neighboiir atoms i , ~ sodium chloride crystal Lattice). e grid point is in a volume whose dimensions are equal .ode separation whtre dimensions are equal to the node

ion in thc x.y.z direction. th3t is Ax, Ay, AZ

,2. 3, 4, 5.6 are Ax, Ax, Ay, Ay, Az, Az away from node I the sides of the six faces of the paralleliped.

ralleliped ABCDEFGH is the material associated with The six nodes surrounding node 0 also have material

ted with them.

g between nodes, 1 and 0 , 0 and 2 is Ax. g between nodes 3 and 0.0 and 4 is Ay g between nodzs 5 and 0 , 0 and 6 is Az

)at each of the six faces of ABCDEFGH, that is where of terial Ax Ay Az associated with node 0 lie halfway 11 node 0 and the adjacent node in the coordinate

direction perpendicular to the face. 63

Page 77: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

By the law of conservation of energy for steady state \ conduction, equation (65) applied to the control volume Ax Ay Az, we have

Rin + Rgen = R o u t

As the control volume, ABCDEFGH has its surfaces bounded by solid material, the only way energy can enter or leave the control volume is by conduction across the six faces of the control volume. It can be assumed that all of the conduction terms are into node of interest, that is node 0. the heat generated is being conducted to node 0, therefore Equation 65 becomes

I f q, - 0 is the rate at which energy is conducted into the control volume from the material and node 1 and ql - 0,q2 - o,q3 - 0,

q4;0,q5.o,q(j-o ............................. (67)

The total rate at which energy is generated within the control volume is given by the local generation rate per unit volume times the volume of material associated with node 0

Therefore the energy balance at node zero becomes

~ I - O + ~ ~ - O + ~ ~ - O + ~ ~ - O + ~ ~ ~ ~ + ~ ~ ~ ~ + ~ ' ~ ~ ~ A X A ~ A ~ = O ......................

from equation (66) (68)

Relating to the nodel temperatures, fourier simplified law of 64

Page 78: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

is used. This IS part of the finite difference ion, since the conditions for the use of simplified are not satisfied unless the finite spacing Ax, Ay and h the iniinitesmal q:iantities dx, dy, and dz

plified law for ql .0 is

L = Ax and the area A perpe1:dicular to the heat is

ature difference is written as TI - To since it is at q 2-0 is into the control volume.

75 eat transfer rates are using three types of reasoning

lese expression into equation (68) and dividing each xAyAz. the a l g e b r a i ~ ~ i t e difference equation for

b.5

Page 79: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

the general interior node 0 is

\ T -TI-2Tn + 1 3 + T ~ - ~ T O ~ T F + Th + 2 T o + q o ~ ~ ~ = O (70) AS' dy dz2 k

Equation (70) is typical of all interior nodes with subscripts changed depending on the nodes surrounding the nodes of interest. This is continued until all interior nodes are covered. This is continued until all interior nodes are covered. This analysis does not cover the nodes on the boundary.

Thus Equation (70) is the finite difference equation for an interior node (one which has the volume of material AxAyAz associated with it) in a steady, three dimensional, constant thermal nodes are referenced to a rectangular cartesian co- ordinate system as shown in fig 8.

If problem 1 were two dimensional Equation (70) reduces to

and for one dimension equation (70) reduces to T l+T2-2To + ~ 1 1 ' = 0 ........ (72)

AX' k if the spacing is equal, that the grid system is equispaced that Az = Ay = Ax. In this case, after multiplying all the term in equation 70 (0.72 Equation (70) becomes

TI +T2+T3 + T J + T ~ + T ~ - ~ T ~ + ~ ~ " ' &)" O..... (72) K

Page 80: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

ion 7 1 becomes

-2+T3 + T4 -4To +cJQ"'&&~~= -- O . . . . . (73) K

ion (72) becomes 2 + 2To + Q'"- (ayl2 = 0 . . ... (74)

k

When all the Lattice spacings are equal, the general

on for an interior node in a three dimensional conduction

1 becomes very simple to write for each of the interior

. From Fig 8 it can be seen that' for any interior node, the

difference equation is found by summing the temperatures

: six surrounding nodes in three co-ordinate directions,

p the term*'"- ( A Y ) ~ = 0 at this node and setting the

k to zero.

it is required to evaluate the temperature at the surface in I ntact with the fluid at T, and h,. Derive a finite difference

uation at the surface.

Page 81: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Solution:- Superimpose a grid on the conduction like in fig 9

Fig 9 Finite difference model of a point on the Fluidlmaterial interface

Domain of interest in the conduction region

Unlike the interior node such as 4 which has the material Ax by Ax by 1 associated with it, node 0 has the material Ax x Ax x 1 associated with it as shown by dashed lines in Fig 9 - 2

Applying energy conservation equation to the control volume surrounding node 0 and assuming that all heat transfer rates into this control volume

Energy enters control volume from the nearest neighbours to node 0, these are nodes 1, 2 and 3, by conduction from these nodes. Energy enter the control volume from the fluid by correction since node 0 is at a fluid solid interface,. Assume that the node 0 receives no net radiant gain from any surfaces beyond the fluid,

Page 82: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

e expression for ql- 0 and q2 - 0 the are perpendicular to the ,.. .s only '/2 Ax ( I ) , rather than Ax (1) as it is for the flow :n 3 and 0. This is a consequence of the reduced amount of sl associated with a non-interior node.

ton's law of cooling

lat the reduced size of the control volume also makes itself felt R ge, tern since R ge, is the total rate at which energy is generated the control volume itself.

ning these result for R in, R ,,and q ,the finite difference

m for node 0 becomes 1

Page 83: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

3.5.4 PROBLEM 3.0 If the fluid solid interface is a perfectly insulated boundary as shown in fig 10. ~ e r l v e the finite difference equation for node

Fig 10. Node at the insulated boundaiy A D = &

2 A B = 1 unit '

- Heat flux from Ax - 1 to 0 through

(Ax12 by 1)

Material system Discretized system 70

Page 84: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Solution: h4atcriuI ;rbboci:~tcrl \kith node O is Ax by !h Ax by 1 as sho\vn by the dashcd line above. Applying the conservation equation to the control volume.

Where there is no tondition from the left because of the perfect insulation.

Using fourier's simplitied law of conduction for the conduction heat transfer rates this follows

Combining T3 + !h TI + 54 TZ +2TU + qol'l (& = 0 ........ (78)

k

. Non - Regular Boundaries: In most cases the conduction region or domain may not fit into a co-ordinate system that is parallel to x, y, z - axes or it wi l l approxin~ate to cylindrical or spherical co-ordinate system. However for any irregularly shaped region, then a rectangular grid can always be imposed on the region. then the nodes on or near the actual outer surfaces are considered, for example see below:

7 1

Page 85: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Note that some nodes are interior. some on the curved boundary

3.5.6 PROBLEM 4.0: I . Consider node 0 near the curve boundary shown in fig

12 below. Using a two din~ensional equispaced lattice. derive the finite difference equation for node 0

Fluid at T, , h,

Fig 12 Node at the curved boundary

There are three main approaches for obtaining the appropriate finite difference equation for node 0. These are: .

(1) To expand the temperature in a two dimensional Taylor series

expansion about node 0 and use the results through

discretization to approximate the governing partial differential

equation at node 0.

Page 86: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

For example Taylor's series erpansion in two dimensional space is described thus

see also 3.4 Another approach is to change the size and shape of the material associated with the node of interest in a way which, in effect, gives a variable, smaller mesh at the boundary (Reference Keith F, Principles of heat Transfer 2nd edition, Scranton, Pa, International textbook Company).

The next approach is the use of finite difference method but less accurate than the other two. However with the aid of a digital computer, a more accurate result could be arrived at.

The finite difference equation for node 0 in fig 12 determined by making an energy balance on the volume of material which is "naturally" associated with node 0

At an interior node like 2, the volume Ax by Ax by 1 is naturally associated with node 2. To associate the volume Ax by Ax by 1 with nodes 0 leads to running out of the solid into the fluid.

~ e n c e only the solid material that has within Ax by Ax by 1 is included as shown by dashed line a and 1 are relevant length.

Applying the energy conservation equation to the control volume in dashed 'lines associated with node 0 gives

Page 87: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Where V(, is the volume of the control \,olume and is approximated by

Vo = (Ax) 1/2 (Ax) ( I ) + % AX (a)

Since the upper portion of the \/olun~e has been approximated by a !riangular prism

where the conduction from the material between the left face of this control volunle and the curved surface is neglected.

To compute q from Newton's law cooling, the nodal temperature To is used as the surface temperature of the surface c hence

and the governing finite equation at node 0 becomes

Page 88: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

OLllTlON OF FINITE DIFFERENCE EQliATIONS:

fter the requircd finite differen~e equations arc obtained Iirr all

le nodes in he grid systcm imposcd on thc domain or ~,cgion

f in~cres~ like equation 70. 76. 77. 78. 81. thc lies1 problcm is

s0h.e the set of n linear algebraic equations in the n unknown

3dal tenlperatures.

:ELAXATION ANALYSIS his is used when solving n linear equations by hand when 2 4 are n nodal points and it is required to find the temperature in ~f the nodes , .TJ . .~~ .T~. .... ..TI) ... are the known coefficients of the temperature so we have

32 T2 + ... + b,, TI, + b,, q,"' = o ............. .(82)

step in relaxation analysis is to set all the linear equation equal als . RI . Rz . R; . RJ'. .......... .R,, at individual nodes rather ) that is

a, T2 + ... +a,, T,, + a n ~ l l l " =K,,

Page 89: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

if the correct temperatures are inserted to the equation (83) all the residuals equal to zero identically .

The second step in the Relaxation Analysis thus is : - make an educated guess of all the unknown temperatures at each

node to be used as a first approximations .

Using superscript to indicate the first and subsequent approximation to a first approxin~ation , for exalnple

TI ' = first temperature approximation for node 1 T ~ ' = first temperature approximation for node 2 etc .

- Substitute the initial guesses into the n linear equations

- Are the equations equal to zero individually ? If yes , the guesses are the correct temperatures. If No and all the residuals are non zero . then consider the eqintior~ whose residual is largest after substituting the initial temperature guesses .

- If Rz. say, is the largest residual. then n neu tcnlperatiiic is c l ~ o w i so that R? becomes zero or near zero.

- This new temperature that makes R2 close to or equal to zcro is nu^

substituted to the o t k r linear equations .

Page 90: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

After value inake

this substitution. all the residuals are examined and the largest m is taken again. say. it is R3. a new temperature is chosen that 8s R3 zero or near zero.

are the This new temperature is substituted in the other equation . the residuals

n examined for the one with largest absolute value .

The 1

SUDS1

indee

3.5.9 A 1-1 right

The r is gil The state

SOL The P U T '

x-ocess continues until all the residuals are zero or near zero.

temperatures that make these residuals zero or near zero are now mted into equation (82) to be sure that the right sides are all :d zero or very close to zero.

>rt cuts to relaxation analysis are over relaxation, block and group ation and group relaxation , discussed in (Ref c) Keith F and ci V.S: Conduction Heat transfer , Addison - Welsey 1966)

PROBLEM 4.0: neter thick slab or material has its left hand face held at O°F and its hand face held at 1 OO°F.

:nergy generation rate per unit volunle of the slab at steady state e n by q"' = 6000 x Wlhr, m3 which is a linear Q c t i o n of x . ~hermal conductivity of the material is 10 W1hr.m. "F . If steady conditions prevail, find the temperature distribution by the

)ximate finite difference method .

,UTION : problem is easily solved using exact solution but for illustration oses . finite difference method is used . .

The ; /' grid system is shown in fig 12a

Page 91: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Since the problen~ is one dimensional. tlic nodcs are placcd along the - discction. A s apart across the I meter dimension . 1 he greater r l nu~nbcr ol'iiodc~ the greater tlic accuracj..

I .et A s = % m . leading to five notes but three are nu~iibercd since tl lirst and the last are on the boundaries where tlic temperature a alrcady knou n .

I i > X - direction I

!

For the interior node of' one di~ncnsional equispacetl 1.utticc cquation (74) is applicrible . thus

r t ' l ' ? - 27'0 .i- q"' ( s ) 2/k - 0 . . . (83)

Page 92: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

. ips refer to tig S and must be reinterpreted for tig. 12a . aipt 0 ret'ers to thc node of interest while the subscript I refers : on the left of the node of' interest and the subscript 2 refers : on the right of thc node of interest . If the node 1 is the .erest in fig 12a .

difference equation becomes

is the local generation rate per unit volume at node 1 but q is of x , q"' = 6000x . Therefore at node 1 . x = % thus ql"' - = 1500 . hence equation (84) becomes after inserting x and

a!ion 74 to node 2 :o node 2 is node 1 : to node 2 is node 3 q u i r t ion (74) 1.c-interpreted for fig 1 2a becon~es

r ' , -i- -r3 - 2.; 7 . (AX) ' k = []

O s ; 6000 x !4 = 3060 s for i~odc 2 is Y L > ~ . : ( ' L \ I w IIOCII; 3 is 2A x =2 (%) from thc boiundar\. (origin point o f x - asis ). After inserting s 2nd I( fhv cquation becon~es T1 .+ 'r; - 2T1 - 15.8 = Q ...( $0)

equation (74) to nodc 3 1.cSt node to 3 is node 2 Right node to 3 is the boundaq (right side ) therefore cquation 74 reinterpreted for fig 12a becon~es Tz + 100 - 2T; + q;"' k = 0

Page 93: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

\ q.;"' = 6600 "x = (6000) (314) = 4500 After inserting Ax and k . the equation becomes

Tz-2T2+ 128=O ...( 87)

To equation to be sol7;ed for TI , T2, T3 are T2 - 2TI + 9.4 = 0 TI + T, - 2T2 + 18.8 = 0 T2 -2T3 + 128.2 =O

89 Using Relaxation s Analysis , equals each to R .

T2 - 2Ti + 9.4 = RI ....... (88) ....... TI +T3-2T2 + 18.8=R2 (89)

T~ - 2~~ + 128.2 = R~ ...... (90)

First Step - Assume educated guess for TI,T2,T3 realizing that the boundary temperature are O°F and 1 QOOf so TI could be 30°f

TI' could be 70°f ~ 3 ' could be 1 1 OOf

Second step - 3 substitute these estimates into (88) ,(89) ,(90) yielding

RI = 70 - 2(30) x 9.4 = + 19.4) ) ........ R2 = 30 + 110 - 2(70) + 18.8 = 18.8) (91)

Kj=70-2(110)+ 128.2=21. 8) The largest residual in absolute value is R3 = 2 1.8

Third sttp - make R3 = 0 , to evaluate the temperature to 6 e substituted to equation 91 to

make R; = 0 or near zero. we find AT3 ( the changes in T3 to reduce the residual to zero ) then 2A7; = AR or - 2(T2;) = 0 - (- 21.8) that - 2(7"; - 1 10) = t 2 1.8

80

Page 94: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

cond temperature estinxde for node 3, ( ~ ~ 3 ) to inake R3 zero is

step - Substitute T3 = 99 approximately in equation 91 = TI - 2TI + 9.4 = 70 - 2(30) + 9.4 = + 9.4

t2 = TI + T3 - 2T2 + 18.8 = 30 99 - 2(70) + 18.8 = + 8 d

a. -2T3 + 128.2 = 70-2 (99)+ 128.2 =O

By this ; substitute 'R1 = 19.4 R 2 = + 8 Rj = 0

NOW the largest residual in absolute values is R, = + 19.4 , hence the estimate of TI should be changed to zero or near zero .

Thus - 2 ( ~ ' , - 'i ' ,)= 0 -- (+19.4) -?I-'! - - . + - +19.4 - 2. 'i" + 2(30) = - 19.4 - 2T2\ = - 19.4-60=-79.4 - T), = 79.4 = 39.7 - 40° --

2

tep: Substitute * TI = 40" in equation (91)

Page 95: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

~hougli the residuals are being relaxed t o ~ ~ a r d zero. further relasatio' \I i l l bc done.

I'he largest residual on the fifih step in absolr .c. \slue is R? at node hencc -

- ~ ( T ' ~ - T ' ~ ) = o - ( + l 8 ) = 0 . 18 - ZT?? + 140 = -18

- 2 T'? = - 18 - 140 = - 158. therefore T'? = 79"

Sisth step: RI = + 8.4 Rz = 0 R; = 79-2 (99) + 128.2 = + 9.2 Largest residual is Rj. This next estimate T33 = 104

Seivnth step: RI - + 84 R2 = 40 + 104 - 2(78) -+ 18.8 = + 4.8 R; = - 0.8 Largest residual is RI. This next estimate T3 I = 44

Ei,ght step: RI = + 0.4 R2 = 8.8 R; - - 0.8 Largest residual is R2. This nest estimate T"? = 83

Xinth step: RI = + 44 Rz = - 0.8 R; = +j -. Largcst residual is RI. 1 his ncst estimate

I .= 46

Page 96: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

,p: R I = + 0.4 R2 = + 2.8 K 3 = + 3 Largest residual is R3. This next estimate T ~ . = 195

step: R1 = + 0.4 R- = 3.8 R3 = + 1 Largest residual is Rz. This next estimate T$ = 85

step: RI = + 2.4 Rz = - 0.2 R 3 = = 3 Largest residual is R3. This next estimate ~ . ~ 3 = 106 .

I

I

:h step:RI = + 2.4 R2 = + 0.8 R 3 = + l Largest residual is R,. This next estimate T$ = 47

th step:R1 = + 0.4 ? .

, .

R 2 = + 1.8 R; = + 1.0 Largest residual is R2. This next estimate T-' - 2 - 86

Page 97: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

fifteenth step:RI = + 1.4 Rz = - 0.2 R 3 = + 2 Largest residual is R3. This next estimate T63=107

fifteenth step:R1 = + 1.4 R2 = - 0.8 R3 = 0

This is the final step because the residuals have been relaxed to the point where fractional changes of a degree would be needed to get them closer to zero, thus the analysis is stopped here using the last values of or TI, T2 and T3, that is

TI =470F,T3= 107OF

These valu& df TI, T2 and T3, are substituted into equation 85,86 and 87 to'make sure that the right hand side of the equation is sufficiently close t9 zero, thus

Setting up the differential equation of the problem and solving it exactly the temperature distribution in the slab is obtained as

Page 98: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

I I solution ' . I I 1 1 1 1 )

table with finite Diff'erence solwtion ' ' / ' 1 5 { ! ' 1 r t 5 r '.ag' ?

jeduced from this table' that if more nodes are used, that is the lattice spacing or grid point spacing and calculating

negligible round-off error better accuracy could be achieved.

much labour in using rehxation analysis for three ,us equations, Cramer's and Garmain elimination methods

,., ,,,,. However when the number of equations to be solved is more than three, relaxation analysis is preferred to hand calculation.

I ! ; ' 1 ~ 1 ~ ~ iit / c ! ' , i ) , l , , t , , ,

Exact

For the above problem, over relaxation would be useful to shorten the time and effort. Over relaxation is simply reducing the largest residual not just to zero. but past zero. Hence if RI is positive TI is changed by

f , , / i , \ ~ f l , l ! . B { , l j j t v t s . . . I ,

an akount that would make klislighily negative rathir than zero. :Or if RI is initially negativei'a change in TI is made that would c a u i RI to be slightly positive. This procedure on the average gives a better distribution of residuals. How far to relax is determined by the 'nature of the problem.

# I ,

Finite difference

3.6.1 IMPORTANCE OP FINITE ~IFFERENCE METHOD The finite difference method is a powerful tool for the engineer not only for steady state problems and transient problems both for problems in fluid dynamics and stress analysis. There are many industries in which the heat transfer problems are so complex that the finite difference method is used extensively.

85

e & t !

Page 99: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

3.6.2 RICHARDSOX TECHNIQ ti E Richardson Technique arrives at what is usuall! verjV close to thc esact solution b ~ , s o h i ~ g the problem using finite differences for only thrw different lattice or grid point spacings. Then the temperatures at an? space point are plotted as a function of the size of the lattice spacing. This curve is extrapolated to zero Lattice spacing. The solution to the problem is the temperature extrapolated to when the spacing is equal to zero.

3.6.3 FINITE DIFFERENCE METHODS IN UNSTEADY - STATE CONDUCTION:

In conduction problems, one often encounters various shapes of conduction domains, boundary conditions, energy generation rate per unit volume, variable thermal conductivity or any combination of these and the determination of the steady state temperature distribution becomes mathematically intractable. In these cases, finite difference techniques are generally employed.

9

. , , .. Unsteady state Conduction ,

When ;he temperature at any space point within a conduction region is' changhg with time, the temperature distributiq is termed unsteady. The problems, relating to unsteady state condition, require the determination of the temperature distribution in a solid conductiorl region as a function of space coordinates and time t.

, There are two types of unsteady state conduction namely: (i) Regular Periodic Conduction: Here the temperature at the

various space points, although changing with time, changes according to a definite pattern, called cyclic variation in time

. which is repeated. An example is the temperature distribution t. within the cylinder wall of a reciprocating automobile engine .

Page 100: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Transient ~ond tk t ion The temperature variation at a space points, as time goes on. is not cyclic. Transient problem are by far the larger and more important class of unsteady state problem and include, in the most general situation, the regular periodic problem as degenerate cases as time gets very large. Examples of transient problems are found in the con~ponents of jet or rocket engines during start up and shut down, heat treating operation, start and shut down of heat exchangers and of nuclear rectors and the design of safes which afford fire protection to their contents for some specified period of time.

There is the LUMPED PARAMETER analysis of transient problems. In this analysis the temperature variation in the space coordinates centre neglected and attention focussed on the average temperature of the conduction focussed on the average temperature of the conduction region as a function of time alone.

Most transient problems are solved by the powerfid finite difference method, especially where because of complicating factors, like the initial distribution of temperature throughout the conduction region at time T = 0 the initial conditions, the lumped parameter analysis method cannot be used, the exact analytical method cannot also be used.

The transient finite difference equation at any node of interest is arrived at in a manner similar to that of steady state condition see 3.5 and making an energy balance on the volunle of material associated with each node leading to a set of algebraic expression for n node temperatures that are to be solved at a finite number of different times . The only difference is the

Page 101: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

appearance of the phenomenon called stability of the equation set.

3.6.4 Problem 5.0

Derive the governing transient finite difference at an interior

node .of interest, like node 0 in fig 13.

Fig 13 Coordinate system and a general interior node in three dimensional conduction region

Page 102: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

otation

To is the temperature at node 0 at the present time, T: is the temperature at node 0 at a future time t + At i.e present time plus one time increment )

The temperatures throughout the condition region at an initial time , called zero time t = 0) are known , the problem is to compute the temperature at 0 + AT, 0 + AT, 0 + AT, and so on until steady state or time of interest is reached.

Applyin surrounc as for st the teml

Recall f R ~ + ' R

The tim finite ti1 control

,g the energy balance equation to the control volume iing the node zero, R in and R ,en terms will have the same form eady state finite difference equation described in section 3.5 of ~erature of the nodes at the present time t are used, hence.

he transient energy balance equation ................. gen = Rout + R stor (94)

e rate of change of the stored energy R ,tor can be written the for me increment A1 as the internal energy of all the material in the volume 1 + At minus the internal energy of all the material in

Page 103: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

the control volume at time t divided by At at time't divided by the time increment At; that is

R ,,,, = PC;AX Ay AZT? -T, ........ (95) At

Note that as Ax, Ay, Az and At approach zero ,

R ,,,, in equation (94) goes to the correct storage term for the partial differential equation PC, dxdydz - dT

dl

Hence (95) can be considered to be approximating to the storage term in the general partial differential equation

d (k dT) + d ( k g + d (k d T ) q M ' = Pcp &.....(96) - - - - - dx dx dy dy dz dz dl

all "ds" are partials "a"

combining (92), (93), (94) and (95) and dividing every term by kAx AJ Az, and recognizing that a = - k yields the general transient finite

PCP difference equation.

Page 104: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

tion (97) is valid for any interior node in a 3-dimensional uction region described by a rectangular cartesian coordinate

system. The reduction of equation (97) to a form suitable for one. two dimensional problem is accomplished by sin1 pl! dropping the t e r m o n

I the 1 4 hand portion to directions in which ~llere is no temperature 3n.

t l .W 1L.1

variatic

For sin

For an To*= =

And fc

I

For nc materi,

solid basic assoc

nplicity equispaced grid points are used

y = A x and equation (97) with M = AX)^

KAT . . . . . . . . . . . . . . . . . . . . (98) '?s

es for each interior node

interior node of a two dimensional equi-spaced lattice,

,r an interior node of a one dimensional lattice.

m-interior nodes which usually have a dif'ferenholume of a1 associated with them and might be located on exterior surfaces

where they may interact with a fluid by convection and with other s by radiation, the finite difference equation can be found by the : rule of making an energy balance on the volume of material :iated with the node.

Page 105: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

3.6.6 Problem 6.0 Derive a finite difference equation for a point on a surface of a conduction region (material) in contact with a fluid bounding the surface and exchanging energy by convection with4the material.

Solution: Applying energy balance for non-steady s tate , conduction Ri, + R,, = RSt,, + but to this material considered as the ' control volume, fig. 14, gives

Defining N = li Ax .................. (10 3) -R and rearranging (102) using (103) give the transient finite difference equation

Page 106: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

For SI

1

urface node shown in fig. 14

Fig 14 The surface node

~roblem7.0 Derive the transient finite difference equation for the non-interior node shown in fig. 15 which is in contact with a perfectly insulated boundary.

Solution: The volume of material associated with the node is (Ax) .1/2 . (Ax) as shown in fig 15. Applying energy because equation to this volume gives

Page 107: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Fig 15 The surface node at an insulated boundary

Dividing every term by k yields 2

i)ividing every term by M= m1 and sol\ i l ly lor To yields AT

+ 2T3 + qdi' u2 + (1 . $To . . , . . . . . .(105b) M k I

b 6.8 PROBLEM 8.0

Derive the transient finite difference equation for the non-

interior node shown in fig 16 in which the temperature distributiorl

depends only, upon the radius and time and an equispaced lattice in the

circular cylinder co-ordinate system is used.

Page 108: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Solution

Since the temperature distribution depends only Only on the radius, the amount of material associated with the node 0 is material between the radius rl- 0 and R. The actual volume of this material is TI ( R ~ - r2 but if the lattice spacing AX is not too large this volume can

Fig. 16 Non-interior node well be approximated as of a circularCylindrical

coordinate system. 2n (r, + '/,At-) A r = Zn mr Applying the energy balance to the control volume of material lying between the radius rl.0 and R. Energy conducted into the control volume from the material associated with node 1 and convected in by the fluid, hence

K 2 ~ r r , - ~ TI- To) + hf 2nR (T,-T,) + qoiii h r ( R ) A r A r

= p c , 2 n ( R ) ~ r (TP-TJ AT

Dividing by 2nkrl-o/Ar yields

/ Solving for T/ yields

Page 109: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

PROBLEM 9.0 Fig 17 shows node 0 on a surface, which receiving mechanical energy at the known rate of wo wattslhr - I because of a grinding operation being performed on the surface. Fil the transient finite difference equation for this node. Grid point spaci~ and all equal to Ax and there is no generation within the material.

Solution: The volume of material associated with the node 0 (AX) x ( ~ ~ 1 2 ) = nx2/2 . Energy is conducted into with nodes 1 and 3 and energy is also received because of the grinding operatio

Fig 17 Node receiving mechanical energy from grinding machines. /

Applying the energy balance equation

Page 110: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Dividing energy term by k L and using M = (w2 a h

Gives TI-To+ T2-To + 2T3-2To + 2 M x = (ToAT-To) M K

Finally solving for ToAT gives

3.7.0 PROBLEM 10.0 A fluid at known temperature Tf and with s surface coefficient of heat transfer Hf between itself and the surface in -&e neighborhood of node 0 flows along the surface. Derive the alevant transient finite difference equation for node 0 (see diagram

i- below)

b 5

isolution: ,

I The volume of material associated Fluid at Tf, hf

/*th node 0 ' i s 3/4 AxAy and , wplying the energy balance equation &I this control volume, ! fhis results: ; f . b y T -T + KAy(T,-To) kAx :

h Ax 2 AX , STz-To) + W(T,-To) + h, &+Ax)

AY .., 3 *

2 AY 2 7-

(TtTo) = PC, AXAy ( ~ % f -T,) . . (107) AT Fig 17 Inside Corner Node.

Page 111: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Dividing by KAxAy leads to 1

(T~-TO) +~T I -T~ ) + 1-1 + &.iCcn)+ hf (-1 (Tf-TO)

Ax2 2Ax2 Ay2 2 ~ ~ 2 2 k AXAY

= 3/4& (ToA5-To) AT

Dividing by k/2 and using M= (AX) '/HAT g i ves

bf ( A ~ + A,) (Tf - To) = 3 PC, (To AT -T,) ............... (108) 2k A X A ~ 4 At

Note: Problems involving finite difference formulation, usually involve n nodes, some of them interior, some non-interior. The Engineer should, based on these nodes set up n algebraic equations on these n (interior + non-interior) nodes - interior equation like equation (101), non-interior equation like equation (1 O4), (1 05), (1 06), (1 08) and (1 09). since all the nodal temperatures are known at time t = 0 , this is the initial condition and these known temperatures can be seen as the

, present temperatures at the nodes and put into the right sides of the equations (loo), (104) and (109) to calculate temperatures at each node point after one time increment At. To do this, using the derived transient finite difference equations, a set of n simultaneous equations is not solved. Rather each is solved individually for the temperature at each node. For example. if in a problem the generation rate per unit volume is zero and at time zero. the temperatures at the various nodes are T, = 500°F, t = To = T2 = T, = T, = T, = T, = T, =T8 = 100°F, and M is chosen to be 10 for this two dimensional conduction region. To calculate the temperature 1 At has passed. The relevant transient finite

/ difference equation is equation (100) with q,"' = 0.

Page 112: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Putting values T/ = l ( 5 0 0 + 100 + 100 + 100 ) + (1 - 4) 100 = 1 40°F 10 10

Hence each of the equation in the set is solved one at a time for the nodal temperature after one At has passed. After all the nodal temperature at 1At have been computed, these temperature are used in the right hand side, for example 8 equations (loo), (101), (104), (105), (106), (107), (1 08) and (109) to determine the temperature on the left side at each node after two time increment 201 has passed. This procedure is repeated until the steady state or the time ofincrement is reached.

3.8.0 PROBLEM 11.0 A conduction is such that the top is immersed in a fluid at Tf , hf and the sides are perfectly insulated, determine the transient finite difference equation for the corner node s h o p in the diagram below. The spacing is Ax between the adjacent nodes.

Fig 18 Comer Node ' I KAx (Tz - TI) + K AX (TI - To) + hf (Tf - To) + qo"' &)'

*, "

2 AX 2 AX 2 4

= PC, &)' T/ - To - 4 AT

Solution Fluid at Tf. hf

0 1 The material with comer node zero is of I a

volume (O>o x (OX) = (&) ' and 2 2

/ 4 /

applying equation (64) to this control /, volume of material and realisng that energy is conducted in from node 2 and 1 and /

convected in from the fluid. I /

I I I

------A

2 3

1

Page 113: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Dividing by kt2 and using M = w2 gives CCAL

T2 - To + TI - To + h f 4 x (Tf - To) + gQrfr AX)^ = M ( T F - To) K k 2 2

Now dividing by W2 and rearranging gi\tsrs L

3.8 STABILITY OF THE FINITE DIFFERENCE . . EQUATION:

In the aforementioned, it appears that complicated transient

1 problems are solved by the finite difference method by selecting a

lattice spacing AX which determines the number and location of all the

nodes and yields a set of equations like (101), (104), (l05), and so on.

Once a finite time material A t , is chosen, My can be calculated using

the formula

M= o2 =AT

It must be noted that M cannot be assigned any value arbitrarily or some laws of thermodynamics will be contravened.. For example, for the equation (100) based on fig 13 , assuming that the generation rate per unit volume is zero, at a certain time t, the temperature at an interior

Page 114: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

node o and the four surrounding nodes are To = 200°F, TI = 1 BO'F, Tz =

150'~, Tj = 1 ~o 'F , T4 = 120 '~ and the temperature at node 0 at time t + At must be determined using M=2 fixed arbitrarily. Substituting in the equation (100) putting generation rate per unit volume equal zero equation (1 00) becomes ToAT = 2 (T,+T,+T,+T,) + (1-*T,

M M Substituting the known temperature at the present time t and the arbitrarily assumed M value,

T F =2 (180+150+130+120)200 = 9 0 ' ~ 2

Thus node 0 is at 9 0 ' ~ which is physically impossible since it is lower

than any of the temperatures of the surrounding nodes. Considering the

situation in detail, this means that energy has to be conducted to a

higher temperature which is a clean violation of the Clausius statement

of the second law of thermodynamics.

If the transient temperatures are calculated with values of M, that is 2,

that violated the second law of thermodynamics, and the result at the

various nodes plotted against 0, l i t , 2At , 3 A t , etc, the iodal

temperatures will oscillate with increasing amplitude as time goes on,

as follows (see fig 19) . I

Page 115: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Fig 19 - Unstable and Stable formulations

Stable transient finite difference equations are preferable. For these solutions to be stable there must be restriction on the values of M. this restriction is referred to as STABILITY CRITERION.

Mathematically, numerical error arithmetic errqr,

a set of finite difference equations is unstable if due perhaps to round - off of a number or to a introduced at some point ir. time, amplifies as tim

goes on'even though no further error of any type are made. If th numerical error introduced remains the same or decays as time goes o the finite difference equation set is said to be mathematically stablc

Lei 1 4 3 1 u.i

For stability analysis s refer to Numerical solution of partial differential' equations). New York, Oxford Univ. Press, 1965).

Page 116: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

For the present purpose the stability criterion used is that a negative coefficient of TO on the right hand side of equation of the type in equation (1 00) is what causes the instability.

Hence if negative coefficients of To are not allowed. the stability criterion for the finite difference equation becomes the following:

For 3 - dimensional, equispaced lattice, interior node. equation (99) requires that,

M> 6 . . . . . . . . . . . (1 10) For 2 - dimensional, equispaced lattice, interior nodes equation (1 00) requires that

For 1 - dimensional case

't M> 2 . . . . . . . . . . . (1 12)

Thus the stability criterion used here states that when the transient finite dicference equation is arranged so that the temperature of the node of interest is on a side by itself with a unity coefficient, then the coefficient of the temperature of the node of interest at the present time on the other side of the equation should not be negative. This statement must be true for all nodes, not just the interior nodes for which equation (I 10) to (1 12) apply.

3.7.1 STABILITY ANALYSIS: (1) Stability is necessary if the solution to the transient finite

difference equation is to be physically reasonable. In transient conduction problem, generally a lattice spacing A x is first chosen which is usually dictated by some

Page 117: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

I compromise between accuracy which increases with decreasing Ax and time and effort expended, which also increase with decreasing A x . After Ax is chosen, AT cannot be selected arbitrarily but rather must be chosen so that the inequality in M is satisfied. For example, if a two - dimensional conduction region has only nodes and an equispaced lattice,M , must satisfy the criterion M 2 4

But since M = (AX) 2 / a ~ ~ ,

o r AT

4a Once the lattice spacing is chosen along with the thermal diffussivity, a, the stability criterion fixes, the largest size time increment that can be used.. The time increment should be large because this reduces the

\ number of times that the equation set must be solved to obtain the nodal temperature at various times. On the other hand a small time increment AT increases the accuracy of the solution. Hence a compromise must again be effected, this time subject to the limitation on the size of AT imposed by the stability criterion.

It was shown that a surface node has a more restrictive stability I

criterion than does an interior node, thus for surface node, from equation (l04), stability criterion is

1 - 4+2N> 0 , M

Or M 1 4 + 2N. . . . . . . . . . . . . . . . . . . .. .(113) Thus larger value of M is required in the surface nodes than in the interior nodes, since

Page 118: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

N = hAx/ k is inherently positive.

Also the amount of material associated with surface nodes is smaller than that for interior node - this is where the factor of 2 comes in the expression, equation (1 13). Hence a problem involving, say 50 interior nodes and perhaps 4 and 5 surface nodes will force the use of a smaller value of At that might be preferred. The resources are available if it is desired to use the largest AT which the interior nodes alone would albw.

(i) The storage term at the surface nodes can be neglected so that : there is no stability criterion associated with them. For example,

for the surface nodes, fig 14, equation 105a is applicable, thus

K~x(T,-To) + &(T2-To) + kax(T,-T0) + h o ~ ~ ( T , - T 0 ) Ax 2 Ax 2 AX

+qoiii (AX) = PC, (ax) (T/-T~) T 2 2 At

I .

If the storage term at this node is neglected, the right hand side of the quation is zero and the equation for the temperature of node zero becomes

with after rearrangement

To = T3+T1/2 + T2/2 + ( h,Ax/ k) T, + (qni ' / k ) (AX) 1 2 , t 2 + hoax/ k) 1 No@ that neglecting the storage term at these surface nodes reduces the i accuracy of the entire approximation, especially in the vicinity of the

surface nodes whose energy storage terms were neglected. 9. I

Page 119: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

( i i ) The governing transient finite d i l f rence equations are derived in a different manner.

Referring to equation (92), the future temperature at all the nodes TIA', TI^', etc as well as ToA', instead of the present temperature are used to arrive at the finite difference equation for a two - dinlensional, equispaced lattice, interior nodes as

If the previous stability requirement is applied to (1 13)c, the coefficient of To on the right is always positive, regardless of the value of M and the equation is said to be unconditionally stable.

Hence if the transient finite difference equation are of the form equation (1 13), the time and space increments AT and Ax can be chosen arbitrarily, but this complete relaxation of the stability criterion for equation (1 13) is not gained without an increase in the effort involved in solving for the temperature at the nodal points. Note that equation (1 13) unlike equation (loo), for example is not explicit in ToAT alone: it also contains the unknown temperature of the surrounding nodes 1,2,3 and 4 at the future time. Hence equation (1 13) is called an IMPLICIT equation and if implicit equations are used, the entire set of equations for the nodal temperature at the future time must be solved simultaneously at every time increment

3.8.2 CONSISTENCY AND CONVERGENCY

The finite difference approximation is consistent if as the lattice spacing, Ax. Ay become smaller, the truncation error (local

Page 120: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

decretization error) tcnds to diminish and the finite difference approximation tends to the true solution: The higher the order of the error in a formulation or approximation. the more consistent is the formulation.

The truncation error from forward difference is Ef = O(Ax), order 1, From backward difference

Eb = O(Ax) order 1, And for central difference E, = AX)^ order 2 . . . .

(see equations 25,30 and 34)

Consistency of finite difference method increases with the order of the error. therefore for consistency the order of error must be greater than zero, hence

E = O(AX)' leads to inconsistent approximation E = O(AX)' leads to consistent approximation E = AX)' leads to consistent approximation

- CONVERGENCE to the exact solution of the differential equation

is a desirable feature in any method of solution of differential

equation. This means that as the method is continually refined

(more and more terms of a series being used, or smaller grid

spacings, Ax. being used. that is smaller and smaller intervals. h.

between successive arguments the sequence approximate solutions

obtained must converge to the exact solution.

107

Page 121: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

For example use Table 1 below. with decreasing grid spacing, Ax,

method converges to the exact solution.

Table 1 - Illustration of Convergency

3.8.2.1 Convergence Analysis:

X (Nodal points)

If El is the error incurred in the finite difference solution at node 1 and El = Fl -fl . . . . . . .. . . (1 14)

Where FI = exact solution at point 1 f l = finite difference solution at point 1

A finite difference solution programme converges if the error,, tend to zero as the grid spacing, Ax and time interval or increment (in unsteady condition) tend to zero. At that point, FI .f , that is the approximate solution tends to the exact solution.

3.8.2.2 FINITE DIFFERENCE OPERATOR NOTATION

Ax = -10

(1) A = forward difference operator of input functions are Y k , Ya+l , Y ~ + z . . . (115)

then

Exact Solution Ax = 0.05 Ax =0.01

Page 122: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

These are one - time operation with

Generally I n- l ............... I anyk = an-ly~+ 1 - A yl; (1 17) ' This follows from the difference Table showing : i

1 Each difference proves to be a combination of the y values in column / . two, for example I

/ 109

Page 123: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

A3yo = y3 - 3): + ;! I - yo. Note that = AZy - AZyO and so on. , k

Or generally Aky0= Z ( - 1 i k + . . . (118) i =O I

where (k) is a binomial coefficient = k! 1 i !(k - i ) !

As an exercise substitute A with E (that is error) with all the above. Below is the complete difference table involving values on the negative axes.

Table of forward Differences

Y -2

v..

Table of backward Differences

Table of central Differences

A = Forward difference operator as illustrated in ( 1 15) V = Backward difference operator

v Y h = Yh -- Y h - I ................ (119) c? = central difference operator

Page 124: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

E = displacement operator . Eyk = y ~ + 1 (displacing y, one unit forward) ............... ( 12 1 )

and (i) A = E - 1 = f m a r d difference operator (ii) V = 1 - E" = backward difference operator (iii) a = E" - E-" = central difference operator .. .(122) and E - ' ~ ~ + I = yk ................... (1 23)

p = averaging operator, defined as pYk=Yk+I/I +Yk-1/2 ................... (I24)

2 E - operator and Taylor's Expansiontheorem:

Taylor's expansion of f(x + Ax) = f(x) + fl(x)(Ax) + f'(x)(Ax)* 1 ! 2 !

.. But Ef(x) = f(x + Ax) that is displacing f(x) to f(x + Ax). (125)

If the differential operator, D is defined thus Df = - df then equation (125) becomes

dx

........ Ef(x) = f (x + Ax) = (1 + AxD + - AX* D* ........) f(x) (126) 3 1

Therefore E = exp (AxD) ................. (127)

Considering equation (122) respectively and equation (1 27) this results Ax. Dye= [ L n (1 + A)]

Expanding the logarithm in series

111

Page 125: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

t

When Ax is very small the formula converges rapidly. Equation (128) is based on forward differences formulation, equation (122i). Using the backward difference method, equation (122ii), this results

on expansion

D.yo= 1 [ V + % v2 + 113 v3lyO ............. - (130) Ax

Using the central difference method and noting equation

(127) E" = exp (Ax.D) .............. (131) 2

\

I but d = E" - E-" from equation (1 22 iii)

therefore

d = exp [Ax.D) - exp ~AXD) .............. (132) 2 2

thus

= 2 sinh (Ax.D) .............. (1 33) 2 ,

and Ax.D = 2 s i n h - ' 0 ) ................ (134) 2

Page 126: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

The right hand side is expanded thus

A useful finite difference formula for approximating differential equation can be obtained by squaring equation (1 35) hence

8 , d4, d6 are evaluated from central difference table

other useful expression relation powers of D with 6 and using Taylor's expansion are as follows

00

eKD = exp (KD) = c K~D'A i =O

Page 127: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Having discussed operators in finite difference analysis. the discussion I continues from equation ( I 14)

Early workers have shown that if in the finite difference solution. the generating tenn q can be replaced with the truncation error. R i at node 1.

for the solution of equation (1 38) at node i. d'f -- q'l' (*) = 0 ........ dx' ( 138)

....... Discretizing (1 38). f,&, - 2 f I+, + f;+l = 0 (1 39) (!AX) '

Replacing qlll by the negative of the truncation error, ,

-RI equation (1 39) becomes ....... El+I -2E1 +E I+l + R I = 0.. ( 1 40)

(AX> Refer to equation (1 16). hencc

\ ....... A?E,= A(A E l ) = Ei,! -2E,+ El-1 (141)

Therefore equation ( 140) becomes

or nriti~lg 1 A'E, + R, = 0. . ......... .(142) ( A\ 1:

For d 2 t ' - d f - q = O ...................... (1 43) 2 du

Finite difference equation of the above is

Page 128: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Using the concept applied to ( 110) Enl -2E"i +En , + I -~i"'l -Ein + Ri = 0 ........ (145)

Ax At Ri results from the discretization in time and discretizatjon in space errors.

It is difficult to investigate stability using the above approach because of the form of the truncation error teqn. Stability has been found to be a necessary and suf'ficient '

condition fdr cohvergence especially 'for linear differential equation.

3.8.2.3 Further statrilib analysis: If we define f ln as the solution

fin* =solution through finite difference including discretization and round off errors

f in = solution through finite difference including only discretisation errors.

The total error at point i will be given as expressed as

EnT, = FIn - fin* .......................... (146) ='(F," - 2") + (in - f,"*) .............. (147) Discretization Round off error error.

The Round off error had been shown to be smaller than the discretization error. Equation of (146) and (147) give the error at Erln

....... point 1 at time level n (or n AT) where n = 0, 1. 2. 115

Page 129: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Total error at point 1 or i and time level (n + 1) AT E ."+I = ~ ~ " 1 - fi("+l)* ............... TI (148)

Mathematically the stability criterion is expressed thus

ET~"+' I 1 ........a.e.. (149) F

This shows that the error will decay with time on the contrary if ETln" > 1, the solution is unstable and the error grows E T ~ ~ with time (see fig. 19)

NEUMANN (FOURIER SERIES) ANALYSIS FOR INVESTIGATING STABILITY

This method is based on the fact that

0 ) The error term satisfies the finite difference equation with the truncation error replacing the source terms

(ii) This initial error in the finite difference approximation may be expressed as a finite Fourier series.

Using the Finite Fourier series, a continuous function f(x) can be

N

.............. f(x) = C an cos (Q) n=O L

(150)

N

or f(x) = C bn sin (m) .............. n=O L

(151)

Page 130: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

But el0 = cos 0 + isin 0 (De'Moivre's theorem) thus generally

N

f(x) = C An e l n x d ~ .............. n=O

(1 52)

inxx = 0 and i = 5 expressing the error in the formulation at point P in Fourier series

N

Ep = C Ane 1nnpAxlL .............. n=O

(153)

Pis 1 ,2 ,3 ............................... Equation (1 53) can be written thus

N

Where Bn = nx

As the error are additive, the error can be expressed simply as

This error term is only space dependent, in the time domain, the criterion for stability should be

pp = eiB pAr e= t , n

eiB P Ax and Enp = An n ,

ee" n A t ..... ..(156)

................ where n = 0, 1, 2,

Essentially equation (1 56) can be written thus Enp = enp = e I B n PAX En .................. (157)

117

Page 131: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

~vhere E is amplification fiittor thus E = e x A t .................... I (1 58)

If the solution were to be stable, the error must not show with time in which case ' E l 5 1 that is aAt = 5 0

Examples:

1 . Examine the stability for the implicit finite difference formulation of the differential equation azf =af - ax2 at

Discretizing

Defining a = & and equation (1 60) becomes Ax2

and error analysis for stability becomes

Page 132: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

I H p l \ but Enp = e n En see.equatibn (1 57) I

therefore equation (1 62) becomes

= i B pbx i B pAs ............................ e n E"+' - e , .En (163)

i B pAx Dividing (1 63) by e , En gives

i B (p - ')AX - LB pAx .En+I-n - 2 e ~ B pbx - IB pAx n n n En+'-"

I B Ax .............. . a[ eCiBnAX .E 2E + e E] = E - 1 ( 1 64)

I B Ax ~ u t cosh B,AX = e + e - 2

I R ju + e - ~ B A \ that is 2 cosh BnAx = e ,, ,, ....... (165)

Putting (1 64) into (1 65) we have

I B Ax E + e .E - 2 d = ~ - 1 , i.e

.............................. a [2.E cosh BnAx - 2@ = E - 1 (166)

and 2 a E [cosh BnAx - 11 = E - 1

Page 133: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

But 1 - cosh2 z = 2 sinh2 2 2

that is

thus .................. E = 1 (168)

1 +4 a sinh2 BnAx 2

The right hand side of equation (168) is always less than 1, therefore

/ E/ l 1 always

Thus the finite difference solution of the difference equation 8 f = af is unconditionally stable - dx2 at

ii. Establish the stability criterion for the implicit formulation to be used in solving the equation - - uac = a c ' I

dx at

Solving Discretizin F -U c"+ - Gin+' = ci"+l - cjn

I + 1

Ax At

Page 134: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Equation (1 69) bccomes -hen+' + ( A - l ) c i n f ' = - C , " ..................

I + 1 (171)

The error satisfies equation ( 171)

Substituting (167) into (1 72). the resulting equation is _he i Bn(p + I )Ax n+l - ( A - l ) e i B n ~ A x En+' = e i B PAX E"

i B pAx Dividing withe En

solving

. .. For stability

/ E l < 1

implying that the right hand side of (1 73) should be less or ... equal to 1

thus ................... /(A- I ) + h e i B n p A x / 2 1 (174)

Using De Moivres equation eie = Cose + sine

equation (1 74) becomes ................ l ( h - l ) + h c o s ~ + i h s i n 6 / 2 1 ( 175)

12 1

Page 135: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

where 8 = B,Ax 1

+ if z = x + iy = complex variable

l z l = ~ and equation (1 75) becomes

( (1-h)+hcose 124 sine 1 2 2 1 ......... (176)

because (1-1 ) is also real

By trigonometrical identities and algebraic manipulations Equation (1 76) becomes

. But (1 - cos0) is greater than or equal to zero al,ways, therefore the stability criterion becomes

I h ( h - 1) LO ................................. (177)

This equation will always be satisfied if 1 2 1 o r h l 0

but h = U At ..................... 7 (178) Ax

, At and Ax are always positive but U can be negative depending ' on the flow or conduction direction. (U is the velocity)

For positive flow velocity the conduction is in the direction of increasing node points. that is downstream weighting, in which case

Page 136: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

U At 2 1 .T his is conditional stability - Ax

For negative flow velocity, the conduction is in the direction of decreasing grid points or nodes - upstream weighting in which case, u is negative and h = - U At I 0 always. This is unconditional stability -

Ax

There is also the matrix method of investigating stability, discussed elsewhere, referred to previously in this book.

Example A corner grid point (node) transfers heat by convection to a fluid at temperature T, but with two different surface coefficients of heat transfer he and he as a result of the different orientation of the exposed faces of the node. The node also absorbs on its upper face, radiant energy at the rate q"' Wlhr. m2 and there is no generation. Derive the finite difference equation appropriate to node 0 and determine its stability criterion

Solution: An energy balance is made on the material associated with node 0. From fig 20 it is seen that the volume of the material is AX)*/^ and from equation (64) leads to '\

I I (T, - To) + qo & = P c, & c ) ~ (~2''- To)/Ar 2 4

Page 137: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

a = diffussivitity

Dividing every term by kl2 and using M = ( ~ x ) * / o c ~ r

Fluid Nf = hf Axlk at TI -To-T2-To+Ne (Te-To)

or finally, rearranging and solving for T, TO*' = 2_CTTI+T2) + me+ Nf)Te + 2 q," + l- 4 + 2 me + N ~ F ~

M M -- M k [ M

The stability criterion can be written down directly from the equation in the form below provided the coefficient of To on the right hand side is never negative

Example: Derive the stability criterion for equation (108)

Stated below:

T4-To + (T3-To) + (T2-To) + (TI -To) + hf (Ay+Ax) (Tt-To) - AX^ AY' 2 ~ ~ ' 2k AxAy

- IT - 3 pc, (Ti -To) . . . . . . . . . . . . . . . . . . . . . . . . . . . ( 108)

4 AT 124

Page 138: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Rearranging to make TO'" the subject of the formula and expanding

-To 1 +I +I+ 1 + h f A ~ + A X ] [z 2 ~ 2 ?$ k AxAy

Dividing all through by % P AT) gives

T o A T = 4 A ~ Tq + T3 + T2 + TI + hf Ay + Ax T9 3 p ~ , ' ~ %? @ AxAy

- 4At 3 + 3 + hf Ay + AX To - 3pCp 2 2 2k AxAy 1

For stability, the coefficient of To must be greater thansr equal to zero, for stability therefore

Thus for a given material, once the lattice spacing Ax and Ay are dosen, the above inequality can be splved for the largest time increment that can be used with the stability of equation 108 insured.

Page 139: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Exercises

1. Consider node 0 near the curve boundary shown in fig 21. Using a two dimensional equispaced lattice.'derive the finite difference equation for node 0

Fluid at T, h,

Fig 2 1 The node at the Curved boundary

2. A 1 metre thick slab of wood initially at 8 0 ' ~ is

accidentally left behind in a large heat treating oven

where it is subjected to 1500 '~ gases with an average

surface coefficient of heat transfer of 5wlh.r-m2 OF 1 .between the wood surface and the air. If the ignition '

i

temperature of the wood is 700°F, determine the time I

between initial exposure and possible ignition. Assume

K = 0.30 wlhr-ft"~. p = 50 kg/m3 and c, = 0.60 ~1kg 'F .

Page 140: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

3. A large 2-cm thick slab of brick-like material is to be

used as the floor of a large high temperature oven. The

bottom side of this slab is essentially insulated.

When the oven is turned on, the upper face of the slab is

exposed to 3000'~ gases and the surface coefficient of

heat transfer h is 6WIhr -m2 OF. Since the oven is not to

be used until all surfaces are at least 2800°F, calculate

the time required for the floor to meet this condition.

The initial temperature of the slab is ~ o O F , ac = 0.02

M2/hr and K = 2.0 Wlhr. MOF

Page 141: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

CHAPTER FOUR

FINITE ELEMENT METHOD (FEM)

4.0 INTRODUCTION Finite ~ l e m e n t Method is a technique for solving the differential equations of physics and engineering. The method is being profusely used in the aerospace industry. It has application Structural and solid mechanics. In structural problem) the method gives, rise tocLset of linear equilibrium

? equations by minimizing the potential energy of the system. Combining finite element method with a minimization

; procedure'2k8?o its use in other engineering, areas, Laplace or the ~oissons'e~uation are closely related to the minimization of a function, thus the method had been applied to these equations.

4.1 FUNDAMENTAL CONCEPT OF FEM FEM is based on the fact that any continuous quantity such as temperature, pressure, or displacements, can be approximated by a discrete model composed of set of piecewise continuous functions defined over a finite number of subdomains. The piecewise continuous function, known or unknown are defined using the values of the continuous quantity at a finite number of points or nodes in its domain. Recall the grid system in the finite difference method, previously discussed. /

4.2 THE DISCRETE MODEL" The model is constructed as follows:

1) The finite number of points in the domain is identified. These points are called nodal points or nodes.

Page 142: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

ii)

iii)

iv)

The value of the continuous quantity at each nodal point is denoted as a variable which is to be determined.

The domain is divided into a finite number of subdomains called elements. These elements are connected at common nodal points and collectively approximate the shape of the domain

The continuous quantity is approximated over each element by a polynomial that is defined using the nodal values of the continuous quantity.

A different polynomial is selected in such a way that continuity is maintained along the element boundaries

Illustration: The temperature distribution in a fin along x - direction is shown below

Fig 22: Temperature distribution in one dimensional fin

Page 143: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Fig 23: Nodal points and the assumed values of T(x)

Page 144: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Fig 24: Division of the domain into elements

The final approximation, of the continuous quantity, T(x) would consist of four piecewise continuous linear function!each defined over a single element,

Fig 25

T L- -

Page 145: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

1 Fig 25 Discrete nodes for the one-dimensional

Temperature distribution

If the domain is divided into two dimensions, the element function becomes a quadrative equation. The final approximation in this case will be two piecewise continuous quadrative functions.

In most cases, the temperature distribution is not known and it is required that values of the temperature be determined at certain points. The nodes are located as usual with unknown temperature indicated along the material like fig 23 - 25

that is T1, Tz, Tj, T4, T5 which are variables. The domain or material is divided into elements and a temperature equation 'defined over each element. The nodal values of T(x) must now be "adjusted' so that they provided the "best" approximation possible to the true temperature distribution.

This adjustment is accomplished by minimizing some quantity associated with the physical problem. A functional related to

132

Page 146: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

the governing differential equation is minimized when considering heat transfer problem. The minimization, process produces a set of linear algebraic equation that can be solved for the nodal values of T(x).

4.3 ELEMENTS IN 2 - or 3 - DIMENSYIONAL , ,. , .. DOMAIN & .

X : 'I ' 1 > ~ k i f C . *'

Fig 26 Modeling of a two dimensional scalar function. Using triangular or quadrilateral elements.

In two dimensional domain, the element function can be a plane surface like in fig 26 or a curved surface. The plane is associated with the minimum numbepof element nodes which is three for a triangle and four for a quadrilateral.

Page 147: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

The final approxin~ation to a two-dimensional continuous function 0 (x, y) is a piecewise continuous collection of surfaces each defined over an element using the value of 0 (x,t) at nodal points. FEM requires profuse use for computer programmes and computer facilities.

4.4 Scope of FEM The basic conceptual aspect of FEM are briefly outlined.

I) Discretization of the region, defining the nodal points and the elements

ii) Defining the elements function for a single element

iii) Combination of the element functions to obtain a piecewise continuous function for the entire region.

iv) Calculation of the system of equation using the minimization of a functional related to the physical problem.

v) Calculation of the element resultant

Discretization of a region

2 - dimensional finite elements 134

Page 148: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

3 - dimensional finite elements z

Axisymmetric finite Element, generated by revolving the triangle

through 360'. Fig 27 Discretization of a domain

135

Page 149: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

1.5.1 DIVISION OF THE DOMAIN INTO ELEMENTS For a triangular region. equal number of nodes are specified on each side-of the triangle and then connecting the appropriate nodes by straight lines and placing nodes at the intersection points.

Fig 28: Division of triangular region into linear triangular elements

There are (n-I)* triangular elements in a triangular region where n is the number of nodes on a side.

The quadrilateral is easily divided into elements by connecting thc

nodes on opposite sides. The intersection of the lines defines thc

interior nodal points. The interior quadrilaterals can be left as eleinen

or they may be divided into triangular elements by inserting thc

shortest diagonal which is preferable because elements of equilatera

shape produce more accurate results.

Page 150: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

In division of region into elements note

i) The spacing should be varied along the edges of the . quadrilaterial in order to have smaller elements in the vicinity of the curved boundary.

ii) A regular mesh or grid, all elements being the same size and

shape is not usually practical in FEM because of stress

concentrations, temperature gradients, concentration gradients

etc. The ability to vary the element size is an important

advantage of FEM

iii) In solid mechanics problem, it is necessary to designate those

nodes that have specified displacements. The symbol for a pin

connection is attached to nodes that have no freedom to move.

A roller is used when the node can move in the direction of one

component but not the other

137

Page 151: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

(a) (b) Fig 30 Nodes with fixed displacements or a single displacement in vertical direction

4.6 LABELLING OF THE NODES"

The nodes should be numbered such that it will influence the computational efficiency associated with obtaining a solution. The set of linear equation which arises when using the FEM has a large number of coefficients which are zero. A listing of the equations show that all non-zero values and some zero values fall between two lines which can be constructed parallel to the main diagonal. The distance for the diagonal to the line is called the band width. All coefficients outside of the band width are zero and they do not have to be stored in the computer. A reduction of the band width produces a reduction in the required computer memory space plus a reduction in the computation time.

The band width B = (R+l) NDOF . . . ... .. . . . .. . . (178)

where R is the largest difference between the node numbers in a single element (all elements are considered in its determination)\

Page 152: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

and NDOF is the number of known (degrees of freedom Dot.') at each node. The minimization of B depends on the minimization of R. which can be accomplished by labelling the nodes across the shortest length of the body.

B

Fig 3 1 : Node numbering for a two dimensional body (two examples)

+~andwdth + /" 7

C C C 0 C'..O 0 0 0 C C C C C 6...0 O O c c c c 0 c e.0 0 0 C C C C C C c'...o c c 0 c c c c o i. O'.C C C C C C C C 0 0'.\(3 C C C C C 0 0 0 O'...C 0 C C C C o b o &..c c o c l c 'L /

Fig 32: The band width for a system of equation. f. denotes a non-zero coefficient ,

139

Page 153: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

4.7 LINEAR INTER-POLATION POLYNOMIALS:

The most popular form of the element function is a polynomial.

Finite elements can be classified into three groups; viz

Simplex, complex and multiplex, according to Oden, 1972

The simplex element has an approximating polynomial that consists of the constant tern1 plus the linear terms. The number of coefficients in the polynon~ial is equal to the dimension of the coordinate space plus one, thus the polynomial.

is the simplex function for the two-dimensional triangular element. The polynomial is linear in x and y and contain three coefficient because the triangle has three nodes

is a complex triangular element interpolating polynomial, it consists of the constant and linear tern1 plus second, third and higher order terms as they are needed. In complex elements the number of nodes is greater than one plus the dimension of the coordinate space this is difference from the simplex element.

4.7.1 One Dimensional Simplex element This element is a line segment with length. L and two nodes at each end. The nodes are denoted by i and j and the nodal values by 4, and @,. The origin of the coordinate system is outside the element.

140

Page 154: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

The polynomial function for a scalar quantity denoted by + is

Fig 3 3 one dimensional simplex method

The coefficient cr I and x 2 can be determined by using the nodal conditions

The nodal conditions result in the pair of equation $ i = X I + ~ 2 x i

$ i = K I + ~ 2 x j Thus solving

Page 155: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Q denotes quantity

Substituting for $ in interpolating polynomial or the finite element formulation (as will be seen later), equation (1 81) becomes

Which can be rearranged into

Note equation (1 8 1 ) is a linear interpolating polynomial. The linear . function of x in equation ( 1 83) are called shape functions or

interpolating function and they are denoted by N, and arbitrary shape function by NB

Thus

And equation ( 1 83) becomes, using matrix notation, $ = N $ I + N , # , = N $

. whereN = N l N, isarow matrix and$

a column vector

Examination of equation (3.5) indicates that

Page 156: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

N , = (X , - x)/L has a value of one at node i and zero at node j. Likewise N , is zero at node i and is one at node j. These values are characteristic of shape functions. They are equal to unity at one node and zero at each of the others.

EXAMPLE

One dimensional simplex element has been used to approximate the temperature distribution within a fin. The solution indicates that the temperature at nodes i and j are 120°C and 90°C respectively. Determine the temperature at a point 4cm from the origin and the temperature gradient within the element. Nodes i and j are located at 1.5 and 6cm from the origin

Fig 34 The temperature. t, within the element is given by

A Solution:

Temperature

TI = 1 2 0 ' ~

, = 9Oc

a I - X, = 1 .krn x; = ecm

Page 157: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

The available element data are I

X, = 1.5cn1, T, = 120°C X, = 6.0cm. TJ = 90°C x = 4.0cm, L = w , - x, = 4.5cin

Substitution yields

t = 2(120) + 2.5(90) = 53.3 + 50 = 103.33"C 4.5 4.5

The temperature gradient is given by dt - = - - 1 T , + l T, = J ( T J - T , ) dx L L L

4.7.2 Two Dimensional Simplex Element

Two dimensional simplex method is the triangle shown below.

This element has straight sides and three nodes, one at each end.

A consistent labelling of the nodes is a necessity and the

labelling is n~ostly done counter clockwise from node i, wlnch

is arbitrary specified. The nodal values of the scalar quantit 4

and are denoted by $,, $J and $I, but the coordinate pairs of the

three nodes ere (XI, y,). X,, yJ) and (xh.yh)

Page 158: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Fig 35 The two-dimensional simplex Element

The interpolating polynomial is

with nodal conditions 4 = $i at X = Xi, Y = yi 4 = 4; at x =x;, y=Yj and 4 = $a at = xk. y = yk substituting of this into 4 = a, + ~ Z X + a3y (equation (185) produce the following system of equation

Page 159: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

yielding

, where A is the are of the triangle, ijk substituting values of K 1 , a 2 and oc into the interpolating polynomial ( x 1 + = 2 x + K 3 y = $) and rearranging produces an equation similar to the earlier equation. The element equation has three shape functions, one for each node.

where the determinant 1 X I y1 I x~ Y J 1 xhyh

....................... = 2A (187)

Page 160: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Note the symmetry of the above expression Evaluation of N, at node i procedures

but the terms within the bracket are the value of determinant in equation (1 87)

There Ni = 1 (2A) = 1 - 2A

at node i. It is an assignment to show that N, is zero at nodes two and three and at all points on the line passing through these nodes.

The scalar quantity, 4, is a function of set of shape function which are linear in x and y (note the nature of the shape functions, Nl, Nj and Nk they are, respectively linear in ac and y),.

1 . . , - . . A . ,

Thus the gradients of Nl, Nj, NL with respect to x or-y are respectively constant and 4 = NI4, + N,@J + N L $ ~ from (188). hence the gradient in the x - direction is

@ = dN,41 + dN,4, + d X 4 h dx dx dx dx

Page 161: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Ni = - 1 [ai + bix '+ ciy] write dowt~ espression for N, and Nk 2A

Similarly dNi = 1 bj = bi 7 - dx 2A 2A

Therefore 3 = - dNi 4i + 3 4 , + - dNk 4k dx dx dx dx

Since bi, bj and bk are constant they are fixed once the nodal coordinates are specified) and 4i 4, and 4k are independent of the space coordinates, the derivative has a constant value.

A constant gradient within any element means that many small elements could be used to approximate a rapid change in the value of 4.

Example: * Evaluate the' element equation and calculate the value of the

pressure at point B of the nodal values are P, = 40 ~ l c rn* ; P, =

34 N/cmZ' and Pk = 46 N/cm2. The coordinates of B on the x, y plane are (2, 1 S).

Page 162: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Fig 36

Solution The pressure, p, on the element I, j, k is given by

P = NIP, + NjPj + NkPh

where Ni = - 1 (a, + bix + c,y), N J - J = 1 (a + b,x + cJy), 2A 2A

from the expression for a,, bi. ci, a,, bj, cJ, a. bk, ck , ,

coordinate values of nodes are substituted;

Page 163: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Substituting the constant a, b, c into

, At point B, x = 2 y = 1.5

These values of x and y are substituted into the expression for pressure in order to determine the pressure at point B then P =1 [ (7) (40) + 7 (34) + 5 (46) ] = 39.37 ~ / c m ~

19

Note the characteristics of a triangular element Ti) 4 varies linearly between any two nodes that is, straight lines

connect two nodes (ii) Any line of constant 4 is a straight line and intersects two sides

of the element, unless all nodes have the small values.

Page 164: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Example: Find the 42 ~ / c ~ n ' contour lint ibr the triangular element used in the previous 1'rchlc.m

Solution P

p, = 31

Y

X

Fig 37

The pressure contour line for 42 Nlcm should cut sides ik and kj. As the pressure varies linearly along each of these sides, simple ratios can be set up.

For side jk Using the x - component

Similarly for y - component along jk

Page 165: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

and fro111 (192) 46 - 42 = 5 - Or y = 3.5 cm 46 - 34 5 0 . 5 ,

P

Similar ratios from side ik yields x = 213cm and y = 513cm

The contour line is shown i n fig 37.

4.7.3 THREE DIMENSIONAL SIMPLEX ELEMENTS This type of eleinent is a tetrahedron. 'The four nodes are labelled 1, j. k. 1 with 1, j. k in a counterclockwise sequence on one face and the node 1 at the apex opposite this face. The labelled tetrahedron is shown below :

Z

Fig 38: The three diniensional s ~ i i l p ~ ~ \ clement.

Page 166: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

The interpolating pol! no~nial for the tetrahedron is $ = % I + K ~ X + O C - ; ~ + q z ......... ( 193)

The coefficients can be determined by applying the four nodal conditions which produce this system of equations. 4, = Kl + K ? X I + %;Y, + Y-,1ZI

I+, = %'-I + K,X, + K;., + %,1%,

K l + x?xh + %;yL+ 3C4z~ ................ (194) $ I = E 1 + c c ~ X l + "3yl + ~ Z I

This system of equations can be solved by using Cramer's Rule. The procedure produces five determinants that must be evaluated. It is easier to let the computer perform the calculations. Starting with ( 1 94) and writing the equation in matrix fomt yields

($1 = [c] {K) .................... (195)

The coefficie'nt matrix { K ) can be obtained by evaluating the inverse of [c] and premultiplying ( I 95) by [c]" yielding

and (c) = I XI y, Zl

I X,YI"l

1 xl, y,, zl, 1 XI yl Zl

..................... ( 197) \

Page 167: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Substitution of ( 1 96) gi\.es

$ = [ I X J Z] [c]" to) ........................ ( 199) The determinant of [c] is equal to six the volume of the tetrahedron

4.7.4 INTER POLATION FOR VECTOR QUANTITIES Unlike the scalar quantity, vector quantity has both magnitude and direction, therefor there is generally more than one unknown (degree of freedom) at a node. The usual procedure is to resolve the vector into components and treat these components as the known quantities. The node has either one, two or three degrees of freedom. depending on whether the problem is one, two or three dimensional. Fig 39: Nodal vector quantities

H x (a) one dimensional 1 i

Page 168: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

All components have the same symbol. u. il subscript is used to denote the individual components. The subscripts are ordered in an x. y. z coordinate direction.

The lo\ver case letter u. v. and w are used to denote general equation for the displacements in the x. y and z directions. I he representation of the vector quantity for a one dimensional problem is identical to the scalar relationship. since there i,s only one unknown at each node. $ a

Where U, is the displacement parallel to the element x. The shape functions are identical to those used in

In simplex triangle, the vector quantities are expressed thus U = NIU21. 1 + NIUZI I + NLUIh I ............. (201)

which is the approximation of the horizontal displacements, u. The vertical component, v is represented thus

............. v = N,U?I + N,U?, + NLU,, (202) writing three components in terms of nodal values The horizontal component u; (vertical component is zero) equals U = N,IJ,, , + OU,, +N,U,, , + OU,, + N,U,, , + OU,,

and the bertical component follows (horizontal component is zero) \ = OU?, I +N,U,l + OU,,., + NIU,, + OU,.lh + NAU,L In matrix form;

155

Page 169: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

The shape functions in equation ( 188).

I:::: J . . . . . . (202)

111 equation (202) are the same with those

Expanding this procedure to three dimensions (tetrahedral). the following system of equation results:

4.7.5 LOCAL COORDINATE SYSTEM The determination of the system of equation for the nodal values'involves the integration of the shape functions or their derivatives or both over the elenient and this integration i s easier to evaluate when the interpolation equation is written in terms of an elemcnt coordinate system ( a coordinate system located on or within the boundaries of the element. This element coordinate is rcferred to as a local element.

Page 170: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

This element coordinate is referred to as a local coordinate system as contrasted u4l1 the global (normal) coordinate systcm using the triangular ele~nent .

$ = N,$, + N,$, + N,$, where N,. N, and Nh

the shape functions are defined as in equation (202) kA

Fig 40: Local coordinates system for a triangular element

Placing the local coordinate point or origin at the centroid of the element as shown above, fig 40 , the coordinate transformation equation are

x =X + s ................. (204) y.= 7 + t

where the centroidal coordinates are given by

Page 171: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

The shape function N, in global coordinate is

N, = 1 (a, + b,x + c,y) Ti

Substituting the local coordinates

or N, =! [(a, + blx + C I ~ +b, s + c, t] ............. (206) 2A

Recalling the definition of a,. b, and c, and substituting these on equation (205) a, + bl x cl y is reduced to 2A/3

The shape function in the element (local) coordinate system becomes

and for N; this results

and NI = - I [ L A ( 1 , - y, ,' + ( x , . x, )' ] . . . . . . . . . . . (207) 2A 3

Page 172: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

I'he integral of a function can be evaluated in the local s! stem b! enlploying the relationship de\.eloped by Kreyszig. 1972.

Hence 5 f(x.y) dsdy = 5 f [x(s.t). y(s.t)] ds dt K K*

Where R is the old region or doniain R* is the new region or doniain and 1 J 1 is the Jacobian or transformation determinant and is equal to A,,&

I n this particular case both systems are rectangular and scaled the same thus A,, = As, and I J 1 = I, since the element shape is unchanged R = R*

Therefore I f(x.j.) dxdy = I f [x(s.t). y(s.t)] ds dt ....... (209)

If the function. f(x. 4) on the left hand side of equation (209) is the element shape funcrion in the global coordinate system the f(x(s. t). y(s. t) is the element shape function in the local coordinate system.

Equation (209) staieb that the integral of a global shape functiou in the global coordinate system is the same as the integral of the local shape function in the local coordinate system. proiided hat the shapes of the elements in the sjstenl are the same and h e arcas of the region in the two system are equal.

Page 173: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Applying this to one di~nensiol~al t . l t .n~en~

Fig 41

The transformation is x = x, x s

Recalling the shape function

Therefore element equation in the Element or local coordinate system becomes

4.7.6 AREA COORDINATE This is a local coordinate system for the triangdar elenlent obtained by defining three coordinate ratios L I , Lz, L3

1 60

Page 174: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Each coordinate is the ratio of a perpendicular distance from one side. s. to the attitude. of that same side

Fig 42(b): The area coordinate system for a triangle.

'fhis is illustrated in the last fig 42 (a) L1 is length ratio that varies between 0 and :. 0 L I 1; the same is true for L?. Lines of constant L I is shown in (c). Each of the lines is parallel to the side from which L I is measured.

Page 175: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

T'hc coordinates. 1.1. L2 and L; are called area coordinates because their ~.alues give the areas of sub-triangles as related to the total area.

Illis can be proved by considering point B in (b) reproduced in the fig below

k

Fig 43 Area of triangle (i,jk). A,. = % bh = - bh

2

Area of triangle Bjk (shaded) A , = - bs 3 -

A1 bs 2 = A = !Zltitude of DBjk -. ... . . . . . .. (21 1 ) - .41 2 bh h Altitude of Dijk -

llsing the same base side kj

Page 176: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Therefore area coordina~c

I., = ratio of the shaded area Total area

Since Al + A2 + A j = A T ........................... LI + L 2 + L 3 = 1 (213)

Equation (21 3) gives the relationship between the three coordinates. The location of any point can be described completely by using only two of the coordinates.

I t is noteworthy that the coordinate variables L I , Lz. L3 are also the shapc functions for the siinplex linear element. In equation form

I.ro~n the last two figures, LI = 1 at node i

= 0 at nodes j and k

Similar properties hold for L2 and L;. from equation (2 13) 163

Page 177: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

S , - N , + Nh = 1 for an! arbitrary poinr.

It'a point (s. y) is located within the triangu!ar plane. s and > can be expressed in terms of L I . L? and L3.

Solving the equation. equations identical to equation (I 88) result. The first two equations in equation (215) give the coordinate location of x and y as a function of the nodal values.

The use of area coordinate system is justified i n the existence of integration equation (due to Malvern and Eisenbe~y 1973) which simplify the evaluation of length and area integrals. These zquations are summarized thus;

Illustrating with this

IN, N; dA where Ni N, are fu~ictions of x and g

I'his integral hecorncs

Page 178: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

The area coordinates I., and L1 correspond to the shape functions N,. N, as shown in fig (a)

Since Nk is not in the product. Lj is of zero power which makes it zero.

Equation (216) is used to evaluate integrals that are a function of the

length along an edge of the element. The quantity . L. this is the

distance between the t ~ o nodes that define the edge under

consideration.

4.7.7 VOLUME COORDINATES:

Similar to the area coordinates is the natural coordinate system

for tetrahedron element. From distance ratios LI. L?, Lj each

perpendicular to a side are defined as the ratio of a distance to

the gerpendicular distance from the side to the opposite apex.

The resulting coordinates are called \~olumc coordillates (fig 44

below)

Page 179: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

J Fig 44

S is perpendicular distance from one side to a point of interest, h is perpendicular distance from apex k to the side ijl

The resulting coordinates are callzd volume coordinates and are related by

And relating ta shape functions N, = L I . Nj = L 2 . Nk = L3, Nc = L4

Volume coordinates are useful in evaluating volume integrals

Page 180: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

4.7.8 PROPERTIES OF THE INTERPOLATING POLYNOMIAL: The polynomial expression used for approximating both scalar and vector quantities for various domains are rewritten thus (i) $ = a l + a ~ x (1 - dimensional) (ii) 4 = a, + a l x + a3y (2 - dimensional) (iii) $ = acl + a l x + a3y + ajl (3 -dimensional)

These polynomial expressions have special properties. They behave correctly when the nodal values are equal and they provide continuity between the elements.

4.7.9 CONVERGENCE: The finite element method will converge to the correct answer as the element size is decreased provided the interpolation polynomial expression gives a constant value throughout the element or domain, when the nodal values are numerically identical. The existence of a constant value also implies that the gradients I

should vanish. If this constant value occurs in a domain, the domain's or elements' interpolating equation can then model a constant value. This criterion places a restriction on the shape functions. If the nodal values are equal to a constant scalar value. C, thus

where there are r nodes within the element or domain. The general form for 4 equals

Page 181: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Since Q, = c = Qi

Sun1 of shape functions equals one at every point within the element.

Recall Ni = X , - x L

and N i = x - x i L

'The shape functions do sum to one.

I'hc existence of a constant value for 4 (or displacements etc) within an clcnicnt implies that the slope in any direction must be zero. thus

+ - Nl + N,@, + N L @ ~

Page 182: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Since C is not necessarily zero (220) is satisfied only if

Expanding from B = i to B = r and rearranging

r A, 1 N13 -1. the derivative Lvill be zero, thus the gradient will be

13-1 r satisfied automatically if the C N U = I is satisfied.

13- I

Page 183: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

4.8.0 CONTINUITY The discrete node fbr the continuous functioii consists of a set of piecewise continuous fimctions each defined over a single element.

The integral of a step wise continuous function f(x) is defined as long as f(x) remains bounded (Kaplan 1954).

For the integral

5 d"Q, dx to be defined Q, must be co*ltinuous to the order of - dx"

(n-1) to insure that only finite jump discontinuities exist in the

nth derivative. Thus the first derivative of the approximating

function must be continuous between elements if the governing

equation contains second derivatives, n = 2. All the governing

equations can be formulated in terms of first derivatives,

therefore the interpolation equation must be continuous betweer

the elements but their derivatives do not have to be.

The existence of continuity for the one dimensional element is

assured since any two adjacent elements have a node in

common.

Page 184: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

For triangular element 1

Fig 45: Continuily of a common boundary between two triangular elements.

Consider two adjacent triangular elements with the co- ordinating system from node I . The nodal values are a, 8, (DL and

The approximating function for $ for the two triangular elemen~s a.re

( 2 ) - * i + N ' I 'm. + Nk'2'mk) 0 - 1 J 1

The superscripts notation denotes the element.

Using area co-ordinates, and measuring L L I'2'

From the sides opposite node 1. rewriting (223) yields

Page 185: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

1.3'" and L2(?' are measured from the common boundary therefore

1 .31 ' ) = 1_2'2) = 0 along this boundary

Equation (224) reduces to 0"' = + ~ ~ ~ l ) @ ~ = L l i l ) @ + ( I - L l ( l ' ) o L

Since L ~ ( ' ) + L 2(1 ' = 1 and L ~ ( ~ ) + L 3(2) = 1

Usi'ng the figure below to complete the proof, S is the distance of an arbitrary point from node k

Since each of these ratios is equal to the respective area co-ordinates L I ' " and L,(" for any point on the common boundary. Substituting this equaIity in to (225) yields

4"' = d2' along the boundary

Page 186: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Determine the local shape functions for a one dimensional element if the origin of the local co-ordinate vstem is at the centroid of the element.

I . he nodal temperature values for the simplex triangular element are T, = 130°C. T, = 100°C and Tk = 120°C.

Page 187: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Dctcrrnine nhere the 125°C isotherm intersects the boundaries of the element. See Figure below.

9 3. Show that N , for the simplex triangular is zero when evaluated

at nodes j and k.

Page 188: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

CHAPTER FIVE

INTERPOLATING POLYNOMIALS, HEAT CONDUCTION INTERPOLATING POLYNOMIALS FOR A DISCRETIZED

REGION

5.1 INTRODUCTION The general form of the interpolating polynomial derived from the earlier discussion is

where the element has r nodes and the superscript (e) denotes an

arbitrary element.

Discretization of a domain into elements can be illustrated by

employing a five element configuration shown below. The nodes have

been numbered from one to six

The global degree of freedom are cDI, <Dz. @3, @.+, D5. and @,. The nodal co-ordinates (xB. yH), B = 1 , 2. ... ... . .. 6 are assumed to be known. The clement numbers are given in parentheses and anticlockwise.

Page 189: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

(a, XI, ~ 1 ) (Q2, x2, y2) Fig 47 Node i is selected arbitrarily. Node (2 can be chosen as node I and nodes j and k are picked in a counter-clockwise direction. Thus node 2 is designated i

node. 2 is designated i

node 3 is designated j

node 1 is designated k

Designating the elements one by one

E l e m e n t 2 i = 3 , j = 2 , k = 4

Element 3 i = 5, j = 3, k = 4

E lemen t4 i=6 : j=3 ,k=5

Element 5 i = 1, j = 3. k = 6

176

Page 190: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

I

These equations ernbed the element because the) rclalc the i. j. k

indices of an element to the global node nunlbers. This process fixes

the co-ordinates of the element nodes.

Substituting the values of i . j. k into this interpolating polynoinial

[N] [@I = [Ni "). N,"', NkiL') .

The following results: For element ( I ) , 4"' = Nz$* + N343 + N3$1 + N141 For element (2), 4i2' = ~ 3 ' ~ ' 4 3 + ~ ~ ( " 4 2 4 ~ 4 ( * ) @ 4

For element (3), 4''' = ~ ~ ( ~ ) 4 ~ + N j(3)43 + ~ ~ ( ~ ' $ 4 . . . . . . . . . . (230a) For element (4), 4i4' = Ng!')$b + N;("$3 + ~ ~ ( ~ ' 4 5

For element (5). 4"' = NI"'$I + Nr"'43 + N$"$L

The shape functions multiplying the nodal values in these equations arc evaluated by inserting the numerical values for i, j and k into the shape function equations.

For example the shape function for the arbitrary element. (e) in i . j and k notation is

Page 191: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

For element (5) for example ~ ~ ( 5 ) = 1 -

2A(9

Equation (230a) accomplishes the primary objective. By these equation the individual elements in the domain have been united into a continuous body and the interpolating function have been written in terms o:f the global nodal values and the global co-ordinated instead of the arbitrary i, j and k.

Equation 230 can be written as a function of all the global values in an expanded form (though some shape functions are simply zero in some elements)

The collection of the equation can be written thus

Page 192: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

This condensed form of the interpolating equation is used when t$e

finite element method is implemented using the digital computer.

It can be written in shorthand summation form. E

4 = C $(e) ................ e= 1

(23 3)

Where E = the number of elements.

Applying equation (233) to equation (232) this resul$s

5.2 VECTOR QUANTITIES

It' vector quantities are involved in the domain to be discretize& the

same method as used for scalar quantity in the last section applies. thus '

labelling is the same.

Page 193: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

1 2 11g 48: .\ Iiw element domain with displacenlent components shown. I he general elemcnt equation for vector quantities. equation (203) can t7c written thus

Page 194: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

This equation is the contracted form of equation for U '" and v"' . , The expanded form will include all 12 of the nodal values U1 . . . . . . .

..... U 12

The above treatment fixes the element within the body or component or domain of interest and the repeated similar process for several elements imposed on the component or domain of interest allows the scalar or vector quantity to be approximated piecewise continuously over the entire domain or region or component.

5.3 FINITE ELEMENT FORMULATION TO BOUNDARY VALUE PROBLEMS

In the finite element formulation a continuous function is approximated over a region by the use of elements, and from the elements equations and solution, numerical values for the nodal quantitiesqhat define the piecewise continuous function such that the element equations approxinlate very closely to some physical parameter of interest.

In the early stages of finite element application .the nodal values were determined by minimising an integral quantity related to the physical process under consideration.

Page 195: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

In solid mechanics problem. the potential energy of the system was minimised. This transformed the element equation into a set of algebraic equilibrium equations that should be solved for the nodal displacements. In field problems like heat transfer, magnetic fields, the integral of a functional was minimised.

For the functional processes, the property is that any function that makes it a minimum also satisfies the governing differential equation and the boundary conditions.

Recently the system of nodal equations have been derived using a weighted residual approach, one of these is the Galerkin's method which is a means of obtaining an approximate solution to a differential equation. It. does this by requiring that the error between the approximate solution and the true solution be orthogonal to the function used in the approximation.

5.4 DERIVATION OF THE FINITE ELEMENT EQUATION USING THE MINIMIZATION OF AN INTEGRAL QUANTITY

This is better illustration using a simple example. Considering a one - dimensional heat conduction in an insulated rod, thus

Page 196: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

The rod with specified heat input ot'q is attached to the wall, and the end is free and has convection coefficient h and a surrounding media temperate of To "C. As the rod is insulated there is no heat loss fiom the circumferential surface. The governing differential equation for the temperature distribution within the rod is.

(234) K,, d 2 ~ = 0 .............. \

' -4 dx

with boundary conditions .............. K,, d T + q = 0 a t x = O (235)

dx

............... and K,, dT + h (T - T,) = 0 - (236) dx

Where K,, is the thermal conductivity of the material, the heat flux. q is positive if heat is moving out of the rod.

From variational calculus a functional x, is minimised thus

requires that the differential equation to be solved thus

K,, d 2 ~ = 0 - - p

with boundary condition

Page 197: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

K,, fi + q x h (T - T,) = 0 .......... (238) d x

Be satisfied.

But the equation (238) is identified with the governing differential equations (234, 235, 236). therefore any temperature distribution that makes x a minimum also satisfies the governing differential equation and therefore is a solution to the problem of interest. Both boundary conditions are contained in equation (238) since the surface integral in equation (237) could be separated into two parts, one for each end of the rod.

Equation (238) is minimised by using the set of element functions each defined over a single element and written in terms of the nodal values ~ ( 1 ) = N I "' T I + N2 ( I ) T2

And the shape functions

'l~lic functional forn~ulation for the example being solved separated into

dv + q (x) ds * \

Page 198: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

where s l and sl are the surface areas tchere q and h are specified. The value of x is obtained by substituting for the temperature. T(s) and evaluating the integrals.

The surface i~ltegral are easily evaluated because the surfaces are located at nodal points.

For the integral involving the heat flux, q

A, is the area at node one T(s), the temperature function simplifies to TI because the surface is at node one..

' The surface integral involving the convection coefficient, h is

L

where A is the area and T is the temperature at node 3. The derivative of the temperature is in the volume integral

Differentiating T "' = N,'" TI + N2 "' T, and ~ ( 2 ) = N2 '2'1'2 + N; '2' T

3

Page 199: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

these result to

and - d ~ " ) = 1 dx I>' I ) ( - T2 .+ T3)

recall the expression for the shape functions N 11, N2m. M3(3 etc

Separating the volume integral into two integrals because the equation for dT is not continuous over the entire body. Separation, Substitution and integration gives.

I k- dv = K, ," )A(~) (- TI + ~ 2 ) ~ v 2 [dx) 2 ~ ' '

A constant cross sectional area was assumed in each element and dV = A"' dx was utilized when evaluating the integral.

One important characteristic of the finite element method is the possibility of separating the volume integral into a sun1 of integrals and this allows the material properties to be varied from one element to another.

By adding equation (241) and (243) the following equation which is a function of the nodal temperatures is obtained

Page 200: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

The correct value of T I , Tz and T3 are those that make x a minimum; therefore

dx = c'" TI - c'" T* + q ~ ~ ) -

3-r- 1

dx = - c'" Tz + [ c ' ~ ' + h Aj] T3 - h Aj T = 0 ............. - (244) dT;

Equation (244) can be rearranged to

or more general matrix form

Page 201: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

The coefficient matrix [K] in equation (244) is referred to as global stiffness matrix. A more appropriate name is the global conductance matrix i n heat transfer problem. The column F is the global force vector.

The final step in the analysis is to plug in assumed values for a physical situation and obtain numerical values for the ten~peratures TI. T2 and T;.

Assunie that K,, = 75 Wlcm = "C 2 0 h = 10 Wlcm - C

A = ncm2 ( I cm diameter) L, = 7.5 cm

q = -50 w/cm2 (negative because heat is moving into the body) and T, = 40°C

The coefficient become c"' = n (75) = 20n = c"' 3.75

and hAj T, = 10 (n) (40) = 400n

The final system of equation is

The nodal temperature values that satisfy these equations are TI = 70. I'? = 63.5 and T: = 55

Page 202: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

5.5 ALTERNATIVE TO MINIMIZATION Here the integral quantity s is separated into its element components and these components are minimized with respect to the nodal values before the integrals are evaluated. The result is a set of integrals that can be evaluated and then summed over the elements.

Let x be the summation of two conlponents

where x'l' is the sum of the integrals for element one and x'l' is a similar sum for element two

where

Differentiating with respect to all the nodal values starting with x")

Page 203: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

e~.alualion of the inlegrals produces a set of equations that can be

Differentiating the second component gives &'2' = 0

Page 204: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Once the integrals have been evaluated.

The minimization of x with respect to the nodal values is

& = &"' + &'Z' = 0 . . . . . . . . . . . . . . . . . . (252) am 3 0 @I If the equations are summed up and the result set equal to zero, the following desired system of equations result.

The summation gives

Which is identical to the system of equations (25 1) Finite element method is applicable to differential equations for any physical process contained in the following quasi - harmonic equation.

with boundary conditions $ = $ B o n S , and 1 or

where L,. L, and L, are the direction cosines of a vector that is normal to the surface. k,,. k,,. . , k,,. q can be function of x, y and z, but are assumed independent of $.

Page 205: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

In t u o dimensional situation \there k,, = k,, . . = 1. Q = 2G0 and Qn = 0 on the entire boundary and the quasi harnonic equation reduces to

+ + 2Gf3 = 0 which is the govei-ning 2s: 2y2

equation for the torsion of non-circular solid sections (Timoshenkp and Goodier. 1970). 4 is stress function. G is the material property, and 0 is the single of twist through which the section rotates. The shear stresses resulting from the torsion load are related to the x and y derivation of 4.

In irrotational flow of fluids where k,, = k,, , . = 1, Q = 0 this results to

with the boundary conditions

(Vallentine. 1959)

5.6 FINITE ELEMENT ANALYSIS IN ELASTICITY PROBLEMS Problems in the theory of elasticity can be solved in one of these ways

Page 206: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

( i ) The goterning dif'erential equations for the specified boundar) condition.

(ii) Minimizing the integral quantity related to the internal and external \+.ark done by the stress compoi-lents and the applied loads.

The finite element analysis utilizes the latter approach. It is the potential energy that will be minimized and the theorem of potential energy (Fung 1965) is stated. thus

"Of all displacements satisfying the given boundary conditions those that satisfy the equations of equilibrium are distinguished by a stationary (extreme) value of the potential energy" which means that the displacement equation selected must satisfy the displacement boundary conditions.

The total potential energy of an elastic system can be separated into two components. viz Strain energy component, potential energy component resulting from the potential energy of the internal and applied loads.

Total potential energy

where h is the strain energy W, is the potential of the applied loads

Work done bj, the loads = the negative of their potential energy

Page 207: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

yielding n = n + W ................... ( 2 5 5 )

As the region is divided into elements the total potential energy.

Example Consider the axially loaded member below, use finite element

analysis to determine the displacements at the loaded ends.

. Fig ~ x i a l i ~ loaded member

Using a single linear one dimensional element. the following equation results

Page 208: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

u" '= N ~ " ' u I + 8,'" ~ j , .............. (257) Since U must be zero because of the fixed end the equation reduces to

U = N 2 U2 = x U2 .............. - (258) L

The potential energy is given by

li,, E ,, = Strain Energy term 2

PU2 = work done by the applied load Rut 6 ,, = EE,, (Hooker's law) therefore equation (259) becomes

0

where dV = Adx assuming the cross sectional area is constant.

The strain component is related to the displacement by E ~ , = duldx

differentiating

Page 209: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

that is E,, = du = U2 ................ (261 ) - - dx L

The potential energy of the systen~ is

Minimizing n with respect to U2 yields

d n = A E Uz - P = O - - du2 L

Solution of the above equation gives u2 = p L ............... (264)

AE

This is identical to the theoretical value.

Exercises

1. ' Determine the embedding equation for the regions show below

Page 210: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

The starting node is indicated by an asterisk. Nodal coordinates are given in parentheses

2. Determine the general element equation for the regions in 1 (a) above if there is one unknown at each node.

L

3. The deflection of a simply supported beam subjected to a constant bending movement M is governed by the differential equation

Where EI i s a section property which is a constant (a) obtain a functional formulation for this problem (b) Derive the system of equations for yl. y; and y; ~ising the

finite element model show below

Page 211: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

y Using the finite element model shown below

1'

Page 212: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

CHAPTER SIX

BOUNDARY VALUE PROBLEMS

6.1 INTRODUCTION A boundary value problem requires the solution of a differential equation or system in a region R subject to various extra conditions on the boundary.

There are two broad classes of boundary value problems, viz;

The classical two - point boundary value problem of ordinary differential equations involves a second order equation, an initial condition and a terminal condition.

The region R is simply the interval (a, b) and the boundary consists of two end points, if x = a. y = A

x = b , y = B

The dirichlet problem requires the Laplace equation T,, + T,, = 0 OR ~LT + ~LT = 0 ........... (266)

ax2 dy2 be satisfied inside some region R of the xy plane and that T

(x,y) assumes specified values on the boundary of R. These are two broad classes of boundary value problems.

Page 213: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

6.2 SOLVIiW BOUNDARY VALUE PROBLEM:

(A) METHOD FOR ORDINARY DIFFERENTIAL EQUATION: Tlie m~ailable algorithms for the approximate solution of ordinary boundary value problem include the following anlongst others

(i) The Superposition Principle If the equations are linear Solving y" = q(x) y for Y (a) = A and Y (b) = B

TayIor and Runge - Kuitta etc are used (Refer to Differential Equations and applications by same author, D. 0 . N. Obikwelu pp34-37, 1988)

After which y (x) = ciyl (x),+ c2y2 (x) and from the boundary condition cl and c2 are determined.. (ii) Replacing derivatives by simple differences, the basic

problem becomes the differences equation

- T,,,,,+I - T,.I ., + (1 - 2h) T,,,, + Tn1+1 ,n . . . . . . . . . (2 70) where x,,, = mh

t, = nk and h = k

hZ

A rectangular lattice of point (x,,,t,) replaces the strip. 200

Page 214: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

The difference equation allows each 'I' values to be computed from values at previous time step. with the specified initial valit~s f(x,,) triggering the process.

For proper choices of h and k (tending to zero) the method converges to the correct solution. The computation for small h and k proves to be strenuous and numerous variations of this alogarithm have been invented in an eft'ort to reduce the size of the job. The implicit methods are foremost and involve a succession of matrix problems. Free boundary problems are among the more troublesome modem extensions of the prototype just presented and require that the location of part of the boundary be determined as part of the problem.

(iii) For the initial value problem y" = f(x,y,yt). y(a) = A, y'(a) = m

For some arbitrary choice of m. The terminal value obtained depends upon the choice of m, for example, f(m).

It is required that F(m) becomes B, i.e F(m) = B and to achieve this will require successive corrections to the initial choice of n ~ . Each new m value brings a new initial choice value problem, to be solved using Taylors Series, Runge - Kutta methods and others. Newton method can be used to choose correction to m thus

(iv) The Calculus of Variation establishes the equivalence of certain boundary value problems with problems of optimization

20 1

Page 215: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

To find the function \ ( \ ) tix ivhich y(a) = A. y(b) = B and makes t)

5 F(x,p.yr)dx maximum (or minimum) 1

One may solve the Euler equation F, =dJ = L F , , subject to the same boundary condition

dy dx (v) Dynamic Programming provides another approach tc

the above optimization problem. and hence to thc boundary problem also. For the b and B it rotes that thc optimum value of the integral (maximum or minimun depends upon a and A, Let the optimum value bc f(a,A).

Determining f(x,y) for various x and y values, the integral can be approximated thus

F(x,y) - opt {h. F[x,y,y'(x)l + fCx+h,y + hy' (x)]} which may then be

used to work backward from x = b, y = B

6.3 (B) METHODS FOR PARTIAL DIFFERENTIAL EQUATIONS: The solution alogarithm depends on the type of problem

namely (i) The parabolic Problem

Tt=T,, , T(o , t) = T ( I . t) = 0 T(x, 0) = f(x) ............,s..... (269)

Note T, = 5. T , = m" This is the prototype d t dx2

Page 216: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

of diffusion problems. The equation must be satisfied inside the semi-infinite strip 0 I x I 1. o It . On the boundaries of this strip T(x.y) is prescribed. See simple difference illustration 6.2ii.

( i i ) Replacement by a matrix problem is also used when the equations are linear.

For the equation

yff = q(x) y y" (x) can be replaced by a second difference method and y" = q(x) y becomes

2 yk-1 - (2+h qk) yk + yl;+l = 0 ............... (267)

Subdividing the interval (a. b) into equal parts using the arguments.

xo = a, xl, ............. x,. x,+l = b, it is then required that the difference equation holds for k = 1, ....... n, with y, = A and Yn+ I = B. The resulting system of n equation may then be treated by these methods - Gausian elimination,

Gauss - Siedel method and Relaxation methods.

(iii) The Garden-hose Method provides a simple and popular approach to nonlinear problems. It proceeds through successive approximations, as in 6.2iii.

(iv) The Elliptic Problem T\\ + T,, = 0 O l x l l O l y l l

Page 217: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

is the Dirichlet problem mentioned before

Using the differences in place of the derivative leads to the diffcrcnce equation

T(xn1- yn) = 54 [T (Xtn - h, yn) + T (xn1+ h, ~11) + T ( ~ n i . Yn - h) + T (x,,,, y,,+h) .............................. (271).

Requiring each ?' values to be the average of its four nearest neigbours in the square lattice (x,,, yn). Writing this difference equation at each interior lattice point brings a Linear system of N equations, where N is the number of such points and can be solved by known methods ealier treated in this text.

The method can be adapted to other equations to regions with curved or unknown boundaries and to more dimensions

(vi) The Hyperbolic Problem Utt = U,, - o o < x < o o , O I t .................................. (272) '

is a prototype of wave progagation problem. Finite difference methods can also be adapt-d to solve such problems including characteristic curves.

Examples:

1: Illustrate the reduction of a linear differential eigenvalue problem to an approximating algebraic system

Solution: Consider the problem

y l ' f h y = 0, y(0) = y(1) = 0 204

Page 218: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

is the Dirichlet problem mentioned before

Using the differences in place of the derivative leads to the dil'fcscnce equation

l'(xn,, yn) = [T O<m - h, ~11) + T (xm+ h, y11) + T (~111. YII - h) + T (x ,,,, yn+h) .............................. (271).

Requiring each T values to be the average of its four nearest neigbours in the square lattice (x,,, yn). Writing this difference equation at each interior lattice point brings a Linear system of N equations, where N is the number of such points and can be solved by known methods ealier treated in this text.

The method can be adapted to other equations to regions with curved or unknown boundaries and to more dimensions

(vi) The Hyperbolic Problem Utt = U,, -oo<x<oo.O I t .................................. (272) '

is a prototype of wave progagation problem. Finite difference methods can also be adap td to solve such problems including characteristic curves.

Examples:

1: Illustrate the reduction of a linear differential eigenvalue problem to an approximating algebraic system

Solution: Consider the problem

y l ' f h y = 0, y(0) = y(1) = 0 204

Page 219: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

its exact solutions are y(x) = C sin nnx, for n = 0. 1. 2. . . . . The corresponding eigenvalues are

-I -I

k,, = 1 1 3 -

For other problems whose exact solution are not easy to find. the following procedure can be followed.

Replacing the differential equation y" + ky = 0 with the difference equation

Considering the interior point j = 1, , . , N, or algebraic eigenvalue problem

Ay = kh2y results with the band matrix

all other elements being zero and y' = (yl, .. . ... .. .. yN). The exact solution of this problem may be found to be

yj = sin nnj with h ,, = (4/h2) sin2 (nn1'/2).

As h tends to zero these results converge to those of the target differential equation.

Page 220: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Fxarnple ( i i ) Replace the diffusion problem i n ~ d v i n g the equation ?TI& = a ~) + b (dT/dt) + CT

2s' and the conditions

1(0. t) = f(t). T(l. t) == g(t), T(x, o) = F(x) By a finite difference approxinlation

Solution:

Let x, = mh. And t,, = nk Where XI,,+ 1 = L

Denoting the value T(x,t) by the alternate symbol TI,, ,, the approximations m a t - i ~ ~ ~ ~ , II- - T ~ ~ ~ , J I ~ 3Tldt - ('L,+l, " - Tlll-,, ,I )/2h d % t 2 - (TI,+,, I1 - 2Trn9 I1 + Tm I, n )/h2

The diffusion equation then becomes 1. ,117 11- I - %bh) 5))- I , I1

+[ I - A(2a + ch )I T,,,, ,, +k(a + %bh) ,, where A= k/h2, m= 1, 2 .. . . . . . . . , N and n = 1.2 . . .. Using the same initial and boundary conditions above in the form

To. , = W,,). T I , + , . I, = g(t,,) and T',,, = F(xIl) this difference equation provides an approximation to each interior T,,,. ,,+, value in terms of its three neighbours at the previous time step. The computation therefore begins at the (given) values tbr t = 0 and proceeds tirst to t = k. then to t - 2k and so on.

206

Page 221: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Example iii Define an -implicit" finite difference method

Solution

Considering the problem I IT

m = a?. T(O. t) = 7 ~ y i , j t ) = O. - at ax2

$z

Applied first n = 1, right hand side of the above equation involves known initial values and the left hand side three unknowns.

Using m = 1, . . . . M, a linear system of M equations to determine TI, I up to T,, I results. Solving this system the second step follows with n = 2. Each new line is thus obtained as a unit, by solving a linear system. The advantage is that there is no stability restriction on the size of h and the horizontal lines may be more widel}, separated.

Example iv t a * ~ + dT + loot = 0, 7 - at- at

Page 222: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Discretizing $1 = Trl,;*; ' L - i

at node 111

lat node 111

t,,, = (111 - 1 ) (At)

Putting the discretization scheme into the partial differential equation

+ 100 (in-1) At = 0 Simpli@ing

(2111-3)(T,,,. , -- 4(m- 1 ) T,,, + (2m- 1 ) Tnl+ I = -200 (m- 1 ) (At) ' Exercises

1. Replace the Laplace Equation a? + a 2 ~ - = 0, o ~ ~ < - e , o ~ ~ ~ e 2 r?v2

by a finite difference approximation. If the boundary value of T(x,y) are assigned on all four sides of the square, show a linear algebraic system is encountered.

Page 223: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

2. Suggest a simple tlnite difference approximation to T\\ + T,, + Tzz = 0

3. Obtain in approximate solution of T, = T,, in the triangular 7

region 0 I t, 0 S x, I x (t) = t' Where T(o,t) = t and T(x,t) = 0 Use the variable k

4. Show that replacement of derivatives by simple finite differences converts the two dimensional diffusion equation. T, = Txs + T, into Tl.rn.nl - ( 1-4h) T~.nl,n + UTi+l.m.n TI-1.m.n + TI. m+l.n + T1.m- I .n)

And obtain similar approximation to the three dimensional diffusion equation Tt = Txs + Tyy + Tzz

Page 224: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

CHAPTER SEF7EN

PRINCIPLE OF CHAKACTERISICS

7.0 INTRODUCTION

\/lost general quasi linear partial differential equations of first order can bc Lvritten in the form

P(x. y.'z) & + Q (x, y. z) & = R(x. y. z) ........... (274) dx dy

Where z is the independent variable and x and y are dependent. If P and Q are independent of z and R. the above equation is truly a linear function of z say R = R l z + Rz and equation (274) becomes

P(~.y,z) & + Q(x,y) & = RI (x,y) z + R2 (x.y) ............ (275) & ay

if U(x.y,z) = c is a solution or intergral surface of equation (274) and determines z as a function of x and y which satisfies equation (274). Such surface represents the characteristic curve of the equation. 7.1 THE QLJASI LINEAR EQUATION OF FIRST ORDER

With the solution, u(x,y,z) = c of equation (274) by partial differentiation. this equation. u(x.y.~) = c becomes & + & + & = O . - a L l r & - + d z = O - ............. (276) c3 i3z S?; dy dz

lvhere &I + & and + &I the variables of x. y and z are ?x dy dz

considered independent. thus the following can be written

Page 225: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

where & f t 0 a~

introducing these expressions into equation (274). the following results, as a function of u

(Note the symmetrical roles of the variable of x, y, z)

Equation (278) can be rewritten thus (Pi + QJ + Rk) eVu= 0 ................. (279)

Since Vu in equation (279) is a vector normal to the surface U =

C, equation (279) states that the vector Pi + QJ + Rk is perpendicular to the normal to that surface at any point on the surface and hence lies in the tangent plane. Thus equation (279) can be considered as determining at any point in some three dimensional region a direction, specified by the vector V = Pi + Q + R k .

If a particle moves from a given initial point in such a way that its direction at any point coincides with the direction of the vector V at that point. a space curve is traced out. Such curves are called the characteristic curves of the differential equatiop.

In a similar way, the ordinary differential equation of first order. dy/dx = f(x.y) defines an angle 8 = t a n - ' f ( ~ , ~ ) at any point in some region in the xy plane which the tangent to an integral

21 1

Page 226: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

curve must make the x - axis, and the general solution of the equation is represented by the set of curves having the prescribed direction at any point in the two-dimensional region of definition.

Note also that the intersection of any two surfaces UI = C1 and U2 = C2 is a characteristic curve whose tangent at point has the direction ratios P,Q.R).

7.2 CHARACTERISTICS OF LINEAR FIRST ORDER EQUATIONS:

Earlier, characteristic curve, of the first order linear equation

where P,Q,RI and R2 are functions of x and y, as a curve in space whose tangent at any point has the direction ratios (P, Q, RIZ + Rz). Any such curve is the intersection of two surfaces of the form.

u, (xy) = C,, u* (x,y,z) = C2 .............. (28 1 )

Where U I (x,y) = C1 is an integral of the ordinary equation

And U (x,y,z) = C is an independent integral of one of the associated equations.

a x = & = ax ............... - (283) P Q R l z + R2

Page 227: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Thus any characteristic curve of equation (280) is the intersection of the cylinder.

GTf (XJ) = CI ......... ............ (284)

with elements parallel to the z - axis and a second surface of the form U2 (x.y,z) = Cz . Thus any characteristic curve can be specified by first choosing a particular cylinder of family (284). The intersection of this ~hara~teristic base cylinder with the XY plane defines the characteristic base curve. Such a curve is the projection of a characteristic space curve on the xy plane.

Note that three-dimensional cylinder elements make up the regions of the axisymnietric domain in the finite element formulation of circular components.

7.3 CHARACTERISTICS OF LINEAR SECOND-ORDER EQUATIONS:

Generally such equation are of the form

where the coefficients and the right hand inember may be functions of x and y

In the case of ordinary equations of second order the initial conditions prescribe a point in the plane through which the integral curve will pass, and also prescribe the slope of the integral curve at tl!at point. This is equivalent to prescribing the values of the dependent variable x. In the case of a partial

Page 228: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

differential equation the analogoirs initial conditions prescribe a curve C in space which is to lie in the integral surface and also prescribe the orientation of the tangent ptane to the integral surface along that curve.

These conditions are equivalent to conditions which prescribe the values of z and its two partial derivatives dz/& and azl@ along the projection C, of the curve C onto xy plane. However the values of z, d z l h and dddq cannot be described in a completely independent way if z is to be differentiable along the curve C,, since if h is a parameter specifying position along C,, this will resuh

For elliptic linear equation of second order there are no real characteristic curves since the discriminant b2 - 4ac is negative.

In hyperbolic equations it is found that there can be infinitely many integral surfaces including a strip.

Exercises

1. Examine linear secor?d order partial differential equations and relate it to the general quasi harmonic equation

with boundary conditions

Page 229: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

0 = O o r S I and ' or

2. Recall the properties of hyperbolic. Elliptic and parabolic equations.

, Answers to selected numbers

Chapter 3

1. T 2 ( % + a ) T l + h, IT;, 1 + % t a ) + h , { T , + w V , = O - - Ax k l AX k ] k

2. 0.0868 hr.

Chapter 6

Page 230: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

1 . CRAMER'S RULE

11. CiUASlAN ELIMINATION

111. GENERAL COMPUTER FLOW DIAGRAM FOR A FWITE ELEMENT PROGRAMME

IV. PROGRAMME FOR SOLVING HEAT TRANSFER PROBLEM

Page 231: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

USE OF CKAMKliS RULE TO SOLVE LINEAR SIMULTANEOUS EQUATIONS -

Example: 3 ~ + ~ - 2 ~ = - 2 Solve for z x - 2y + 3x = 9 for z

2 x + 3 y + z = 1

By Cramer's rule we have 3 1 -2 '

Example: (a) For what value of k will the system of equation

(1 - k ) x + y = O

kx - 24' = 0

have solutions other than the trival one x = 0, y = 0.

(b) Find two non-trical solutions.

(a) By Cramer's rule the solution will be

0 1 I - k 0

x = 0 - 2 , y = k 0

1 - k l 1 - k 1

k - 2 k - 2

217

Page 232: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

l o t i since the numerators are equal to mu. these can he non-trivial (i.e

nowem) solution only if the denominator is 31w equal to zero, i.e

(c) If k = 2 the equations become - s y - 0.2s - 2y = O and are identical. i.e x = y. Then solutions are x = 2. y = 2. x =

3, y = 3 for example. Actually there are infinitely many such non-trivial solutions.

Example: Solve 3x + 4y = 6 2~ -- 5y = 8 Using determinants.

By Cramer's rule we have 21 8

Page 233: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

A check is supplied by substituting these results in the given equations.

SOLVING SIMULTANEOUS LINEAR EQUATIONS:

(i) Gauss-Jordan Elimination This procedure is much simpler and more efficient than the more familiar methods based upon direct algebraic substitution or the use of determinants. The basic idea is first to write the given constants in the form of an array.

And then to transform this array, row by row, until all the a's beconle 0's except the elenlents on the principal diagonal (upper left to loiser right), which become I 's. The last column, which originally contained the b's will then contain the values of the unknobn x's in other words. the original arraq mil l be transformed into

Page 234: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

................... 1 0 ... 0 x,,

I-ach transformation consists in adding some r~lultiple uf one ron to another row, in such a manner that the desired result (a 0 or a I ) is obtained. The detailed procedure can be illustrated bj. means of an esalnple.

Example: Solve the following system of simultaneous linear Equations using the Gauss-Jordan method:

We first express the given system of equations in the form of an array. i.e

3 2 - 1 4 2 - 1 1 3 1 1 -2 -3

'I'he array is then transformed a i follows

* Transform ;he first column to ( 1.0.0). To do so. (a) Multipiy the first row by -213 and add to the second

row. 'This results in a new second row:

Page 235: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

(Note that the ~nultipiier. -213. is chosen so that a zero is obtained in the first column of the second row. i.e (-2/3)(3) + 2. - 0)

tb) Illultiply the first row by -113 and add to the third row. This results in a new third row:

(Again. note that the n~ultiplier. -113. is chosen so that a zero is obtained in the first column of the third row)

(c) Multiply the first row by 113, resulting in a new first row:

(The multiplier, 113. is chosen so that a 1 is obtained in the first column of the first row) As a result of these operations. our original array has become.

1 213 -113 413 0 -713 513 113 0 113 -513 -1313

2. Transform the second colunm to (0. 1. 0). To accon~plish this. (a) Multiply the second row (of the new array) bj

217 and add to the first rom. This results in a neu first row:

1 0 117 1017

Page 236: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

(b) Multipl! the second mu b~ 117 and add to the third roc\. 1'11is results in a new third row:

0 0 -10'7 -3017

(c) Multiplj the second r o u b!. -317. resulting i n a neu second row :

0 1 -5!7 -117 Thus. our array has become

1 0 117 1017

3 . transform the third column to (0. 0. 1). To do so, (a) Multiply the third rob (of the new array) by 1110

and add to the first row. We now have a new first row:

1 0 0 1

(b) Multiply the third row by -112 and add to the second row. This results in a new second row:

0 1 0 2

(c) Multiply the third row by -711 0. resulting in a new third row:

0 1 0 2

Our arraj has no& become 1 0 0 1

Page 237: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

3. We can no\\ read the solution from the last column. Thus. xl = l . x ? = 2 . x3 =3 . It is easy to \erif>r that (1 . 2. 3) are the correct answers b? simply substituting these values into the original three equations.

. . 11. Gauss Elimination

A variant of the Gauss-Jordan technique is Gauss elimination. in which the original array

is transformed into

wherein all elements below the principal diagonal are 0's The x's are then obtained as

..................................................... X I = (dl - ~ 1 2 ~ 1 - .... - clIlx /ell

Page 238: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Example: Sol\ e the follouing sj.stem of equations usins ' Gauss elimination

The gi\.en system of equations can he written as 0.1 -0.5 0 1 2.7 0.5 -2.5 1 -0.4 -4.7 1 0.2 -0.1 0.4 3.6 0.2 0.4 -0.2 0 1.2

132. We no\v perform the following operations,

1. 'Transform the first column to (0. I , 0. 0.0) as follows: (a) Multiply the first row by -5 and add to the second row. (b) Multiply the first row by -10 and add to the third row (c) Multiply the first row by --2 and add to the fourth row.

'The result is

Page 239: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

7 . Remove the zero from the principal diagonal by interchanging the second and third roLvs ( or the second and fourth rows).

3. Transform the second column to (-.5, 5.2, 0.0) as follows: Multiply the second row by

and to the last row. The result is 0.1 -0.5 0 1 2.7 0 5.2 -0.1 -9.6 -23.4 0 0 . I -5.4 -18.2 0 0 -0.1730.585 2.1

4. Transform the third column to (0, -0, 1, 1.0) as follows: Multiply the third row by 0.173 and add to the fourth row. The result is

0.1 -0.5 0 I 2.7 0 5.2 -0.1 -9.6 -23.4 0 0 .1 -5.4 -18.2 0 0 0 -0.35 -1.05

5 . We now solve for x ~ , x;. xl. and X I as follows x~ = ( -1.05)/(-0.35) = 3 X; = ( -1 8.2 (-5.4j (3) 1 1 = -2 S, = -23.4 - (-9.6) (3) - (-0.1 ) 115.2 = 1 X I = 2.7-(I)(;)-(O)(-2)-(-0.5) (1) 1IO.1 = 2

Page 240: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

6 . Sol1.e the s!stem of equations presented in problem 5.7 ['sing Gauss-Josda~l elimination.

We no& perfom) the following operations:

1. Transform the first colunin to ( 1. 0. 0) as follows: (a) Multiply the first row b j -5 and add to the

second row. ( b ) Multiply the first row by -2 and add to tlie third

row (c) Multiply tlie first row by -2 and add to the fourth

1'0 \Y

(d) Multiply the first row by 10.

I'he result is 1 -5 0 10 27 0 0 1 -5.4 -18.2 0 5.2 -0.1 -9.6 -23.4 0 1.4 -0.2 -2 -4.2

7 - Remol e the ~ e r o from the principal diagonal by inter-changing the second and third rows ( or tlie second and fourth rows).

Page 241: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

3. 'I'ransii>rm the second column to (0. 1 . 0. 0) as fo l lo~s : (a) Multiply the second row by 515.2 = 0.062 and add to the

first r o ~ \ - >

( b ) Multiplj the second row by -1.415.2 = -0.269 and add to the last row..

(c) Multiply the second rom by 115.2 = 0.192.

The result is

Page 242: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Number of equations. Number of elements. Bandwidth. materials

properties

global st~ffness and global force matrices

on the number of elements

Element number, node number, nodal coordmates material properties mdev

Store pertinent element data on scratch tape.

disk. etc

Print of element data

Calculate element stiffness and element force matrices

Insert element matrices into tne global matrices

End of Do loop - P

READ Vodal fbrse \slurs and add to the global force

READ Sprc~tied nodal values and modify the global stiffness matrix

Decompose the global matrices and solve by

on the number

Read element data from cards. retrieve from

memory or scratch tape

Calculat~on and pnntmg of element resultant values

End of Do loop I

Fig: Genera (7' computer flow diagram for a finite Element program.

228

Page 243: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

COMPL'TER SOLUTION OF CONDUCTIVITY EQUATION USING FiNIT ELEMENT METHOD (After Prof. Segerlind (6))

PROGRAM T O HEAT (INPUT, OUTPUT. PUNCH. TAPE 60 = INPUT, TAPE 61 = OUTPUT. TAPE 6 17, = PUNCH) DIMENSION NS (3). ESM (3. 3), EF (3). X (3). Y(3), B (3), C (3) DIMENSION ISlDE (2). A (2500). PHI (3) COMMONITLEITITLE (20) REAL KXX, KYY, LG DATA INl60. 101611, NCLIII, IDliOi, IPi621

C DEFINITION OF THE CONTROL PARAMETERS C N P -NUMBER O F GLOBAI, TFMPERATUKE. N E - NI!MBER O F

10 C ELEMENTS. NBW - BAND WIDTH. K X X - CONDIJCTIVITY IN X C , DIRECTION. KYY - CONDUCTIVITY IN THE Y DIKECTION. H - C CONVECTION COEFFICIENT. TlNF - FLUID TEMPERATURE C C

15 C INPUT O F THE TITLE C A R D AND THE CONTROL PARAMETERS C READ (IN. 3 ) TITLE

3 FORMAT (20A4) READ (IN. 2)NP. NE. NBW. IPCH. KXX. KYY. H. TlNF

20 2 FORMAT (4 13.4F 10.5) C C CALCULATION OF POIN1.ERS AND lNlTlALlZATlON OF THE COLI.MN

VECTOR A JGF = NP*NCL

25 JEND = JGSMtNP*NBW '

DO 1 3 1 = 1 . J E N D 13 A([) = 0.0

C . , ,

3 0 C OlJTPIJT O F TITLE A N D DATA HEADINGS C

WRITE (10.4) TITLE. &XX. XYY. H. TINF 4 FORMAT ( I H I . I l l l lS . 5HFLUID TEMPc . F? IIIIX. I7HNEL NODE NIJM

.3 5 Z BER.6X. J H X ( I ) . OX..IHY(I). 6X, IHX (1). OX. I t lY ( ? L O X l l i X ( 3 ) . OX. I fIY ( 7 ) ) C*3**3* 13*3+* C ASSEMBLEYING OF THE GLOBAL STIFFNESS MATRIX AND GI.ODAI. FORCE MATRIX ('************* C

40 C INPIJI' A N D EC'I-I0 PKIN'I' O F ELEMENT DATA ( '

no?tik;= 1 . ~ 1 : READ (IN. I1 NEI.. N ' . k'(1). Y ( l l X (2) . k'(3). Y ( 3 ) ISIDE

9 3 C) - -

Page 244: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

I FOI(L1 (413. ht 10.4: 213) 45 b'RI'l'1: (10.23) YEL. NS. S ( l J. )' ( I ). (2). Y (2). ( .3). lr(.>)

23 FOli"d:\ I' ( IS. 13.2X. 314.3X. 6125. [:H 41) c' C' C'!U,C'L'l.Xl~lOX OF 'I'tIE CONDUCl~l~XY \I.Al~UiX c

s o B ( I ) = s ( ~ - Y O ) L 3 ( 2 ) * = Y ( 3 ) - Y ( l ) B (3) = Y ( I ) - Y (2) C ( l ) = X ( l ) - X ( 2 ) C (2) = S (2) - X (3)

55 c ' ( 3 ) = X ( 3 ) - X ( I ) AKJ = ( X (1) * Y (3) + X (3)* Y ( I ) + X ( I ) * Y (2) --X (2)*Y ( I ) -X ( 3 ) * Y ( 2 ) - X ( I ) * Y ( 3 ) ) 1 ' 2 D O 5 I = 1 . 3 EF (I) = 0.C

60 D O C J = I . 3 5 ESM (1.J) = (KXX*B (I) *B(J) + KYY * C (I) *C (J))/AK4

C CALCULATION OF THE CONVECTION RELATED QUANTITIES c'

6 5 DOIOI = 1.2 IF (ISIDE (I) .LE.O) GO T O 6 J = ISIDE (I) WRITE (10. 12) J. NEL

12 FORMAT (IX, 20 HCONVECTION FROM SIDE, 12. LIH OF ELEMENT. 14) 70 K = J + I

l F ( J E Q . 3 1 ) K = I LC; = SQRT ((X(K) -X (J)) **2 + (Y(K) -Y (J)) ** 2) HL = H*LG EF (J) = EF (J) -t LiL* T INFl2

75 EF (K) = EF (K) t HL* T INFl2 ESM (J. J ) = ESM (J, J ) + HL13 ESM (J. K) = ESM (J. K) -t HLI 6. ESM (K. J) = ESM (.I, K)

10 ESM (K. K) = ESM (K. K) + HL 1 3 80 C

C INSERTION OF ELEMENT PROPERTIES INTO THE GL.0BAL SfIFFNESS MATRIX

C 8 D 0 7 1 = 1 . 3

I 1 = NS ( I) 85 D O 1 5 J = I , N C L

JS = (NCL + J -. I)* NP + I I 15 A (JC) = A (JC) t E,:F (I)

DO 17.1= 1 .3 .I./ = NS ( J )

Page 245: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

0 5

1 O(1

105

110

I I.;

120

I25

C C',%l.C'~Jl.~tTION OF I ' i iE .F~I . l~MEK'1 ' RESULTANI-S [ ' * * * * * * a * * * * *

C~ C' INlY I 0 1 ; 'l'l l F i ELEMENT ( '

I)OX6KK = I. NE l<l:,\I)(IN.I) NEL. NS. X( I j , Y (I). X (2). Y (2). X (3). Y (3) I[ (N1:L. 1-1-. 0) STOP II: ( K K . CiT . I ) GO T O 50 Wl<I~l'E (10. 6G) TITLE

XC' I ORMAT ( IHI . /I!/ 1 X, 2OAJ /, I X. IBHELEMENT O F SIKTANTS :!fix, SIHELEMEN'I' I GRAD(Xj GRAD ( Y ) AVE TEMP

c C I<I..'I RII:VAL. O F T H E NODAL VALES FOR THE ELEMENT C' CACUI.ATION OF AVERAGE TEMPERATURE

5 0 J I - JGSM - NEL n l . l l )~ .c c

c 1>0201 - 1.3 II = NS (I) PHI (I) = A(I1)

?0 A ( J I ) - A ~ J I ) ~ ~ 1 ' ~ 1 1 ( 1 ) ~ 3 ( '

C' CAI.CIJI.A'I'I~N OU'I'IYJT- 01: THE TEMPEKATIIKI-.C;KADIENTS

Page 246: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

140 52 = JGSM + I WRITE (1P. 53) (A (1). 1 = J2, J l )

53 FORMAT (6E 12.6) STOP END

This programme can be adapted using the modern computers.

Page 247: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

References

MacCalla T.R Introduction to Nunlerical Methods and Fortran Programming John Wiley and Sons, Inc New York (1 967)

Obikwelu D.0.N Differential Equations and Applications, First Edition Alphabet Nigeria Publishers Owerri, ( 1 998)

Hilderbrand F.B Advanced Calculus for Applications. Second Edition Prentic - Hall, Inc New jersey (1 976)

Sheid F. Numerical Analysis Schaum's outline series MaGrawhill Outline Series ( I 968)

Onyekonwu M. Reservior Simulation. Laser Publishers (Nigeria)

Segerlind L.J Applied Finite Element Analysis. John Wiley & Sons Inc (1976)

Coulson J.M et a1 Chemical engineering Volunle Three. Second Edition Pergamon Press ( 1 99 1 )

Sucec J. Heat Transfer Simon and Schuster N. Y. ( 1 975)

Page 248: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

Imgmui r I. Adams E.Q. Meihlt. F. S. Flou of heat 71'hrough tilrthes N'alls. T'hr Shape Factor. Tsaiisactions of the American Electrochemical Society Vol. 24 ( 191 3) 1'1'. 53 - 84

Grobcr H. S. et a1 Fundamentals of Heat Transfer 3'' ed. Ne\i Yorh. McGsa\\Hill Boo1 Co ( lO6 1 )

Page 249: University of Nigeria to Computational...4) is non-linear but usually referred to as quasi - befficients, a,b,c, and g are constant's or functions of x the partial differential equation

I . V

leer

text b q