investigation of implicit methods for solution of the

115
Brigham Young University BYU ScholarsArchive All eses and Dissertations 1968-5 Investigation of Implicit Methods for Solution of the Fourier Equation Kjell Steinar Gundersen Brigham Young University - Provo Follow this and additional works at: hps://scholarsarchive.byu.edu/etd Part of the Mechanical Engineering Commons is esis is brought to you for free and open access by BYU ScholarsArchive. It has been accepted for inclusion in All eses and Dissertations by an authorized administrator of BYU ScholarsArchive. For more information, please contact [email protected], [email protected]. BYU ScholarsArchive Citation Gundersen, Kjell Steinar, "Investigation of Implicit Methods for Solution of the Fourier Equation" (1968). All eses and Dissertations. 7121. hps://scholarsarchive.byu.edu/etd/7121

Upload: others

Post on 08-May-2022

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Investigation of Implicit Methods for Solution of the

Brigham Young UniversityBYU ScholarsArchive

All Theses and Dissertations

1968-5

Investigation of Implicit Methods for Solution ofthe Fourier EquationKjell Steinar GundersenBrigham Young University - Provo

Follow this and additional works at: https://scholarsarchive.byu.edu/etd

Part of the Mechanical Engineering Commons

This Thesis is brought to you for free and open access by BYU ScholarsArchive. It has been accepted for inclusion in All Theses and Dissertations by anauthorized administrator of BYU ScholarsArchive. For more information, please contact [email protected], [email protected].

BYU ScholarsArchive CitationGundersen, Kjell Steinar, "Investigation of Implicit Methods for Solution of the Fourier Equation" (1968). All Theses and Dissertations.7121.https://scholarsarchive.byu.edu/etd/7121

Page 2: Investigation of Implicit Methods for Solution of the

C l o ^ ^ L

£<l f r

INVESTIGATION OF

FOR SOLUTION OF TE

IMPLICIT METHODS

:s fourisr equation

yV

A Thesis

P resen ted to the

Department o f Mechanical .Engineering

Brigham Young U n iv e rs i ty

In P a r t i a l F u l f i l lm e n t

of the Requirements f o r the Degree

Master of Science

by

K je l l S te in a r Gundersen

May j 19 6 S

Page 3: Investigation of Implicit Methods for Solution of the

This t h e s i s , by K j e l l S t e i n a r Gandersen, i s accepted in

i t s p re s e n t form by the Department c f Mechanical Engineering

of Brigham Young U n iv e r s i t y as s a t i s f y i n g th e t h e s i s r e q u i r e ­

ment f o r th e degree of Master of Sc ience .

i i

Page 4: Investigation of Implicit Methods for Solution of the

To E l le n

Page 5: Investigation of Implicit Methods for Solution of the

ACKNOWLEDGMENTS

The au tho r wishes to express h i s s i n c e r e s t a p p r e c i a t i o n

to Dr. Howard S. Heaton f o r h i s pe rso n a l h e lp and sugges t ions

th roughout t h i s p r o je c t and f o r h i s w i l l i n g n e s s to share of

h i s i n s i g h t i n to the f i e l d of numerical methods i n h ea t

t r a n s f e r .

The a u t h o r ' s w ife , E l le n , a l s o dese rves a s p e c i a l word

of a p p r e c i a t i o n . Besides being a good mother and w ife she

has been a co n s tan t source of encouragement and support and

has done a l l the typ ing connected w i th t h i s p r o j e c t .

Page 6: Investigation of Implicit Methods for Solution of the

TABLE OF CONTENTS

DEDICATION

ACKNOWLEDGMENTS ..................... '............................................ iv

LIST OF FIGURES ........................ ; ................. v i i

NOMENCLATURE ......................................................................................... v i i i :

C hapter

I . INTRODUCTION ................................................................................ 1

P rev io u s Work

I I . STATEMENT OF THE PROBLEM......... ........................................... 4

I I I . DEVELOPING THE BACKWARD DIFFERENCE METHOD ............... 6

Summary of Node Equations

IV. DISCUSSION OF METHODS OF SOLUTION................................ 14

Gauss E lim in a tio n Method G au ss-S e id e l Method C ho lesk i D ecom position Method G auss-Jordan E lim in a tio n Method Booy Method

V. DISCUSSION OF RESULTS ..................................................... 23

Computer Time E rro r

T ru n ca tio n E rro r Round-Off E rro rO ptim ising Computer Time and Accuracy

VI. CONCLUTIONS .................................................. 41

APPENDIX A THE GAUSS ELIMINATION METHOD ....................... 43

APPENDIX B THE GAUSS-SEIDEL METHOD......... ........................... 53

APPENDIX C THE BOOY METHOD ................................. ' ..................... 63

v

Page

i i i

iv

v i i

v i i i :

iJL

4

6

14

23

41

4-3

53

63

Page 7: Investigation of Implicit Methods for Solution of the

Page

APPENDIX D THE GAUSS-JORDAN ELIMINATION METHOD ............ 80

APPENDIX E THE CHOLESKI DECOMPOSITION METHOD ................ 85

BIBLIOGRAPHY ................. 101

ABSTRACT ....................... . .................................. 104

v i

Page 8: Investigation of Implicit Methods for Solution of the

LIST OF FIGURES

F ig u re Page

1. R ec tangu la r P la te Problem .................................................. 4

2. P la t e w ith Superimposed Grid ......................................... 6

3. Numbering of Nodes ........................................................... 12

4 . Temperature Response f o r Node of C o n s id e ra t io n . . 25

5. Number of O perations v s . Number of Nodes ............... 26

6. Computer Time v s . Number of Nodes fo r =1/16 . . . 27

7 . Computer Time vs. Number of Nodes fo r =2 ............. 28

8. T ru n ca tio n E rro r v s . Time f o r D i f f e r e n t ' s . . . . 33

9 . E rro r Curves fo r Choleski and Gauss Methods . . . . 34

10. E rro r Curves fo r G auss-Seide l I t e r a t i o n ................ 34

11. E rro r Curves fo r Booy Method ......................................... 35

12. O ptim izing fo r Booy Method ......................................... 39

13. O ptim izing fo r Gauss E lim in a tio n Method ............ 39

14. Optim izing fo r Cholesfci Method ............. 40

15. Optim izing f o r G auss-Seide l Method ....................... 40

16. R ec tangu la r P la te w ith Convective Boundaries . . . 65

v i i

4

6

12

25

26

2?

28

3334

34

35

39

39

40

40

65

Page 9: Investigation of Implicit Methods for Solution of the

NOMENCLAT CHE

AA Thermal d i f f u s i v i t y In th e y - d i r e c t i o n

AB Thermal d i f f u s i v i t y i n th e x - d i r e c t i o n

c S p e c i f i c h ea t of th e m a t e r i a l i n th e p l a t e

DX H o r izo n ta l s id e of r e c t a n g u la r p l a t e

DY V e r t i c a l s id e of r e c t a n g u la r p l a t e

KA Convective h e a t t r a n s f e r c o e f f i c i e n t on th e l e f t s id e

HB Convective h ea t t r a n s f e r c o e f f i c i e n t on th e lower s id e

HC Convective h e a t t r a n s f e r c o e f f i c i e n t on th e r i g h t s id e

HD Convective h ea t t r a n s f e r c o e f f i c i e n t on th e upper s id e

i , j , k In d ic e s in th e x - d i r e c t i o n , y - d i r e c t i o n , time

KA Thermal c o n d u c t iv i ty i n th e y - d i r e c t i o n

KB Thermal c o n d u c t iv i ty i n the x - d i r e c t i o n

m A rb i t r a ry node in y - d i r e c t i o n

n A r b i t r a r y node in x - d i r e c t i o n

NA Number of nodes i n th e y - d i r e c t i o n

NB Number of nodes i n the x - d i r e c t i o n

T Temperature

TCA Temperature of f l u i d on the l e f t boundary

TCB Temperature of f l u i d on the lower boundary

TCC Temperature of f l u i d on th e r i g h t boundary

TCD Temperature of f l u i d on the upper boundary

At Time increment

Ax Grid spacing in x - d i r e c t i o n

v i i i

Page 10: Investigation of Implicit Methods for Solution of the

Grid spacing i n y - d i r e c t i o n

Densi ty of m a te r i a l in th e p l a t e

Ay

s

ix

Page 11: Investigation of Implicit Methods for Solution of the

CHAPTER I

INTRODUCTION

In r e c e n t yea rs th e re has been an ex te n s iv e development

of f i n i t e d i f f e r e n c e techn iques fo r s o l u t i o n of th e t r a n s i e n t

h e a t conduction equa t ion due to the a v a i l a b i l i t y of h ig h ­

speed d i g i t a l computers. I t i s th e purpose o f t h i s paper to

i n v e s t i g a t e and compare s e v e r a l i m p l i c i t methods fo r the

s o lu t io n of th e F o u r ie r equa t ion with r eg a rd s to t r u n c a t i o n

e r r o r , ro u n d -o f f e r r o r and computer time which probably a re

among the most im portan t f a c t o r s to be cons idered in choosing

a method.

The methods to be i n v e s t ig a te d in c lu d e an ex ten s io n of

a method r e c e n t l y developed by M. L. Booy ( 3 ) , and th e more

c l a s s i c a l backward d i f f e r e n c e method. The l a t t e r w i l l u t i ­

l i z e G auss-Se ide l i t e r a t i o n , Gaussian e l im in a t io n , and the

Choleski decomposit ion methods to so lve a system of s im ul­

taneous eq u a t io n s . Although th e method by Booy u t i l i z e s a

backward time d e r i v a t i v e i t d i f f e r s from th e c l a s s i c a l back­

ward d i f f e r e n c e method in t h a t the f i n i t e d i f f e r e n c e equa t ions

a r e no t s e t up i n a p en ta -d iagona l form.

The G auss-Se ide l method i s widely used in th e s o lu t io n

of hea t f low problems. Most of the l a r g e s c a l e i m p l i c i t

computer programs p r e s e n t ly i n use u t i l i z e i t e r a t i o n as a

method of s o l u t i o n , fo r i n s t a n c e Anderson ( 1 ) . The Booy

1

Page 12: Investigation of Implicit Methods for Solution of the

2

method was developed r e c e n t ly and published i n r e f e r e n c e ( 3) .

The au tho r of. t h i s paper claims t h a t the method i s s im pler

and more a c c u ra te than i t e r a t i v e p rocedu res . The Gauss e l i ­

m ina t ion method i s th e most commonly used method in s t r e s s

and s t r u c t u r e problems (2 1 ) . Among o th e r s i t i s being used

by Wilson (19). and the Rohm and Haas Company (2 1 ) . The

Choles.ki decomposit ion method i s being used i n a program

named SAMIS, v / r i t t e n by P h i lco Ford and i n COSMOS which i s

being used by the Boeing Co. (21 ) . ■ I t i s a l s o w r i t t e n f o r

the H ercu les Powder Co. by Dr. H .C h r i s t i a n s e n (21) .

To the a u t h o r ' s knowledge, the l a t t e r two methods a re

no t being used in th e s o lu t io n of hea t f low problems. How­

ev e r , s in ce th e s e methods have been used s u c c e s s f u l l y in

s t r e s s and s t r u c t u r e problems to so lve th e same type of pro­

blem t h a t o f ten occurs i n hea t flow a n a l y s i s (symmetric band-

m a t r i c e s ) a comparison w ith th e i t e r a t i o n and Booy methods

seems to be j u s t i f i e d . Also t h i s paper w i l l d i s c u s s th e so­

l u t i o n of a two dimensional problem, whereas most comparisons

have been made fo r th e one dimensional ca se .

P rev ious Y/ork

There i s ex ten s iv e d i s c u s s io n on th e v a r io u s i m p l i c i t

and e x p l i c i t methods in th e l i t e r a t u r e . R ich tm yer•(15) l i s t s

13 d i f f e r e n t f i n i t e d i f f e r e n c e schemes rang ing from th e pure

i m p l i c i t to th e pure e x p l i c i t form. In deve lop ing th e back­

ward d i f f e r e n c e method f o r so lv ing complex t r a n s i e n t h ea t

t r a n s f e r problems, Anderson e t . a l . (2) has a s h o r t compari­

son between the Gauss e l im in a t io n method and th e a c c e le r a t e d

Page 13: Investigation of Implicit Methods for Solution of the

G auss -Se ide l i t e r a t i o n method, g iv ing s e v e r a l su g g es t io n s fo r

a c c e l e r a t i n g th e i t e r a t i o n s . Anderson (1) has a d i s c u s s io n

of p re se n t s p e c i a l purpose and g en e ra l purpose e x p l i c i t and

i m p l i c i t - t y p e programs inc lud ing a d i s c u s s io n on the Gauss-

S e id e l method and the most common l a rg e s c a le h e a t t r a n s f e r

programs. In a r e c e n t paper Gay e t . a l . (7) compare the ex­

p l i c i t , the backward d i f f e r e n c e , and th e Crank-Nicolson me­

th o d s , th e l a t t e r two u t i l i z i n g two d i f f e r e n t types of i t e r ­

a t i o n methods to o b ta in s o lu t io n of the s e t of s im ultaneous

e q u a t io n s . Gauraer (6) compares the forward d i f f e r e n c e , back­

ward d i f f e r e n c e and mid d i f f e r e n c e methods f o r th e one dimen­

s i o n a l case w ith convective and r a d i a t i n g boundary c o n d i t io n s .

Page 14: Investigation of Implicit Methods for Solution of the

CHAPTER I I

STATEMENT OF THE PROBLEM

The p a r t i a l d i f f e r e n t i a l equa t ion governing h ea t conduct­

ion i n two dimensions w ith o r th o t r o p ic p r o p e r t i e s , p r i n c i p a l

axes a l ig n ed w i th th e co o rd in a te axes , and no i n t e r n a l hea t

g e n e ra t io n i s g iven by:

The problem t h a t w i l l be solved in t h i s paper i s the r e c t a n g ­

u l a r p l a t e problem shown in F ig . 1.

F i g . l . —Rectangular P l a t e Problem.

4

3

r DY

r e # ,HR

0

rc c> H c

*x-DXT dB jH B

kn

KB

r c o , H o

Page 15: Investigation of Implicit Methods for Solution of the

0

The convec t ive boundary cond i t ions a re as fo l lo w s :

1. IVca- tc o , y , t ) l KA*-KB%M1- -* b x j x=0

2. fTCB-T (x , 0, t )1 H3=-KA-~-- )L J * y / y=0

3 . [TCC-TO.X,y,t|HA=KB-|| ) x=DX

