• No results found

Finite Difference Method

N/A
N/A
Protected

Academic year: 2021

Share "Finite Difference Method"

Copied!
34
0
0

Loading.... (view fulltext now)

Full text

(1)

Finite Difference Method

MEL 807

Computational Heat Transfer (2-0-4)

Dr. Prabal Talukdar

Assistant Professor

Department of Mechanical Engineering

IIT Delhi

(2)

Discretization Methods

• Required to convert the general transport

equation to set of algebraic equations

™

Finite difference method

™

Finite volume method

(3)

Introduction to Finite Difference

+

+

+

+

+

=

+

!

n

)

x

(

x

f

2

)

x

(

x

f

x

x

f

)

x

(

f

)

x

x

(

f

n n n 2 2 2 Taylor series expansion

(4)

Discretization

⎟⎟

⎜⎜

φ

+

φ

⎟⎟

⎜⎜

φ

+

φ

+

φ

=

φ

+

6

)

x

(

x

2

)

(

x

x

x

3 j , i 3 3 2 j , i 2 2 j , i j , i j , 1 i x

(5)

Representation of a Derivative

)

x

(

x

x

j , i j , 1 i j , i

+

φ

φ

=

φ

+

O

⎟⎟

⎜⎜

φ

⎟⎟

⎜⎜

φ

φ

φ

=

φ

+

6

)

x

(

x

2

)

x

(

x

x

x

2 j , i 3 3 j , i 2 2 j , i j , 1 i j , i Finite difference representation

⎟⎟

⎜⎜

φ

+

⎟⎟

⎜⎜

φ

+

φ

+

φ

=

φ

+

6

)

x

(

x

2

)

x

(

x

x

x

3 j , i 3 3 2 j , i 2 2 j , i j , i j , 1 i Forward difference

(6)

Backward Difference

⎟⎟

⎜⎜

φ

+

⎟⎟

⎜⎜

φ

+

φ

+

φ

=

φ

6

)

x

(

x

2

)

x

(

x

)

x

(

x

3 j , i 3 3 2 j , i 2 2 j , i j , i j , 1 i

⎟⎟

⎜⎜

φ

⎟⎟

⎜⎜

φ

+

φ

φ

=

φ

6

)

x

(

x

2

)

x

(

x

x

x

3 j , i 3 3 2 j , i 2 2 j , i j , i j , 1 i

)

x

(

x

x

j , 1 i j , i j , i

+

φ

φ

=

φ

O

Backward difference

(7)

Central difference

⎟⎟

⎜⎜

φ

+

⎟⎟

⎜⎜

φ

+

φ

+

φ

=

φ

+

6

)

x

(

x

2

)

x

(

x

x

x

3 j , i 3 3 2 j , i 2 2 j , i j , i j , 1 i

⎟⎟

⎜⎜

φ

⎟⎟

⎜⎜

φ

+

φ

φ

=

φ

6

)

x

(

x

2

)

x

(

x

x

x

3 j , i 3 3 2 j , i 2 2 j , i j , i j , 1 i 2 j , 1 i j , 1 i j , i

)

x

(

x

2

x

+

φ

φ

=

φ

+ −

O

Subtracting, Central difference

(8)

Forward, backward and central

difference stencil

) x ( O x x j , i j , 1 i j , i ∆ + ∆ φ − φ = ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ ∂ φ ∂ + ) x ( x x j , 1 i j , i j , i ∆ + ∆ φ − φ = ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ ∂ φ ∂ − O 2 j , 1 i j , 1 i j , i ) x ( x 2 x ∆ + ∆ φ − φ = ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ ∂ φ ∂ + − O

(9)

Stencil in y direction

) y ( y y j , i 1 j , i j , i ∆ + ∆ φ − φ = ⎟⎟ ⎠ ⎞ ⎜⎜ ⎝ ⎛ ∂ φ ∂ + O

)

y

