You are on page 1of 107

Introduction

Introduction

This course is about: numerical techniques for solving boundary-value (BV) problems.
A boundary value problem is: differential equations (DE) & boundary conditions (BC).
Two techniques are covered: The Finite Element (FE), and the Finite Difference (FD).

Classical Solution Of BV Problems
The classical solution is based on three steps:
1. Assume a solution.
2. Plug into the DE to get the Residual, R.
3. Find the best values of the coefficients in the assumed solution, which satisfy the BV
problem at the BC and at specific evaluation points, or which minimize the error (R)
over the domain.

Example:

Find and approximate solution to the following BV problem

, o x u u = + + 0 < x < 1

u(0) = 0 and u(1) = 0

Solution:

1. Assume u =
2
2 1 0
x a x a a u
~
+ + =
2. Plug into the DE R = x x a x a a a 2
2
2 1 0 2
+ + + +
3. u(0) = 0 a
0
= 0,
u(1) = 0 a
1
+ a
2
= 0,
Set R = 0 at x = - 2a
1
+ a
1
(1/2) a
1
(1/2)
2

(1/2) = 0 a
1
= 2/7


( )( )
2
x x 7 / 2 ) x ( u
~
= , Exact solution is x
) 1 sin(
) x sin(
u
*
=

Figure 1 Comparison between exact
and approximate solutions
2


Element
Node
. Finite Element

1. INTRODUCTION

The classical finite element technique goes through 4 major phases (steps):

1. Mesh Generation and Function Approximation:
The domain of solution is divided into sub-domains
(elements), with the corners at boundaries called nodes. The
elements and the nodes constitute the FE mesh.
The solution is assumed as a polynomial over each element.
That is; the solution is assumed to be a piece-wise polynomial.
The solution at the boundaries (between elements) is not necessarily continuous.

=
=
ne .. 1 j
e
j j
e
elements
e
U ) x ( N ) x ( u where , ) x ( u ) X ( u
Where N
j
(x) are the shape functions, and
e
j
U are the nodal displacements.

2. Element Equation:

Over each element the DE is discretised using the following steps

(i) The approximate solution u
e
is substituted into the DE rendering the Residual, R.
(ii) The weighted residual over each element is forced to vanish, rendering the best
values of
e
j
U that minimizes, R.

=
element
i
element. each for , 0 Rdx ) x ( w
Where w
i
is the weighting function. If w
i
= N
i
the method is called the Galerkin FE
method (GFEM). We will be using the GFEM throughout the course.
(iii) Integration by part and after some algebraic manipulation the element equation
is recovered: [K]
e
U
e
= F
e
+B
e
, where [K]
e
is the element stiffness matrix, U
e
is the
element nodal displacement vector, F
e
is the element force vector, and B
e

is the
element boundary force vector.


3

3. The Global Equation:

The element equations are assembled rendering the Global equation [K] U = F+B, where [K]
is the global stiffness matrix, U is the global nodal displacement vector, F is the global force
vector, and B is the global boundary force vector.

4. Solution:
The global equation is solved for the nodal displacement vector. Notice that the FE renders
the solution at the nodes. If the solution anywhere else in needed an interpolation
procedure has to be applied.

Examples

O Solve the following BV problem using the GFEM

, o u u = + 0 < X < 4

u(0) = 0 and u(4) = 1

-----------------------------------------------------------------------

1. Divide the domain into 4 equal, linear elements

(1) U ) x ( N ) x ( u where , ) x ( u ) X ( u
2 : 1 j
e
j j
e
4 : 1 e
e

= =
=
N
1
(x) = 1 x/h, and N
2
(x) = x/h, where h is the length of the element (h=1).

Notes: Global, when considering the whole domain; versus local, when inside an element:

(i) Global node numbering (from 1:5) and local node numbering (1:2),
(ii) Global coordinate, X, and local coordinate, x.

How to generate the Shape function? For Linear elements, we assume within each element

u
e
= a
0
+ a
1
x, where x is the local coordinate

At x = 0, u
e
=
0
e
1
a U = , and at x = h, h a a U u
1 0
e
2
e
+ = =

1
2 3
4
1 2 3 4 5
X
4

That is,
h
U U
a and , U a
e
1
e
2
1
e
1 0

= =
Substituting in the expression of u
e
and after some manipulation we get,

e
2
e
2
e
1 1
e
2
e
1
e
U N U ) x ( N U
h
x
U
h
x
1 u + = + |

\
|
=

2. Within a generic element
(i) ( ) , o u u R
e e
+

= (2)
(ii)

= =
element
i
2 : 1 i , 0 Rdx ) x ( N (3)
(iii)Substitute from (2) into (3) and integrate by part we get
1,2 i 0 dx u N u N dx u N
e
e
i
h
0 e
e
i
e
i
= = +




Substituting from (1) and rearrange
( ) 1,2 i u N U dx N N N N
e
i
e
j
2 : 1 j
h
0
j i j i
=

=

( )
h
0
e
i
e
i
h
0
j i j i
e
ij
e
i
2 : 1 j
e
j
e
ij
u N B
, dx N N N N K where
(4) 1,2 i B U K Or

=
=
= =

=

Equation (4) can be expressed as

[ ]
e e e
B U K =

Or after substituting from the expressions of N
i
and integrating

e
2
1
e
2
1
U
U
U
U
3
h
h
1
6
h
h
1
6
h
h
1
3
h
h
1
|
|

\
|


=
|
|

\
|
(
(
(
(

\
|

|

\
|
+
|

\
|
+
|

\
|



With h = 1 the element equation becomes

h
1
N
1
N
2
2
x
5

e
2
1
e
2
1
U
U
U
U
4 7
7 4
6
1
|
|

\
|


=
|
|

\
|
(



3. Upon Assembly, the global equation is

6
1
|
|
|
|
|
|

\
|


=
|
|
|
|
|
|

\
|
(
(
(
(
(
(

5
1
5
4
3
2
1
U
0
0
0
U
U
U
U
U
U
4 7
7 8 7
7 8 7
7 8 7
7 4


Saving the first and fifth rows and eliminating the first and fifth columns, taking into
consideration that U
5
= 1, we get

|
|
|

\
|
=
|
|
|

\
|
(
(
(

7
0
0
U
U
U
8 7
7 8 7
7 8
4
3
2


4. Solve the reduced global equation we get

|
|
|

\
|
=
|
|
|

\
|
386 . 0
441 . 1
261 . 1
U
U
U
4
3
2
















6

O Solve the following BV problem using the GFEM

, X u = 0 < X < 1

u(0) = 0 and u(1) = 1

-----------------------------------------------------------------

1. Divide the domain into 4 equal, linear elements

U ) x ( N ) x ( u where , ) x ( u ) X ( u
2 : 1 j
e
j j
e
4 : 1 e
e

= =
=
N
1
(x) = 1 x/h, and N
2
(x) = x/h, where h is the length of the element (h=1/4).

2. Within a generic element

(i) ( ) , o X u R
e

=
(ii)

= =
element
i
2 : 1 i , 0 Rdx ) x ( N
(iii) Substitute from R and integrate by part we get
1,2 i 0 X N u N dx u N
e
i
h
0 e
e
i
e
i
= =




Substituting from (1) and rearrange
1,2 i u N dx X N U dx N N
h
0
e
i
e
i
e
j
2 : 1 j
h
0
j i
=

+ =

=


( )
u N B
, dx ) x X ( N Xdx N F
, dx N N K where
1,2 i B F U K Or
h
0
e
i
e
i
e
e
1 i
e
i
e
i
h
0
j i
e
ij
e
i
e
i
2 : 1 j
e
j
e
ij

=
+ = =
=
= + =

=

Where
e
1
X is the value of Xat node 1 of element e




1 2
3 4
1 2 3 4 5
X
7

The element equation can be expressed as

[ ]
e e e e
B F U K + =

Or after substituting from the expressions of N
i
and integrating

e
2
1
e
1
2
e
1
2
e
2
1
U
U
2
h X
3
h
2
h X
6
h
U
U
1 1
1 1
h
1
|
|

\
|

+
+
=
|
|

\
|
(


Notice that h 3 X and , h 2 X , h X , 0 X
4
1
3
1
2
1
1
1
= = = = .

3. Upon Assembly, the global equation is

|
|
|
|
|
|

\
|


+
|
|
|
|
|
|

\
|
=
|
|
|
|
|
|

\
|
(
(
(
(
(
(

5
1
2
5
4
3
2
1
U
0
0
0
U
11
18
12
6
1
6
h
U
U
U
U
U
1 1
1 2 1
1 2 1
1 2 1
1 1
h
1


Saving the first row, and eliminating the first column with h = and U
5
= 1, we get

|
|
|
|
|

\
|
+
|
|
|
|
|

\
|
=
|
|
|
|
|

\
|
(
(
(
(

1
0
0
0
4
1
11
18
12
6
386
1
U
U
U
U
1 1
1 2 1
1 2 1
1 2
5
4
3
2



4. Solve the reduced global equation we get

|
|
|
|
|

\
|
=
|
|
|
|
|

\
|
6667 . 0
4453 . 0
2708 . 0
1276 . 0
U
U
U
U
5
4
3
2


Note: the exact solution is
2
X
6
X
u
3
+ = , so u(0.25) = 0.1276 ... Excellent agreement


8

Problems # 1


Solve the following problems using the Galerkin finite element Method (GFEM).

O , 1
X
u
X
u
2
2
=

1 X 0 < < . Subjected to u(0) = 0 and u(1) = 0.


Use 5 equal, linear elements.


O , 0 ) X 1 ( X
X
u
2
2
=

1 X 0 < < . Subjected to u(0) = 0 and u(1) = 0.



Use 4 equal, linear elements.



O , 0 X u
X
u
2
2
= + +

1 X 0 < < . Subjected to u(0) = 0 and u(1) = 0.


Use 4 equal, linear elements.
Compare the GFE results with the exact and the approximate solution given in
the Introduction chapter.














9

T
P
X
dx
2. RODS


Introduction

Rods are slender members which carry mainly axial loadings.
There are three types of loads that act on any member (body):
1. Body force/unit volume (f): acts on each and every point of the body (gravity).
2. Traction force/unit area (T): acts on the surface of the body (friction).
3. Concentrated force (P): acts over a very small area, which is approximated as a point.

Mathematical Model

Consider the static equilibrium of the differential element of a rod shown in Figure 1.











Figure 1 differential element of the rod

Sum of the forces in the X direction gives:
0 fAdX TSdX dX
dX
dP
= + + (1)
Where A is the cross sectional area, and S is the active circumferential length.
Substituting from
dX
du
EA AE A P = = = into equation (1), we get:
0 fA TS
dX
du
EA
dX
d
= + +
|

\
|
(2)

f
dX
dX
dP
P+

10

Where E is the modulus of elasticity, is the axial stress, is the axial strain, and u is the axial
displacement.
Two common types of boundary conditions:
Free end: 0 dX du E E = = = , and
Fixed end: u = 0.
Equation (2) together with the appropriate BCs constitutes the mathematical model of the
static linear, elastic deflection of the rod; it is in the form of a BVP and consequently, the FE is
one of the numerical methods of solution.

Element Equation Using GFEM

Upon meshing and assuming that

=
=
ne .. 1 j
e
j j
e
elements
e
U ) x ( N ) x ( u where , ) x ( u ) X ( u , the element
equation of the rod can be obtained following the three steps outlined in the previous section:

(i) 0 fA TS EAu R
e
+ +

\
|

=

(ii)

= =
element
i
2 : 1 i , 0 Rdx ) x ( N

(iii) Substitution from R and integration by parts renders:

( ) ( ) 1,2 i u EA N dx ) fA TS ( N dx EAu N
h
0
e
i
h
0
i
h
0
e
i
=

+ + =




1,2 i EAu N dx ) fA TS ( N dxU EAN N
h
0
e
i
h
0
i
e
j
2 : 1 j
h
0
j i
=

+ + =

=


That is, 1,2 i B F U K
e
i
e
i
2 : 1 j
e
j
e
ij
= + =

=

dx EAN N K matrix, stiffness element the is K where
h
0
j i
e
ij
e
ij


=
11

( )
h
0
e
i
e
i
h
0
i
e
i
u EA N vector, force boundary element the is B
dx ) fA TS ( N vector, force nodal element the is F



The element equation can be expressed in matrix/vector form


[ ]
e e e e
B F U K + =


( )
e
2
1
e
2
1
e
P
P
1
1
fA TS
2
h
U
U
1 1
1 1
h
EA
|
|

\
|
+
|
|

\
|
+ =
|
|

\
|
(

\
|
(3)



Equation (3) is the element equation of a rod element, where E
e
, A
e
, and h are the
modulus of elasticity, cross sectional area, and length of the element, respectively.
e
2
e
1
P and P
are the axial, normal reaction forces at both ends of the rod element (Figure 2). The expression
of the element force vector F
e
is based on constant body (f) and traction forces (T) over the
element. If f and T are functions of x, the expression of F
e
has to be evaluated.






Figure 2 Schematic of the element boundary forces


Stresses inside an element

If the nodal displacements (
e
2
e
1
U and U ) are known, then the stress inside the element can be
computed from:
( ) ) U
h
1
U
h
1
( E ) U N U N ( E u E E
e
2
e
1
e e
2 2
e
1 1
e e e e e
+ = + =

= =
Or
e
e
1
e
2 e e
h
U U
E

= (4)


where
e
is the average axial stress in the element (constant), and h
e
is the element length.
P
1
e
P
2
e
12

Examples

O The composite rod shown in the Figure
is subjected to a body force f = 1000 Lb/in
3
and
A traction force T = 2000 Lb/in
2
over an active
circumferential length, S = 1.6 in. A compressive
force P is applied at the top end, and the bottom
end is fixed. Using the GFEM, and for = 0.001 in,
find the following:
(i) The displacement at B
(ii) The applied force, P
(iii) The stress in the mid-section.

Note: the weight is negligible.
-------------------------------------------------------

1. Mesh Generation & function approx

Divide the domain into 4 equal, linear elements

U ) x ( N ) x ( u where , ) x ( u ) X ( u
2 : 1 j
e
j j
e
3 : 1 e
e

= =
=
N
1
(x) = 1 x/h, and N
2
(x) = x/h,

where h is the length of the element.

Elem # E (Msi) A (in
2
) h (in) k (Lb/in)10
6
fAh (Lb) TSh (Lb) h(fA+TS)/2
1 10 1 2 5 0 6400 3200
2 10 1 2 5 0 0 0
3 15 2 3 10 6000 0 3000

2. Element equations (3)

2 in
2 in
3 in

T
f
A=1 in
2
A=2 in
2
X
P
B
1
2
3
4
13

|
|

\
|
+
|
|

\
|
=
|
|

\
|
(

|
|

\
|
+
|
|

\
|
=
|
|

\
|
(

|
|

\
|
+
|
|

\
|
=
|
|

\
|
(

...
...
3000
3000
U
U
10 10
10 10
10 ] 3 [ Element
...
...
0
0
U
U
5 5
5 5
10 ] 2 [ Element
...
...
3200
3200
U
U
5 5
5 5
10 ] 1 [ Element
1
2
1 6
2
2
1 6
1
2
1 6



3. Assembly & BC

|
|
|
|
|

\
|
+
|
|
|
|
|

\
|
=
|
|
|
|
|

\
|
(
(
(
(

4 4
3
2
1
6
R
0
0
P
3000
3000
3200
3200
U
U
U
U
10 10 0 0
10 15 5 0
0 5 10 5
0 0 5 5
10

Saving the first and fourth rows and eliminating the first and fourth columns, taking into
consideration that U
1
= 0.001, we get

|
|

\
|
+
|
|

\
|
=
|
|

\
|
(

0
5000
3000
3200
U
U
15 5
5 10
10
3
2 6
Coming from U
1
= 0.001

4. i) Solve we get U
2
= 1.104 10
-3
in, and U
3
= 0.568 10
-3
in.

ii) And form the saved equations

P = 10
6
(5 U
1
5 U
2
) 3200 = -3720 Lb

R = 10
6
(10 U
4
10 U
3
) 3000 = -8680 Lb



iii) The stress at the mid-section is located in element 2

Inside element [2], we have, from equation (4):

( ) psi 2680 10 ). 104 . 1 568 . 0 (
2
10 . 10
U U
h
E
3
6
1 2
= = =





14

O
A 2-m long rod is fixed at the top
end and suspended down as shown in
the Figure. Find and sketch the stresses
as a function of X, in both sections (top
and bottom) of the rod, as it deforms
under its own weight. Note that the
deflection of the rod is limited by the
gap between the bottom surface of the
rod and the rigid ground.
Take: E = 100 MPa, A
top
= 1000 cm
2

and A
bottom
= 2000 cm
2
, the specific
weight of the material, w = 0.2 N/cm
3
,
and a gap () of 0.003 m.

----------------------------------------------------


1. Mesh generation & function approximation

Divide the domain into 2 equal, linear elements

U ) x ( N ) x ( u where , ) x ( u ) X ( u
2 : 1 j
e
j j
e
2 : 1 e
e

= =
=
N
1
(x) = 1 x/h, and N
2
(x) = x/h,

where h is the length of the element.

Elem # E (Mpa) A (m
2
) h (m) k (N/m)

fAh (N) TSh (N) h(fA+TS)/2
1 100 0.1 1 10.10
6
20.10
3
0 10,000
2 100 0.2 1 20.10
6
40.10
3
0 20,000

Note: (fAh)
1
= (0.2x10
6
)x(0.1)x(1) = 20,000 N

(fAh)
2
= (0.2x10
6
)x(0.2)x(1) = 40,000 N
1
m
1
m
gap
X
1
2
3
1
2
15

2. Element equations

|
|

\
|
+
|
|

\
|
=
|
|

\
|
(

|
|

\
|
+
|
|

\
|
=
|
|

\
|
(

...
...
20000
20000
U
U
20 20
20 20
10 ] 2 [ Element
...
...
10000
10000
U
U
10 10
10 10
10 ] 1 [ Element
2
2
1 6
1
2
1 6



3. Assembly & BC

At this stage, we need to assume a scenario: hit vs. not hitting

a) Let us assume that the bottom surface (node 3) will not hit the ground. Then,

|
|
|

\
|
+
|
|
|

\
|
=
|
|
|

\
|
(
(
(

0
0
R
2
3
1
10
U
U
U
20 20 0
20 30 10
0 10 10
10
1
4
3
2
1
6


Save the first line and delete the first column, we get the reduced Global equation;

|
|

\
|
=
|
|

\
|
(

2
3
10
U
U
20 20
20 30
10
4
3
2 6
m
006 . 0
005 . 0
U
U
3
2
|
|

\
|
=
|
|

\
|


Notice that U
3
= 0.006 m > = 0.003 m; that is, the assumption is wrong.

b) The bottom surface will hit the ground. So,

|
|
|

\
|
+
|
|
|

\
|
=
|
|
|

\
|
(
(
(

3
1
4
3
2
1
6
R
0
R
2
3
1
10
U
U
U
20 20 0
20 30 10
0 10 10
10



Saving the first and third rows, and eliminating the first and third columns, taking into

consideration that U
3
= , then

10
6
(30 U
2
20 U
3
) = 3 x10
4
U
2
= 0.003 m = 3 mm.


Reaction needed to stop
the bottom surface upon
contact with the ground
U
3
=
16

4. Finding the stresses in the elements:

Element 1: ( )
2 3 3
6
e
1 2
e
N/m 10 300 10 ). 0 3 (
1
10 . 100
U U
h
E
= = =


Element 2: ( )
2 3
6
e
1 2
e
N/m 0 10 ). 3 3 (
1
10 . 100
U U
h
E
= = =



A sketch of the element stresses





























0

(KPa)
X (m)
1
2
300
17

Problems # 2

O
Consider the rod in the Figure.
Determine the nodal
displacements, element stresses,
and support reactions. Use two
equal elements, and take E =
15x10
6
psi, A = 0.4 in
2
, f = 200 lb/in
3
, S = 0.5 in and P = 100 lb.

O
Consider the composite rod shown in the Figure
Determine the nodal displacements,
the element stresses, and support reactions.
Take E = 200 GN/m
2
and E = 100 GN/m
2
for the
smaller (LHS) rod and the larger (RHS) rod, respectively.
(Chandruptla and Belegundu, 2001).

O

For the vertical rod shown, find the deflection at
A and sketch the stress distribution.
Use E = 200 MPa and weight per unit volume
w = 0.12 N/cm
3
.
Note: solve this problem twice (with two and four
linear elements), and comment on the effect of
the number of elements on the displacement and
stress distribution results.
(Chandruptla and Belegundu, 2001).
20 20
P
f
X
A
B
18

rods
pivots
F
1
F
2
X
Y
u
2
u
1
v
1
U
1
v
2
U
2

3. TRUSSES


Introduction

A truss is a structure designed to support
stationary loads, and consists of rods and
pivots.
The traction and body forces are considered
negligible compared to the applied
concentrated forces.


Displacements

For the 2D analysis the pivots can move in the x and y
directions (u
i
, v
i
); however, the rods experience axial
loading only (U
i
).

From Figure 2, we have:

h
Y Y
) sin( m and
h
X X
) cos( l where
(1)
v
u
v
u
m l 0 0
0 0 m l
U
U
) sin( v ) cos( u U
) sin( v ) cos( u U
1 2 1 2
e
2
2
1
1
e
2
1
e
2
e
2
e
2
e
1
e
1
e
1

= =

= =
|
|
|
|
|

\
|
(

=
|
|

\
|
+ =
+ =
Equation (1) can be expressed as

(2) q ] L [ U
e
=

where U
e
is the axial nodal displacement vector
Figure 1 A sketch of a truss
Figure 2 Kinematics of a truss element
(

=
|
|
|
|
|

\
|
=
|
|

\
|
=
m l 0 0
0 0 m l
[L] ,
v
u
v
u
q ,
U
U
U
e
2
2
1
1
e
2
1 e
19

q is the planar nodal displacement vector
[L] is the Transformation matrix.

Forces

Similar to the displacements argument, the relationship
between the axial forces (P
i
) and the planar forces (F
xi
and F
yi
)
can be derived (Figure 3):

|
|

\
|
(
(
(
(

=
|
|
|
|
|

\
|
= =
= =
2
1
2 y
2 x
1 y
1 x
2 y2 2 2 x
1 y1 1 1 x
P
P
m 0
l 0
0 m
0 l
F
F
F
F
, is that
) sin( P F ), cos( P F
) sin( P F ), cos( P F


Or in a condensed format: [ ] (3) B L F
~
e T
e
=

Where B
e
is the axial nodal BC force vector.

e
F
~
is the planar nodal BC force vector.

|
|

\
|
=
|
|
|
|
|

\
|
=
2
1 e
2 y
2 x
1 y
1 x
e
P
P
B and
F
F
F
F
F
~



Element Equation

The element equation of the truss member is derived from the rod element equation via
transformation of coordinates:

P
1
F
x1
F
y1
X
Y

P
2
F
y2
F
x2
Figure 3 Forces of a truss element
20

The element equation of the rod is [ ] B F U K
e e e e
+ =


Pre-multiply by [L]
T
, we get [ ] [ ] [ ] B L U K L
e T e e T
=

Substituting from equations (2) and (3): [ ] [ ] [ ] [ ] F
~
B L q L K L
e
e T e T
= =


That is, [ ] (4) F
~
q K
~ e e
=

Where
[ ] [ ] [ ] [ ] [ ]
[ ] (5)
m lm m lm
lm l lm l
m lm m lm
lm l lm l
h
EA
K
~
q L K L K
~
truss, the of matrix stiffness element the is K
~
2 2
2 2
2 2
2 2
e
e
e T
e e
(
(
(
(
(

\
|
=
=



Element stress

The stress for the rod is given by
e
e
1
e
2 e e
h
U U
E

=

Substituting from (1), we get:

(6) ) mv lu mv lu (
h
E
e
1
e
1
e
2
e
2
e
e
+ =














21

Examples

O

For the truss shown in the Figure,

find the stress in element 3.

(F
1
= 4,000 Lb)

---------------------------------------------

(i)

Elem # E (Msi) A (in
2
) h (in) k (Lb/in) Connect. l m
1 30 0.8 24 1x10
6
1-2 1 0
2 10
4.8 3 12 3
4 x10
6
1-3
3 /2
1/2
3 10 9.6 12 8 x10
6
2-3 -1/2
3 /2

(ii)

Element stiffness matrices:

[1] 10
6

(
(
(
(

0 0
0 1
,
[2] 10
6

(
(
(
(
(

1 3
3 3
,
[3] 10
6

(
(
(
(
(

6 3 2
3 2 2




F
1
30
0
60
0
2
1
2
3
C C
C
(-)
(-)
(-)
(-)
(-)
(-)
(+)
(+)
(+)
22

(iii)
|
|
|
|
|
|
|
|

\
|

=
|
|
|
|
|
|
|
|

\
|
(
(
(
(
(
(
(
(







4000
0
R
0
R
R
V
U
V
U
V
U
7 3 6 3 2 1 3
3 5 3 2 2 3 3
6 3 2 6 3 2 0 0
3 2 2 3 2 3 0 1
1 3 0 0 1 3
3 3 0 1 3 4
10
2 y
1 y
1 x
3
3
2
2
1
1
6


Save equations (1), (2) and (4); and delete columns (1), (2) and (4):

10
6

|
|
|

\
|

=
|
|
|

\
|
(
(
(

4000
0
0
V
U
U
7 3 3 2
3 5 2
3 2 2 3
3
3
2
inch 10
375 . 1
216 . 0
732 . 1
V
U
U
3
3
3
2

|
|
|

\
|

=
|
|
|

\
|


(iv) Stress in element [3]: From (6)

( ) ( ) ( ) ( ) psi 360 0
2
3
732 . 1
2
1
375 . 1
2
3
216 . 0
2
1
12
10
) V . m U . l V . m U . l (
h
E
) mv lu mv lu (
h
E
7
] 3 [
e
2
e
2 3 3
e
e
e
1
e
1
e
2
e
2
e
e
=

|
|

\
|
|

\
|

|
|

\
|
+ |

\
|
=
+ =
+ =



















The negative sign implies compression
(makes sense)
23

F
1y
=10,000N




O

The truss shown in the Figure is made of Steel

(E = 200 GPa). The cross sectional areas of

Members 1 and 2 are 1000 mm
2
and 1250 mm
2

respectively. The truss is completely fixed at

pivots 2 and 3. Find the displacement at the free

pivot (1), the reactions at the fixed pivots (2,3), and the stresses in the two members.

-----------------------------------------------------------------------------------------------------------------

(i)

Elem # E (GPa) A (m
2
) h (in) k (N/m) Connect. l m
1 200 10
-3
0.75 267x10
6
1-2 -1 0
2 200 1.25x10
-3
0.9014 277.8 x10
6
1-3 -0.832 -0.555

(ii)

Element stiffness matrices:

[1] 267x10
6

(
(
(
(

0 0 0 0
0 1 0 1
0 0 0 0
0 1 0 1
,
[2] 278x10
6

(
(
(
(





308 . 0 463 . 0 308 . 0 463 . 0
463 . 0 692 . 0 463 . 0 692 . 0
308 . 0 463 . 0 308 . 0 463 . 0
463 . 0 692 . 0 463 . 0 692 . 0
,



0.75 m
1
2
C
C
C
0.5 m
24





(iii) Assembly & BCs


|
|
|
|
|
|
|
|

\
|

=
|
|
|
|
|
|
|
|

\
|
(
(
(
(
(
(
(
(

+ +
+ +
3 y
3 x
2 y
2 x
3
3
2
2
1
1
6
R
R
R
R
000 , 10
0
v
u
v
u
v
u
86 128 0 0 86 128
128 192 0 0 128 192
0 0 0 0 0 0
0 0 0 267 0 267
86 128 0 0 86 0 128 0
128 192 0 267 128 0 192 267
10


Storing equations 3-6, and deleting columns 3-6, we get:

|
|

\
|

=
|
|

\
|
(

000 , 10
0
v
u
86 128
128 459
10
1
1 6

|
|

\
|

=
|
|

\
|
1988 . 0
0554 . 0
v
u
1
1
mm

(iv) Reaction:
3 3 6
3 y
3 x
2 y
2 x
10 .
01 . 10
81 . 14
0
29 . 15
10 .
1988 . 0
0554 . 0
86 128
128 192
0 0
0 267
10
R
R
R
R
|
|
|
|
|

\
|
=
|
|

\
|

(
(
(
(

=
|
|
|
|
|

\
|

N



Stresses: From equation (6):


( )( ) ( )( ) ( )( ) ( )( ) { }
( ) ( )( ) ( )( ) ( )( ) { }
MPa 14.254 Pa 10 254 . 14
10 1988 . 0 555 . 0 10 0554 . 0 832 . 0 10 0 555 . 0 10 ) 0 ( 832 . 0
9014 . 0
10 . 200
MPa 14.773 Pa 10 773 . 14 10 1988 . 0 0 10 0554 . 0 1 0 0 0 1
75 . 0
10 . 200
6
3 3 3 3
9
] 2 [
6 3 3
9
] 1 [
= =
+ =
= = + =





Should be 15.0
(round off error)
Should be 10.0
(round off error)
Compressive; makes sense
25

Problems # 3

O
For the truss shown in the Figure, a horizontal load of
P = 5000 Lb is applied in the x direction at node 2,
Using the GFE:

1. Find the displacements at nodes 2 and 3.
2. Determine the stresses in elements 2 and 3.
3. Determine the reaction force at node 2.

(Chandruptla and Belegundu, 2001).


O
For the truss shown in Figure, find:
1) The element stiffness matrix for each element.
2) The global equation.
3) The X and Y components of the
deflection at node 2.
4) The reaction at node 3.
5) The stress in element 1.

Consider the following parameters: h
1
= h
2
=
20 inch,
h
3
= 30 inch, A
1
= A
2
= 2 inch
2
, A
3
= 6 inch
2
,
E
1
= E
2
= E
3
= 10
7
psi,
F = 1000 lb, and = 45
0
.

C
C
C
C
F
1
2
3
26

O

For the truss shown in the Figure, find:
1. The element stiffness matrices.
2. The global stiffness matrix.
3. The x and y components of the
deflections at node 1.
4. The vertical reaction forces at the pivots
(2 and 3).
5. The stress in element 1.

The rods are identical and have the following
properties: the length of the element (link), h = 20", Area = 1 in
2
, and E = 10 Msi. The magnitude
of the applied force F = 1000 lb.




















10" 10"
1 2
C
C
C
F
27

V
M
X
dx
dX
dX
dV
V+
Y
4. BEAMS


Introduction

Beams are structural members which carry mainly transverse loadings.


Mathematical Model

Consider the static equilibrium of the differential element of a beam shown in Figure 1.













Figure 1 differential element of the beam

Where f(x) is the transverse force per unit length,
V is the shear force, and
M is the bending moment.
(2) 0 VdX dX
dX
dM
: moments the of Sum
(1) 0 dX
dX
dV
dX (X) f : direction Y in the forces the of Sum
=
=

Differentiating (2) and substituting from (1), we get: 0 ) x ( f
dX
M d
2
2
= (3)
From Mechanics of Materials,
2
2
dX
v d
EI M = , (3) becomes:

dX
dX
dM
M +

f(x)
28

0 ) X ( f
dX
v d
EI
dX
d
2
2
2
2
=
|
|

\
|
(4)

Where E is Youngs modulus, I the area moment of inertial about the z-axis, and v is the
transverse displacement. Notice that the bending moment and shear force, respectively, are:


3
3
2
2
dX
v d
EI V and ,
dX
v d
EI M = = (5)

Common types of boundary conditions:
Pivoted: 0. v EI M and , 0 v = = =
Clamped end: 0. v and , 0 v = =
Fixed end: 0. v EI V and , 0 v EI M = = = =
Equation (4) together with the appropriate BCs constitutes the mathematical model of the
static linear, elastic transverse deflection of the beam; it is in the form of a BVP and
consequently, the FE is one of the numerical methods of solution.

Mesh Generation and Function Approximation

Just like rods the domain is divided into elements with the solution assumed as a polynomial
over each element; that is the solution is assumed to be a piece-wise polynomial. In the case of
beams it is assumed to a cubic piece wise polynomial. The choice of a cubic polynomial is
ordained by the fact that the shear force is proportional to the third derivative of the
displacement (equation 3). Any lower polynomial would mean that the shear force is zero inside
the element.

=
=
4 .. 1 j
j j
e
elements
e
q ) x ( N ) x ( v where , ) x ( v ) X ( v , where
. 1
h
x
h
x
) x ( N ,
h
x
2 3
h
x
) x ( N
,
h
x
h
x
2 1 x ) x ( N ,
h
x
2
h
x
3 1 ) x ( N
2
4
2
3
2
2
3 2
1
)
`

=
)
`

\
|
=

\
|
+ |

\
|
= |

\
|
+ |

\
|
=
(6)

29

The nodal displacement vector q
j
is [v
1

1
v
2

2
], where
V
1
and v
2
are the nodal transverse displacements, and
1
and
2
are the nodal angular
displacements (rotation/slope).


Figure 2 The cubic shape functions


Element Equation Using GFEM

Following the main three steps outlined before:

(i) Residual

( ) 0 ) X ( f q EI R

=


(ii) Weighted residual

= =
element
i
4 : 1 i , 0 Rdx ) x ( N



(iii) Substitution from R and integration by parts twice renders:

( ) ( ) 4 : 1 i ) EIv ( N EIv N dx ) X ( f N dx EIv N
h
0
e
i
e
i
h
0
i
h
0
e
i
=

+ =




30


4 : 1 i V N M N dx ) X ( f N dxq EIN N
h
0
e
i
e
i
h
0
i j
4 : 1 j
h
0
j i
= + =

=


That is, 4 : 1 i B F q K
e
i
e
i
4 : 1 j
j
e
ij
= + =

=

h
0
e
i
e
i
e
i
h
0
i
e
i
h
0
j i
e
ij
e
ij
V N M N vector, force boundary element the is B
dx ) X ( f N vector, force nodal element the is F
dx N EI N K matrix, stiffness element the is K where

=



The element equation can be expressed in matrix/vector form


[ ]
e e e e
B F q K + =


Or upon manipulation:


e
2
2
1
1
e
2
2
1
1
2 2
2 2 e
3
M
V
M
V
h
6
h
6
12
fh
v
v
h 4 h 6 h 2 h 6
h 6 12 h 6 12
h 2 h 6 h 4 h 6
h 6 12 h 6 12
h
EI
|
|
|
|
|

\
|
+

+
+
|
|
|
|
|

\
|

=
|
|
|
|
|

\
|

(
(
(
(

\
|
(7)

Equation (7) is the element equation of a beam element, where E
e
, I
e
, and h are Youngs
modulus, area moment of inertia, and length of the element, respectively.
e
2
e
1
e
2
e
1
M , M and V , V
are the shear forces and bending moments at both ends of the beam element (Figure 3). The
expression of the element force vector F
e
is based on a constant transverse force (f). If f is a function
of X, the expression of F
e
has to be evaluated.






Figure 3 Schematic of the element boundary forces


M
1

V
2
e
V
1
e
M
2
e
31

Moment and shear force inside an element


If the nodal displacements (
e
2
e
2
e
1
e
1
and v , , v ) are known, then the Moment and the shear force
inside the element can be computed from:

( )
( ) (9) N v N N v N EI q N EI v EI V
(8) N v N N v N EI q N EI v EI M
e
2 4
e
2 3
e
1 2
e
1 1
e
4 : 1 i
i i
e e e e
e
2 4
e
2 3
e
1 2
e
1 1
e
4 : 1 i
i i
e e e e
+ + + = = =
+ + + = = =

=
=


The derivatives of the shape functions in equations (8) and (9) are:

|

\
|
+ =
|

\
|
=
|

\
|
+ =
|

\
|
+ =
h
x
3 1
h
2
N
h
x
2 1
h
6
N
h
x
3 2
h
2
N
h
x
2 1
h
6
N
4
2 3
2
2 1

2 4
3 3
2 2
3 1
h
6
N
h
12
N
h
6
N
h
12
N
=
=
=
=





Notice that the bending stress inside the element is given by:

I
My
e
=

where y is the transverse distance from the C.G. of the cross sectional area to the point of
interest.







y
z
C.G.
Figure 4 Cross sectional areas coordinates
32

Examples

O
The beam shown is clamped at both ends.
Using the GFE method with two equal
Elements find:
1. Element equations.
2. The global equation.
3. The deflection and slope at the midpoint B.
4. The reaction at the LHS end A.
5. The bending moment at X = 5.

Take E = 10
7
psi and I = 1 in
4
.
-------------------------------------------------------------------------------------------------------------------------------

1. Mesh Generation & function approx

Divide the domain into 2 equal, linear elements


q ) x ( N ) x ( v where , ) x ( v ) X ( v
4 : 1 j
e
j j
e
2 : 1 e
e

= =
=

2. Element Equations

|
|
|
|
|

\
|
+
|
|
|
|
|

\
|

=
|
|
|
|
|

\
|

(
(
(
(

|
|
|
|
|

\
|
+
|
|
|
|
|

\
|
=
|
|
|
|
|

\
|

(
(
(
(

..
..
..
..
100
60
100
60
v
v
400 60 200 60
60 12 60 12
200 60 400 60
60 12 60 12
10 [2] Element
..
..
..
..
0
0
0
0
v
v
400 60 200 60
60 12 60 12
200 60 400 60
60 12 60 12
10 [1] Element
e
2
2
1
1
4
e
2
2
1
1
4



10
X
10
f = 12 Lb/in

P=180 Lb
A
B
1 2
1
2
3
33

3. Assembly & B.C.

|
|
|
|
|
|
|
|

\
|

+
|
|
|
|
|
|
|
|

\
|

=
|
|
|
|
|
|
|
|

\
|

(
(
(
(
(
(
(
(


+ +
+ +

3
3
1
1
3
3
2
2
1
1
4
M
R
0
180
M
R
100
60
100 0
60 0
0
0
v
v
v
400 60 200 60
60 12 60 12
200 60 400 400 60 60 200 60
60 12 60 60 12 12 60 12
200 60 400 60
60 12 60 12
10


Storing the first, second, fifth and sixth rows; and eliminating the corresponding
columns (first, second, fifth and sixth); we get:

|
|

\
|
=
|
|

\
|

|
|

\
|

=
|
|

\
|

rad 1.25x10 -
in 001 . 0 v

100
240 v
800 0
0 24
10
5 -
2
2
2
2 4

4. i) Finding the reactions:

in . Lb
Lb
in . Lb
Lb

0 . 725
5 . 187
0 . 575
5 . 112
M
R
M
R

100 -
60
0
0

v
200 60
60 12
200 60
60 12
10
M
R
M
R
3
3
1
1
2
2 4
3
3
1
1
|
|
|
|
|

\
|

=
|
|
|
|
|

\
|

|
|
|
|
|

\
|
+
|
|

\
|

(
(
(
(

=
|
|
|
|
|

\
|


Note: R
1
+ R
3
= P + fxh 112.5 + 187.5 = 180 + 120 = 300 Lb

ii) Finding the Moment at X = 5 in:

From (8): X = 5 in lays in element # 1, consequently

( )
( )
2 4 2 3 1 2 1 1
] 1 [
4 : 1 i
i i
] 1 [
e
2 4
e
2 3
e
1 2
e
1 1
e
4 : 1 i
i i
e e e e
N v N N v N EI q N EI v EI M
N v N N v N EI q N EI v EI M
+ + + = = =
+ + + = = =

=
=

M(X=5) = 10
7
{0x(-0.001))+0.1x(-1.25x10
-5
)}= - 12.5 Lb-in



1 . 0
10
5
3 1
10
2
h
x
3 1
h
2
N and , 0
10
5
2 1
100
6
h
x
2 1
h
6
N
4
2
3
= |

\
|
+ = |

\
|
+ = = |

\
|
= |

\
|
=

34

O

The beam shown

Is clamped at A, and

Simply supported at

The midpoint B and the RHS end C. A moment M
0
= 10,000 Lb-in is applied at C. Using GFE find:

1. The angular displacements at B and C.
2. The reactions.
3. The bending moment at X = 13 in.
4. The bending stress at the same location (X=13 in), for I = 10 in
4
and y

= 0.6 in.
-------------------------------------------------------------------------------------------------------------------------------

1. Mesh Generation & function approx

Divide the domain into 2 equal, linear elements


q ) x ( N ) x ( v where , ) x ( v ) X ( v
4 : 1 j
e
j j
e
2 : 1 e
e

= =
=

2. Element Equations

|
|
|
|
|

\
|
+
|
|
|
|
|

\
|
=
|
|
|
|
|

\
|

(
(
(
(

..
..
..
..
0
0
0
0
v
v
400 60 200 60
60 12 60 12
200 60 400 60
60 12 60 12
10 [2] and [1] Element
e
2
2
1
1
5

3. Assembly & B.C.

|
|
|
|
|
|
|
|

\
|
+
|
|
|
|
|
|
|
|

\
|
=
|
|
|
|
|
|
|
|

\
|

(
(
(
(
(
(
(
(


+ +
+ +

4
3
2
1
1
3
3
2
2
1
1
5
10
R
0
R
M
R
0
0
0
0
0
0
v
v
v
400 60 200 60
60 12 60 12
200 60 400 400 60 60 200 60
60 12 60 60 12 12 60 12
200 60 400 60
60 12 60 12
10

10
10
(EI) = 10
8
Lb.in
2
A
C
B
M
0
1 2
1
2
3
35

Storing the first, second, third and fifth rows; and eliminating the corresponding
columns (first, second, third and fifth); we get:

rad
2.8610
10 14 . 7

10
0
400 200
200 800
10
4 -
-5
3
2
4
3
2 5
|
|

\
|
=
|
|

\
|

|
|

\
|
=
|
|

\
|


4. i) Finding the reactions:

Lb
Lb
in . Lb
Lb

7 . 1285
3 . 1714
6 . 1428
6 . 428
R
R
M
R

60 60
60 0
0 200
0 60
10
R
R
M
R
3
2
1
1
3
2 5
3
2
1
1
|
|
|
|
|

\
|

=
|
|
|
|
|

\
|

|
|

\
|

(
(
(
(


=
|
|
|
|
|

\
|


Note: R
1
+ R
2
+ R
3
= 0 - 428.6 + 1714.3 1285.7 = 0

ii) Finding the Moment at X = 13 in:

From (8): X = 13 in lays in element # 2 (x = 3 in), consequently:

( )
( )
3 4 3 3 2 2 2 1
] 2 [
4 : 1 i
i i
] 2 [
e
2 4
e
2 3
e
1 2
e
1 1
e
4 : 1 i
i i
e e e e
N v N N v N EI q N EI v EI M
N v N N v N EI q N EI v EI M
+ + + = = =
+ + + = = =

=
=

M(x=3 in) = 10
8
{ 0.22x7.14x10
-5
0.02x2.84x10
-4
} = 1000 Lb-in


02 . 0
10
3
3 1
10
2
h
x
3 1
h
2
N
22 . 0
10
3
3 2
10
2
h
x
3 2
h
2
N
4
2
= |

\
|
+ = |

\
|
+ =
=
|

\
|
+ =
|

\
|
+ =


The bending stress, psi 60
10
0.6 x 1000
I
My
= = = .






36

Problems # 4

O




For the clamped-pivoted steel beam (E=30x10
6
psi, and I = 6 in
4
) shown in the figure, using
two and equal FE, find the nodal displacements, and the reactions at the clamped end. Also,
what is the bending stress at the middle of the first element (X = 3 in)? Take y = 2 inch.



O





Using two equal elements, find the nodal displacements and the reactions (forces and
moments) for the beam shown in the figure. Also, find the bending stress at global X = 16 in.
Take E = 10
7
psi, I = 1 in
4
, C = 1 in,
F = 300 lb, and M = 400 lb-in.

6 in 6
in
f
0
=100 lb/in
M=400 Lb-in
10
in
10
in
M
F
37

O

The beam shown in the Figure is clamped in a rigid wall at the LHS end, and is suspended
with two identical cables at the midpoint A and at the RHS end. The equivalent stiffness of the
cable is 100,000 lb/in. The beam is subjected to a distributed force f
0
= 10 lb/in. Using the Finite
Element method, find the linear and angular displacements at the midpoint A. Take EI = 2.16
10
6
lb-in
2
.
What is the bending moment at X = 9 inch?








6 in 6 in
f
0
= 10 lb/in
A
K
c
= 100,000 lb/in
X
38

5. 2D HEAT CONDUCTION


Mathematical Model

The mathematical model is based on the conservation of energy.
For any control volume (Figure 1), the first law of thermodynamics states:

Q = Q
1
+ Q
2
(1)

Where Q is the rate of heat generated per unit volume.
Q
1
is the rate of heat conducted per unit volume
Q
2
is the rate of heat stored per unit volume.
The rate of heat conducted, Q1:

Let us introduce the heat flux q, which is the rate of heat transfer per unit area (Figure 2)

j

q i

q j

y
T
i

x
T
k n
T
k q
y x
+ =
)
`

l


where k thermal conductivity |W/m-
0
C|
T Temperature |
0
C|
q
x
Heat flux in the x direction |W/m
2
|
q
y
heat flux in the y direction
n Unit norm vector.

For the differential element shown in Figure 3, the net rate of heat conduction per unit volume is

(2) T k Q
T k
y
T
x
T
-k
y
T
k
y x
T
k
x y
q
x
q

dz . dy . dx dz . dx dy
y
q
dz . dy dx
x
q
Q
2
1
2
2
2
2
2
y
x
y
x
1
=
=
)
`

=
|
|

\
|

\
|

=
|
|

\
|

|
|

\
|


+ |

\
|


=

Q
Q
1
Q
2
q
n
Figure 2 The heat flux
Figure 1 Balancing of the rate of heat
q
x


q
y


dx
x
q
q
x


+
dy
y
q
q
y


+
dy
Figure 3 Differential element
dx
39

where
2
is the Laplacian,
2
2
2
2
2
y x

= .
The rate of heat stored, Q2:

The rate of heat stored is determined empirically:

T C
t
T
C Q
2
&
=

= (3)

where is the density |kg/m
3
|
C is the specific heat |J/kg-
0
C|
t is the time |s|

Substituting from (2) and (3) into (1) we get the governing DE of the 2D heat conduction:

Q T C T k
2
= +
&
(4)

Boundary conditions:

Four possible boundary conditions will be studied (Figure 4):

1. Specified temperature, T=T
specified
.
2. Perfect insulation, q=0.
3. Convection.
4. Radiation; is not covered in this course.

Convection boundary condition:

When a solid surface contacts a fluid, conservation of energy requires:

q
conduction
= q
convection


(5) ) T T (
x
T
k
b s
=



where

is the film temperature |W/m
2
-
0
C|,
T=T
0
C
C
C
C
Figure 4 The different boundary conditions
T
s
T
b
q
conv
q
cond
Figure 5 Heat fluxes at the interfaces
40

x
y
Figure 6 A generic rectangular FE
X
Y
C
C
C C
2h
2b
T
s
is the surface temperature,
T
b
is the bulk temperature (the average temperature of the fluid).
The mathematical model of the heat conduction is a BVP (DE & BC), consequently the FE is one
of the numerical techniques that can be applied to solve the heat conduction problems.

Mesh Generation and Function Approximation


The domain is divided into rectangular sub-domains
(elements). The temperature, T(X,Y), is
assumed to be a piecewise polynomial. The
temperature inside the element, T
e
(x,y) is
assumed to be quasi-linear:
(6) T ) y , x ( N ) y , x ( T where
) y , x ( T ) Y , X ( T
4 : 1 j
e
j j
e
ne : 1 e
e

=
=
=


In (6) T
j
e
and N
j
and are, respectively, the
nodal temperatures and the shape functions:

|

\
|
+ |

\
|
=
|

\
|
+ |

\
|
+ =
|

\
|
|

\
|
+ =
|

\
|
|

\
|
=
h
y
1
b
x
1
4
1
) y , x ( N
h
y
1
b
x
1
4
1
) y , x ( N
h
y
1
b
x
1
4
1
) y , x ( N
h
y
1
b
x
1
4
1
) y , x ( N
4
3
2
1
(7)


where b and h are half the width and height of the element, respectively.




41

Element Equation Using GFEM

The FE analysis is restricted to the steady state 2D heat conduction; that is, T
&
=0 in equation (4).
Following the three main steps of developing the element equations:

(i) 0 Q T C T k R
e e 2
+ =
&


(ii)

= =
element
i
4 : 1 i , 0 Rdx ) x ( N



(iii) Substitution from R:
( )

= +
|
|

\
|

= +
Area A
i
2
e 2
2
e 2
i
Area
e 2
i
0 Qdxdy N dxdy
y
T
k
x
T
k N
0 dA Q T k N


Now, integrate by part:

+ =
)
`

|
|

\
|

= +

+
|
|

\
|



h
h
b
b
e
i
b
b
h
h
e
i
A
i
4 : 1 j
e
j
h
h
b
b
j
i
j
i
A
i
h
h
b
b
e
i
b
b
h
h
e
i
h
h
b
b
e
i
e
i
dx
y
T
k N dy
x
T
k N Qdxdy N T dxdy
y
N
k
y
N
x
N
k
x
N
0 Qdxdy N dx
y
T
k N dy
x
T
k N dxdy
y
T
k
y
N
x
T
k
x
N

Or 4 : 1 i ... q Q T K
e
i
e
i
4 : 1 j
e
j
e
ij
= + =

=


[ ] (8) q Q T K
: form matrix a In
dx
y
T
k N dy
x
T
k N q vector, force) (boundary flux heat the is q
dxdy ) Y , X ( Q N Q vector, (force) generation heat of rate element the is Q
dxdy
y
N
k
y
N
x
N
k
x
N
K matrix, ) (stiffness ty conductivi element the is K
e e e e
h
h
b
b
e
i
b
b
h
h
e
i
e
i
e
i
h
h
b
b
i
e
i
e
i
h
h
b
b
j
i
j
i e
ij
e
ij
+ =

=
=
)
`

|
|

\
|








42

Evaluation of the separate components:

The conductivity matrix:

Substituting from the shape functions into the expression of
e
ij
K , for constant k, we get:

(
(
(
(
(
(
(
(

+ +
+ +
+ +
+ +
=
h
b
3
1
b
h
3
1
h
b
6
1
b
h
3
1
h
b
6
1
b
h
6
1
h
b
3
1
b
h
6
1
h
b
6
1
b
h
3
1
h
b
3
1
b
h
3
1
h
b
3
1
b
h
6
1
h
b
6
1
b
h
6
1
h
b
6
1
b
h
6
1
h
b
3
1
b
h
6
1
h
b
3
1
b
h
3
1
h
b
6
1
b
h
3
1
h
b
3
1
b
h
6
1
h
b
6
1
b
h
6
1
h
b
6
1
b
h
3
1
h
b
3
1
b
h
3
1
k K
e
(9)

The rate of heat generation vector:

For constant rate of heat generation, Q(X,Y) = Q
0
, the element rate of heat generation vector is:


|
|
|
|
|

\
|
=
1
1
1
1
bh Q Q
0
e
(10)

The element heat flux (convection) vector:

( ) ( )
4 : 1 i q q q q
dx q N dx q N dy q N dy q N
dy q N dy q N
dy
y
T
k N dy
x
T
k N q
B
i
T
i
L
i
R
i
h
b
b
y i
h
b
b
y i
b
h
h
x i
b
h
h
x i
h
h
b
b
y i
b
b
h
h
x i
h
h
b
b
e
i
b
b
h
h
e
i
e
i
= + + + =
+ + =

+ =






So, the heat convection vector is represented by four components. They represent the flux at
the four sides of the element: Right, left, top and bottom sides as shown in Figure 7.

43

h
b
b
x i
B
i
h
b
b
y i
T
i
b
h
h
x i
L
i
b
h
h
x i
R
i
dx q N q , dx q N q
dy q N q , dy q N q




+ = =
+ = =
(11)
Now substituting from the expressions of the
Shape functions (7) into the (11), we recover the
expression of the element heat convection flux vectors; e.g. for the RHS flux:



Substituting into N
i
taking into consideration that x = b, we get:

b
e
3
e
2
R
2
h
h
b
e
3
h
h
e
2
h
h
b
h
h
b 2
e
3
h
h
2
e
2
h
h
2
R
2
R
4
R
1
hT T
3
h
T
3
h 2
q
dy T
h
y
1
2
1
T dy
h
y
1
2
1
h
y
1
2
1
T dy
h
y
1
2
1
h
y
1
2
1

dy T N T dy
h
y
1
2
1
N T dy
h
y
1
2
1
N q
, 0 q q
+ |

\
|
+

=
|

\
|
+ |

\
|
+ |

\
|
|

\
|
|

\
|
=
+ |

\
|
+ |

\
|
=
= =





q
T
q
B
q
L q
R
Figure 7 Element flux vector
( )
b
h
h
b i
e
3
h
h
i
e
2
h
h
i
b
h
h
b i
b
e
4
h
h
4 i
e
3
h
h
3 i
e
2
h
h
2 i
e
1
h
h
1 i
b
h
h
b i
e
j
b
4 : 1 j
h
h
j i
b
h
h
b
4 : 1 j
e
j j i
b
h
h
b
e
i
b
h
h
x i
R
i
dy T N T dy
h
y
1
2
1
N T dy
h
y
1
2
1
N
dy T N T dy N N T dy N N T dy N N T dy N N
dy T N T dy N N
dy T T N N
dy T T N
4 : 1 i dy q N q

+ |

\
|
+ |

\
|
=
+ =
+ =
|
|

\
|
=
=
= =
Note: at x = b

N
1
= N
4
= 0

N
2
= (1 y/h)

N
3
= (1+y/h)
44

b
e
3
e
2
R
3
hT T
3
h 2
T
3
h
q
, Similarly
+
|

\
|
+

=


Combining all the four components of the RHS flux vector, we get:

|
|
|
|
|

\
|
+
|
|
|
|
|

\
|
(
(
(
(

=
|
|
|
|
|

\
|
=
0
1
1
0
hT
T
T
T
T
0 0 0 0
0 2 1 0
0 1 2 0
0 0 0 0
3
h
q
q
q
q
q
b
e
4
3
2
1
R
4
3
2
1
R


Similarly, the expression of the other three components of the flux can be determined:

|
|
|
|
|

\
|
+
|
|
|
|
|

\
|
(
(
(
(

=
|
|
|
|
|

\
|
=
|
|
|
|
|

\
|
+
|
|
|
|
|

\
|
(
(
(
(

=
|
|
|
|
|

\
|
=
|
|
|
|
|

\
|
+
|
|
|
|
|

\
|
(
(
(
(

=
|
|
|
|
|

\
|
=
0
0
1
1
bT
T
T
T
T
0 0 0 0
0 0 0 0
0 0 2 1
0 0 1 2
3
b
q
q
q
q
q
(12)
1
1
0
0
bT
T
T
T
T
2 1 0 0
1 2 0 0
0 0 0 0
0 0 0 0
3
b
q
q
q
q
q
1
0
0
1
hT
T
T
T
T
2 0 0 1
0 0 0 0
0 0 0 0
1 0 0 2
3
h
q
q
q
q
q
b
e
4
3
2
1
B
4
3
2
1
B
b
e
4
3
2
1
T
4
3
2
1
T
b
e
4
3
2
1
L
4
3
2
1
L










45

0.2 m
0.1 m
T =100
0
C
T = 40
0
C
= 30 W/(m
2
-
0
C), T
b
= 10
0
C
Example

Find the steady state temperature
distribution in the rectangular domain
shown, using two equal elements.
Neglect the heat generation, and take the
thermal conductivity of the material k = 6 W/(m-
0
C).
----------------------------------------------------------------

1. Mesh Generation & function approx

Divide the domain into 2 equal, linear elements


T ) y , x ( N ) y , x ( T where
) y , x ( T ) Y , X ( T
4 : 1 j
e
j j
e
2 : 1 e
e

=
=
=



2. Element Equations: Element # 1




[ ]
B T L R ] 1 [ ] 1 [ ] 1 [ ] 1 [
q q q q q Q T K + + + = + =






B L
b
] 1 [
4
3
2
1
] 1 [
4
3
2
1
q q
1
1
0
0
bT
T
T
T
T
2 1 0 0
1 2 0 0
0 0 0 0
0 0 0 0
3
b
T
T
T
T
3
2
6
1
3
1
6
1
6
1
3
2
6
1
3
1
3
1
6
1
3
2
6
1
6
1
3
1
6
1
3
2
6 + +
|
|
|
|
|

\
|
+
|
|
|
|
|

\
|
(
(
(
(

=
|
|
|
|
|

\
|
(
(
(
(
(
(
(
(






C
C
C C
C
1 2
Cancels out
Upon assembly
(action&reaction)
Unknown
(required to keep the
temperature constant)
Heat convection
(from eqn. 12)
Unknown
(required to keep the
temperature constant)
46

] 1 [
4
5
2
1
] 1 [
4
5
2
1
4
5
2
1
q
15
15
0
0
T
T
T
T
5 2 1 2 1
2 1 5 1 2
2 1 4 1
1 2 1 4
q
1
1
0
0
10 x 05 . 0 x 30
T
T
T
T
2 1 0 0
1 2 0 0
0 0 0 0
0 0 0 0
3
05 . 0 x 30
T
T
T
T
4 1 2 1
1 4 1 2
2 1 4 1
1 2 1 4
+
|
|
|
|
|

\
|
=
|
|
|
|
|

\
|
(
(
(
(





+
|
|
|
|
|

\
|
+
|
|
|
|
|

\
|
(
(
(
(

=
|
|
|
|
|

\
|
(
(
(
(







Element # 2:




[ ]
B T L R ] 2 [ ] 2 [ ] 2 [ ] 2 [
q q q q q Q T K + + + = + =






B
b
] 2 [
4
3
2
1
b
] 2 [
4
3
2
1
] 2 [
4
3
2
1
q
1
1
0
0
bT
T
T
T
T
2 1 0 0
1 2 0 0
0 0 0 0
0 0 0 0
3
b

0
1
1
0
hT
T
T
T
T
0 0 0 0
0 2 1 0
0 1 2 0
0 0 0 0
3
h
T
T
T
T
3
2
6
1
3
1
6
1
6
1
3
2
6
1
3
1
3
1
6
1
3
2
6
1
6
1
3
1
6
1
3
2
6
+
|
|
|
|
|

\
|
+
|
|
|
|
|

\
|
(
(
(
(

|
|
|
|
|

\
|
+
|
|
|
|
|

\
|
(
(
(
(

=
|
|
|
|
|

\
|
(
(
(
(
(
(
(
(








Heat convection
(from eqn. 12)
Heat convection
(from eqn. 12)
Cancels out
Upon assembly
(action&reaction)
Unknown
(required to keep the
temperature constant)
47

] 2 [
5
6
3
2
5
6
3
2
5
6
3
2
q
1
1
0
0
10 x 05 . 0 x 30
T
T
T
T
2 1 0 0
1 2 0 0
0 0 0 0
0 0 0 0
3
05 . 0 x 30

0
1
1
0
10 x 05 . 0 x 30
T
T
T
T
0 0 0 0
0 2 1 0
0 1 2 0
0 0 0 0
3
05 . 0 x 30
T
T
T
T
4 1 2 1
1 4 1 2
2 1 4 1
1 2 1 4
+
|
|
|
|
|

\
|
+
|
|
|
|
|

\
|
(
(
(
(

|
|
|
|
|

\
|
+
|
|
|
|
|

\
|
(
(
(
(

=
|
|
|
|
|

\
|
(
(
(
(






] 2 [
5
6
3
2
q
15
30
15
0
T
T
T
T
5 2 1 2 1
2 1 6 2 1 2
2 2 1 5 1
1 2 1 4
+
|
|
|
|
|

\
|
=
|
|
|
|
|

\
|
(
(
(
(








3. Assembly & B.C.




Saving the first four equations and removing the first four columns, taking into consideration
the values of the temperatures T
1
, T
2
, T
3
, and T
4
, we get


|
|
|
|
|
|
|
|

\
|
+
|
|
|
|
|
|
|
|

\
|
=
|
|
|
|
|
|
|
|

\
|
(
(
(
(
(
(
(
(







|
|
|
|
|
|
|
|

\
|
+
|
|
|
|
|
|
|
|

\
|
+
=
|
|
|
|
|
|
|
|

\
|
(
(
(
(
(
(
(
(


+


+

0
0
q
q
q
q
30
30
15
15
0
0
T
T
T
T
T
T
6 2 1 0 2 1 2 0
2 1 10 2 1 2 2 2
0 2 1 5 0 2 1
2 1 2 0 5 1 0
2 2 2 1 8 1
0 2 1 0 1 4
0
0
q
q
q
q
30
15 15
15
15
0
0
T
T
T
T
T
T
6 2 1 0 2 1 2 0
2 1 5 5 2 1 2 1 1 2
0 2 1 5 0 2 1
2 1 2 0 5 1 0
2 1 1 2 1 4 4 1
0 2 1 0 1 4
4
3
2
1
6
5
4
3
2
1
4
3
2
1
6
5
4
3
2
1
48

C
8 . 51
6 . 61
T
T

280
590
T
T
6 2 1
2 1 10
40 T
100 T
100 T
70 T
0 2 1 2 0
2 1 2 2 2
30
30
T
T
6 2 1
2 1 10
0
6
5
6
5
4
3
2
1
6
5
|
|

\
|
=
|
|

\
|
|
|

\
|
=
|
|

\
|
(

|
|
|
|
|

\
|
=
=
=
=
(

+
|
|

\
|
=
|
|

\
|
(



To get the nodal rate of heat required to keep the temperatures constants at nodes 1,2,3 and 4:

Use the saved equations:

W/m
115.8 -
235.9
323.2
16.8
15
15
0
0
T
T
T
T
T
T
0 2 1 5 0 2 1
2 1 2 0 5 1 0
2 2 2 1 8 1
0 2 1 0 1 4
q
q
q
q
6
5
4
3
2
1
4
3
2
1
|
|
|
|
|

\
|
=
|
|
|
|
|

\
|

|
|
|
|
|
|
|
|

\
|
(
(
(
(





=
|
|
|
|
|

\
|




















49

Problems # 5

O Solve this problem using the finite element method.

Find the steady-state temperature distribution (T
1
, T
2
, T
3
) on the convection surfaces shown
in the Figure, using the crude displayed mesh.







Consider the following material parameters: K = 12 W/m-
0
C, and = 60 W/m
2
-
0
C. The bulk
temperature of the fluid, T
b
, is 10
0
C.







0.2 m
0.1 m
0.1 m
T = 100
0
C
T = 60
0
C
C
C
C
50

0.3 m
0.2 m
T = 90
0
C
T = 30
0
C
O














For the 2-D, 0.2x0.3 m rectangular domain shown, in the Figure, find the steady state
temperature distribution using the finite element method.

Consider a uniform heat generation rate, Q
0
= 1000 Watt/m
3
, and take K = 10 W/m-
0
C,
= 10 W/m
2
-
0
C, and T
b
= 20
0
C.

Also, consider the uniform mesh shown (6 elements) with mesh size, h = 0.1 m.









Y
51


L
Node
C R
B
T
. Finite Difference

1. INTRODUCTION

Basic Strategy

The basic principle of the FD solution is to approximate the derivatives that exist in the
differential equations (DE) and/or boundary conditions (BC) in terms of the values of the
neighboring dependent variable. This approximation transforms the DE into a system of linear
algebraic equations (LAEs).

The solution, in general, is accomplished in three steps:

1. Grid Generation: the domain is covered with a distributed net of nodes (grid), as shown
in Figure 1, at which the DE is approximated. Notice, that elements have no role or
meaning in the FD analysis.

2. Using a truncated Taylors series expansion, the derivatives in the DE are approximated
in terms of the neighboring values of the dependent variable; e.g.,

( )
( )
( )
( )
( ) (5) U 4 U U U U
h
1
u
(4) U U 2 U
h
1
y
u
(3) U U 2 U
h
1
x
u
(2) U U
h 2
1
y
u
(1) U U
h 2
1
x
u
C B R T L 2
C
2
B C T 2
C
2
2
L C R 2
C
2
2
B T
C
L R
C
+ + +
+



x
y
Figure 1 FD Grid
52

where h is the mesh size; assuming a uniform mesh with h = x = y, and U
i
is the value
of the dependent variable, u, at node i. Consequently, the DE at C is converted into an
algebraic equation.

3. Repeat step 2 at every node; the DE is converted into a system of LAE. In a matrix form:

[K] U = F (6)

To accommodate derivative BC, usually the body is extended and a fictitious node is created.
For example, let us assume that at the RHS the BC (Figure 2) is a
x
u
=

. At node A the FD
approximations of the BC, after extending the body to the right and creating the fictitious point

F, becomes (equation 1):

( ) a U U
h 2
1
x
u
L F
A
=



This equation complements the system of LAE (6).


Approximation of the Derivatives

Derivation of the derivatives approximation (1) (5) is based on Taylors series expansion;

along the x direction:

(8) ...
x
f
! 5
h
x
f
! 4
h
x
f
! 3
h
x
f
2
h
x
f
h ) x ( f ) h x ( f
(7) ...
x
f
! 5
h
x
f
! 4
h
x
f
! 3
h
x
f
2
h
x
f
h ) x ( f ) h x ( f
5
i
5 5
4
i
4 4
3
i
3 3
2
i
2 2
i
i i
5
i
5 5
4
i
4 4
3
i
3 3
2
i
2 2
i
i i
+

=
+

+ = +


(7) + (8), and (7) (8), respectively give:

...
x
f
60
h
x
f
3
h
x
f
h 2 ) h x ( f ) h x ( f
...
x
f
12
h
x
f
h ) x ( f 2 ) h x ( f ) h x ( f
5
i
5 5
3
i
3 3
i
i i
4
i
4 4
2
i
2
2
i i i
+

= +
+

+ = + +


That is, respectively:
A L
T
B
F
Figure 2 Extended body and fictitious
point
j+1
j
j-1
i+1
i
i-1
Figure 3 FD-grid notation
53


{ }
{ }
)
`

+ =

)
`

+ + =

...
x
f
120
h
x
f
6
h
) h x ( f ) h x ( f
h 2
1
x
f
...
x
f
12
h
) x ( f 2 ) h x ( f ) h x ( f
h
1
x
f
5
i
5 4
3
i
3 2
i i
i
4
i
4 2
i i i
2 2
i
2


And based on the FD grid notation (Figure 3), we have:

( )
( ) (10) f f
h 2
1
x
f
(9) f f 2 f
h
1
x
f
j , 1 i j , 1 i
j , i
j , 1 i j , i j , 1 i 2
j , i
2
2
+
+
|

\
|

+
|
|

\
|



It can be seen that the error in the approximation (9) and (10) is in the order h
2
.

Similarly, along the y direction, we can show:

( )
( ) (12) f f
h 2
1
y
f
(11) f f 2 f
h
1
y
f
1 j , i 1 j , i
j , i
1 j , i j , i 1 j , i 2
j , i
2
2
+
+

|
|

\
|

+
|
|

\
|



Combining (9) and (11) gives:

( )
j , i 1 j , i j , 1 i 1 j , i j , 1 i
2
j , i
2
2
j , i
2
2
j , i
2
f 4 f f f f
h
1
y
f
x
f
f + + +
|
|

\
|

+
|
|

\
|

=
+ +


Or in a Pictorial form:


(13) f
1
1 4 1
1
h
1
f
j , i
2
j , i
2




Equation (13) is called the 5-point star formula; because of the star that can be formed in both
equation (13) and Figure 3.
54

Examples

O Solve the following BV problem using the FDM

, o u u = + 0 < X < 4

u(0) = 0 and u(4) = 1

--------------------------------------------------------------------

1. Create a uniform grid with 5 nodes

2. Using (9), the FD approximation of the DE at node i" is

( ) 0 U U U 2 U
h
1
u
dx
u d
i 1 i i 1 i
2
i
i
2
2
= + + +
|
|

\
|
+


That is (h = 1)

At 2: (U
3
- 2U
2
+ U
1
) + U
2
= U
3
- U
2
+ U
1
=0

At 3: (U
4
- 2U
3
+ U
2
) + U
3
= U
4
- U
3
+ U
2
=0

At 4: (U
5
- 2U
4
+ U
3
) + U
4
= U
5
- U
4
+ U
2
=0


3. In a matrix form

|
|
|

\
|
=
|
|
|

\
|
=
|
|
|

\
|
(
(
(

1
0
0
U
0
U
U
U
U
1 1
1 1 1
1 1
5
1
4
3
2

|
|
|

\
|

=
|
|
|

\
|
0
1
1
U
U
U
4
3
2











1 2 3 4 5
X
55

O Solve the following BV problem using the FDM

, X u = 0 < X < 1

u(0) = 0 and u(1) = 1

---------------------------------------------------------------------




1. Create a uniform grid with five nodes.

Also, because of the derivative BC at the RHS end, extend the body and create the

fictitious point A.

2. Using (9), the FD approximation of the DE at node i" is

( )
i 1 i i 1 i
2
i
2
2
X U U 2 U
h
1
dx
u d
= +
|
|

\
|
+


That is (h = 1/4)

At 2: (U
3
- 2U
2
+ U
1
) = h
2
x h = 1/64

At 3: (U
4
- 2U
3
+ U
2
) = h
2
x (2h) = 2/64

At 4: (U
5
- 2U
4
+ U
3
) = h
2
x (3h) = 3/64

At 5: (U
A
- 2U
5
+ U
4
) = h
2
x (4h) = 4/64

Using equation (1), the BC at node 5 can be expressed as

At 5: U
A
U
4
= 2h = U
A
= U
4
+ 1/2

Substituting from U
A
into the FD equation at node 5, renders:

At 5: (-2U
5
+2U
4
)= 4/64-1/2 = - 7/16



1 2 3 4 5
X
A
56

3. In a matrix form


|
|
|
|
|

\
|

|
|
|
|
|

\
|
=
|
|
|
|
|

\
|
(
(
(
(

16 7
64 3
64 2
64 1
0
0
0
U
U
U
U
U
2 2 0 0
1 2 1 0
0 1 2 1
0 0 1 2
1
5
4
3
2

|
|
|
|
|

\
|
=
|
|
|
|
|

\
|
6562 . 0
4375 . 0
2656 . 0
1250 . 0
U
U
U
U
5
4
3
2



Comparison with the FE results and exact solution:


FD FE EXACT
U
2
0.1250 0.1276 0.1276
U
3
0.2656 0.2708 0.2708
U
4
0.4375 0.4453 0.4453
U
5
0.6562 0.6667 0.6667


Note: The FE solution engenders exact results, to within the round-off errors, only for
special linear differential equations, called the quadratic problems. This problem
is a typical example of a quadratic problem. The FD solution on the other hand,
using the approximation addressed in this course (equations 1-5), always has an
error proportional to h
2
. To improve the accuracy of the FD solution, a finer grid
(more nodes) is needed.












57

Problems # 6


Solve the following problems using the finite difference Method (FDM).

O , 1
X
u
X
u
2
2
=

1 X 0 < < . Subjected to u(0) = 0 and u(1) = 0.


Use a uniform grid of 6 nodes.



O , 0 ) X 1 ( X
X
u
2
2
=

1 X 0 < < . Subjected to u(0) = 0 and u(1) = 0.



Use a uniform grid of 5 nodes.



O , 0 X u
X
u
2
2
= + +

1 X 0 < < . Subjected to u(0) = 0 and u(1) = 0.


Use a uniform grid of 5 nodes.
Compare the FD results with the FE, exact, and the approximate solution given in
the Introduction chapter.













58

2. 2D HEAT CONDUCTION


Introduction

The mathematical Model

The mathematical model of the heat conduction problem is developed previously, and belongs to the
class of BV problems: Differential equation + boundary conditions:

The governing differential equation is:


Q T C T k
2
= +
&
(1)

where is the density |kg/m
3
|
C is the specific heat |J/kg-
0
C|
k thermal conductivity |W/m-
0
C|
T Temperature |
0
C|
Q rate if heat generation/volume |W/m
3
|
The possible boundary conditions are (Figure 1):

5. Specified temperature, T=T
specified
.
6. Perfect insulation, q=0.
7. Convection.
8. Radiation; is not covered in this course.

For the convection boundary condition:


) T T (
x
T
k
b s
=

(2)


where is the film temperature |W/m
2
-
0
C|,
T
s
is the surface temperature,
T
b
is the bulk temperature (the average temperature of the fluid).
T=T
0
C
C
C
C
Figure 1 The different boundary conditions
59

Figure 2 Convection at the RHS point
A
n
n-1
The FD Approximation of the Derivative BC


Applying the DE approximation to the convection equation (2) at

node n gives (Figure 2):

( )
b n
1 n A
T T
h 2
T T
k




Or ( )
b n 1 n A
T T T T =



This equation can be generalized to cover all surfaces:

( )
bulk surface erior int fictitious
T T T T = (3)

Where
k
h 2
=


At perfectly-insulated surfaces = 0, and consequently T
A
= T
n-1
and the surface acts as a mirror.

That is:
erior int fictitious
T T =
















60

T=40
0
C
T=100
0
C
T=0
0
C
T=80
0
C
C
C C
C
Steady State Heat Conduction

Examples

O
Find the steady-state temperature in the square
domain, using the grid, shown in the Figure. Consider
constant temperatures of 80, 100, 40 and 0
0
C
at the right, bottom, left and top boundary
surfaces, respectively. Also, ignore the rate of heat
generation, Q.

-------------------------------------------------------

1. The grid is given.
2. The DE is Q T C T k
2
= +
&

The FD approximation of the DE (3) at node i,j is

0 T
1
1 4 1
1
h
1
T
j , i
2
j , i
2
=



At node 1: 40 + T
3
+ T
2
+ 100 4 T
1
= 0

At node 2: T
1
+ T
4
+ 80 + 100 4 T
2
= 0

At node 3: 40 + 0 + T
4
+ T
1
4 T
3
= 0

At node 4: T
3
+ 0 + 80 + T
2
4 T
4
= 0

3. In a matrix form:
|
|
|
|
|

\
|
=
|
|
|
|
|

\
|
(
(
(
(





80
40
180
140
T
T
T
T
4 1 1 0
1 4 0 1
1 0 4 1
0 1 1 4
4
3
2
1

|
|
|
|
|

\
|
=
|
|
|
|
|

\
|
5 . 47
5 . 37
5 . 72
5 . 62
T
T
T
T
4
3
2
1
0
C
61

O Find the steady-state temperature in the domain
shown in the Figure, using the given grid (h = 0.1 m).
The left and bottom surfaces are kept at 100
0
C,
and the rest at 0
0
C. A uniform rate of heat
Q = 10,000 W/m
3
is generated inside the domain.

Take the thermal conductivity k = 10 W/m-
0
C.

--------------------------------------------------------------


1. The grid is given.
2. The DE is Q T C T k
2
= +
&

The FD approximation of the DE (3) at node i,j is


k
Q
T
1
1 4 1
1
h
1
T
j , i
2
j , i
2
=



At node 1: 100 + 0 + 0 + T
2
4 T
1
= - 10

At node 2: 100 + T
1
+ T
3
+ 100 4 T
2
= - 10

At node 3: T
2
+ 0 + 0 + 100 4 T
3
= - 10

3. In a matrix form

|
|
|

\
|
=
|
|
|

\
|
(
(
(

110
210
110
T
T
T
4 1 0
1 4 1
0 1 4
3
2
1

|
|
|

\
|
=
|
|
|

\
|
43 . 46
71 . 75
43 . 46
T
T
T
3
2
1
0
C




T=100
0
C
T=100
0
C
T=0
0
C
T=0
0
C
C
C C
The magnitude and
distribution of the
temperature make sense
62

C C C
C
C

A B
E
D
C
F
T = 60
0
C
O For the domain and grid shown find the steady-state temperature distribution.

Consider the following parameters: k = 60 W/(m-
0
C), = 20 W/(m
2
-
0
C), T
b
= 20
0
C,

and a uniform mesh of size h = 0.3 m.

The heat generation rate is zero.

------------------------------------------------
-

1. The grid is provided.
We need to extend the body at the top and
right surfaces where the convection and
insulation (derivative boundary conditions) are; and
create the fictitious nodes A F.
2. The DE is Q T C T k
2
= +
&

The FD approximation of the DE (3) at node i,j is

0 T
1
1 4 1
1
h
1
T
j , i
2
j , i
2
=



At node 1: 60 + T
A
+ T
2
+ 60 4 T
1
= 0

At node 2: T
1
+ T
B
+ T
3
+ T
4
4 T
2
= 0

At node 3: T
2
+ T
C
+ T
D
+ T
5
4 T
3
= 0

At node 4: 60 + T
2
+ T
5
+ 60 4 T
4
= 0

At node 5: T
4
+ T
3
+ T
E
+ T
6
4 T
5
= 0

At node 6: 60 + T
5
+ T
F
+ 60 4 T
6
= 0


The FD approximation (equation 3) of the derivative BC at nodes A F is

At node A: T
A
= 60 - (T
1
T
b
)
63


At node B: T
B
= 60 - (T
2
T
b
)

At node C: T
C
= 60 - (T
3
T
b
)

At nodes D, E, and F respectively

T
D
= T
2
, T
E
= T
4
, T
F
= 60.

Substituting from the values of T
A
through T
F
into the DE at node 1, with = 0.2, renders:

T
2
4.2 T
1
+ 184 = 0.

Similarly, at the other 5 nodes we get:

At node 2: T
1
+ T
3
+ 2 T
4
4.2 T
2
+ 4 = 0

At node 3: 2 T
2
+ 2 T
5
4.2 T
3
+ 4 = 0

At node 4: T
2
+ T
5
4 T
4
+ 120 = 0

At node 5: 2 T
4
+ T
3
+ T
6
4 T
5
= 0

At node 6: T
5
4 T
6
+ 180 = 0

3. In a matrix form

|
|
|
|
|
|
|
|

\
|
=
|
|
|
|
|
|
|
|

\
|
(
(
(
(
(
(
(
(

180
0
120
4
4
184
T
T
T
T
T
T
4 1 0 0 0 0
1 4 2 1 0 0
0 1 4 0 1 0
0 2 0 2 . 4 2 0
0 0 2 1 2 . 4 1
0 0 0 0 1 2 . 4
6
5
4
3
2
1

|
|
|
|
|
|
|
|

\
|
=
|
|
|
|
|
|
|
|

\
|
41 . 59
65 . 57
23 . 58
73 . 54
28 . 55
97 . 56
T
T
T
T
T
T
6
5
4
3
2
1
0
C






64

0.2 m
0.1 m
T =100
0
C
T = 40
0
C
= 30 W/(m
2
-
0
C), T
b
= 10
0
C
O Find the steady state temperature
distribution in the rectangular domain
shown, using the grid shown below.

Neglect the heat generation, and take the
thermal conductivity of the material k = 6 W/(m-
0
C).

----------------------------------------------------------------

1. Generate the shown grid
2. Applying the FD approximations at 5 and 6
At node 5: 40 + T
A
+ T
6
+ 100 4 T
5
= 0
At node 6: T
5
+ T
B
+ T
C
+ 100 4 T
6
= 0
At the fictitious nodes:
At node A: T
A
= 100 - (T
5
T
b
)
At node B: T
B
= 100 - (T
6
T
b
)
At node C: T
C
= T
5
- (T
6
T
b
)
Where T
b
= 10
0
C and 1
6
1 . 0 x 30 x 2
k
h 2
= =

= .
Substituting from the values of the fictitious temperatures into the FD equations at nodes 5
and 6 gives:
At node 5: 5 T
5
T
6
= 250
At node 6: 6 T
6
2 T
5
= 220

3. In a matrix form:
|
|

\
|
=
|
|

\
|
(

220
250
T
T
6 2
1 5
6
5

|
|

\
|
=
|
|

\
|
14 . 57
43 . 61
T
T
6
5 0
C The FE solution:
|
|

\
|
8 . 51
6 . 61
0
C



C

C
C
C C
A
B
C
65

Problems # 7

O Solve this problem using the finite difference method.

Find the steady-state temperature distribution (T
1
, T
2
, T
3
) on the convection surfaces shown
in the Figure, using the crude displayed mesh.







Consider the following material parameters: K = 12 W/m-
0
C, and = 60 W/m
2
-
0
C. The bulk
temperature of the fluid, T
b
, is 10
0
C.






0.2 m
0.1 m
0.1 m
T = 100
0
C
T = 60
0
C
C
C
C
66

0.3 m
0.2 m
T = 90
0
C
T = 30
0
C

O














For the 2-D, 0.2x0.3 m rectangular domain shown, in the Figure, find the steady state
temperature distribution using the finite difference method.

Consider a uniform heat generation rate, Q
0
= 1000 Watt/m
3
, and take K = 10 W/m-
0
C,
= 10 W/m
2
-
0
C, and T
b
= 20
0
C.

Also, consider the uniform grid shown (6 nodes) with mesh size, h = 0.1 m.







Y
C C C
C C
67

t
0
t
k-2
t
k-1
t
k
t
k+1
t
k+2
Past
Future
T
Time, t
Transient Heat Conduction


In general, transient problems are solved in two steps: the temporal first then the spatial one.
The temporal is solved using numerical integration; in here the -method will be
addressed.
The spatial problem will be solved using the FD method that we have studied.
The temporal problem and the -method

Equation (1) can be arranged as:
) t , y , x ( f
C
Q
T
C
K
t
T
2
=

. (4)
Now let us divide the time domain into equal intervals t
and assume that the past history of the temperature (T
k-1
,
T
k-2
, , T
0
) is known at times t
k-1
, t
k-2
, , t
0
, respectively;
and we want to predict the current temperature (T
k
) at
time t
k
and the future ones at times t
k+1
, t
k+2
,

The prediction is accomplished in a step-by-step manner.
The current temperature T
k
at time t
k
is determined in terms of the known temperature at the
previous time t
k-1
. Then, the temperature T
k+1
at the new time t
k+1
is determined in terms of
temperature at the new-previous time t
k
. We repeat this process until we get to the time at
which the temperature is needed. This process is called the time marching technique.

Integrate equation (4) from t
k-1
to t
k
, we get

=

k
1 k
t
t
1 k k
dt ) t , y , x ( f T T (5)
The -method estimates the integration of the RHS of equation (5) in terms of a linear
combination of the value of f at the previous and new times. That is,
( ) { } 0 1 ... , f 1 f t dt ) t , y , x ( f
1 k k
t
t
k
1 k
+ =


(6)
T
0
T
k-1
T
k-2
T
k T
k+1
T
k+2
Figure 1 Time domain grid
68

t
k
f
t
t
k-1
f
k-1
f
k
t
t
k
f
t
t
k-1
f
k-1
f
k
t
Euler Crank-Nicolson
Figure 2 Graphical presentations of Euler and Crank-Nicolson
The -method encompasses a family of methods:
= 0 Euler method
= Crank-Nicolson method
= 2/3 Galerkin method
= 1 Back-ward method
Two methods will be covered here: the Euler, and Crank-Nicholson methods. Both are popular
for different reasons: Euler because of its simplicity and Crank-Nicholson because of its
accuracy.

Applying Euler and Crank-Nicolson methods to (6) engenders, respectively:
Euler: { }
1 k
t
t
f t dt ) t , y , x ( f
k
1 k

=

(7)
Crank-Nicolson: { }
1 k k
t
t
f f
2
t
dt ) t , y , x ( f
k
1 k

=

(8)

A graphical presentation of both methods is
shown in Figure 2. It is clear, in general, that
Crank-Nicolson is the more accurate one.

Local error:
Euler: order of t
2

Crank: order of t
3


Substituting from (7) and (8) into (5) gives:

Euler
1 k
2 1 k k
C
Q
T
C
K
t T T

)
`

= (9)
Crank-Nicholson

|
|

\
|

+
|
|

\
|

1 k
2
k
2 1 k k
C
Q
T
C
K
C
Q
T
C
K
2
t
T T (10)
69

The spatial problem

For the spatial problem we apply the FD approximation to the derivatives that exist in both
equations (9) and (10)

1. EULER METHOD:

At any node i,j, (9) is satisfied, that is:
( )
(11)
Ch
K t
r where Q
C
t
T
r
r r 4 1 r
r
T Or
Q
C
t
T
1
1 4 1
1
h
1
C
K
t
C
Q
T
C
K
t T T
2
1 k
j , i
1 k
j , i
k
j , i
1 k
j , i
1 k
j , i
2
1 k
j , i
j , i
2 1 k
j , i
k
j , i

=
)
`



2. CRANK-NICHOLSON

Satisfying (10) at node i,j gives:
k
j , i
k
j , i
2
1 k
j , i
1 k
j , i
2
1 k
j , i
2
k
j , i
2 1 k
j , i
k
j , i
Q
C 2
t
T
1
1 4 1
1
h
1
C
K
2
t
Q
C 2
t
T
1
1 4 1
1
h
1
C
K
2
t

C
Q
T
C
K
C
Q
T
C
K
2
t
T T

|
|

\
|

+
|
|

\
|


( ) ( )
( ) (12) Q Q
C
t
T
r
r r 4 2 r
r
T
r
r r 4 2 r
r
Or
Q Q
C
t
T
r
r r 4 r
r
T
r
r r 4 r
r
T T 2
k
j , i
1 k
j , i
1 k
j , i
k
j , i
k
j , i
1 k
j , i
k
j , i
1 k
j , i
1 k
j , i
k
j , i
+

=



70

The recurrence equations (11) and (12) are the FD approximation of the heat conduction DE at
any node i,j and time k. Knowing the temperature distribution at time k-1, the
temperature distribution can be directly determined using Euler method (11), and indirectly
(solving a system of Algebraic equations) using the Crank-Nicolson method. That is why the
Euler method is called the Explicit method, while the Crank-Nicholson is called the Implicit
method.

It can be shown that the 1D version of (11) and (12), respectively are:

Euler: ( ) { }
1 k
i
1 k
1 i i 1 i
k
i
Q
C
t
rT T r 2 1 rT T

+

+ + + = (13)

Crank-Nicolson: ( ) { } ( ) { } + + + = + +

+ +
1 k
1 i i 1 i
k
1 i i 1 i
rT T r 1 2 rT rT T r 1 2 rT ( )
k
i
1 k
i
Q Q
C
t
+


(14)

















71

C C C
T=0
0
C
T=100
0
C
Examples

O The slab shown in Figure was
initially kept at 100
0
C. The
temperature of the LHS wall is
suddenly reduced to 0
0
C. Find the
temperature evolution with time, using the Euler method. Take Q = 0.
The temperature of the RHS wall is kept at 100
0
C all time. Use the uniform grid shown.
-------------------------------------------------------------------------------------------------------------------
1. The grid is given
2. The FD approximation at time-step k and node i is (13),
( ) { }
1 k
j , i
1 k
1 i i 1 i
k
i
Q
C
t
rT T r 2 1 rT T

+

+ + + =



At node 1: T
1
= r T
L
+ (1-2r)T
1
+ rT
2
At node 2: T
2
= r T
1
+ (1-2r)T
2
+ rT
3
At node 3: T
3
= r T
2
+ (1-2r)T
3
+ rT
R
3. In a matrix form:
|
|
|

\
|
+
|
|
|

\
|
(
(
(

=
|
|
|

\
|
= = =
|
|
|

\
|
+
|
|
|

\
|
(
(
(

=
|
|
|

\
|

25
0
0
T
T
T
2 1 0
1 2 1
0 1 2
4
1
T
T
T
C 100 T and , 0 T ,
4
1
r For
T
0
T
r
T
T
T
r 2 1 r 0
r r 2 1 r
0 r r 2 1
T
T
T
1 k
3
2
1
k
3
2
1
0
R L
R
L
1 k
3
2
1
k
3
2
1

Now march on time:
At previous time step k-1

At current time step k

72

C
C C C
T=0
0
C
T
b
=20
0
C
k = 1 C
100
100
75
25
0
0
100
100
100
2 1 0
1 2 1
0 1 2
4
1
25
0
0
T
T
T
2 1 0
1 2 1
0 1 2
4
1
T
T
T
0
0
3
2
1
1
3
2
1
|
|
|

\
|
=
|
|
|

\
|
+
|
|
|

\
|
(
(
(

=
|
|
|

\
|
+
|
|
|

\
|
(
(
(

=
|
|
|

\
|

k=2 C
100
75 . 93
5 . 62
25
0
0
100
100
75
2 1 0
1 2 1
0 1 2
4
1
25
0
0
T
T
T
2 1 0
1 2 1
0 1 2
4
1
T
T
T
0
1
3
2
1
2
3
2
1
|
|
|

\
|
=
|
|
|

\
|
+
|
|
|

\
|
(
(
(

=
|
|
|

\
|
+
|
|
|

\
|
(
(
(

=
|
|
|

\
|
k=3 C
44 . 98
5 . 87
69 . 54
25
0
0
100
75 . 93
5 . 62
2 1 0
1 2 1
0 1 2
4
1
25
0
0
T
T
T
2 1 0
1 2 1
0 1 2
4
1
T
T
T
0
2
3
2
1
3
3
2
1
|
|
|

\
|
=
|
|
|

\
|
+
|
|
|

\
|
(
(
(

=
|
|
|

\
|
+
|
|
|

\
|
(
(
(

=
|
|
|

\
|

And so on


O
The slab shown in Figure was initially
kept at 100
0
C. The temperature of
the LHS wall is suddenly reduced to 0
0
C, and the RHS wall is quenched by a fluid having a constant temperature of 20
0
C.

Find the
temperature evolution with time, using the Crank-Nicolson method. Take Q = 0, and the non-
dimensional film coefficient at the RHS wall, = 0.1
-------------------------------------------------------------------------------------------------------------------
1. The grid is given. Because of the
derivative BC at the RHS wall,
extend the body and create a
fictitious temperature A.
2. The FD approximation at time
step k is (14):

( ) { } ( ) { } + + + = + +

+ +
1 k
1 i i 1 i
k
1 i i 1 i
rT T r 1 2 rT rT T r 1 2 rT
( )
k
j , i
1 k
j , i
Q Q
C
t
+



C
C C
A
C
73



At node 1: -rT
L
+ 2(1+r)T
1
-rT
2
= r T
L
+ 2(1-r)T
1
+ rT
2
At node 2: -rT
1
+ 2(1+r)T
2
-rT
3
= r T
1
+ 2(1-r)T
2
+ rT
3
At node 3: -rT
2
+ 2(1+r)T
3
-rT
4
= r T
2
+ 2(1-r)T
3
+ rT
4
At node 4: -rT
3
+ 2(1+r)T
4
-rT
A
= r T
3
+ 2(1-r)T
4
+ rT
A
At node A: T
A
= T
3
- (T
4
T
b
), at all times. Substituting back gives:
At node 4: -2rT
3
+ (2+2r+r)T
4
- rT
b
= 2r T
3
+ (2-2r-r)T
4
+ rT
b
3. In a matrix form:
|
|
|
|
|

\
|

+
+
|
|
|
|
|

\
|
(
(
(
(

=
|
|
|
|
|

\
|
(
(
(
(

+ +
+
+
+

b
1 k
L
k
L
1 k
4
3
2
1
k
4
3
2
1
rT 2
0
0
rT rT
T
T
T
T
r r 2 2 r 2 0 0
r r 2 2 r 0
0 r r 2 2 r
0 0 r r 2 2
T
T
T
T
r r 2 2 r 2 0 0
r r 2 2 r 0
0 r r 2 2 r
0 0 r r 2 2

For r=1, T
L
=0, T
b
= 20
0
C and = 0.1:
|
|
|
|
|

\
|
+
|
|
|
|
|

\
|
(
(
(
(

=
|
|
|
|
|

\
|
(
(
(
(


4
0
0
0
T
T
T
T
1 . 0 2 0 0
1 0 1 0
0 1 0 1
0 0 1 0
T
T
T
T
1 . 4 2 0 0
1 4 1 0
0 1 4 1
0 0 1 4
1 k
4
3
2
1
k
4
3
2
1

Now Time-marching:
k=1:
|
|
|
|
|

\
|
+
|
|
|
|
|

\
|
(
(
(
(

=
|
|
|
|
|

\
|
(
(
(
(

4
0
0
0
100
100
100
100
1 . 0 2 0 0
1 0 1 0
0 1 0 1
0 0 1 0
T
T
T
T
1 . 4 2 0 0
1 4 1 0
0 1 4 1
0 0 1 4
1
4
3
2
1

|
|
|
|
|

\
|
=
|
|
|
|
|

\
|
38 . 92
39 . 94
17 . 85
29 . 46
T
T
T
T
1
4
3
2
1
0
C
k=2:
|
|
|
|
|

\
|
+
|
|
|
|
|

\
|
(
(
(
(

=
|
|
|
|
|

\
|
(
(
(
(

4
0
0
0
38 . 92
39 . 94
17 . 85
29 . 46
1 . 0 2 0 0
1 0 1 0
0 1 0 1
0 0 1 0
T
T
T
T
1 . 4 2 0 0
1 4 1 0
0 1 4 1
0 0 1 4
2
4
3
2
1

|
|
|
|
|

\
|
=
|
|
|
|
|

\
|
55 . 83
51 . 81
93 . 64
52 . 37
T
T
T
T
2
4
3
2
1
0
C
And so on
At current time step k

At previous time step k-1

74

Note: The matrix-form can be expressed in a general format:
[ ] [ ] Q TB T 2 K T 1 K
1 k k
+ + =

,
where [K1] and [K2] may be called the Crank-Nicolson matrices, TB is the nodal temperature
B.C. vector and Q is the nodal rate of heat generation vector (in this example, Q is 0). This
equation is pertinent to computer programming. A typical MATLAB program is provided
below for solving this example.


%*****************************************************
% Crank-Nicolson Implicit method
% with derivative BCs
% [K1]*T = [K2]*T0 + TB
%*****************************************************
% Data
% nstep = the number of time-step to be performed
nsteps = 20; h = 0.01; TL = 0; Tb = 0; r = 1;
C = 500; k = 20; beta = 100; rho = 9500;
%......................................................
% Basics
dt = r*rho*C*h^2/k;
gamma = 2*beta*h/k;
% Matrices
K1 = [2*(1+r) -r 0 0; -r 2*(1+r) -r 0; 0 -r 2*(1+r) -r; 0 0 -
2*r 2*(1+r)+gamma*r];
K2 = [2*(1-r) r 0 0; r 2*(1-r) r 0; 0 r 2*(1-r) r; 0 0 2*r
2*(1-r)- gamma*r];
TB = [2*r*TL;0;0; 2*r*gamma*Tb];
T0 = [100;100;100;100];
%......................................................
% Solve via time-marching
% TH = Matrix stores the temperature results with time
for n = 1:nsteps,
time(n)= dt*n;
T = K1\(K2*T0+TB);
TH(:,n)= T;
T0 = T;
end
%......................................................
% Plot the evolution of temperature at the midpoint vs time
T_mid = TH(2,:);
plot(time,T_mid);
75

0.2 m
0.3 m
T = 80
0
C
T = 100
0
C
C
C
D
A
B
C
C C
C C

O
For the rectangle domain shown
in the Figure, find the
temperature distribution after
two time steps. Neglect the rate
of heat generation inside the
material, and consider the
uniform grid shown. Take the
initial temperature of the
domain to be 0
0
C.
-------------------------------------------
1. Grid is given. Extend the
body and create fictitious
nodes A, B, C and D.
2. The FD approximation at i,j is using Euler approximation using Euler method is (11)
Q
C
t
T
r
r r 4 1 r
r
T
1 k
j , i
1 k
j , i
k
j , i

=
Fot r=1/4;
( )
( )
( )
( )
( )
( ) 4 100 T T T T
4 100 T T T T
4 100 T T T T
4 T T 80 T T
4 T T 80 T T
4 T 80 T T T
1 k
B 3 5
k
6
1 k
6 2 4
k
5
1 k
5 1 D
k
4
1 k
6 A 2
k
3
1 k
5 3 1
k
2
1 k
4 2 C
k
1

+ + + =
+ + + =
+ + + =
+ + + =
+ + + =
+ + + =

T
C
= T
2
, T
D
= T
5
and T
A
= T
3
- (T
2
T
b
), T
B
= T
6
- (T
5
-T
b
) where = 1 . 0
40
1 . 0 x 20 x 2
K
h 2
= =

( )
( ) 4 40 T 1 . 0 T T
4 40 T 1 . 0 T T
0
6 5
0
B
0
3 2
0
A
= =
= =

T
b
= 40
0
C

= 20 W/m
2
-
0
C
C C
C C
K = 40 W/m-
0
C
76

At the first time step k = 1:
( )
( )
( )
( )
( )
( ) 26 4 100 T T T T
25 4 100 T T T T
25 4 100 T 2 T T
21 4 T T 80 T T
20 4 T T 80 T T
20 4 T 80 T 2 T
0
B 3 5
1
6
0
6 2 4
1
5
0
5 1
1
4
0
6 A 2
1
3
0
5 3 1
1
2
0
4 2
1
1
= + + + =
= + + + =
= + + =
= + + + =
= + + + =
= + + =
,
( )
( ) 4 . 26 40 T 1 . 0 T T
9 . 21 40 T 1 . 0 T T
1
6 5
1
B
1
3 2
1
A
= =
= =


At the second time step k = 2:
( )
( ) ( )
( ) ( )
( ) ( )
( ) ( )
( ) ( ) 1 . 43 4 100 4 . 26 21 25 4 100 T T T T
75 . 42 4 100 26 20 25 4 100 T T T T
5 . 42 4 100 50 20 4 100 T 2 T T
975 . 36 4 26 9 . 21 80 20 4 T T 80 T T
5 . 36 4 25 21 80 20 4 T T 80 T T
25 . 36 4 ) 25 80 40 ( 4 T 80 T 2 T
1
B 3 5
2
6
1
6 2 4
2
5
1
5 1
2
4
1
6 A 2
2
3
1
5 3 1
2
2
1
4 2
2
1
= + + + = + + + =
= + + + = + + + =
= + + = + + =
= + + + = + + + =
= + + + = + + + =
= + + = + + =


Notes:
All units of temperatures are in
0
C.
For Euler method, we dont have to cast the equations into the matrix form.
If we want to know the real time after the two time steps, we use
C
K
h
t
r
2

= or
K
C
rh t
2

= . (15)
Check units: sec
W
J
W
C m
C Kg
J
m
Kg
m t
0
0 3
2
= = =
So, if = 4000 Kg/m
3
and C = 50 J/kg-
0
C then
( ) 25 . 12
40
50 x 4000
1 . 0
4
1
t
2
= = sec
And the time after two steps = 2xt = 25 sec
The choice of r is based on a compromise between accuracy (smaller) and efficiency
(larger). It is mainly from experience.
77

O
Find the temperature distribution (T
1
, T
2
, T
3
) on the convection surfaces, shown in the
Figure, after two time steps (r = 1/4) using the crude displayed mesh.






Consider the following material parameters: K = 50 W/m-
0
C, = 5,000 Kg/m
3
, and C = 10 J/Kg-
0
C. At the convection surfaces take = 100 W/m
2
-
0
C and the bulk temperature of the fluid, T
b
, is
10
0
C. Also, consider a uniform rate of heat generation:
t
1
2
e Q

= , where
1
=500,000 W/m
3

and
2
=0.08 sec
-1
.
Take the initial temperature as 0
0
C.
-------------------------------------------------------------------------------
1. The grid is given. At convection surfaces, extend the body
and create the fictitious points T
A
and T
B
(T
A
belongs to
surface 1-2, and T
B
belongs to surface 2-3), as seen in the
Figure. By now it is understood that the insulation
surfaces act as mirrors.
0.2 m
0.1 m
0.1 m
T = 100
0
C
T = 60
0
C
C
C
C
C
C
C
B
A
78

2. The FD difference approximation at the surface nodes is:
Q
C
t
T
r
r r 4 1 r
r
T
1 k
j , i
1 k
j , i
k
j , i

=
where from (15), ( ) sec 5 . 2
50
10 x 5000
1 . 0
4
1
t
2
= = ; consequently,
( )
( )
( )
1 k
3
1 k
2 B
k
3
1 k
2
1 k
3 1
k
2
1 k
1
1 k
A 2
k
1
Q
C
t
60 T 2 T
4
1
T
Q
C
t
T 60 100 T
4
1
T
Q
C
t
T 100 T 2
4
1
T

+ + + =

+ + + + =

+ + + =
and
4 . 0
50
1 . 0 x 100 x 2
K
h 2
) T T ( 60 T
) T T ( 100 T
b 3 B
b 1 A
= =

=
=
=
,

3 -0.08x0 t k
1
0 0 0
B
0 0
A
W/m 000 , 500 e 000 , 500 e Q and C 64 T , C 104 T
2
= = = = =



At the first time step, k = 1:
( ) ( )
( ) ( )
( ) ( ) C 56 000 , 500
10 x 000 , 5
5 . 2
60 0 x 2 64
4
1
Q
C
t
60 T 2 T
4
1
T
C 65 000 , 500
10 x 000 , 5
5 . 2
0 60 100 0
4
1
Q
C
t
T 60 100 T
4
1
T
C 76 000 , 500
10 x 000 , 5
5 . 2
104 100 0 x 2
4
1
Q
C
t
T 100 T 2
4
1
T
0 0
3
0
2 B
1
3
0 0
2
0
3 1
1
2
0 0
1
0
A 2
1
1
= + + + =

+ + + =
= + + + + =

+ + + + =
= + + + =

+ + + =


3 0.08x2.5 - t k
1
1
0
b 3 B
0
b
1
1
1
A
W/m 365 , 409 e 000 , 500 e Q
C 6 . 41 ) 10 56 ( 4 . 0 60 ) T T ( 60 T
C 6 . 73 ) 10 76 ( 4 . 0 100 ) T T ( 100 T
2
= = =
= = =
= = =



At the second time step, k = 2:
79

( ) ( )
( ) ( )
( ) ( ) C 37 . 78 365 , 409
10 x 000 , 5
5 . 2
60 65 x 2 6 . 41
4
1
Q
C
t
60 T 2 T
4
1
T
C 93.47 365 , 409
10 x 000 , 5
5 . 2
56 60 100 76
4
1
Q
C
t
T 60 100 T
4
1
T
C 37 . 96 365 , 409
10 x 000 , 5
5 . 2
6 . 73 100 65 x 2
4
1
Q
C
t
T 100 T 2
4
1
T
0 1
3
1
2 B
2
3
0 1
2
1
3 1
2
2
0 1
1
1
A 2
2
1
= + + + =

+ + + =
= + + + + =

+ + + + =
= + + + =

+ + + =


O
The 0.3x0.3 m
2
domain shown
generates a non-uniform heat at the
rate of Q = Q
0
(1+X+Y) W/m
3
, where Q
0

= 40,000 W/m
4
. The top and left
surfaces are kept at 0
0
C, and the right
and bottom surfaces at 100
0
C at all
times. Using the FD method and the
Crank-Nicolson with r = 1, find the
temperature distribution, for the mesh
shown, after 2 time steps.
Consider the following material
constants: K = 40 W/m-
0
C, = 8,000
Kg/m
3
, and C = 50 J/Kg-
0
C. Take all initial condition temperatures as 0
0
C.
-------------------------------------------------------------------------------------------------------------------------------
1. Mesh is provided; no extension is needed (No derivative boundary conditions)
2. The FD equation at the interior nodes is
( )
k
j , i
1 k
j , i
1 k
j , i
k
j , i
Q Q
C
t
T
r
r r 4 2 r
r
T
r
r r 4 2 r
r
+



With a constant rate of heat generation (Q does not change with time), we get:
T=0
0
C
T=100
0
C
T=0
0
C
T=100
0
C
C
C C
C
Y
X
80

j , i
1 k
j , i
k
j , i
Q
C
t 2
T
r
r r 4 2 r
r
T
r
r r 4 2 r
r


where from (15), ( )( ) sec 100
40
50 x 8000
1 . 0 1 t
2
= = ; consequently,


( ) ( ) ( ) ( )
( ) ( ) ( ) ( )
( ) ( ) ( ) ( )
( ) ( ) ( ) ( )
4 4 B R 2 3 4 B R 2 3
3 3 B 4 1 L 3 B 4 1 L
2 2 4 R T 1 2 4 R T 1
1 1 3 2 T L 1 3 2 T L
Q
C
t 2
T r 4 2 T T T T r T r 4 2 T T T T r
Q
C
t 2
T r 4 2 T T T T r T r 4 2 T T T T r
Q
C
t 2
T r 4 2 T T T T r T r 4 2 T T T T r
Q
C
t 2
T r 4 2 T T T T r T r 4 2 T T T T r

+ + + + + = + + + + +

+ + + + + = + + + + +

+ + + + + = + + + + +

+ + + + + = + + + + +

3. In a matrix form
The above equation can be expressed in a general format:
[ ] [ ] Q TB T 2 K T 1 K
1 k k
+ + =

,
where [K1] and [K2] may called the Crank-Nicolson matrices, TB is the nodal temperature
B.C. vector and Q is the nodal rate of heat generation vector. This equation is pertinent to
computer programming.

For r = 1 and the given parameters, we get

At current time step k

At previous time step k-1

|
|
|
|
|

\
|

+
|
|
|
|
|

\
|
+
+
+
+
+
|
|
|
|
|

\
|
(
(
(
(

=
|
|
|
|
|

\
|
(
(
(
(

+
+
+
+

4
3
2
1
B R
B L
R T
T L
1 k
4
3
2
1
k
4
3
2
1
Q
Q
Q
Q
C
t 2
T T
T T
T T
T T
r 2
T
T
T
T
r 4 2 r r 0
r r 4 2 0 r
r 0 r 4 2 r
0 r r r 4 2
T
T
T
T
r 4 2 r r 0
r r 4 2 0 r
r 0 r 4 2 r
0 r r r 4 2
|
|
|
|
|

\
|
+
|
|
|
|
|

\
|
+
|
|
|
|
|

\
|
(
(
(
(

=
|
|
|
|
|

\
|
(
(
(
(






3 . 1 x 000 , 40
2 . 1 x 000 , 40
4 . 1 x 000 , 40
3 . 1 x 000 , 40
50 x 000 , 8
200
200
100
100
0
2
T
T
T
T
2 1 1 0
1 2 0 1
1 0 2 1
0 1 1 2
T
T
T
T
6 1 1 0
1 6 0 1
1 0 6 1
0 1 1 6
1 k
4
3
2
1
k
4
3
2
1
81

or



At the first time step k = 1








At the second time step k = 2















|
|
|
|
|

\
|
+
|
|
|
|
|

\
|
+
|
|
|
|
|

\
|
(
(
(
(

=
|
|
|
|
|

\
|
(
(
(
(






26
24
28
26
400
200
200
0
T
T
T
T
2 1 1 0
1 2 0 1
1 0 2 1
0 1 1 2
T
T
T
T
6 1 1 0
1 6 0 1
1 0 6 1
0 1 1 6
1 k
4
3
2
1
k
4
3
2
1
C
83 . 89
167 . 56
833 . 56
167 . 23
T
T
T
T
426
224
228
26
0
0
0
0
2 1 1 0
1 2 0 1
1 0 2 1
0 1 1 2
T
T
T
T
6 1 1 0
1 6 0 1
1 0 6 1
0 1 1 6
26
24
28
26
400
200
200
0
T
T
T
T
2 1 1 0
1 2 0 1
1 0 2 1
0 1 1 2
T
T
T
T
6 1 1 0
1 6 0 1
1 0 6 1
0 1 1 6
0
1
4
3
2
1
1
4
3
2
1
0
4
3
2
1
1
4
3
2
1
|
|
|
|
|

\
|
=
|
|
|
|
|

\
|

|
|
|
|
|

\
|
+
|
|
|
|
|

\
|
(
(
(
(

=
|
|
|
|
|

\
|
(
(
(
(





|
|
|
|
|

\
|
+
|
|
|
|
|

\
|
+
|
|
|
|
|

\
|
(
(
(
(

=
|
|
|
|
|

\
|
(
(
(
(





C
72 . 78
28 . 56
72 . 56
28 . 34
T
T
T
T
426
224
228
26
83 . 89
167 . 56
833 . 56
167 . 23
2 1 1 0
1 2 0 1
1 0 2 1
0 1 1 2
T
T
T
T
6 1 1 0
1 6 0 1
1 0 6 1
0 1 1 6
26
24
28
26
400
200
200
0
T
T
T
T
2 1 1 0
1 2 0 1
1 0 2 1
0 1 1 2
T
T
T
T
6 1 1 0
1 6 0 1
1 0 6 1
0 1 1 6
0
2
4
3
2
1
2
4
3
2
1
1
4
3
2
1
2
4
3
2
1
|
|
|
|
|

\
|
=
|
|
|
|
|

\
|

|
|
|
|
|

\
|
+
|
|
|
|
|

\
|
(
(
(
(

=
|
|
|
|
|

\
|
(
(
(
(





|
|
|
|
|

\
|
+
|
|
|
|
|

\
|
+
|
|
|
|
|

\
|
(
(
(
(

=
|
|
|
|
|

\
|
(
(
(
(





82

T
l
= 100
0
C
T
R
= 0
0
C
L = 0.1 m
L = 0.04
m
Problems # 8

O

Use the explicit method, with r = 1/4, to find the
temperature distribution in the 1-D slab, shown in the
Figure, after 3 equal time steps. Use 4 equal spacing
(e.g. h = 0.025 m), and consider a uniform initial
temperature of 0
0
C. The left and right walls'
temperatures are kept at 100 and 0
0
C, respectively, at
all times. For k = 20 W/m-
0
C, C (specific heat) = 50 J/kg-
0
C, and (density) = 7000 kg/m
3
, find the time increment t.

O

Use the Crank-Nicholson method (r = 1) and
the mesh shown in the Figure to find the
temperature distribution in the slab, after three
time steps. Use the following parameters: = 1000
kg/m
3
, C = 200 J/kg-
0
C, K = 10 W/m-
0
C, = 100 W-
m
2
_
0
C at both sides. Also take T
b
= 10
0
C and 100
0
C
at all times, for the left and right fluids,
respectively. Initial temperature of the wall is 0
0
C. What is the time at the end of the third time
step?
Also, use MATLAB programming to find the temperature evolution with time at node 3 after 20
time steps.
C
C C
C C
C C
C
83

T = 60
0
C
T = 20
0
C

O
Find the temperature distribution
(T
1
, T
2
, T
3
) after three time steps using:
1. The explicit method
(Euler's) with r = 1/4,
2. The Implicit method (Crank
Nicholson) with
r = 1/2.
What is the time increment?
Assume a uniform mesh with h = 0.2 m, and take the initial temperature to be 60
0
C. Also,
consider the following material properties: = 9000 kg/m
3
, C = 500 J/kg-
0
C, K = 50 W/m-
0
C.

















C C
C
84


3. OTHER TOPICS

Stability


The effectiveness of any numerical method for solving BVP is measured by three criteria:

1. Accuracy: The results need to be accurate, usually measured by some kind of an error
norm; e.g., root-mean-square error. Since the exact solution is usually not available, it is
always recommended to:
a. Perform a sanity check.
b. Conduct some simple hand-calculation, to make sure that the results are within
the expected bulk solution.
c. Run a standard well known example first.
d. Refine the mesh and monitor the convergence of the results. If the results
converge; then it is ok. If not; something is wrong!
2. Efficiency: The efficiency of a program depends on the storage requirements and the
computational time needed, which
translate into cost. A good analyst is the
one who can get accepted results with the
crudest possible mesh and least possible
calculation time. This skill, usually, comes
mainly with experience.
3. Stability: Stability means the results
converges to the exact answer over time
and/or space. A typical stable vs. unstable
results are shown in Figure 1.




Time/space
u
Unstable
Stable
Exact
Figure 1 Stable vs. unstable results
85


Example: Transport Equation:

The 1D heat conduction equation for a moving medium is

(1) Q
X
T
K
Dt
DT
C
2
2
=






Where
Dt
DT
is the material time derivative, v
X
T
t
T
t
X
X
T
t
T
Dt
DT

= .
Substituting into (1), and considering the steady-state case
|

\
|
=

0
t
T
, we get,
Q
X
T
K
X
T
Cv
2
2
=

, (2)

where v is the velocity of the medium.


Now, let us find the temperature distribution in a 1D moving slab using the FD method.

The BVP is:
0. T(L) and 0. T(0)
L X 0 Q
X
T
K
X
T
Cv
2
2
= =
=

p p


1. Generate the grid; no need for extension
of the body.
2. The FD approximation of the DE (2) at a
generic point i is
( ) ( )
( ) ( )
( ) ( )
i 1 i i 1 i
i 1 i i 1 i 1 i 1 i
i
2
1 i i 1 i 1 i 1 i
i
2
1 i i 1 i 1 i 1 i
S T 1 Pe T 2 T 1 Pe
S T T 2 T T T Pe
K
Q h
T T 2 T T T
K 2
Cvh
Q
h
T T 2 T
K
h 2
T T
Cv
= +
= +
|
|

\
|
= +
|

\
|
=
+

+
+ +
+ +
+ +

X
h
i-1 i i+1
Figure 2 A generic FD grid
86


Where Pe is the Peclet number, ,
K 2
Cvh
Pe

= and S is the equivalent rate of heat generation
temperature,
K
Q h
S
2
= .

3. Figure 3 displays the FD solution, for L = 1 m, S = 1
0
C, and h = 0.1 m, and for different
valued of the Pe. The Figure also displays the exact solution: T
*
,
.
K
Cv
where ,
e 1
e 1
X
v
1
T
X
*

=
)
`

Notice that the solution is unstable for Pe = 5.


It turns out that the solution is unstable for Pe > 1. For these values the exact solution displays a
very steep and sharp change in the value of the gradient. This sharp change is in general a
challenge for all numerical techniques, and needs some special treatment, which is beyond the
scope of this course.

Finite diff.
X
T
Figure 3 Comparison of the FD and exact
solutions for different Pe values.
87


Irregular Regions

Irregular mesh:

Irregular regions cannot be covered by a uniform mesh, in particular at the edges. There, an
irregular mesh has to be constructed and the FD approximation differs. Figure 4 shows a typical
generic irregular FD mesh in the vicinity of a curved edge. The FD approximation of the
Laplacian is:

( )
C
2
2
2
2
C
2
y
u
x
u
u
|
|

\
|

= (3)
( )
( ) ( )
h h and , h h where
(4)
U U U U
h
2

h
U U
h
U U
h h
2

x
u
x
u
2 h h
1
x
u
x x
u
R R L L
L R L
L C
L R R
C R
L
L C
R
C R
R L
L R R L C
C
2
2
2
= =
)
`

=
)
`

+
=
)
`

\
|

\
|

+
= |

\
|

=
|
|

\
|



Similarly, we can show that

( ) ( )
(5)
U U U U
h
2
y
u
B T B
B C
B T T
C T
C
2
2
2
)
`

=
|
|

\
|



Substituting from (4) and (5) into (3) we get the FD approximation of the laplacian:


( )
( ) ( ) ( ) ( )
)
`

|
|

\
|

+

+
+
+
+
+
+
+

C
B T L R B T B
B
L R L
R
B T T
T
L R L
L
2 C
2
U
1 1 U U U U
h
2
u


L
B
R
T
C
h
L
h
R
h
T
h
B
Figure 4 Irregular mesh
88



Polar Coordinates:

In polar coordinates the Laplacian is given by

2
2
2 2
2
2
u
r
1
r
u
r
1
r
u
u

= (6)

The FD approximation of each derivative in the above equation, based on the mesh given in
Figure 5, is
( )
( )
( )
( )
( )
R C L
2
C
2
2
B T
C
B C T
2
C
2
2
U U 2 U
1 u
U U
r 2
1
r
u
U U 2 U
r
1
r
u
+

|
|

\
|

\
|

|
|

\
|


Substituting into (6), we get

( )
( )
( ) ( )
( )
( )
R C L 2
C
B T
C
B C T 2 C
2
U U 2 U
r
1
U U
r r 2
1
U U 2 U
r
1
u +

+

+ +



( )
( )
(7) U
r
r
1 2 U
r
r
U
r
r
U
r 2
r
1 U
r 2
r
1
r
1
u
C
2
C
R
2
C
L
2
C
T
C
B
C
2 C
2

|
|

\
|
|
|

\
|

+
|
|

\
|

+
|
|

\
|

+
|
|

\
|
+ +
|
|

\
|




U
C
U
L
U
R
U
T
U
B
r


Figure 5 Polar FD mesh
89

C
C
C
C
C

A
B
C
1.5
2
1
T = 100
0
C
T = 50
0
C
Example:

For the domain shown in the Figure, write the FD
approximation of the steady-state heat conduction
equation at nodes 2 and 4. Neglect the rate of heat
generation. Take the bulk temperature, T
b
= 20
0
C and the
non-dimensional film coefficient = 0.3.
-------------------------------------------------------------------
The FD approximation at node i,j is given by equation (7)
At node 2, we have:

( )
( )
0 T
4
2 T
4
T
4
T
6
7
6
250

4
5 . 1
6 x 5 . 0
r
r
and ,
6
7
3
5 . 0
1
r 2
r
1 ,
6
5
3
5 . 0
1
r 2
r
1
6 and , " 5 . 1 r , 0.5" r where
0 T
r
r
1 2 T
r
r
T
r
r
T
r 2
r
1 50
r 2
r
1
r
1
T
2
2
2
3
2
1
2
5
2
2
2
2 2 2
2
2
2
2
3
2
2
1
2
2
5
2 2
2
2
2
=

+ +

= |

\
|

=
|
|

\
|

= |

\
|
+ =
|
|

\
|
+ = |

\
|
=
|
|

\
|

= = =
=

|
|

\
|
|
|

\
|

+
|
|

\
|

+
|
|

\
|

+
|
|

\
|
+ +
|
|

\
|




At node 4, we get:

( )
( )
6 T 3 . 0 T ) T T ( T T and , " 2 r where
0 T
r
r
1 2 T
r
r
T
r
r
T
r 2
r
1 T
r 2
r
1
r
1
T
4 1 b 4 1 A 4
4
2
4
5
2
4
5
2
4
A
4
1
4
2
4
2
+ = = =
=

|
|

\
|
|
|

\
|

+
|
|

\
|

+
|
|

\
|

+
|
|

\
|
+ +
|
|

\
|



90

( )
0 T
5 . 4
2
8
7 . 2
4
27
T
5 . 4
T 2
0 T
25 . 2
1 2 T
5 . 4
6 T 3 . 0 T
8
9
T
8
7
,
25 . 2
2
0.5x6
r
r
and ,
8
9
4
5 . 0
1
r 2
r
1 ,
8
7
4
5 . 0
1
r 2
r
1
4
2
5
2
1
4
2
5
2
4 1 1
2
2
2
4 2 2
= |

\
|

+ + +

+
= |

\
|

+ + +

= |

\
|

=
|
|

\
|

= |

\
|
+ =
|
|

\
|
+ = |

\
|
=
|
|

\
|
































91

Vibration Problems (Newmark method)


A vibration problem or a hyperbolic equation, in general, takes the form:
f Ku u C u M = + + & & & , (8)
where M, C and K are the mass, damping and stiffness of the system, respectively; and u, u&
and u& & are the displacement, velocity and acceleration, respectively.
The step-by-step, time-marching approach

Similar to the -method, the numerical solution of
(8) is accomplished in a step-by-step manner.

Assuming the time domain is divided into equal
intervals t, and that the past history of the
displacement (U
k-1
, U
k-2
, , U
0
) is known at times t
k-
1
, t
k-2
, , t
0
, respectively; and we want to predict
the current displacement (U
k
) at time t
k
and the
future ones at times t
k+1
, t
k+2
,

The current displacement U
k
at time t
k
is determined in terms of the known displacements at
the previous times t
k-1
and t
k-2
. Then, the displacement U
k+1
at the new time t
k+1
is determined
in terms of displacements at the new-previous times t
k
and t
k-1
. We repeat this process until we
get to the time at which the displacement is needed. This process, as in the -method and in
most numerical techniques for solving the transient problems is called the time marching
technique.





U
k-1
U
k-2
U
k U
k+
1
U
k+
2
t
0
t
k-2
t
k-1
t
k
t
k+1
t
k+2
Past
Future
U
Time, t
Figure 6 Time domain grid
92

The Newmark method


The Newmark method applies the weighted residual method for the time-marching algorithm:

1. Assume that the displacement is quadratic in the interval {t
k-2
: t
k
} and is approximated
by,
j
k : 2 k s
j
U ) s ( N ) s ( u

=
=


Where N
j
is the shape function j (Figure 7):
( )
|

\
|

=
|

\
|

+
|

\
|

=
|

\
|

t
s
1
t 2
s
) s ( N
t
s
1
t
s
1 s N
t
s
1
t 2
s
) s ( N
k
1 k
2 k
(9)
s is the time in local coordinate, t s t .

2. Get the element equation:
i. Substitute from the approximate solution, u , into the DE (8) to get the residual,
. f u K u

C u

M R + + = & & &


ii. Enforce the weighted residual over the period {t
k-2
: t
k
} to vanish, yields:
( ) ( ){ }
( ) ( ) ( ) ( )
( ) ( ) ( ) ( ) ( ) ( )
( ) , fds s w
ds U s N k s w ds U s N c s w ds U s N m s w
, fds s w ds u k s w ds u

c s w ds u

m s w
, 0 ds f u k u

c u

m s w Rds s w
t
t
t
t
2 k : k j
j j
t
t
2 k : k j
j j
t
t
2 k : k j
j j
t
t
t
t
t
t
t
t
t
t
t
t


=
)
`

+
)
`

+
)
`

= + +
= + + =
& & &
& & &
& & &
Rearrange, renders:
( ) ( ) ( ) ( ) { } ( ) ( ) ( ) ( ) { }
( ) ( ) ( ) ( ) { } ( ){ }


+ + = + + +
+ + + + +
t
t
2 k 2 k 1 k 1 k k k 2 k
t
t
2 k 2 k 2 k
1 k
t
t
1 k 1 k 1 k k
t
t
k k k
ds f N f N f N s w U ds s KN s N C s N M s w
U ds s KN s N C s N M s w U ds s KN s N C s N M s w
& & &
& & & & & &

Substituting from (9) and after integration and some manipulation, we get:

Figure 7 Shape functions for Newmark
s
U
I
U
k U
k-1
U
k-2
Time, t
t
k
t
k-1
t
k-2
N
k-2
N
k-1
N
k
93

{ }
( )
( )
f t f
2
1
f 2
2
1
f t
U K t
2
1
tC 1 M
U K t 2
2
1
tC 2 1 M 2
U K t tC M
2 2 k 1 k k 2
2 k 2
1 k 2
k 2
=
)
`

\
|
+ + |

\
|
+ +
=
)
`

\
|
+ +
+
)
`

\
|
+ + +
+ + +

(10)

Where, upon introducing the non-dimensional time = s/t,

( )
( ) ( )
( ) ( ) . d w d f ) s ( w f
, d w d 1 ) s ( w
, d w d
2
1
) s ( w
1
1
1
1
1
1
1
1
1
1
1
1






=
+ =

|

\
|
+ =
(11)

Equation (10) can be expressed in a condensed way as:

( ) ( ) ( )
{ }
( )
( )
)
`

\
|
+ + =
)
`

\
|
+ + + =
+ + =
= + +

K t
2
1
tC 1 M 3 A
K t 2
2
1
tC 2 1 M 2 2 A
K t tC M 1 A
where
f t U 3 A U 2 A U 1 A
2
2
2
2 2 k 1 k k
(12)


Equation (12) is the Newmark recurrent equation. Knowing the displacements at the
previous times t
k-1
and t
k-2
, for a given weighting function w(s), i.e., given values of and
, and with the applied force known as a function of time, the displacement at the new
time k can be calculated. This process can be repeated for the evolution of displacement
over a certain period of time. It is understood that the longer the period of time, the
more calculation time (cost) and the more the accumulated error that we accrue.

94

As in the -method, the Newmark method encompasses a family of methods depending
on the choice of the weighting function w(s):
Unweighted method: .
6
1
,
2
1
1 ) ( w = = =
The linear acceleration: .
10
1
,
2
1
t
s
1
t
s
1 ) ( w = = |

\
|

+ |

\
|

=
Galerkin method: .
5
4
,
2
1
t
s
1
t 2
s
) ( w = =
|

\
|

=
The average acceleration: .
4
1
,
2
1
t
s
) ( w = =

=
The average acceleration method is popular because it is unconditionally stable.


Example

The axial free vibration of a Maxwell-Model viscoelastic fixed-free rod is represented by:
, u
C
1
x
u
x
u
2 2
2
2
2
& &
&
=

0<x<L
Subject to: u (0,t) = 0, and at x = L,
x
u
x
u

&
= 0,
Initial conditions: u(x,0) = 0.01x/L, and u& (x,0) = 0.
where is the relaxation time and C is the wave speed of the material.
Find the evolution of tip displacement with time using the FD method for the special domain
and the average-acceleration method for the time domain. Adopt the following non-
dimensional parameters: u
*
= u/L, t
*
= tC/L, x
*
= x/L, and
*
= C/L = 0.2.
-------------------------------------------------------------------------------------------------------------------
The non-dimensional BVP becomes:
, u
x
u
x
u
*
2
*
* 2
2
*
* 2
& &
&
=

0<x
*
<1 (13)
BC: u
*
(0,t
*
)=0, and at x
*
= 1, 0
x
u
x
u
*
*
*
*
*
=

&

IC: u
*
(x
*
,0) = 0.01x
*
, and
*
u& (x
*
,0) = 0.
For abbreviation, the superscript * will be omitted in the solution presented.
x
Figure 8 Fixed-free rod
95


The spatial problem using the FD method:

1. Use the uniform grid shown, and extend
the body at the end and create the
fictitious node A.
2. The FD approximation of the DE (13) at node i is
( ) ( ) 0 U U U 2 U
h
1
U U 2 U
h
1
i 1 i i 1 i 2 1 i i 1 i 2
= + + +
+ +
& & & & &

That is:
At 2: ( ) ( ) 0 U h U U 2 U U U 2 U
2
2
1 2 3 1 2 3
= + + +
& & & & &

At 3: ( ) ( ) 0 U h U U 2 U U U 2 U
3
2
2 3 4 2 3 4
= + + +
& & & & &

At 4: ( ) ( ) 0 U h U U 2 U U U 2 U
4
2
3 4 5 3 4 5
= + + +
& & & & &

At 5: ( ) ( ) 0 U h U U 2 U U U 2 U
5
2
4 5 A 4 5 A
= + + +
& & & & &


The derivative BC at 5 can be expressed as:

( ) ( ) 0 U U
h 2
U U
h 2
1
4 A 4 A
=

+
& &
, or
4 4 A A
U U U U
& &
+ = +


Substituting from the above equation into the FD equation at 5, gives

At 5: ( ) ( ) ( ) 0 U 2 h U U U U
5
2
5 4 5 4
= +
& & & &


3. In a matrix form
|
|
|
|
|

\
|
=
|
|
|
|
|

\
|
(
(
(
(

+
|
|
|
|
|

\
|
(
(
(
(

+
|
|
|
|
|

\
|
(
(
(
(

0
0
0
0
U
U
U
U
1 1 0 0
1 2 1 0
0 1 2 1
0 0 1 2
h
1
U
U
U
U
1 1 0 0
1 2 1 0
0 1 2 1
0 0 1 2
h
U
U
U
U
2 1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
5
4
3
2
2
5
4
3
2
2
5
4
3
2
&
&
&
&
& &
& &
& &
& &


In a condensed form: [ ] [ ] [ ] 0 U K U C U M = + +
& & &
,

where [M], [C] and [K] are the mass, damping and stiffness matrices, respectively:
[ ] [ ] [ ]
(
(
(
(

=
(
(
(
(

=
(
(
(
(

=
1 1 0 0
1 2 1 0
0 1 2 1
0 0 1 2
h
1
K and ,
1 1 0 0
1 2 1 0
0 1 2 1
0 0 1 2
h
C ,
2 1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
M
2 2

C
C C C C
x
A
Figure 9 FD grid
96


The temporal problem using the Newmark method:
Equation (12), renders:
[ ] [ ] [ ] { } f t U 3 A U 2 A U 1 A
2 2 k 1 k k
+ + =

, (14)
where the expressions of the matrices [A] are:

[ ] [ ] [ ] [ ]
(
(
(
(

|
|

\
|
+
(
(
(
(

\
|
+
(
(
(
(

=
+ + =
1 1 0 0
1 2 1 0
0 1 2 1
0 0 1 2
h
t
1 1 0 0
1 2 1 0
0 1 2 1
0 0 1 2
h
t
2 1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1

K t C t M 1 A
2
2
2
2
,

[ ] [ ] ( ) [ ] [ ]
( )
(
(
(
(

|
|
|
|

\
|

|

\
|
+
+
(
(
(
(

\
|
+
(
(
(
(

=
|

\
|
+ + + =
1 1 0 0
1 2 1 0
0 1 2 1
0 0 1 2
h
t 2
2
1
1 1 0 0
1 2 1 0
0 1 2 1
0 0 1 2
h
t 2 1
2 1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
2
K t 2
2
1
C t 2 1 M 2 2 A
2
2
2
2

[ ] [ ] ( ) [ ] [ ]
( )
(
(
(
(

|
|
|
|

\
|

|

\
|
+
+
(
(
(
(

\
|
+
(
(
(
(

=
|

\
|
+ + =
1 1 0 0
1 2 1 0
0 1 2 1
0 0 1 2
h
t
2
1
1 1 0 0
1 2 1 0
0 1 2 1
0 0 1 2
h
t 1
2 1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1

K t
2
1
C t 1 M 3 A
2
2
2
2


Substituting = 0.25, = 0.5 (average acceleration), h = 0.25, and t = 0.1 (from the natural
frequency estimation), we get:
[ ] [ ] [ ]
(
(
(
(

=
(
(
(
(

=
(
(
(
(

=
38 . 0 12 . 0 0 0
12 . 0 76 . 0 12 . 0 0
0 12 . 0 76 . 0 12 . 0
0 0 12 . 0 76 . 0
A3 ,
92 . 0 08 . 0 0 0
08 . 0 84 . 1 08 . 0 0
0 08 . 0 84 . 1 08 . 0
0 0 08 . 0 84 . 1
A2 ,
7 . 0 2 . 0
2 . 0 4 . 1 2 . 0
2 . 0 4 . 1 2 . 0
0 0 2 . 0 4 . 1
1 A

Now execute the time marching process:
97


At k = 0: The IC translates into
3 ) 0 (
10 x
10
5 . 7
0 . 5
5 . 2
h 4
h 3
h 2
h
01 . 0 U

|
|
|
|
|

\
|
=
|
|
|
|
|

\
|
=
At k = 1: Because the initial velocity is zero, we assume that the displacement remains the same

At k = 2: we apply (14): [ ] [ ] [ ] { } f t U 3 A U 2 A U 1 A
2 2 k 1 k k
+ + =




[ ] [ ] [ ] { }
2 k 1 k 1 k
U A3 U A2 1 A U

+ =


( )
T
1
3
(0)
5
4
3
2
(1)
5
4
3
2
1 (2)
5
4
3
2
0.9404 0.7413 0.4987 0.2498 01 . 0
10
5 . 7
5
5 . 2
0.38 0.12 0 0
0.12 0.76 0.12 0
0 0.12 0.76 0.12
0 0 0.12 0.76

10
5 . 7
5
5 . 2
0.92 0.08 0 0
0.08 1.84 0.08 0
0 0.08 1.84 0.08
0 0 0.08 1.84
0.7 0.2
0.2 1.4 0.2
0.2 1.4 0.2
0.2 1.4
10
U
U
U
U
0.38 0.12 0 0
0.12 0.76 0.12 0
0 0.12 0.76 0.12
0 0 0.12 0.76

U
U
U
U
0.92 0.08 0 0
0.08 1.84 0.08 0
0 0.08 1.84 0.08
0 0 0.08 1.84
0.7 0.2
0.2 1.4 0.2
0.2 1.4 0.2
0.2 1.4
U
U
U
U
=

|
|
|
|
|

\
|
(
(
(
(

+
|
|
|
|
|

\
|
(
(
(
(

(
(
(
(

|
|
|
|
|

\
|
(
(
(
(

+
|
|
|
|
|

\
|
(
(
(
(

(
(
(
(

=
|
|
|
|
|

\
|


At k = 3:

( )
T
1
) 1 (
5
4
3
2
) 2 (
5
4
3
2
1 ) 3 (
5
4
3
2
0.8529 0.7130 0.4923 0.2486 01 . 0
00 . 1
75 . 0
50 . 0
25 . 0
0.38 0.12 0 0
0.12 0.76 0.12 0
0 0.12 0.76 0.12
0 0 0.12 0.76

0.9404
0.7413
0.4987
0.2498
0.92 0.08 0 0
0.08 1.84 0.08 0
0 0.08 1.84 0.08
0 0 0.08 1.84
0.7 0.2
0.2 1.4 0.2
0.2 1.4 0.2
0 0 0.2 1.4
01 . 0
U
U
U
U
0.38 0.12 0 0
0.12 0.76 0.12 0
0 0.12 0.76 0.12
0 0 0.12 0.76

U
U
U
U
0.92 0.08 0 0
0.08 1.84 0.08 0
0 0.08 1.84 0.08
0 0 0.08 1.84
0.7 0.2
0.2 1.4 0.2
0.2 1.4 0.2
0 0 0.2 1.4
U
U
U
U
=

|
|
|
|
|

\
|
(
(
(
(

+
|
|
|
|
|

\
|
(
(
(
(

(
(
(
(

|
|
|
|
|

\
|
(
(
(
(

+
|
|
|
|
|

\
|
(
(
(
(

(
(
(
(

=
|
|
|
|
|

\
|


98

A typicl MATLAB program is provided below for solving this example:

%***************************************************
% The vibration of a viscoelastic rod example
% Using the Newmark method
% [M]*d2U/dt2 + [C]*dU/dt + [K]*U = F;
%***************************************************
% Data
% nn = dimension, nt = number of time steps
% h = element length; dt = time increment
nn = 4; nt = 100;
h = 1/nn; dt = 0.1; dt2 = dt*dt;
beta = 0.25; gama = 0.5; % Average acceleration
tau = .2;
%......................................................
% Matrices
M = [1 0 0 0; 0 1 0 0; 0 0 1 0; 0 0 0 1/2];
K = (1/h^2)*[2 -1 0 0;-1 2 -1 0; 0 -1 2 -1; 0 0 -1 1];
C = tau*[K];
% Evaluate [A1],[A2],[A3]
A1 = M + gama*dt*C + beta*dt2*K;
A2 = -2*M + (1-2*gama)*dt*C + (0.5-2*beta+gama)*dt2*K;
A3 = M - (1-gama)*dt*C + (0.5+beta-gama)*dt2*K;
invA = inv(A1);
%.......................................................
% Iterate over time
t0 = 0; t1 = dt;
U0 = 0.01*[h; 2*h; 3*h; 1];
Ud0 = [0;0;0;0];
U1 = U0 + dt*Ud0;
U(1,:) = U0; time(1) = t0;
U(2,:) = U1; time(2) = t1;
for k = 3:nt
RHS = A2*U1 + A3*U0;
t = dt + t1;
U2 = - invA*RHS;
U(k,:) = U2;
time(k)= t;
U0 = U1;
U1 = U2;
t1 = t;
end
%********************************************************
99





Figure 10 shows the prediction of the displacement response at the tip of the rod (U
5
). It
demonstrates that the response is oscillatory and damped. Viscoelastic materials have inherent
damping that dampens out the vibration.











0 1 2 3 4 5 6 7 8 9 10
-6
-4
-2
0
2
4
6
8
10
x 10
-3
Time, t
T
i
p

d
i
s
p
l
a
c
e
m
e
n
t
Figure 10 The free response at the rods tip
100

Problems # 9

O
Find the steady-state temperature
distribution in the domain shown in
the Figure. The circular top surface is
kept at 100
0
C and the side surfaces at
50
0
C. Convection occurs at the bottom
surface. The bulk temperature of the
fluid, T
b
= 10
0
C and the film coefficient
= 20 W/m
2
-
0
C. The thermal
conductivity of the material of the
domain, K = 40 W/m-
0
C. Take
advantage of symmetry and use the grid shown in the Figure.

O
The problem of the axisymmetric
vibration of a gun barrel under the
effect of single pulsive load (firing) at
the inner surface, in the non-
dimensional form (see Figure), can be
modeled by the following BVP:
0
x
u
r
u
r
u
r
r r
1
2
2
2
=

+ + |

\
|


1 < r < r
0
Subjected to
0
r r at 0
r
u
) 1 (
r
u
1 r at 0 ) t ( p
r
u
) 1 (
r
u
= = +

= = +



T=100
0
C
T=50
0
C
0.2 m
0.2 m
0.1 m
0.1 m
r
0
=2
r=1
p(t)
101

where u is the non-dimensional radial displacement
r is the non-dimensional radius (r = r/r
inner
)
t is the non-dimensional time
is a non-dimensional material constant.
P in the non-dimensional inner pressure due to firing

Using the FDM with uniform mesh for the spatial domain and the average acceleration
algorithm of the Newmark method for the temporal solution:
Derive the expression for the matrices [A1], [A2] and [A3]
Find and plot the evolution of the radial displacement u at the inner and outer radii
with time for the following case:
o Steel gun barrel, = 0.43,
o Gust function input for the pressure, ) t 2 exp( t 15 . 0 ) t ( p = ,
o Non dimensional outer radius, r
0
= 2,
o Mesh size, h = 0.1, and time interval, t = 0.01.
Briefly comment on the results, i.e., what are the dominant frequencies of vibration.


















102

SUMMARY FE


GFE

For the solution of the BVP where L(u) = F, the classical finite element technique goes through 4

major phases (steps):

1. Mesh generation & function approximation:

The displacement is assumed to be piece-wise polynomial; that is:

U ) x ( N ) x ( u where , ) x ( u ) X ( u
2 : 1 j
e
j j
e
ne
e

=
=

For linear elements, N
1
(x) = 1 x/h, and N
2
(x) = x/h, where h is the length of the element.
2. Element Equation:
a. R (residual) = L(u
e
) F,
b.
c. Integrate by part to get the element equation,
3. Assembly & Boundary conditions:

Where [K] is the global stiffness matrix,

U is the nodal displacement vector,

F is the nodal internal force vector,

B is the boundary-force vector.

4. Solve for the displacement vector U.


=
element
i
element. each for , 0 Rdx ) x ( N
[ ]
e e e e
B F U K + =
[ ] B F U K + =
103

RODS


The element equation:

( )
e
2
1
e
2
1
e
e
P
P
1
1
fA TS
2
h
U
U
1 1
1 1
h
EA
|
|

\
|
+
|
|

\
|
+ =
|
|

\
|
(

\
|


E
e
, A
e
, and h
e
are the modulus of elasticity, cross sectional area, and length of the
element, respectively.
e
2
e
1
P and P are the axial, normal reaction forces at both ends of the rod element.
f and T are the body and traction forces, respectively.
S is the effective circumferential length (constants).


The stress in an element:
e
e
1
e
2 e e
h
U U
E

=



are the element nodal displacements,



















e
2
e
1
U and U
104

TRUSSES


The element equation:

, [ ] F
~
q K
~ e e
=

Where [ ]
(
(
(
(
(

\
|
=
2 2
2 2
2 2
2 2
e
e
m lm m lm
lm l lm l
m lm m lm
lm l lm l
h
EA
K
~


E
e
, A
e
, and h
e
are the modulus of elasticity, cross sectional area, and length of the
element, respectively.
l = cos() and m = sin().


The stress in an element:


) mv lu mv lu (
h
E
e
1
e
1
e
2
e
2
e
e
+ =



are the element nodal displacements,


BEAMS


The element equation:

e
2
2
1
1
e
2
2
1
1
2 2
2 2 e
3
M
V
M
V
h
6
h
6
12
fh
v
v
h 4 h 6 h 2 h 6
h 6 12 h 6 12
h 2 h 6 h 4 h 6
h 6 12 h 6 12
h
EI
|
|
|
|
|

\
|
+

+
+
|
|
|
|
|

\
|

=
|
|
|
|
|

\
|

(
(
(
(

\
|


e
2
e
2
e
1
e
1
v and u , v , u
X
C
C
105

E Youngs modulus.
I the area moment of inertia about z axis.
h the length of the element.
f the applied transverse force (constant).
v
i
the nodal transverse displacement.

i
the nodal angular displacement (rotaion).


The bending (M) and shear forces (V) inside an element:



( )
( )
e
2 4
e
2 3
e
1 2
e
1 1
e
4 : 1 i
i i
e e e e
e
2 4
e
2 3
e
1 2
e
1 1
e
4 : 1 i
i i
e e e e
N v N N v N EI q N EI v EI V
N v N N v N EI q N EI v EI M
+ + + = = =
+ + + = = =

=
=


The shape functions and their derivatives are:


. 1
h
x
h
x
) x ( N ,
h
x
2 3
h
x
) x ( N
,
h
x
h
x
2 1 x ) x ( N ,
h
x
2
h
x
3 1 ) x ( N
2
4
2
3
2
2
3 2
1
)
`

=
)
`

\
|
=

\
|
+ |

\
|
= |

\
|
+ |

\
|
=



|

\
|
+ =
|

\
|
=
|

\
|
+ =
|

\
|
+ =
h
x
3 1
h
2
N
h
x
2 1
h
6
N
h
x
3 2
h
2
N
h
x
2 1
h
6
N
4
2 3
2
2 1

2 4
3 3
2 2
3 1
h
6
N
h
12
N
h
6
N
h
12
N
=
=
=
=









106

Figure 6 A generic rectangular FE
C
C
C C
2h
2b
STEADY STATE 2D HEAT CONDUCTION

The element equation:

[ ] q Q T K
e e e e
+ =

[K]
e
is the element conductivity (stiffness) matrix

(
(
(
(
(
(
(
(

+ +
+ +
+ +
+ +
=
h
b
3
1
b
h
3
1
h
b
6
1
b
h
3
1
h
b
6
1
b
h
6
1
h
b
3
1
b
h
6
1
h
b
6
1
b
h
3
1
h
b
3
1
b
h
3
1
h
b
3
1
b
h
6
1
h
b
6
1
b
h
6
1
h
b
6
1
b
h
6
1
h
b
3
1
b
h
6
1
h
b
3
1
b
h
3
1
h
b
6
1
b
h
3
1
h
b
3
1
b
h
6
1
h
b
6
1
b
h
6
1
h
b
6
1
b
h
3
1
h
b
3
1
b
h
3
1
k K
e


Q
e
is the element rate of heat generation vector, for uniform Q = Q
0
,



q
e
is the element heat flux vector

q q q q q
T L R e
+ + + =








|
|
|
|
|

\
|
+
|
|
|
|
|

\
|
(
(
(
(

=
|
|
|
|
|

\
|
=
0
1
1
0
hT
T
T
T
T
0 0 0 0
0 2 1 0
0 1 2 0
0 0 0 0
3
h
q
q
q
q
q
b
e
4
3
2
1
R
4
3
2
1
R
( )
T
0
e
1 1 1 1 bh Q Q =
|
|
|
|
|

\
|
+
|
|
|
|
|

\
|
(
(
(
(

=
|
|
|
|
|

\
|
=
1
0
0
1
hT
T
T
T
T
2 0 0 1
0 0 0 0
0 0 0 0
1 0 0 2
3
h
q
q
q
q
q
b
e
4
3
2
1
L
4
3
2
1
L

1
1
0
0
bT
T
T
T
T
2 1 0 0
1 2 0 0
0 0 0 0
0 0 0 0
3
b
q
q
q
q
q
b
e
4
3
2
1
T
4
3
2
1
T
|
|
|
|
|

\
|
+
|
|
|
|
|

\
|
(
(
(
(

=
|
|
|
|
|

\
|
=
|
|
|
|
|

\
|
+
|
|
|
|
|

\
|
(
(
(
(

=
|
|
|
|
|

\
|
=
0
0
1
1
bT
T
T
T
T
0 0 0 0
0 0 0 0
0 0 2 1
0 0 1 2
3
b
q
q
q
q
q
b
e
4
3
2
1
B
4
3
2
1
B
107

FD

Central difference approximation

( )
( )
1 i i 1 i
2
i
2
2
1 i 1 i
i
u u 2 u
x
1
x
u
u u
x 2
1
x
u
+
+
+

|
|

\
|

\
|


u
1
1 4 1
1
h
1
u
j , i
2
j , i
2



Steady-State Heat Conduction

( )
( ) .
K
h 2
, T T T T
K
Q
T
1
1 4 1
1
h
1
T
b surface erior int A
j , i
j , i
2
j , i
2

= =
|

\
|
=





Transient Heat Conduction

1D Euler: { }
1 k
i
1 k
i
k
i
Q
C
t
T r r 2 1 r T

+ =
1D C.N.: { } { } ( )
1 k
i
k
i
1 k
i
k
i
Q Q
C
t
T r r 2 2 r T r r 2 2 r

+

+ = +

2D Euler:
1 k
j , i
1 k
j , i
k
j , i
Q
C
t
T
r
r r 4 1 r
r
T

=

2D C.N.: ( )
1 k
j , i
k
j , i
1 k
j , i
k
j , i
Q Q
C
t
T
r
r r 4 2 r
r
T
r
r r 4 2 r
r

+



Where
C
K
h
t
r
2

You might also like