23
Finite element method

Bche Cfd Fem 2 [Print Version]

Embed Size (px)

Citation preview

Page 1: Bche Cfd Fem 2 [Print Version]

Finite element method

Page 2: Bche Cfd Fem 2 [Print Version]

'''q x

k x

L

''qLT

'''q x

k x''q

xx

Page 3: Bche Cfd Fem 2 [Print Version]

2''' 2 ''

1 1 2 2 3 3

''' 2

1 1

( ) 1 12

The solution can also be approximated as:T ......For N=3, If compared with analytical solution, then

and 12

L

NN N

q L x q L xT x Tk L k L

x a x a x a x a x

q Lak

2

''

2 2

3 3

and 1

and 1L

xL

q L xak L

a T

2''' 2 ''

1 1 2 2 3 3

''' 2

1 1

( ) 1 12

The solution can also be approximated as:T ......For N=3, If compared with analytical solution, then

and 12

L

NN N

q L x q L xT x Tk L k L

x a x a x a x a x

q Lak

2

''

2 2

3 3

and 1

and 1L

xL

q L xak L

a T

Page 4: Bche Cfd Fem 2 [Print Version]

N1 N2 N1 N2 N1 N2 N1 N2

e1 e2 e3 e4

Element arrangementfor 1-D conductionproblem

Page 5: Bche Cfd Fem 2 [Print Version]

2

1 1 2 21

2

1 1 1

For any element - e

T N T +N T N T

Now,

T ( ) N T

number of elements in the computational domain

je e e e

j jj

jN MeN

i i j ji e j

x

x a x x

M

2

1 1 2 21

2

1 1 1

For any element - e

T N T +N T N T

Now,

T ( ) N T

number of elements in the computational domain

je e e e

j jj

jN MeN

i i j ji e j

x

x a x x

M

Page 6: Bche Cfd Fem 2 [Print Version]

Galerkin’s method of FEM formulationTe

mpe

ratu

re (T

)Analytical solution

Distance (x)

Tem

pera

ture

(T)

Approximate solution

Page 7: Bche Cfd Fem 2 [Print Version]

T T eN Nx x x

Analytical solution = Approximate solution + error

L(eN) = L(T) – L(TN) = – L(TN)

Hence,

L(eN) = L(T) – L(TN) = – L(TN)

Hence,

'''L T 0N

N d dTk qdx dx

Page 8: Bche Cfd Fem 2 [Print Version]

To minimize global error over theentire domain the , error isintegrated over the domain w.r.t. aresidual function.

'''

0 for 1 i N

0 for 1 i N

Ni

N

i

w L T dx

d dTw k q dxdx dx

'''

0 for 1 i N

0 for 1 i N

Ni

N

i

w L T dx

d dTw k q dxdx dx

In Galerkin’s method

i iw x x

Page 9: Bche Cfd Fem 2 [Print Version]

Now it can be written,

'''

0

0

1 i NThe second derivative term in the equationmay be reduced to first derivative term byapplying integration by parts.

L N

id dTx k q dxdx dx

for

'''

0

0

1 i NThe second derivative term in the equationmay be reduced to first derivative term byapplying integration by parts.

L N

id dTx k q dxdx dx

for

Page 10: Bche Cfd Fem 2 [Print Version]

As the derivative is reduced in orderby 1 the statement now calledGalerkin’s weak statement andtermed as WSL N

i0

L Ni

0

L'''

i0

d dTWS= k dx-dx dx

d d dT k dx dxdx dx dx

+ q dx 0

L N

i0

L Ni

0

L'''

i0

d dTWS= k dx-dx dx

d d dT k dx dxdx dx dx

+ q dx 0

Page 11: Bche Cfd Fem 2 [Print Version]

LN Ni

i00

L'''

i0

ddT dTWS= k - k dxdx dx dx

+ q dx 0

L

LN Ni

i00

L'''

i0

ddT dTWS= k - k dxdx dx dx

+ q dx 0

L

( )

1

Mh e

eWS WS

Page 12: Bche Cfd Fem 2 [Print Version]

2

1 1

'''1

1

1

0

For 1 i 2 are Kronecker delta for boundary

condition specification.

e

e

Mjh ei

je j

M

i i eM i ee

e eM

dNdNWS k dxTdx dx

dT dTN q dx N k N kdx dx

and

2

1 1

'''1

1

1

0

For 1 i 2 are Kronecker delta for boundary

condition specification.

e

e

Mjh ei

je j

M

i i eM i ee

e eM

dNdNWS k dxTdx dx

dT dTN q dx N k N kdx dx

and

Page 13: Bche Cfd Fem 2 [Print Version]

Term by termformulation

1 i = 1

1 i = 2

( )

( )11

0

( )

20

( )

1 1 1 1

1 11 1

1 11 1

i e

e

j eij

ee

e

j

ee

j

e

j

d Nd x

d Nd N k d x Td x d x

k d x Te e

k d x Te

k Te

1 i = 1

1 i = 2

( )

( )11

0

( )

20

( )

1 1 1 1

1 11 1

1 11 1

i e

e

j eij

ee

e

j

ee

j

e

j

d Nd x

d Nd N k d x Td x d x

k d x Te e

k d x Te

k Te

Page 14: Bche Cfd Fem 2 [Print Version]

'''1''' '''