(

y

y

1 j , i j , i j , i

+

φ

φ

=

⎟⎟

⎜⎜

φ

O

2 j , 1 i j , 1 i j , i ) y ( y 2 y ∆ + ∆ φ − φ = ⎟⎟ ⎠ ⎞ ⎜⎜ ⎝ ⎛ ∂ φ ∂ + − O

(10)

2

nd

Order and Mixed Derivative

) ) x ( ) x ( 2 x 2 2 j , 1 i j , i j , 1 i j , i 2 2 ∆ + ∆ φ + φ − φ = ⎟⎟ ⎠ ⎞ ⎜⎜ ⎝ ⎛ ∂ φ ∂ + − 0 ) ) y ( ) y ( 2 y 2 2 1 j , i j , i 1 j , i j , i 2 2 ∆ + ∆ φ + φ − φ = ⎟⎟ ⎠ ⎞ ⎜⎜ ⎝ ⎛ ∂ φ ∂ + − 0 ] ) y ( , ) x [( y x 4 y x 2 2 1 j , 1 i 1 j , 1 i 1 j , 1 i 1 j , 1 i j , i 2 ∆ ∆ + ∆ ∆ φ − φ − φ + φ = ⎟⎟ ⎠ ⎞ ⎜⎜ ⎝ ⎛ ∂ ∂ φ ∂ + + − − − + + − O

(11)

Boundary Consideration

• What kind of differencing scheme is possible at the

boundaries?

• Central difference approximation

is not possible as point 2’ is

beneath the boundary

• How we can get a second order

accurate scheme?

• Possibility:

Polynomial approach

)

y

(

y

y

1 2 1

+

φ

φ

=

⎟⎟

⎜⎜

φ

O

(12)

Polynomial Approach

• Assume

• At grid point 1, φ

1

= a

• At grid point 2 where y = ∆y,

• At grid point 3 where y = 2∆y,

2

cy

by

a

+

+

=

φ

2 2

=

a

+

b

y

+

c

(

y

)

φ

2 2

=

a

+

b

2

y

+

c

(

2

y

)

φ

(13)

Polynomial Approach (cont’d)

• Solving these equations,

• Differentiation of

gives

• At point 1 (boundary),

• What is the order of

approximation??

y

2

4

3

b

1 2 3

φ

φ

+

φ

=

b

y

cy

2

b

y

cy

by

a

1 2

=

⎟⎟

⎜⎜

φ

+

=

φ

+

+

=

φ

y

2

4

3

y

3 2 1 1

φ

φ

+

φ

=

⎟⎟

⎜⎜

φ

(14)

Order of Approximation

• Taylor series gives,

• Comparing with the polynomial expression ,

we can say that our polynomial is of O(∆y)

3

φ

1

, φ

2

, φ

3

can all be expressed in terms of the polynomial

• Represents one-sided difference of 2

nd

order accuracy

− − − + ⎟⎟ ⎠ ⎞ ⎜⎜ ⎝ ⎛ ∂ φ ∂ + ⎟⎟ ⎠ ⎞ ⎜⎜ ⎝ ⎛ ∂ φ ∂ + ⎟⎟ ⎠ ⎞ ⎜⎜ ⎝ ⎛ ∂ φ ∂ + φ = φ 6 y y 2 y y y y ) y ( 3 1 3 3 2 1 2 2 1 1 2 3 3 2 1 1

)

y

(

y

)

y

(

y

2

4

3

y

=

=

φ

φ

+

φ

=

⎟⎟

⎜⎜

φ

O

O

2

cy

by

a

+

+

=

φ

(15)

FDM for 1D diffusion

• Uses truncated Taylor series expansion to approximate the

derivative of the DE

• Consider 1-D diffusion equation

• Expand φ

in Taylor series about

point 2

0

S

dx

d

2 2

=

+

φ

Γ

(16)

FDM (cont’d)

)

)

x

(

)

x

(

2

dx

d

2 2 2 3 1 2 2 2

+

φ

φ

+

φ

=

⎟⎟

⎜⎜

⎛ φ

0

2 2 3 1 2 2 2

)

x

(

2

dx

d

φ

φ

+

φ

Γ

=

⎟⎟

⎜⎜

⎛ φ

Γ

Second order truncation error

Dropping the truncated terms

Adding the equations

2 3 2 1 2 2 2

S

)

x

(

)

x

(

)

x

(

2

+

φ

Γ

+

φ

Γ

=

φ

Γ

(17)

FDM (cont’d)

• We can write one such equation for each grid

point

• Boundary conditions gives us boundary value

• Second order accurate

• Need to find a way to solve the couple

algebraic equation set

2 3 2 1 2 2 2

S

)

x

(

)

x

(

)

x

(

2

+

φ

Γ

+

φ

Γ

=

φ

Γ

(18)

1D Steady State Conduction

• Consider the steady state heat conduction in a slab of thickness L,

in which energy is generated at a constant rate of S W/m

3

. The

boundary surface at x = 0 is maintained at a constant temperature

T

o,

while the boundary surface at x = 0 dissipates heat by

convection with a heat transfer coefficient h into an ambient at

temperature T

.

Compute the temperature inside the slab for h = 200

W/(m

2

.°C), k = 18 W/(m.°C), L = 0.01 m, T

= 100°C, T

o

= 50°C, and

S = 7.2 x 10

7

.

To = 50 ° C 0.01 m T = 100 ° C x ∆x 0 1 2 3 4 5

(19)

Solution

0.01m

L

at x

hT

hT

dx

)

x

(

dT

k

0

at x

T

)

x

(

T

0

S

dx

T

d

k

o 2 2

=

=

=

+

=

=

=

+

∞ B.C.

16

S

k

)

