You are on page 1of 34

WEEK 9

Dr. K. J. Berry. P.E.


Mechanical Engineering
Kettering University
jberry@kettering.edu
SKYPE: KJBERRYCEO

The

widespread use of digital computers has


made numerical methods extremely valuable
for solving problems very difficult or
impossible to solve analytically.
Analytical Limitations, e.g.:
Simple Geometries
Simple Boundary Conditions
Isotropic Properties
Temperature Independent Properties

Methods

Finite Differences
Finite Elements (MECH-622)

K. J. Berry-Week 9

APPROACH COMPARSON
APPROACH

PROS

CONS

Analytical

Clean, General,
Restricted Geometry
Good for limiting cases for Restricted Physics
numerical solutions
Linear Problems

Experimental

Capable of being most


realistic

Equipment Needed
Measurement Needed
Cost
Scaled Model Needed

Computational

Not restricted to linear


Complex multi-physics
Complex geometries

Round-off Errors
Computer Cost and
Time
Boundary Conditions
Problems

K. J. Berry-Week 9

Motion
HOT
Recirculation
Flow

Velocity Vectors
w/Temperatures

COLD
K. J. Berry-Week 9

Corner
Edge Effects
Low Pressure
High Velocity

K. J. Berry-Week 9

Consider

a function t(x). The exact definition


of the derivative is:
t ( xm x ) t ( xm )
dt
lim
d x x xm x 0
x
R eally is an ap p ro x im atio n b etw een x m a n d x m 1 , so :
t
t
dt
m 1 m ; a n d

x
dx m 2
x
t t
dt
m m 1

x
dx m 2
x

Consider
2

d t
dx2

d 2t
dx2

dt
dx

xm

dt
dx

2nd Derivative:
xm

x
2

; C e n tra l F in ite D iffe re n c e s

tm 1 tm
t t m 1
m
x
x

x
t
2 tm tm 1
; G e n e ra l F in ite D iffe re n c e E q u a tio n
m 1
2
x
K. J. Berry-Week 9

Consider

1D FIN heat transfer with fixed


temp at x=0, and insulated at x=L. The Rod
experiences convective heat transfer at the
boundaries. The 1D Fin HDE becomes:
E E 0
in

out

q"in A q"out A h Pdx (t t ) 0


d 2t
hP
(t t ) 0;
2
dx
kA
P Perimeter
A Cross Section Area
K. J. Berry-Week 9

Sub-divide FIN into discrete m segments. At


interior nodes ONLY apply general FINITE
DIFFERENCE equation.
ODE

d 2t
hP
t
t

(
)
0
;

kA
dx2
t m 1 2 t m t m 1
d 2t

2
dx2
x
(t t ) (tm t )
t m 1 2 t m t m 1 x 2 t m x 2 t
t m 1 t m ( 2 x 2 ) t m 1 x 2 t
K. J. Berry-Week 9

At

boundary node, either known


temperature, or use energy balance and
find boundary difference equation.
Consider FIN tip INSULATION equation
" M " end node
qconduction qconvection 0
qconduction qM 1, M kA

tM 1 tM
x

x
hP
(tM t );
kA
2
x 2t ;Boundary Difference Eqn.

qconvection hP

2tM 1 (2 x 2 )tM

K. J. Berry-Week 9

Consider

tip convection.
q M 1, M q cm q em

t M 1 t M
x
( t M t ) he A ( t M t )
hP
2
x
h A x
hP x 2
(t M t ) e
(t M t )
t M 1 t M
kA 2
kA
2h x
2h x
2 t M 1 t M (1 x 2 e ) t ( x 2 e )
k
k
hP

kA
kA

K. J. Berry-Week 9

10

NODE
1
2

FINITE DIFFERENCE EQUATION


t1 K N O W N

t1 t2 (2 x 2 ) t3 x 2t

t2 t3 (2 x 2 ) t4 x 2t

2t3 (2 x 2 )t4 x 2t

K. J. Berry-Week 9

11

SOLVE

2 x 2

2 x
2

t
x
t t1

2
t3 x 2t
1

2

2 t 4
x
t

2 x
[ K ]t R
0

In

general, nxn equations to solve for nodal


points of unknown temperatures.

K. J. Berry-Week 9

12

PDE
d 2 T mn 1

dT mn 1

hP
c
;C
dx
dt
kA
k
T he first derivative approxim ation at the m idpoint:
2

T mn

(T m

n 1

T ( t )) C
n

n 1
n
dTmn 1 T m T m

; and
t
dt
internediate tem p w ithin each tim e step "n".

T mn 1 =(1- )Tmn Tmn 1 ; 0 1


R mn 1 =(1 - )R nm R mn 1
d 2 T mn 1
T mn 1 T mn
d 2 T mn
n 1
Tm C
(1- )
(1- )Tmn R

