Documente Academic
Documente Profesional
Documente Cultură
With 62 Figures
Springer-Verlag
London Berlin Heidelberg New York
Paris Tokyo Hong Kong
Barcelona Budapest
ISBN-13:978-1-4471-2093-3
e-ISBN-13:978-1-4471-2091-9
DOl: 10.1007/978-1-4471-2091-9
British Library Cataloguing in Publication Data
A catalogue record for this book is available from the British Library
Apart from any fair dealing for the purposes of research or private study, or
criticism or review, as permitted under the Copyright, Designs and Patents Act 1988,
this publication may only be reproduced, stored or transmitted, in any form or by
any means, with the prior permission in writing of the publisbers, or in the case of
reprographic reproduction in accordance with the terms of licences issued by the
Copyright Licensing Agency. Enquiries concerning reproduction outside those terms
should be sent to the publisbers.
o Springer-Verlag London Limited 1994
Softcover reprint of the hardcover 1st edition 1994
The publisher makes no representation, express or implied, with regard to the
accuracy of the information contained in this book and cannot accept any legal
responsibility or liability for any errors or omissions that may be made.
Typesetting: Camera ready produced by authors using
~~
To our families
Preface
This text presents an introduction to the application of the finite element method to the analysis of heat transfer problems. The discussion has
been limited to diffusion and convection type of heat transfer in solids and
fluids. The main motivation of writing this book stems from two facts.
Firstly, we have not come across any other text which provides an introduction to the finite element method (FEM) solely from a heat transfer
perspective. Most introductory texts attempt to teach FEM from a structural engineering background, which may distract non-structural engineers
from pursuing this important subject with full enthusiasm. We feel that
our approach provides a better alternative for non-structural engineers.
Secondly, for people who are interested in using FEM for heat transfer, we
have attempted to cover a wide range of topics, presenting the essential theory and full implementational details including two FORTRAN programs.
In addition to the basic FEM heat transfer concepts and implementation,
we have also presented some modem techniques which are being used to
enhance the accuracy and speed of the conventional method.
In writing the text we have endeavoured to keep it accessible to persons
with qualifications of no more than an engineering graduate. As mentioned
earlier this book may be used to learn FEM by beginners, this may include
undergraduate students and practicing engineers. However, there is enough
advanced material to interest more experienced practitioners.
The first four chapters include a review of the basic heat transfer concepts, the governing equations and a gradual introduction to FEM. The
last three chapters present special topics, which are phase change, adaptivity and convection/advection. Finally two appendices give complete
details of the programs HEAT2D and HADAPT, with full user instructions and documented examples. HEAT2D is a program capable of steady
and transient, linear and nonlinear analyses of diffusive and convective
heat transfer. HADAPT is an adaptive version of HEAT2D and includes
subroutines for error estimation and unstructured mesh generation of triangular and quadrilateral elements in arbitrary geometries.
The complete source code for both the programs and sample input data
files are provided on a floppy disc included with the book.
Swansea, UK
1993.
1.
2.
3.
The program may not be transferred onto any other machine without
the written permission of the author, or in the case of his death, by the
written permission of his estate.
4.
5.
UK
UK
Additional Note
Print-outs of disk content shown in the Appendices of this book have been
especially formatted for reproduction; users should not expect their print-outs
to match those in this section.
Contents
1 Introduction
1.1 Importance of Numerical Analysis of Heat Transfer
1.2 Reliability of Finite Element Analysis for Heat Transfer .
1.3 Various Heat Transfer Problems
1.4 Objectives and Layout
References . . . . . . . . . . . .
1
1
2
2
3
5
7
7
7
8
9
13
15
15
18
20
21
21
25
29
32
32
33
34
41
44
47
49
49
50
51
Contents
4.3.1
52
53
56
58
61
5 Phase Transformation
5.1 Introduction.........................
5.2 The Stefan Problem.. . . . . . . . . . . . . . . . . . . . .
5.3 Numerical Methods for Modelling Phase Transformation
5.3.1 Effective Heat Capacity
5.3.2 Enthalpy Method . .
5.3.3 Heat Source Method
5.4 Benchmark Examples . . .
5.4.1 Analytical Solution
5.4.2 Numerical Solution
5.5 Conclusion.
References. . . . . . . . .
63
63
65
66
67
68
70
73
73
76
79
81
85
85
87
89
90
91
96
103
129
129
129
Contents
A.3
AA
A.5
A.6
A.7
Xl
129
131
133
134
137
140
142
142
144
145
146
146
151
168
169
169
169
169
170
171
172
173
178
178
180
180
183
183
186
191
Subject Index
197
191
192
194
Chapter 1
Introduction
1.1
Since the advent of the digital computer, there has been a revolution in
the general area of mathematical modelling. Highly sophisticated and
detailed analysis of most engineering problems has become possible, where
only crude approximations had to be relied upon. For many problems of
simple geometry and boundary conditions, exact solutions have existed
for decades. Unfortunately most problems of engineering interest involve
complicated geometries and boundary conditions. The cost-effectiveness
and competitiveness of an engineering product depends greatly on the
sophistication of the analysis employed during the design process. This
necessitates the use of numerical methods to obtain approxima.te solutions
to real engineering problems.
A large variety of numerical methods have been used to analyse the
problems of heat transfer [1]. Some of these methods were used before the
power of the digital computer was av~ilable, and have thus become redundant. The two numerical methods which have achieved the greatest degree
of popularity and success since the arrival of computers have been the finite
difference method (FDM) and the finite element method (FEM). FDM has
many advantages, not the least of which are its conceptual simplicity and
ease of implementation. FDM is applied directly to the differential equation by approximating differentials by appropriate difference expressions.
However, the crucial limitation of FDM is that the domain of interest must
be divided into rectilinear cells. Therefore, for many problems boundaries
have to be approximated by a step like pattern. FEM however, does not
suffer from any such limitation, indeed the ability to accurately model the
domain boundaries is the major strength of FEM. The domain of interest
is divided into a number of simple non-intersecting areas or volumes (elements) of variable size (if necessary). The boundaries of these elements
1.2
1.3
Heat transfer problems constitute a very large class of problems in engineering. These problems span many engineering disciplines including
Introduction
1.4
The text in the following chapters has been arranged according to the
objectives stated above. The next chapter has been devoted to the establishment of the basic differential equations that govern the different forms
of heat transfer and the various boundary conditions that may be applied.
Chapter 3 introduces the reader to the mathematical background of the
finite element method following which the basic concepts are explained.
The spatial discretisation of the governing equations of heat transfer is then
demonstrated using the basic principles established earlier. Discretisation
in the time domain for transient (time dependent) problems is discussed
in Chapter 4. Various schemes that are normally used in heat transfer
analysis are presented.
The special numerical techniques used for solving phase change problems
are described in Chapter 5. These techniques are evaluated by comparing
with available analytical solutions for freezing and melting.
To obtain an accurate solution, it is sometimes necessary to use very
fine meshes in regions of a problem domain where high gradients of the
field variable exist. The variation of field variable in the rest of the domain may, on the contrary, be so gentle as to require a very coarse mesh
for its adequate resolution. The areas of high gradient may not always
be predictable and in the case of transient problems, they may not be restricted to a particular region. Therefore if a fixed fine mesh is used in
solving such problems, it may turn out to be unacceptably expensive. For
such problems, the technique of adaptive analysis based on estimating the
discretisation error provides an economical alternative. This technique is
developed for heat transfer problems in Chapter 6.
In the analysis of heat transfer problems where convection is the dominant mode of transport, the conventional Galerkin form of the finite element method proves to be inadequate. Several techniques are used to
modify the conventional method to model the convection dominated heat
transfer problems successfully. Some of these techniques are discussed in
Chapter 7.
The Appendices describe the software included with the text. The main
variables used are defined and some key subroutines are listed. The program structures are illustrated schematically. Full user instructions are
given for the two programs HEAT2D and HADAPT. Several documented
examples are also included for both the programs to familiarise the user
with the software. Appendix A presents the program HEAT2D, which may
be used for steady and transient, linear and nonlinear analyses of diffusive
and convective heat transfer. Phase change problems may also be solved
using the enthalpy method or a heat source method. Appendix B introduces the program HAD APT , which is an adaptive version of HEAT2D
and includes subroutines for error estimation and unstructured mesh generation of triangular and quadrilateral elements in arbitrary geometries.
Introduction
References
[1] W.J.Minkowycz, E.M.Sparrow, G.E.Schneider, and R.H.Pletcher, editors. Handbook. of Numerical Heat Transfer. John Wiley and Sons,
Inc., New York, 1988.
[2] J.Barlow and G.A.O.Davies. Selected FE benchmarks in structural and
thermal analysis. Technical Report FEBSTA REV 1, NAFEMS, 1986.
Chapter 2
Governing Differential
Equations
2.1
Introduction
2.2
Conduction
2.2.1
(2.3)
As illustrated in Figure 2.1, the temperature within the wall decreases
linearly from the value Twl to Tw2 , if the thermal conductivity is constant.
However, this linear relationship does not exist in unsteady heating or
cooling process and generally heat flux varies locally and in time. Equation
(2.1) may then be applied only to parts of the body of infinitely small
dimensions. Therefore, the temperature difference (Twl - Tw2 ) in Equation
(2.1) is to be replaced by the differential aT; the place of the wall thickness
b is taken by the differential an, where n is the line normal to the plane of
the surface element dA. In this way, for the rate of heat flow dQ through
the surface dA, the equation
dQ
= _kdA aT
an
is obtained. The minus sign in this equation indicates that the heat flow
proceeds in the direction of the temperature drop, that is, in the negative
aT
= - kan-
(2.4)
aT
= -k ax
aT
ay
q11 =-kqz
2.2.2
= - kaT
az-
(2.5)
The expression (2.5) is valid only for an isotropic material. However, for
some materials such as wood, fibrous materials and crystalline substances,
the conductivity is directionally dependent. Therefore, the more general
non-isotropic description of conduction postulates that any component of
10
the heat flux vector depends upon the temperature gradients in each of
three directions. For the x-direction for example
aT
aT
qx = -ku- - k12 ax
ay
for x, y and
aT
k13 az
(2.6)
or simply as
qx;
aT
= -k;j-a
x
(2.8)
where repeated indices indicate a summation over all three values (summing on repeated suffixes-j in this case).
It is noted that three conductivity components arise in each co-ordinate
direction and the thermal conductivity becomes the following tensorial
quantity:
= [!~:
!~~ !~:]
(2.9)
k31 k32 k33
When the co-ordinate system x, y, z rotates about its origin a new coordinate system x', y', z' is obtained. The new conductivity matrix k' can
be written as
(2.10)
where P is direction cosine matrix
COS(X1,X)
P= [ COS(Y"x)
COS(ZI, x)
COS(XI,y)
cos(yl,y)
COS(ZI, y)
COS(XI,Z)]
COS(YI, z)
COS(ZI, z)
(2.11)
= [~~
and
0
k"
0
aT
qe
= -kea~
q"
= -k" a",
aT
2,1
(2.12)
11
(2.13)
(~,.", () are principal axes of conductivity in the co-ordinate system. ke, k"
and k, are the principal conductivity coefficients. If (~,.", () are mutually perpendicular axes then the material is considered as an orthogonal
anisotropic material such as wood and fibrous materials. It can also be
considered that kij = O(i #- j) and kii = ki in the k matrix, that is, all
non-diagonal terms are zero and the diagonal terms are different, representing different conductivities in different directions. For isotropic case,
kij = O(i #- j), and kii = k, that is, all non-diagonal terms in the k matrix
are zero and the remaining non-zero diagonal ones are equal.
aT
qe = -ke a~
aT
( ')
."
[cosO SinO]
-sinO cosO
(X)
y
(2.15)
12
Therefore,
[ kxx
kyx
kxy ] _ [cos()
kyy - sin()
-sin()] [ke
cos()
0
0] [cos()
-sin()
k'l
sin()]
cos()
(2.16)
= kesin 2()+k'lcos 2 ()
(2.17)
qx = -(kecos 2 ()
qy
+ k'lsin 2()) ~~ -
= -(ke - k'l)cos()sin()~~ -
(ke -
k'l)coS()Sin()~:
(2.18)
13
(q,l
+ ~dy)dx
dy
{q:c+ ~dx)dy
dx
q,ldx
.jk;.
Ike and
Figure 2.3 shows that the conductivity coefficient varies for different
Values of O. This phenomenon can be shown experimentally by taking a
piece of flat glass and a piece of mica of the same shape, and covering
one side of both with wax and heating the other side with candles. Few
minutes later, it will be found that the shape of the molten wax on the
glass is circular while on mica it is ellipsoidal (see [1]).
2.2.3
We now set ourselves the problem of determining the basic equations which
govern heat conduction in a solid.
Consider an isotropic material in the two-dimensional system in a domain n shown in Figure 2.4. If the heat flowing in the direction of the
x and y axes per unit length and in a unit time is denoted by q:c and q,l
respectively, the difference between outflow and inflow for an element of
size dxdy is given as
oq:c
)
(
oq,l
)
dy (q:c + ox - q:c + dx q" + oy - q,l
For conservation of heat, this quantity must be equal to the sum of the
heat generated in the element in unit time, say, Qdxdy and the heat gained
14
in a unit time due to the temperature change, namely, -pc~~ dxdy (where
c is the specific heat, p is the density and T(x, y, t) is the temperature
distribution). Clearly, this requirement of equality leads to the differential
relationship
oq",+qq"
aT 0
- - Q +pc-=
ax oy
at
(2.21)
= - kaT
ax
aT
oy
q =-k-
"
a aT
ax ax
a aT
oy oy + Q -
-(k-) + -(k-)
aT
at = 0
pe-
(2.22)
a aT oaT oaT
ax ax + -(k-)
oy oy + -(k-)
oz oz + Q -
-(k-)
aT
at = 0
pe-
(2.23)
Vk VT
+ Q=
aT
(2.24)
peat
10
aT
--(rk-)
r
or
looT
oaT
+ -(k-)
or + --(k-)
r2 of} of}
oz oz + Q -
aT
at = 0
pc-
(2.25)
aT
OX;
OXj
- . (k;j-)
aT
+ Q = peat
(2.26)
2.2.4
15
= To(x,y,z)
in
(2.27)
= T(x,y,z,t)
(2.28)
2.3
Convection
Convective heat transfer takes place when whole groups of molecules move
from one place at a certain tempera~.ure to another at a different temperature. Therefore, convection is created by fluid flow (Figure 2.5). Imagining a group of particles moving with a given velocity field whose components are (u, v, w) or (u). When calculating the rate at which heat crosses
any plane, a convective term of components (pcTu, pcTv, pcTw) or (pcTu)
must be added to the part due to conduction. Thus the components of the
heat flux vector are now
8T
q",
= -k 8x + pcTu
qll
= -k 8y + pcTv
qz
= -k 8z + pcTw
8T
8T
8T
pc( 7ft
8T
8T
8T
+ u 8x + v 8y + w 8z ) = Vk VT + Q
(2.30)
16
DT
Dt
pcwhere
= VkVT+Q
(2.31)
DT aT
aT
aT
aT
-=-+u-+v-+wDt
at
ax
ay
az
aT
pc( at
aT
u 9 aT
aT
+ U r ar + -;:- ao + U z az ) =
1a
aT
1a aT
a aT
;: ar (rk ar) + r2 ao(k ao) + az (k az) + Q
(2.32)
17
TJ
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
Til
a
a
a
-ap
+ -(pv)
+ -(pw)
=0
at + -(pu)
ax
ay
az
or, in vector notation,
(2.33)
ap
at + V(pu) = 0
We consider the density for the problems relevant to us as constant, i.e., incompressible material, therefore the above equations reduce to a statement
of continuity,
(2.34)
or,
Vu=O
In many cases, convection normally occurs in heat exchange between
fluid and solid boundaries. Therefore, convection may be considered as a
kind of boundary condition to the solid domain.
It was Newton who observed that convective heat transfer was a function
of the temperature difference between the solid and fluid, Til and TJ (see
Figure 2.6)
(2.35)
where q and h are the heat flux and the heat transfer coefficient between
the solid and the fluid. Therefore, the boundary condition Equation (2.29)
can be expressed as
(2.36)
18
To find out the value of h, the boundary layer theory has to be employed,
where (2.31) is applied to laminar flow along the solid wall (see [4]). It can
be shown that h is related to the Nusselt number (Nu) which is a function
of the Prandtl number (Pr) and the Grashof number (Gr). We have
h = kNu
L
(2.37)
Nu ~ a(GrPr)t
For a mean air temperature of 38C and atmospheric pressure with constant wall temperatures, we have (see [5]) a = 0.59 for vertical surface and
a = 0.54 for horizontal surface approximately. The Grashof number (Gr)
is defined as
Gr = g{3(Ta - Tf )P
112
2.4
Radiation
19
In practice we are normally concerned with radiation between two systems which are at temperatures Tt and T2 with Tt > T2. The surface at
T2 will emit some radiation, but it will receive more radiation from Tt and
hence will increase in temperature. The net heat received by body 2 is
(2.40)
where A is the receiving area of body 2, and F12 is a geometry dependent
view factor between body 1 and body 2.
- kaT
-
an =
ftO'
(4
Tt - T2 4)
(2.42)
Ea
20
References
[1] C.M.Yu. Heat Conduction and its Numerical analysis (in Chinese).
Tsinghua University Press, Beijing, China, 1981.
[2] D.R.Croft and D.G.Lilley. Heat Transfer Calculations Using Finite
Difference Equations. Applied Science Publishers Ltd, London, U.K.,
1977.
[3] L.C.Burmeister. Convective Heat Transfer. John Wiley and Sons, New
York, U.S.A., 1983.
[4] J.P.Holman. Heat Transfer. McGraw-Hill Book Company, New York,
U.S.A., 1990.
[5] M.N.Ozisik. Basic Heat Transfer. McGraw-Hill Book Company, New
York, U.S.A., 1977.
Chapter 3
Finite Element Method
3.1
Introduction
If the heat flow domain and boundary conditions are well posed then the
governing equations of heat transfer can be analytically solved but only
for the simplest type of problems.
In this section we try to work out the solution of the steady-state heat
conduction equation in a rectangular region in which there is no heat generation, the thermal conductivity is constant, and only one of the boundary
conditions is nonhomogeneous while the other three boundary conditions
are homogeneous. The rectangular region is within 0 :S x :S a,O :S y :S b,
subjected to the boundary conditions shown in Figure 3.1. It may be
noted that the surfaces at x = 0, x = a, and y = 0 are maintained at
zero temperature, while the surface at y = b is subjected to a prescribed
temperature distribution To. The mathematical formulation of this heat
conduction problem can be simplified as
8 2 T 8 2T
8x2 + 8y2
(3.1)
=0
with
T(x,y)=O
at
x=O
=0
at
x=a
T(x,y)=O
at
y=O
= To
at
y=b
T(x,y)
T(x,y)
(3.2)
22
T=To
b t - - - - -.......
T=O
x
a
(3.4)
(3.5)
cPX = -MX
(3.6)
cPY =MY
(3.7)
dx 2
dy2
+,X2
> O.
However, if
Y = Cy+D
T(x, y) = (Ax
and
+ B)(Cy + D)
(3.8)
23
x = Acosh>'x + Bsinh>.x
y = Ccos>.y
T(x, y) = (Acosh>.x
+ Dsin>.y
+ Bsinh>.x)(Ccos>.y + Dsin>.y)
(3.9)
For both cases their solutions satisfying boundary conditions are the same
as (see[l])
which we do not require. Therefore, we choose M > 0, that is
iii) M = +>.2 > 0 then
x=
Acos>.x + Bsin>.x
(3.10)
=0
X=o
at
X=O
at
x = a
(3.11)
where the boundary conditions (3.11) are obtained from the boundary
conditions (3.2) by substituting T(x,y) = X(x)Y(y) and noting that the
Y(y) should not vanish at x = 0 and x = a. Therefore,
X(x) = sin>'n
(3.12)
where
(3.13)
and constant B is omitted. The solution of Equation (3.7) for the Y
separation is taken as
Y = Csinh>'nY + Dcosh>'nY
(3.14)
y=o
:at
y= 0
24
but many solutions for each consecutive value An, n = 1,2,3, ... Therefore,
the complete solution for the temperature should be taken as a linear sum
of all these permissible solutions in the form
E CnsinhAnysinAnx
00
T(x,y) =
(3.16)
n=l
where the Cn's are the unknown expansion coefficients which are yet to be
determined. We note that the solution given by Equation (3.16) satisfies
the differential equation of heat conduction (3.1) and the three homogeneous boundary condition in Equation (3.2). But it does not yet satisfy
the non-homogeneous boundary condition. Therefore, the unknown coefficients Cn's can be determined by constraining the above solution to satisfy
the non-homogeneous boundary condition in Equation (3.2). If Equation
(3.16) is the solution of the above heat conduction problem it should also
satisfy the non-homogeneous boundary condition, that is,
00
= E CnsinhAnbsinAnX
To
III
O~x~a
(3.17)
n=l
L
a
. \
,. \
SZnJlmX
sznJlnX'd'
x
= -a2
(3.20)
all the terms in the summation on the right-hand side of Equation (3.18)
vanish except the term An = Am. Therefore we have
(3.21)
integrating the left-hand side yields
aTo
n
- [ - ( -1)
n1r
and
.
+ 1] = a
-CnsmhAnb
2
Cn = 2To[-(-I)n + 1]
n1rsinhAnb
(3.22)
(3.23)
25
The substitution of Equation (3.23) into Equation (3.16) finally gives the
desired solution of the above heat conduction problem as
T( X, Y) -_ 2To
7r
or
4To
~
L..J
. h \ bStnAnX
n=l
Stn
sinh (2k:l),..Y
szn
k=l
(3.24)
An
(2k + 1)7rX
a
(3.25)
It can be seen that the analytical solution of the simplest problem is not
simple. Furthermore, a numerical procedure is still required to evaluate
the above expression. To overcome such difficulties and to enlist the aid of
the most powerful tool developed in this century - the digital computer - it
is desirable to recast the problem in a purely algebraic form, involving only
the basic arithmetic operations. To achieve this, various forms of discretisation of the continuum problem defined by the differential equations can
be used. In the continuum problem the solution is satisfied at all points in
the problem region. The discretised form of the problem only requires the
solution to be satisfied at a finite number of points in the region. In the
remainde~ of the region appropriate interpolations may be used. Of the
various forms of discretisation which are possible, one of the simplest is the
finite difference method which has been utilized for many decades. Today,
the finite element method developed in the 1960's is the most attractive
tool for the approximate solution of differential equations. The finite element formulations can be derived ftom several different approaches such
as variational principles and weighted residuals.
3.2
[2]
II(T) =
10
ax
oy
1r
(3.26)
26
a aT
-(k-)
ax ax
aT
+ -(k-)
+Q=
ay ay
(3.27)
T=To
on
(3.28)
fT
aT
- kan
= ij
(3.29)
5II(T)
a
k aT a
= 10[ [k2( aT
ax) ax (<<5T) + 2( ay) ay (<<5T) -
]
[
Q5T dO + 1rq ij5Tdf
[ aB
10 A ay dxdy
=0
(3.30)
[ aA
1
ay Bdxdy + Ir ABnlldf
= - 10
(3.31)
where A and B are suitable differential functions, no; and nil are the direction cosines of the outward normal n to the closed curve f surrounding
an area 0 in the (x, y) plane. The integration around f is made in an
anti clockwise direction and it should noted that
vA
no; ax
aA
aA
+ nil ay = an
(3.32)
5II(T) =
1rT+rq
5II(T)
[
aT
[ [a aT
a aT
]
= 1rq
(k an + ij)5Tdf - 10 ax (k ax) + ay (k ay) + Q 5TdO = 0
(3.34)
27
where aT is arbitrary, thus Equations (3.27) and (3.29) are necessary when
II is stationary. We call the differential equation (3.27), the Euler-Lagrange
equation and the boundary condition (3.29), natural.
It can be seen that instead of solving the differential equation(EulerLagrange equation) directly, we can minimize its functional to approach
the problem of two--dimensional steady state heat conduction with the
essential and natural boundary conditions on rT and rq
Let us now consider a specific problem, which is a long cylinder of inner
radius r = a and outer radius r = b. A fixed flux of q = -U per unit
length is applied on the inner surface of the cylinder whereas at the outer
edge the temperature is fixed at To = O. The governing partial differential
equation for this problem is
~~(rkoT)=O
ror
(3.35)
or
at r
=b
koT -U=O
at r = a
(3.36)
on
The classical analytical solution to the heat conduction problem is presented by Carslaw and Jaeger [3] which has the form of
T(r)
a r
Ua r
= To + q-In(
-) = --In( -)
k
b
k
b
(3.37)
1 f2"
= 2" 10
lb
a
oT
f2"
k( or )2 r drd8 - 10 UTad8
(3.38)
00
,,=1
C"N(r)"
(3.39)
which must satisfy the essential boundary condition. Then the functional
has to be minimized with respect to the parameters C". In the present
problem, for instance, we can use a power series expansion of the form
,
T(r)
00
= Co + L C"rn
(3.40)
,,=1
(3.41)
28
Note that since T(b)
= 0 so Co = -C1 b -
C2 b2 , therefore,
(2
2)
T(r)=C
1 (r-b)+C 2 r -b
(3.42)
and
(3.43)
By substituting Equations (3.42) and (3.43) into the functional (3.38) we
obtain
Il(T) = br
(3.44)
then
Il(T) =
all
aCi = 0,
r =
1,2
(3.46)
(3.48)
which may be solved to give
U
C1 = -1.38461"
C2
= 0.23081"
(3.49)
1'(1) =
0.6922~
4)
(3.50)
(3.51)
3.3
29
o ot + -(k-)
0 ot + Q
= -(k-)
Ox ox oy oy
(3.52)
where t contains trial functions and satisfies the Dirichlet boundary condition of t = To at rT. The smaller the residual, the better the approximation. It should be noted that Ro is a function of position in O. Now,
we attempt to reduce this residual as close to zero as possible. If we have
i
= 1,2, ... ,M
(3.53)
1o [OxootOx + oyootoy +
Wi -(k-)
-(k-)
Q dxdy
=0
(3.54)
Jrr
r q
It is required that
WiRrdr = 0
Jrrq Wi
i=1,2, ... ,M
rq
(3.56)
Thus,
[k ot
on +q]dr=O
(3.57)
30
{
[OOT
OOT]
{-[OT]
1n ~ ox (k ox) + oy (k Oy) + Q dxdy + 1rq Wi k on + ij dI'
=0
(3.58)
Wi [OT
ko- + ij] dI'
WidI' + 1frrT+rqkoTon
rq
n
= 0
(3.59)
Since both Wi and W; are arbitrary, we can limit the choice of the weighting
functions as
(3.60)
Wi = 0
on r T
W; = -Wi
on
rq
(3.61)
Now, it can be seen that the term involving the weighted integral of ~~ on
the boundary vanishes and the approximating equation becomes
{ [oW; oT
1n ox k ox
OT]
{
{
+ o~
oy k oy dxdy - 1n WiQdxdy + 1rq WiijdI' = 0
(3.62)
This is the well known weak form of the steady state heat conduction
equations. As for the variational method, the boundary condition
oT
-k-=ij
on
(3.63)
is in some way natural for this problem as the formulation eliminates the
need for an actual evaluation of ~~ on the boundaries and if ij = 0 such
boundaries do not enter explicitly into Equation (3.62).
In order to utilize the weak form Equation (3.62) to obtain the approximation of the solution, one has to first choose appropriate trial functions,
Ni (x, y) to represent the real solution, that is
00
T(x,y) = Co + ECiNi(x,y)
(3.64)
i=1
which must satisfy the essential boundary conditions. The second task is
to choose the weighting functions. The most popular weighted residual
method is where the trial functions themselves are chosen as the weighting
functions, thus
Wi(X,y) = Ni(x,y)
(3.65)
31
This method was first used by Galerkin and is referred to the Galerkin
method. Therefore, for Galerkin weighted residual method, the weak form
of the 2-D heat conduction equations may be written as
=0
(3.66)
Let us consider the same problem as given by Equations (3.35) and (3.36)
in Section 2. The residual in n is
10
oT
Ro =--(rk-)
r Or
or.
(3.67)
r q is
Rrq
oT
= k--U
on
(3.68)
and
(3.71)
which vanish on the rT. Substitution of Equations (3.70) and (3.71) into
the weak form Equation (3.69) yields
!(b2 _a 2) 1(b3_a3)]
2k [ 2
3
[C1 ]_2U[(a-b)]
1r
Hb3 _ a3) (b4 _ a4 )
C2 - 1r a (a2 - b2)
(3.72)
which is identical to Equation (3.47). Using the same procedure the approximate solution can be obtained. Thus we see here that the RayleighRitz and Galerkin methods lead to identical results. For generality, we
will use the Galerkin weighted residual approach to introduce the finite
element method.
32
3.4
3.4.1
Introduction
t(x,y) = Co + L:CiNi(x,y)
(3.73)
i=l
t(x,y) =
L:
~~
L:
~~
Ci(2) Ni(2)(X,y)+ .. +
L:
~~
clM) NlM)(x, y)
(l,
(3.74)
where P is the number of free parameters C't in each element and M is the
total number of elements. In such a case, the definite integrals occurring
in the weak form Equation (3.66) can be obtained simply by summing the
contributions from each element as
Er
e=l
Jo.
[aNt k ate
ax ax
ay
Er
e=l
Jo
NtQdxdy
(3.75)
where
te(x,y)
i=l,P
L:
0.
C'tN,/(x,y)
(3.76)
33
3.4.2
oTe
oN~ k
oTe]
k
- + --,
- dxdy - 1 NtQdxdy + 1 NN.df
1 [ ON~
Ox Ox
oy oy
o.
r
__
I
0.
q.
(i=l,P)
(3.77)
The third term of Equation (3.77) appears, if any boundary of this element
fie lies on the boundary rq of fi. Now, we assume that the Nt(x,y) are
analytically simple, such as low-order polynomials and the like and .Cf are
local or nodal values of the solution T, that is
j=l,P
te{x,y) =
TJNJ{x,y)
(3.78)
0.
Jo.
ox
ox
oy
Jo.
oy
(i,j
Jr q.
= l,P)
(3.79)
where
-1
e
K "'J
0.
J,~
(i,j
= l,P)
(3.80)
[ONikoNJ
d
-ox- -ox
- +ONfkoNJ]
- - - dxy
oy oy
(3.81)
It = f NtQdxdy - f NNdr
Jo.
Jrq
(i=I,P)
(3.82)
= l,NP)
(3.83)
34
where
Kij
= EKtj
(3.84)
e=l
(3.85)
e=l
convective boundary condition (2.36) is involved, then the element conductivity matrix becomes
(3.86)
(i=1,P)
(3.87)
For the general non-isotropic case, the element conductivity matrix (3.81)
may be written in tensor notation as
(3.88)
In order to discuss further details, the type of finite element to be used
for analysis must be defined.
3.4.3
Triangular Elements
The simplest finite element geometry for the heat conduction problem
in two dimensions is that obtained by covering n with triangles having
nodes (or solution points) at the vertices (Figure 3.2) and in which the
finite element solution T(x, y) consists of plane triangular "tiles". The
triangular finite element in two spatial dimensions holds an important
place, particularly for the purpose of adaptively remeshing, because it is
very flexible in idealising an arbitrary domain n geometrically.
Here, the linear triangular element is used to demonstrate all essential
features of two dimensional finite element analysis. The element has three
nodes numbered anticlockwise as 1,2,3, or generally as i,j, m. A linear
temperature variation is assumed throughout the element, each node has
one degree of freedom corresponding to the free parameters, that is the
unknown temperature value Tt at that point. Therefore the temperature
at any coordinate position x, y within the element can be represented as
(3.89)
35
z
(Xi,Yi)
Te(xl, yt) = T;
T e ( X2, Y2) = T;
(3.90)
T e (X3,Y3) = T;
SO,
we have
T; =
T; =
T; =
al
+ a2Xl + a3Yl
al
+ a2x2 + a3Y2
al
+ a2x3 + a3Y3
(3.91 )
al =
where
2~ [(X2Y3 -
X3Y2)T;
+ (X3Yl -
XlY3)T;
+ (XlY2 -
x2yt}T;]
a2 =
2~ [(Y2 -
Y3)T;
a2 =
2~ [(X3 -
1 [1
A = -det 1
2
+ (Y3 -
Yl)T;
+ (Yl -
Y2)T;]
element area
(3.92)
(3.93)
Therefore, we write
(3.94)
where
36
= 2~ (~ + C2 X + d2 y)
N;
= 2~ (ba + C3 X + d3 y)
(3.95)
in which
= Yj - Ym
d; = Xm - Xj
Ci
(3.96)
and i,j and m are taken as 1,2,3 in cyclic permutation. Here, the element
trial functions Nr are named as the shape functions. It should be noted
that Nr(x,y) has a unit value at (x;,y;) of node i, whereas it has zero
value at (xj, Yj) of node j and (xm, Ym) of node m. This is a characteristic
of an element shape function.
Alternatively, f~r the linear three node triangle, the element shape functions can be simply defined by area coordinates. Considering Figure 3.3,
the coordinates Lt , L2 and L3 are defined as
(3.97)
where A is the area ~123, At the area ~P23, A2 the area ~P31 and A3
the area ~P12. Since P has only two Cartesian coordinates (x, y), it must
be the case that the three coordinates (L;) cannot be independent of each
other. It is clear that the sum of the three area coordinates equals one,
that is
(3.98)
37
It is seen that Li has a unit value at node i and zero value at other nodes
with a linear variation in between. It is easily verified that the area coordinates L l , L2 and L3 are identical to the linear shape functions N:, Ni
and N 3. The Cartesian coordinates (x,y) may also be expressed as
Y2
Yl
Y3
(3.99)
L3
-1
K e""'1
O.
[ONtkoNJ
d
- - - - +oNtkoNJ]
- - - - dxy
OX
oy
Ox
oy
(i,j
= 1,2,3)
(3.101)
= 4A
+ dldl
+ d2 dl
C3Cl + d3d1
[ClCl
C2 Cl
+ dl d2
+ d2d2
C3C2 + d3d2
+ dld3]
+ d2d3
C3C3 + d3d3
CIC2
ClC3
C2 C2
C2 C3
(3.102)
where
and
(3.104)
If side ij of the triangle is subjected to the natural boundary condition
with a uniform flux q then
feq
= fe.
= -q k.
f.
~
.j
[Z~l dr = -qLii
2 [~l
1
(3.105)
38
-1
.2
-1
-1
1
(3.106)
= 2.
Since,
(3.107)
39
j m
1 2 4
4 3
1
3 4 6
6 5 3
No. element i
j
m
5
5
6 8
6
8 7
5
7
7 8 10
8
10 9 7
3
4
K11
K14
K24
K34
K44
K46
K55
K=
K58
K57
K56
K68
K66
SYM.
K77
K78
K710
K88
K8lO
K9lO
KlOlO
(3.108)
(I)
K 22
(2)
K 22
--
T/
.H24 -
+ K(3)
+ K(4)
11
33 -
1
K 35 -K(4)32 - (I)
K(2)
K(3)
K
33
(4)
K 22
11
(6)
K 22
K~~)
+ K(7)
+ K(8)
11
33 -
33
K 9,lO --
+ K(8)
- 2
11-
K(2)
34 -
21
= K~~) =-1
+ K(3)
2
12 - -
K 36 -K(3)+K(4)-0
13
31K
K(3)
46
23
56 -
K 58 -- K(5)
13
K 68 --
R,(4)
21
=-1
+ K(5)
12 -
-2
+ K(6)
- 0
31K(5) -
23 - -
- K(6)
78 -
21
+ K(7)
12 -
K(7)
13
+ K(8)
- 0
31-
K 8 ,lO =
K~;) =-1
K 7,10 --
+ K~~) + Kg) = 4
K(8)
22 K(7)
+ K(4)
+ K(5)
11
22 -
K 79 -- K(8)
32 -
=
=
= 4
+ K(5)
+ K(6)
11
33 -
K 57 -- K(6)
32 (3)
K 33
22
1/(1) 1
--
1~32
K 13
-2
K(8)
1
21 - -
It may be noted that the global K matrix is symmetric about the leading
diagonal and that it is also banded. The bandwidth of the matrix is affected
40
2
-1
-1
-1
-1
0
4
o
o o
o o
o o
o o
-1
o
o o
0
4
-1
-2
-2
-1
0
0
0
0
0
o
o
o
0
0
0
0
4
-1
-2
-1 0
-2 -1
o
o
o
o
o
o
o
-1 0
-2 -1
-1
0
0
0
o
o
o
o
0
0
-1 0
-2 -1
o
o
o
o
0
2
-1
-1
-1
-1
-1
0
0
0
o
o
o
o
o
= o
o
o
o
o
(3.109)
Tg
= TlO = 100
4Ta -Ts =0
-Ta + 4Ts -T7 = 0
- Ts + 4T7 - 100 = 0
or in matrix form as
[~:l
=[ ~ 1
[!1o -1~1 ~ll
4
T7
100
We can use the Gaussian elimination method to reduce a linear equation
system to an upper triangular form by successive elimination. However, in
present case, the solution can be easily worked out as
Ta
Ts
T7
= 1.78570
= 7.14286
= 26.7857
T; = 1.0940
T; = 5.4880
T; =
26.094
41
3.4.4
e,,,,
e,,,,
e,
e- ",
N:=1-e-",
(3.110)
(3.113)
42
."
1
(3.115)
as
[ ~l = J- [~l
1
2!Y.i.
2!Y.i.
811
(3.116)
81/
8e !!JL]
8e
!!JL
8",
(3.117)
8",
81/
81/
This mapping technique is specially useful for high order elements. For
instance, the six node triangular element shown in Figure 3.6 has shape
functions as
Ne =
1
."(2.,, - 1)
N = 4.,,(I-e-.,,)
N3e = (1 - e- .,,)(1 e
2
N = 4e(1- e-.,,)
N = e(2e - 1)
N6 = 4e."
2e - 2.,,)
e
4
e
5
e
(3.118)
43
"I
DDD
Figure 3.8: 4,8 and 9 node elements
which are quadratic in (~, "I).
In addition to triangles, quadrilateral elements are widely used, Figure
3.7 shows the mapping from a general quadrilateral to a square. The shape
functions of some typical quadrilateral elements (Figure 3.8) are listed a8
follows.
Bilinear -I-node element
(3.119)
Serendipity 8-node element
=
=
e)/2
(3.120)
Nt =
[~~i(1
where
~i' "Ii
+ ~~i)/2 + (1 -
e)(l - e)][TJTJi(l
+ TJTJi)/2 + (1 -
"1"12(1 - "In
(3.121 )
44
3.4.5
Numerical Integration
(3.122)
(3.126)
where ei,"'i are natural coordinates of the sampling points, ai, aj are weighting factors and n is number of integration points in one direction. The
positions of the sampling points and the values of the weighting factors for
n = 1, 2, 3 are listed in Table 3.3 in which p is the degree of polynomial in
or." which can be integrated exactly. A 2x2 integration rule is shown in
Figure 3.10
45
1
3
P
1
2
~i
l
t
~
~
~
~
0.0597158717
0.4 701420641
0.4701420641
0.7974269853
OJ012865073
0.1012865073
"li
l
t
J
0
~
~
~
~
0.4701420641
0.0597158717
0.4701420641
0.7974269853
0.7974269853
0.1012865073
ai
1
1
a-
-*
25
4s
0.2250000000
0.1323941527
0.1259391805
46
(12)
(22)
(11)
(21)
1x 1 1
2x 2 3
ei
0
'TJj
ai
aj
-~'3
--"~
-;-;ij
~i
-V~ -v'~
-J~
-V~
v~
-v~
~~
3x 3
7a
0
0
0
vf
v~
J~
--'is
.~
v~
-v~
v~
5
5
9
8
9
8
9
5
9
5
9
2
5
5
9
5
47
References
[1] M.N.Ozisik. Basic Heat Transfer. McGraw-Hill Book Company, New
York, U.S.A., 1977.
[2] O.C.Zienkiewicz and K.Morgan. Finite Elements and Approximation.
John Wiley and Sons, New York, U.S.A., 1983.
[3] H.S.Carslaw and J.C.Jaeger. Conduction of Heat in Solids. Clarendon
Press, Oxford, 1959.
[4] D.R.J.Owen andE.Hinton. A Simple Guide to Finite Elements. Pineridge Press, Swansea, U.K., 1980.
[5] G.Carey and J.T.Oden. Finite Elements, Vol II. Pineridge Press,
Englewood Cliffs, New Jersey 07632, 1983.
Chapter 4
Temporal Discretisation for
Heat Conduction
4.1
Introduction
50
4.2
It was shown in the previous chapter that the Galerkin form of the weighted
residual method when applied to the steady heat conduction equation,
gives identical results to those achieved by Rayleigh-Ritz approximation of
the variational functional of Equation (3.30). We will therefore directly use
the Galerkin weighted residual method to derive the finite element form
of the transient equation. The residual for the transient heat conduction
equation is defined as: .
Ro
a at + -(k-)
a at + F - pcat
= -(k-)
ax ax ay ay
at
(4.1)
The subsequent steps of the derivation to obtain the Galerkin form of the
weighted residual expression remain the same as outlined in the previous
chapter, i.e. Equation (3.53) to Equation (3.66). The only exception
is the presence of the temporal derivative term in the weak form of the
transient conduction equation in addition to the terms in Equation (3.66).
The Galerkin weak form of the transient heat conduction equation may
therefore be written as,
at
+1[aN;
1o pcN;-dxdy
at
ax
0
aN;kat]
- kat
- +ax
ay ay dxdy
(4.2)
To obtain the algebraic system of equations from the weak form of Equation (4.2) we use the familiar strategy of dividing the solution domain into
subregions or elements, and use the element shape functions as discussed
earlier to define the solution within the element, based on the nodal values. In this case however, we apply these shape functions to the temporal
derivative, i. e.,
ate
j=l,P aT~
at (x,y) = L a: NJ(x,y)
(4.3)
0.
It may be noted that the weighting functions in Equation (4.3) are identical
to the trial or shape functions in Equation (4.3) above. This will result in
the final Galerkin finite element form of the discretised equations, which
may be written as,
M
[aN~ aN~
aN~ aN~]
LM 1 pcN;e NJ aTe
a: dxdy + L 1 -a' k' k- TJdxdy
a + -a
Y aY
e=l
0.
e=l
0.
J
X
(i,j
= 1,P)
(4.4)
51
(4.5)
Here, K represents the global conductivity matrix which is obtained from
the summation of the element conductivity matrices as in Equation (3.81).
Also, F represents the global load vector obtained from assembling the
element load vectors as in Equation (3.82).
The objective of a time integration scheme is to find the unknown values
Tn+! at time point tn+! from the known information. The values Tn are
known at time point tn and so is F in the small time interval f1t. The
same scheme is continued until the time of interest is reached, therefore
these schemes are referred to as recurrence relations. The time intervals
f1t may be considered as elements of time and appropriate shape functions
may be defined at the ends of the interval, i.e. tn+! and tn, to establish
the variation of the temperature field within the interval.
4.3
Recurrence Relations
The methods used for time discretisation of the heat equation may be
broadly classified as single step and multistep methods. Of these the single step methods are the most popular because of their simplicity and
flexibility. The main operational advantage of these methods is that the
52
timestep size may be varied during the analysis. We will present in the
following pages the details of a commonly used method for the equation
system (4.5), the Generalised mid-point or trapezoidalfa.mily of methods,
see references [3, Chapter 8] and [4, Chapter 2] for details.
4.3.1
C(Tn+l, tn+lyi'n+l
(4.6)
and
(4.7)
subscripts n represent the nth time step. If not indicated otherwise fl.t
will mean fl.t n. Substituting Equation (4.7) in Equation (4.6), we obtain,
2Cn
l ] (Tn+l)
[ L5.t
++
Kn+l
2 Tn + Tn
. ) + (Fn+!)
= [Cn+l] ( at
(4.8)
This method involves the calculation of the derivatives on the right hand
side. Here, C n +! etc. mean C (Tn +b tn+!).
The generalised mid-point family of methods [4, page 145] is written as,
= F(Tn+a, tn+a)
(4.9)
where,
Tn+a
Tn+a
tn+a
=
=
=
(1 - a)T n + aTn+!
Tn+! - Tn
at
tn + afl.t
(4.10)
[ C=
n+
a
Cn+a + aKn+a] (Tn+d
[ t1t
t1t
(4.11)
No calculation of derivatives is necessary for this method. By changing
the values of a from 0 to 1, different members of this family of methods
are identified, i.e.,
a =0
-Forward Difference or Forward Euler.
a=
-Midpoint rule or Crank Nicolson.
-Galerkin.
a =3
-Backward Difference or Backward Euler.
a =1
All, except the first (forward Euler), of the above schemes are implicit, i.e.,
they require matrix inversion for solution.
4.3.2
53
Convergence
CT+KT=O
(4.12)
which is then written in a SDOF (single degree of freedom) form. This can
be done by a modal decomposition procedure. We begin by substituting,
therefore
which leads to,
(4.13)
Equation (4.13) represents an eigenvalue problem with the associated properties, i.e.,
(4.14)
and
(4.15)
where, I is the identity matrix, A and ~ are the eigenvalues and the eigenvectors, so that (C and K being positive definite),
= ET;~;
;=1
(4.16)
and
;=1
(4.17)
(4.18)
54
substuting Equations (4.14) and (4.15) in Equation (4.18) gives us N decoupled SDOF equations of the form,
(4.19)
This is a first order ordinary differential equation which may be exactly
solved between the general interval tn and t n+1. This gives us the solution,
.Lrpn+l -_
.Ln
(4.20)
as (tn+l - tn) > 0 the above solution implies that ITn+11 < ITnl. If we use
the generalised midpoint rule to discretise Equation (4.19), we obtain,
(1 + o:~tA)Tn+1
or
T.
= (1 -
(1 -
o:)~tA)Tn
- (1 - (1 - o:)~tA)T. - AT.
(1 + o:~tA)
n n
n+1 -
(4.21)
(4.22)
(1 - (1 - o:)~tA) 1
(1 + o:~tA)
<
(4.23)
~t<
(1 - 20:)A
(4.24)
which implies conditional stability for these values of 0:, and unconditional
stability for all other values. Of the methods mentioned in the previous
section the Forward Euler method is the only one with conditional stability.
Another interesting aspect of this analysis is the oscillation limit at A = 0,
l.e.
1
(4.25)
~t = (1- O:)A
t.
55
A=~
2
(4.26)
h pc
D.t<~PCh2
= 0) gives,
(4.27)
3k
(4.28)
This result may be applied to general 2-D or 3-D problems if the minimum
element size (h min ) in the mesh is used which corresponds to the maximum
eigenvalue. It is seen from these results that the critical time step for
explicit schemes (at which instability impends) depends upon the square
of the element size. In practice, this limit can be prohibitively small,
especially when higher order elements are used (where h corresponds to
the distance between two nearest nodes). For this reason, implicit methods
are generally preferred for heat conduction problems.
Algorithms based on rational assumptions are consistent, where consistency is defined as follows. Consider Equation (4.22), which may be
written as under with a load term L n ,
(4.29)
replacing Tn and Tn+! above with corresponding exact values we have,
(4.30)
where r(t n ) is called the local truncation error. For consistency we must
have
for all t
(4.31)
where C is a constant and r > 0, r being the rate of convergence. The
generalised midpoint and trapezoidal families of methods are consistent
with r = 1 for all values of 0 except for 0 = for which r = 2. For the
proof of this the reader may refer to [3].
The above stability analysis may be extended to the trapezoidal rule as
well, using the general equivalence of the trapezoidal and the mid-point
family [6], as suggested by Hughes [4, page 150]. As far as accuracy is
concerned the mid-point rule is to be preferred [7]. Also, Cliffe [8] has
shown that the generalised mid-point rule conserves linear and quadratic
quantities, while the trapezoidal rule conserves only the linear ones.
t,
56
4.4
= Yn + 2l::..tn
[(2 + l::..t
l::..tn- )Yn
' - (l::..tn)
, ]
l::..t n- 1 Yn-l
n 1
(4.32)
(4.34)
Yn+!
Yn
+ 2l::..tn (In+! + In )
l::..tn ( ,
')
Yn + 2
Yn+! + Yn
(4.35)
(tn+! )
Yn+! -' Y
(4.36)
Subtracting Equation (4.34) from Equation (4.36) and eliminating the unknowns i.e., Y:' and y(tn+!), we obtain,
(4.37)
57
we now define,
Yn+1 - y(tn+d
= d(Yn+d
and substitute its value from Equation (4.36) in Equation (4.37), to obtain,
(4.38)
From Equation (4.36), we can write for times tn+1 and t n+2,
but,
III
Yn+1
At )
= Yn + O(Un
III
therefore,
d(Yn+2)
d(Yn+1)
= (.:ltn+1)3
.:ltn
(4.39)
.:ltn+1
= .:ltn
(I d(Y:+1) I)
(4.40)
Yn+l
Yn + .:ltn (fn+l)
Yn + .:ltn (Y~+l)
(4.42)
Bixler calculates the time truncation error for the midpoint rule by subtracting the Taylor series expansion from Equation (4.42), as,
(4.43)
58
In calcula.ting the time derivative Y' for use in the predictor, he sugg~sts
a formula based on the values of y at different time levels, to improve the
stability of the predictor, i.e.,
2 (Yn - Yn-l )
'
Yn, = --':--t
- Yn-l
U
(4.44)
n-l
where,
n-
= ~tn-l~tn-2
+ ~tn-2
(Yn - Yn-l)
~tn-l
~tn-l
+
.
~tn-l + ~tn-2
(Yn-l - Yn-2)
~tn-2
(4.45)
The formula for the succeeding time-step remains the same except, d(Yn+1)
is redefined for the new corrector, i.e.,
(4.46)
where, 0.25 ~ 'Y ~ 1.0. with 'Y = 1, the original formula is obtained. This
scheme helps to increase the time-step much more rapidly when steady
state impends.
For both the above time integration methods the AB formula is used
as predictor which requires the time derivative, r.t at the first step, which
can be obtained by solving Equation (4.5) as,
(4.47)
The same procedure may be used to obtain time-step selection for the
simpler first order methods. If the Forward Euler method is used as a
predictor and the Backward Euler as the corrector, the formula for the
succeeding time-step is written as,
d(Yn+d
= Yn+1 ;
Yn+1
+ O(~tn)3
(4.48)
(4.49)
4.5
Benchmark Example
59
x = O.Om
p
100sin:~oC
x = 0.08m x = O.lm
(Target point)
= 7200~
c = 440.5 K;'K
k = 35.0m~K
2 ~ nk'1r A
. n1rx(.
(
-ant))
T -_ LL...J L( 2
2) smT ansmwt - w coswt - e
n=l
for 0 < x
< L, L
+an
(4.50)
= Asinwt
at x
=0
and
at x = L
Also, values of an and k' are obtained from,
and
k'=
~
pc
Figure 4.2 shows the plot of the analytical solution for the chosen benchmark problem at x = 0.08m. The exponential term of Equation (4.50)
(shown by the dotted line in the Figure) corresponds to the transient component which decays to a negligible value for larger values of t and a steady
harmonic component remains. The finite element method using a uniform
mesh of 20 6-noded elements produces a result indistinguishable from the
analytical solution. The timestep size was 2secs with a = 0.5.
60
60
40
_\
~
6'
!!
20
AnaIyticeI Sol
Elq>. "'" 01 An. Sol.
FEMSoI.
(!
-20
-40
100
200
300
400
500
600
700
800
TIme (sees)
Figure 4.2: Analytical and FEM solution for the benchmark problem
61
References
[1] J.R. Yu and T .R.Hsu. Analysis of heat conduction in solid by spacetime finite element method. International Journal for Numerical
Methods in Engineering, 21:2001-2012, 1985.
[2] R.W.Lewis J.Y.Zhang and J.S.Peng. A semi-analytic approach to
general transient problems and its applications to heat transfer. Numerical Heat Transfer, 23:413-424, 1993.
[3] T.J.R.Hughes. The Finite Element Method - Linear Static and Dynamic Finite Element Analysis. Prentice-Hall International, Inc., Englewood Cliffs, New Jersey 07632, 1987.
[4] T.J.R.Hughes. Analysis of transient algorithms with particular reference to stability behaviour. In Computaional methods for transient
analysis. Elsevier Science Publishers, 1983.
[5J W.L.Wood and R.W.Lewis. A comparison of time marching schemes
for the transient heat conduction equation. International Journal for
Numerical Methods in Engineering, 9:679-689, 1975.
[6] G.Dahlquist and B.Lindberg. On some implicit one-step methods for
stiff differential equations. Technical Report TRITA-NA-7302, Department of Information Processing, The Royal Institute of Technology, Stockholm, 1973.
[7J N.E.Bixler. An improved time integrator for finite element analysis.
Commnunications in Applied Numerical Methods, 5:69-78, 1989.
[8J K.A.Cliffe. On conservative finite element formulations of the inviscid
boussinesq equations. International Journal for Numerical Methods
in Fluids, 1:117-127, 1981.
[9] P.M.Gresho, R.L.Lee, and R.L.Sani. On the time-dependent solution
of the incompressible Navier-Stokes equations in two and three dimensions. In Recent Advances in Numerical Methods in Fluids, volume l.
Pineridge Press Limited, Swansea, 1980.
[10J J.Barlow and G.A.O.Davies. Selected FE benchmarks in structural
and thermal analysis. Technical Report FEBSTA REV 1, NAFEMS,
1986.
[l1J H.S.Carslaw and J.C.Jaeger. Conduction of Heat in Solids. Clarendon
Press, Oxford, 1959.
Chapter 5
Phase Transformation
5.1
Introduction
64
65
Phase Transformation
a book by John Crank [4]. A good account of the early effort in the numerical modelling of phase change (primarily solidification) is given by
Samonds [5], who reports that the finite difference method was first used
by Sarjant and Slack [6] in 1954 in the study of ingot solidification. Many
other researchers continued to employ the finite difference methods to predict solidifcation behaviour using computers, such as Henzel and Kevarian
[7, 8, 9], Weatherwax and Riegger [10], Hansen [11] etc. The first use of
the finite element method was by Soliman and Fakhroo [12] in the analysis
of ingot casting, as reported in reference [5]. Morgan et. al. and Lewis et.
al. [13, 14] modelled the solidification of ingot castings and also analysed
the thermal stresses in the ingot. A useful review of the methods used in
a finite element context, can be found in a paper by Dalhuijsen and Segal
[15]. Salcudean and Abdullah [16] have listed several latent heat formulations and many references for general numerical modelling of phase change.
Recently Voller et al. [17] have disctissed the fixed grid methods with the
aim of providing a comprehensive review of the major formulations with
an emphasis on the numerical features.
5.2
(5.1)
aT
and
Pscs7ii = Vks VT
in
ns
(5.2)
where, the subscripts 1 and s denote liquid and solid respectively. The
complete description of the problem involves, in addition to the initial
conditions and the appropriate external boundary conditions, the interface
conditions on the phase change boundary r It/, which are,
Tr.,$ = Tf
k(aT)
ax _k(aT)
ox s
I
Lds
P dt
on
rltl
(5.3)
66
5.3
As mentioned earlier the front tracking methods attempt to solve the classical problem in its pure or strong form. This involves the use of moving
meshes or the transformation of coordinates [18, 19,20] to explicitly satisfy
the interface conditions. These methods can be used to solve isothermal
phase change problems with good accuracy but become too complicated,
even impossible, when faced with complex interface shapes which vary
nonmonotonically with time. Furthermore, front tracking methods cannot
be readily usedin the case of freezing over a range of temperatures. Due
to the limitations of the 2-domain methods the subsequent discussion will
be limited to the I-domain methods. The I-domain or fixed grid methods
offer a more general solution as they account for the phase change conditions impliCitly without attempting to a priori establish the position of
the front. These methods are based on a weak formulation of the classical
problem, which is commonly referred to as the enthalpyformulation. A
single, energy conservation equation is written for the whole domain as,
aH = V.kVT
at
in
(5.4)
where, H is the enthalpy function or the total heat content which is defined
in reference [15] for isothermal phase change as,
H(T)
(5.5)
H(T)
and for phase change over an interval of temperatures Ta to Ti, which are
the solidus and the liquidus respectively, we have,
ITTr pca(T)dT
H(T)
H(T)
H(T)
(T < Ta)
(Ta $ T $ Tl)
(T > TI)
(5.6)
where, Cj is the specific heat in the freezing interval, L is the latent heat and
Tr is a reference temperature lower than Ta. The mathematical validity
of this formulation is discussed in detail by Crank [4J, who has referred
to several original works, such as that of Rubinstein, Kamenomostskaja,
67
Phase Transformation
Oleinik, Niezgodka etc. to state the equivalence of the classical and weak
formulations and the existence and uniqueness of the solution for the weak
formulation.
The enthalpy formulation can be implemented in a finite element based
heat transfer code in a variety of ways. Some of the commonly used methods are discussed in the following text.
5.3.1
Among the fixed mesh methods, one of the earliest and the most commonly
used methods has been the effective heat capacity method. This method
was derived from writing Equation (5.4) as,
dHaT
dT at
= V.kVT
in
(5.7)
ceff
= dT
(5.8)
where, Ceff is the effective heat capacity, which can be evaluated directly
from Equations (5.6) as shown in reference [15],
Ceil
Ceil
Ceil
=
=
(T < Ta)
PCa
PCf
pc,
L
+ T,- Ts
(Ta
~ T ~ T,)
(T > T , )
(5.9)
Figure 5.1 shows the typical variation of the effective heat capacity and enthalpy with temperature. It can be seen from the figure that if this directly
evaluated effective specific heat is used, it will be necessary to maintain
an interval of temperatures for the evolution of latent heat, otherwise the
effective heat capacity will become infinite. This method therefore cannot
accurately model an iso-thermal change of phase due to the requirement
of a temperature range. In reality, the use of a directly evaluated heat capacity is of limited value in cases other than those where the phase change
occurs in a very wide range of temperatures. The main problem in the
numerical modelling context is that the latent heat information may be
contained in a narrow band of temperatures, and it may be missed if the
temperature change in one time step at a node or integration point straddles the phase change interval [5, 15,21]. This imposes severe restrictions
on the temporal and spatial step sizes in a numerical analysis. Due to the
step like behaviour of Cef f around the phase change interval, numerical
oscillations may occur, making the achievement of a convergent solution
68
H(T)
CeJi
Temperature
Figure 5.1: Typical variation of enthalpy and
CeJi
with temperature
difficult [15]. Lewis and Huang [22] have used an effective capacity type
method described by Samonds in [5] to analyse a fire resisting cabinet containing phase change material. As the amount of latent heat was large,
they had to use an adaptive meshing procedure, with an extremely fine
mesh in the region of the moving phase change front.
5.3.2
Enthalpy Method
In order to overcome the difficulties encountered in using a directly evaluated effective capacity, recourse is made to several averaging techniques.
These techniques are generally referred to as the enthalpy method. In this
context the enthalpy method enables the heat capacity to be defined as a
smooth function of temperature [21]. Some of the commonly used averaging techniques mentioned in the relevent references [15, 21, 23] are listed
below. The simplest approxirpation used (for 2-D) is,
(5.10)
Phase Transformation
69
This method has been reported to cause oscillations in certain circumstances [21]. A better method as reported by DelGuidice et al. [1] is,
(5.11)
Morgan et al. [21] and Lemmon [24] suggest another approximation which
is reported to work satisfactorily,
(5.12)
Morgan et al. [21] have also advocated the use of a simple backward
difference approximation,
(5.13)
where, n represents the timestep number. This scheme restricts the time
step severely according to reference [15] if a correct heat balance is to be
maintained. Lewis and Roberts [23] claim that the last scheme is computationally quicker than the abovementioned averaging techniques.
In using the above techniques in a finite element analysis it is common
practice to interpolate H from the nodal values using the same basis functions as for T thus obtaining a smoothing effect. The appearance of space
derivatives in the above equations ensures the inclusion of the phase change
effect. Dalhuijsen and Segal [15] have compared the performance of the
various approximation schemes mentioned above with respect to time integration procedures, and found that the method of DelGuidice et al. is
marginally more suitable for Euler backward time integration and Lemmon's method works slightly better for two-step time integration schemes,
but in general there is no significant effect on the relative accuracy. They
also advocate the use of lumped mass matrices for better accuracy and
reduction in the tendency for oscillation.
The enthalpy method, although reasonably accurate and very simple to
implement in any heat transfer code, suffers from a number of deficiencies
some of which have been discussed in [25, 26]. The main drawbacks in a
finite element context can be listed as follows,
Due to the necessity of a temperature range for the evolution of latent
heat, isothermal phase changes can not be modelled correctly.
Requires small spatial and temporal step sizes, otherwise convergence
becomes difficult. This does not allow for quick computer runs if a
rough preliminary analysis is required.
70
5.3.3
(5.14)
The implementation of this method in a finite element heat transfer program is not straightforward. Rolph and Bathe [27] have given considerable
detail for such an implementation. In the following lines a step by step
procedure of implementing source based phase change in a finite element
program is presented.
1. Calculate the global nodal latent heat vector QTOT L( i) for each
node i in the finite element mesh. This can be done by lumping
the masses of all elements at the nodes using standard lumping procedures [29] and assembling all nodal contributions in the vector
QTOT L( i) after multiplying them by the latent heat per unit volume. Also store the assembled nodal masses in QMASS(i).
71
Phase Transformation
2. Set up a vector QCU MU(i) for collecting the amount of latent heat
released or absorbed for each node i in the course of the analysis.
The value of QCUMU(i) is initialised to zero before the start of
the analysis. Another vector QLATH(i) is set up for use in the
global load vector as the fictitious heat-flow or the heat source vector.
The value of this vector is initialised to zero at the beginning of
each timestep. Lastly, a vector QINCR(i) is set up for storing the
increments in the latent heat in each iteration. The value of this
vector is initialised to zero at the beginning of each iteration in a
single time step.
3. At the ~tart of the analysis flag all nodes as solid or liquid using
ISOLID(i). In the program developed for this work the flag value
-1 indicates liquid, +1 indicates solid and 0 indicates a node in
the process of changing phase. Another flag LSOLID(i) is used
to indicate melting or solidification. A negative value of the flag
indicates solidification and a positive value indicates melting.
4. As the problem is nonlinear and the latent heat is released or ab-
(TP-l)
n
i < T8 < (TP).
n ,
(melting)
QINCR(i)
(for solidification)
or,
(for melting)
It may be noted that in the first case QINCR(i) will be positive while
in the second case it will be negative. If the node under consideration
is already undergoing phase change from the previous timestep n -1,
so that I SO LI D( i) = 0, then the latent heat is calculated for both
solidification and melting as,
QINCR(i)
= c((Tn-di -
(T~UQMASS(i)
72
5. The incremental latent heat is added to the heat source vector QLAT H(i)
for the time step n, which is then added to the force vector as in Equation (2.32) in chapter 2, after dividing by the timestep t:.tn as the
rate of latent heat release/absorption is required. It may be noted
that this technique allows for the use of variable timesteps. The
iterations are continued until convergence.
6. After each iteration, the temperature of each node undergoing phase
change is corrected (assuming a latent heat evolution linear with
temperature) to keep it consistent with the amount of latent heat
released or absorbed acCording to,
(for solidification)
or,
(for melting)
7. The incremental latent heat QINC R( i) is also added to the cumulative latent heat vector QCUMU(i) for each iteration of all time
steps until,
QCUMU(i) ~ QTOTL(i)
when the node i is flagged as solid or liquid as the case may be.
The technique described above is in terms of the more general case of
mushy phase change involving a solidus and a liquidus temperature (T"
and T/), the special case of isothermal phase change can be derived by
making T" = T/ in all the above equations. The c term used in the fourth
step above, is an effective specific heat [27]. The value of c is the same
as c" or c/ mentioned in Equation (5.5) for isothermal phase change. For
mushy phase change the value of c is calculated by considering the fact
that the heat lost/gained in one iteration is the sum of the latent heat and
the sensible heat and the enthalpy-temperature curve is linear between
liquidus and solidus. If we consider a drop in temperature of t:.T in one
iteration then the total heat loss is,
where, CI is the same as in Equation (5.6). This includes the heat loss
due to latent heat release and due to the corrected temperature drop 6T.
Assuming linear latent heat release we can write for the heat loss due to
latent heat,
(5.15)
73
Phase Transformation
If an effective specific heat (c) is defined so that it directly gives the heat
loss due to latent heat (the r.h.s of the above equation), then we can write,
cAT
solving for
'L
= (T/ _ TJ aT
(5.16)
CfAT
(Cf
+ TI~T.)
(5.17)
substituting Equation (5.17) into Equation (5.16) we obtain the final expression for c as,
= (Tl-T,
+ .1.)
L
CI
(5.18)
The same relation can be obtained if a temperature rise (melting) is considered instead of a temperature drop.
It can be noted from the above description that although this method
is more complicated to implement, it is more attractive in terms of engineering intuition, as the exact amount of latent heat can be explicitly released/absorbed at the appropriate temperature or range of temperatures.
Comparisons with other methods will be made by solving a benchmark
example in the succeeding section.
5.4
Benchmark Examples
A one dimensional benchmark example of solidification as shown in Figure 5.2 is solved by the methods discussed above and compared with the
analytical solution. The material properties, dimensions, boundary and
initial conditions are as shown in the same figure. To and Tf refer to the
initial and freezing temperatures respectively. No particular units are necessary. This example has been used for such comparisons in several papers
[21, 27, 28]. The temperature vs. time curve at a chosen point (x = 1.0
here) in the domain is used for the comparisons. This method is more
reliable according to [15], instead of the normally used interlace position
vs. time curves. The same example with reversed temperatures as shown
in Figure 5.3 will be used to solve a melting example.
The mesh with 20 9-noded elements used to solve the above examples is
as shown in Figure 5.4. This mesh is used for all cases except for one case
where the source method is demonstrated on a coarse mesh.
5.4.1
Analytical Solution
The general solution to Neumann's problem and many special cases appear in the textbook by Carslaw and Jaeger [30] and that by Crank [4].
74
= -45.0 ....
T..,o,_=_0_.0_____T_,_=_-_0._15--11
1 ___
=1.0
=4.0
= 70.26
pc = 1.0
=1.0
= 70.26
=45.0
=1.0
= 4.0
pc = 1.0
k
=1.0
(5.19)
= 2'\(k.t)~
The temperature in the solid zone (x :::; X or T:::; T,), is given by,
T,
erf,\
2(k.t)2
T= --erf
= Too -
111111111111
Too - T,
(5.20)
X or T
erfc--1
erfc,\(~)2
2(k/t)2
1
III I I I I I
(5.21)
Phase Transformation
75
erf>'-
()! Too k/
ks
Tj
Tj
e _>.2 !.a.
k,
>'L1r21
erfc>.(t)t = csTj
(5.22)
Here, erf is the error function and erfc(x) = 1- erf(x). The values of
the error function were approximated from the formula below [31]:
(5.23)
where,
b=_l_
1>+ px
= 0.3275911
at = 0.254829592
a2 = -0.284496736
p
a3
a4
as
= 1.421413741
= -1.453152027
= 1.061405429
f(X)
1.5 X 10- 7
(5.24)
The temperature in the liquid zone (x
X or T ~ T j
_ To-Tj f_x_
T -T
0
er
1
erf>.
2(k/t)2"
The temperature in the solid zone (x
T=
>.
is given by,
(5.25)
Tj
x
k 1 erfc
1
erfc>.(F,-) 2"
2(kst)2
),
(5.26)
76
10
1....
~SaI.
.. FEM Sol.
(EnIhq>y)
5
0
I!!
!.
E
~
-5
-10
-15
-20
-25
-30
0
Time
5.4.2
Numerical Solution
Phase Transformation
77
1-
.a.
AnoIyticolSoL
-5
-10
I!!
8-
-15
-20
-25
-30
0.0
0.5
1.0
1.5
2.0
2.5
3.0
3.5
4.0
Time
1-
.&
AnoIyticol Sol
FEU SoL (Soun:o- ..... ,-.,0)
-5
-10
I!!
8-
-15
-20
-25
-30
Time
Figure 5.7: Source method vs the analytical solution using small timesteps.
78
IIII I I
Figure 5.8: Coarse finite element mesh used with the heat source method
1-
o-+----....~
AnIIyI'" Sol.
FEMSoI. (Saurao will ..........,
-5
-10
1-"
{!
-20
-25
-~~----r---~----,-----r----r----~---,----~
0.0
0.5
1.0
1.5
2.0
2.5
3.0
3.5
4.0
TIme
Figure 5.9: Source method vs the a.t;lalytical solution using a coarse mesh.
as shown in Figure 5.9, which is reasonable, considering the coarseness of
the mesh.
From these results it can be seen that a tradeoff between accuracy and
cost is possible with the source method. The ease with which the solutions
are obtained (without any convergence problems) promotes confidence for
using this method in solving general phase change problems including difficult problems, such as those with large latent heats. Figure 5.10 shows a
melting example solved by the heat source method, similar results are obtained. Finally, an example of phase change over a range is solved using all
the three methods mentioned in the beginning of this section. There is no
analytical solution for this problem. The problem description is as shown
in Figure 5.11. The results from all the three methods are shown in Figure
5.12. The effective capacity method of [5] (which completelely failed to
solve the previous problems with a 10 phase change interval) overestimates
79
Phase Transformation
30
1...
Ano/yIGoI Sol
FEMScL
25
20
.a
! 15
{!!.
10
Time
Figure 5.10: Source method vs the analytical solution for melting example.
= 70.26
pc = 1.0
k = 1.0
L
= -45.0
51
1r-=_0_.0__
Ts_=_-_1_0._15_Tl_l_=_-_0_.1-j
T......,o
L . 1_ _ _
= 1.0
= 4.0
5.5
Conclusion
80
.-
-5
-10
-15
AA
A
-20
AA
AA
AA
AA
AAA
-25
AAA
"AA""
-30
0
Time
= 10.0).
timesteps. This is due to the localised nature of the latent heat evolution,
because of lumping all the latent heat at the nodes. This unsmoothness
is relatively less noticable for problems with phase change over a range of
temperature due to a more gradual latent heat release/absorption. The
smoothness of the temperature profiles from the enthalpy method is due to
the 'smearing' effect obtained by integrating the enthalpy over the whole
element. The effective heat capacity method is only suitable for phase
change over a very wide range of temperature.
Phase Transformation
81
References
[1] S.DeIGuidice, G.Comini, and R.W.Lewis. Finite element simulation
of freezing processes in soils. International Journal of Numerical and
Analytical Methods in Geomechanics, 2:223-235, 1978.
[2] P.E.Frivik, E.Thorbergsen, S.DeIGuidice, and G.Comini. Thermal
design of pavement structures in seasonal frost areas. Journal of Heat
Transfer, 99:533-540, 1977.
[3] H.C.Huang and R.W.Lewis. Adaptive analysis for heat How problems
using error estimation techniques. In Sixth International Conference
for Numerical Methods in Thetmal Problems, Swansea, U.K., July
1989. Pineridge Press, Swansea.
[4] J.Crank. Free and Moving Boundary Problems. Clarendon Press,
Oxford, 1984.
[5] M.T.Samonds. Finite Element Simulation of Solidification in Sand
Mould and Gravity Die Castings - Ph.D. Thesis. University of Wales,
Swansea, 1985.
[6] R.J .Sarj ant and M.R.Slack. Internal temperature distribution in the
cooling and reheating of steel ingots. Journal of Iron and Steel Institute, 177:428-444, 1954.
[7] J.G.Henzel and J.Keverian. Predicting casting solidification patterns
with a computer. Foundry, pages 50-53, 1964.
[8] J.G.Henzel and J.Keverian. Predicting casting solidification patterns
in a steel valve casting by means of a digital computer. Metals Eng.
Quarterly, pages 39-44, 1965.
[9] J.G.Henzel and J.Keverian. Comparison of calculated and measured
solidification patterns in a variety of steel castings. AFS Cast Metals
Research Journal, pages 19-36, 1965.
[10] R.Weatherwax and O.K.Riegger. Computer-aided solidification study
of a die cast aluminium piston. 'AFS Transactions, 85:317-322, 1977.
[11] P.N.Hansen. Numerical simulation of the solidification process. In
Solidification and Casting of Metals, Sheffield, U.K., 1979. The Metals
Society. Proceedings of the Conferenc.
[12] J.I.Soliman and E.A.Fakhroo. Finite element solution of heat transmission in steel ingots. Journal of Mechanical Eng. Science, 14:]9--24,
1972.
82
Phase Transformation
83
[27] W.D.Rolph and K.J.Bathe. An efficient algorithm for analysis of nonlinear heat transfer with phase changes. International Journal for
Numerical Methods in Engineering, 18:119-134, 1982.
[28] J.Roose and O.Storrer. Modelization of phase changes by fictitious
heat flow. International Journal for Numerical Methods in Engineering, 20:217-225; 1984.
[29] O.C.Zienkiewicz. The Finite Element Method. McGraw-Hill Book
Company (UK) Limited, London, 1977.
[30] H.S.Carslaw and J.C.Jaeger. Conduction of Heat in Solids. Clarendon
Press, Oxford, 1959.
[31] Jr. C.Hastings. Approximations for Digital Computers. Princeton
University Press, Princeton,N.J., 1955.
Chapter 6
Adaptive Heat Transfer
Analysis
6.1
Introduction
Techniques for error estimation have recently been developed for stress
analysis problems. These methods may be considered as optimizing the
finite element analysis according to the intrinsic behaviour of the given
problem. This type of error estimation is now applied to heat flow analyses.
The technique will first be demonstrated for steady state thermal problems
and then extended to transient problems.
As mentioned in the previous chapters, to solve the heat transfer problems by the finite element method the domain of interest is first subdivided
into a number of discrete sub domains or elements. Variational, Galerkin
or other techniques can be used to dbtain an integral formulation, which
is usually referred to as the 'weak' form. After evaluation of the integrals
a set of algebraic equations, in matrix form, is obtained for each element.
Once such equations are formulated for all the elements, the global matrices are then assembled and the final solution is obtained.
The size and placement of these elements largely determines the accuracy with which the problem can be solved. Reducing the element size
and thereby increasing the number of nodal points usually yields a more
accurate solution but at the cost of an increased CPU time and memory
requirement. The key to the efficient and economic solution of problems
is not merely the number of nodal points and elements but also their
placement. Regions with large gradients (e.g. a singularity, stress concentration or region of high heat flux) will need a high mesh density, with
quiescent regions requiring a comparatively coarser mesh. In many real
engineering situations, it is desirable either to obtain the most accurate
solution possible within an upper problem size limit, or to try to capture a numerically awkward feature without using an excessive number of
elements.
86
The premise of adaptive procedures is that, by making use of the mathematics of error analysis, a finite element program can determine which
region needs refining and automatically adapt the mesh to suit the problem. The error is calculated in each element and is compared with a
predefined limit. It is expected that for a given accuracy of the solution
each element has approximately the same level of error. Therefore, any
element with an error above, and in some cases below, must be adjusted
to match this error level. The process is repeated, if necessary, with the
ultimate aim that every element contains the same predefined, allowable
error, thus yielding an optimal mesh.
There are two distinct phases of the adaptive solution process: error
analysis and mesh refinement. Error analysis allows us to calculate for each
element, in the case of error estimation, an absolute value for the error, and
in the case of error indication, an element value relative to other elements
in the mesh. Much of the early mathematical work in error analysis was
due to Babuska and Rheinboldt [1,2], but was drawn together, in the form
of an error estimate, in a notable paper by Kelly et al. [3]. A companion
paper by Gago et al. [4] was later published which offered several strategies
for using an error estimator to refine a mesh.
Once an estimate of the ed'or in each element has been obtained, there
are several ways of going about the next phase of the adaptive process, i.e.
improving the mesh. The two basic approaches are p - refinement and
h - refinement. p-refinement involves increasing the order of the polynomial approximation within an element while h-refinement simply means
reducing the subdivision size. p-refinement, especially when combined
with a hierarchical formulation, has several advantages-it is more efficient,
converges faster and appeals to the purist by virtue of its mathematical
elegance. However, incorporating p-refinement generally means restructuring, if not rewriting, an existing finite element code. h-refinement is
more universally accepted [5, 6] and has been employed in the content of
this chapter.
Having decided. on adopting the h-refinement method there is another
choice to be made, element subdivision or mesh regeneration. With the
element subdivision approach, every element that exceeds the allowable
error threshold is subdivided into smaller elements. This is most effective
when using four-node elements as it is otherwise very difficult to achieve
the desired density distribution. However, constrained nodes are introduced which must be dealt with, and the method allows only one level of
subdivision at a time.
The remeshing approach involves completely regenerating the mesh, either in regions of high error only, or over the entire domain. The advantage
of regenerating the entire mesh is that areas can be coarsened if the calculated error is below the allowable error. It is this that allows the generation of a truly optimal mesh in which every element has approximately the
87
same, predefined, level of error, and it was this fact that led the authors
to use the mesh regeneration approach in this work. One of the disadvantages of mesh regeneration is that a high degree of spatial flexibility
is required if use is to be made of the abundant information provided by
an error estimation procedure. For planar problems we can automatically
generate both triangles and quadrilaterals in regions of arbitrary geometry
using a mesh generator based on the Delaunay triangulation procedure.
The details of adaptive heat transfer analysis is presented as follows.
6.2
(6.1)
with the boundary conditions of
T=To
and
aT
an
- k - = ij
on
(6.2)
fT
on
(6.3)
fq
or
with
eT=T-t
(6.4)
e q = q-q
(6.5)
aT
qx = -kx ax
(6.6)
aT
qy = ...:..ky ay
(6.7)
where T and q are actual temperature and heat flux, while t and q are
the solution obtained from the finite element analysis.
However, it is more reasonable to use a scalar or a norm to express these
errors. The error norm in the heat flow problem can be defined as follows
lIell = [ f
A ] 1/2
(6.8)
88
or in the vector form as
Ilell
fA
A] 1/2
VTfk(VT - VT)dO
= [}o(VT -
where
k
= [kx
0
ky
(6.9)
(6.10)
(6.11)
Thus, we have
if we define
IIqll2 =
IIql12
10 (VTfkVTdO
= 1o(VTfkVTdO
(6.13)
lIell
(6.15)
." = IIqllx100%
The significance of the term Ilell/llqll, can be realized from the following
analysis. We consider a special boundary condition where T = 0 and
~~ = 0 on the domain boundary f. Using Green's lemma [8] we can write
IIql12
= 1o(VTfkVTdO = - 10 TV(kVT)dO
(6.16)
IIql12
= - 10 (T -
T)V(kVT)dO
(6.17)
(6.18)
89
(6.19)
where (T - T) * and T* are temperatures at appropriate points. Since, a
uniform distribution of errors is expected, therefore 1]2 can be thought of
as representing an average error for the temperature field. It is evident
that the temperature errors will be much lower than those of the gradient.
For instance, an error of 20 per cent in the gradient values should roughly
correspond to an error of 4 per cent in the temperature.
6.3
Before the implementation of the adaptive procedure is discussed the problem of calculating the error norm Ilell must be addressed as it contains socalled 'exact' values of the temperature gradients, which are obviously not
available. It is suggested by Zienkiewicz and Zhu that a globally smoothed
value may be taken as an approximation of higher order to that given by
the finite element solution [9]. In this smoothing process, it is assumed that
the approximation quantities are interpolated by the same basis functions
as the variable T and that they fit the original ones in a least square sense.
This process is known as recovery. In this study the smoothed continuous
values of temperature gradients are represented in the following manner as
given by Hinton and Campell [10]. However, basis functions of the same
order have been used here for smoothing as for the main variable T, unlike
lower order basis function used in [10]. The smoothing procedure involves
representing the smoothed gradients G in the element in terms of their
unknown nodal values ai, i.e.
n
G= ENiai
(6.20)
i=1
where n is the number of nodes per element and Ni are smoothing shape
functions which are usually defined on the original mesh of elements. H
G represents the non-smoothed values obtained from the original finite
element analysis, then the problem becomes one of finding the nodal values
ai which minimize the functional
(6.21)
Hence for I to be a minimum
(6.22)
90
It may be re-written as
EMijOi = J;
(6.24)
Mij =
and the 'smoothing forces'
Ii
It =
/1 /1 NiNjdetJd~d"l
-1
-1
(6.25)
/ 1/1
-1
-1
NiGdetJd~d"l
A
(6.26)
6.4
91
(6.29)
where m is the total number of elements. Now, the maximum permissible
error for each element can be calculated by distributing I/q112 equally over
all the elements, i.e.
(6.30)
where r; is some specified maximum value. The approximate error in each
element after the first analysis can be calculated according to Equation
(6.8) using, of course, the smoothed values of temperature gradients instead
of the exact values. This can be written for a two-dimensional element e
as
(6.31)
where ~~, ~; are the smoothed values of temperature gradients and ~~, ~;
are the finite element solutions.
Now this error is compared for all elements to the maximum permissible
error in an element as calculated above and used to modify the mesh for
a second analysis. If we define a variable
where
ee,
(6.32)
ee
If > 1, the size of element e must be reduced and the mesh will require
refinement, otherwise, the size of the element must be increased and the
mesh will be coarsened. Thus the predicted size of the new element can
be calculated from the current element size as follows
(6.33)
where he is the predicted element size, he is current element size and P is
the order of the shape functions.
6.5
In the numerical example given, both linear and quadratic triangular elements are employed for the adaptive remeshing technique [8, 14].
The first example to test the adaptive procedure, as outlined above, was
obtained from a list of selected benchmarks published by NAFEMS [15].
A rectangular plate shown in Figure 6.1 is subjected to three different
92
LOrn
. . .___. . \;2mj
0.6rn
.1 B
= 2hT
E[(a~ +
AB n=l
(6.34)
where
a
k
h
TAB
=
=
=
=
=
=
0.6m
LOrn
h/k
and an are the roots of "a tan aa = h" which may be solved using the
iterative method as follows.
1
an = -[tan-1 (h/an ) + (n - 1)71"]
a
93
= b"
where n = 1 ---t 00. The first ten roots are listed in the Table 6.1.
This analytical solution is shown for the whole domain in Figure 6.2,
from which it is clearly seen that the steep temperature gradient between
points B and E requires the use of a relatively fine mesh in this area. In
many practical problems it is not immediately obvious as to where a fine
mesh may be required and this is where the advantage of the adaptive
finite element method lies.
When a uniform mesh of thirty triangular elements is used, which was
recommended in reference [15], a temperature error of -24.6% was obtained for the three noded elements, whereas an error of -1.6% was obtained for six noded elements at the point E.
Now, the adaptive error estimation technique is applied to this same
problem. For both linear and quadratic triangular elements a uniform
mesh, similar to that used in reference [15], is adopted as the initial mesh
(Figure 6.3). A target error of 10% is prescribed for the linear element.
The mesh shown in Figure 6.4a was automatically generated according to
the estimated errors and indicates a norm error of 14.3%, which implies
an average temperature error of 2.0%. However, the error at the point
E compared to the analytical solution was less than 0.6%. After further
remeshing (Figure 6.4b), a norm error of 9.8% was indicated. The mesh
can be seen to be finer in the area of points B and E, as expected, and
much coarser elsewhere.
When six noded triangular elements are employed with a target error
of 5% a much better result was obtiined. The two subsequent meshes in
Figure 6.5a-b were generated according to the adaptive procedure which
leads to a norm error of 2.8%. This corresponds to a temperature error of
approximately 0.08%. The solution obtained from this mesh is virtually
indistinguishable from the analytical solution.
94
(a)
95
(b)
Figure 6.4: Set of refined meshes (3 node) based on the smoothed solution
(a)
(b)
Figure 6.5: Set of refined meshes (6 node) based on the smoothed solution
96
(a)
(b)
Figure 6.6: Set of refined meshes (4 node) based on the smoothed solution
Four noded quadrilateral elements are used to solve the same problem.
A target error of 10% was prescribed in this case. An initial mesh with 8
linear quadrilateral elements (Figure 6.3) produced a norm error of 21.6%
in the results, therefore further refinement was required. The two subsequent meshes in Figure 6.6a-b were generated according to the adaptive
procedure which leads to a norm error of 16.0% and 10.0% respectively.
Since there is an analytical solution available, the exact temperature gradient could be calculated and used to evaluate the error norm in expression
(6.8). The meshes in Figure 6.7a-b for 3-node elements, Figure 6.8a-b for
6-node elements and Figure 6.9a-b for 4-node elements were generated using the 'exact' error norm. It is noted that a similar pattern of meshes as
in Figure 6.4, 6.5 and 6.6 were obtained. The details of such comparisons
are given in Table 6.2 and 6.3 where NP is the number of nodes and NE
is the number of elements.
6.6
Transient Analysis
(a)
97
(b)
Figure 6.7: Set of refined meshes (3 node) based on the exact solution
(a)
(b)
Figure 6.8: Set of refined meshes (6 node) based on the exact solution
98
(a)
(b)
Figure 6.9: Set of refined meshes (4 node) based on the exact solution
Table 62 : 3-node t
nanguI ar e ement s WIth a t ar
1[
initial
mesh
1st refinement
ax;
NP 1 NE 7]% NP 1 NE 7]%
smoothed 19 I 25 30.8 77 L 116 .14.3
Fig. 6.3
Fig. 6Aa
exact
19 1 25 42.0 83 1119 14.8
Fig. 6.3
Fig. 6.7a
et error 0 f 10 O~0
2nd refinement
NP 1 NE 7]%
132 J 214 9.8
Fig. 6Ab
155 1256 9.6
Fig. 6.Th
99
T a blIe 64
. : 4-00 de quad rI1 atera1 eIemeots with a target error of 10.0%
!#.
initial mesh
1st refinement
2nd refinement
8%,
NP I NE 1]% NP I NE 1]% NP I NE 1]%
smoothed 15 I 8 21.6 45 I 35 16.0 93 I 77 10.0
Fig. 6.3
Fig. 6.6a
Fig. 6.6b
exact
15 I 8 27.9 37 I 27 16.3 105 I 89 10.2
Fig. 6.3
Fig. 6.9a
Fig. 6.9b
100
work involved here is the need to interpolate the nodal information from
the previous mesh to the new mesh in order to continue the time integration
process. The interpolation for linear triangular elements may be conducted
as follows
(6.35)
where Lt,L2 ,L3 are area coordinates at (x,y) and Tt,T2 ,T3 are temperatures at the element nodes. Such linear interpolation is not satisfactory
for most problems. An interpolation suggested by Sampaio et. al. [17]
uses the smoothed gradients available from the error estimation process.
A higher order interpolation, for linear triangular elements may be written
as,
3
T(x, y)
(6.36)
i=1
where Ni are the same as Li for the linear triangular element, and R; which
include the temperature gradients (~~) and (~;) are given by,
(6.37)
This interpolation is equivalent to the the one given in reference [17], however it is cheaper to calculate as it does not contain second order terms.
The globally smoothed temperature gradients available from the error estimation procedure could be used in the above formula, however, we have
found that these produce spatial oscillations in the interpolated solution if
the gradients are too steep (such as in the transient casting problem here).
Using a lumped version of the global smoothing matrix of Equation (6.24)
alleviates the problem of spatial oscillations. For the program HADAPT
of Appendix B, we have employed the equivalent procedure of averaging
the constant gradients (from a linear triangle) at the nodes, to obtain the
smooth gradients for Equation (6.37). For the purpose of interpolation we
convert other elements to the linear triangle in HADAPT.
Later works of Zienkiewicz and Zhu, such as [18], have used local (superconvergent patch) recovery procedures which converge faster towards
the target errors. The locally smoothed gradients available from this recovery process would be well suited for use in Equation (6.37). Tessler
et. al. [19] have presented a recovery procedure based on minimisation
of a discrete least-squares/penalty constraint functional which produces
a smoothed field approaching C 1 continuity for large penalty numbers.
This method appears to be better than the superconvergent patch recovery method [18] for linear and cubic elements, however, it requires the
solution of a large system of equations as it a global recovery procedure
similar to the one described in this chapter.
101
Figure 6.12: Mesh obtained after two adaptive passes on the initial
conditions
Returning to the transient casting problem of Figure 6.10, the initial
unstructured finite element mesh of linear quadilateral elements is shown
in Figure 6.11. Note that the fin area has been refined to ensure the
presence of node points in the interior of the fin. The initial conditions
were imposed on this mesh and two passes of the error estimator were used
on the initial temperature field (without advancing in time) to obtain the
mesh shown in Figure 6.12. This procedure ensured that minimal errors
were introduced in the problem at the start. The temperature at the mould
boundaries was fixed at 20C and the casting boundaries were assumed to
be insulated. The adaptive meshes and the results at three different times
are shown in Figure 6.13. These results were based on a target error of
25.0 %. The mesh refinement can be seen to be concentrated in the areas
of high temperature gradient located at the metal-mould interface. Agood
temperature resolution was achieved at the fin (which is only 1mm wide) as
due care was taken to ensure a fine mesh in that region at the beginning.
The mesh can be seen to be evolving with the shifting gradients. The
solidification range was from 615C to 550C. In Figure 6.13(b) almost all
of the casting has begun solidifying (below 615C). In Figure 6.13( c) most
of the casting has solidified (below 550C) .
Finally, it is important to understand that the errors calculated by the
error estimation procedure are obtained from a smoothed solution on the
same mesh. Therefore, one may discover lower errors for the same problem
for a coarse mesh than for a better fine mesh. In the above problem the
errors were higher than 25.0 % for all of the results shown as the size of
the elements is restricted to a specified minimum in program HADAPT.
However, we still obtain a very good quality solution without having to
refine the whole mesh indiscriminately.
102
103
References
[1] I. Babuska and W.C. Rheinboldt. Adaptive approaches and reliability
estimates in finite element analysis. Computer Methods in Applied
Mechanics and Engineering, 17/18:519-514, 1979.
[2] I. Babuska and W.C. Rheinboldt. Error estimates for adaptive finite element computations. SIAM Journal of Numerical Analysis, 15,
1978.
[3] D.W. Kelly, J.P. De S.R. Gago, O.C. Zienkienwicz, and I. Babuska. A
posteriori error analysis and adaptive processes in the finite element
method: part 1 - error analysis. International Journal for Numerical
Methods in Engineering, 19:1596-1619, 1983.
[4] J.P. De S.R. Gago, D.W. Kelly, O.C. Zienkienwicz, and I. Babuska. A
posteriori error analysis and adaptive processes in the finite element
method: part 2 - adaptive mesh refinement. International Journal
for Numerical Methods in Engineering, 19:1621-1656, 1983.
[5] J. Peraire, M. Vahdati, K. Morgan, and O.C. Zienkiewicz. Adaptive
remeshing for compressible flow computations. Journal of Computational Physics, 72:449-466, 1987.
[6] J. Peraire, K. Morgan, and J. Piero. Unstructured finite element
mesh generation and adaptive procedures for CFD. In AGARD FDP:
Specialists meeting, Loen, Norway, May 1989.
[7] O.C.Zienkiewicz, Y.C.Liu, and G.C.Huang. Error estimates and convergence rates for various incompressible elements. International
Journal for Numerical Methods in Engineering, 28:2191-2202, 1989.
[8] H.C.Huang and R.W.Lewis. Adaptive analysis for heat flow problems
using error estimation techniques. In Sixth International Conference
for Numerical Methods in Thermal Problems, Swansea, U.K., July
1989. Pineridge Press, Swansea.
[9] O.C. Zienkiewicz and J.Z. Zhu. A simple error estimator and adaptive
procedure for practical engineering analysis. International Journal for
Numerical Methods in Engineering, 24:337-357, 1987.
[10] E.Hinton and J.S.Campbell. Local and global smoothing of discontinuous finite element functions using a least squares method. International Journal for Numerical Methods in Engineering, 8:461-480,
1974.
104
[11] T.J.R.Hughes. The Finite Element Method - Linear Static and Dynamic Finite Element Analysis. Prentice-Ha.ll International, Inc., Englewood Cliffs, New Jersey 07632, 1987.
[12] M. Zlamal. Superconvergence and reduced integration in the finite
element method. Mathematics of Computation, 32:663-685, 1978.
[13] O.C.Zienkiewicz and J.Z.Zhu. Adaptivity and mesh generation. International Journal for Numerical Methods in Engineering, 32:783-810,
1991.
[14] R.W.Lewis, H.C.Huang, A.S.Usmani, and J.T.Cross. Finite element
analysis of heat transfer .and flow problems using adaptive remeshing
including application to solidification. International Journal for Numerical Methods in Engineering, 1991. To be published in a special
issue on adaptivity and meshing.
[15] J.Barlow and G.A.O.Davies. Selected FE benchmarks in structural
and thermal analysis. Technical Report FEBSTA REV 1, NAFEMS,
1986.
[16] H.S.Carslaw and J.C.Jaeger. Conduction of Heat in Solids. Clarendon
Press, Oxford, 1959.
[17] P.A.B.de Sampaio, P.R.M.Lyra, K.Morgan, and N.P.Weatherill.
Petrov-galerkin solutions of the incompressible Navier-Stokes equations in primitive variables with adaptive remeshing. Technical Report CRj701/92, Department of Civil Engineering, University College
of Swansea, 1992.
[18] O.C.Zienkiewicz and J.Z.Zhu. The superconvergent patch recovery
and a posteriori error estimates. Part 1: The recovery technique, Part
2: Error estimates and adaptivity. International Journal for Numerical Methods in Engineering, 33:1331-1382, 1992.
[19] A.Tessler, H.R.Riggs, and S.C.Macy. A variational method for finite
element stress recovery and error estimation. Computer Methods in
Applied Mechanics and Engineering, 111:369-382, 1994.
Chapter 7
Effects of Convection in Heat
Transfer
7.1
Introduction
When there is a velocity field present in the problem domain, heat is transported by the medium of convection as well as diffusion. The differential
equation governing convective-diffusive heat transfer is reproduced here
from Chapter 2.
DT
pcDt
= VkVT + Q
(7.1)
where
DT
aT
aT
aT
aT
-=-+u-+v-+wDt
at
ax
ay
az
As mentioned in Chapter 2, we assume a given velocity field in this text.
For the derivations in this chapter we assume a velocity field which is constant with time. This however does limit the applicability of the derivations
to a constant velocity field. For fully coupled heat transfer and flow problems, such as natural convection, the'Navier-Stokes equations must also be
solved to obtain the variable velocity field. For more information on this
the reader may refer to the following references [1, 2, 3,4] and texts such
as [5,6].
The finite element discretisation of the Equation 7.1 via the conventional Galerkin weighted residual method yields a spatially discretised set
of equations as for the pure conduction energy equation, with only one
additional convective component in the general stiffness matrix for an element e. The conductivity matrix for an element e, Kij is given in Chapter
3 as,
-1
K e""l)
Oe
[ONtkaNJ
ON,e d
k aNJ
---+
- ] dxy
ax ax
ay ay
(7.2)
106
(7.3)
where, u and v are the Cartesian components of the velocity vector. When
numerical integration is used to calculate Aii , u and v may be calculated
at the integration points as L NkUk and L NkVk, where k is the summation index over the number of nodes in each element. All other terms of
the spatially discretised convection-diffusion equation remain the same as
derived earlier for the pure conduction case.
The relative amounts of heat transported by the two mechanisms (convection and diffusion), is normally expressed by means of a dimensionless
parameter known as the Peclet number (Pe). This is defined as,
Pe
= pc I v I L
k
(7.4)
where L is a characteristic length and I v I is the magnitude of velocity. For low values of Pe, the Galerkin finite element discretization of the
convection-diffusion equation behaves reasonably well and acceptable solutions are achieved. However, when the convective effect starts to dominate
for a given problem i.e., the local values of Pe increase beyond a certain
point, spurious oscillations are generated which may completely mask the
true solution. Galerkin discretization is therefore no longer sufficient to
give reliable or indeed, meaningful results. This is a very active area of
research for people involved in computational methods for heat transfer
problems or for that matter, the transport of other quantities such as,
mass, momentum and pollutants etc. In these problems the term 'convection' which refers to heat transfer is replaced by the more general term
'advection' .
Because of the central difference nature of GFEM approximations, oscillations result in the solution when the finite element mesh is of insufficient
refinement to model the variations of the field variable, such as one linear element spanning a region where the field variable varies quadratically.
In most cases such spurious oscillations may be eliminated by a judicious
mesh refinement in the zones where regions of high gradient are expected.
Gresho et . al. [7] have shown that in fact GFEM continues to give reliable
solutions for Peclet numbers much larger than one (the theoretical limit ).
They have further shown that the actual limit at which the wiggles appear
is related to the product of the solution gradient and the local or mesh
Peclet number. The mesh Peclet number is obtained for any element by
replacing the characteristic length (L) in Equation (7.4) with the element
size (h). Therefore meaningful solutions using GFEM are still obtainable
for Pe > > 1 if the mesh is sufficiently refined in the regions of high gradient. This is obviously due to the reduction in the local Pe due to reduced
107
7.2
The basic reason for the failure of GFEM in advection dominated situations
is that GFEM is optimal for self-adjoint problems, such as heat conduction
which give rise to symmetric stiffness matrices. Advection-diffusion problems are not self-adjoint and produce non-symmetric stiffness matrices.
Therefore many methods that have been developed for modelling advection diffusion start by attempting to regain the self adjoint property in the
discretized equations. The problem of oscillations in advection dominated
flow has been one of the most active areas of research in the numerical
modelling of transport phenomena. The period of this research goes back
several decades in the case of finite difference modelling and about fifteen years in finite elements. The most conspicuous of all the different
techniques proposed to deal with this problem has been the method of
upstream differencing, or as more widely referred to, 'upwind methods'.
In finite element circles this method was first used by Christie et. al. [8]
who used modified weighting functions to achieve the upwind effect compared to the conventional Galerkin technique of using the trial functions
as the weighting functions. Heinrich et. al. [9] generalised the method to
two dimensions ufring a consistent Petrov-Galerkin formulation in which
the modified weighting functions were applied to all the terms rather than
to the advection term only. The method was further improved by the
introduction of 'streamline upwinding' by Brooks and Hughes [10], who
removed the problem of excessive diffusion in the crosswind or transverse
direction to the flow, by replacing the scalar artificial diffusivity with a
diffusivity tensor with non-zero values only in the flow direction. Kelly et.
al. [11] developed a similar procedure and termed it 'anisotropic balancing
dissipation'. There was much criticism of the upwinding methods [7, 12]
108
initially, due to the fact that the effect of upwinding is equivalent to adding
artificial diffusion to the standard Galerkin formulation. This, in the early
upwind methods manifested itself as excessive crosswind diffusion, when
these methods were applied to multi-dimensional problems and problems
with transient and source terms. However, in the present stage of development the upwind technique, identified by Hughes [13] by the acronym
SUPG (streamline upwind Petrov-Galerkin), has effectively answered most
of the criticisms levelled at the early upwind methods. Furthermore, it
has proven its effectiveness in providing oscillation free solutions to many
advection dominated problems and a sound mathematical basis for this
method has also been developed [13]. We describe the implementation of
the SUPG method in the following lines.
7.2.1
10 w [pcv . VT -
V . k VT + Q] dO
=0
(7.5)
The same is done to the boundary conditions, where the boundary conditions are the same as described in Chapter 2. As in Chapter 3 we require
the weighting functions to be zero on the boundary rT where the Dirichlet
or fixed boundary condition exists. On the boundary rq we write,
(7.6)
As before the boundaries satisfy,
=-N
on
109
r q is,
"L
e=l
o.
p [ V . k Vf')
dOe
(7.8)
where, M is the number of elements. Examining the third term involving the perturbation weighting function p we find that it is applied to the
diffusion term of the ,advection-diffusion differential equation, containing
second derivatives. However, as this weighting applies only on an element
by element basis, we can make certain simplifications according to Hughes
and Brooks [10]. Let us assume the thermal conductivity k to be a constant (as has been done so far in this derivation). If simplex elements are
used (linear triangles or linear tetrahedra), then we see that the second
derivatives will be zero and therefore this term would vanish. The same
is true for bilinear isoparametric elements of rectangular shape and corresponding 3-D elements. For general isoparametric elements with linear
interpolation this term may be neglected if the element shapes are not too
distorted. Brooks and Hughes [10] report that in higher order elements the
contribution of this term may be significant for diffusion dominated cases
but for advection dominated cases there is justification for neglecting it.
Having completed a consistent weighted residual formulation using a
Petrov-Galerkin type weighting function, we now turn to establishing the
nature of the perturbation function p. This function is defined as,
(7.9)
where k is a scalar controlling the amount of diffusion to be a.dded and IIvll
is the euclidean norm or the average velocity over the element. This form
of the perturbation function has evolved from the early days of upwinding
when only a scalar diffusion (k) was added to the physical diffusion. In
the present form, the function p ensures that k is applied only in the flow
or streamline direction to eliminate 'crosswind diffusion'. This form of
p results in k being applied as part of a diffusivity (or conductivity, as
derived here) tensor. Expanding Equation (7.8) after removing the third
term, we have
In
+
In
In VNkVf'dO=
qNijdO- InNQdO-
Vf') dO
1n(1I:lI v . VN )QdO
(7.10)
110
The second term on the LHS and the last term on the RHS of the above
equation represent the additional terms obtained from the Petrov-Galerkin
formulation. The former represents a stabilising artificial diffusion and the
latter is the result of a consistent weighting of the thermal load Q. The
artificial diffusion term may be written as
(k
(7.11)
This expression shows very clearly the structure of the artificial diffusion
term as a result of the SUPG formulation. The scalar multipliers combined
with the velocity tensor (VVT) produce a kind of conductivity tensor. We
now approximate t using the trial functions N and convert Equation (7.10)
into a finite element algebraic system of equations. In doing so we find that
in addition to element matrices and vectors of Chapter 3 and the advection
matrix of Section 1 of this chapter, we obtain a stabilising matrix (S:'j) for
the artificial diffusion term above,
SI!.
'J -
(2 0N;ONj 2oN;oNj
oN;oNj
ON;ONj) dO
ax + v oy oy +uv ax oy + vu oy ax
pc II v ll JOe u AX
He
(7.12)
k {
IIvll JOe
(aN;
aN;)
u ax + v ay Qdxdy
(7.13)
In the above formulation the issue of the scalar artificial diffusion coefficient (k) remains outstanding. For I-D advection problems it is defined
as
vh(7.14)
k=-e
2
where,
Pe
2
= coth-(7.15)
2
Pe
Pe being the mesh or local Peclet number. Such a definition of k produces nodally exact solutions, and is thus optimal. For multi-dimensional
problems [10] the above definition is generalised in the absence of a more
rigorous a.lternative. This generalisation however, does not seem to be of
major consequence to the solution as it has been pointed out by Brooks
and Hughes [10] that the structure of the artificial diffusion term of Equation (7.11) is more important than the actual value of the parameter k.
The 2-D generalisation of Equations (7.14) and (7.15) for an isoparametric
quadrilateral element is given as, follows
k = tvh{ + ~vfjhfj
2
(7.16)
111
where,
Pee
2
coth--2
Pee
= coth Pe ." - ~
2
Pe."
=
(7.17)
and
Pee
Pe."
In the above equations
of an element.
and
'TJ
::::;
vehe
k
v."h."
k
(7.18)
h Tty h~y
I,
x
Figure 7.1: Illustration of quantities required to calculate k for the 4-noded
isoparametric quadrilateral
An alternative version of the Equations (7.16) to (7.18) which is equivalent and readily programmable may be written for a 4-noded isoparametric
quadrilateral element as,
(7.19)
112
where,
y =
Pez
2
coth--2
Pez
coth Pe y __2_
Pe y
2
Pez
Pe y
(7.20)
and
u(hez + h"z)
k
v(hey + h"y)
k
(7.21)
The definitions of a.ll the above terms are clearly illustrated in Figure
7.1. All the terms in the figure can easily be calculated from the nodal
coordinates. It may be noted that the signs of the hez etc. terms will
be according to direction of the local axes. For instance a.ll the terms in
Figure 7.1 are positive except the h"z term, which of course is negative.
For 3-noded triangular elements we use the same procedure as above,
except in this case we choose the two shortest axes (of the three natural
axes) as and "I. All the relevent terms are shown in Figure 7.2.
hlly
x
Figure 7.2: Illustration of quantities required to calculate k for the 3-noded
triangle
7.2.2
113
Figure 7.3 illustrates a typical problem that is widely used to test algorithms for modelling convection dominated algorithms. A uniform flow
0.76 T=O.O
0.26 T=l.o
I
I...
Flow direction
T=I..tI
1.0
Figure 7.3: Illustration of the benchmark problem to test the PetrovGalerkin method
field of a unit magnitude is assumed. The inflow boundaries are specified
as shown in the figure. The outflow boundaries are considered homogeneous (meaning diffusive flux is zero, which of course means that there is no
temperature gradient). The value of 0 in Figure 7.3 for the test examples
attempted here has been chosen as 30. The value of heat capacity (pc) is
set to unity while the value of thermal conductivity (k) is set to 10-6 This
low value of conductivity makes this a convection dominated problem with
a Pe of 106 Figure 7.4 shows the exact solution (E) in comparison to the
Galerkin (G), Quadrature Upwind (QU) and SUPG solutions. A uniform
mesh of 400 4-noded elements was used for each method. The Quadrature
Upwind solution corresponds to the traditional upwind methods which are
equivalent to adding a scalar artificial diffusion k regardless of the flow
direction. It can be seen clearly from Figure 7.4 that the SUPG method
gives us the best results. There are overshoots and undershoots in case
of the SUPG method, however these do not affect the solution in other
regions. Hughes [13] suggests the use of a discont.inuity capturing operat.or
to obtain smoother results.
114
7.2.3
115
Figure 7.5: The first uniform mesh, two subsequent adaptive meshes and
the last mesh at which the target error was achieved
The solutions from the first mesh and the last mesh are shown in Figure
7.6 in the form of line contours. The quality of the adaptive solution can
be seen to be far superior.
The converged adaptive solution is again shown in Figure 7.7 for comparison with the solutions in Figure 7.4. It may be observed that the
adaptive solution is very close to the exact solution.
116
Figure 7.6: Solutions corresponding to the first uniform mesh and the final
adaptive mesh
Figllre 7.7:
:~J)
7.3
117
Transient Advection-diffusion
The SUPG method has essentially been derived based on the steady state
advection-diffusion equation and is not strictly applicable to the transient
equations [14] being considered here. Furthermore, upwind methods still
require empirical factors to control the amount of artificial diffusion as
seen in the previous section. However it may still be applied to transient
problems with an ad hoc definition of the parameter k given by Brooks
and Hughes as,
(7.22)
118
7.3.1
The first order pure advection equation for the function F(x, y, t), which
we call a pseudo-concentration junction, may be written as,
aF aF aF
-+u-+v-=O
at ax oy
(7.23)
= vLlt
(7.24)
The Taylor-Galerkin method [15] is now applied to Equation (7.23). Writing Equation (7.23) in the form,
F'+V(vF)=O
which for incompressible or divergence-free flow (V v
(7.25)
= 0) becomes
F' + (v . V)F = 0
where F' represents the first derivative w.r.t time and so on, and both F
and v are functions of space and time. Using forward time Taylor series,
we can write
Fn+l - Fn = F' Llt F" O(Ll)2
(7.26)
l1t
n + 2
n +
t
Donea [15] included a third order term as well, in the above approximation.
From Equation (7.25) we hav~,
= -(vn V)Fn
(7.27)
(7.28)
F~
and
F:
119
Fn+1 - Fn
tl.t
Vn
tl.t(
V
)
+! V) +2"
Vn
2) Fn
(7.30)
(7.31)
which can be solved for the vector Fn+l at each time step as,
(7.32)
where M may be referred to as a mass matrix (it is similar to the heat
capacity matrix of Chapter 4) and is.written as,
Ll
M
M=
e=l 0.
(7.33)
NtNJdxdy
(7.34)
and S is a balancing diffusion type part which after integrating the second
derivative terms by parts is obtained as
~ t1t
s -_ e=l
L.J 2
1 (2
0.
8Nie 8N;
Jl
uX
Jl
uX
8N
8N; + vu aN! 8N;) dfle
+ V 2 uy! 8N;
+ uv 8N!
uy
uX uy
uy uX
Jl
Jl
Jl
Jl
Jl
Jl
(7.35)
here all the velocities are at time level n. It can be seen from the above
derivation that an 'artificial diffusion' or 'balancing diffusion' type term
is automatically produced, which has tensorial structure resulting in its
influence being limited to the streamline directions. In fact this term is
actually the same as the stabilising matrix given by Equation (7.12) derived
earlier for the Petrov-Galerkin formulation. The only difference is in the
scalar multipliers, which for the Equation (7.12) is obtained in an ad hoc
manner while here it arises naturally. Donea [15J mentions that this term
may not be thought of as artificial diffusion but as part of a more accurate
temporal discretisation.
120
= U n+l -
Un
LuP+1 = f - (M - L)uP
(7.37)
here, M and L are the consistent and lumped mass matrices respectively
and p is the iteration index.
As Equa.tion (7.32) only conditionally stable, we can only use time steps
below a certain limit. The stability limit for a lumped mass solution is
c = v~t ~ 1.0
(7.38)
c<-y'3
(7.39)
C being the Courant number, while v is the magnitude of velocity and his
the element size for linear elements. This limit can be very severe specially
when consistent mass matrices are used and matrix inversion is necessary
for solution.
7.3.2
The rotating cone problem shown in Figure 7.8 has been widely used to
test advection algorithms, and has been recommended strongly for such
use, for instance by Gresho and Lee [7]. Figure 7.9 shows the initial configuration, where the cone represents the values of some function which
121
u=-y
1.0 F=IJ.O
Cone"
F=IJ.O
I~
1.0
Viewing direction
~I
Figure 7.8: Illustration of the benchmark problem to test the TaylorGalerkin method
122
7.3.3
In this section the Taylor-Galerkin method is applied to the energy equation based on references [19, 14, 20j. Writing the energy conservation
equation with the source term Q (which is the rate of internal heat generation)
pc (T' + V VT) = V k VT + Q
(7.40)
where T' represents the first derivative w.r.t time and so on. Using forward
time Taylor series as before, we write
Tn+! - Tn
I:1t
= T'n + I:1t
Til 0(1:1)2
2 n +
t
(7.41 )
(7.42)
and
+ V kVT~ + Qn
(7.43)
123
Figure 7.10: Explicit solution for the rotating cone problem showing the
cone from after a quarter revolution, top-left, to a full
revolution, bottom right.
124
Substituting equations (7.42) and (7.43) in Equation (7.41) after approximating v~ as Vnl;Vn, we obtain
-pc(vn+!
V)Tn
2
+ V kVTn + Qn
pc _ V k
( D.t
2
PC
= ( D.t
V)
+ V .2k V + pc ( (Vn+t
+ (1-
1:
V)
n+1
D.t
n V)
+ T(V
2)) Tn
D.t
)
D.t .
T(Vn . V) Qn + TQn
(7.45)
(7.46)
125
The stability limits for various values of a from a linear stability analysis
are reported in [14, 20] as,
1 - 2a
C < ---+
. -
Pe
J-+
1
3
(1 - 2a) 2
-Pe-
(7.48)
(7.49)
for lumped capacity matrices. Here C is the Courant number and Pe is
the Peclet number
For most high Pe problems it is economical to use the explicit version
of the discrete system given by Equation 7.47. To take full advantage of
the explicit system the use of lumped mass or capacity matrices is almost
mandatory. This however, as mentioned earlier introduces oscillations and
phase errors in the solution of advection problems. For pure diffusion the
reverse is true, i. e. mass lumping actually produces smoother results. In
light of this fact Donea [15] proposed the separation of the two parts to
achieve a much improved solution. This in context of Equation 7.47 may
be accomplished in the following two stages:
Convection
~tT* = (~t -
pc(A +
S)) Tn
(7.50)
Here T* is an intermediate temperature field obtained by an iterative explicit solution of only the advection part of Equation 7.47.
Diffusion
~~Tn+I = (~t -
K) T* + F
(7.51)
Solving the diffusion part as above gives the final temperature field. Here
a straightforward explicit solution using a lumped capacity matrix (C L )
gives a smooth solution.
Advective boundary conditions for the above problem are applied in
the convection stage and diffusive c@nditions are applied in the diffusion
stage. The results obtained using the two-stage procedure above are much
smoother than if Equation 7.47 is used directly. As with all splitting
methods some splitting errors are introduced here, however, the benefits
seem to outweigh the costs significantly.
126
References
[1] P.M.Gresho, R.L.Lee, and R.L.Sani. On the time-dependent solution
of the incompressible Navier-Stokes equations in two and three dimensions. In Recent Advances in Numerical Methods in Fluids, volume 1.
Pineridge Press Limited~ Swansea, 1980.
[2] P.M.Gresho, R.L.Lee, S.T.Chan, and R.L.Sani. Solution of the timedependent Navier-Stokes and Boussinesq equations using the Galerkin
finite element method. In Proceedings of the IUTAM Symposium on
Approximation Methods for Navier-Stokes Problems, Paderborn, West
Germany, September 1979. Springer-Verlag.
[3] P.M.Gresho. On the theory of semi-implicit projection methods for
viscous incompressible flow and its implementation via a finite element
method that also introduces a consistent mass matrix. part 1: Theory
and part 2: Implementation. International Journal for Numerical
Methods in Fluids, 11:587-659, 1990.
[4] J.Donea, S.Giuliani, H.Laval, and L.Quartapelle. Finite element solution of the unsteady Navier-Stokes equations by a fractional step
method. Computer Methods in Applied Mechanics and Engineering,
30:53-73, 1982.
[5] O.C.Zienkiewicz and R.L.Taylor. The Finite Element Method: Volumes 1 and 2. McGraw-Hill Book Company, London, 1987.
[6] C.Taylor and T.G.Hughes. Finite Element Programming of the
Navier-Stokes Equations. Pineridge Press, Swansea, U.K., 1981.
[7] P.M. Gresho and R.L.Lee. Don't suppress the wiggles - they are telling
you something! Computers and Fluids, 9:223-253, 1981.
[8] I.Christie, D.F.Griffiths, A.R.Mitchell, and O.C.Zienkiewic~. Finite
element methods for second order differential equations with significant first derivatives. International Journal for Numerical Methods in
Engineering, 10:1389-1396, 1976.
[9] J.C.Heinrich and O.C.Zienkiewicz. Quadratic finite element schemes
for two-dimensional convective transport problems. International
Journal for Numerical Methods in Engineering, 11:1831-1844, 1977.
[10] A.N.Brooks and T.J.R.Hughes. Streamline upwind/Petrov-Galerkin
127
128
[21] P.M. Gresho, S.T.Chan, R.L.Lee, and C.D.Upson. A modified finite element method for solving the time-dependent, incompressible
Navier-Stokes equations. International Journal for Numerical Methods in Fluids, 4:557-598, 1984.
[22] J.Donea, S.Giuliani, and H.Laval. Accurate explicit finite element schemes for convective-conductive heat transfer problems. In
T.J.R.Hughes, editor, Finite Element Methods for Convection Dominated Flows, volume 34. ASME, AMD, 1979.
Appendix A
Software Description for
HEAT2D
A.I
Introduction
A.2
A brief description of the main integer and real variables, main integer and
real arrays and the main subroutines is listed in the following sections in
alphabetical order.
A.2.1
Main Variables
130
131
A.2.2
Main Arrays
Array name
amass (mnpel,mnpel)
ambit(mboun)
Description
Element capacity matrix
Ambient temperature at the face
corresponding to nfacb
arwet( mgaus,melem)
Weighting factors at each integration
point in an element
astif( mnpel,mnpel)
Element stiffness matrix
capcy( mmatr)
Base heat capacity value for material
Conductivity variation with temperature
cdvlu( mcdpt,mmatr)
Convective heat transfer coefficient at
coeff( mboun)
the face corresponding to nfacb
Base conductivity value for material
condy( mmatr)
coord( mpoin,mdime)
Nodal coordinates
cpvlu(mcdpt,mmatr)
Capacity variation with temperature
derv 1(mnpel,mgaus,melem) Cartesian derivatives of shape
functions with respect to the X-axis
derv2( mnpel,mgaus,melem) Cartesian derivatives of shape
functions with respect to the y-axis
Temperature corresponding to nodes in
fixed(mboun)
iffix
Heat flux into the face corresponding
fluxe( mboun)
to nfacb
force(mpoin)
Global right hand side vector
gflum( mfron,mfron)
Global non-symmetric coefficient matrix
for convection
gstif(mprof)
Global coefficient matrix in vector
form
iffix( mpoin)
Index indicating free/fixed temperature
nodes
isoli(mpoin)
Index indicating phase of each node
(solid/liquid/mush)
Index indicating solidification or
lsoli(mpoin)
melting
An extra element nodal connectivity
lnods( melem,mnpel)
array for the front solver
Array used in the front solver
lhedv( mfron)
132
Array name
locel(mnpel)
mtype( melem)
nadfm( mpoin)
Description
Array used in the front solver
Element material type
First global degree of freedom number
at each node
nconc( melem,mnpel)
Element nodal connectivities
Array used in the front solver
ndest(mnpel)
Index indicating the diagonal
ndiag(mpoin)
positions in 'gstif'
nelmb( mboun)
Element number with a Neumann type
boundary condition
nfacb( mboun)
Face number of the element above
nfixd(mboun)
Node number of fixed temperature
boundary
nload(mboun)
Node number of specified thermal load
nodfm(mpoin)
Total number of degrees of freedom at
each node (1)
petrv( melem)
Parameter k for the amount
of diffusion added in the SUPG method
pnorm( mfron)
Array used in the front solver
qcumu(mpoin)
Cumulative amount of latent heat
released or absorbed
qlath(mpoin)
Amount of latent heat processed at
each iteration
qtotl(mpoin)
Amount of latent heat available at each
node
qincr(mpoin)
Increment to qlath at the end of
each iteration
qresi(mpoin)
Residual latent heat after phase change
has taken place
radia(mboun)
Radiative coefficient at the face
corresponding to nfacb
shapf( mnpel,mgaus,melem) Shape functions at each integration
point and element
tempr(mpoin)
Current temperature field
tfixd( mpoin)
Temperature corresponding to the fixed
nodes
tilod( mcdpt)
Time corresponding to load variation
valod
tlast(mpoin)
Temperature field at the last time
step or iteration
tload(mboun)
Thermal load corresponding to nodes
nload
A.2.3
133
Description
Temperature values corresponding to
cpvlu and cdvlu variations
X-component of the velocity at the nodes of an
element
Y-component of the velocity at the nodes of an
element
X-component of the velocity specified at nodal
points of the mesh
Y-component of the velocity specified at nodal
points of the mesh
Thermal load variation with time
Volum of phase change material at each node
Main Subroutines
Subroutine Description
BOUNDS
Calculates neumann boundary condition effects
FRONTS
Frontal solver for unsymmetric system of equations [1]
JACOBN
Evaluates the jacobian matrix and its determinant
Deals with latent heat
LATENT
Constructs the global nodal latent heat vector
LATVEC
NONLIN
Evaluates nonlinear quantities
Outputs temperature
OUTPUT
PETROV
Calculates the scalar coefficient k for the SUPG method
PHASCH
Calculates the latent heat source term for each iteration
PREWRK
Prepares necessary arrays
PROFAC
Factorizes global stiffness matrix [2] (symmetric)
PROSOL
Profile solver for symmetric system of equations [2]
READIN
Reads all problem data
SHAPEF
Calculates element shape functions and derivatives
SHAPE3
3-noded element shape functions and derivatives
SHAPE4
4-noded element shape functions and derivatives
6-noded element shape functions and derivatives
SHAPE6
9-noded element shape functions and derivatives
SHAPE9
Performs steady state analysis
STEADY
STIFFN
Constructs element stiffness matrix
TEMCOR
Corrects nodal temperatures for consistency with latent
heat evolved
Performs transient analysis
TRANSI
134
A.3
Program Overview
The main routine is listed in the following lines, the program structure
with all the subroutines is shown in Figure A.I.
PIlOGllJl HEAT2D
HEAT
c HEAT
HEAT
BEAT
BEAT
BEAT
A.S USJIA.I a H.C. HUAIG
BEAT
c BEAT
PAllJlETEJl (JlELEJI=400.IIPOIl"'441.IIJPEL"9.JIJIATIl=1.JlBOUJ=41.JlCDPI'"10. BEAT
JlDIJlE-2.JlGAUS=9.JlPIl0F-9999.JlFIlD.-99)
BEAT
IJIPLICIT JlEAL.8(A-B.0-Z)
BEAT
DIJIEISIO. JlTTPE(JlELEJI) CO.C(JlELEJI.JI.PEL).COOIlD(IIPOI JlDIJIE).
BEAT
COIDY(JlJlATIl).CAPCY(JIJIATIl).FIIED(JlBOUJ) FIID(JIBOUJ).
BEAT
.FACB(JlBDUI).IELJlB(JlBDUJ) LDAD(JlBDUJ).FLUlE(JIBOUJ).
HEAT
COEFF(JlBDUI).JlADIA(JlBDUJ).AJlBIT(JlBOUJ).TLDAD(JlBOUJ).
HEAT
TEIIPIl(JlPOI.).CDYLU(JlCDPT.JIJIATIl).CPYLU(JlCDPI.JIJIATIl).
HEAT
TVALU(JlCDPT.JlJlATIl).tILDD(JlCDPT).VALOD(JlCDPI)
HEAT
DIJlElSIO. SHAPF(JI.PEL.JlGAUS .JlELEII) .DEIlV1(JlIPEL.JlGAUS.JlELEII).
HEAT
DEIlV2(JlIPEL.JlGAUS .JlELEII) .AJlIlET(JlGAUS.JlELEII)
BEAT
VEIGB(JlGAUS).POSGB(JlGAUS).VEIGP(JlGAUS).POSGI(JlGAUS).
HEAT
POSGY(JlGAUS)
HEAT
DIJlElSIODFEL(JI.PEL).ASTIF(JI.PEL.IIJPEL).AllASS(IIJPEL.IIJPEL).
HEAT
.COLJI(JlPOI.).IFFII(JlPOI.).TFIlD(IIPOI.).TEJIPI(JlIPEL).
HEAT
TEJlP1(JI.PEL.JlIPEL) .IlYECT(IIJPEL) .IBELJI(JlELEII.4).
HEAT
lCDIlD(JI.PEL).YCOIlD(JI.PEL).EFOJlC(IIJPEL)
HEAT
DIJIEISIO.ISOLI(JlPOI.).LSOLI(JlPOI.).ILATI(IIPOI.).YOLUJl(JlPOI.).
HEAT
QTOTL(JlPOI.).QCUJIU(IIPOI.).QLATB(IIPOI.).QI.CJl(JlPOI.).
HEAT
QRESI(JlPOI.)
HEAT
DIJlE.SIO. GSTIF(JlPIlOF).IDIAG(JlPOI.).FOIlCE(IIPOI.).TLAST(JlPOI.)
HEAT
DIJlE.SIO. UVELO(JlPOI.).VVELO(JlPOI.).PETIlV(JlELEII).ULDCA(JlIPEL).
HEAT
YLOCA(JI.PEL).IDEST(IIJPEL).LDCEL(IIJPEL).LHEDV(JlFRO.).
HEAT
.ADFJI(JlPOI.) ODFJI(IIPOI.).LlODS(JlELEII.IIJPEL).
HEAT
P.OJlJl(JlFIlD.).GFLUJI(JlFIlD JlFIlD.)
HEAT
C
HEAT
C... OPEl CHAIIELS FOil JlEADI.G AID VIlITI.G
HEAT
C
HEAT
OPE. (UJIT=8.STATUS"'OLD'.FILE='I.PUTS.DAT')
HEAT
OPEl (UJIT'"7.STATUS='.EV'.FILE"'OUTPUT.RES')
BEAT
C
HEAT
C... READ I. DATA
BEAT
C
HEAT
CALL READII
HEAT
(JlELEII.JlPOI JlJlATIl.JllPEL.IIDIJlE.JlBDUJ.JlCDPT.
ITJllI.ILIIIl.IAlSY.ICO.V.IPETl.IPHAS ELEII.
HEAT
HEAT
.POIJlATIl.IIPEL.IFIlB.JEUIII THEIl ITEIl.
.TIJIL.TTIJIE.STIJIE.DTIJIE.DTJlAI ITUP ITD
BEAT
IlELAl.TOLER.ALPHA.JlTYPE CO.C ELJIB FACB.
BEAT
BEAT
.FIlD LOAD CDPI.COOIlD.COIDY.CAPCY.TYALU.
CDYLU.CPYLU.TLIQS.TSOLS.QLATI.FIlED.FLDIE.
BEAT
COEFF.JlADIA.AJlBIT.TLOAD.TEllPJl.TILOD.VALOD.
HEAT
UVELO.YVELO.FACTJl)
HEAT
C
HEAT
C CREATE REQUIRED I1FOJlJlATIO.
HEAT
C
HEAT
CALL PREVIlI
(JlELEJI.JlPOI.\JlIPEL.JlBOUJ.IELEII.IPOIPEL.
BEAT
ICO.V.ITJllI PIlOF CO.C.IDIAG COLJI.IELJlB.
HEAT
.BELJI.IFFIl FIID EOJII.IIPFC.IFIlB.LlODS.
HEAT
.ADFII ODFII.TFIlD.FIIED.ALPHA)
HEAT
C
BEAT
C IF SUPG RETROD IS TO BE USED FOil COIVECTIO. CALCULATE THE SCALAIl BEAT
C
C
C
C
C
2
3
4
6
6
7
8
9
10
11
12
13
14
16
16
17
18
19
20
21
22
23
24
26
26
27
28
29
30
31
32
33
34
36
36
37
38
39
40
41
42
43
44
45
46
47
48
49
60
61
62
53
64
66
66
67
68
69
135
136
C... CoEFFICIEIT FOil EACR ELERIIT
C
IF (ICon.Eq.1.UD.IPEn.EQ.!) TRD
IF (ITUI.EQ.1.UO.ALPRi.EQ.O.O) GOTo 311
OPEl (UlIT-2,STAYUS-'SClATCR',FOIR-'UlFDlAATTED')
OPEl (UlITa4,STAYUS-'SClAtcH',FOIRa'UlFDlAATTED')
CALL PETaDY
(IIPOII ,IIELIII,IIPIIL ,IIDIIIE ,lIIIAn,lPOII ,IELEII,
1IPEL,IIPFC,ICOIC,KI1PE,COIDT,Cooao,PEnY,
UYELo,YYELD)
311 ColTIIUE
EID IF
CALL SHAPEF
CALL STEADT
C OUTPUT aESULTS
C
CALL OUTPUT
STOP
(lIPoII,IPOII,TERPa)
100 ColTIIUE
TIJlEaSTIIIE
ISTEPaO
REAT
BUT
BUT
BUT
BUT
BUT
BUT
BUT
BUT
BElT
BUT
BUT
BElT
BUT
BUT
BUT
BUT
BUT
BUT
BUT
BUT
BUT
BUT
BUT
BUT
BElT
BUT
BUT
BUT
OAT
BUT
BUT
BUT
BUT
BElT
BUT
BUT
BElT
BUT
BUT
BUT
BUT
OAT
BUT
BElT
BUT
BUT
BUT
BUT
BUT
BUT
BUT
BElT
BUT
BUT
BUT
BElT
BUT
BElT
BUT
BUT
BUT
BUT
BUT
BUT
BUT
BUT
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
63
64
85
66
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
ElD
A.4
137
HEAT
HEAT
BU.T
HEAT
BU.T
HEAT
BU.T
HEAT
BU.T
BU.T
127
128
129
130
131
132
133
134
135
136
Input Instructions
anD
DAD
DAD
DAD
anD
DAD
DAD
anD
anD
anD
DAD
DAD
DAD
1
2
3
4
5
6
7
8
9
10
11
12
13
anD
anD
IRPLICIT anL.8(A-H.0-Z)
anD
DIREISIO. RTYPE(IIELD) CO.C(IIELER ....PEL) .COOaD(RPOII.RDIIIE).
DAD
CO.DY(RRATa) .CAPCY(Rnn) .FIIED(IIBOUJ) .IFIID(IIBOUJ).
DAD
.FACB(RBOUJ) .nLRB(UoUJ) LOADOIBOUJ) .FLUIEOlBOUJ).
DAD
COEFF(RBOUJ) .aADI&(IIBOUJ) .AIIBIT(RBOUJ). TLOAD(RBOUJ).
anD
TERPa(RPOII) .CDYW(RCDPT .....Ata) .CPYLU(RCDPT .RRAn).
anD
TYALU(RCDPT .MAta) TILOD(RCDPT). VALOD(RCDPT) TITLE(12) anD
DIIIE.SIO. UYELO(RPOI.).YYELO(RPOI.)
anD
anD(8.920) TITLE
DAD
VIlITE (7 .920) TITLE
DAD
920 FOaRAT(12A6)
anD
.ITD-l
anD
anD
C
C 1. anD liFO FDa LI.na/.OILIDO/ STEADY STATE/tu.SIEIT SOLUTIOIaEAD
C
DAD
anD (8 ) ITaAJ.ILI.a.IAISY.Icon.IPETa
DAD
lIaITE(7.901} ItaAI. ILIft. IllSY. ICOIY.IPEn
anD
901 FOUAT(I/8H ItaAI "'.I4.41.8H ILIft -.I~.41.8H IUSY ".14
DAD
./l8H ICOIV -.I4.41.8H IPETa -.14)
.
DAD
IF (ITU'.EQ.l) anD (8 ) TTIRE.STIRE.DTIRE.ALPHA
anD
IF (ITU'.EQ.1} VIlITE(7.902)TTIRE.STIIIE.DTIIIE.ALPHA
DAD
902 FOUAT(//8H TTIRE =.F6.3.3I.8H STIllE -.F5.3.31.
anD
.8K DTIRE m.F5.3.31.8H ALPHA -.F6.3)
anD
IF (ILIft.EQ.1} DAD (8 ) '!TEa.TOLER.aRtU
anD
IF (ILIft.EQ.l) VIlITE(7.903) 'ITEa.TOLER.UtAI
anD
903 FOUAT(//8H .ITEa "'.I4.41.8H TOLEa -.F5.3.31.
DAD
DAD
.8H aELAI "'.F5.3)
IF <ILIft.EII.1.&ID.ITU'.EII.1} DAD (8 ) IITUP.IITD'.DTRAX.FACta DAD
IF (ILIft.EQ.l.&ID.Itu'.EII.l) lIaITE(7.907)'ITUP.'ITD'.DTR&I.FAcnaEAD
907 FOaRAT(//8K IITUP =.I4.41.8H IITDI -.I4.41.8H DTRAI -.F5.3.3I.
anD
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
c
C
C.... THIS SUBaOUTI.E anDS ALL paOBLER DATA
C
c
C
C
IISEaT DOUBLE
lEAD
14
138
READ
READ
READ
C 2. RESH DATA, COIIECTIYITY AID 10DAL COORDIIATES
READ
C
READ (S,.) IELER,IPOII,IRATR,IIPEL
READ
VRITE(7,.904)IELER,IPOIl,IRATR,IIPEL
READ
904 FORRAT(I/SH IELER =,I4,4X,SH IPOII =,14,4X,SH IRATR -,I4,4X,
READ
.SH IIPEI. =,14/1>
READ
READ (S,.) ICOIC(IEL,JPE),JPE=l,IIPEL),RTYPE(IEL),
READ
IEL=l,IELER)
READ
VRITE(7 ,.)' ELEREIT, RATERHL,
lODE JUJlBERS'
READ
DO 2 IELER-l,IELER
READ
2 VRITE(7,905)IELER,RTTPE(IELER),(ICOIC(IELER,IIPEL),IIPEL-l,IIPEL) READ
906 FORRAT(lX,15,19,6X,9I6)
READ
READ (S,.) (COORD(IIOD,l),COORD(IIOD,2),IIOD=l,IPOII)
READ
VRITE (7 )
READ
VRITE(7,.)' lODE
x
Y'
READ
DO 10 IPOII-l,IPOII
READ
10 VRITE(7,,906) IPOIl,(COORD(IPOII,IDIRE),IDIRE=l,2)
READ
906 FORRATUX,I6,3Fl0.3)
READ
READ
C
READ
C 3. RATERIAL PROPERTIES
READ
C
READ (S,.) (COIDY(IR),CAPCY(IR),IR=l,IRATR)
READ
READ
VRITE(7,,912)
READ
912 FORRAT(//'
RAT.',lX,'COIDUCTIYITY',ll,'CAPACITY')
READ
DO 16 IR-l,IRATR
READ
16 VRITE(7,906) IR,COIDY(IR),CAPCY(IR)
READ
IF (ILIIR.EQ.l) THEI
READ
READ (S,.) ICDPT
IF (ICDPT.OT.O) READ (S,.)
READ
CDYLU(I,IR),CPYLU(I,IR) ,TYALU(I,IR),I=l,ICDPT) ,IR=l,IRATR) READ
READ (S,.) IPHAS
READ
IF (IPHAS.GT.O) READ (S,.) TLIQS,TSOLS,QLATI
READ
READ
EID IF
READ
C
C 4. DIRICHLET BOUIDARY COIDITIOIS (FIXED TERPERATURE)
READ
C
READ
READ (S".) IFIXB
READ
IF (IFIXB.GT.O) READ (S,.) (IFIXD(IBC),FIIED(IBC),IBC=l,IFIlB)
READ
IF (IFIXB.GT.O) VRITE(7,.)
READ
IF (IFIXB.OT.O) VRITE(7,.) , lODE FIXED TERPR'
READ
IF (IFIXB.GT.O) VRITE(7,916)(IFIXD(IBC),FllED(IBC),IBC=l,IFIXB) READ
916 FORRAT(15,F13.4)
READ
C
READ
C 6. lEURAl1 BOUIDARY COIDITIOIS (FIlED FLUX, COIYECTIOI, RADIATIOlREAD
C
READ
READ (S,.) lEURI
READ
IF (IEURI.GT.O) READ (S,.) (IELRB(IBC),IFACB(IBC),
READ
FLUXE(IBC) ,COEFF(IBC) ,RADIA(IBC) ,ARBIT(IBC),IBC-l,JEURJ)
READ
READ
IF (IEURJ.GT.O) VRITE(7,.)
IF (IEURI .GT .0)
READ
VRITE(7,.) 'ELEREIT FACE FLUX
COEFF
RADIA
ARBIT'READ
IF (IEURI.GT.O) VRITE(7 ,926)(IELRB(IBC) ,IFACB(IBC),
READ
FLUXE(IBC) ,COEFF(IBC) ,RADIA(IBC) ,ARBIT(IBC) ,IBC=l,IEURJ)
READ
926 FORRAT(2I6,4Ell.3)
READ
C
READ
READ
C 6. THERRAL LOADIIG (IITERIAL HEAT GEIERATIOI)
READ
C
READ (S,.) ITHER
READ
READ
IF (ITHER.GT.O) READ (S,.) (ILOAD(IBC),TLOAD(IBC),IBC=l,ITHER)
IF (ITRAI.EQ.l.AID.ITHER.GT.O) THEI
READ
READ (S,.) ITIRL
READ
IF (ITIRL.GT.O) READ (S,.) (TILOD(I),YALOD(I),I=l,ITIKL)
READ
EID IF
READ
C
READ
C 7. IIITIAL TERPERATURE FIELD FOR 10lLIIEAR OR TRAISIEIT PROBLERS READ
.SH FACTR =,F6.3)
47
4S
49
60
51
52
63
54
56
66
57
6S
59
60
61
62
63
64
66
66
67
68
69
70
71
72
73
74
76
76
77
7S
79
SO
Sl
S2
83
S4
S6
86
S7
88
S9
90
91
92
93
94
95
96
97
9S
99
100
101
102
103
104
105
106
107
lOS
109
110
111
112
113
139
IF (ILIIR.EQ.1.0R.ITRAI.EQ.1) THEI
READ (8,.) (TERPR(IIOD),IIOD=l,IPOII)
11
DO 11 1=1 ,IFIXB
TERPR(IFIXD(I=FIXED(I)
COITllUE
IIRITE(7,.)
IIRITE(7,.)'IIITIAL TERPERATURE'
IIRITE(7,910) (IIOD,TERPR(IIOD),IIOD=l,IPOII)
EID IF
C 8.
IF (ICOIV.EQ.l) THEI
READ (8,.) (UVELO(IIOD),VVELO(IIOD),IIOD=l,IPOII)
IIRITE(7,.)
IIRITE(7,.)'SPECIFIED VELOCITY FIELD'
IIRITE(7,.)' lODE
U-VEL
V-VEL'
DO 19 IIOD=l,IPOII
IIRITE(7,911) IIOD,UVELO(IIOD),VVELO(IIOD)
19
COITIIUE
EID IF
910 FORRAT(4(I5,FI0.4
911 FORRAT(4(I5,FI0.4,lX,FI0.4
RETORI
EID
READ
READ
READ
READ
READ
READ
READ
READ
READ
READ
READ
READ
READ
READ
READ
READ
READ
READ
READ
READ
READ
READ
READ
READ
READ
READ
READ
READ
READ
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
Subroutine READIN reads in all the input data required by the program as listed above from the file INPUTS.DAT. The details of the input
are described below. The variables to be input are written in bold face in
bold brackets. All the variable names are as defined in the tables earlier.
1 Control data
1.1 (title)
1.2 (itran,ilinr ,iaxsy,iconv ,ipetr)
1.3 (ttime,stime,dtime,alpha) (Only if itran=l)
1.4 (niter,toler,relax) (Only if ilinr=l)
1.5 (nitup,nitdn,dtmax,factr) (Only if ilinr=l and itran=l)
2 Mesh data
2.1 (nelem,npoin,nmatr,nnpel)
2.2 (nconc,mtype) nelem times ('nnpel' nodes and material)
2.3 (coord) npoin times (x-coordinate and y-coordinate)
3 Material properties
3.1 (condy,capcy) nmatr times
3.2 (ncdpt) (Only if ilinr=l)
140
(nelmb~nfacb,fluxe,coeff,radia,ambit)
neumn times
6 Thermal loading
6.1 (nther)
6.2 (nload,tload) nther times
6.3 (ntiml) (Only if itran=l)
6.4 (tilod,valod) ntiml times
7 Initial conditions
7.1 (tempr) npoin times (Only if itran=l and ilinr=l)
8 Velocity field
8.1 (uvelo,vvelo) npoin times (Only if iconv=l)
A.5
Element stiffness and mass matrices are calculated in the following routine.
SUBILOUTIIE STIFFI (IIELEII,IIGAUS ,IIJPEL,IICDPT ,lIJIATa,IELEII,IIU.TR,
IGAUS,llPEL,InAI,ILIla,IPETR,ICDIV,IAXSY,
IPHAS,ICDPT,PEnD,TYALU,CDYLU,CPYLU,CDIDT,
CAPCT, TEIIPT ,SHAPF ,DElYl,DElV2 ,AlIlET ,ASTIr,
AIIASS,ULDCA,YLDCA,lCDID,YCDID)
c
C
c THIS SUBILOUTIIE CDISTRUCTS ELEIIUT STIFFIESS IIATRIl
STIF
STIF
STIF
STIF
STIr
STIF
STIF
STIF
2
3
4
5
6
7
8
141
STIF
c STIF 10
C
C
IISERT DOUBLE
C
C ***
C
30
C
C ***
C
49
60
C **.
C
C **.
C
STIF
STIF
IRPLICIT REAL*8(A-H,O-Z)
STIF
DIREISIOI SHAPF(RlPEL,RGAUS,RELER),DEIY1(RIPEL,RGAUS,RELER),
STIF
DERV2(RIPEL,RGAUS,RELER),AlVET(RGAUS,RELER),
STIF
CDYLU(RCDPT,RRATI),CPYLD(RCDPT,RRATI),
snF
TYALU(RCDPT,RRATI),TERPT(RlPEL),ASTIF(RlPEL,RlPEL),
snF
ARASS(RlPEL,RIPEL) ,ULOCA(RlPIL) ,YLOCA(RIPEL),
STIF
XCORD(RIPEL),YCORD(RlPEL),SHAPP(9),CAlTP(2,9)
STIF
STIF
lTIACT ELEREIT SHAPE FUlCTIOIS
STIF
snF
DO 100 IGAUS~l,IGAUS
STIF
DAREA-AIVET(IGAUS,IELER)
snF
DO 30 I10D""1 ,IIPEL
STIF
SHAPP(IIODP)-SHAPF(IIODP,IGAUS,IELER)
STIF
CAlTP(l,IIODP)-DEIY1(IIODP,IGAUS,IELER)
STIF
CAITP(2 ,IIODP)=DERY2(IIODP , IGAUS, IELER)
snF
COITIIUE
STIF
STIF
EYALUATE PROPEITIES AT IITEGIATIOI POIITS
STIF
STIF
TERP1=O.0
snF
STIF
TERP2"0.0
TERP3=0.0
STIF
COIn-COIDT
STIF
CAPY=CAPCT
STIF
IADI-1.0DO
snF
IF (IAiSY.EQ.l) THEI
snF
IADI=O.ODO
STIF
DO 49 IIOD""l,IIPEL
STIF
IADI=IADI+XCORD(IIODP)*SHAPP(IIODP)
STIF
COITIIUE
STIF
DD IF
STIF
IF (ILIIR.EQ.l) THO
STIF
TERP "0.0
STIF
DU-O.O
snF
DTT-O.O
snF
DHX=O.O
STIF
DHY=O.O
STIF
DO 60 IIODP-l,IIPEL
STIF
TERT-TERPT(IIODP)
snF
TERP-TERP+TERT*SHAPP(IIODP)
snF
IF (ITIAI.EQ.l.AID.IPHAS.EQ.O) THEI
STIF
CALL 10lLII (RCDPT ,RRATI,IRATR,ICDPT, mT ,TYALU,CPYLU, YALUE)STIF
UTH-VALUE
STIF
DTX=DTX+TERT*CAlTP(l,IIODP)
STIF
DTY-DTY+TERT*CAlTP(2,IIODP)
STIF
DHX=DHX+DTH*CAlTP(l,IIODP)
STIF
DHY=DHY+DTH*CAlTP(2,IIODP)
snF
EID IF
snF
COITIIUE
STIF
CALL 10ILII (RCDPT,RRATR,IRATR,ICDPT,TERP,TYALU,CDYLU,YALUE)STIF
COID-COID*VALUE
STIF
IF (ITIAI.EQ.l.AlD.IPHAS.EQ.O) THO
STIF
IF (DTI.IE.O.O.AID.DTT.IE.O.O) THO
STIF
--------------- ROIGAI ET. AL. AID LERROI'S APPIOX. --------------STIF
CAPY-CAPY*DSQITDHX*DHX+DRY*DRY)/(DU*DTI+DTY*DTT snF
IF (CAPY.LE.O.O) CAPY=CAPCT
snF
--------------- DELUIDICE ET. AL.'S APPROI. ---------------------STIF
CAPY=CAPY*(DHX*DTI+DRY*DTT)/(DTX.DTX+DTY*DTY)
STIF
IF (CAPY.LE.O.O) CAPY=CAPCT
STIF
KID IF
STIF
ELSE IF (ITIAI.IE.l) THEI
STIF
CALL 10lLII (RCDPT, RRATR, IRATI,ICDPT , TERP, TYALU, CPYLU, STIF
11
12
13
14
16
16
17
18
19
20
21
22
23
24
26
26
27
28
29
30
31
32
33
34
36
36
37
38
39
40
41
42
43
44
46
46
47
48
49
50
61
62
63
64
65
56
67
68
59
60
61
62
63
64
66
66
67
66
69
70
71
72
73
74
75
142
VALUE)
CAPY=CAPY.YALUE
EID IF
DD IF
IF (lCOIV. EQ.1) THEI
UVEL =0.0
YVEL -0.0
DO 51 IIODP~l,IIPEL
UVEL-UVEL+ULOCA(IIODP).SHAPP(IIODP)
YYEL=YYEL+VLOCA(IIODP).SHAPP(IIODP)
COITIIUE
EID IF
STIF
STIF
STIF
STIF
STIF
STIF
STIF
STIF
STIF
STIF
STIF
51
STIF
STIF
C
STIF
C COISTRUCT STIFFIESS AID RASS RATRICES
STIF
C
STIF
DO 90 I10DP=1,OPEL
SHAPI=SHAPP(IIODP)
STIF
CARII=CARTP (1 ,IIODP)
STIF
CARYI=CARTP(2,IIODP)
STIF
DO 80 JIODP=l,IIPEL
STIF
SHAPJ=SHAPP(JIODP)
STIF
CARIJ=CARTP(l,JIODP)
STIF
CARYJ=CARTP(2,JIODP)
STIF
C
STIF
C DIFFUSIOI PART OF STIFFIESS RATRII.
STIF
C
STIF
STIF
STIF
C
C * COIYECTIOI PART OF STIFFIESS ",TRII.
STIF
STIF
C
IF (lCOIV. EQ .1)
STIF
STIF
TERP2=(UVEL*CARIJ+YVEL*CARYJ)*SHAPI*DAREA*CAPY*RADI
C
STIF
C *.. PETROY-GALEUII PART OF STIFFJESS RATRIl.
STIF
C
STIF
IF (IPETR.EQ.O
STIF
TERP3-(CARII*CARIJoUVEL*UVEL+CARYIoCARYJ*YVEL*YVEL+
STIF
CARII*CARYJ.UVEL*YVEL+CARYIoCARIJ*YVEL.UVEL)
STIF
*PETRO*DAREAoCAPY*RADI
STIF
ASTIF(IIODP,JIODP)=ASTIF(IIODP,JIODP)+TERP1+TERP2+TERP3 STIF
C
STIF
C 0 CAPACITY RATRII FOR TRAISIEIT PROBLERS
STIF
C
STIF
IF (lTUI.EQ.l)
STIF
ARASS(IIODP,JIODP)=ARASS(IIODP,JIODP)+
STIF
SHAPI*SHAPJ*CAPY.DAREA
STIF
80
COITIIUE
STIF
90
COlTIIUE
STIF
100 COlTIIUE
STIF
RETURI
STIF
EID
STIF
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
A.6.l
LATE
LATE
LATE
LATE
2
3
4
LATE
LATE
LATE
c LATE
LATE
IISERT DOUBLE
C
LATE
C
IRPLICIT REAL.8(A-H,O-Z)
LATE
DIREISIOIICOIC(RELER,RIPEL),ILATI(KPOII),RTYPE(RELER),
LATE
ARASS(RIPEL,RIPEL),VOLUR(KPOII),QTOTL(RPOII),
LATE
ARVET(RGAUS,RELER),SHAPF(RlPEL,RGAUS,RELER),
LATE
TERPR(RPOII),ISOLI(KPOII),CAPCY(RRATR)
LATE
LATE
C
C COISTRUCT 10DAL LATEIT HEAT VECTOR FOR PHASE CHAIGE PROBLERS
LATE
C
LATE
DO 134 I=l,IPOII
LATE
ILATI(I)=O
LATE
IF (TERPR(I).GT.TLIQS) THEI
LATE
I SOLI (I )=-1
LATE
ELSE IF (TERPR(I) :LT. TSOLS) THEI
LATE
ISOLI(I)=l
LATE
ELSE
LATE
ISOLI (I)=O
LATE
10 IF
LATE
LATE
134 COITIIUE
(RELER,RPOII,RIPEL,RGAUS,IELER,IPOII,IIPEL,
CALL LATVEC
LATE
IGAUS,IPHAS,QLATI,ILATI,RTYPE,ICOIC,VOLUR,
LATE
QTOTL,ARASS,SHAPF,ARVET)
LATE
C
LATE
SPEAT=CAPCY(IPHAS)
LATE
RETUU
LATE
LATE
EID
C
c THIS SUBROUTIIE DEALS VITH LATEIT HEAT
C
LATV
LATY
LATY
c LATY
LATY
C
C THIS SUBROUTIIE COISTRUCTS THE GLOBAL 10DAL LATEIT HEAT VECTOR
LATY
LATY
C
c LATY
IISERT DOUBLE
LATY
C
LATY
C
IRPLICIT REAL.8(A-H,O-Z)
LATY
DIREISIOIICOIC(RELER,RlPEL),ILATI(KPOII),RTYPE(RELER),
LATY
ARASS(RlPEL,RlPEL),YOLUR(KPOII),QTDTL(RPOII),
LATV
ARVET(RGAUS,RELER) ,SHAPF(RlPEL,RGAUS,RELER) ,SHAPE(9)
LATY
DO 1000 IEL-l ,IELER
LATY
IRAT-RTYPE(IEL)
LATV
IF (IRAT.IE.IPHAS) Goto 1000
LATV
DO 1008 I=l,IIPEL
LATV
DO 1009 J=l,IJPEL
LATY
ARASS(I,J)-O.O
LATV
COITIIUE
LATV
1009
1008
COITIIUE
LATY
DO 1001 IGAUS-l,IGAUS
LATV
DO 1002 I=l,IIPEL
LATV
SHAPE(I)=SHAPF(I,IGAUS,IEL)
LATV
1002
COITIIUE
LATV
GVIGJ=ARVET(IGAUS,IEL)
LATV
DO 1003 I=l,IIPEL
LATY
DO 1004 J=l,UPEL
LATV
ARASs(I ,J)=ARASS(I ,J)+SHAPE(I).SHAPE(J).GVIGJ
LATV
COITIIUE
LATV
1004
LATV
1003
COITIIUE
LATV
1001
COITIIUE
LATY
DO 1005 I=l,IIPEL
143
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
36
36
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
144
1006
1006
1000
1010
A.6.2
LATY
LATY
LATY
LATY
LATY
LAYY
LATY
LATY
LATY
LATY
LATY
LATY
36
36
37
38
39
40
41
42
43
44
46
46
PHAS
PHAS
PHAS
PHAS
c PHAS
C
PHAS
c THIS SUBIlDUTIIE CALCULATES THE LATUT HEAT SDUilCE TEJlII FDIl EACH PHAS
C lTEIlATIDI.
PHAS
C
PHAS
c PHAS
C
IISEIlT DDUBLE
PHAS
C
PHAS
IIIPLICIT REAL.8(A-H,D-Z)
PHAS
DIIIUSIDIISDLI(IIPDII),LSDLI(IIPDII),ILATI(IIPDII),TEIIPIl(IIPDII);
PHAS
TLAST(IIPDII) ,VDLUR(IIPDII),QTDTL(IIPDII) ,QCUIIU(IIPDII) ,
PHAS
QLATH(IIPDII),QIICJl(IIPDII),CPYLU(IICDPT,IIIIATR),
PHAS
QRESI(IIPDII),TYALU(IICDPT,III1ATR)
PHAS
C
PHAS
DD 1000 I-l,IPDII
PHAS
IF (ILATI(I).EQ.O) GDTD 1000
PHAS
TEIIP=TEIIPJl(I )
PHAS
CALL IDILII (IICDPT ,IIIIATR,IPHAS,JCDPT ,TEIIP,TYALU,CPVLU,VALUE) PHAS
STEIIP=SPEAT.YALUE
PHAS
SHEAr-l.0/TLIQS-TSOLS)/QLATI+1.0/STEIIP)
PHAS
QIICJl(I)=O.O
PHAS
IF (ISDLI(I).EQ.-l) THEI
PHAS
LSDLI (I)-ISDLI (I).ISTEP
PHAS
IF (TEllPIl(I).LT.TLIQS.AlD.TLAST(I).GE.TLIQS) ISDLI(I)=O
PHAS
IF (ISDLI(I).IE.O) GDTD 1000
PHAS
DTEllP-TLIQS-TEllPIl(I)
PHAS
QIICIl(I)"VDLUR(I).SHEAT~DTEIIP
PHAS
IF (QIICIl(I).GT.QTDTL(I QIICJl(I)-QIDTL(I)
PHAS
QCUIIU(I)-qCUllU(I)+qIICIl(I)
PHAS
QLATH(I)-QLATH(I)+qIICJl(I)
PHAS
GDTD 1000
PHAS
UD IF
PHAS
IF (ISDLI(I).EQ.l) THEI
PHAS
LSDLI (I)-ISDLI (I).ISTEP
PHAS
IF (TEIIPJl(I).GT.TSDLS.AlD.TLAST(I).LE.TSDLS) ISDLI(I)=O
PHAS
IF (ISDLI(I).IE.O) GDTD 1000
PHAS
DTEIIP=TSOLS-TEIIPIl(I)
PHlS
QIICIl(I)-YDLUR(I).SHEAT.DTEIIP
PHAS
IF (DABS(QIICJl(I.GT.QTDTL(I QIICIl(I)=-QTDTL(I)
PHAS
QCUIIU(I)-qCUllU(I)+qIICJl(I)
PHAS
QLATH(I)-QLATH(I)+qIICJl(I)
PHAS
GDTD 1000
PHAS
BID IF
PHAS
IF (ISDLI(I).EQ.O) THU
PHAS
IF (ISTEP.EQ.IABS(LSDLI(I) THEI
PHAS
2
3
4
6
6
7
8
9
10
11
12
13
14
16
16
17
18
19
20
21
22
23
24
26
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
46
46
47
48
49
A.G.3
145
pus 50
PUS
PUS
PUS
PUS
PUS
PUS
PUS
PUS
PUS
PUS
PUS
PUS
PUS
PUS
PUS
PUS
PUS
PHIS
PUS
PUS
PUS
PUS
PUS
PUS
PUS
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
66
69
70
71
72
73
74
75
TEIIC
TEJIC
1
2
c..................................................................... TIle 3
C
c SUBaDUTllE TO
c BElT EYOLYED.
CORRECT
I1SEIlT DOUBLE
IKPLICIT REIL.8(I-K,O-Z)
DIIIEISIOI ISOLI(IIPOII) ,LSOLI(IIPOII) ,ILlTl(IIPOII) ,TEIIPa(KPOII),
TLlST(KPOII) ,YOLUR(KPOII) ,QTOTL(IIPOII) ,QCOKU(KPOII)
TUlO-TLIQS-TSOLS
DO 1000 I=l,IPOII
IF (ILlTl(I).EQ .0) OOTO 1000
IF (ISOLI(I) .IE.O) OOTO 1000
IF (TUlG.EQ.O) THD
TEKPa(I)-rLIQS
GOTO 1001
DO IF
IF (LSOLI(I).LT.D) THD
TERP=TLIQS-(DABS(QCUIIU(I/QTOTL(I.TRIIG
TEKPa(I)=TEKP
ELSE IF (LSOLI(I).GT .D) THD
TEIIP=TSOLS+(DABS(QCUIIU(I/QTOTL(I.TRIIG
TERPa(I) =TEIIP
DO IF
1001
IF (QCUWU(I) .LT.D .. IID.DABS(QCUIIU(I .GE.QTOTL(I ISOLI(I)=-l
IF (QCOWU(I).GT.D.D.IID.QCUKO(I).GE.QTOTL(I ISOLI(I)=1
1000 COITIIDE
IlETOU
DD
TEIIC
TEIIC
TEJIC
TEJIC
TEJIC
TEJIC
TEJIC
5
6
7
8
9
TERC
TERC
TERC
10
11
12
13
14
15
16
17
18
19
2D
21
22
23
24
25
26
27
28
29
TEIIC
30
TEIIC
TEJIC
31
32
TEIIC
TERC
TERC
TEIIC
TEIIC
TEIIC
TEIIC
TEIIC
TEIIC
TEIIC
TEIIC
TEJIC
TEJIC
TERC
TEJIC
TEJIC
TEIIC 33
146
A.7
Documented Examples
Details of two examples are listed in the following sections. The first one
is a transient heat conduction problem, the second is a steady state forced
convection problem.
A.7.1
5.
T
= -45.0
CI. . ---r.-o-=-0-.0-0-C--T--=---0-.1-5-oC---'1
j
= l.OcmI
= 4.0cm
= 70.26 ca~
pc = l.OO;!3
pL
= l.0 occalems
122 121 80 81
120 119 78 79
118 117 76 77
116 115 74 75
114 113 72 73
112 111 70 71
110 109 68 69
108 107 66 67
106 105 64 65
104 103 62'- 63
102 101 60 61
100 99 58 59
98 97 56 57
1
1
1
1
1
1
1
O.
14 15 56 97 96 95 54 55
12 13 54 95 94 93 52 53
10 11 52 93 92 91 50 51
8 9 50 91 90 89 48 49
6 7 48 89 88 87 46 47
4 5 46 87 86 85 44 45
2 3 44 85 84 83 42 43
O.
4.87805E-03 O.
9.75610E-03 O.
2.46470E-02 O.
3. 95379E-02 O.
6.44416E-02 O.
8. 93453E-02 O.
0.124262 O.
0.159178 O.
0.204108 O.
0.249037 O.
0.303979 O.
0.358922 O.
0.423877 O.
0.488832 O.
0.563800 O.
0.638768 O.
0.723748 O.
0.808729 O.
0.904365 O.
1.00000 O.
1.10436 O.
1.20873 O.
1.32375 O.
1.43877 O.
1.56380 O.
1.68883 O.
1.82388 O.
1.95892 O.
2.10398 O.
2.24904 O.
2.40411 O.
2.55918 O.
2.72426 O.
2.88935 O.
3.06444 O.
3.23954 O.
3.42465 O.
3.60976 O.
3.80488 O.
4.00000 O.
O.
0.250000
4. 87805E-03
0.250000
9. 75610E-03
0.250000
2. 46470E-02
0.250000
3. 95379E-02
0.250000
6.44416E-02
0.250000
8. 93453E-02
0.250000
0.124262
0.250000
0.250000
0.159178
0.204108
0.250000
0.250000
0.249037
0.303979
0.250000
0.250000
0.358922
0.423877 0.250000
0.250000
0.488832
0.250000
0.563800
0.638768 0.250000
0.723748
0.250000
0.808729 0.250000
147
148
0.904365 0.250000
1.00000 0.250000
1.10436 0.250000
1.20873 0.250000
1.32375 0.250000
1.43877 0.250000
1.56380 0.250000
1.68883 0.250000
1.82388 0.250000
1.95892
0.250000
0.250000
2.10398
2.24904
0.250000
0.250000
2.40411
0.250000
2.55918
2.72426 0.250000
2.88936
0.250000
3.06444 0.250000
3.23954
0.260000
3.42466
0.250000
3.60976 0.250000
3.80488
0.250000
4.00000 0.260000
O.
0.500000
4.87805E-03 0.600000
9.76610E-03 0.500000
2.46470E-02 0.600000
3.95379E-02 0.600000
6.44416E-02 0.600000
8.93453E-02 0.600000
0.600000
0.124262
0.159178 0.600000
0.204108 0.600000
0.249037 0.600000
0.303979 0.500000
0.358922 0.500000
0.423877
0.500000
0.488832
0.600000
0.663800 0.500000
0.638768 0.500000
0.723748 0.600000
0.808729 0.500000
0.904386 0.500000
1.00000 0.600000
1.10436 0.600000
1.20873 0.500000
1.32375
0.600000
1.43877 0.500000
1.56380 0.500000
1.68883 0.500000
1.82388 0.500000
1.95892
0.500000
2.10398
0.500000
2.24904
0.500000
2.40411
0.600000
2.55918
0.500000
2.72426
0.500000
2.88935
0.500000
3.06444
0.500000
3.23954
0.500000
3.42465
0.500000
3.60976
0.500000
3.80488
0.500000
4.00000
0.500000
1.08 1.0
0
-0.15
-0.15
70.26
149
1 -45.0
83 -45.0
42 -45.0
o
0.0
0.0
The last set of data consists of npoin lines of initial temperatures which
are all the same therefore only two lines are shown.
ILIIR ..
ITRAI"
ICOIV"
IAXSY"
IPET1l"
ALPHA =1.000
STIllE =0.000
DTIIIE =0.100
lITER =
TOLER =0.01
RELAX =1.000
IITUP =
IITDI =
DTIIAX =0.100
FACTR =2.000
IllATa ..
IIPEL -
IELEII" 20
ELEIIEIT,
1
IIATERIAL,
1
39
lODE IUllBERS
40
41
82
123
122
121
80
81
84
83
42
43
X
0.000
44
85
Y
0.000
4.000
0.500
FIXED TEIIPR
-45.0000
-45.0000
-45.0000
150
IIITIAL TERPERATURE
1
5
9
13
17
21
26
29
33
37
41
46
49
63
57
61
65
69
73
77
81
85
89
93
97
101
106
109
113
117
121
-46.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
O.OCIOO
O.OCIOO
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
2
0.0000
3
0.0000
4
0.0000
8
6
0.0000
7
0.0000
11
0.0000
12
10
0.0000
16
14
0.0000
16
18
0.0000
19
0.0000
20
0.0000
24
22
0.0000
23
0.0000
28
26
0.0000 27
0.0000 32
30
0.0000 31
0.0000 36
34
0.0000 36
38
0.0000 39
0.0000 40
0.0000
42 -46.0000 43
44
46
0.0000
47
0.0000 48
0.0000
61
0.0000
52
50
0.0000
66
0.0000
66
64
68
0.0000
59
0.0000 60
0.0000 63:
0.0000 64
62
66
0.0000 67
0.0000 68
0.0000 71
0.0000 72
70
0.0000 76
0.0000 76
74
78
0.0000 79
0.0000 80
82
0.0000 83 -46.0000 84
0.0000 88
66
0.0000 87
0.0000 92
90
0.0000 91
94
0.0000 96
0.0000 96
98
0.0000 99
0.0000 100
0.0000 104
102
0.0000 103
0.0000 108
106
0.0000 107
0.0000 112
110
0.0000 111
0.0000 116
114
0.0000 116
118
0.0000 119
0.0000 120
0.0000
122
0.0000 123
4.000000000000003
STEP ..
47
OUTPUT OF TERPERATURE
1
6
9
13
17
21
26
29
33
37
41
45
49
53
57
61
66
69
73
77
81
85
89
93
97
101
-46.0000
-44.0947
-41.3576
-36.8062
-30.5100
-22.61.06
-13.4729
-0.1600
-0.1600
0.0166
0.0184
-44.4357
-42.1558
-38.0647
-32.1845
-24.6715
-16.8174
-5.8172
-0.1500
-0.15,00
0.0182
-44.7766
-42.9647
-39.3060
-33.8686
-26.7564
2
6
10
14
18
22
26
30
34
38
42
46
50
54
68
62
66
70
74
78
82
86
90
94
96
102
-44.8883
3
-43.6246
7
-40.3311
11
-36.3346 16
-28.6261
19
-20.3893
23
-10.9621
27
-0.1600 31
-0.1600 36
0.0171
39
-46.0000 43
-44.0947 47
-41.3575 51
-36.8062
56,.
-30.5100 69
-22.6106 63
-13.4729 67
-0.1500 71
-0.1600 76
0.0166 79
0.0184 63
-44.4367 87
-42.1568 91
-38.0647 96
-32.1846 99
-24.6715 103
4 -44.4357
-44.7766
8 -42.1568
-42.9647
-39.3060 12 -38.0647
16 -32.1845
-33.8686
20 -24.6716
-26.7664
-18.1977
24 -15.8174
28
-6.8172
-8.4869
-0.1600 32
-0.1600
-0.1600
-0.1600 36
0.0177
40
0.0182
-44.8883 44 -44.7766
-43.5246 48 -42.9647
62 -39.3060
-40.3311
-36.3346 66 -33.8686
-28.6251
60 -26.7654
-20.3893 64 -18.1977
-10.9621 68
-8.4869
-0.1600 72
-0.1600
-0.1500 76
-0.1500
0.0171
80
0.0177
-46.0000 84 -44.8683
-44.0947 86 -43.6246
-41.3675 92 -40.3311
-36.8062 96 -35.3346
-30.6100 100 -28.6251
-22.6106 104 -20.3893
-18.1977
-8.4859
-0.1600
-0.1500
0.0177
A. 7.2
106
110
114
118
122
-15.8174
-5.8172
-0.1500
-0.1500
0.0182
107
111
115
119
123
-13.4729
-0.1500
-0.1500
0.0166
0.0184
151
108
112
116
120
-10.9621
-0.1500
-0.1500
0.0171
This example has been used to show the effectiveness of the SUPG method
in Chapter 7. The problem details appear in Section 7.2.2 and Figure 7.3
of Chapter 7.
152
44 46 66 66
46 46 67 66 1
46 47 66 67 1
47 48 69 66 1
48 49 70 69 1
49 60 71 70 1
60 61 72 71 1
61 62 73 72 1
62 63 74 73
63 64 76 74
64 66 76 76 1
66 66 77 76 1
66 67 78 77
67 68 79 78 1
68 69 80 79 1
69 60 81 80 1
60 61 82 81 1
61 62 83 82 1
62 63 84 83 1
64 66 86 86
66 86 87 86 1
86 67 88 87 1
67 68 89 88 1
88 69 90 89 1
69 70 91 90
70 71 92 91
71 72 93 92
72 73 94 93
73 74 96 94 1
74 76 96 96 1
76 76 97 96 1
76 77 98 97
77 78 99 98
78 79 100 99 1
79 80 101 100 1
80 81 102 101
81 82 103 102
82 83 104 103 1
83 84 106 104 1
86 86 107 106 1
86 87 108 107 1
87 88 109 108 1
88 89 110 109 1
89 90 111 110 1
90 91 112 111 1
91 92 113 112 1
92 93 114 113 1
93 94 116 114 1
94 96 116 116 1
96 96 117 116 1
96 97 118 117 1
97 98 119 118 1
98 99 120 119 1
99 100 121 120 1
100 101 122 121 1
101 102 123 122 1
102 103 124 123 1
103 104 126 124 1
104 106 126 125 1
106 107 128 127 1
107 108 129 128 1
108 109 130 129 1
109 110 131 130 1
110 111 132 131 1
111 112 133 132 1
112 113 134 133 1
113 114 135 134 1
116
116
117
118
119
120
121
122
123
124
126
126
128
129
130
131
132
133
134
136
136
137
138
139
140
141
142
143
144
146
146
147
149
160
161
162
153
164
166
166
167
158
169
160
161
162
163
164
166
166
167
166
170
171
172
173
174
176
176
177
178
179
180
181
182
183
184
136
137
138
139
140
141
142
143
144
146
146
147
149
160
151
162
163
164
166
166
167
168
169
160
161
162
163
164
166
166
167
168
170
171
172
173
174
175
176
177
178
179
180
181
182
163
164
186
186
187
188
189
191
192
193
194
196
196
197
198
199
200
201
202
203
204
206
136
136
137
138
139
140
141
142
143
144
146
146
148
149
160
161
162
163
164
165
166
167
168
169
160
161
162
163
164
166
166
167
169
170
171
172
173
174
176
176
177
178
179
160
181
182
163
164
186
166
187
188
190
191
192
193
194
196
196
197
198
199
200
201
202
203
204
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
153
154
184
185
186
187
188
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
232
233
234
235
236
237
236
239
240
241
242
243
244
245
246
247
248
249
250
251
253
254
185
186
187
188
189
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
254
255
206
207
208
209
210
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
233
234
235
236
237
236
239
240
241
242
243
244
245
246
247
248
249
250
251
252
254
255
266
267
268
269
260
261
262
263
264
265
266
267
21;8
21;9
270
271
2jr 2
273
275
276
205
206
207
208
209
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230 1
232 1
233 1
234
235
236
237
238
239
240
241
242 1
243
244
245
246
247
248
249
250
251 1
253 1
254 1
256
256
257
258 1
259 1
260
261
262
263
264
265
266
267
268 1
269
270
271
272 1
274
275
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
317
318
319
320
321
322
323
324
325
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
338
339
340
341
342
343
344
345
346
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
337
338
339
340
341
342
343
344
345
1
1
1
1
1
155
156
325
326
327
328
329
330
331
332
333
326
327
328
329
330
331
332
333
334
334 335
335 336
337 336
338 339
339 340
340 341
341 342
342 343
343
344
344 345
345 348
348 347
347 348
348 349
349 350
350 351
351 352
362 353
353 354
354 355
355 356
356 357
358 359
359 360
360 361
361 362
362 363
363 364
364 365
365 366
366 367
367 366
366 369
369 370
370 371
371 372
372 373
373 374
374 375
375 376
376 377
377 378
379 360
360 381
381 382
382 363
383 364
384 385
385 366
386 387
387 388
366 389
389 390
390 391
391 392
392 393
393 394
394 395
347 346
347
349 348
360 349
361 350
362 351
353 352
354 353
355 354
366 355
367 356
359 358
360 359
361 360
382 361
363 362
364 363
365 364
366 365
367 366
366 367
369 368
370 369
371 370
372 371
373 372
374 373
375 374
376 375
377 376
378 377
360 379
381 380
382 381
363 382
384 383
385 384
366 385
387 366
366 387
389 366
390 389
391 390
392 391
393 392
394 393
395. 394
396 395
397 396
398 397
399 398
401 400
402 401
403 402
404 403
405 404
406 405
407 406
406 407
409 408
410 409
411 410
412 411
413 412
414 413
415 414
416 415
348
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
405
406
407
408
409
410
411
412
413
414
416
416
417
418
419
396
397
398
399
401
402
403
404
406
406
407
408
409
410
411
412
413
414
415
416
417
418
41~
420
o. o.
417
418
419
420
422
423
424
426
426
427
428
429
430
431
432
433
434
435
436
437
438
439
416
417 1
418 1
419 1
421
422 1
423
424
425
426
427
428
429 1
430
431
432
433
434
436 1
436 1
437 1
438 1
440 439
441 440
6.00000E-02 o.
1.00000E-01 o.
0.160000 o.
0.200000 o.
0.250000 o.
0.300000 o.
0.350000 o.
0.400000 o.
0.450000 o.
0.500000 o.
0.550000 o.
0.600000 o.
0.650000 o.
0.700000 o.
0.760000 o.
0.800000 o.
0.850000 o.
0.900000 o.
0.960000 o.
1.00000 o.
o.
6.00000E-02
6.00000E-02
5.00000E-02
1.00000E-01
5.00000E-02
0.160000
5.00000E-02
0.200000
6.00000E-02
0.250000
5.00000E-02
0.300000
5.00000E-02
0.350000
5.00000E-02
0.400000
5.00000E-02
0.450000
5.00000E-02
5.00000E-02
0.500000
0.550000
5.00000E-02
5.00000E-02
0.600000
5.00000E-02
0.650000
0.700000
5.00000E-02
5.00000E-02
0.750000
6.OOOOOE-02
0.800000
5.00000E-02
0.850000
5.00000E-02
0.900000
0.950000
5.00000E-02
5.00000E-02
1.00000
1.00000E-01
o.
157
158
5.oooooE-02
1.oooo0E-01
1 .00000E-01
1.00oo0E-01
0.150000
1.0ooo0E-01
0.200000
1.00oo0E-01
1.oooooE-01
0.250000
1.oooo0E-01
0.300000
0.350000
1.oooo0E-01
0.400000
1.0oo00E-01
0.450000
1.000ooE-01
0.500000
1.0oo00E-01
0.550000
1.0oo00E-01
0.600000
1.00oo0E-01
1.00oo0E-01
0.650000
0.700000
1.00oooE-01
0.750000
1 .00000E-01
1 .OOOOOE-Ol
0.800000
0.850000
1.oooo0E-01
0.900000
1.00oo0E-01
0.950000
1.00oo0E-01
1.00000
1.0ooo0E-01
O.
0.150000
5.ooo00E-02
0.150000
0.150000
1 .OOOOOE-'Ol
0.150000
0.150000
0.200000
0.150000
0.250000
0.160000
0.300000
0.150000
0.350000
0.150000
0.400000
0.150000
0.450000
0.160000
0.600000
0.150000
0.560000
0.150000
0.600000
0.150000
0.650000
0.150000
0.150000
0.700000
0.750000
0.150000
0.800000
0.150000
0.850000
0.150000
0.900000
0.160000
0.960000
0.160000
1.00000
0.150000
O.
0.200000
5.oo0ooE-02 0.200000
1.oooo0E-01
0.200000
0.150000
0.200000
0.200000
0.200000
0.260000
0.200000
0.300000
0.200000
0.350000
0.200000
0.400000
0.200000
0.450000
0.200000
0.500000
0.200000
0.650000
0.200000
0.600000
0.200000
0.650000
0.200000
0.700000
0.200000
0.750000
0.200000
0.800000
0.200000
0.860000
0.200000
0.900000
0.200000
0.950000
0.200000
1.00000
0.200000
O.
0.250000
5.00000E-02
0.250000
1.oo000E-01
0.250000
0.150000
0.250000
0.200000
0.250000
159
160
0.450000 0.400000
0.600000 0.400000
0.550000 0.400000
0.600000 0.400000
0.650000 0.400000
0.700000 0.400000
0.750000 0.400000
0.800000 0.400000
0.850000 0.400000
0.900000 0.400000
0.950000 0.400000
1.00000 0.400000
O.
0.450000
5.00000E-02 0.450000
1.00000E-01 0.450000
0.150000 0.450000
0.200000 0.450000
0.250000 0.450000
0.300000 0.450000
0.350000 0.450000
0.400000 0.450000
0.450000 0.450000
0.500000 0.450000
0.550000 0.450000
0.600000 0.450000
0.650000 0.450000
0.700000 0.450000
0.750000 0.450000
0.800000 0.450000
0.850000 0.~50000
0.900000 0.450000
0.950000 0.460000
1.00000 0.460000
o. 0.500000
5.00000E-02 0.500000
1.000001:-01 0.500000
0.150000 0.500000
0.200000 0.500000
0.250000 0.500000
0.300000 0.500000
0.360000 0.500000
0.400000 0.500000
0.450000 0.500000
0.500000 0.500000
0.550000 0.500000
0.600000 0.500000
0.650000 0.500000
0.700000 0.500000
0.750000 0.500000
0.800000 0.500000
0.850000 0.500000
0.900000 0.500000
0.960000 0.500000
1.00000 0.500000
O.
0.550000
5.00000E-02 0.550000
1.00000E-01 0.550000
0.160000 0.550000
0.200000 0.560000
0.260000 0.560000
0.300000 0.550000
0.350000 0.560000
0.400000 0.560000
0.450000 0.560000
0.500000 0.550000
0.550000 0.550000
0.800000 0.550000
161
162
0.850000
0.700000
0.900000
0.700000
0.950000
0.700000
1.00000
0.700000
O.
0.750000
5.ooo00E-02
0.750000
1.oooooE-01
0.750000
0.150000
0.750000
0.200000
0.750000
0.250000
0.750000
0.300000
0.750000
0.350000
0.750000
0.400000
0.750000
0.450000
0.750000
0.500000
0.750000
0.550000
0.750000
0.600000
0.750000
0.650000
0.760000
0.700000
0.750000
0.750000
0.750000
0.800000
0.750000
0.850000
0.750000
0.900000
0.750000
o . 950000
0 . 750000
1.00000
0.750000
O.
0.800000
5 .00000E-02
0.800000
1 .00000E-01
0.800000
0.160000
0.800000
0.200000
0.800000
0.260000
0,800000
o . 300000
0 . 800000
0.350000
0.800000
0.400000
0.800000
0.460000
0.800000
0.600000
0 . 800000
0.550000
0.800000
0.600000
0.800000
0.650000
0.800000
o .700000
0 . 800000
0.750000
0.800000
0.800000
0.800000
0.850000
0.800000
0.900000
0.800000
0.950000
0.800000
1 .00000
0.800000
O.
0.850000
5.00000E-02
0.850000
1.0ooo0E-01
0.850000
0.150000
0.850000
0.200000
0.860000
0.250000
0.850000
0;850000
0.300000
0.350000
0.860000
0.400000
0.850000
0.450000
0.850000
0.500000
0.860000
0.660000
0.860000
0.800000
0.850000
0.650000
0.860000
0.700000
0.850000
0.750000
0.850000
0.800000
0.850000
0.850000
0.850000
0.900000
0.850000
0.950000
0.850000
1.00000
0.850000
0.900000
6.00000E-02
0.900000
1.00000E-01
0.900000
0.160000
0.900000
0.200000
0.900000
0.260000
0.900000
0.300000
0.900000
0.360000
0.900000
0.400000
0.900000
0.450000
0.900000
0.500000
0.900000
0.650000
0.900000
0.900000
0.600000
0.660000
0.900000
0.700000
0.900000
0.750000
0.900000
0.800000
0.900000
0.860000
0.900000
0.900000
0.900000
0.960000
0.900000
1.00000 0.900000
O.
0.960000
5.00000E-02
0.960000
1.00000E-01
0.950000
0.160000
0.960000
0.200000
0.960000
0.250000
0.950000
0.300000
0.960000
0.360000
0.960000
0.960000
0.400000
0.450000
0.960000
0.500000
0.960000
0.960000
0.560000
0.600000
0.960000
0.650000
0.960000
0.700000
0.950000
0.750000
0.960000
0.800000
0.960000
0.850000
0.950000
0.900000
0.960000
0.9&0000
0.950000
1.00000 0.9&0000
O.
1.00000
5.00000E-02
1.00000
1.00000E-01
1.00000
0.160000
1.00000
0.200000
1.00000
0.250000
1.00000
0.300000
1.00000
0.360000
1.00000
0.400000
1.00000
0.460000
1.00000
0.500000
1.00000
0.560000
1.00000
0.600000
1.00000
0.650000
1.00000
0.700000
1.00000
0.760000
1.00000
0.800000
1.00000
0.850000
1.00000
0.900000
1.00000
0.950000
1.00000
1.00000
1.00000
1.0d-6 1.0
41
1.0
1
2
1.0
163
164
3
1.0
4
1.0
5
1.0
1.0
6
7
1.0
1.0
8
1.10
9
10
1.0
1.0
11
1.0
12
13
1.0
1.0
14
1.0
15
1.0
16
17
1.0
18
1.0
19
1.0
20
1.0
21
1.0
1.0
22
1.0
43
1.0
64
1.0
85
106
1.0
127
0.0
0.0
148
0.0
169
190
0.0
0.0
211
232
0.0
253
0.0
274
0.0
295
0.0
0.0
316
337
0.0
358
0.0
379
0.0
0.0
400
421
0.0
0
0
0.8660254 0.5
0.8660254
0.5
The last set of data consists of npoin lines of velocities (u and v), which
are all the same therefore only two lines are shown.
ITRAI'"
IUSY"
IeOl' ..
IPETR ..
IELE!!" 400
IPOII .. 441
IIIATIL ..
ILID'"
IIPEL"
ELEIIDT
1
IIATEIlIlL.
1
lODE JUllBEIlS
23
22
1
1
0.000
440
0.000
1.000
1.000
0.000
lODE
FIlED TEllPR
1
2
3
4
5
6
7
8
9
10
11
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
12
13
14
15
16
17
18
19
20
21
22
43
64
85
106
127
148
169
190
211
232
253
274
295
316
337
358
379
400
421
1.000
0.8660
0.5000
165
166
441
0.8660
0.6000
1. 0000
1.0000
1.0000
1.0000
1.0000
1.0000
0.9997
1.0003
1.0CIOl
1.0000
1.0000
1.0008
0.9984
1.0002
1.0001
1.0000
0.9985
1.0061
0.9986
1.0003
1.0000
1.0000
0.97'96
1.0Cl62
0.9987
1.0004
0.9999
1.0E;93
0.9860
1.OC'41
0.9989
1.OC104
0.8686
1.0~~70
0.9919
1.0025
0.9992
o .OCIOl
1.0300
0.9997
0.9984
1.OClO9
0.0(100
0.37'29
1.0794
0.9f157
1.OCl24
0.9~196
-0.0410
0.7166
1.0660
0.9f142
1.0038
0.0007
0.0849
0.9439
1.0:-106
0.9897
0.0002
-0.0,166
2
6
10
14
18
22
26
30
34
38
42
46
50
64
68
62
66
70
74
78
82
86
90
94
98
102
106
110
114
118
122
126
130
134
138
142
146
150
164
168
162
166
170
174
178
182
186
1910
194
198
202
206
210
214
218
222
226
230
234
238
1. 0000
1.0000
1.0000
1.0000
1.0000
1.0000
0.9997
1.0003
1.0000
1.0000
1.0000
1.0005
0.9986
1.0004
1.0000
1.0000
1.0005
1.0042
0.9987
1.0004
0.9999
0.9915
0.9901
1.0033
0.9989
1.0004
1.0000
1.0136
0.9946
1.0019
0.9994
1.0003
1.0405
0.9949
0.9998
1.0006
0.9998
0.2606
1.0831
0.9841
1.0031
0.9994
-0.0219
0.661q
1.0676
0.9838
1.0039
0.0000
0.0262
0.9198
1.0323
0.9897
1.0031
-0.0186
0.2822
1.0450
1.0026
0.9966
0.0027
-0.0433
3
7
11
16
19
23
27
31
35
39
43
47
61
55
59
63
67
71
76
79
83
87
91
96
99
103
107
111
116
119
123
127
131
136
139
143
147
151
165
169
163
167
171
176
179
183
187
191
196
199
203
207
211
215
219
223
227
231
236
239
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
0.9999
1.0003
1.0000
1.0000
1.0000
0.9997
0.9991
1.0004
0.9999
1.0000
1.0039
1.0016
0.9992
1.0003
0.9999
0.9778
0.9994
1.0009
0.9996
1.0002
1.1024
0.9861
1.0019
0.9999
0.9999
0.0000
1.0906
0.9817
1.0039
0.9992
1.0002
0.6950
1.0694
0.9836
1.0041
0.9989
-0.0268
0.8943
1.0330
0.9899
1.0030
-0.0011
0.2036
1.0381
1.0028
0.9989
0.0000
-0.0431
0.6285
1.0760
0.9873
1.0018
0.0030
0.0101
4
8
12
16
20
24
28
32
36
40
44
48
62
66
60
64
68
72
76
80
84
88
92
96
100
104
108
112
116
120
124
128
132
136
140
144
148
162
156
160
164
168
172
176
180
184
188
192
196
200
204
208
212
216
220
224
228
232
236
240
1.0000
1.0000
1.0000
1.0000
1.0000
0.9999
1.0001
1.0002
0.9999
1.0000
1.0006
0.9988
0.9997
1.0002
0.9999
1.0000
1.0062
0.9996
0.9998
1.0002
0.9999
0.9736
1.0044
0.9993
1.0001
1.0001
1.1031
0.9792
1.0047
0.9989
1.0003
0.6056
1.0689
0.9836
1.0042
0.9989
0.0000
0.8700
1.0319
0.9906
1.0028
0.9992
0.1138
1.0322
1.0020
0.9974
1.0011
-0.0239
0.4671
1.0774
0.9868
1.0020
0.0019
-0.0230
0.7660
1.0619
0.9847
0.0000
-0.0109
0.1466
167
0.3542
1.0616
1.0019
0.0000
0.0046
-0.0303
0.6482
1.0732
0.9874
-0.0001
-0.0162
0.0979
0.8806
1.0514
0.0000
0.0046
-0.0460
0.3301
1.0173
0.0000
-0.0006
0.0004
-0.0229
0.5967
0.0000
0.0000
0.0024
-0.0258
0.0976
0.8236
0.0000
-0.0006
0.0067
-0.0483
0.3061
0.0000
0.0001
0.0003
-0.0052
-0.0192
0.0000
0.0000
-0.0004
0.0046
-0.0319
0.0000
0.0000
0.0001
-0.0008
0.0044
-0.0423
242
246
250
264
258
262
266
270
274
278
282
286
290
294
298
302
306
310
314
318
322
326
330
334
338
342
346
360
364
358
362
366
370
374
378
382
386
390
394
398
402
406
410
414
418
422
426
430
434
438
0.6915
1.0747
0.9876
-0.0002
-0.0039
0.0614
0.8463
1.0660
0.0000
0.0022
-0.0386
0.2699
1.0026
1.0229
-0.0004
0.0043
-0.0381
0.5419
1.0664
0.0000
0.0006
-0.0167
0.0677
0.7888
0.0000
-0.0003
0.0063
-0.0448
0.2526
0.0000
0.0001
-0.0005
0.0005
-0.0346
0.4970
0.0000
-0.0001
0.0029
-0.0232
0.0676
0.0000
0.0000
-0.0008
0.0068
-0.0472
0.0000
0.0000
0.0001
0.0006
-0.0049
243
247
261
265
269
263
267
271
275
279
283
287
291
295
299
303
307
311
315
319
323
327
331
336
339
343
347
351
365
369
363
367
371
375
379
383
387
391
395
399
403
407
411
415
419
423
427
431
436
439
0.8060
1.0686
0.9851
0.0001
-0.0260
0.2086
0.9856
1.0256
0.0000
0.0050
-0.0460
0.4834
1.0620
0.0000
-0.0004
-0.0061
0.0222
0.7464
1.0691
0.0000
0.0036
-0.0376
0.1996
0.9371
0.0000
-0.0007
0.0042
-0.0440
0.4458
0.0000
0.0001
0.0012
-0.0144
0.0264
0.0000
0.0000
-0.0005
0.0066
-0.0424
0.1886
0 .0000
0.0001
-0.0004
0.0010
-0.0404
0.0000
0.0000
-0.0002
0 . 0036
-0.0224
244
248
262
266
260
264
268
272
276
280
284
288
292
296
300
304
308
312
316
320
324
328
332
336
340
344
348
362
356
360
364
368
372
376
380
384
388
392
396
400
404
408
412
416
420
424
428
432
436
440
0.9669
1.0283
0.9899
0.0027
-0.0468
0.4210
1.0673
1.0008
-0.0003
0.0013
-0.0077
0.6996
1.0712
0.0000
0.0014
-0.0272
0.1476
0.9109
0.0000
-0.0004
0.0055
-0.0479
0.3888
1.0283
0.0001
-0.0001
-0.0062
-0.0015
0.6472
0.0000
-0.0002
0.0043
-0.0350
0.1409
0.0000
0.0001
-0.0007
0.0043
-0.0475
0.0000
0.0000
0.0000
0.0016
-0.0124
0.0043
0.0000
0.0000
-0.0007
0.0060
-0.0419
168
References
[1] C.Taylor and T.G.Hughes. Finite Element Programming of the NavierStokes Equations. Pineridge Press, Swansea, U.K., 1981.
[2] W.Weaver Jr. and P.R.Johnston. Finite Elements for Structural Analysis. Prentice-Hall, Englewood Cliffs, 1984.
[3] H.S.Carslaw and J.C.Jaeger. Conduction of Heat in Solids. Clarendon
Press, Oxford, 1959.
Appendix B
Software Description for
HADAPT
B.I
Introduction
In this appendix a detailed description of the program HADAPT is presented with complete instructions for the user. This program allows a user
to perform adaptive heat transfer analysis for 2-D plane or axisymmetric
problems. The program uses three types of elements, i.e., 3 and 4-noded
linear and 6-noded quadratic elements.
B.2
A brief description of the main variables and arrays and the main subroutines is listed in the following sections.
B.2.1
170
B.2.2
B.2.3
171
Variable name
ambip(mcdpt)
Description
Values of ambient temperature to be used
for Neumann BC's (nobcn number)
Values of convective heat transfer coefficient to
coefp(mcdpt)
be used for Neumann BC's (nobcn number)
coorO( mpoin,mdime) Nodal coordinates for the previous mesh
darep(mele3)
Auxilliary array used in subroutine TRANSF
ehnew( mpoin)
Predicted element sizes around nodal points
Previous element sizes
ehold( melem)
emass( mnpel,mnpel) Mass matrix of elements
erelm(melem)
Relative norm errors in each element
ernor(melem)
Square of norm errors in each element
fluxp(mcdpt)
Values of heat flux to be used for Neumann
BC's (nobcn number)
icont(mpoin)
Auxilliary array used in subroutine ERREST
itemp(mpoin)
Auxilliary array used in subroutine TOMESH
Inod3(mele3)
Auxilliary array used in subroutine TRANSF
nbeln(mbpln)
Number of elements on each boundary segment
with one face (edge) on an external boundary
nbctm(mbpln)
Array specifying the Dirichlet BC's on each
boundary segment
nbctm(mbpln)
Array specifying the Neumann BC's on each
boundary segment
nbele( mbpln,mpnod) Element number of each element on each
boundary segment
nbelt(mbpln,mpnod) Auxilliary array for nbele
nbelf( mbpln,mpnod) Face number of the external face of each
element on each boundary segment
nbpoi( mbpln)
Number of nodes on each boundary segment
nbref( mbpln,mpnod) Node number of each node on each boundary
segment
nbret( mbpln,mpnod) Auxilliary array for nbref
nconO( melem,mnpel) Element nodal connectivities for the previous
mesh
newel(melem)
Array used in front optimization after mesh
generation
newno( mpoin)
Array used in profile optimization after mesh
generation
permi( melem)
Calculated element sizes (nobcn number)
radip(mcdpt)
Values of radiation coefficient to be used
for Neumann BC's
sgrdx( melem,mgaus) Smoothed values of dT / dx at Gaussian points
sgrdy( melem,mgaus) Smoothed values of dT / dy at Gaussian points
172
Variable name
smoth(mpoin)
Destription
Smoothed values of temperature gradients
at nodal points
Heat flow dissipation in each element
tener( melem)
tgrdx( melem,mgaus) Temperature gradients (dTJdx) at Gaussian
points
tgrdy( melem,mgaus) Temperatqre gradients (dTJdy) at Gaussian
points
Values of fixed temperatures to be applied
tembc( mcdpt)
as Dirichlet BC's (nobcd number)
The temperature value to be used as initial
temin(mmatr)
condition for all the nodes in each material
Auxilliary array used in subroutine TRANSF
tempa( mpoin)
Auxilliary array used in subroutine TRANSF
tempb( mpoin)
Auxilliary array used in subroutine TRANSF
tempc(mpoin)
Auxilliaryarray used in subroutine TRANSF
tempd( mpoin)
The X-component of velocity to be used
uvelm( mmatr)
for convection for all the nodes in each material
The V-component of velocity to be used
vvelm(mmatr)
for convection for all the nodes in each material
X-coordinates of all nodes transferred to the
xdens(mpoin)
mesh generator for locating density points
ydens(mpoin)
Y-coordinates of all nodes transferred to the
mesh generator for locating density points
B.2.4
Subroutine Description
CONTRL
Reads control data for the problem
Reads the geometry data, generates and optimizes the
MESH2D
mesh
INDATA
Reads the problem data regarding material, boundary,
and initial conditions
TOMESH
Transfers all problem data to the appropriate nodes and
elements of the mesh
ERREST
Performs error estimation calculations
TRANSF
Transfers all necessary information from the old mesh to
the new mesh
B.3
173
Program Overview
The main routine is listed in the following lines, the program structure
with all the subroutines is shown in Figure B.lo
PRDGRAII HADAPT
ADPT
ADPT
C_______________________________________________________________________
C THIS PRDGRAII PERFDRIIS H-ADAPTIVE 2-D FEll HEAT TRAISFER AlALYSIS. IT ADPT
C I1CLUDES AI AUTDIIATIC IIESH GEIERATDR, IIEHS2D FDR GEIERATIIG TRIAIGULARADPT
C (3 t 6 IDDED ELEIIEITS) AID QUADRILATERAL (4 IDDED) ELEllEITS.
ADPT
A S USIIAIl AID H C KUAiG DCT 1993 ADPT
C
ADPT
C_______________________________________________________________________
C
PARAIIETER (IIELEII=4999,IIPDII=4999,IIIPEL=9,IIIIATR=2,IIBDUI=999,
IICDPT=10,IIDllIE=2,IIGAUS=9,IIPRDF=199999,IIDElS=IIPDII,
IIFRDI=l99 ,IIBPLI=49 ,IIPIDD=l99 ,1IELE3=IIELEII.4)
IIIPLICIT REAL.8(A-H,D-Z)
DIIIElSIDIIITYPE(IIELEII),ICDIC(IIELEII,IIIPEL),CDDRD(IIPDII,lIDllIE),
CDIDY(IIIIATR),CAPCY(IIIIATR),FIlED (IIBOUI),IFIXD(IIBDUI),
IFACB(IIBDUI),IELIIB(IIBDUI) ,FLUIE(IIBOUI) ,
CDEFF(IIBDUI),RADIA(IIBDUI) ,AIIBIT(IIBOUI) ,
TEIIPR(IIPDII),CDVLU(IICDPT,IIIIATR),CPVLU(IICDPT,IIIIATR),
TVALU(IICDPT,III1ATR)
DIIIEISIDI SHAPF(IIIPEL,IIGAUS,IIELEII),DERV1(IIIPEL,IIGAUS,IIELEII),
DERV2(IIIPEL,IIGAUS,IIELEII),ARVET(IIGAUS,IIELEII),
VEIGB(IIGAUS),PDSGB(IIGAUS) ,VEIGP(IIGAUS) ,PDSGI(IIGAUS) ,
PDSGY(IIGAUS)
DIIIEISIDIIDFEL(IIIPEL),ASTIF(IIIPEL,IIIPEL),AllASS(IIIPEL,IIIPEL),
ICDLII(IIPDII),IFFII(IIPDII) ,TFIID(IIPDII) ,TEIIPT(IIIPEL) ,
TEIIP1(IIIPEL,IIIPEL) ,RVECT(IIIPEL),IBELII(IIELEII,4) ,
ICDRD(IIIPEL),YCDRD(IIIPEL),EFDRC(IIIPEL)
DIIIElSIDI GSTIF(IIPRDF),IDIAG(IIPDII) ,FDRCE(IIPDII) ,TLAST(IIPDII)
DIIIElSIDI TElER(IIELEII),TGRDI(IIELEII,IIGAUS),TGRDY(IIELEII,IIGAUS),
ERHS1(IIELEII,IIIPEL),ERHS2(IIELEII,IIIPEL),IIDIAG(IIPDII),
ERlDR(IIELEII),SGRDI(IIELEII,IIGAUS),SGRDY(IIELE11,IIGAUS),
ERELII(IIELEII) ,SIIDTH(IIPDII) ,PERIII(IIELE11) ,EHDLD(IIELE11) ,
EHIEV(IIDEIS),IDElS(IIDEIS),YDEIS(IIDElS),ICDIT(IIPDII)
DIIIElSIDI UVELO(IIPDII),VVELD(IIPOII) ,PETRV(IIELE11) ,ULDCA(IIIPEL) ,
YLDCA(IIIPEL),IDEST(IIIPEL) ,LDCEL(IIIPEL) ,LHEDY(IIFRDI) ,
IADFII(IIPDII),IDDFII(IIPDII),LIDDS(IIELEII,IIIPEL),
PIDRII(IIFRDI),GFLUII(IIFRDI,IIFRDI)
DIIIEISIDIIBCTII(IIBPLI),IBCFL(IIBPLI),TEIIBC(IICDPT),FLUIP(IICDPT),
CDEFP(IICDPT),RADIP(IICDPT),AIIBIP(IICDPT),TEIIII(III1ATR),
UVELII(III1ATR),VVELII(IIIIATR)
DIIIEISIDI IBPDI(IIBPLI),IBREF(IIBPLI,IIPIDD),IBELI(IIBPLI),
IBELF(IIBPLI,IIPIDD) ,IBELE(IIBPLI,IIPIDD) ,ITEIIP(IIPDII) ,
IBRET(IIBPLI,IIPIDD) ,IBELT(IIBPLI,IIPIDD) ,lEVEL (IIELEII) ,
IEVID(IIPDII)
DIIIElSIDI LIDD3(IIELE3,3),ICDI0(IIELEII,IIIPEL),CDDRO(IIPDII,IIDllIE),
DAREP(IIELE3),TEIIPA(IIPDII)
C
C... DPEI CHAIIELS FDR READIIG AID VRITIIG
C
DPEI (UlIT=12,STATUS='DLD',FlLE='ADPIIP.DAT')
DPEI (UlIT=7,STATUS='IEV',FILE='ADPOUT.RES')
C
DPEI(UlIT=ll,STATUS='DLD',FILE='GEDIIET.DAT')
DPEI(UlIT=14,STATUS='DLD',FlLE='DElSIT.DAT')
DPEI(UlIT=13,STATUS='UlIIDVI',FlLE='GElERR.LDG')
C
C... READ CDITRDL DATA
C
ISTEF--a
IFRIT=O
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
174
C
C
C
C
C...
C
888
C
C
C...
C...
C
311
C
175
176
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
ADPT
C
ADPT
C PERFORR STEADY STATE AIALYSIS
ADPT
C
(RELER,RPOII,RGAUS,RlPEL,RCDPT,RRATR,RTYPE,
CALL STEADY
ADPT
RDIRE,RBOUJ,RPROF,RFRDI,IAXSY,ILIJR,ITRAI,
ADPT
ICOIV,IPETR,IITER,IFIXB,TOLER,RELAX,
ADPT
IELER,IPOII,IGASB,IGAUS,IIPEL,
ADPT
IIPFC,IPROF,ICDPT,JDFEL,IFACB,IBELR,ICOIC,
ADPT
LIODS ,IDIAG ,IFFIX ,TFIXD ,TVALU ,COVLU, CPVLU ,
ADPT
COIDY,CAPCY,TERPT,SHAPF,DERY1,DERY2,ARVET,
ADPT
ASTIF,ARASS,PDSGB,VEIGB,GSTIF,XCORD,YCORD,
ADPT
EFORC,FORCE,FLUXE,COEFF,RADIA,AKBIT,TLAST,
ADPT
TERPR ,COORD ,UYELO ,VVELO ,ULOCA ,YLOCA ,PETRY ,
ADPT
IDEST,LOCEL,LHEDV,IADFR,IODFR,PIORK,GFLUR)
ADPT
C
ADPT
c COIDUCT ERROR ESTIRATIOI IF REQUIRED
ADPT
C
ADPT
tF(IERST.1E .0)
ADPT
-CALL ERREST
(RELER,RGAUS,RlPEL,RCDPT,RRATR,RPOII,IGAUS,
ADPT
IIPEL,ILIJR,ICOAR,ICOPT,TYALU,CDVLU,SHAPF,
ADPT
DERV1,DERV2,IPOII,RPRDF,ARVET,KDIRE,COORD,
ADPT
RTYPE,COIDY,TERPR,ICOIC,IELER,GSTIF,IFFIX,
ADPT
FORCE, TUEll, TGRDX, TGRDY ,ERHS1,ERHS2,ERlOR,
ADPT
ERELR,SGRDX,SGRDY,SROTH,RDIAG,ICOLR,PERKI,
ADPT
EHOLD,EHIEW,ICOIT ,ERDOR,ERSRT ,ERKAX,IELRK,
ADPT
PCEIT)
ADPT
C
ADPT
C OUTPUT RESULTS
ADPT
C
ADPT
CALL OUTPUT
(RELER,RPOII,RRATR,RlPEL,IPOII,IELER,IIPEL,
ADPT
JRATR,IERST,ICOIC,RTYPE,TERPR,COORD,RDIRE,
ADPT
ERELK,ERDOR,ERSRT,EHIEW,ERKAX,IELRK,UYELO,
ADPT
VYELO , TIRE)
ADPT
C
ADPT
C IF REQUIRED ERROR lOT ATTAllED RERESH AID REAIALYSE
ADPT
C
ADPT
IF (ERSRT.LE.RCEIT) GOTO 999
ADPT
ITRAD-ITRAD+l
ADPT
IF (ITRAD.GT.IITRA) VRlTE(7,.)'RAX PERKITTED ADAPTIYE CYCLES OYER'ADPT
IF (ITRAD.GT.IITRA) GOTO 999
ADPT
DO I-l,IPOII
ADPT
EHIEW(I)=EHIEW(I).ARULT
ADPT
IF (EHIEV(I).GT.ELRAI) EHlEW(I)=ELRAX
ADPT
IF (EHIEV(I) .LT.ELRII) EHIEW(I)"ELRII
ADPT
UD DO
ADPT
DO I"l,IPOIl
ADPT
XDUS(I)=COORD(I,1>
ADPT
IDEIS(I)=C00RD(I,2)
ADPT
UD DO
ADPT
IDEIS=IPOIl
ADPT
C
ADPT
C TRAISFER OLD KESH lIFO TO SEPERATE ARRAYS
ADPT
C
ADPT
IELEO=IELER
ADPT
IPOIO=IPOIl
ADPT
DO I-l,IELER
ADPT
DO J=l.IIPEL
ADPT
ICOIO(I,J)=ICOIC(I,J)
ADPT
EID DD
ADPT
UD DO
ADPT
DO I=l,IPOII
ADPT
C
CALL SHAPEF
(RELER,RPOII,RDlKE,RlPEL,RGAUS,IELER,IPOII,
IIPEL,IGASB,IGAUS,ICOIC,COORD,VEIGB,POSGB,
VEIGP,POSGX,PDSGY,SHAPF,DERV1,DERV2,ARVET,
lAXSY)
IF (ITRAI.EQ.l) GOTO 100
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
168
189
190
191
192
193
177
REVI.D 11
IADAP.l
CALL HESH2D
IF (ILIIR.EQ.1>
-CALL TRAISF
GOTO 888
999 COITIJUE
STOP
(HPOI HELEK.KlPEL.KBPLI.KP.OD.KDIIIE.HDDS.
IADAP.IFRIT.IPOI IELEK.JlPEL.JKATR DDS.
.BPLBPOI.IBREF.IBELI.IBELF.IBELE CO.C.
HTYPE BELT.IBRET.IEVEL.IEV.O.COORD.XDDS,
YDDS.ER.EII)
(HPOI HELEH.KlPEL.KDIIIE.HELB3.ICO.V.ILIIR.
JPOI PEL POIO.IELEO CO.0.LlOD3.
COORO.COORD.TEKPR.DAREP.TEHPA)
100 CO.TIJUE
101 TIHE=TIIIE+DTIHE
.STEP..STEP+l
CALL ru.SI
(HELEH.HPOI HGAUS.KlPEL.HCDPT.HHATR.HTTPE.
HDIHE,HBOUJ.KPROF.HFROJ.IAXSY.ILI.R.ITU
ICO.V,IPETR ITER,IFIXB.TOLER.DTHAX.FACTR.
.ELEH POI GASB OAUS.JlPEL ITUP ITO
PFC PROF COPT.IDFEL.IFACB.IBELH CO.C.
L.ODS DIAO.IFFIX.TFIXD.TVALU.COVLU.CPVLU.
COIDY.CAPCY.TEKPT.SHAPF.DERV1.DERV2.ARIlET.
ASTIF,AHASS.POSGB.IlEIGB.GSTIF.XCORD.YCDRD.
EFORC.FORCE.FLUXE.COEFF.UDIA.AHBIT.TLAST,
TEHPR.COORD.UYELO.VVELO.ULOCA,VLOCA,PETRV,
.DEST.LOCEL.LHEDV ADFH,.ODFH.P.ORM,GFLUH,
.STEP.TTIHE.ALPHA.DTIIIE.TEHP1.RVECT)
IF(IEUT .IE.O)
-CALL ERREST
(HELEH.HGAUS.KlPEL.HCDPT.HHATR.KPDI.,.OAUS,
PEL.ILIIR.ICOAR COPT.TVALU.COVLU,SRAPF,
DERV1.DERV2 ,IPOII.KPROF .ARIIET ,KDIIIE .CDDRD.
HTYPE.CO.DY.TEHPR CD.C.IELEK.OSTIF.IFFIX.
FDRCE.TElER.TORDX.TOIDY,ERHS1,ERHS2,ERlOR,
ERELH.SORDX.SGRDY.SHDTR.KDIAG CDLH.PERHI.
EHDLD.EHlEIi.ICOIT.ERDDH.ERSRT.ERHAX.IELRH,
PCE.T)
ADPT 194
ADPT 195
ADPT 196
ADPT 197
ADPTl98
ADPT 199
ADPT 200
ADPT 201
ADPT 202
ADPT 203
ADPT 204
ADPT 205
ADPT 206
ADPT 207
ADPT 208
ADPT 209
ADPT 210
ADPT 211
ADPT 212
ADPT 213
ADPT 214
ADPT 215
ADPT 216
ADPT 217
ADPT 218
ADPT 219
ADPT 220
ADPT 221
ADPT 222
ADPT 223
ADPT 224
ADPT 225
ADPT 226
ADPT 227
ADPT 228
ADPT 229
ADPT230
ADPT 231
ADPT 232
ADPT233
ADPT 234
ADPT 235
ADPT 236
ADPT 237
ADPT238
ADPT 239
ADPT240
ADPT 241
ADPT 242
ADPT 243
ADPT 244
ADPT 245
ADPT 246
ADPT 247
ADPT 248
ADPT 249
ADPT 250
ADPT 251
ADPT 252
ADPT 253
ADPT 254
ADPT 255
ADPT 256
ADPT 257
ADPT 258
ADPT 259
ADPT260
178
IELEO=.ELEK
.POIOa.POli
DO I-1 ELEK
DO J a 1 PEL
.CO.O(I.J)-.CO.C(I.J)
nD DO
nD DO
DO 1-1 .IPOII
COORO(I.1)-COORD(I.1)
COORO(I.2)-COORD(I.2)
nD DO
REVI.D 11
IADAP=l
CALL KESH2D
(KPOII.KELEK OPEL .IIBPLI.KP.OD .KDIKE.KOnS.
IADAP.IFRIT.IPOI IELEK PEL "'TR DnS.
.BPLI BPOI.IBREF.IBELI BELF.IBELE CO.C.
KTYPE BELT.IBRET.IEVEL EVlO.COORD.lDnS.
YDnS.EH.EV)
CALL TRAiSF
(KPOI KELEK.KlPEL.KOINE.KELE3.ICO.Y.ILI.R.
.POI PEL.IPOIO.IELEO CO.0.L.OD3.
COORO.COORD.TEKPR.DAREP.TEKPA)
IF (TINE.OT.TTINE) STOP
OOTO 888
9999 COITIIUE
IF (TIKE.LT.TTIKE) OOTO 101
STOP
E.D
B.4
ADPT 261
ADPT 262
ADPT 263
ADPT 264
ADPT 265
ADPT266
ADPT 267
ADPT 268
ADPT 269
ADPT 270
ADPT 271
ADPT 272
ADPT 273
ADPT 274
ADPT 275
ADPT 276
ADPT 277
ADPT 278
ADPT 279
ADPT 280
ADPT 281
ADPT 282
ADPT 283
ADPT284
ADPT 285
ADPT 286
ADPT 287
ADPT 288
ADPT 289
ADPT 290
ADPT 291
ADPT 292
ADPT 293
ADPT 294
ADPT 295
ADPT 296
ADPT 297
ADPT 298
Input Instructions
The input data required by this program can be divided into two distinct groups. The first group consists of data required for generating the
mesh. This data is read from files GEOMET .DAT and DENSIT .DAT
in various subroutines of the subprogram MESH2D. The control data and
the material property and boundary condition data is read from file ADPINP.DAT in subroutines CONTRL and INDATA. The data required
for the first two files is explained first:
B.4.1
Geometry Data
In this section the data for the file GEOMET .DAT will be described.
This data will be used for generating the finite element mesh of 3,4 or
6-noded elements. The variables to be input are written in bold face in
bold brackets. All the variable names are as defined in the tables earlier.
179
1 Control data.
1.1 (nbnds,natrib,nnpe,toier)
2 Internal regions data (nbnds times).
2.1 (noseg)
2.2 Segment details (for i = 1 to noseg) to be input in a clockwise order. Straight line (ityp = 1) segments are defined by
two points. Any reference to the first point in a variable may
be inferred from a '1' included in that variable. For referencing subsequent points the same procedure is followed. For arc
segments (ityp = 2), a radius is required in addition to the
two points. The radii of the circular arc segments are negative for arcs in a clockwise direction and positive for arcs in a
counterclockwise direction. Direction is determined by moving
from point 1 to point 2. The third type, a user defined segment
(ityp = 3), can theoretically consist of any number of points.
2.2.1 (ityp)
2.2.2 For i = 1
2.2.2.1 (xl,yl,x2,y2) (if ityp = 1)
2.2.2.2 (xl,yl,x2,y2,rad) (if ityp = 2)
2.2.2.3 (numpt,xx(l),yy(l), .... ,xx(numpt),yy(numpt (if
ityp = 3)
2.2.2.4
2.2.3 For
2.2.3.1
2.2.3.2
2.2.3.3
(if ityp = 3)
= 4)
180
B.4.2
In this section the data for the file DENSIT .DAT will be described. This
is used to control the local element size (mesh density) for the first mesh
only. This data simply consists of a list of points with a mesh density value
attached to each point. Any number of such points may be defined by the
user to control the element sizes in various regions of the mesh. The data
is written as follows:
ndpt
xd(l),yd(l),vald(l)
xd(ndpt),yd(ndpt),vald(ndpt)
B.4.3
An arbitrary 2-D geometry shown in Figure B.2 will be used here to illustrate the preparation of data for the mesh generator as explained in the
previous section. Only the numbers printed in typescript are the ones to
be included in the datafiles.
7
10
-4.0
]J
-2.0
@
18
11
8
0.0
-LO
-0.0
14
20
11 -3.0
l2.0
lU
181
Geometry Data
1 Control data.
1
0.00001
3.0 4.0
2
-1.
1
6. 4. 6. 6.
1
182
O.
1
O.
1
3.
1
3.
1
5.
1
5.
1
6.
O.
O.
1.
1.
4.
O. 14. O.
6.
4. 2.
2.
For subdomain 4,
7
4
18
1
6. 4.
4
13
4
12
4
11
4
10
1
183
BAA
Output Data
The mesh that results from the example data in the previous section is
shown in Figure B.3. If the value of nnpe is changed to 4 in the data of
the previous section the result is a mesh of 4-noded quadrilateral elements
as shown in Figure B.4
BA.5
Problem Data
In this section the data for the file ADPINP.DAT will be described.
This data is read from the subroutines CONTRL and INDATA which
are listed below.
SUBROUTIIE COITRL (ITRAI,ILIIR,IAXSY,IERST,ICOIY,IPETR,IITER,
lITUP,lITDl,TTIRE,STIRE ,DTIRE,DTRAX ,ALPHA ,
RELAX, TOLER,PCEIT ,ELRII ,ELRAX ,FACTR)
c.....................................................................
C
C... THIS SUBROUTIIE READS ALL PROBLER DATA
COlT
COlT
COlT
2
3
COlT
COlT
5
6
COlT
184
COlT
COlT
COlT
COlT
COlT
COlT
C
C... READ AID WIlITE TITLE
COlT
COlT
C
COlT
READ(12.920) TITLE
VIlITE(7.,920) TITLE
COlT
920 FOIlRAT(12A6)
COlT
C
COlT
C... READ AID WIlITE COITILOL PARAMETERS
COlT
C
COlT
READ(12 ) ITIlAI.ILIIIl.IAXSY.IERST.ICOIV.IPETIL
COlT
WIlITE(7.901)ITRAI.ILIIIl.IAXSY.IEIlST.ICOIY.IPETIl
COlT
901 FOIlRAT(f/SH ITRAI =.I4.4X.SH ILIIIl =.I4.4I.SH IAXSY =.14.41.
COlT
.SH IEILST =.I4//SH ICOI' =.I4.4I.SH IPETIl =.14)
COlT
IF (ITIlAI.EQ.l) READ(12 ) TTIME.STIME.DTIRE.ALPHA
COlT
IF (ITIlAI.EQ.l) WIlITE(7.902)TTIRE.STIRE.DTIRE.ALPHA
COlT
902 FOIlRAT(//BH TTIME =.F5.3.3I.SH STIME =.F6.3.3I.
COlT
.SH DTIME -.F6.3.3I.SH ALPHA -.F6.3)
COlT
IF (ILIIIl.EQ.l) READ(12 ) lITEIl.TOLEIl.RELAX
COlT
IF (ILIIR.EQ.l) WRlTE(7.903) lITEIl.TOLEIl.RELAI
COlT
903 FOIlRAT (f ISH lITER 14 .41 SH TOLEIL F6 .3 .31
COlT
.SH RELAI =.F6.3)
COlT
IF (ILIIIl.EQ.l.AID.ITIlAI.Eq.l) READ(12 ) lITUP.IITDI.DTRAX.FACTIL COlT
IF (ILIIIl.EQ.l.AID.ITIlAI.Eq.1)WIlITE(7.906) lITUP.IITDI.DTRAI.FACTRCOIT
906 FOIlRAT(//BH lITUP -.I4.4I.SH IITDI =.I4.4X.SH DTMAI =.F6.3.3X.
COlT
.SH FACTIl =.F5.3)
COlT
COlT
IF (IEIlST.EQ.l) READ(12 ) PCUT.ELMII.ELRAX
COlT
IF (IEIlST.EQ.l) WIlITE(7.904) PCUT.ELMII.ELRAX
904 FOIlRAT(//SH PCEIT =.F5.3.3I.BH ELMII =.F5.3.3X.3X.SH ELMAX =.F6.3)COIT
RETUIlI
COlT
EID
COlT
9
10
11
12
13
14
15
16
17
lS
19
20
21
22
23
24
26
26
27
2S
29
3D
31
32
33
34
36
36
37
38
39
40
41
42
c.....................................................................
IMPLICIT REAL.S(A-H.O-Z)
DIMEISIOI TITLE(12)
PCDT=1.0DO
IITEIl=l
COlt
185
All the problem data regarding the material and boundary conditions
for the file ADPINP.DAT must be input as follows.
1 Control data (this item is read in subroutine CONTRL).
1.1 (title)
1.2 (itran,ilinr,iaxsy,ierst,iconv,ipetr)
1.3 (ttime,stime,dtime,alpha) (Only if itran=l)
1.4 (niter,toler,relax) (Only if ilinr=1)
1.5 (nitup,nitdn,dtmax,factr) (Only if ilinr=1 and itran=1)
1.6 (pcent,elmin,elmax) (Only if ierst=l)
2 Material properties (this and all subsequent items are read in subroutine INDATA)
2.1 (condy,capcy) nmatr times
2.2 (ncdpt) (Only if ilinr=l)
As HEAT2D if iphas=O '(next line), and itran=1 and ilinr=1
then this program will also expect an enthalpy curve to be input.
2.3 (cdvlu,cpvlu,tvalu) ncdpt times nmatr times
3 Dirichlet type boundary conditions
3.1 (nobcd)
3.2 (tembc) nobcd times
3.3 (num) (Only if nobcd:/=O)
3.4 (numb,numc) num times
Here if numc is positive then, the boundary condition is applied
to the all the nodes of segment numb. If however, numc is
negative, the boundary condition is applied only to the first
node of segment numb.
4 Neumann type boundary conditions
4.1 (nobcn)
4.2 (fluxp,coefp,radip,ambip) neumn times
4.3 (num) (Only if nobcn:/=O)
4.4 (numb,numc) num times Here if numc is positive then, the
boundary condition is applied to the all the elements of segment
numb. If however, numc is negative, the boundary condition is
applied only to the first element of segment numb.
186
5 Initial conditions
5.1 (temin) nmatr times (Only if itran=l or ilinr=l)
6 Velocity field
6.1 (uvelm,vvelm) nmatr times (Only if iconv=l)
B.5
EIRE
ERIE
ERIE
EIRE
ERIE
EIRE
ERIE
EIRE
c EIRE
c
EIRE
c SUBROUTIIE TO PERFORR ERROR ESTIRATIOI CALCULATIOIS
EIRE
C
ERIE
c EIRE
C
IISERT DOUBLE
EIRE
C
EIRE
IRPLICIT REAL.S(A-K,O-Z)
EIRE
DIKEISIOI SRlPF(RIPEL,RGAUS,RBLER),DERY1(NJPEL,RGAUS,RELEK),
ERIE
DERY2(RlPEL,RGAUS,RBLER) ,ARVBT(ROAUS.IlELER).
ERIE
CDYLU(RCDPT.RRATR),IDIAG(RPOII).ICOIC(RELEK.RlPEL).
ERIE
TYALU(RCDPT.RRATR),TERPR(RPOII).COORD(RPOII,RDIRE).
ERIE
RTYPE(RELER) .CDIDY(RRATR) GRASS (RPROF) ,IFFIX(RPDII).
EIRE
SKAPP(9),CARTP(2,9)
EIRE
DIREISIOI TElER(RELER).TORDX(RELER.RGAUS).TGRDY(RBLER.RGAUS).
EIRE
ERKS1(RELER.NJPEL).ERKS2(RELER.RIPEL).ICOLR(RPOII).
EIRE
ERlOR(RELER) .SGRDX(RELER.RGAUS) .SGRDY(RELEK,ROAUS).
EIRE
ERELR(RELER).FDRCE(RPOII).SRDTH(RPDII).
EIRE
PERRI(RBLER) .ERASS(9.9) .XE(3). YE(3) ,FX(9) .FY(9).
EIRE
EKOLD(RELER).EKIEV(RPOII).ICDIT(RPDII)
EIRE
DIREISIOIIJ4(3).IJ9(3)
ERIE
DATA IJ4/1.3.4/.IJ9/1.6.7/
ERIE
SIZEOooO.O
ERIE
C
ERIE
IF ELERBITS !LLOIlED TO BE COARSElED, ICOAR=l
EIRE
C
EIRE
C
ICOAR-l
EIRE
C
EIRE
C CALCULATE ELEREiT SIZES OF THE PRESEIT RESK
EIRE
C
EIRE
ESIZE-o.O
EIRE
IF(IIPEL.Eq.3.0R.IIPEL.Eq.6) THEI
EIRE
DO 1010 IEL"'l.1ELER
EIRE
DO 1016 JPE"'1.3
EIRE
JJ=JPE
ERIE
IF(IIPEL.EQ.6) JJ=JPE.2-1
EllIE
IP=ICOIC(IEL,JJ)
ERIE
XE(JPE)-COORD(IP.l)
ERIE
1016 YE(JPE)=CDDRD(IP.2)
ERIE
u-sqRT( (XE(2)-XE(1) )**2+(YE(2)-YE(1) )**2)
EIRE
A2=SqRTXE(3)-XE(2 2+(YE(3)-YE(2 2)
EIRE
C...
2
3
4
6
6
7
S
9
10
11
12
13
14
16
16
17
18
19
20
21
22
23
24
26
26
27
28
29
30
31
32
33
34
36
36
37
38
39
40
41
42
43
44
46
46
47
48
49
187
50
51
52
53
54
55
56
57
58
59
60
ERRE 61
EnE 62
ERRE 63
ERRE
EnE
EnE
ERRE
ERRE
EnE
EnE
EnE
EnE
EnE
EnE
ERRE
64
ERRE
EnE
ERRE
EnE
ERRE
ERRE
ERRE
EnE
EnE
EnE
ERRE
EnE
ERRE
ERRE
EnE
ERRE
65
ERRE
ERRE
ERRE
EnE
ERRE
ERRE
ERRE
EnE
ERRE
EnE
ERRE
EnE
ERRE
ERRE
ERRE
ERRE
ERRE
EnE
ERRE
ERRE
ERRE
EnE
RRE
ERRE
ERRE
EnE
EnE
EnE
EnE
ERRE
EnE
ERRE
EnE
ERRE
ERRE
ERRE
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
188
117
118
119
130 ERlSS(IPE,JPE)-D.O
120
llIAn-tlTYPE(IEL)
COIDT-COIDY(IlIAn)
121
122
C
C ElTUCT ELEIIEIT SUPE ru.CTIOn
123
124
C
125
DO 20 IOAUS-l,101US
GVIG-AlWET(101US,IEL)
126
127
DO 32 II0DP-l,1IPEL
SHlPP(IIOOP)-SUPF(IIODP,IG1US,IEL)
128
CAlTP(l,IIODP)-DERY1(IJODP,IGlUS,IEL)
129
CAlTP(2,IIODP)ooOERY2(IJODP,IGlUS,IEL)
EIlU 130
ERU 131
32
COnIJUE
ERU 132
C
C EYALU1TE PlOPERTIES 1T IITEGUTIOI POInS
ERU 133
ERU i34
C
EIlU 135
COe-colDT
IF (ILIR.EQ.1) TIIEI
ERU 136
TEIIP "D.O
EIlU 137
DO 52 IPE-l,IJPEL
ERU 138
JP-lCOIC(IEL,IPE)
ERU 139
TEllP-Tl!llP+1'IIIIPa(IP).supp (IPE)
ERU 140
52
COnlJUE
ERU 141
CALL IOJLII (IICOPT ,lIlIAn, llIAn ,ICDPT ,TEIIP, nALU ,COYLU, Y.&LUE)ERU 142
EIlU 143
COe-coe.YlLUE
lID IF
EIlU 144
CCCX-cD1D
EIlU 145
CCCY-cD1D
ERU 146
C
EIlU 147
C ClLCOLlTE TEllPERlTUEE OUDIDTS FlOII FEll BSULTS
EIlU 148
C
ERU 149
DO 30 IPE-l,1JPEL
EUE 160
JP-ICOIC(IEL,IPE)
ERU 161
ERU 162
TGaDX(IEL,IG1US)-rGIDl(IIL,I01US)+C&aTP(l,IPE).TEllPa(lP)
30 TGlOY(IEL,IG1US)-TQlOY(IEL,101US)+CAa1P(2,IPE).TEIIPa(IP)
ERU 163
CCCXV-CCCXGVIO
ERU 154
CCCYV-CCCY*GVIO
ERU 165
C
EIlU 166
C... OBT1II SQU1B OF TOTlL BElT DISSIP1TIOJ liD SIIOOTRIIO FOacES
EIlU 167
DO
130 IPE-l,IJPEL
DO 130 JPE'"l,IJPEL
TElER(IEL)-tEIEa(IEL)+CCCXV.TGIDl(IEL,I01US).TGaDX(IEL,101US)
+CCC1V.TGaDY(IEL,101US)*TGaDY(IEL,101US)
DO 25 lPE-l,1IPEL
ODS-oVIO.SHlPP(IPE)
FX(IPE)-FX(IPE)+TGaDX(IEL,IOIUS).ODS
25 FT(IPE)-FT(IPE)+TGaDT(IEL,I01US).ODS
DO 55 IPE-l,1IPBL
DO 55 JPE-l,1IPBL
EllASS(IPE;JPE)-EIIlSS(IPE,JPE)+QVIO.SUPP(IPE).SUPP(JPE)
55 conlJUE
20 ConlJUE
C
DO 128 J-l,IJPEL
DO 129 I-J ,IJPEL
11OV=ICOIC(IEL,J)
lCOL-ICOIC(IEL,I)
IF (IBOV.Li.lCOL) OOTO 104
IIEII-llOV
IaOV=ICOL
ICOL-lTEII
ERU
ERU
ERU
ERU
ERU
ERU
ERU
ERU
ERU
ERU
ERU
ERU
ERU
EIlU 158
DB 159
ERU 160
J!UE 161
ERU 162
ERU 163
J!UE 164
ERU 166
ERU 166
EIlU 167
EIlU 166
ERU 169
EIlU 170
ERU 171
ERU 172
ERU 173
ERU 174
EIlU 175
ERU 176
ERU 177
ERU 178
EIlU 179
ERU 180
EIlU 181
EIlU 182
ERU 183
IRC=IDIAG(ICOL)-ICOL+IROV
GKlSS(IRC)-GRASS(IRC)+ERASS(J,X)
COITIJUE
COITIJUE
COITIJUE
DO 26 IPE-l,IIPEL
EBHSl (IEL ,IPE)=FX(IPE)
ERRS2(IEL,IPE)-FY(IPE)
FIIT-FIIT+TEIER(IIL)
COITIJUE
FILER=FIIT/ELI
FSRT=SqRT(FELER)
C
12
36
21
66
62
60
DO 12 I'"l,IPOIl
FORCE(I)=O.O
COITIJUE
DO 36 IIL-l,IELER
DO 36 IPE=l,nPEL
IOo-ICOIC(IEL,IPE)
FORCE(IOD)=FDRCE(IOD)+EBHS1(IEL,IPE)
COITIJUE
DO 21 IPOII-l,IPOII
SROTH(IPOII)=O.O
CALL PRDFAC (RPROF,RPOII,IPOII,GKlSS,IDIAG)
CALL PROSOL (RPROF ,RPOll,IPDII,GKlSS,FDRCE,SROTH,IDIAG)
DO 60 IEL=l ,IELER
DO 62 IOAUS-l,IOAUS
U=O.O
DO 66 IPE-l,IIPEL
IPICOIC(IEL,IPE)
SHAPP(IPE)-SHAPF(IPE,IGAUS,IEL)
U-U+SHAPP(IPE).SROTH(IP)
SGRDX(IEL,IGAUS)=U
COITIJUE
42
46
22
76
72
70
DO 42 1=1 ,IPOIl
FORCE(I)=O.O
COlTIJUE
DO 46 IEL-l,
DO 46 IPE-l,nPEL
IOo-ICOIC(IEL,IPE)
FORCE(IOD)=FDRCE(IOD)+ERRS2(IEL,IPE)
COITIJUE
DO 22 IPOII-l,IPOII
SROTH(IPOII)=O.O
CALL PRDSOL (RPROF,RPOII,IPOII,GKlSS,FORCE,SROTH,IDIAO)
DO 70 IIL-l ,IELER
DO 72 IOAUS-l,IGAUS
BB=O.O
DO 76 IPE=l,IIPEL
IPICOIC(IEL,IPE)
SHAPP(IPE)-SHAPF(IPE,IOAUS,IEL)
BB=BB+SHAPP(IPE).SROTH(IP)
SORDY(IIL,IGAUS)=BB
COITIJUE
nLER
ERKlX=O.O
EIIT=O.O
189
EDE 164
EDE 186
EDE 186
EDE 187
EDE 186
EDE 189
EUB 190
EDE 191
EUB 192
EUB 193
EDE 194
EUB 196
EDE 196
EDE 197
EDE 198
EDE 199
EDE 200
EDE 201
EDE 202
EUB 203
EDE 204
EDE 206
EDE 206
EUB 207
EUB 208
EDE 209
EUB 210
EDE 211
EDE 212
EDE 213
EDE 214
EDE 216
EUB 216
EUB 217
EUB 218
EUB 219
EDE 220
EDE 221
EDE 222
EDE 223
EUB 224
EUB 226
EUB 226
EUB 227
EUB 228
EDE 229
EUB 230
EUB 231
EUB 232
EDE 233
EDE 234
EDE 236
EUB 236
EUB 237
DU 236
EDE 239
EDE 240
EDE 241
EDE 242
EUE 243
EUE 244
EUE 246
EDE 246
EUB 247
EDE 248
EDE 249
EDE 260
190
C...
C
402
C
C
C
96
C ***
C
92
90
C
C ***
C
C
C ***
C
C ***
C
110
116
120
C
C ***
C
BRRE
ERRE
ERRE
ERRE
ERRE
ERRE
ERRE
ERRE
ERRE
ERRE
ERRE
ERRE
ERRE
ERRE
ERRE
251
262
253
264
266
266
267
EVALUATE PROPERTIES AT IITEGRATIOI POIITS
258
269
COID=COIDT
IF (ILIIR.EQ.l) THEI
260
261
TE"P =0.0
DO 402 IPE=l,IIPEL
262
263
IP=ICOIC(IEL,IPE)
TE"P=TE"P+T~PR(JP).SHAPP(IPE)
264
COlTIJUE
266
CALL 10lLII ("CDPT,""ATR,I"ATR,ICDPT,T~,TVALU,CDVLU,VALUE)ERRE 266
COID=COID.VALUE
ERRE 267
ElD IF
ERRE 268
ERRE 269
CALCULATE THE IOU ERROR II EACH EL~ElT
ERRE 270
ERRE 271
CCCX-COID
ERRE 272
ERRE 273
CCCY=COID
WJ=GWIG
ERRE 274
DBLX=SGRDX(IEL,IGS)-TGRDX(IEL,IGS)
ERRE 276
DELY-SGRDY(IEL,IGS)-TGRDY(IEL,IGS)
ERRE 276
ERlOR(IEL)=ERlOR(IEL)+CCCX.WJ.DELX*DELX+CCCY*WJ.DELY*DELY
ERRE 277
ERE~(IEL)-SQRT(ERlOR(IEL/FSRT
ERRE 278
IF(EREL"(IEL) .GT .ERIlAX) THEI
ERRE 279
EUAX=ERE~(IEL)
ERRE 280
IELU-IEL
ERRE 281
ElD IF
ERRE 282
ERRE 283
CALCULATE XI AID lEW ELE"EIT SIZES
ERRE 284
ERRE 286
ARR=PCEIT/EREL"(IEL)
ERRE 286
IF(IIPEL.EQ.6.0R.IIPEL.Eq.9) ARR-SQRT(ARR)
ERRE 287
IF(ICOAR.IE.O) GO TO 92
ERRE 288
IF(ARR.GT.l.0) ARR-l.0
ERRE 289
PEUI(IEL)=EHOLD(IEL)*ARR
ERRE 290
EIIT=EIIT+ERlOR(IEL)
BRRE 291
COlTIJUE
ERRE 292
ERRE 293
FIID THE AVERAGE IOU ERROR II WHOLE DO"AII
ERRE 294
ERRE 296
ERDO"=EIIT/FIIT
ERRE 296
ERRE 297
AID CORRESPOIDIIG TE"PERATURE ERROR II WHOLE DO"AII
ERRE 298
ERRE 299
BRSRT=SQRT(ERDO")
ERRE 300
ERRE 301
AVERAGE ELE"EIT SIZES AROUID 10DAL POIITS
ERRE 302
ERRE 303
DO 110 II=l,IPOII
ERRE 304
ICOIT(I1)=O
ERRE 306
EHIEW(II)=O.O
ERRE 306
DO 116 IEL=l,IELE"
ERRE 307
DO 115 IPE-l,IIPEL
ERRE 308
IP=ICOIC(IEL,IPE)
ERRE 309
ICOIT(IP)=ICOIT(IP)+l
ERRE 310
BHIEW(IP)=EHlEV(IP)+PEUI(IEL)
ERRE 311
DO 120 II=l,IPOII
BRRE 312
COII=ICOIT(II)
ERRE 313
EHIEV(II)=EHlEW(II)/COII
ERRE 314
ERRE 316
ADJUST ELE~EIT SIZES WITHII "III~ AID "AXI~
ERRE 316
ERRE 317
191
ERU
ERU
ERU
ERU
ERU
ERU
UD
B.6
318
319
320
321
322
323
Documented Examples
In this section three examples of adaptive heat transfer analysis are presented with the the details of input. The output files for each example
may be found in the floppy disk.
B.6.1
i----....;4=-----.... 1.0
lae 758.0
x
0.2
x=r-JJ.O
1
I
I ...
T=100.0
--..I
,buo/SJI_.
Figure B.5: Geometry and BC details for the 2-D heat conduction example
The first data file to be prepared is GEOMET.DAT. For this example
it looks like this:
o1
4 0.000001
192
1
5
1
0.0
1
0.6
1
0.6
1
0.0
The second data file to be prepared is DENSIT .DAT, which for this
example is:
1
0.0 0.0 0.4
2 1
31
4 1
B.6.2
o
1
1 3 0.000001
193
T=O.O
1;0
4
3 ~0.85
u = 0.866024
v=0.5
-0.80
X
2
0.25T=1.0
:r=y=O.O
I...
Figure B.6: Geometry and
heat transfer example
Be
1.0
T=1.0
.1
194
1
0.0
1
1.0
1
1.0
1
1.0
1
0.0
1
0.0
1
1.0
0.0
3
1 1
6 2
7 1
0.8660254
B.6.3
0.5
The third example is the same as the first example of Appendix A. However, it has been solved adaptively here using three noded triangular elements with the enthalpy method to account for the latent heat effects
instead of the source method used earlier.
GEOMET.DAT for this example is:
o 1 3 0.000001
1
4.0 0.0
1
4.0 0.5
1
1.0 0.5
1
0.0 0.5
1
0.0
0.5
1.0
4.0
0.0
0.5
1.0
4.0
0.0
0.0
0.0
0.0
0.5
0.5
0.5
0.5
0.05
0.1
0.2
0.5
0.05
0.1
0.2
0.5
-45.0
1
6 1
0.0
195
196
It ma.y be noted that the values of itran and ilinr for this data file are 1.
This means that the program expects an enthalpy curve to take account
of the heat capacity. This ailows us to model phase change problems using
the enthalpy method. The values of condy and capcy here are the same as
the example of Appendix A. The difference is that the latent heat value
of 70.26 is incorporated in the enthalpy curve. The relationship between
enthalpy and heat capacity i!! given in Equations (5.5) and (5.6), and is
schematically shown in Figure 5.1. From this information we can easily
construct an enthalpy curve for this problem. We begin with a temperature
value of -50.0 and a corresponding arbitrarily chosen value of enthalpy (H)
as 1 (as only the quantity
is of interst and not the absolute value of H).
Assuming a temperature range of -1.15 to -0.15 for solidification and going
on to a suitable last value of 5.0 we determine all our temperature points.
The corresponding enthalpy values are obtained by integrating the heat
capacity between these temperature ranges. The second value is obtained
by:
(-1.15 - (-50.0)) x 1 + 1 = 49.85
"Ii
valu~
= 121.11
Subject Index
198
Heat 7
Heat capacity matrix 51
Heat flow dissipation 88
Heat flux 8,9,10
Heat generation rate 13
Heat source method 70
Heat transfer coefficient 17
Higher order approximation 89
H-refinement 86
Orthogonal anisotropy 12
Initial condition 15
Input instructions 137,178
Isotropic material 8
Jacobian matrix 42
Kinematic viscosity 18
Lagrangian element 43
Least square smoothing 89
Liquidus 64
Load vector 35,36,40,53
Subject Index
STIFFN 140
TEMCOR 145
Substantial differential 16
Superconvergence 90
Taylor-Galerkin method 117,118,
120,122
Temporal discretisation 49,51
Thermal conductivity 8,10
Thermal expansion 18
Time step 51,52,56,57,58
Transient problems 49,117
199
Trial functions 27
Triangular elements 35,36,42
User instructions 137,178
Variational principle 25
Weak form 30,50
Weighting factor 45,46
Weighting functions 29
Weighted residual method 29