moving mesh-moving boundary method for two-phase … · •the shape functions are 1 at the node...

18
MOVING MESH-MOVING BOUNDARY METHOD FOR TWO-PHASE FLOWS WITH PHASE CHANGE Tutorial 11-4-2: Two Phase Boiling Computational Modelling Challenges Gustavo R. ANJOS San Francisco - CA, InterPACK2015 July 6th, 2015 http://gustavo.rabello.org http://www.gesar.uerj.br

Upload: others

Post on 14-Oct-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: MOVING MESH-MOVING BOUNDARY METHOD FOR TWO-PHASE … · •the shape functions are 1 at the node and zero everywhere else; •the sum of all shape function at the element is 1 everywhere,

MOVING MESH-MOVING BOUNDARY METHOD FOR TWO-PHASE FLOWS

WITH PHASE CHANGE

Tutorial 11-4-2: Two Phase Boiling Computational Modelling Challenges

Gustavo R. ANJOS

San Francisco - CA, InterPACK2015 July 6th, 2015

http://gustavo.rabello.org http://www.gesar.uerj.br

Page 2: MOVING MESH-MOVING BOUNDARY METHOD FOR TWO-PHASE … · •the shape functions are 1 at the node and zero everywhere else; •the sum of all shape function at the element is 1 everywhere,

OUTLINE

• Intro to Finite Element Method• Variational method: the weak form;• Function approximations: Galerkin method;• 1D example;• Tasks: 1D and 2D examples;

2

Page 3: MOVING MESH-MOVING BOUNDARY METHOD FOR TWO-PHASE … · •the shape functions are 1 at the node and zero everywhere else; •the sum of all shape function at the element is 1 everywhere,

Fundamentals of the Finite Element Method for Heat and Fluid Flow

Authors: Roland W. Lewis, Perumal Nithiarasu, Kankanhally e N.

Seetharamu

Basic

Basic-advancedThe Finite Element Method - Linear Static and Dynamic Finite Element

AnalysisAuthors: Thomas J.R. Hughues

BIBLIOGRAPHY

Page 4: MOVING MESH-MOVING BOUNDARY METHOD FOR TWO-PHASE … · •the shape functions are 1 at the node and zero everywhere else; •the sum of all shape function at the element is 1 everywhere,

Find in such that:u ⌦ = [0, 1]⇥ [0, 1]

321

1 2 3 4(0,0) (0,1)

x

1D PROBLEM - STRONG FORM

d

2u

dx

2+ u+ 1 = 0

u(0) = 0 boundaryconditiondu

dx

(1) = 1

h1 = h2 = h3 = 1/3domain:Answer: u2=1.049; u3=1,874; u4=2,386

3

Page 5: MOVING MESH-MOVING BOUNDARY METHOD FOR TWO-PHASE … · •the shape functions are 1 at the node and zero everywhere else; •the sum of all shape function at the element is 1 everywhere,

1D PROBLEM - WEAK FORM

Z

⌦w

✓d

2u

dx

2+ u+ 1

◆d⌦ = 0

Z 1

0w

d

2u

dx

2dx+

Z 1

0wudx+

Z 1

0dx = 0

w

du

dx

����1

0

�Z 1

0

du

dx

dw

dx

dx+

Z 1

0wudx+

Z 1

0wdx = 0

w

du

dx

����1

� w

du

dx

����0

�Z 1

0

du

dx

dw

dx

dx+

Z 1

0wudx+

Z 1

0wdx = 0

weight functionmathematical procedure (integration by parts)

Find in such that:u H1

4

Page 6: MOVING MESH-MOVING BOUNDARY METHOD FOR TWO-PHASE … · •the shape functions are 1 at the node and zero everywhere else; •the sum of all shape function at the element is 1 everywhere,

•the shape functions are 1 at the node and zero everywhere else;•the sum of all shape function at the element is 1 everywhere, including boundary.

Finite element properties:

Chart:function node, i node, j x

Ni 1 0 between 0 e 1Nj 0 1 between 0 e 1

Ni+Nj 1 1 1

CHOOSING ELEMENT

5

Page 7: MOVING MESH-MOVING BOUNDARY METHOD FOR TWO-PHASE … · •the shape functions are 1 at the node and zero everywhere else; •the sum of all shape function at the element is 1 everywhere,

FEM SHAPE FUNCTIONS1D Problem - linear :

T (x) = ↵1 + ↵2x T (x) = ↵1 + ↵2x+ ↵3x2

1D problem - quadratic:

shapefunction

function

shapefunction

derivative

6

Page 8: MOVING MESH-MOVING BOUNDARY METHOD FOR TWO-PHASE … · •the shape functions are 1 at the node and zero everywhere else; •the sum of all shape function at the element is 1 everywhere,

GALERKIN METHOD

u =4X