2
2
dx
t
dx
2
d T m T m 1 2 T m T m 1

2
dx 2
x

Tm 1 2T m Tm 1

n 1

x Tm
2

n 1

C x2
n 1

Tm
Rn
t

x 2C
Tm
R n (1 ) T m 1 T m (2 x ) T m 1 x R
t

n
n 1
R =(1- )T T ; T im e V arying C onvective Fluid
2

K. J. Berry-Week 9

13

Difference Equation

Fo 2t ; hP ;C c ;0 1
kA
k
x
Tm1 Tm(2 x2 ) Tm1

n1

Rn (1 ) Tm1 Tm(2 x2 ) Tm1

n1

Cx2
Tm

Rn
n

Cx2
2
x R
Tm

1 n1

[I ] Tm R(Tmn )

Fo

1 n

2
n

[
]
T
x
R
R
(
T
)
K
I

(1

m
m

Fo

K Stiffness Matrix, I Capacitance Identity Matrix (damping)



Steady State

Steady State Convergence=

max Tmn Tmn1

K. J. Berry-Week 9

Tmn

Tmn1

0.01
14

THETA

METHOD

Forward Difference (Euler/Explicit)


Steady Decay or Oscillations

Crank-Nicolson (Stable Oscillation)

Galerkin

2
2
3

Backward Difference (Implicit)


NO Oscillation/Steady Decay
Requires smaller time step and
mesh size

K. J. Berry-Week 9

15

Euler

Explicit

Tm1 Tm (2 x 2 ) Tm1

n 1

C
x

Tm

Rn (1 ) Tm1 Tm (2 x 2 ) Tm1

n1

Rn

C x 2

x R
Tm
t

OR
2

C
x
Tm

n 1

Tm1 Tm (2 x 2 ) Tm1
Let : 0, r

C
x

Tm

n 1

C x 2

2
Tm
x R
t

k t 1 t

Fourier #
c x2 C x2

Tm1 Tm (2) Tm1

C x 2

Tm x 2 R

1
n
Tm rTm1 (1 2r )Tm rTm1 r x2 R

K. J. Berry-Week 9

16

K
n1
m

n1

T1

T2

T3

T4

n1

T
j

Matrix Format

rTm1 (12r)Tm rTm1 rx2R


n

12r

0
r
12r r
r 12r
0
r

b
K
T

n

K. J. Berry-Week 9

T
0 1
T
0 2

r T3
12rT
4

b
1
b
2

b3

b4

17

Pros:

Contains only one unknown and van be


solved explicitly at all grid points.
Cons: It is conditionally staple
STABILITY CRITERIA (Conditionally):

t
1
; Fourier Number
r Fo
2
x

cp
K. J. Berry-Week 9

18

Properties

and Geometry

m2
1E 05 ; t 5,000s; x 2.5 0.05m
s
5

t
r 2 0.2 1/ 2
x
I .C.: Ti 60C;(T1 ,T2 ,T3 ,T4 )
B.C.: T0 600C ,T5 60C

K. J. Berry-Week 9

19

Nodes

n 0

1-4

6 0 0

60
6 0

60
60

6 0

T 1n 1

( T 0 T 2 ) (1 2 r ) T 1

168

T 2n 1

( T 1 T 3 ) (1 2 r ) T 2

60

T 3n 1

( T 2 T 4 ) (1 2 r ) T 3

60

60

T 4n 1

r (T
3

6 0 0

1 6 8
6 0

60
60

6 0

T 5 ) (1 2 r ) T 4

K. J. Berry-Week 9

20

1D Euler Transient Solution


X=0

0.5

1.0

1.5

2.0

2.5

t=0

600

60

60

60

60

60

t=5k

600

138

60

60

60

60

t=10k

600

233

82

60

60

60

t=15k

600

276

108

64

60

60

t=20k

600

307

133

72

61

60

T0

T1

T2

T3

T4

T5

K. J. Berry-Week 9

21

Tm 1 Tm (2 x 2 ) Tm 1

n 1

Tm

Rn (1 ) Tm 1 Tm (2 x 2 ) Tm 1

C x
t

n 1

Rn

C x 2

2
Tm
x R
t

OR

2
T

x
(2

) Tm 1
m
m 1

n 1

L et : 0, r

m 1 Tm (2

Tm

C x
t

n 1

k t
1 t

c x 2 C x 2

x 2 ) Tm 1

n 1

Tm

rT

(1 2 r )Tm rT

1
m 1
m

K. J. Berry-Week 9

n 1

n 1

C x 2

2
Tm
x R
t

Fourier #
n

Tm x 2 R

Tm n r x 2 R
22

Matrix Format

rTm1 (1 2r)Tm rTm1

n1

T rx R
n
m

n1

12r

r
0

r
0
12r r
r 12r
0
r

T
T1

1
0
T
0 2 T2

r T3 T3
12r T T4
4

Inter-coupled, Future Equations


Gauss Elimination to Solve

n1

b
1
b
2

b3

b4

KT T b
j j j

K. J. Berry-Week 9

23

r Fo 2t 1 ; Fourier Number
2

x
Conditionally Stable

Explicit

Fast convergence and low computer memory


Uses past times at neighbor nodes to predict
future at center node.

Implicit

Unconditionally Stable
Requires solving system of linear equations
Uses past times at center node to predict
future performance at neighbor nodes.

K. J. Berry-Week 9

24

0.

Set time step size, final time, and grid size


1. Set nodal temperatures to Ti
2. Set fixed nodal temp boundary conditions
3. Evaluate temperature dependent quantities
4. Apply finite difference to unknown nodes
5. Assemble [K] and [R]
6. Solve for {T} and update storage
7. Check steady state condition, else go to 3
8. Check if reached final time, else go to 3
9. Compute heat transfer rate at each node
K. J. Berry-Week 9

25

Formulations

EULER:un+1=(1-2r)un ; un+1 (1-2r)un


u n
(1-r) n
n+1
n n+1
CRANK-NICOLSON:(1+r)u =(1-r)u ; u
u
(1+r)
u n
1
n+1
n n+1
Implicit:(1+2r)u =u ; u
un
(1+2r)
u n
K. J. Berry-Week 9

26

1
Steady, unbounded growth (new value has same sign as old and larger)
1 0
Steady decay (new value has same sign as old and smaller)
0>> -1
Stable oscillations (new value has opposite sign as old and smaller)
<-1
Unstable oscillations (new value has opposite sign as old and larger)

K. J. Berry-Week 9

27

Consider

an advanced problem with a varying


cross section area and temperature
dependent properties.
Not a problem with Finite Differences.
hP
kA
or
h ( T ) Pm ( x )
m (T , x ) m
k m (T ) A m ( x )

h m 1 (T ) h m 1 (T )
2
(T ) k m 1 (T )
k
k m (T ) m 1
2
P ( x ) Pm 1 ( x )
Pm ( x ) m 1
2
A ( x ) Am 1 ( x )
A m ( x ) m 1
2
h m (T )

K. J. Berry-Week 9

28

The

Power of Numerical Methods--Temperature

K. J. Berry-Week 9

29

PressureExperimental/Analytical

Not

Possible

K. J. Berry-Week 9

30

Finite

Differences can be applied to general


Boundary Value Problems. Example:
d2y
dy
x
2

x
x
y
3
(
1)
sin
dx
4
dx 2
L
1; x 2 1
Let : L 6, N 6, x
N
Let : y ( x0 ) y 0 0; y ( xm ) y m 0; m :1 5
RECALL
d 2 y y m 1 2 y m y m 1 dy y m 1 y m
;

; so
2
dx
x

dx 2
x

d 2 ym
dy m
xm
2
3
(
1)
x
x
y

sin
m
m
4
dx
dx 2
K. J. Berry-Week 9

31

d 2 y ym1 2 ym ym1 dy ym ym1

;
; so
2

dx
x
dx 2
x
d 2 ym
dym
xm
2

3
x
(
x
1
)
y
sin
m
m
m
dx
4
dx 2

m 1; y0 2 y1 y2 3x1( y1 y0 ) ( x1 1) y1 sin
2

x1
4

x2

4
x
m 3; y 2 y y 3x ( y y ) ( x 1) y sin
4
x
m 4; y 2 y y 3x ( y y ) ( x 1) y sin
4
x
m 5; y 2 y y 3x ( y y ) ( x 1) y sin
4
m 2; y1 2 y2 y3 3x2 ( y2 y1) ( x2 1) y2 sin
2

K. J. Berry-Week 9

32

4x 3 x y y

x
m 2; y (1 3 x ) y (2 3 x x 1) y sin
4
x
m 3; y (1 3 x ) y (2 3 x x 1) y sin
4
x
m 4; y (1 3 x ) y (2 3 x x 1) y sin
4
x
y
m 5; y (1 3 x ) y (2 3 x x 1) sin
4
m 1; y1 (2 3 x1 x12 1) y2 sin

0
2

L
1; x 2 1
N
2, x3 3, x4 4, x5 5

L et : L 6, N 6, x
F o r : L 6 , x1 1, x 2
m

Xm

Y(m1)

Y(m)

Y(m+1)

0.706825

15

0.707951

11

25

0.001593

14

37

0.7057

K. J. Berry-Week 9

33

0
0
0 y1 0.706825
1 1
5 7
y

1
0
0
1

0 8 15
1
0 y3 0.707951

0
0
11
25
1
0.001593

0 0
0 14 37 y5 0.7057

K. J. Berry-Week 9

34

You might also like