4. [TCD-T(x,DY,tllB=KA-^-| \/ ysDY

The i n i t i a l c o n d i t io n i s :

j 5. T (x ,y ,C )= f (x ,y )

A FORTRAN computer program was w r i t t e n f o r each method g iv ing

th e s o l u t i o n to the r e c t a n g u la r p l a t e problem w i th the

fo l low ing c h a r a c t e r i s t i c s :

1. O r th o t ro p ic p r o p e r t i e s ( a r b i t r a r y c o n d u c t i v i t i e s in

the two co o rd in a te d i r e c t i o n s ) .

2. D i f f e r e n t uniform f l u i d tem pera tu re on each f a c e .

3. D i f f e r e n t uniform hea t t r a n s f e r c o e f f i c i e n t on each

f a c e .

4. Uniform g r id spacing but d i f f e r e n t i n the x- and y-

d i r e c t i o n s .

For th e sake of un ifo rm ity in the comparisons, the fo l low ing

case was chosen:

1. KA-KB

2. DX=DY

3. Two a d jace n t boundar ies i n s u l a t e d .

4 . Two ad ja c e n t f l u i d tem pera tu res equal to 100°.

5. I n i t i a l tem pera ture d i s t r i b u t i o n equal to 0° .

Page 16: Investigation of Implicit Methods for Solution of the

CHAPTER I I I

. DEVELOPING THE BACKWARD DIFFERENCE METHOD

I n th e case of r e c ta n g u la r p l a t e w i th convec t ive bound­

a ry co n d i t io n s as given In F i g . 2 we can superimpose a g r id

on th e domain. We then 'approx im ate th e h e a t t r a n s f e r in the

p l a t e w i th th e h ea t t r a n s f e r between the v a r io u s nodes, i . e .

we r e p la c e the o r i g i n a l p a r t i a l d i f f e r e n t i a l equa t ion with a

s e t of one or more f i n i t e d i f f e r e n c e equa t ions which have to

be so lved .

F i g . 2 . —P la te w i th Superimposed Grid

6

1 2 3 n-1 n n-1 NB i

3

NA

ra-.l

m

m-1

2

1

Page 17: Investigation of Implicit Methods for Solution of the

7

Considering th e i n t e r i o r node (n,m) i n F i g . 2 the second space

d e r i v a t i v e s a t time k can. be approximated by:

2frb x 2 /

n,m,k

rp x'? — PT= i i k l l l . a i s z l a l n 5 1 b__fllffij.fe

(AX) 2

£ t_' i ? )n.m, k

_ ^n,m+l , k*^n , m - l ,k~2^n.,m,k (^y) 2

The time d e r i v a t i v e can be approximated a s :

_Tn,m,k~Tn ,m ,k - l 4 t /n ,m ,k -----A t -----------

In s u b s t i t u t i n g th e s e ex p ress io n s back in to the p a r t i a l

d i f f e r e n t i a l equa t ion (1) one p i l l no te t h a t while th e space

d e r i v a t i v e s a r e approximated a t t ime k, the d e r i v a t i v e w ithv

r e s p e c t to time i s a c t u a l l y approximated a t t im e:

- fc-i

To compensate f o r t h i s we can express th e space d e r i v a t i v e s

as a weighted average between time k and t ime k -1 . S e t t i n g

th e f r a c t i o n of space d e r i v a t i v e a t time k equa l to <f> , g ives

(assuming KA-K3, &x=Ay, and 6 = :

^n ,m,k“Th , r a ,k - l=® [ ^ Tn + l sm,k+Tn - l ,m ,k ~ 2Tn,m,k+ i n,m+l,k+

Tn ,m - l , k ”2Tn,m ,k^f ^Tn + l ,m ,k - l +^ n - l , m , k - l “ 2Tn , m , k - l +

Tn ,m + l ,k - l +Tn , m - l , k - l “ 2Tn,m,k-l^j ^

This method has been r e f e r r e d to by C ra n d a l l , Richtmyer (15)

and o th e r s . Two s p e c i a l cases a r e ob ta ined when <|> =1 andcj>=0.

S e t t i n g <J) “0 i n (2) r e s u l t s i n an eq u a t io n where Tn ^mj^

can be solved f o r e x p l i c i t l y i n terms of tem pera tu res a t time

Page 18: Investigation of Implicit Methods for Solution of the

k -1 . The method i s c a l l e d th e pure ly e x p l i c i t or the f o r ­

ward d i f f e r e n c e method s ince the time d e r i v a t i v e i s ev a lu ­

a ted a t T. m i, i o r in o th e r words forward from th e p o in t ofn ni ^c o n s id e r a t i o n ^njiri}u p ­

s e t t i n g <p s i i n (2) r e s u l t s i n an e q u a t io n where one

known tem pera tu re a t time k-1 i s expressed i m p l i c i t l y i n

terms of s e v e r a l unknown tem peratures a t t ime k. A s e t of

s im ul taneous , l i n e a r , equa t ions w i l l r e s u l t . So lv ing the

s e t w i l l y i e l d the d e s i re d tem pera tu re d i s t r i b u t i o n . This

method i s c a l l e d th e pure ly i m p l i c i t or the backward d i f f e r ­

ence method s in c e the time d e r i v a t i v e i s eva lua ted backward

from th e p o in t of c o n s id e ra t io n Tn jm j^.

At <J> =f an a r i t h m e t i c average of th e space d e r i v a t i v e s

a t t im es k-1 and k i s obta ined and th e method i s a p p ro p r i ­

a t e l y c a l l e d th e m id -d i f fe re n ce or the Crank-Nicolson method.

I t should a l s o be noted t h a t any value o f O ' w i l l r e s u l t in

a system of equa t ions t h a t have to be solved s im u l taneous ly .

Both th e e x p l i c i t and the i m p l i c i t methods have t h e i r

advan tages . The forward d i f f e r e n c e method i s easy to s e t up

and i t i s claimed t h a t i t has an advantage over the backward

method in the computation time per time s t e p . However, s t a ­

b i l i t y f o r th e two dimensional forward method i s only assured

when©> which pu ts a severe r e s t r i c t i o n on the s i z e of the

time increm en t . The backward method i s inconven ien t i n t h a t

i t r e q u i r e s a s o lu t io n of s imultaneous eq u a t io n s . However,

more freedom i n choice of v a r i a b l e s i s ob ta ined s in ce the

method i s s t a b l e f o r a l l va lues of & . A lso , s teady s t a t e

Page 19: Investigation of Implicit Methods for Solution of the

9

s o lu t i o n s a re obtained immediately by using an i n f i n i t e time

s t e p . The m id -d i f fe re n ce method r e q u i r e s a s o l u t i o n of sim­

u l taneous equa t ions and i s s t a b l e , but f r e q u e n t ly develops

o s c i l l a t i o n s when a sudden change in boundary co n d i t io n s

occu rs .

This paper d ea ls p r im a r i ly with the pu re ly i m p l i c i t or

i . e . the backward d i f f e r e n c e method. For a r e c t a n g u la r p l a t e

problem we w i l l ge t nine c h a r a c t e r i s t i c f i n i t e d i f f e r e n c e

eq u a t io n s , one fo r each corner node, one f o r each boundary,

and one f o r th e i n t e r n a l nodes . In the fo l lo w in g th e se

equa t ions a re developed and put i n a form convenien t f o r

s o lu t io n on a d i g i t a l computer.

The therm al d i f f u s i v i t i e s in the x - and y - d i r e c t i o n s

a r e de f ined a s :

Making an energy balance on an i n t e r n a l node using the

lumped c a p ac i tan c e approach v/e ge t :

where Tnjm jj. i n d i c a t e s th e tem pera tu re a t node (n,m) a t time

k. This equ a t io n can be reduced t o :

Summary of Node Equations

AB=KB/$c and AA=KA/$c

A t(A B )r., fa x 2

Page 20: Investigation of Implicit Methods for Solution of the

10

- A t(AA) A t( AA) __m . .Ay2 1n , r a - l , k “ Ay2 Tn,m+A,k- i n ,m ,k - l

Making an energy ba lance on node (1 ,1 ) we ge t co r re sp o n d in g ly :

i . k - Ti . i . k * TCA- Ti , i , k * TCB- !ri a , k =A.y__ 4.x__ 1 1

KAax/ 2 KBAy/2 HAAj72 HBax/2

which can be reduced t o :

,AA4t , AB4t . HAAt , HB4t . l >rp , ABAt™' CIv2 ' + ^ 1 " + “H E + ~ 5 E + a )Ti * i , k + 1 5 ^ 2 , 1 , k

+ AA^Xp = - Tl , l , k - 1 . HAAt HBAtT0BAy2 1 ’ 2 ’ lc 2 S04XTCA- Jc4yICB

S im i l a r ly we get f o r th e fo l low ing boundary nodes:

NODE <1,NA): - ( M | l + m ± t M g t ^ ) T 1>MA)k ♦Ayc

*AAMrp, A , + ABAt Tl,NA, k - l HAAtA/2 Tl , S A - l , k A.**’ T2«HA>k =--------- 2 --------- Jc4x~