5

/

L

(

S

k

)

x

(

T

T

2

T

S

T

)

x

(

k

T

)

x

(

k

2

T

)

x

(

k

S

T

)

x

(

k

T

)

x

(

k

T

)

x

(

k

2

i 2 i 2 1 i i 1 i i 1 i 2 i 2 1 i 2 i 1 i 2 1 i 2 i 2

=

=

=

+

=

+

+

+

=

+ − + − + −

(20)

Treatment of Boundary Condition

16

T

T

2

T

i1

i

+

i+1

=

To = 50 ° C 0.01 m x ∆x 0 1 2 3 4 N=5

Applicable to node 1-4

∆x/2

0

44

.

4

16

T

044

.

2

T

2

0

T

k

xh

2

k

S

)

x

(

T

k

xh

2

2

T

2

0

2

x

S

)

T

T

(

h

x

T

T

k

5 4 N 2 N 1 N N 1 N N

=

+

+

=

+

+

+

=

+

∞ − ∞ − T cond conv

Applying it to

node 5

(21)

Treatment of Boundary Condition

(Another Way)

16

T

T

2

T

4

5

+

6

=

4 5 6 5 4 6

T

)

T

T

(

k

xh

2

T

0

)

T

T

(

h

x

2

T

T

k

+

=

=

∞ ∞

16

T

T

2

T

i1

i

+

i+1

=

To = 50 ° C 0.01 m x ∆x 0 1 2 3 4 N=5

Apply to node 5

T B.C. gives 44 . 4 16 T 044 . 2 T 2 T k x h 2 16 T k x h 2 2 T 2 5 4 5 4 + − = − ⇒ ∆ + − = ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ + ∆ −

(22)

Algebraic Equations

16

T

T

2

T

0

1

+

2

=

16

T

T

2

T

1

2

+

3

=

16

T

T

2

T

2

3

+

4

=

16

T

T

2

T

3

4

+

5

=

44

.

4

16

T

044

.

2

T

2

4

5

=

50

16

T

T

2

1

+

2

=

• Can be solved by Thomas’ algorithm

• Matrix inversion as shown in next slide

(23)

Matrix Form

=

44

.

20

16

16

16

66

T

T

T

T

T

044

.

2

2

0

0

0

1

2

1

0

0

0

1

2

1

0

0

0

1

2

1

0

0

0

1

2

5 4 3 2 1

[ ][ ] [ ]

[ ] [ ] [ ]

x

A

B

B

x

A

1 −

=

=

(24)

Prescribed Heat Flux

X=0 ∆x 0 1 2 3 N-1 N ∆x/2 X=L qo q N

Energy balance gives,

0

xS

2

1

x

T

T

k

q

0

xS

2

1

x

T

T

k

q

N N 1 N N 0 0 1 0

=

+

+

=

+

+

(25)

FDM representation

N

i

0

k

xq

2

k

S

)

x

(

T

2

T

2

0

i

0

k

xq

2

k

S

)

x

(

T

2

T

2

N N 2 N 1 N 0 0 2 0 1

=

=

+

+

=

=

+

+

for

for

N

i

0

k

S

)

x

(

T

2

T

2

0

i

0

k

S

)

x

(

T

2

T

2

N 2 N 1 N 0 2 0 1

=

=

+

=

=

+

for

for

For insulated or symmetry boundary,

Flux boundary,

(26)

Unsteady Heat Conduction with

FDM

• Unsteady heat conduction in

1-D with constant thermal

conductivity

• Expand the individual

terms with Taylor series,

2 2

x

T

t

T

α

=

+

⎟⎟

⎜⎜

=

+

2

t

t

T

t

T

T

t

T

n i 2 2 n i 1 n i n i

+

⎟⎟

⎜⎜

+

=

⎟⎟

⎜⎜

+

12

)

x

(

x

T

)

x

(

T

T

2

T

x

T

n 2 i 4 4 2 n 1 i n i n 1 i n i 2 2

(27)

Unsteady Heat Conduction (cont’d)

2 n 1 i n i n 1 i n i 1 n i

)

x

(

)

T

T

2

T

(

t

T

T

+

α

=

+ +

(28)

Explicit Solutions

)

T

T

2

T

(

)

x

(

t

T

T

)

x

(

)

T

T

2

T

(

t

T

T

n 1 i n i n 1 i 2 n i 1 n i 2 n 1 i n i n 1 i n i 1 n i − + + − + +

+

α

+

=

+

α

=

cm 10 5 50 x = = ∆

α

=

17

x

10

−2

cm

2

/

s

Tw = 30C Tw = 100C 50 cm

Find 1-D unsteady temperature distribution till steady state

Initial temp Tin = 30C, ∆t = 10 sec

2

1

)