20

1

'''1

1

112

Therefore, WS

1 1 1 0 =

1 1 1 02

e

ie

Meh

e

Me e

e eM

N q eN q dx q dxN

WS

k q e dTT ke dx

'''1''' '''

20

1

'''1

1

112

Therefore, WS

1 1 1 0 =

1 1 1 02

e

ie

Meh

e

Me e

e eM

N q eN q dx q dxN

WS

k q e dTT ke dx

Page 15: Bche Cfd Fem 2 [Print Version]

'''q c o n s tk c o n s t

L

' 'qLT

T1 T2 T3 = TL

M = 2

'''q c o n s tk c o n s t

' 'q

x

1 2

Page 16: Bche Cfd Fem 2 [Print Version]

For M=2 the discretization scheme:

'''1 11

1

'''1 ''

''

1 1 11: WS

1 1 1 02

1 1 1 1/ 21 1 1 0/ 2 2

: =q at x = 0.

ek q e dTe T ke dx

q Lk T qL

dTNote kdx

'''1 11

1

'''1 ''

''

1 1 11: WS

1 1 1 02

1 1 1 1/ 21 1 1 0/ 2 2

: =q at x = 0.

ek q e dTe T ke dx

q Lk T qL

dTNote kdx

Page 17: Bche Cfd Fem 2 [Print Version]

'''2

222

'''2

1 1

2

2 1

2

2 :01 1 1

WS1 1 12

1 1 1 0/ 21 1 1 1/ 2 2

: =

=

e

e

k q e dTT ke dx

q Lk dTT kL dx

TNote T

T

TT

T

'''2

222

'''2

1 1

2

2 1

2

2 :01 1 1

WS1 1 12

1 1 1 0/ 21 1 1 1/ 2 2

: =

=

e

e

k q e dTT ke dx

q Lk dTT kL dx

TNote T

T

TT

T

Page 18: Bche Cfd Fem 2 [Print Version]

When two element-matrix arecombined, it gives the globalmatrix for all over the domain ofanalysis.

1

2

3

,K = Global diffusion matrixb = Global load matrix

TK T b

TWhere

1

2

3

,K = Global diffusion matrixb = Global load matrix

TK T b

TWhere

Page 19: Bche Cfd Fem 2 [Print Version]

2

1

1 1 0 0 0 02 21 1 0 0 1 1

0 0 0 0 1 1

1 1 02 1 2 1

0 1 1

eM

e

Now

K K

k kL L

kL

2

1

1 1 0 0 0 02 21 1 0 0 1 1

0 0 0 0 1 1

1 1 02 1 2 1

0 1 1

eM

e

Now

K K

k kL L

kL

Page 20: Bche Cfd Fem 2 [Print Version]

2

1

''''' '''

,

1 0 01 0 1 0

4 40 0 0

e

e

Similarly

b b

qq L q L

dTkdx

2

1

''''' '''

,

1 0 01 0 1 0

4 40 0 0

e

e

Similarly

b b

qq L q L

dTkdx

Page 21: Bche Cfd Fem 2 [Print Version]

1

2

3

''''' 2

2 through all the terms by - ,

1 1 01 2 1

0 1 1

12 0

8 21

kDividingL

TTT

qq L Lk k

dTkdx

1

2

3

''''' 2

2 through all the terms by - ,

1 1 01 2 1

0 1 1

12 0

8 21

kDividingL

TTT

qq L Lk k

dTkdx

Page 22: Bche Cfd Fem 2 [Print Version]

3

1 2

'''''

1 ''' 2

2

3

the boundary condition at x = L is T =T T and T are only two unknown temperatures.

The matrix equation reduces to:

2 41 1 01 2 1

40 1 1

L

L

As Tonly

L q L qk k

Tq LTk

T T

'''''

1

''' 22

, the matrix equation is reduced to 2 x 2 matrix

1 1 2 41 2

4 L

Or

L q L qT k kT q L T

k

3

1 2

'''''

1 ''' 2

2

3

the boundary condition at x = L is T =T T and T are only two unknown temperatures.

The matrix equation reduces to:

2 41 1 01 2 1

40 1 1

L

L

As Tonly

L q L qk k

Tq LTk

T T

'''''

1

''' 22

, the matrix equation is reduced to 2 x 2 matrix

1 1 2 41 2

4 L

Or

L q L qT k kT q L T

k

Page 23: Bche Cfd Fem 2 [Print Version]

''' ''

1''' 2 ''

2

''' ''

1

the matrix equation involves two unknown nodal temperatures.Solution to this equation gives:

23

8 2 the final solution is:

2

L

L

Now

q L q L TT k kT q L q L T

k kAnd

q L q LT Tk k

''' 2 ''

2

3

38 2 (Known boundary condition)

L

L

L

q L q LT Tk k

T T

''' ''

1''' 2 ''

2

''' ''

1

the matrix equation involves two unknown nodal temperatures.Solution to this equation gives:

23

8 2 the final solution is:

2

L

L

Now

q L q L TT k kT q L q L T

k kAnd

q L q LT Tk k

''' 2 ''

2

3

38 2 (Known boundary condition)

L

L

L

q L q LT Tk k

T T