rA np /wi-p i > - / AAAt ABAt HBAt HoAt\mNODE (NB,1) : - ( — 2- - - - g - - ^

•TCA - HDAtm P r\ JcAy

AB41 Ax

Awn iiAAtm , 1 , k— 1 HCAtmpp HBAtrriprp2 TN B ~ l , l ,k - . p TKB,2,k = -------- V - ---- --- *ca£TGC ? £ a ^ CB

Tt

* y f cAx So Ay

NODS (NB,NA): - ( AAAt x ABAt M HCAt ^ HDAtAy4 Ax_ g o E * gcAy ANSjNA, k *■

THB,NA,k-l“ JC4X-

AAAtm , ABAtm n , TNB.NA,k-l HCAtTPp~~2 T^ j N A - l , k + ^ 2 -TKB-l,NA,k = -------------- ~ ^ f e TCC ~

HDAt~SC Ay

:TGD

Making th e energy ba lan ce on a node on th e lower boundary we

g e t :

Page 21: Investigation of Implicit Methods for Solution of the

11

- ( 2 -AAt f Ay2

2ABAt2AxLa ly ^ oKBAt

cAy * * ^ 9 Tn - l , l , k f

♦ ^ Tn , 2 , k - ' I n . l . b - X - 2^ TCB

Correspondingly we get f o r a node on th e upper boundary:

/(-.AA^t , ^ABAt 0HDAt ■> \m , , ABAtm .• ( ^ r f 2r 3 - *■ 2 jH y + 1>I n,N A ,k *■ — g -T n -l.N A .k +

«AAAtn ,HBAtn

Ay* Axc

jiBAtrn 0AAAtm rn oHDAtmpT-.Ax2~Tn+'1,NA,k 2Ay®”Tn,NA‘*1 ,k = ” Tn’NA’ k" 1 ~ fcAyTCD

The energy ba lance on a boundary node on th e l e f t hand bound­

a ry g iv e s :

/ oAAAt oABAt oHaAt n \m , AAAtm i. AAAtm+ 2 - 2 - * - + D T 1>mjlc * - y T 1)m- l , k * 7 2 ™1 , m+1 , kAy*

^ oABAtj Ax

oHAAtn2 -2 ,m ,k = - T l , « ,k - 1 - 2P S TCA

S im i l a r ly we ge t f o r a node on the r i g h t hand boundary:

r -,AAAt ,- k2 — 5- +A y-

oABAtAX2

oHCAt^?CAX ^NB,m,k

AAAtmA y 2 ■NB j m+1, k +

AAA t rnK

O AB At mk - % B ,m ,k - l - 2p ^ j I C C

Given th e tem pera tu re d i s t r i b u t i o n a t t ime k-1 the s o lu ­

t i o n a t t ime k i s ob ta ined by so lv ing s im u l taneous ly the s e t

of equa t ions r e s u l t i n g from making th e h e a t ba lance on each

node.

By numbering the nodes from 1 to N as in d i c a t e d i n F i g . 3

th e s e t of equations can be transformed in to m a t r ix form which

then can be solved by using i t e r a t i o n , Gauss e l im in a t io n , e t c .

Page 22: Investigation of Implicit Methods for Solution of the

N-NE N

NB+1

1 2 3 4 MB

S e t t i n g :

F i g . 3*—Numbering of Nodes

A1 s HAAtgCAX

A2 = | l ^ t $ cA y A3 HCAt

* f C AX

A 4 - HDAt $ c Ay

THA =A y ^

THB ABAt" a x 2

- (THA-TKB-A1-A2-0.5 ) = 9 j

-(THA-THB-A2-A3-0.5) = 0 ;•

“ (2THA-2THB-1)

-(THA-THE-Al-A4-i) = © ■:

-(THA-TKB-A3-A4>i) = © 9

- ( 2THA-2THB-2A2-1) - Q 2

-(2THA-2THB-2A1-1) = © 4

-(2THA-2THB-2A3-1) = © 5

- ( 2THA-2TKB-2A4-1) = © 3

Using th e se s i m p l i f i c a t i o n s , the equa t ions a r e shown below

i n m a tr ix n o t a t i o n ap p l ied to a square p l a t e w ith n in e nodes:

e, THB 0 THA 0 0 0 0 0" -T]_/2-Al(TCA) -A2(TCB)

THB ©;l THB 0 2THA 0 0 0 0 T2 -T2-2A2(TCB)

0 THB ©* 0 0 THA 0 0 0 T3 -T3/2-A3(TCC)-A2(TCB)

THA 0 0 &H 2THB 0 THA 0 0 T4 -T4-2A1(TCA)

0 THA 0 THB Osr THB 0 THA 0 t 5 -T50 0 THA 0 2THB ©<. 0 0 T.EP. t 6 -T6-2A3(TCC)

0 0 0 THA 0 0 ©7 THB 0 T7 -T7/2-Al(TCA)-A4(TCD)

0 0 0 0 2THA 0 THB CD THE t 8 -Tg-2A4(TCD)

__0 0 0 0 0 THA 0 THB ©<J To -T9/2-A3(TCG)-A4(TCD)

Page 23: Investigation of Implicit Methods for Solution of the

13

I t i s noted t h a t th e n ine nodes are the fewest number of

nodes p o s s ib le i n order to r e p r e s e n t a l l the c h a r a c t e r i s t i c

d i f f e r e n c e equa t ions with equation. 5 r e p r e s e n t in g the only

i n t e r n a l node. As seen from th e c o e f f i c i e n t m a t r ix i t has a

d ia g o n a l band which can be made symmetric by m u l t ip ly in g the

i n t e r n a l equa t ions by a f a c t o r of 2.

I t should a l s o be noted t h a t the width o f th e band de­

pends e n t i r e l y on the number of nodes i n the x - d i r e c t i o n , the

width being equal to 2(i\7B ) - l .

Page 24: Investigation of Implicit Methods for Solution of the

CHAPTER. IV

DISCUSSION OF METHODS OF SOLUTION

Gauss E l im ina t ion Method

The Gauss e l im in a t io n method i s developed in Appendix A,

p p . 43-53. As noted p rev ious ly t h i s method i s commonly used

i n s t r e s s a n a ly s i s and s t r u c t u r e problems, and most o f t e n

ap p l ied to symmetric m a tr ices where the non-zero elements

a r e co n cen t ra ted in a d iagona l band. In many hea t f low pro­

blems the c o e f f i c i e n t m a tr ix i s a l so i n a s i m i l a r band form.

The number of c a l c u l a t i o n s can then be reduced by working

only w i th the elements w i th in the band. I t i s noted t h a t

th e i n d ic e s i n equations I , I I and I I I p .4? can run from n+1

to n+Mb-1 where Mb i s the width of txhe band. Furthermore i f

th e c o e f f i c i e n t m a tr ix i s used i n a symmetric form, we

observe t h a t

a i 3=a? i

The number of c a l c u l a t i o n s can then be f u r t h e r reduced by

le av in g the i unchanged in equa t ion I I , but by l e t t i n g j run

from i , i + 1 , ......... , n+Mb-1.

The s tandard Gauss e l im in a t io n working on a. f u l l m a tr ix

r e q u i r e s a number o f numerical o p e ra t io n s which i s equal to

n.3/34n2-n /3

o p e r a t io n s , n e g le c t in g a d d i t io n and s u b t r a c t i o n which a re

14

Page 25: Investigation of Implicit Methods for Solution of the

15

much f a s t e r than m u l t i p l i c a t i o n and d i v i s i o n (1 1 ) . For a

band m a t r ix , however, the number of o p e ra t io n s i s p r o p o r t i o ­

n a l to n(Mb)2 . Also the computer s to rag e can be cu t down from

n2 to n(Mb) (a l though t h i s was not done i n th e programs r e ­

por ted h e r e ) .

In many h ea t flow problems the a b s o lu te value of the

d iagona l term in th e c o e f f i c i e n t m a t r ix w i l l be the dominat­

ing term in t h a t p a r t i c u l a r row. R e fe r r in g to an a r b i t r a r y

equa t ion of e l im in a t io n (see p #44) suppose th e e r r o r i n the

numerator i s £, . Accordingly the e r r o r i n th e unknown solved

f o r i n the k ' t h row i s approxim ate ly : .

Now i f

e r r o r (Xfc) ^ £

> I , th e magnitude of th e e r r o r in i s l e s s

than | £ ( (9) p. 104.

One major d isadvan tage w ith th e Gauss method i s t h a t i t

i s no t s e l f - c o r r e c t i n g , i . e . the ro u n d -o f f e r r o r w i l l accumu­

l a t e p ro p o r t i o n a l to th e number of o p e r a t io n s , and the values

of th e v a r i a b l e s w i l l tend to be s u c c e s s iv e ly more i n a c c u r a t e

as the b a c k s u b s t i t u t i o n co n t in u es .

Gauss-Seidel Methodi

The G auss-Se ide l i t e r a t i v e method i s de r ived in Appendix

B p p . 53-62. The i t e r a t i o n can be d isc o n t in u e d by e i t h e r

sp e c i fy in g the number o f i t e r a t i o n s or by having a c e r t a i n

accuracy , e p s i lo n , s p e c i f i e d . However, i t should be noted

t h a t the magnitude of ep s i lo n does no t n e c e s s a r i l y sp e c i fy

th e e r r o r which may e x i s t in the tem p era tu re s , as t h i s i s a l s o

a f u n c t io n of th e r a t e of convergence. The f a s t e r th e r a t e

Page 26: Investigation of Implicit Methods for Solution of the

16

of convergence, the g r e a t e r the accuracy f o r a given e p s i lo n ,

because e p s i lo n i s checked a g a in s t the d i f f e r e n c e between two

su c ce s s iv e i t e r a t i o n s , not between the exac t s o l u t i o n and the

l a s t i t e r a t i o n .

One d isadvan tage w ith th e method i s t h a t i t does not

always converge. There a re s e v e ra l t e s t s f o r convergence

( see (14) p p . 56-61) and one s u f f i c i e n t , but n o t n ecessa ry

t e s t i s very convenient f o r most h ea t flow problems. Con­

vergence i s assured i f :

a i i J ^

t h a t i s , i f the magnitude of each d iag o n a l element i s g r e a t e r

th an the sum of th e magnitudes of a l l th e o f f - d ia g o n a l e l e -

£j= i ii j i —l , 2 , . . . • , n

ments i n a row.

One major advantage with the G auss -Se ide l method i s t h a t

j t i s s e l f - c o r r e c t i n g . The e r r o r does not c a r r y over from

one i t e r a t i o n to an o th e r , but i s a f u n c t io n o f th e l a s t i t e r ­

a t i o n only which in c lu d es n^ com puta t ional o p e r a t i o n s . Also

advantage can be taken of a l l th e zeroes in t h e c o e f f i c i e n t

m a t r ix by no t inc lud ing them in the i t e r a t i o n .

The i n i t i a l so lu t io n v ec to r can be chosen a r b i t r a r y or

c a l c u l a t e d in some manner. With dominant d ia g o n a l e lem ents ,

one method i s to c a l c u l a t e T. a s :

% -Tia 11

One common way to improve the G auss-Se ide l i s to a c c e l e ­

r a t e the method using an o v e r - r e l a x a t i o n f a c t o r to a c c e l e r a t e

Page 27: Investigation of Implicit Methods for Solution of the

17

th e convergence. The p r i n c i p l e behind the a c c e l e r a t i o n i s

simply to improve the i n i t i a l guess to a va lue c l o s e r to the

a c t u a l s o l u t i o n , and i n t h i s way save computer time by

c u t t in g down th e number of o p e r a t io n s . One d isad v an tag e i s

t h a t th e a c c e l e r a t i o n r o u t in e s i n some cases may r e q u i r e more

o p e ra t io n s than what i s gained by cutting down th e number of

i t e r a t i o n s . Anderson (2) g ives two methods of a c c e l e r a t i o n .

In t h i s paper th e i n i t i a l guess i s assumed to be the temper­

a t u r e s a t th e old t im e . This method, which a c t u a l l y i s a

form of a c c e l e r a t i o n , i s very s a t i s f a c t o r y f o r small time

s t e p s . For a d d i t i o n a l in fo rm a t io n see (14) p p . 144-156.

Cholesk i Decomposition Method

The Choleski decomposit ion method i s de r iv ed in Appendix

E, p p . 85-100. Like th e Gauss e l im in a t io n method i t i s p re ­

s e n t ly mainly being used in s t r u c t u r e and s t r e s s programs.

The number of o p e ra t io n s i s equal t o :

m u l t i p l i c . and d i v i s i o n s + n square ro o t so 2 3

The main advantage o f th e method i s the r e l a t i v e l y few oper­

a t i o n s compared to Gauss e l im in a t io n and G auss -S e ide l . The

number of o p e ra t io n s can be a d d i t i o n a l l y cut down by tak ing

i n t o account band and symmetry c o n d i t io n s . However, l i k e

a l l e l im in a t io n methods, the ro u n d -o f f e r r o r w i l l accumulate

i n th e answers w ith in c re a s in g number of o p e r a t io n s . Another

d isad v an tag e i s t h a t th e Choleski method only can be app l ied

t o a symmetric and p o s i t i v e d e f i n i t e c o e f f i c i e n t m a tr ix , see

(1 8 ) , p .124 . I f th e m a t r ix i s not symmetric i t can ,be t r a n s -

Page 28: Investigation of Implicit Methods for Solution of the

18

formed by p rem u l t ip iy in g by I t s t r a n s p o s e . Most h ea t flow

problems a re not n a t u r a l l y s e t up in a p o s i t i v e d e f i n i t e form,

so t h i s i s one th in g t h a t must be checked b e fo re the method

i s a p p l i e d .

For a d d i t i o n a l d i s c u s s io n on the Choleski method see

(1 0 ) , p p .270-277, and (11) , -p.36 .

Gauss-Jordan E l im in a t io n Method

The Gauss-Jordan e l im in a t io n method i s de r ived i n App­

endix D, p p .80-84. I t i s a m o d i f ic a t io n of th e c l a s s i c a l

Gauss e l im in a t io n with much the same advantages and d i s a d ­

v an tag es . The number of o p e ra t io n s i s equa l to :

+ nr - G ops.2 2

o r , i . e . somewhat l a r g e r number of o p e ra t io n s than th e Gauss

method. However, i t i s claimed t h a t a l i t t l e b i t i s gained

i n accuracy because of th e way the e l im in a t io n i s performed.

From the Appendix i t i s noted t h a t dur ing the r e d u c t io n i t

i s p o s s i b le t h a t a-Q may take on a zero v a lu e . I f t h i s

occu rs , th e f i r s t row' can be in te rchanged w ith ano ther row ■

which has a f i r s t element not equal to ze ro . In te rch an g in g

th e rows w i l l not a l t e r the o rde r of the unknown in th e f i n a l

column m a t r ix .

In t h i s paper th e method i s used to so lve a system of

HA s im ultaneous equa t ions i n the Booy method. For f u r t h e r

d i s c u s s io n on the method see James, e t . a l . (1 2 ) .

Page 29: Investigation of Implicit Methods for Solution of the

1 •*>J-9

Booy Method

The Booy method fo r the r e c t a n g u la r p l a t e problem i s

de r ived in Appendix G, p p .63- 79. I t i s q u i t e s im i l a r to the

backward d i f f e r e n c e method i n t h a t i t i s pu re ly i m p l i c i t

u t i l i z i n g a backward time s t e p . However, i t ' s s o lu t io n i s

based ori the forward e l im in a t io n , forward s u b s t i t u t i o n p r in ­

c i p l e . The tem pera tu res a t i = l and j=l,NA a r e l i n e a r fu n c ­

t i o n s of the tem pera ture of the f l u i d a t the l e f t - h a n d

boundary. The tem peratures a t i=2 and j =l,NA a r e l i n e a r

f u n c t io n s of the tem pera tures a t i = l , and so on. Solving f o r

tem pera tu re v e c to r s a t co n s tan t i and j = l , M and s u b s t i t u t i n g

w i l l r e s u l t in a s e r i e s of r e c u r s io n m a t r i c e s e v e n tu a l ly

y i e ld in g the tem pera ture of th e f l u i d on th e r ig h t -h a n d s id e

as a f u n c t io n of tem pera tures a t i = l and f l u i d tem pera tu re a t

t h e l e f t - h a n d boundary. Accordingly the tem p era tu res a t i= l

can be determined, by solving a s e t of NA sim ultaneous equa­

t i o n s . The r e c u r s io n m a t r ic e s a re then used to f in d the

tem pera tu res a t the r e s t of the i - s t a t i o n s .

This p r i n c i p l e i s much l i k e t h a t of th e t r i - d i a g o n a l

s o l u t i o n , see I saacson (11) . To apply t h i s s o l u t i o n , th e

c o e f f i c i e n t m a t r ix has to be i n the form of t h r e e non-zero

d ia g o n a l s . Considering th e p en ta -d iag o n a l m a t r ix on page 12,

t h i s can be transformed in to a t r i d i a g o n a l form by a simple

m a t r ix p a r t i t i o n i n g . The normal procedure i s to e l im in a te

T^ from the f i r s t equa t ion , T2 from th e second, e t c . , always

so lv in g f o r the h ig h e s t order of the unknown. E ven tua l ly the

l a s t equa t ion can be solved f o r Tn . B a c k - s u b s t i t u t i o n w i l l

Page 30: Investigation of Implicit Methods for Solution of the

20

then y i e ld th e unknown tem pera tu res i n r e v e r s e o rd e r . How-'

eve r , in s t e a d of e l im in a t in g in th e f i r s t eq u a t io n , T2

could be e l im in a ted and so on u n t i l Tj_ i s found from the

l a s t eq u a t io n . Back s u b s t i t u t i o n would th en y i e l d T2 > T3 ,

e t c . This p r i n c i p l e of s o lu t io n would then be i n d e n t i c a l to

t h a t of the Booy method. Also, i n performing th e m a t r ix p a r ­

t i t i o n i n g , th e r e s u l t i n g subsystem w i l l be reduced i n s iz e

which i s the s t r e n g t h of the Booy method.

The main advantage w i th the Booy method seems to be the

f a c t t h a t in s t e a d of so lv ing a s e t o f n s im ultaneous equa­

t i o n s we only so lve a system of NA equa t ions and then apply

a m a tr ix m u l t i p l i c a t i o n r o u t in e to f in d th e t o t a l tem pera tu re

d i s t r i b u t i o n . This may be p a r t i c u l a r l y advantageous when the

problem has most o f i t s nodes along th e x - d i r e c t i o n . As to

th e o th e r methods d iscu ssed i n t h i s c h a p te r , i t w i l l be a

d isadvan tage to have many nodes i n th e x - d i r e c t i o n because

th e bandwidth i s a f u n c t io n only of the number of nodes in

th e x - d i r e c t i o n . ?rhen th e p l a t e has a l a r g e r number of nodes

i n th e y - d i r e c t i o n and few i n the x - d i r e c t i o n , e x a c t l y th e

o p p o s i te i s t r u e . The o th e r methods w i l l be more advantage­

ous because th e band w id th w i l l d ec rease and ac co rd in g ly a l s o

the number of o p e r a t io n s . Also the Booy method w i l l have an

in c reased number of s im ultaneous equa t ions to so lv e . The

s to ra g e requirem ent i s l e s s because of th e sm a l le r system of

equa t ions t h a t has to be so lved .

The method i s somewhat inconven ien t to s e t up. Since

th e problem i s solved by cons ider ing tem pera tu res in column

v ec to r s f o r c o n s ta n t i ’s , t h r e e d i f f e r e n t s e t of f i n i t e

Page 31: Investigation of Implicit Methods for Solution of the

21

d if fe rence equa t ions i n m a tr ix form have to be s e t up com­

pared to one f o r the o the r methods., one a t the l e f t boundary,

one f o r the i n t e r i o r nodes, and one f o r the r ig h t -h a n d bound­

a r y . There i s a lso l e s s freedom i n choosing th e boundary con­

d i t i o n s . An in s u l a t e d boundary on the r ig h t -h a n d s id e fo r

in s tance , -would normally j u s t y i e ld a h ea t t r a n s f e r c o e f f i ­

c i e n t equal to ze ro . However, a t the r ig h t -h a n d boundary

the h e a t t r a n s f e r c o e f f i c i e n t appears i n th e denominator i n

th e Booy method. Accordingly , a d e r i v a t i v e w i l l have to be

eva lua ted and s e t equal to ze ro . In th e problem i n t h i s

pape r , the l e f t and the lower boundar ies were taken to be

i n s u l a t e d , thus avoiding the problem of d iv id in g by ze ro .

I t was found t h a t the elements of the r e c u r s io n m a t r ic e s

E^ may a t t a i n l a rg e a b s o lu te values w i th in c r e a s in g number of

nodes i n th e marching d i r e c t i o n . This r e q u i r e s inc reased

p r e c i s io n to avoid u ns tab le s o lu t io n . As an example f o r the

problem with two ad jacen t boundar ies i n s u l a t e d and th e o th e r

two a t 100°, elements of the order of 10-^ r e s u l t e d . The

i n s t a b i l i t y i s normally in troduced a t th e nodes f a r t h e s t from

th e s t a r t i n g po in t and then spreads i n a d i r e c t i o n o p p o s i te

t h a t of th e marching d i r e c t i o n . From eq u a t io n s ( 1 ) , ( 2 ) , and

(3) p.66 i t can be seen t h a t the numerical v a lu es of th e e l e -

— ments of E^ depend l a r g e l y on the num erica l s i z e of th e temp­

e r a t u r e o f the f l u i d s a t the boundar ie s .

However, b es id es problems with l a r g e numerical v a lu e s ,

th e s t a b i l i t y co n d i t io n s a re a l s o dependent upon th e number

o f s i g n i f i c a n t f i g u r e s . When the boundary tem pera tu res were

Page 32: Investigation of Implicit Methods for Solution of the

22

decreased by a f a c t o r of 10, the method s t i l l became un­

s t a b l e f o r small time increm ents . The reason i s t h a t during

th e c a l c u l a t i o n of the tem pera tu res , numbers t h a t only d i f f e r

a t a s i g n i f i c a n t f igu re -w hich exceeds the s in g l e p r e c i s io n

c a p a c i ty a r e su b t r a c te d and added. This problem resembles

an i n i t i a l va lue problem mentioned by Richtmyer (15 ) , in

which he concludes t h a t the method i s of l im i t e d va lue .

Page 33: Investigation of Implicit Methods for Solution of the

CHAPTER V

DISCUSSION OF RESULTS

For th e sake of comparison a l l th e runs were made w ith

th e fo l low ing param ete rs :

DX = DY - 1”

KA = KB = 1 B/sec i n F

HA * HB » 0 B/sec in^ F

HC = HD = 1 B/sec in2 F

TCA ® TCB = 100° F

TCC = TCD = 0° F

AA = AB - 1 sq. i n / s e c

NA = NB

Runs where made w ith 16, 49, and 100 nodes and a l l compari­

sons made a f t e r 0 .2 seconds. The tem pera tu res were compared

a t th e same p o in t , node 4 f o r N=l6, node 17 f o r N=49, and

node 34 f o r N=100. The exact tem pera tu re a t t h i s po in t a f t e r

0 .2 seconds w i th th e parameters s p e c i f i e d was ob ta ined

from t a b l e s of s o lu t io n s fo r one d im ensiona l problems (20) .

By apply ing th e p r i n c i p l e of th e product s o l u t i o n , t h e s o lu ­

t i o n of the two-dimensional problem was o b ta in ed . For a

d e r i v a t i o n of the product s o lu t io n method, see Carslaw and

Jaeg e r ( 5) , pp .33-35 . Only one i t e r p o l a t i o n had to be made

i n th e t a b l e , and t h i s was done by f i t t i n g a second o rde r

23

Page 34: Investigation of Implicit Methods for Solution of the

24

parabo la to th r e e g iven p o in t s . The tem pera tu re according

to th e t a b l e was:

T ( s tan d a rd ) ~ 15.4207°

F i g . 4 p.25 shows th e tem pera tu re versus time response f o r the

node of c o n s id e r a t i o n . A ll comparisons were made a f t e r 0 .2

seconds, when th e tem pera tu re has reached about 15$ of the

s teady s t a t e va lve as i n d ic a t e d in th e f i g u r e .

A s u b ro u t in e , CLOX, was in c o rp o ra te d i n th e program in

o rder to e v a lu a te th e computer time d i f f e r e n c e per time s tep

f o r each method.

Computer Time

The computer time f o r a p a r t i c u l a r method and a p a r t i c u ­

l a r computer i s mainly a f u n c t io n of the number of a r i t h ­

m etic o p e ra t io n s (here def ined as m u l t i p l i c a t i o n s and d i v i ­

s i o n s ) , bu t a l s o of n ec essa ry l o g i c , number o f a d d i t io n s and

s u b t r a c t i o n s , e t c . F i g . 5 p .26 shows th e number of o p e ra t io n s

versus th e number o f nodes, and F i g . 6 p .2? and F i g . 7 p .28

show the computer time per t ime s te p fo r© =1/16 and © =2

r e s p e c t i v e l y . In F i g . 5 i t should be noted t h a t the o p e ra t io n s

f o r the G auss-Se ide l method i s given per i t e r a t i o n . This

i n d i c a t e s how many i t e r a t i o n s a r e r eq u i red f o r convergence

f o r th e G auss-Se ide l method to have a t o t a l number of oper­

a t i o n s equal to th e number of o p e ra t io n s f o r th e o th e r methods.

From the f i g u r e i t can be seen t h a t a t 40 nodes fo r i n s t a n c e ,

th e G auss-Seide l method must have 5 i t e r a t i o n s or l e s s in

o rder f o r i t to be f a s t e r than th e Choleski method. From the

Page 35: Investigation of Implicit Methods for Solution of the

Tem

pera

ture

2?

1 2 3 4Time, sec .

F i g . 4 . —Temperature Response f o r Node o f C o n s id e ra t io n

Steady S t a t e100 '

80-

40-

0

Page 36: Investigation of Implicit Methods for Solution of the

Num

ber

of

Ope

rati

ons

26 '

F i g . 5 . —Number of Operations vs . Number of Nodes

3(104)

2(104)

104

010 20 30 40 50

Number of Nodes

T o p s . / i t e r a t i o n )

G auss-Se ide l

Choleski / ( o p s . / / time s tap )

Gauss E l im in a t io n ( o p s . / t im e s tep)

Page 37: Investigation of Implicit Methods for Solution of the

27

GaussG auss-Seide lCholeskiBooy

20 40 60 80 100

150-

100-

5 0 -

0

• -v©nOvOX0-pCO0S•HEH

0Ph0E

•HEH

0-P3Q.aoo

F i g . 6—Computer Time vs . Number of Nodes for© =1/16

Number of Nodes

Page 38: Investigation of Implicit Methods for Solution of the

Com

pute

r Ti

me

per

Tim

e S

tep

x 60

se

c.

2.8

800

600

400

200

020 40 60 80 100

F i g . 7 . — Computer Time vs. Number of Nodes f o r ^ -2Number of Nodes

Page 39: Investigation of Implicit Methods for Solution of the

29

graphs i t i s obvious, t h a t the number of o p e ra t io n s to a g r e a t

e x ten t i n d i c a t e s th e time per time, s t e p . For 6 =2 the

Choleski method proves to be th e f a s t e s t method; about twice

as f a s t as th e Gauss e l im in a t io n method and s e v e r a l t imes as

f a s t as th e i t e r a t i o n . The Bcoy method, however, has ap p ro x i ­

mate ly th e same computation t imes as th e C ho lesk i .

For 0 * 1 / 1 6 i t i s noted t h a t the Gauss e l im in a t io n method

i s by f a r . t h e s low est . The Choleski method i s f a s t e s t up to

about 70 nodes w h erea f te r th e Gauss-Seide l i s f a s t e s t .

In h e ren t i n the i t e r a t i o n method i s th e f a c t t h a t th e c lo s e r

to the a c t u a l answer the i n i t i a l guess i s , the fewer i t e r a ­

t i o n s a re r eq u i red f o r a s p e c i f i e d accu racy . The sm al le r 9 i s , the sm a l le r the time s tep i s , and th e c l o s e r the temper­

a t u r e s a t time k+1 w i l l be equal to those a t time k, and

acco rd in g ly fewer i t e r a t i o n s a re needed f o r convergence. I t

should a l s o be noted t h a t the computer time per time s tep

was taken as the one a t time equal to 0 .2 s e c . when the

tem pera tu re was 15$ of th e s teady s t a t e v a lu e . However, f o r

t imes c l o s e r to zero th e re i s a g r e a t e r change in tem pera tu re

per time s te p and acco rd ing ly computer t imes were ap p rec iab ly

h ig h e r than the one p lo t t e d on the graph. I n f a c t the t o t a l

computer time f o r the Gauss-Seide l method up to time equal

to 0 .2 seconds i s probably g r e a t e r than th e t o t a l time fo r

Cholesk i or Booy. I t should a l so be noted t h a t f o r a l l values

of 1/16 the computation t ime f o r G auss-Se ide l i s h ighe r

than those of the Choleski and Booy methods f o r a l l g r id

sp ac in g s . -

Page 40: Investigation of Implicit Methods for Solution of the

30

Another i n t e r e s t i n g obse rva t ion i s t h a t due to the

i n t e r n a l lo g ic of the computer, the computer t ime per time

s te p f o r a p a r t i c u l a r g r id spacing w i l l i n c r e a s e i f

r each es a c e r t a i n l e v e l . For© =1/16 and © =1/4 and w ith 49

nodes the computer t i n e w i l l be 58/60 seconds. However,

fo r© =1 and©=2 and the same number of nodes , th e time jumpes

t o 98/60 seconds.

E rro r

Numerical s o lu t io n s of p a r t i a l d i f f e r e n t i a l equa t ions

a r e s u b je c t to d i f f e r e n t types of e r r o r , th e most im por tan t

of which a re t r u n c a t i o n and round-o ff e r r o r . The t o t a l e r r o r

i s de f ined as the d i f f e r e n c e between th e exac t and the ca lc u ­

l a t e d v a lu es . I t i s agreement in the l i t e r a t u r e t h a t i n most

a p p l i c a t i o n s the t r u n c a t io n e r r o r has a much g r e a t e r i n f l u ­

ence on the t o t a l e r r o r than does numerical o r ro u n d -o f f

e r r o r . However, the Booy method in t h i s paper dem onstra tes

th e in f lu e n c e round-o ff e r r o r can have.

The t r u n c a t i o n e r r o r i s due to the approxim ation of the

p a r t i a l d i f f e r e n t i a l equa t ion with th e f i n i t e d i f f e r e n c e

ex p re s s io n s . The t r u n c a t io n e r r o r de te rm ines the convergence

to th e exact s o l u t i o n . The ro u n d -c f f e r r o r i s due to the

chopping o f f of a number a f t e r a c e r t a i n number of s i g n i f i ­

cant f i g u r e s . Thus I f an i n f i n i t e number of decimals were

c a r r i e d along i n th e c a l c u l a t i o n s , the ro u n d -o f f e r r o r would

van ish . In p r a c t i c a l a p p l i c a t i o n the ro u n d -o f f e r r o r can be

decreased by using double p r e c i s io n which, however, g r e a t ly

in c r e a s e s the computer t ime.

Page 41: Investigation of Implicit Methods for Solution of the

31

T runca t ion Error

An ex p res s io n of the t r u n c a t io n e r r o r f o r the one dimen­

s io n a l case i s given in Schneider (16) and Richtmyer (1 5 ) .

For th e two dimensional case expanding Tn,m,k-1> ^n-l ,m,k>

Tn-l ,m,k> Tn ,m - l ,k , Tn ,m - l ,k i n T a y l o r ' s s e r i e s about Tn>fflyk

g iv e s :

T n - l ,m ,k Is n ,m,k"Ax^ T/ ^ x )n ,m ,k4,.........+ax4/2 4 (^ f / d x 4 ) n>ni}k+ . . .

Tn ,m - l ,k =Tn}rn,k-Ay ^ T / ^ y ) n , mji£+ . . . . .+Ay4/2 4 ( b 4T/a>y4) n , m, k+ . . .

I 'n -1, m, k=^ n , m, k+AX /^x) n , m, k+.........+Ax4/24 (&4T /^>x4 ) n , m, k+ • • •

^n ,m +l,k=^n ,m ,k+Ay$T /& y )njm>k+ .........M y4/24(&4T/^y4 ) njmjk+. • •

^n ,m ,k+ l”^h .^m ,k+^ i^T /^ i)n ,m ,k+ .........+ A t - /2 (^ ^ T /^ t^ )njmjk+. • • •

The f i n i t e d i f f e r e n c e approximation can now be r e w r i t t e n by

s u b s t i t u t i n g th e s e r i e s expansions. Assuming-uniform

c o n d u c t iv i ty :

(™n, m, k- l “Tn , % k^ t =c / n , m, k+£ ^ ^ ) n , m, k* • •]