i=1

Niui w =4X

j=1

Njwj

4X

i=j=1

✓Z 1

0

dNi

dx

dNj

dx

dx�Z 1

0NiNjdx

◆ui =

4X

j=1

Z 1

0Njdx+

du

dx

(1)� du

dx

(0)

w(1)du

dx

(1)� w(0)du

dx

(0)�4X

i=j=1

Z 1

0

dNi

dx

uidNj

dx

wjdx+4X

i=j=1

Z 1

0NiuiNjwjdx+

4X

j=1

Z 1

0Njwjdx = 0

w(1)du

dx

(1)� w(0)du

dx

(0)�4X

i=j=1

Z 1

0

dNi

dx

uidNj

dx

wjdx+4X

i=j=1

Z 1

0NiuiNjwjdx+

4X

j=1

Z 1

0Njwjdx = 0

(Kij �Mij)ui = bistiffness matrix

mass matrix(Kij �Mij)ui = bi(Kij �Mij)ui = bi

right hand side.

Approximated functions:

boundarycondition

7(Kij �Mij)ui = bi + b.c.

Page 9: MOVING MESH-MOVING BOUNDARY METHOD FOR TWO-PHASE … · •the shape functions are 1 at the node and zero everywhere else; •the sum of all shape function at the element is 1 everywhere,

1D PROBLEM - LINEAR

3211 2 3 4

(0,0) (1.0)x

(0.3) (0.6)

1element

2element

3element

N1 = �3x+ 1N2 = 3x

N2 = �3x+ 2N3 = 3x� 1

N3 = �3x+ 3

N4 = 3x� 2

⌦e2 = [1/3, 2/3]

⌦e1 = [0, 1/3]

⌦e3 = [2/3, 1]

N1 = �3x+ 1N2 = 3x N3 = 3x� 1N4 = 3x� 2domainand shapefunctions:

8

Page 10: MOVING MESH-MOVING BOUNDARY METHOD FOR TWO-PHASE … · •the shape functions are 1 at the node and zero everywhere else; •the sum of all shape function at the element is 1 everywhere,

MATRIX FORM

1element

N1 = �3x+ 1N2 = 3x

⌦e1 = [0, 1/3]

K11 �M11 =

Z 1/3

0

dN1

dx

dN1

dx

dx�Z 1/3

0N1N1dx

K12 �M12 =

Z 1/3

0

dN1

dx

dN2

dx

dx�Z 1/3

0N1N2dx

K21 �M21 =

Z 1/3

0

dN2

dx

dN1

dx

dx�Z 1/3

0N2N1dx

K22 �M22 =

Z 1/3

0

dN2

dx

dN2

dx

dx�Z 1/3

0N2N2dx

b1 =

Z 1/3

0N1dx� du

dx

(0)

b2 =

Z 1/3

0N2dx

9

matrix

vector

Ke1 �Me

1 =

"K11 K12

K21 K22

#�

"M11 M12

M21 M22

#

"b1

b2

#

Page 11: MOVING MESH-MOVING BOUNDARY METHOD FOR TWO-PHASE … · •the shape functions are 1 at the node and zero everywhere else; •the sum of all shape function at the element is 1 everywhere,

MATRIX FORM

2element

9

matrix

vector

N2 = �3x+ 2

N3 = 3x� 1

⌦e2 = [1/3, 2/3]

K22 �M22 =

Z 2/3

1/3

dN2

dx

dN2

dx

dx�Z 2/3

1/3N2N2dx

K23 �M23 =

Z 2/3

1/3

dN2

dx

dN3

dx

dx�Z 2/3

1/3N2N3dx

K32 �M32 =

Z 2/3

1/3

dN3

dx

dN2

dx

dx�Z 2/3

1/3N3N2dx

K33 �M33 =

Z 2/3

1/3

dN3

dx

dN3

dx

dx�Z 2/3

1/3N3N3dx

b2 =

Z 2/3

1/3N2dx

b3 =

Z 2/3

1/3N3dx

Ke2 �Me

2 =

"K22 K23

K32 K33

#�

"M22 M23

M32 M33

#

be2 =

"b2

b3

#=

"1/6

1/6

#

Page 12: MOVING MESH-MOVING BOUNDARY METHOD FOR TWO-PHASE … · •the shape functions are 1 at the node and zero everywhere else; •the sum of all shape function at the element is 1 everywhere,

MATRIX FORM

3element

9

matrix

vector⌦e

3 = [2/3, 1]

N3 = �3x+ 3

N4 = 3x� 2

Ke3 �Me

3 =

"K33 K34

K43 K44

#�

"M33 M34

M43 M44

#

"b3

b4

#

K33 �M33 =

Z 1

2/3

dN3

dx

dN3

dx

dx�Z 1

2/3N3N3dx

K34 �M34 =