x

(

t

2

α

(29)

Results

0 20 40 60 80 100 120 0 1 2 3 4 5 6 7 8 20sec 90sec 260sec 360 T(°C) Nodes

(30)

2D Steady State Heat Conduction

0

k

)

y

,

x

(

S

y

T

x

T

2 2 2 2

=

+

+

2 j , 1 i j , i j , 1 i j , i 2 2

)

x

(

T

T

2

T

x

T

+

=

⎟⎟

⎜⎜

+ −

2D steady state with heat generation

2 1 j , i j , i 1 j , i j , i 2 2

)

y

(

T

T

2

T

y

T

+

=

⎟⎟

⎜⎜

+ −

l

y

x

0

k

l

S

T

4

T

T

T

T

2 j , i j , i 1 j , i 1 j , i j , 1 i j , 1 i

=

=

=

+

+

+

+

+ +

where

(31)

Flux Boundary Condition

Ti,,j+1 Ti,,j-1 Ti+1,,j Ti,,j l qo W/m2 l/2

Nodes (i,j) on a prescribed heat flux boundary

0 k lq 2 k S l T 4 T T 2 T 0 S l 2 1 l T T 2 l k l T T kl l T T 2 l k l q o j , i 2 j , i 1 j , i j , 1 i 1 j , i j , i 2 j , i 1 j , i j , i j , 1 i j , i 1 j , i 0 = + + − + + = + − + − + − + − + + − + + After rearrangement

(32)

Flux Boundary Condition

(another way)

0 k S l T 4 T T T T i,j 2 j , i 1 j , i 1 j , i j , 1 i j , 1 i− + + + + + − − + = j , 1 i o j , 1 i j , 1 i j , 1 i o T k lq 2 T l 2 T T k x T k q + − − + + = ⇒ − − = ∂ ∂ − = Ti,,j+1 Ti,,j-1 Ti+1,,j Ti,,j l qo W/m2 l/2

Applying the finite difference equation at the boundary node (i, j)

B.C.

0

k

lq

2

k

S

l

T

4

T

T

2

T

i,j o 2 j , i 1 j , i j , 1 i 1 j , i +

+

+

+

+

+

=

(33)

Convective Boundary Condition

0 S l 4 3 ) T T ( hl l T T 2 l k l T T kl l T T kl l T T 2 l k i,j−1 − i,j + i−1,j − i,j + i,j+1 − i,j + i+1,j − i,j + i,j + 2 i,j = After rearrangement,

0

T

k

hl

2

S

k

l

2

3

T

k

hl

2

6

T

T

2

T

2

T

i,j 2 j , i j , 1 i 1 j , i j , 1 i 1 j , i

+

+

=

⎛ +

+

+

+

+ + − Ti,,j+1 Ti,,j l l/2 Ti-1,,j Ti+1,j Convection h,T Ti,,j-1 l

(34)

Insulated Boundary

x b 6 cos 100 ) x ( T = π 0 3b 0 2b T1 T2 T5 T3 T4 T6 100 86.66 50 Insulated Maintained at zero temperature Insulated Node 1: 2T2+2T3-4T1= 0 Node 2: T1+2T4+100-4T2 = 0 Node 3: T1+2T4+T5-4T3 = 0 Node 4: T2+T3+T6+86.66-4T4 = 0 Node 5: T3+2T6-4T5 = 0 Node 6: T4+T5+50-4T6 = 0 ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ − − − = ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ − − − − − − 50 0 66 . 86 0 100 0 T T T T T T 4 1 1 0 0 0 2 4 0 1 0 0 1 0 4 1 1 0 0 1 2 4 0 1 0 0 2 0 4 1 0 0 0 2 2 4 6 5 4 3 2 1 Matrix Form

References

Related documents

Urban transportation is a complex system with an increasing number of competing transport modes and with very different patterns across cities in the use of private

Spain Spanish energy industry association UNESA offers a consumption calculator which allows customers to see the cost breakdown of the invoice: energy, access fees,

Antimicrobial Poly (vinyl alcohol) Nanofibers Containing Silver Nanoparticles. In Poly

4.4.2 Finite-Difference Form of the Heat Equation: No Generation and Constant Properties 222 4.4.3 Finite-Difference Form of the Heat Equation: The Energy Balance Method 223.

In steady state condition as no heat is absorbed, the rate of loss of heat by conduction is equal to that of the

Mobile device management is defined as software used to manage the components and requirements of mobile devices (including smartphones and tablets) within an

Direct response advertising, marketing accountability, through the line campaign, analytic hierarchical processing, game theory modelling, marketing metrics, open

In this work, a 3D breast structure has different permittivity and conductivity is modelled in HFSS by using Finite Element Method (FEM) to solve electromagnetic field values and