Assuming Ax=Ay:

^Tn - 1, m, ktTn*1, m, k*'Tn,m-1, k ^ n , mvl, k”4xn , m, / ' =

( i aI / i x 2) I, t ,Il)li4.Ax2/ 1 2 ^ 4T / ix 4 ) n)In. lc+ . . . J + (■& 2T /i>y2) n , m:a k+

Ay4/ 1 2 [ ( i ^ y 4 ) n>1Citf........... ] (2)

D ef in ing th e t r u n c a t i o n e r r o r as th e d i f f e r e n c e between the

l e f t - h a n d s id e s of equations (1) and (2) and assuming t h a t

T i s an exact s o lu t io n , i . e . :

Page 42: Investigation of Implicit Methods for Solution of the

A(& T/bt)-b2T/5x2- b 2T/6y2«0

g iv e s , i f we n e g l e c t h ig h e r o rde r te rms:

T runca t ion Error= A O t / 2) (d2T / d t 2)-Ax2/1 2 ( ^ 4? / ^ 4 )-Ay2/1 2 ( ^ 4T / V b

S u b s t i t u t i n g : ^ 2T / ^ t 2=l/dk2^ 4T/^Jc4+b4T/by^j

o r : T runca t ion H rro r=(A t /2 - (A 2x/12) ) (d4T/&x4+b4T/£>y4 )

I t i s seen t h a t the t r u n c a t i o n e r r o r i s minimized when:

At/2-dUAx2/12)=0

o r : A tA A x 2»i /6= ©

The t r u n c a t i o n e r r o r can now be c a l c u l a t e d by using a f i n i t e

d i f f e r e n c e approxim ation f o r ^ 4t / d x 4 a n d ^ T / ^ t . Of course

th e t r u n c a t i o n e r r o r can only be approximated t h i s way.

F i r s t of a l l t h e r e i s the i n i t i a l approxim ation b:/ only

cons ide r ing a few terms in the T a y l o r ' s s e r i e s . Second,

th e r e w i l l be an e r r o r i n approximating the t r u n c a t i o n e r r o r .

The r e s u l t s a r e shown i n F i g . 8 p .33 where t r u n c a t i o n e r r o r i s

p lo t t e d versus time f o r v a r io u s 0 ' s . The r e s u l t s seem to

v e r i f y t h a t th e t r u n c a t i o n e r r o r i s indeed minimized f o r& =1 /6 . A ll th e methods a r e in f lu en ced to the same degree by

t r u n c a t io n e r r o r s in c e they a l l use the same f i n i t e d i f f e r e n c e

approx im ations .

Round-Off E r r o r .

The e f f e c t of ro u n d -o f f e r r o r i s d i f f i c u l t to p r e d i c t

and many of th e p r e s e n t t h e o r i e s a re very l im i te d in a p p l i ­

c a t i o n . According to Hammond (8) " . . . A t p re se n t time th e r e

i s no r e a l l y s a t i s f a c t o r y t h e o r y , . . . " However, the l a r g e r

th e number of a r i t h m e t r i c o p e r a t io n s , th e g r e a t e r w i l l be the

Page 43: Investigation of Implicit Methods for Solution of the

Tru

ncat

ion

Err

or

33

F i g . 8 . —Trunca t ion E rro r vs. Time f o r D i f f e r e n t <91s

10

1

.1

.01

0

-.01

- . 1

-1

5.55 11.11 \ 16.66 22.22 \ \ Time x 100, sec

$ =1/16

O = 1/6

O =1/4

e=±9 =2

Page 44: Investigation of Implicit Methods for Solution of the

Err

or

x 10

0,

degr

ees

Err

or x

100

, de

gree

s34

F i g . 9 . —E rro r Curves f o r Choleski and Gauss Methods

F i g . 1 0 .—E rro r Curves f o r G auss-Se ide l I t e r a t i o n

Page 45: Investigation of Implicit Methods for Solution of the

F i g . 1 1 .—Erro r Curves f o r Booy Method

moot-iM0)oc*

oof-twuouflm

Page 46: Investigation of Implicit Methods for Solution of the

36

e f f e c t o f round ing . Rounding and t r u n c a t io n w i l l be i n t e r ­

r e la t e d to a c e r t a i n e x t e n t , but n e g le c t in g t h i s i n t e r r e l a t e d

e f f e c t i t should be v a l id to say th a t the t o t a l error w i l l be

ap p rox im ate ly a l in e a r fu n c t io n o f rounding and t r u n c a t io n .

In t h i s paper th e t o t a l error i s the d i f f e r e n c e between

1 5 .4 2 0 7 ° and th e v a lu e c a lc u la t e d by th e com puter. I t should

be noted th a t th e va lu e 15 .4207 i s n o t e x a c t , but depends on

th e accu racy o f th e t a b le s used and th e i n t e r p o l a t i o n made.

The t o t a l error as a fu n c t io n o f Q i s shown in F i g s . 9>

10 and 11 on p p .34-35* However, even a t 100 nodes th e accu ­

r a c i e s f o r th e C h o lesk i and th e Gauss e l im in a t io n methods

a re th e same t o th e th ir d and fo u r th d e c im a l . C on siderin g

th e g r e a t d i f f e r e n c e in th e number o f o p e r a t io n s , t h i s should

i n d i c a t e th a t the e f f e c t o f rounding i s n e g l i g i b l e . The

Booy method, how ever, i s g r e a t ly in f lu e n c e d by r o u n d -o f f error

b e in g u n s ta b le f o r 1=49 a n d © = l / l 6 and f o r N-100 and©£q|*,

Comparing th e e rro r o f th e Booy method w ith th e o th e r m ethods,

i t a l s o seems th a t th e r e s u l t s at© =1 and N=100 are i n f l u ­

enced by round ing , which d e c r e a se s w ith in c r e a s in g © .

Comparing th e t o t a l e r r o r s o f th e methods shows th a t

th e C h o lesk i d e c o m p o sit io n method and th e Gauss e l im in a t io n

method are i d e n t i c a l as fa r a s a ccu ra cy . The G a u s s -S e id e l

method i s somewhat l e s s a c c u r a te , p a r t i c u l a r l y f o r la r g e N1s .

T h is could o f co u r se be c o rr ec ted by d e c r e a s in g e p s i l o n which

would a g a in in c r e a s e th e number o f o p e r a t io n s and a c c o r d in g ly

th e computer t im e . The Booy method i s very a c c u r a te fo r sm e ll

N 's

Page 47: Investigation of Implicit Methods for Solution of the

37

Making a comparison between th e t r u n c a t i o n e r r o r and the

t o t a l e r r o r shows t h a t f o r 16 nodes th e r e i s a minimum e r r o r

a t 6 approxim ate ly equal to 1 /6 fo r a l l the methods. This

i s to he expected s ince i t i s the value of Q which minimizes

t h e t r u n c a t i o n e r r o r . This r e l a t i o n s h i p i s no t obvious fo r

l a r g e r number of nodes. One reason f o r t h i s i s t h a t th e

e f f e c t of the' t r u n c a t io n e r r o r d ec rease s w i th d ec re a s in g © .

From the t r u n c a t i o n e r ro r curve i t i s noted t h a t the e f f e c t

of t r u n c a t i o n w i l l dec rease w ith time f o r a g iven © . How­

eve r , b e fo re th e tem pera tu re - t im e curve s t a r t s to l e v e l o f f

towards th e s teady s t a t e va lue , the t o t a l e r r o r w i l l c a r ry

over from time k to time k+1 and not d ec re a se w i th time l i k e

t r u n c a t i o n e r r o r . I t can a l s o be noted from th e curves t h a t

f o r small N 's , the e r ro r in c re a s e s g r e a t l y w i t h # , whereas

f o r N=49 and N=100, the e r r o r w i l l i n c r e a s e w i th in c re a s in g

© , but to a much l e s s e r degree .

Optimizing Computer Time and Accuracy

In a l l numerical work i t i s d e s i r a b l e to have the

r e s u l t s as a c c u ra te as p o s s i b l e . However, i f th e accuracy

i s improved by f o r in s ta n c e d e c r e a s i n g © , in c reased computer

t ime w i l l i n e v i t a b l y fo l low . In most a p p l i c a t i o n s the

computer time has to be l im i te d because of economical r e a so n s .

The q u es t io n i s then how much can be s a c r i f i c e d in accuracy

i n o rde r to cu t down the computer t im e, depending on the

p a r t i c u l a r problem.

One way to do t h i s i s to p lo t the f u n c t io n :

y=a(Tot. computer t im e ) + b ( to t a l e r r o r )

Page 48: Investigation of Implicit Methods for Solution of the

38

v e r s u s © , where a and b a re f a c t o r s whose va lues depend on

th e importance of computer t ime and t o t a l e r r o r fo r the

p a r t i c u l a r problem. To get a common, b a s i s fo r comparison

the p l o t s of computer time vs . © and e r r o r v s . & a re normal­

iz e d , the e r r o r w i th r e s p e c t t o the l a r g e s t e r r o r a t ©=2 and

th e computer time with r e s p e c t to th e l a r g e s t t ime a t ©=1/16

choosing b equal to 1-a and 0£a£l w i l l r e s u l t i n a l l va lues

of y being between 0 and 1. The e r r o r w i l l in c re a s e w i th

in c re a s in g © and th e computer t ime w i l l d e c re a s e . This

a s s u re s t h a t y w i l l be minimized f o r a c e r t a i n value of Q .

T h is © w i l l acco rd in g ly g ive an optimized s o l u t i o n of the

method f o r th e par t icu lar va lue of a .

F ig s . 12-14 on. p p .39-4-0 show y v e r s u s © fo r the fo u r

methods, w i th a=-g-, and N-l6 . Based on th e s e param eters the

Choleski method i s b e s t w i th y=0.3> then Booy w ith y=0.33,

Gauss e l im in a t io n with y=0.38 and Gauss-SeideT w ith y - 4 .2 .

Page 49: Investigation of Implicit Methods for Solution of the

39

F i g . 1 2 .—Optimizing 0 f o r Booy Method

F i g . 1 3 .—O ptim iz ing© f o r Gauss-Slim. Method

Page 50: Investigation of Implicit Methods for Solution of the

40

F i g . 1 4 .—O ptim iz ing© f o r Choi .Ilethod

F ig . 1 5 .—Optimizing Q f o r Gauss-Seidel Ilethod

Page 51: Investigation of Implicit Methods for Solution of the

CHAPTER VI

CONCLUSIONS

The behav ior of s e v e ra l i m p l i c i t f i n i t e d i f f e r e n c e

methods in the s o lu t io n of a two-dimensional h e a t flow

problem w ith convec t ive boundary co n d i t io n s has been d i s c u s s e d .

In l i g h t of th e in fo rm at ion ob ta ined , s e v e ra l conc lus ions

may be drawn,

1. The computer time per time s te p i s a f u n c t io n of the

number of ar i thrae tr ic o p e r a t io n s . In most cases the Choleski

decomposit ion method i s f a s t e s t with the Booy method a l s o

being f a s t e r th an Gauss e l im in a t io n and G auss-Se ide l i t e r ­

a t i o n . However, f o r small time s tep s the G auss-Se ide l method

w i l l improve co n s id e rab le compared to the o th e r methods.

2. The t r u n c a t i o n e r r o r I s the same fo r a l l methods

because they a r e a l l using the same f i n i t e d i f f e r e n c e approx­

im a t io n s . Also, the t r u n c a t i o n e r r o r can be minimized by

using a 0 = 1 / 6 . This was p a r t l y v e r i f i e d by th e r e s u l t s .

3 . The ro u n d -o f f e r r o r does not have any s i g n i f i c a n t

e f f e c t r e l a t i v e l y e a r ly i n th e t r a n s i e n t s o l u t i o n on the

Cho lesk i , Gauss e l im in a t io n , and Gauss-Seide l i t e r a t i o n

methods. This can be concluded because a l though the Gauss

e l im in a t io n and Choleski methods d i f f e r by a l a r g e number of

o p e ra t io n s t h e i r a c c u ra c ie s a r e the same. The Booy method

4 1

Page 52: Investigation of Implicit Methods for Solution of the

42

has s t a b i l i t y problems f o r small time s te p s and l a rg e number

of nodes . However., once s t a b l e , i t i s r e l a t i v e l y a c c u r a te .

As f a r as o v e r - a l l accuracy the .G auss e l im in a t io n and Choleski

decomposit ion a r e the most a c c u r a t e .

4 . The Choleski decomposit ion method i s f a s t e r and a t

l e a s t as a c c u ra te as t h e o th e r methods. The Gauss method i s

a c c u r a te , but' r e l a t i v e l y slow, whereas the Booy method i s

l im i te d i n a p p l i c a t i o n because of s t a b i l i t y problems.

5. An optimum O can be ob ta ined f o r a p a r t i c u l a r p ro­

blem by a s s ig n in g weight f a c t o r s to accuracy and computer

t im e . The "b e s t" method can then be found f o r th e p a r t i c u l a r

problem simply by comparing th e optimum© 1 s of the v a r io u s

methods.

Page 53: Investigation of Implicit Methods for Solution of the

43

APPENDIX A

THE GAUSS ELIMINATION METHOD

Page 54: Investigation of Implicit Methods for Solution of the

THE GAUSS ELIMINATION METHOD

The system of equa t ions le ad in g to th e s o l u t i o n of the

backward d i f f e r e n c e method can be w r i t t e n i n th e form:

* a l l Tl +a12T2+.................. +alNTH = b l

a 21Tl +a22T2+.................. +a2NTN “ b2

aNlTl +aN2T2+ ....... ...........+aM % = bN

Using the Gauss e l im in a t io n method the f i r s t s t e p i s to

so lve the f i r s t eq u a t io n f o r T]_:

Tl=b l / a l l “ ^a 12^a l l ^ T2’' (a 13 /a n ) T3~ ...............- ( a i N/ a n ) T N

S u b s t i t u t i n g t h i s back in to th e remaining equa t ions of the

o r i g i n a l s e t and e l im in a t in g T1? a modif ied s e t of equa t ions

i s o b ta in e d :

a 22T2*a23T3+

a 32T2*a33T3*

+a2 # f = b2

+a3NTN = b3

aN2T2+aN3T3f '+aNNTN = bN

where:

44

Page 55: Investigation of Implicit Methods for Solution of the

4 8

a i r s i r Ai i /Au

bi =bi - a i l bl / a U

. •. • • •, i\

1 = 2 , 3 , ............ ,W

A s i m i l a r procedure can now be used to so lve f o r Tp in

th e primed system. Back s u b s t i t u t i o n w i l l f u r t h e r reduce th e

o r i g i n a l system. The e l im in a t io n o f Tn w i l l then y i e l d :

V v > * jj=n+l,n+2, ......... ,N ( I )