Z 1

2/3

dN3

dx

dN4

dx

dx�Z 1

2/3N3N4dx

K43 �M43 =

Z 1

2/3

dN4

dx

dN3

dx

dx�Z 1

2/3N4N3dx

K44 �M44 =

Z 1

2/3

dN4

dx

dN4

dx

dx�Z 1

2/3N4N4dx

b3 =

Z 1

2/3N3dx

b4 =

Z 1

2/3N4dx

Page 13: MOVING MESH-MOVING BOUNDARY METHOD FOR TWO-PHASE … · •the shape functions are 1 at the node and zero everywhere else; •the sum of all shape function at the element is 1 everywhere,

MATRIX FORM

3211 2 3 4

(0,0) (1.0)x

(0.3) (0.6)

1element⌦e

1 = [0, 1/3]

N1 = �3x+ 1N2 = 3x N3 = 3x� 1N4 = 3x� 2domainand shapefunctions:

Ke1 �Me

1 =

"K11 K12

K21 K22

#�

"M11 M12

M21 M22

#

Ke1 �Me

1 =

"3� 2

18 �3� 118

�3� 118 3� 2

18

#=

"5218 � 55

18

� 5518

5218

#

b

e1 =

"b1 + b.c. at x = 0

b2

#=

"1/6

1/6

#

10

Page 14: MOVING MESH-MOVING BOUNDARY METHOD FOR TWO-PHASE … · •the shape functions are 1 at the node and zero everywhere else; •the sum of all shape function at the element is 1 everywhere,

MATRIX FORM

3211 2 3 4

(0,0) (1.0)x

(0.3) (0.6)

2element

N1 = �3x+ 1N2 = 3x N3 = 3x� 1N4 = 3x� 2domainand shapefunctions:

be2 =

"b2

b3

#=

"1/6

1/6

#

Ke2 �Me

2 =

"K22 K23

K32 K33

#�

"M22 M23

M32 M33

#

Ke2 �Me

2 =

"3� 2

18 �3� 118

�3� 118 3� 2

18

#=

"5218 � 55

18

� 5518

5218

#⌦e

2 = [1/3, 2/3]

11

Page 15: MOVING MESH-MOVING BOUNDARY METHOD FOR TWO-PHASE … · •the shape functions are 1 at the node and zero everywhere else; •the sum of all shape function at the element is 1 everywhere,

MATRIX FORM

3211 2 3 4

(0,0) (1.0)x

(0.3) (0.6)

3element

N1 = �3x+ 1N2 = 3x N3 = 3x� 1N4 = 3x� 2domainand shapefunctions:

⌦e3 = [2/3, 1]

Ke3 �Me

3 =

"3� 2

18 �3� 118

�3� 118 3� 2

18

#=

"5218 � 55

18

� 5518

5218

#Ke

3 �Me3 =

"K33 K34

K43 K44

#�

"M33 M34

M43 M44

#

b

e3 =

"b3

b4 + b.c. at x = 1

#=

"1/6

1/6 + 1

#

12

Page 16: MOVING MESH-MOVING BOUNDARY METHOD FOR TWO-PHASE … · •the shape functions are 1 at the node and zero everywhere else; •the sum of all shape function at the element is 1 everywhere,

ASSEMBLING

12

1 2 3 4

1

2

3

4

=

linear system of equations:

(Kij �Mij)ui = bi(Kij �Mij)ui = bi bi + b.c.

(Kij �Mij)ui = bi + b.c.

Page 17: MOVING MESH-MOVING BOUNDARY METHOD FOR TWO-PHASE … · •the shape functions are 1 at the node and zero everywhere else; •the sum of all shape function at the element is 1 everywhere,

Find in such that:u ⌦ = [0, 1]⇥ [0, 1]

321

1 2 3 4(0,0) (0,1)

x

1D PROBLEM

d

2u

dx

2+ u+ 1 = 0

u(0) = 0 boundarycondition

h1 = h2 = h3 = 1/3domain:Answer: u2=0.251; u3=0.363; u4=0.328

du

dx

(1) = �u

13

Page 18: MOVING MESH-MOVING BOUNDARY METHOD FOR TWO-PHASE … · •the shape functions are 1 at the node and zero everywhere else; •the sum of all shape function at the element is 1 everywhere,

Find in such that:

Answer: u6=0.611; u7=0.889; u10=0.889; u11=1.167

u

boundarycondition

⌦ = [0, 1]⇥ [0, 1]

r2u = 0

6

5

4

32

1

12

11

10

98

7

18

17

16

1514

13

1 2 3 4

5

9

13

8

12

16

6 7

10 11

14 15

u = y2 + 1

u = x

2 + 1

u = y

u = x

Equation:

(0,0) (0,1)

(1,1)(0,1)

x

y

2D PROBLEM

14