i , j= n + l ,n + 2 , . . . . . . N ( I D

i=n+l ,n+2 , • ......... N ( i l l )

equa t ions i s reduced to one equa t ion which can be solved

d i r e c t l y f o r T,^:T bN - lA.N-li N=DN /c-NN

The r e s t of th e unknowns a re then determined by back s u b s t i ­

t u t i o n i n t o equa t ion I where the necessa ry c o e f f i c i e n t s a re

determined from I I and I I I .

A computer program l i s t i n g of the backward d i f f e r e n c e

method w ith th e Gauss e l im in a t io n method of s o l u t i o n i s shown

on pp .47-52. The Gauss e l im in a t io n method i s conta ined in

th e su b ro u t in e ’'MUSS** and the flow c h a r t i s shown on p .4 6 .

The nomenclature in the flow c h a r t corresponds to t h a t of the

computer program.

Having ap p l ied t h i s procedure .N-l t im es , the o r i g i n a l s e t of

Page 56: Investigation of Implicit Methods for Solution of the

Read A,B,N,NB,JP,M

Eand width MB«2(NB)*1

K~1

r - i + i

Genera te A ( I , J )

I-Nil

Generate D(K)

NN-IP--MB-2

Compute X(Njl)I=IP

Generate H(IC,J).

T-■IP

KK=N-1

Compute X(XX,1)

KK=iK-1

+

46

Page 57: Investigation of Implicit Methods for Solution of the

SJOB THS750 MOD. GAUSS K. GUNDERSEN 7DIMENSION! W(101.1) .NAME (13) .0(101. 1).B(101.1).A(1G1.101)

C----- THIS SECTION READS AND WRITES INPUT OATA30 11=0

CALL CLOX(II)12=11-11 11 = 1 ILOGICAL ZEROREAD(5.10) (NAME(M).M*l.13)READ(5.11) NA.NB.IFREQREAD(5.12) DA.D8.DELT.TMAXREAD(5.12) AA.A3.FKA.FKBREAD(5.12) TCA.TCB.TCC.TCO.HA.HD.HC.HDREAD(5.13) ZERO

10 FORMAT(13A6)11 FORMAT(3110)12 FORMAT!8E10.0)13 FORMAT(LI)

N=NA*NBIF(.NOT.ZERO) GO TO 3 DO 1 1=1.N

1 W( I . 1 )=0.GO TO 4

3 READ(5.12) (W (I .1).I=1.N )4 WRITE(6.20) (NAME(M).M=1,13)

20 FORMAT(1H1.13A6)WRITE{6 * 21) NA.NB.DA.DB.DELT

21 FORMAT(1H0» 3HNA = »13 »11X,3HNB=,13.11X .3HDA=.E10.3.4X.3H0B=.E 10.3. 4X 1,5H0ELT=»E10.3)WRITE(6.22) AA.AB.FKA.FKB.TMAX WRITE(6 * 23) HA.HB.HC.HD.TCA.TCB.TCC.TCD

23 FORMAT(1H , 3HHA=E 1 0.3.4X ,3HHE3= .El 0.3.4X , 3HHC= . E10.3.4X, 3HHD=. E10.3 2.4X,4HTCA=,F7.1,4X,4HTC8=.F7.1.4X ,4HTCC=*F7.1.4X»4HTCD=*F7•1)

2 2 FORMAT( 1H . 3 H A A = » E 1 0 . 3 , 4 X . 3HAB= . E l 0 . 3 , 4 X , 3 HKA=. E l 0 . 3 , 4 X . 3 H K B = . E 1 0 • 3 3 . 4 X . 5HTMAX=. E 1 0 • 3 )WRITE!6.24)

Page 58: Investigation of Implicit Methods for Solution of the

24 FORMAT*1H0.42HTEMPERATURES PRINTED IN FORMAT— (N) TEMP--) 99 FORMAT*1H ,1OX,5HTIME=,E12.5,16HI NT. TIME DIFF.=,I12)

C----- THIS SECTION GENERATES NECCESSARY PARAMETERSICO = l TIME=0.0 ANA=NA BNB =NBY=DA/(ANA-1•)X=DB/*BNB— 1•)THA=DELT*AA/*Y**2.)THB-DELT*AB/(X**2.)RHOC=FKA/AAAl=HA*DELT/*RHOC*X)A2=HB*DELT/*RH0C*Y)A3 = HC*0ELTy'*RH0C*X)A4=HD*DELT/*RHOC*Y)N=NA*NBN3=NB**NA-l>+l N2=N-1 N4=NB-1 N6=N3+1 N 8=1+NB N 9 = N 3—NB N10=2*NB Nil=N—NB DO 45 1=1,N

45 O*I,1)=0.D*1♦1)=-Al*TCA— A2*TCB 00 41 I=2 * N4

41 D*I,1)=-2.*A2*TCB0(NB * 1)=-A3*TCC-A2*TCB D*N,1)=-A3*TCC-A4*TCD O (N 3»1)=-A1 *TCA-A4*TCO DO 42 I=N6,N2

42 0*I.1)=-2.*A4*TCD DO 43 I=N8•N9 »NB

■Pco

Page 59: Investigation of Implicit Methods for Solution of the

43 DtI»1 ) =—2.*A1*TCA DO 44 I=N10»N11.N8

44 Dt I . 1 )=-2.*A3*TCCCALL MATOUTt D * N « 1*101*1.0.0.0.0)CALL CLOX(I I)12=11-11WRITEi6*99) TIME.12 11 = 11CALL MATOUT(W.N.l.101*1.0.0.0.0)TI ME=TIME+OELT

51 CONTINUEC----- THIS SECTION GENERATES THE PENTA-DIAGONAL MATRIX

DO 9 1=1.N DO 9 J=1•N

9 A(I.J )=0.DO ICO I=1.N

100 A(I.I)=-t2.*THA+2.*THB+l.)A{1.1 )=-(THA+THB + Al + A2+0.5>A(N .N ) =— (THA + THB+A3+A4+ 0•5)A(NO «N B )=-t THA+TH8 + A2+A3+0.5)A(N3*N3)=-(THA+THB+A1+A4+0.5)N 1=N—NB DO 110 1=1.N1 N 13=I+NB

110 A d ,N13)=THA N 12=NB+1 DO 120 I=N12.N N 14=I—NB

120 At I»N 14 > =THA NN = 0DO 130 1=1.N2 NN=NN+1IF(NN.EQ.NB) GO TO 14 At I , 1 + 1)=THB GO TO 130

14 NN=0

vO

Page 60: Investigation of Implicit Methods for Solution of the

130 CONTINUE KK = 0DO 15 1=2,N KK=KK+1IFCKK.EO.NB) GO TO 16 A ( I * I— 1)=THB GO TO 15

16 KK = 0 IS CONTINUE

00 210 I=2•N4 N 5=I+NBA(I, I)=-(2.*THA+2.*THB+l.+2.*A2>

210 A (I,N5)=2,*THA DO 220 I=N6 * N2 N 7=1—NBA (I, I )=— (2, *THA+2,*THB+1•+2,*A4)

220 A (I,N7)=2.*THADO 230 I -=N8 * N9 » NBA(I,I)=-(2,*THA+2.*THB+l.+2,*A1)

230 A( I,1+1)=2•*THBDO 240 I=N10 * NX 1 ,NB A (I• I )=-(2.*THA+2.*THB+l.+2.*A3>

240 A (I» I— 1)=2.*THBC----- THIS SECTION GENERATES THE CORRESPONDING COLUMN MATRIX

DO 46 1=1,N 46 Q(I * 1 )*D(I•1)-W(I,1)

B(l.l)=D(l,l)-vm,l>/2.8(NB * 1)=D(NB * 1) — W (NO * 1)/2•B(N3,l)=D(N3,l)-W(N3,l)/2.8(N,1 )=D(N,1)-W(N.l )/2.

C----- THIS SECTION SOLVES THE SYSTEM USING MOOIFIED GAUSS ELIMINATIONCALL MAUSS(A •101*101 ,D »101 •W * i 01» N,NB)CALL CLOX(H)12=11-111 1=1 IIF(TIME-TMAX) 40,47,47

'Ji.O

Page 61: Investigation of Implicit Methods for Solution of the

48 IF(I CO•EQ•IFREQ)GO TO 49 ICO=ICO+lTIME=TIME+DELT GO TO 51

49 WRITEl6,99) TIME.12CALL MATOUTtW.N.l.101.1 .0.0.0.0)ICO = lTIME=TIME+DELT GO TO 51

47 CONTINUE GO TO 30

333 STOP ENO

$ IBFTC MAUSS DECKSUBROUTINE MAUSS(A •I A •JA.B.IB•X ,I X ,N.NB)DIMENSION A {IA.JA).B{IB•1)»X(IX.1).H (101.101).D(101)

C----- MAUSS SOLVES THE SYSTEM USING MODIFIED GAUSS ELIMINATIONMB=2*NB+1 M=N-1 IP = 2DO 6 K=1.M D ( l< ) =B I K . 1 ) /A ! K . K )NN= IP +MB—2 IF(NN.GT.N) GO TO 10 GO TO 1 1

' 10 NN=N11 CONTINUE

DO 16 I=IP,NN 16 B(I,1)=B<I,1)-A<I,K)*D(K)

00 5 J=IP.NN H(K,J)=A(K,J)/A(K,K)DO 5 I=IP.NNA (I . J ) = A(I.J)—A{I»K / *H(K .J )

5 CONTINUE6 IP=IP+1

X {N » 1 )=B(N,1)/A(N.N)

vnH-*

Page 62: Investigation of Implicit Methods for Solution of the

GO TO 12

JP=N KK=N

a s u m =o *KK=KK—1 NN=JP+MB-2 IFINN.GT.N)GO TO 13

12 NN=N13 CONTINUE

DO 9 J=JP.NN9 SUM=SUM+H(KK.J)*X(J.l)

JP=JP-1X (KK•1)=D(K K )— SUM IF(KK.NE.l) GO TO 8 RETURN END

ro

Page 63: Investigation of Implicit Methods for Solution of the

53

APPENDIX B

THE GAUSS-SEIDBI. METHOD

Page 64: Investigation of Implicit Methods for Solution of the

THE GAUSS-SSIDSL METHOD

The system of equat ions to be solved s im u l tan eo u s ly i n

th e backward d i f f e r e n c e method can be w r i t t e n i n th e form:

a l l Tl +a12T2+............. +aln Tn=bl

a21Tl +a22T2+ * *....................... +a2nTn=b2

an l Tl +ab2T2 * .........................+annTn=bn

The G auss-Se ide l method i s a l i n e a r , i t e r a t i v e process

f o r approximating th e s o l u t i o n of th e n s e t of s im ultaneous

e q u a t io n s . The b a s ic p rocedure of the method i s to assume

an a r b i t r a r y i n i t i a l s o l u t i o n v e c to r . The f i r s t equa t ion i s

then solved f o r T- , the second f o r T2 > e t c . A new va lue f o r

T- i s c a l c u l a t e d usj.ng th e i n i t i a l g u esses . This p rocess i s

r e p e a te d , r e p l a c in g the old T^ va lues by the newly c a l c u l a t e d

ones.

Applying t h i s procedure to the system of equa t ions above

and assuming an i n i t i a l v e c to r of T-^, T j ^ , ............»Tn,k: g iv e s :

m . b j - a j j g g t r ......... ..l , k - l ® 11

54

Page 65: Investigation of Implicit Methods for Solution of the

55

i - l n

Ti , k + l

The process i s repea ted u n t i l T j ^ + i s a t i s f i e s a c e r t a i n

accuracy check, i . e . t i l l the a b s o lu te value of the d i f f e r ­

ence between T^ and i s l e s s than some p red esc r ib ed

.value,, say, e p s i l o n .

A computer program l i s t i n g of backward d i f f e r e n c e method

u t i l i z i n g the Gauss-Seidel method i s shown on p p .57-62. The

G auss-Seide l method i s d esc r ibed in the s u b ro u t in e UGAS3I!I

and th e flow c h a r t of the sub ro u t in e i s shown on p.56.

Page 66: Investigation of Implicit Methods for Solution of the

56

Guess i n i t i a l s o lu t io n vec to r

Page 67: Investigation of Implicit Methods for Solution of the

$ JOB THS750 ITERATION K. GUNDERSEN 7DIMENSION W{100 *1).NAME(13)•D (100•1)•B (100•1),A<100•100)

c----- THIS SECTION READS AND WRITES INPUT DATA30 11=0

CALL CLOXCII)12=11-11 11 = 1 ILOGICAL ZEROREAD( 5 »10) (NAME(M),M=l*13)READ(5*11) NA.NBtIFREQREAD(5,12) DA.DD.DELT.TMAX.EPSREAD(5,12) AA.AB.FKA.FK8READ(5*12) TCA,TCB,TCC,TCD.HA,HB,HC»HOREAD(5*13) ZERO

10 FORMAT!13A6)11 FORMAT(3110)12 FORMAT(8E10.0)13 FORMAT(LI)

N=NA#NQIF(.NOT.ZERO) GO TO 3 DO 1 1 = 1,N

1 W ( I * 1 ) =0.GO TO 4

3 READ(5,12) (W (I,1)•I=1,N)4 WRITE(6,20) (NAME(M ),M=1,13)

20 FORMAT(1H1*13A6)WRITE(6,21) NA,NB,DA,DB,DELT

21 FORMAT(1H0,3HNA=,I3.11X ,3HN0=,13,11X ,3HDA=»E10. 3.4X»3HDB=,E10.3, 4X 1,5HDELT=,E10.3)WRITE(6,22) AA.AB.FKA.FKB.TMAX WRITE(6,23) HA.HB.HC,HD,TCA,TCB,TCC,TCD

23 FORMAT(1H ,3HHA=E10.3,4X,3HHB=,E10.3,4X,3HHC=,E10«3•4X•3HHD=,E10.3 2,4X* 4HTCA=,F7.1,4X,4HTCB=,F7.1.4X,4HTCC=,F7.1,4X.4HTCD=«F7.1)

22 FORMAT ( IH , 3HAA = , E1 0.3,4 X , 3H AB= ,E10.3,4X, 3Hi< A= , El 0.3,4X , 3HKB=» E 10 • 33•4 X •5HTMAX = * E 10.3}WRITE(6,24)

M l'O

Page 68: Investigation of Implicit Methods for Solution of the

24 FORMATCIH0.42HTEMPERATURES PRINTED IN FORMAT— (N) TEMP--)99 FORMAT{1H •1 OX•5HTIME = • £12•5.16HI NT• TIME DIFF.=.I12)

C----- THIS SECTION GENERATES NECCESSARY PARAMETERSICO = l TIME=0.0 ANA =NA BNB=NBY =DA/(ANA— 1•)X=OB/(BNB— 1 • )THA=DELT*AA/(Y**2. )THB=DELT*AB/(X**2. )RHOC=FKA/AAAl=HA*DELT/(RHOC*X>A2=HB*DELT/(RH0C*Y>A3=HC*D£LT/<RHOC*X)A4=HD*DELT/(RH0C*Y)n =n a *n b00 9 1=1.N

C----- THIS SECTION GENERATES THE PENTA-D!AGONAL MATRIXDO 9 J=l.N

9 All.J)=C.DO 100 1=1.N

100 A (I * I )=— {2**THA+2»*THB + 1•>A{1.1)=— (THA+THB+A1+A2+0.5)A (N » N )=— (THA + THB +A3 + A4 + 0.5)A (NB * NB ) =-(THA+THB+A2+A3+0.5)N3=NB*INA-1)+lA(N3»N3)=— {THA+THB+A1+A4+0.5)N1=N-NB DO 110 I-~1.N1 N 13 = I+NB

110 A (I» N 13 ) =THA N 12 =NB+1 DO 120 I=N12.N N 14=I—NB

120 A {I *N 14)=THA

VST.CX>

Page 69: Investigation of Implicit Methods for Solution of the

GO TO 14

N2=N-1 NN = 0DO 130 1=1.N2 NN=NN+1 IF(NN.EQ.N0 )A tI * 1 + 1)=THB GO TO 130

14 N N = 0 130 CONTINUE

KK = 0DO 15 1=2.N KK=KK+1 IF(KK.EO.NB) GO TO 16 A (I,I— 1)=THB GO TO 15

16 KK = 015 CONTINUE

N4=NB-1DO 210 1=2.N4 N 5=I+NBAt I.I)=-(2.*THA + 2.*THB+l.+2.*A2)

210 At I,N5)=2.*THA N6=N3+100 220 I=N6.N2 N 7=I—NBAt I.I>=-(2.*THA+2.*THB+l.+2.*A4)

220 At I»N7)=2.*THA N8=1+NB N 9=N 3—NBDO 230 I=N8.N9,NBAt I.I)=— t 2•*THA + 2.*THB+1»+2.*Ai)

230 At I.1 + 1)=2.*THB N 10 = 2*NB N i l = N - N BDO 240 I=N10.N11.NBAt I.I)=-t2.*THA + 2.*TH8+1.+2.*A3)

VJlvD

Page 70: Investigation of Implicit Methods for Solution of the

240 At I•1-1)=2.*THBC----- THIS SECTION GENERATES THE CORRESPONDING COLUMN MATRIX

DO 45 1=1.N45 D M * 1 )=0.

DC 1.1)=-Al*TCA-A2*TCB DO 41 1=2.N4

41 DC I»1)=-2.*A2*TCB DCNB.1)=-A3*TCC-A2*TCB DCN,1>=-A3*TCC-A4*TCD DCN3,1)=-Al*TCA-A4*TCD DO 42 I=N6.N2

42 DC I * 1)=-2.*A4*TCD DO 43 I=N8,N9.NB

43 D M • 1 )=-2.*Al*TCA DO 44 I=N10.N 11 • N8

44 DC I.1>=-2.*A3*TCCCALL MATOUT(D.N . 1.100.1.0.0.0*0)CALL CLOXtI I)12=11-11WRITEC6.99) TIME,12 11=11CALL MATOUTCW.N.l.100.1.0.0.0.0)TIME=TIME+DELT

51 CONTINUEDO 46 1=1.N

46 B(I.1)=D tI.1)— W 11 • 1)B C1.1)=D(1.1) — Wtl.l)/2.B CNB , 1 ) =D { NB » 1 ) — W (NB • 1 ) /2 •BCN3,1)=DCN3,1)-WtN3.1)/2.BIN, 1 )=DCN, 1 >-VK CN.l ) /2.

C----- THIS SECTION SOLVES THE SYSTEM USING GAUSS-SEIDEL ITERATIONCALL GA SEICA.100.100,B,100.M.100.NB » N ,EPS)CALL CLOXCI I)12=11-11 I 1 = 1 IIFtTIME-TMAX) 48,47,47

ONo

Page 71: Investigation of Implicit Methods for Solution of the

48 IF(ICO.EQ.IFREQlGO TO 49 ICO=1CO+1TIME=TIME+DELT GO TO 51

49 WRIT£(6,99) TIME.12CALL MATOUTIW.N.I.100*1.O.G.O.G)ICO = lTIME=TIME+DELT GO TO 51

47 CONTINUE GO TO 30

333 STOP END

iIBFTC CASE I DECKSUBROUTINE CASE ItA•I A •JA*B .IB.T »IT.NB,N ,EPS) DIMENSION A(IA•JA). B < I O » 1) * T (IT*1)» X(100 »1)

C----- GASEI SOLVES THE SYSTEM USING MOOIFIED GAUSS SEIDELDO 18 I = 1 ♦ N

18 X(I.1)=T(I.1)23 N4=N—NB 17 J=1

N 1 —NB +1 N6=N1

6 SUM = 0•DO 5 1=1.N1IF( I .EQ.J) GO TO 5SUM=SUM+T(I»1)*A(J»I)

5 CONTINUET(J,1> = (B(J»1) — SUM)/A(J * J)J=J+1 N1=N1+1 N3=J-1IF(M3.EQ.N6) GO TO 7 GO TO 6

7 N2 = 28 SUM=0«

On

Page 72: Investigation of Implicit Methods for Solution of the

DO 9 I —N2*N1 IF ( I«EQ•J ) GO TO 9 SUM=SUM+T(I.1)*A(J.I)

• 9 CONTINUET(J. 1) = CQ(J.1)-SUM)/A<J,J)J=J + 1 N2=N2+1 N 1=N 1 + 1 N 3 = J— 1IF(N3.EQ.N4) GO TO 19 GO TO 8

19 N1=N1-1 10 SUM = 0 •

DO 11 I=N2.N1IF{I.EO.J) GO TO 11SUM=SUM+T(I.1)*A(J.I)

1 1 CONTINUET(J,1)=(B(J,1)— SUM)/A(J •J)J=J + 1 N2=N2+1 N 3 = J— 1IF(N3.EQ.N> GO TO 12 GO TO 10

12 CONTINUEDO 13 1=1,N DIFF=X(I*1)— T(I*1)IF{ABStDIFF).GT.EPS) GO TO 14

13 CONTINUE GO TO 16

14 CONTINUEDO 15 1=1,N

15 XCI, 1 )=T(1,1)GO TO 17

16 RETURN END

ON

Page 73: Investigation of Implicit Methods for Solution of the

63

APPENDIX C

THE BGOY METHOD

Page 74: Investigation of Implicit Methods for Solution of the

THE BODY METHOD*

The c l a s s i c a l backward d i f f e r e n c e method was developed

f o r a r e c t a n g u la r p l a t e problem w ith convec t ive boundary

c o n d i t io n s i n Chapter I I I . In. developing th e Booy method,

the energy ba lance f o r each node i s made as b e fo r e . However,

now the f i n i t e d i f f e r e n c e equa t ion i s solved w i th r e s p e c t to

th e tem pera tu re of th e node f a r t h e s t along i n th e marching

d i r e c t i o n and the tem pera tu res f o r i= c o n s ta n t and j=l,NA

considered as a column v e c to r . R e fe r r in g to F i g . 16 th e f i ­

n i t e d i f f e r e n c e equa t ions f o r a l l th e nodes on th e l e f t - h a n d

boundary as developed in the backward d i f f e r e n c e method can

be r e w r i t t e n i n th e form:

N0D3 ( 1 , 1 ) : T2 ) J A = l / IH B(0 ,T1 )1 )k-(lHA)T1) i t l i r 4Tl i l > k . r

A1(TCA)-A2(TCB))

NODE (1,M): T2>m, k =

(THA)Ti)m+i jk --(2Al)TCA)

NODE (1,NA): T2>NA>k = l /T H B (^ T 1#M >kr(THA)T1>NA»i j k -

«T1 , NA, k-1“A1(TCA)" A 4 (TCE° )

The l e f t s id e of th e s e equa t ions c o n s t i t u t e the s e t of

*This method was developed by M.L. Booy f o r P o i s s o n ’s equa t ion w i th homogeneous boundary c o n d i t io n s . (See r e f . ( 3 ) ) . I n t h i s paper th e method i s de r ived fo r the F o u r ie r conduc­t i o n equ a t io n ap p l ied to the two dimensional r e c t a n g u la r p l a t e problem w i th convec t ive boundary c o n d i t i o n s .

64

Page 75: Investigation of Implicit Methods for Solution of the

65

tem pera tu res a t i~2 fo r j=l,MA. In g e n e ra l , we can express

th e tem pera tu res a t .the boundary a t time k s im u l taneous ly as

a column v e c to r :

Tl ,k =

1 2 3 n-1 n n+1 NB

T ( l , l )

T(1,M)

T(1,NA) k

F i g . 1 6 .—Rectangular P l a t e w i th Convective Boundaries

J

NA

m+1

m

m-1

2

1

Page 76: Investigation of Implicit Methods for Solution of the

66

The s e t o f equa t ions can no if be r e w r i t t e n i n m a tr ix form:

THA-THB-AI-A2-? . -TKA. ................ Q.......................0

T2 , k =l

THB THE

-TEA 2THA-2TK3-2A1-1 -THA 0 , 2THB 2THB 2THB '

>0

■ 0 -THA THA-THB-Al-A4-j- THB THB

T l , k

1__2THB * i , k - l

A2THBtgb"thbtca

AlTHB•TCA

A im p ATHB

A4-T&0AI m f-1 a THB"THB

(1)

For is.n and j=l,NA we can w r i t e th e f i n i t e d i f f e r e n c e equa­

t i o n s a s :

NODE ( n , 1) :

NODE (n ,m ) :

N0DE(n,NA):

T n - l , l * k = 1/THB (©*.^ n , i , k*(2THA)Tn? 2 , k“Tn , 1 , k - 1“

2A2(TCB)-(THB)Tn_1>1}k)

Tn - l , m , k = l/THB(%Tn>m5k-(THA)Tn?m_1>k-

^n,m, jk~^TKB^Tn- l ,m ,k^

Tn - 1 , NA, k= l/^HB ( , NA, k" ( 2THA) Tn ? jfA- ]_} m-

Tn ,NA,k-l-^HB)Tn _ljNA)k-2A4(TCD))

Using the same m a t r ix n o t a t i o n as. def ined p re v io u s ly , th e

system of equa t ions a t i=n can be w r i t t e n a s :

Page 77: Investigation of Implicit Methods for Solution of the

67

^ n - l , k :

2THA-2THB-2A2-1 -2THA 0 *THB THB

-THA 2THA-2.THB-1 -THATHB THB THB u

0 ............................. -2THA 2THA-•2THB-2A4-1THB THB

rn ,k

2A2m.^thbtcb

0

2A4;m-,y.THBiLU

- Tn , k - l (2)

W rit ing th e f i n i t e d i f f e r e n c e equa t ions f o r th e nodes on the

boundary on the r ig h t -h an d s id e g iv e s :

HODS TCC =

(THB)TjtB_tl j x,k~A2(TCB))

NODE (SB,m): TOC - l / 2« a . T KB)ln)K- ( T » ) T MBtI, , 1 )ll.-TJ(B!|affe. 1-

(THA)Tjjg>m- l Jk“ (^HB)Tji}3 _^> m j )

NODE (NB,NA): TCC = 1/A3(©»TWB,.NA}k- (TKA)TNB, NA- 1 , k“

*% B, NA, k - 1 " (THB % B -1, NA, k~PA C TCD))

M atr ix n o t a t i o n g ives :

TCC

'TCC

7HA-THB-A2-A3-P" -THA A3 . A3

o........... ............0

-THA 2THA-2THB-2A3-1 2A3 2A3

-THA o •• 2A3

• • • •* • Q

-THA TH A-THB - A - A4-|rA3 A3 J

TNB,k

Page 78: Investigation of Implicit Methods for Solution of the

I t i s seen from equa t ions 1, 2, and 3 t h a t they a l l a r e of

th e fo rm :

T i * l , k * BT1 >k- r T 1. 1 )k-cT1)!c. 1-B (4)

where r and c a re co n s tan ts and B a square NAxNA m a t r ix and

D a NAxl column m a tr ix . B, I), r , and c a re known a l though

d i f f e r e n t f o r each o f th e t h r e e cases 1 , 2 , and 3 .

Equation 4 expresses f i +p jk as a l i n e a r r e c u r s io n r e l a ­

t i o n s h i p between Ti_]_jk and Tj_jk _p. or o th e r words

th e tem pera tu re a t s t a t i o n i+1 fo r j=l,NA i s a f u n c t io n of

th e tem pera tu res a t s t a t i o n s i and i - 1 f o r j =l,NA. According

ly we can a l s o say t h a t the tem pera tu re T i j k =^ ( ^ i - l , k j

^ i - l , k - l » ^ i -2 ,k ^ wkere T in d i c a t e s a l i n e a r f u n c t i o n a l r e ­

l a t i o n s h i p . This can be repea ted f o r and so on. In

t h i s manner we can move in the marching d i r e c t i o n from the

l e f t boundary to th e r i g h t u n t i l we e v e n tu a l ly a r e ab le to

express the elements of i n terms of e lements of T-|)k

and T0?k and c o n s ta n t s , where To?k t ie c o l ^111*1 m a tr ix

whose elements a r e equal to the f l u i d tem pera tu re on. the l e f t

Defining Z ( j ) = T ( l , j ) to d i s t i n g u i s h th e tem pera tu res

a t i = l from those a t o ther l o c a t i o n s an-e lem ent of Tj_>k

would become:

in

i s

(3)

68

Page 79: Investigation of Implicit Methods for Solution of the

69

T ( i , j ) = e i ( j , l ) Z ( l ) i - e i ( 3 > 2 ) 2 ( 2 )+ . . . . . +TCA

where th e ej_'s a r e c o n s t a n t . ..

Def in ing Z(NA-1)-1 we can w r i t e t h i s i n m a tr ix n o t a t i o n :

Z(l)Z(2)

e (1 ,1 ) e±( l , 2 ) . . . . . . e i d j N A ) eiCljNA+l)

Ti ,k =61(2 ,1) ei ( 2 , 2 ) . . . . . . e i (2 ,H A ) ei (2,NA+l)

e i (NA,i) ei (NA,2). . ej_(NA,NA+l

The tem pera tu r e v ec to r i s now i n the form:

Z(NA)

Z(NA-l)

f i j k = S i z (5)

M atrix S i i s an augmented KAx(NA+l) m a t r ix , v ec to r Z an

augmented v ec to r w i th Z(NA+1)=1. For i = l we g e t :

^ l , k " E1 zBut s in ce we a l r e a d y know t h a t we must d e f in e Ei a s :

Si =

1 0 .........

0 1 0 . . . . . 0

0

S im i l a r ly we know t h a t :

?0,k=

TCA

TCA

0 ___ . . . 0 TCA

Ml

O il

0 ____ _ . 0 TCA

0 .............. 0 TCA

Accordingly Eq•j must be def ined a s :

Page 80: Investigation of Implicit Methods for Solution of the

70

The r e c u r s io n equa t ion (1) can. now be w r i t t e n i n the form:

it= ( S ^ i - r i b i _ i - c ± i ^ j - D ) Z - i ^ i . ^ Z (6)

o r : Ei +i=EEi - r3 i - r cTi , k - i " Dwhere now i s of the augmented form:

0 . . . . . . . . 0 T ( i , l )

T ( i ,2 )- 0 . . . . . . . . oTi , k - 1=

0 ___ T(i,NA)

and D i s of the augmented form:

0 ...................... 0 D(1 j 1)

0 ................ 0 D (2 ,1)D=

0 0 D(NA,1)

Both and D a r e now of t h e -order-HA x (NA-1) .

Repeated a p p l i c a t i o n of ( 6) w i l l y i e ld a s e r i e s of

m a t r i c e s S^. The p rocess i s repea ted u n t i l an ex p res s io n

f o r corresponding to the f l u i d s id e of th e r i g h t boun­

dary i s o b ta in ed . Then we have:

' TNB+l=ENB+lZ=TCCwhich can be w r i t t e n in expanded form a s :

eNB+l^1 *1 • • • • eN B + l^ * ^ ^

eN B + l^A’ ^^ eNB*l(^,NA)

Z(l)

Z(NA)

T CC- ejjg+ p (1 j NA+-1)

TCc- e 1B+i ( M , N A+1)

(7)

Equations (7) a r e now a s e t of l i n e a r l y independent equa t ions

which can be solved s im ultaneously to y ie ld th e s o lu t io n of

Page 81: Investigation of Implicit Methods for Solution of the

71

Z. Back s u b s t i t u t i o n of Z i n t o equa t ion (5) w i l l then y ie ld

th e d e s i re d tem pera tu re d i s t r i b u t i o n .

A flow c h a r t of the Booy method i s shown on page 72

and a program l i s t i n g on pp. 73- 79, th e nomenclature of the

flow' c h a r t corresponding to t h a t of the computer program.

Page 82: Investigation of Implicit Methods for Solution of the

72

Page 83: Investigation of Implicit Methods for Solution of the

SJOB THS750 BOOY K. GUNDERSEN 7DIMENSION B (11 *11),D<11 .11) ,E1(11.11) .E2<11,11),V(11,1),W3(11.11)* IF1(11.11).F 2 (11,11) ,F3(11 .11)*WD(11,11),W(ll,ll)•02( 11.11 ),B1( 11, 1 21 ).B2(11,11 ),NAME(I3),E(11.11.1 1 )

C---— THIS SECTION READS AND WRITES THE INPUT DATA30 11=0

CALL CLOX(II)12=11-11 11 = 11LOGICAL ZEROREAD(5,10) (NAME(M),M=1.13)READ(5.11) NA.NB.IFREO READ(5.12) DA.DB.DELT.TMAX READ(5*12) AA.AB.FKA,FKBREAD(5 »12) TCA.TCB.TCC.TCD »HA »HB »HC »HD READ(5*13) ZERO

10 FORMAT(13A6)11 FORMAT(3110)12 FORMATt8E10.0)13 FORMAT(LI)

IF(.NOT.ZERO) GO TO 3 N4=NB+1 DO 1 N=1,NA DO 1 M=2,N4

1 W(N.M)~0.GO TO 4

3 CALL MATIN(W ,NA,NB.25.40.2)4 WRITE(6.20) (NAME(M),M=1.13)

20 FORMAT!1H1.13A6)WR1TE(6,21) NA.NB.DA.DB.DELT

21 FORMAT{ 1H0•3HNA = .13,11X ,3HNB=,I 3.11X,3HDA=,E10•3,4X,3H0B=,E 10«3,4X 1,5HDELT =»E10.3)WRITE(6,22) AA.AB.FKA.FKBWRITE(6,23) HA, HQ, HC , HD,TCA.TCB.TCC,TCD

23 FORMAT(1H ,3HHA=E10.3.4X,3HHB=,E10•3,4X.3HHC=.E 10.3.4X.3HHD=,E1C.3 2.4X,4HTCA=,F7.1,4X.4HTCB=,F7.1,4X,4HTCC=,F7.1.4X,4HTCD=,F7.1}

-<3

Page 84: Investigation of Implicit Methods for Solution of the

22 FORMAT(1H •3HAA = .El 0.3.4X,3HAB=,E10•3•AX.3HKA=•El 0•3,4X•3HKB=.E10• 33)

WRITE(6•24)24 FORMATl1H0,74HTEMPERATURES PRINTED IN MATRIX FORM STARTING IN THE

4L0WER LEFT-HAND CORNER)99 FORMAT(1H •1 OX,5HTIME =,E12.5.i6HINT. TIME DIFF.=»I12)

C----- THIS SECTION GENERATES PARAMETERS BASED ON THE INPUT DATAIC0 = 1 T IM E = 0 •ANA =NA BNB=NBY=DA/tANA-1.)X=DB/tBN8— 1•)THA=DELT*AA/tY**2.)THB=DELT*AB/tX**2.)RHOC=FKA/AA Al=HA*DELT/tRHOC* X)A2=HB*DELT/(RH0C*Y)A3=DELT*HC/(RH0C*X)A4=HD*OELT/tRHOC*Y)

C----- THIS SECTION PERFORMS THE FORWARD ELIMINATIONDO 41 1=1,NA DO 41 J = 1»NA BtI * J)=0•B2tI,J)=0.

41 Bit I•J ) =0.DO 42 1=1.NABtI•I)=t2.*THB+2.*THA+l.)/THBB2<I,I)=(2.*THA+2.*THB+1.+2.*A3)/(2.*A3)

42 BttI,I)=(2.*THA+2.*THB+2.*A1+1.)/(2.#THB)B t 1.1)=t2.*THA+2.*THB+1.+2.*A2)/THBB 2 t1 * 1)= t THA+THB+A2+A3+0.5)/A3 Bit 1 , 1) = t THA + THB + A1+A2 + 0.5)/THB 8(NA » N A ) = (2•* THA + 2•*THB +1• +2 •*A4)/THB 8 2 t NA * N A )= tTHA+ THB+A3 +A4 + 0•5)/A3 B 11 NA,NA) = tTHA+THB + A1 + A4 + 0.5)/THB

■vj4

Page 85: Investigation of Implicit Methods for Solution of the

Nl=NA-l 00 43 1=2.N1 8(1.14-1) =-(THA/THB)82(1.1+1)=-(THA/(2.*A3>)

43 Bit I.1 + 1>=-(THA/(2.*THB))DO 44 1=2.NAB (I»I— 1)=-<THA/THB)B2(I.1-1)=-(THA/(2.*A3))

44 Bl(I.1-1)=-(THA/(2.*THB>)B (1.2)=—2.* THA/THBB 2(1.2)=— (THA/A3)B K 1,2 ) =-( THA/THB)B(NA.NA-1)=-2.*THA/THB B2(NA » NA— 1)=— (THA/A3)BKNA.NA-l ) =-( THA/THB)N2=NA+1 DO 47 1=1.NA DO 47 J=1.N2

47 0(I,J)=0.00 48 1=1.NA DO 48 J = 1.NA

48 E 1(I.J)=0.DO 49 1=1.NA

49 El(I,N2)=TCA*Al/THB DO 50 1=1.NADO 50 J=1*N2

50 E2(I.J)=0.DO 51 1=1.NA

51 E2(I.I)=1.CALL CLOX(II)12=11-11WRITE(6.99) TIME.121 1 = 11CALL MATOUT(W.NA.N8.il,11.0.0.0.0) T IME=TIME+DELT

71 CONTINUE

VII

Page 86: Investigation of Implicit Methods for Solution of the

D(1.N2)=-A2*TCB/THB D(NA.N2)=-A4*TCD/THB 00 52 1=1.NA DO 52 J=1,N2 Fit r . j y s f n i . j )F2CI.J)=E2<I•J)02(I.J)=D(I.J)DO 53 J=1.NAD2(J,N2)=D<J,N2)-W(J.2)/(2.«THB)CALL RECUR(B1.F2.F1.D2.F3.11.NA.N2)D(1,N2)=-2.*A2*TCB/THBQ (NA » N 2 )=—2 ® *A4 * TCD/THBDO a 1=1.NADO 8 J=1,N2F 1 ( I.J )=F2(1.J)F2<I,J)=F3(I.J)E(1»I»J)-F3(I»J)D2(I.J)=0(I.J)N3=NB-1 DO 7 M = 2 »N3 DO 6 J=1.NAD2(J.N2>=D(J,N2>-W(J.M+l)/THB CALL RECUR<B,F2.FI.D2.F3.il.NA.N2) DO 60 1=1»NA DO 60 J = 1♦ N2 ECM.I.J)=F3(I.J)FI{I.J)=F2(I.J)F 2( I * J )=F3(I .J)CONTINUED (1,N2)=-A2*TCB/A3 D(NA.N2)=-A4*TCD/A3 DO 57 1=1.NA DO 57 J = 1»N2 D2(I.J)=D(I.J)DO 58 1=1,NA DO 58 J = 1» N2

5253

8

6

607

57

ON

Page 87: Investigation of Implicit Methods for Solution of the

58 Fl< I,J)=F1(I,J)*(THB/A3)DO 56 J=1,NA

56 D2(J.N2)=D(J.N2)-W<J.N4)/<2.*A3>CALL RECUR (B2.F2.F1 ,D2,F3«11 »NA# N2)DO 59 J=1,NA

59 F3(J «N2 )=—F3(J•N2) + TCCC----- SYSTEM OF EQUATIONS SOLVED BY GAUSS-JORDAN ELIMINATION

CALL KJELL(F3»11.11.NA)C----- THIS SECTION PERFORMS THE FORWARD SUBSTITUTION

DO 75 1=1.NA 75 V(I * 1)=F3(I.1)

V(N2,1)=1.DO 64 M = 1»N 3 DO 77 1=1.NA DO 77 J = 1* 1 W3{I,J)=0.00 77 K=1,N2

77 W3(I.J)=W3(I.J)+E(M •I .K)*V(K.J)DO 2 1=1.NA

2 WD( I•M+1)=W3(I ,1)64 CONTINUE

DO 65 1=1.NA65 WD( I,1)=V(I.1 )

DO 35 1=1,NA DO 35 J=2,N4

35 W(I,J )=WD(I .J-l)CALL CLOX{II)12=11-111 1 = I IIF(TIME-TMAX) 73,74.74

73 IF(ICO.EG.IFREQ) GO TO 72 IC0=IC0+1 TIME=TIME+DELT GO TO 71

72 WRITE(6 » 99) TIME,12CALL MATOUTIWD.NA.NB.l1 .11,0.0,0.0)

'•a

Page 88: Investigation of Implicit Methods for Solution of the

IC0 = 1TIME=TIME+OELT GO TO 71

74 CONTINUE GO TO 30

333 STOPEND -

$IBFTC RECUR DECKSUBROUTINE RECUR<A .B.C,D.E.NO•NE•NF)

C A IS THE SQUARE COEFFICIENT MATRIXC B I S THE E(I) MATRIXC C IS THE E(I-l) MATRIXC D IS THE CONSTANT TERM MATRIXC E IS THE E (1+1) MATRIXC NO IS THE DIMENSION OF THE COEFF. MATRIXC NE IS THE NUMBER OF INTERIOR POINTS ALONG THE J AXISC NF IS (NE+l)

DIMENSION A (ND.ND).B(ND.ND)»C(ND.ND),D(ND.ND)* E {NDi ND),Alt 11, 11), A 12(11*11)CALL MULT(A *8 *A1*NE•NE•NF.ND*ND.ND*ND•11 * 11)CALL SUB(A 1.C.A2.NE.NF.ND.ND,ND.NO.ND.ND)CALL ADD(A2.D.E.NE.NF,ND.ND,ND.ND.ND.ND)RETURNEND

®IBFTC KJELL DECKSUBROUTINE KJELL(A ,I A .JA,M)DIMENSION A (IA . JA)«p (1 1 *11) .C (11 .11)

C----- KJELL SOLVES THE SYSTEM USING GAUSS-JORDAN ELIMINATIONN =M +1

19 Z=A(1.1)IF(Z-0. ) 11.6 »11

6 K=N-1DO 9 1=2.K ZK=A(I.1)IFCZK-O.>7.9.7

7 DO 8 J=1,N

^3CO

J

Page 89: Investigation of Implicit Methods for Solution of the

C(I.J)=ACI.J)A( I. JJaAU.J)

8 A C 1 « J )=CC I * J )GO TO 1 1

9 CONTINUE WRITE 16,25)

25 FORMAT (30X.I8HNO UNIQUE SOLUTION)GO TO 18

11 00 12 J=2,N DO 12 1=2,M

12 B (I— 1# J— 1)=A(I» J )—A (1•J)*A(I,l)/A(l,l)DO 13 J =2,N

13 B(M, J - 1 ) =A( I , J ) /A {1 • 1)N=N- 100 14 J = 1 ,N 00 14 '1 = 1, M

14 AC I,J)=B(I,J)IF (N-l)19,16,19

30 FORMAT (40X.F10.3)16 CONTINUE 18 RETURN

ENDSIBFTC SMULT DECK

SUBROUTINE SMULT (A,B*C,N1«N2« N3,Mi,M2,M3,M4,M5,M6) C COMPUTES CCN1.N3) = ACN1CN2) S B (N2(N3) A BEING SPARSE

DIMENSION ACMl,M2),3<M3,M4), CCNi5,M6)00 1 1=1,N1DO 1 J=1,N3

1 C(I,J ) = 0.0 DO 2 I = 1 » N1 DO 2 J=1,N2IFCAC1,J),EQ,0,0) GO TO 2 XI = AC I,J)DO 3 K=1,N3

3 C CI,K ) = CCI.K) + X1*0CJ.K)2 CONTINUE

END

O

Page 90: Investigation of Implicit Methods for Solution of the

80

APPENDIX D

THE GAUSS-JORDAN ELIMINATION METHOD

Page 91: Investigation of Implicit Methods for Solution of the

THE GAUSS-JORDAN ELIMINATION METH0t>

The system of s im ultaneous equa t ions r e s u l t i n g from the

a p p l i c a t i o n of the r e c u r s io n equa t ion i n th e development can

be w r i t t e n i n the form:

Xt +a, nx 0+ ----- . . . . +al n xnnb1ttl l Al +a12x2

a 21x l +a22x 2+

(a)

+a2nxn=b2 ^(1)

an l x l +an2x 2+ +annxn=bn (c)

Using the Gauss-Jordan e l im in a t io n method, we d iv id e equa t ion

1(a) by the c o e f f i c i e n t of th e f i r s t unknown in t h a t equa t ion

o b ta in in g equa t ion 2(a) below. *Ee then m u l t ip ly equa t ion

2 (a) by th e c o e f f i c i e n t o f th e f i r s t unknown i n each of the

remaining equa t ions of 1 and o b ta in as fo l lo w s :

x l +^a l 2 //al l ^ x2+------ ------- + a ln'/ a l l ^ xn=bl ' / a H ^

a 21x l t ^a 21a 12/ a u ) x 2+* • • * •<-^a 21a l n/ a l l ^ xn=a21bi / a l l ^( 2 )

an l x l + (an l a 12/ a H ) x 2+........ + <an i a ln / a n ) xn f an l b l / a l l ( c)i

Next we s u b t r a c t 2(b) from 1 (b ) , 2(c) from 1 ( c ) , e t c , and

l e t t i n g 2(a) become 3(c) we g e t :

81

Page 92: Investigation of Implicit Methods for Solution of the

S2

(a 2 2 - a2 i a i 2/ an ) x 2+ ------ + (a 2n"a 2 1 a ln / a l l ) x n=b2 ~a 2 1 bl //a l l

(3 )(a n 2 “an l a l 2 / a l l ) x 2 4- - - f |' (a nn“an l a l n / a l l ) xn:::V an l b l / a i l (b)

Ca l l - a n l ) x 1+ (a 1 2 - a 12 / a i i ) x 2+ ------* (a ln ~ a ln / a l l )x n=bl - bl / a l l ( c >

R ep ea tin g th e procedure w i l l reduce th e system o f e q u a tio n s

a d d i t io n a l ly , u n t i l e v e n tu a lly th e w hole system i s reduced

to a column v e c to r which c o n s t i t u t e s th e d e s ir e d s o lu t io n o f

th e s im u lta n eo u s e q u a tio n s .

C on sid erin g th e c o e f f i c i e n t m atrix A augmented w ith the

column v e c to r b , we can e x p r ess th e e lem en ts o f th e reduced

augmented c o e f f i c i e n t m atrix a s :

i s 2 , 3 , . . . . ,m

c i - l , ,i_i=a i j " (a l j a i l / a l l ^ J‘=2 >3, • • • • »na H^O

cm, j - l " a l j ^ a H 3 - 2 , 3 , » • • • , n

a H ^0

In th e s e e q u a tio n s:

i-yow number o f o ld m a tr ix A

j=column number o f o ld m a tr ix A

m^maximum row number

n=maximum column number

a=an elem ent o f o ld m a tr ix A

c=an elem ent o f new m a tr ix C

The G auss-Jordan method i s used to s o lv e NA s im u lta n e ­

ous e q u a tio n s in th e Booy m ethod. The method i s l i s t e d as

Page 93: Investigation of Implicit Methods for Solution of the

83

a su b ro u tin e ,!KJELL" on p .7 8 and th e f lo w c h a r t i s g iv en on

p .S 4 .

Page 94: Investigation of Implicit Methods for Solution of the

84-

STOP

Page 95: Investigation of Implicit Methods for Solution of the

85

APPENDIX E

THE CHOLESKI DECOMPOSITION METHOD

Page 96: Investigation of Implicit Methods for Solution of the

THE CHOLESKI DECOMPOSITION METHOD

A system o f n l in e a r ly in d ep en d e n t, s im u lta n eo u s equa­

t io n s l i k e th e one r e s u lt in g from u s in g th e backward d i f f e r ­

ence method can be w r it te n in th e fo l lo w in g m atr ix n o ta t io n :

(1)

w here: [A] i s an (n x n) m atr ix

[b] i s an(n x 1) column m atrix

M i s an (n x 1) column m atrix

Assuming th a t th e c o e f f i c i e n t m atrix A i s sym m etric, we know

th a t we can f in d a m atrix L such th a t

[l] [l] T = A (2 )

where we d e f in e 1 ^ = 0 , j > i . S u b s t itu t in g (2 ) in to (1 ) g iv e s

= (3)

R ew ritin g (2 ) in elem ent form g iv e s :

i- l l 0 ^ l 121 . . . . . l ln

121 122 0 . . . 0 0 122 ** ** 12n

.M i 1n2 ----- 1nn 0 0 ___

SYM. a 22

P erform ing th e m u l t ip l ic a t io n g iv e s :

l ^ 1=a11_ l 11= i / ^ 1

1 2 1 1 l l =a 2 1 ------- - 12 1 =1 l i a 21

Page 97: Investigation of Implicit Methods for Solution of the

87

For d ia g o n a l c a se when i= j we g e t :

1.r i - i H

D e fin in g th e m a tr ix [dj * j x iT p a g iv e s

M Cm » [b 3

E q uation (4 ) can be w r it t e n a s :

", '~d-

(4 )

111 0 ..............0

121 122 0 . . . . 0

1 , _______ 1n l nn n

P erform ing th e m u l t ip l ic a t io n g iv e s :

l l l d 1? b1--------W 1! !

121dl - 122d2s:b2 -------- d2= (b 2- l 2 1 d l ) / 122

In g e n e r a l we g e t : i - 1

Backward s u b s t i t u t io n in t o L X - D y i e l d s :

x = l ~ b d n nn n

xi =1i ii [ d l ' f c - i likXlc]

The computer program c o n s i s t s o f two su b r o u t in e s , CHOL 1

and CHOL 2 * . The f i r s t perform s th e d eco m p o sitio n and com­

p u tes w hereas CHOL 2 perform s th e forw ard and backward

*The su b r o u tin e s w ere ob ta in ed from Dr. H. C h r is t ia n s e n , C iv i l E n g in eerin g De p t . , B. Y. U.

Page 98: Investigation of Implicit Methods for Solution of the

s u b s t i t u t i o n s . The program i s optimized f o r symmetric band

m a t r i c e s . Since th e method r e q u i r e s a p o s i t i v e d e f i n i t e co­

e f f i c i e n t m a t r ix , th e pentadifegonal m a tr ix has to be t r a n s ­

formed i n t o a symmetric, p o s i t i v e d e f i n i t e form b e fo re th e

Choleski method i s a p p l i e d . The c o e f f i c i e n t m a tr ix i s read

i n a r r a y form ta k in g advantage of th e f a c t t h a t symmetry and

band c o n d i t io n s e x i s t .

I f th e c o e f f i c i e n t m a t r ix can be w r i t t e n as fo l lo w s ;

a l l a 12 a 13 0

a 22 a23 a 24

0

0

th e c o e f f i c i e n t a r r a y would be read i n t h i s manner:

A(I)«

a l l

a 12

a 13

a 22

a 23

a 24

a nn

Besides the column m a t r ix on th e r i g h t which i s read in , the

program a l s o u t i l i z e s an a r r a y named KEY(I,1) whose elements

a r e th e band width per row. R e fe r r in g to the c o e f f i c i e n t

Page 99: Investigation of Implicit Methods for Solution of the

m a tr ix , th e KEY a r r a y would be:

KSY(I)=

3

6

9

12

For f u r t h e r in fo rm at io n and d i s c u s s io n on th e Choleski method

see r e f . (10) pp.ZW~.Z77.A program l i s t i n g of the backward d i f f e r e n c e method

u t i l i z i n g the Choleski decomposit ion method i s shown on pp.

92-100. The flow c h a r t of CHOL 1 i s shown on page 90 and the

flow c h a r t of CHOL 2 on page 91, the nomenclature of th e flow

c h a r t s corresponding to t h a t of th e computer programs.

Page 100: Investigation of Implicit Methods for Solution of the

90

Page 101: Investigation of Implicit Methods for Solution of the

91

Page 102: Investigation of Implicit Methods for Solution of the

S JOB

C

THS750 CHOLESKI K. GUNDERSEN 7DIMENSION W{100.1).NAME(13).D(100.1).8(100.1).A{100.100),C(1100.!) 1 . KEY(100.1)

3 0 J 1 = 0CALL C L O X ( J J )J 2 = J J — J 1 J 1 = J J NCE = 0 I T = 0

--- THIS SECTION READS AND WRITES INPUT DATALOGICAL ZEROREAD(5.10) (NAME(M),M=1,13)READ(5.11) NA.NB.IFREQ READ(5 »12) DA.DB.DELT.TMAX READ(5.12) AA ,AB.FKA.FKBREAD(5.12) TCA.TCB.TCC.TCD.HA.HB.HC.HO READ(5♦13) ZERO

10 FORMAT(13A6)12 FORMAT!8E10.0)11 FORMAT(3110)13 FORMAT(LI)

N=NA*NBI F ( . N O T . Z E R O ) GO TO 3 DO 1 1 = 1 , N

1 W( I ,1 )=0 .GO TO 4

3 R E A D ( 5 , 1 2 ) ( W{ I , 1 ) , I = 1 , N )4 WRI TE( 6 , 2 0 ) ( N A M E ( M ) , M = 1 . 1 3 )

2 0 FORMAT( 1 H 1 , 1 3 A 6 )WR I T E ( 6 , 2 1 ) N A . N B , D A , D B , D E L T

2 1 FORMAT ( 1 H 0 , 3 H N A = , I 3 , 1 1 X , 3 H N E - - , I 3 » 1 1 X . 3 H D A = 1 . 5 H D E L T = , E 1 0 . 3 )

. E 1 0 . 3 . 4 X , 3 H D B = . E 1 0 « 3 . 4 X

WRI TE( 6 » 2 2 ) A A . A B . F K A . F K B . T MA X WRI TE( 6 , 2 3 ) H A . H B . H C . H D . T C A . T C B . T C C . T C D

2 3 FORMAT( 1H , 3 HHA=E1 0 . 3 . 4 X . 3 H H B = . E 1 0 • 3 . 4 X , 3 HHC= . E 1 0 . 3 . 4 X . 3 H H D = , E 1 0 . 3 2 . 4 X , 4 H T C A = . F 7 . 1 , 4 X , 4 H T C 0 = » F 7 . 1 , 4 X . 4 HTCC= . F 7 . 1 , 4 X , 4 HTCD=, F 7 . 1 )

vOro

Page 103: Investigation of Implicit Methods for Solution of the

22 FORMAT(1H •3HAA= »El0,3,4X »3HAB=*Ei 0•3,4 X »3HKA=* E10•3*AX * 3HK8=, E 10 • 33,4X.5HTMAX=,E10.3)WRITE(6,24)

24 FORMAT!1H0,42HTEMPERATURES PRINTED IN FORMAT— (N) TEMP--)99 FORMAT!1H •I OX,5HTIME=,E12.5,16HI NT• TIME DIFF.=.112)

332 FORMAT!5X,E12.8)C----- THIS SECTION GENERATES NECCESSARY PARAMETERS

ICO = l TIME=0.0 ANA =NA BNB=NBY=DA/(ANA-l•)X=DB/(BNB-l•)THA=DELT*AA/(Y**2.)THB=DELT*AB/!X**2.>RHOC=FKA/AAAl=HA*DELT/(RHOC*X>A2=HB*DELT/(RHOC*Y)A3=HC*DELT/(RHOC*X)A4 =HD*D£LT/(RHOC*Y)N=NA*NB DO 9 1=1,N

C-----THIS SECTION GENERATES THE PENTA-DIAGONAL MATRIXDO 9 J = 1,N

9 A(I,J)=0.DO ICO 1=1,N

100 A ! I » I ) =- ( 2• *THA+2» *THB+1•)A (1 * 1)=— (THA+THB+A1+A2+0,5)A(N.N)=-(THA+THB+A3+A4+0.5)A(NB,NB)=-(THA+THB+A2+A3+0.5)N3=NB*(NA~1)+lA(N3»N3)=— (THA+THB+A1+A4+0,5)Nl=N—NB DO 110 1=1,Ni N 13 = I+N3

110 A(I *N 13)=THA

'Ou>

Page 104: Investigation of Implicit Methods for Solution of the

N12=NB+1 00 120 I=N12,N N 14 = I—NB

120 A (I,N14)=THA N2=N— 1 NN = 0DO 130 1=1*N2NN=NN+1IF(NN*EQ.NB) GO TO 14A(I.I+1)=THBGO TO 130

14 NN=0130 CONTINUE

KK = 0DO 15 I=2.N KK=KK+1IF(KK.EQ.NB) GO TO 16 A(I,I-1)=THB GO TO 15

16 KK=015 CONTINUE

N4=NB-1DO 210 I=2 »N4 N 5=I+NBA ( I• I )=-(2.*THA+2«*THB+l.+2.*A2)

210 A (I * N 5)- 2 •* THAM6=N3+1DO 220 I=N6,N2 N7=I—NBA (I•I)=— (2•* THA + 2* *THB+1•+2•*A4)

220 A(I,M7)=2.*THA N8=1+NB N9=N3—NBDO 230 1=N8•N9•NBA (I•I)=-(2.*THA+2«*THB+l.+2.*Al)

230 A ( I,1 + 1)=2•* THB

sO

Page 105: Investigation of Implicit Methods for Solution of the

N10=2*NB N 11=N-NBDO 240 I-N1 0 , N1 1 ,NB A ( I ,I)=-(2.*THA+2.*THB+l.+2.*A3)

240 A (I»1-1)=2.*THBN23=N6-NB NY =N 1 0— 1 NX=NB+2

75 CONTINUEDO 62 I=NX » NY DO 62 J = l,N

62 A (I,J)=2.*A<I.J)IF(NX.EQ.N23) GO TO 73 NX=NX+N13 NY=NY+NB GO TO 75

73 CONTINUEC----- THIS SECTION GENERATES THE CORRESPONDING COLUMN MATRIX

C----- THIS SECTION GENERATES THE KEY ARRAYK S UM—0DO 55 1=1,N1KEY!I,I)=N12+KSUM

DO 45 1=1.N 45 D(I,1)=0.

D ( 1.1)= + Al* TCA + A2*TCB DO 41 1=2,N4

41 D(I,1>=+2.*A2*TCBO (NO »1)=+A3*TCC+A2*TCB D (N »1)=+A3*TCC + A4*TCD D (N 3 * 1>=+Al*TCA+A4*TCD DO 42 I=N6 » N2

42 D(I, 1 )=+2.*A4*TCD DO 43 I=N8.N9.N8

43 D{ I , 1 )=+2.*Al*TCA DO 44 1=N10.N 11 * NB

44 D(I,1)=+2.*A3*TCC

vOva

Page 106: Investigation of Implicit Methods for Solution of the

55 KSUM=KEY{ I » 1 1 I2=N1+11=1

56 KEY!12.1)=KSUM+N12— I I F( 12•EQ *N ) GO TO 57 KSUM=KEY(12.1)12=12+11=1+1 GO TO 56

57 CONTINUECALL MATOUTlD.N.l.100.1.0.0.0.0)CALL CLOX(JJ)J2=JJ— J 1WRITE(6» 99) TIME.J2 J1=JJCALL MATOUT(W.N,l.100.1.0.0.0.0)T IME = TIME+OELT

51 CONTINUE00 46 1=1.N

46 B (I•1)=0(I»l)+W(I.l)B{ 1 . 1 )=D(1.1) + W(1,1)/2.D (NO .1)=D(NO.1}+W<NB.l)/2*B (N 3.1 ) =0(N3.1)+W(N3.1 )/2.B (N * 1 ) =0 (N » 1 ) + W ( N • 1 ) /2 •NY=N10— 1 NX=NB+2

65 CONTINUEDO 61 I=NX•NY

61 B(I.1)=2.*B(I ,1 )IF(NX.EQ.N23) GO TO 63 NX=NX+NB NY=NY+NB GO TO 65

63 CONTINUEC----- THIS SECTION GENERATES THE COEFFICIENT ARRAY

N 19=N12

vOCT\

Page 107: Investigation of Implicit Methods for Solution of the

NR = 0 11 = 1DO 52 K = 1,NJ=KDO 53 1=11,N19 C ( I ♦ 1 ) =— A ( K # J )J=J + 1

53 CONTINUEIFlK.EQ.Nl.OR.K.GT.Nl) GO TO 59 I 1=N19+1 N 19 =N1 9+N12 GO TO 52

59 NR=NR+1 I 1=N19+1 N 19 =N19+N12—NR

52 CONTINUEC----- THIS SECTION SOLVES THE SYSTEM USING CHOLESKI METHOD

CALL CHOLKC. 1100,KEY, 100,NCE.N)CALL CH0L2(C,1100,B,100*KEY,100 »N)

C----- THIS SECTION SOLVES FOR THE TRUNCATION ERRORIT=IT+1 IF(IT.EQ.2) GO TO 330

TR = VJ (17,1)TR2 =B(17,1 )GO TO 331 •

330 TR3=B(17,1)TRUN1=0.5*(TR3-2,*TR2+TR)/DELTTRUN2 = ( 1./12.)*(W<19,1)-4.*W(18,1>+6.*W(17,1>-4.*W116,1>+W(15,I))/ 1(X**2.)TRUN3={1,/12.)*{W(31,1>-4.*W(24,1)+6.#W(17•1)-4.*W(10,1>+W(3,1))/t

2Y**2.)TRUNC=TRUN1— TRUN2— TRUN3 I T = 0

331 CONTINUEDO 101 1=1,N

101 W (I , 1 )=0(1,1)

vO *■* >»■

Page 108: Investigation of Implicit Methods for Solution of the

CALL C L O X ( J J )J 2 = J J - J I J 1 = J JI F { T I ME - T MA X ) 4 8 . 4 7 , 4 7

4 8 I F { I C O . E Q . I F R E Q > G O TO 4 9 I C O = I C O + l TI ME=TI ME+D£ LTGO TO 51

4 9 WRI TE( 6 , 9 9 ) T I M E . J 2 W R I T E ( 6 , 3 3 2 ) TRLNCCALL M A T O U T ( B , N , l , 1 0 0 , 1 , 0 » 0 . 0 , 0 )I C0 = 1TI ME=TI ME+DELT GO TO 51

4 7 CONTINUE GO TO 3 0

3 3 3 STOP END

S I B F T C CHOL1 DECKSUBROUTINE C H O U { A , NA, KEY, NKEY, NCE, N> DI MENSI ON A ( N A , 1 ) , K E Y ( N K E Y , 1 )

C----------- CHOLI PERFORMS THE CHOLESKI DECOMPOSI TI ONI F ( N C E . G T . O ) NCE =0 1 = 1DO 1 J = 1 , NI F ( A ( I . 1 ) . L E . 0 . 0 ) GO TO 2 A ( I , 1 ) = S Q R T ( A ( I , 1 ) )X 1 = A ( 1 , 1 )1 = 1 + 1M= K E Y ( J , 1 )I F ( I • GT• M) GO TO 1 DO 3 L = I , M

3 A { L , 1 ) =A ( L , 1 ) / X 1 I 1 = J + 1 1 2 = 1 1+M- 2I F ( J . N E . l ) 1 2 = 1. 2 - K E Y ( J - l , 1 )

HNC

HNC

HNC

HNCHNC

vOCO

Page 109: Investigation of Implicit Methods for Solution of the

0 0 4 L = I 1 , I 2I F ( A U , D . E O . O . O ) GO TO 4 X 1 = A < 1 , 1 )I 3 = K E Y £ L - 1 • 1 ) + l 0 0 5 1 4 = 1 , MA U 3 , l ) = A U 3 , l ) - X l * A U 4 , n

5 1 3 = 1 3 + 1 4 1 = 1 + 11 I =M+1

GO TO 62 NCE = J6 RETURN

END$ I 8 FTC CH0 L2 DECK

SUBROUTINE C H 0 L 2 ( A , N A , B , N B , KEY, NKEY. N ) O I MEN SI ON A ( N A , 1 ) , B ( N 8 , 1 ) , KEY ( NKEY, 1 )

C----------- CH0 L2 PERFORMS THE BACK S UBS TI TUTI ONJ = 1DO I 1 = 1 , NB( I , 1 ) = 6 ( I , 1 ) / A < J . l )1 1 = 1 + 1 I 2 = K E Y < 1 , 1 )I F ( I . N E . l ) 1 2 = 1 2 —KE Y( I —1 , 1 )1 2 = 1 2 + 1 1 - 2 J = J + 1I F ( I 1 . G T . I 2 ) GO TO 1 X 1 = B ( 1 , 1 )DO 2 J 1 = I 1 , 1 2 B ( J 1 , 1 ) =B ( J 1 » 1 ) — X1 * A ( J • 1 )

2 J = J + 1 1 CONTINUE

J =KEY( N , 1 )DO 3 L 4 = 1 , N I =N + 1 —L4B ( I , 1 ) = B \ I , 1 ) / A ( J , 1 )I F ( I . E Q . 1) GO TO 3

HNC

HNC

HNCHNCHNCHNCHNCHNCHNC

HNC

HNC

HNCHNCHNC

HNC

HNCHNC

HNCHNC

HNC

vOvO

Page 110: Investigation of Implicit Methods for Solution of the

J=J-1I 2 = 1“ XI1=KEY(12.1)-2+I IF ( I ,NE , 2 ) 11=1 l-KEY(I2-l ,1 )IF(I.GY.II) GO TO 3 M = 11DO 4 M4 = I,11B(I2»1)=Q(12,1)-A(J.1)*B(M,1 ) M=M—1

4 J=J-1 3 CONTINUE

RETURN END

HNCHNC

HNCHNCHNCHNCHNCHNCHNC

100

Page 111: Investigation of Implicit Methods for Solution of the

101

BIBLIOGRAPHY

Page 112: Investigation of Implicit Methods for Solution of the

102

REFERENCES CITED

1. Anderson, J . T. A Review of Dig i t a l - Comp u te r Hea t -T ra n s fe r Progr ams . ASME Paper no. 65-WA7hT-48, 1965*

2. Anderson, J . T . , B o t je , J . M. and K o e f fe l , W. K. D i g i t a lCompu te r S o lu t i on of Complex T ra n s ie n t Heat Trans f e r Problems. West V i r g i n i a U n iv e r s i ty B u l l e t i n , Engineer­ing Expreiment S t a t i o n , Technica l B u l l e t i n No. 62.

3. Booy, M. L. "A Numerical S o lu t io n of P o i s s i o n ' s andL a p la c e ' s Equat ions With A p p l ica t io n s t o Slow Viscous Flow," Jour n a l of Ba s i c E n g in ee r in g , December 1966, pp. 725-733.

4. Bramble, James H. ( e d . ) Numer i c a l S o lu t io n of P a r t i a lD i f f e r en t i a l E qua t ions , pew York: Academic P re s s , 1966.

5. Carslaw, H. S. and J a e g e r , J . C. Conduction of Heat i nS o l i d s . Oxford: At the Clarendon P r e s s , 1959*

6. Gaumer, G i lb e r t R. " S t a b i l i t y of Three F i n i t e D i f fe re n ceMethods of Solving f o r T ra n s ie n t T em pera tu res ," ARS Journa l , pp. 1595-1597- (Oct. 1962)

7. Gay, B. and Cameron, P. T. The E f f i c i e n c y of Numer i c a lS o l u t i ons of th e Heat-Con d u c t io n Equ a t io n . AS?IE Paper no7~b7-WA/HT-17', 1957.

8. Hamming, R. Y«. Numerical Methods f o r S c i e n t i s t s andEngineer s . New York: McGraw-Hill Book Co., I n c . , 1962.

9. Hawgood, John. Numerical Methods in A lgo l . New York:McGraw-Hill Book Co., I n c . , 1955.

10. I r v in g , J . and Mull ineux, N. Mathematics i n Phy s i c s andE ng inee r ing . New York: Academic P re ss I n c . , 1959.

11. I saacso n , E. and K e l l e r , H. B. A nalys is of Nume r i c a lMethods. New York: John Wiley & Sons, I n c . , 1955.

12. James, M. E. e t . ' a l . Analog and D i g i t a l Computer Methodsi n Engineering A n a ly s i s . Scran ton : I n t e r n a t i o n a l TextbooE~Uompany, 1954.

13. Lee, John A. N. Numerical Analysis f o r Computers. NewYork: Reinhold P u b l ish in g Co., 1955.

Page 113: Investigation of Implicit Methods for Solution of the

103

14. R a ls to n , Anthony and W il f , H erbe r t S. MathematicalMethods f o r Di g i t a l Comput e r s . New York: John Wiley & Sons, I n c . , I960.

‘ 15. Richtmyer, R. D. Dif f e r e n c e Methods f o r I n i t i a l - ValueProblems. New Y o r k : ' i n t e r s c i e n c e P u b l i s h e r s , I n c . ,1 9 5 7 . '

16. S chne ider , P. J . Conduct i o n Heat Tr a n s f e r . Reading,• Mass.: Addison Wesley P u b l ish in g Company, I n c . , 1957.

17. Weeg, G. P. and Reed, G. B. I n t r o d u c t io n to Numer i c a lA n a ly s i s . Waltham, Mass.: B l a i s d e l l P u b l ish in g Co.,1 9 5 5 . r

18. Wendroff, Burton . Theor e t i c a l Numer i c a l A n a ly s i s . NewYork: Academic P re s s , 1 9 ^ .

19. Wilson, E. L. " S t r u c t u r a l A na lys is of AxisymmetricS o l i d s , " AIAA J o u r n a l , Vol. 3 , pp. 2269-2274 (1965).

20. Thorne, Charles J . Temperature T ab les . Navord Report5562, P a r t 1. China Lake: U.S. Naval Ordnance ' l e s t S t a t i o n , 1957. -

21. P ersona l communication w i th Dr. Henry C h r i s t i a n s e n ,C i v i l Engineering Department,. Brigham Young U n iv e r s i t y .

Page 114: Investigation of Implicit Methods for Solution of the

INVESTIGATION OF IMPLICIT METHODS

FOR SOLUTION OF THE FOURIER EQUATION

An A b s t rac t of a. Thesis

P resen ted to the

Department of Mechanical Engineering

Brigham Young U n iv e r s i ty

In P a r t i a l F u l f i l lm e n t

of the Requirements f o r the Degree

Master of Science

by

K j e l l S t e in a r Gundersen

May, 1963

Page 115: Investigation of Implicit Methods for Solution of the

ABSTRACT

The purpose cf t h i s t h e s i s was to compare s e v e r a l im p l i ­

c i t methods f o r s o l u t i o n of th e F o u r ie r conduc t ion equa t ion

w i th r e s p e c t to accuracy and computer t im e.

A FORTRAN program was w r i t t e n f o r each method so lv ing a

r e c t a n g u la r p l a t e problem with convec t ive boundary c o n d i t io n s ,

in c lu d in g o r th o t r o p i c p r o p e r t i e s , a r b i t r a r y g r i d , spacings in

th e two d i r e c t i o n s , a r b i t r a r y i n i t i a l t e m p e ra tu re s , and

a r b i t r a r y f l u i d tem pera tu res and hea t t r a n s f e r c o e f f i c i e n t s

a t th e fo u r b o u n d a r ie s .

The methods were compared and i t was shown t h a t the

Choleski decomposit ion method was f a s t e s t . a n d most a c c u ra te

i n most c a se s , whereas th e Booy method showed . l im i te d a p p l i ­

c a t i o n because of s t a b i l i t y problems. The Gauss e l im in a t io n

i s a c c u r a te , bu t slow, and th e Gauss-Ss ide l method i s depend­

en t upon th e r eq u i r ed accuracy and the method of a c c e l e r a t i o n .

APPROVED: