22
CIS/ME 794Y A Case Study in Computational Science & Engineering 2-D Conservation of Mass u dx dy dx u x u v dy v y v vecto velocity ); v , u ( V (x,y) ) 1 )( dy )( dx ( t ) 1 )( dx ( dy v y v ) 1 )( dy ( dx u x u ) 1 )( dx ( v ) 1 )( dy ( u stored m out m in m 0 y ) v ( x ) u ( t

CIS/ME 794Y A Case Study in Computational Science & Engineering 2-D Conservation of Mass uu dx dy vv (x,y)

Embed Size (px)

Citation preview

Page 1: CIS/ME 794Y A Case Study in Computational Science & Engineering 2-D Conservation of Mass uu dx dy vv (x,y)

CIS/ME 794Y A Case Study in Computational Science & Engineering

2-D Conservation of Mass

u

dx

dy

dxux

u

v

dyvy

v

vectorvelocity);v,u(V

(x,y)

)1)(dy)(dx(t

)1)(dx(dyvy

v

)1)(dy(dxux

u

)1)(dx(v)1)(dy(ustoredmoutminm

0y

)v(x

)u(t

Page 2: CIS/ME 794Y A Case Study in Computational Science & Engineering 2-D Conservation of Mass uu dx dy vv (x,y)

CIS/ME 794Y A Case Study in Computational Science & Engineering

2-D Conservation of Momentum

bodyFsurfaceF)z)(y)(x(dtVd

cesignificanphysicalitsofbecause

derivativeMaterialortialtanSubsthecalledisDt

DDt

VDyVv

xVu

tV

dtVd

vdtdyandu

dtdx,But

dtdy

yV

dtdx

xV

tV

dtVd),t,y,x(VVSince

Page 3: CIS/ME 794Y A Case Study in Computational Science & Engineering 2-D Conservation of Mass uu dx dy vv (x,y)

CIS/ME 794Y A Case Study in Computational Science & Engineering

2-D Conservation of Momentum (contd.):Surface forces

dx

(x,y)

dy

)1)(dx(2

dyyP

P

)1)(dx(2

dyyP

P

)1)(dy(2

dxxP

P

)1)(dy(

2

dxxP

P

xy(dy)(1)

yx(dx)(1)

)1)(dy(dxxxy

xy

)1)(dx(dy

yyx

yx

Page 4: CIS/ME 794Y A Case Study in Computational Science & Engineering 2-D Conservation of Mass uu dx dy vv (x,y)

CIS/ME 794Y A Case Study in Computational Science & Engineering

2-D Conservation of Momentum (contd.)

)1)(dx(dyx

yxyx)1)(dx(yx)1)(dy(dx

x

PP)1)(dy(P

xsurfaceF

Similarly,

)1)(dy(dxx

xyxy)1)(dy(xy)1)(dx(dy

y

PP)1)(dx(P

ysurfaceF

The body forces are expressed as:

)1)(dy)(dx(fF vbody

where is the body force per unit volume. For example,

vf

Bjforgf vv

Page 5: CIS/ME 794Y A Case Study in Computational Science & Engineering 2-D Conservation of Mass uu dx dy vv (x,y)

CIS/ME 794Y A Case Study in Computational Science & Engineering

2-D conservation of momentum (contd.)

xx

P

y

uv

x

uu

t

u:directionx

yx

yy

P

y

vv

x

vu

t

v

:directiony

xy

Or, in cartesian tensor notation,

ixij

ixP

jxiu

jutiu

Where repeated subscripts imply Einstein’s summation convention, i.e.,

22

11

jj x

)(u

x

)(u

y

)(v

x

)(u

x

)(u

Page 6: CIS/ME 794Y A Case Study in Computational Science & Engineering 2-D Conservation of Mass uu dx dy vv (x,y)

CIS/ME 794Y A Case Study in Computational Science & Engineering

i

j

j

i

k

kijij x

u

x

u

x

u

3

2

Conservation of momentum (contd.):

The shear stress ij is related to the rate of strain (i.e., spatial derivatives of velocity components) via the following constitutive equation (which holds for Newtonian fluids), where is called the coefficient of dynamic viscosity (a measure of internal friction within a fluid):

Deduction of this constitutive equation is beyond the scope of this class. Substituting for ij in the momentum conservation equations yields:

ix

ju

jxiu

kxku

3

2

ixixP

jxiu

jutiu

Page 7: CIS/ME 794Y A Case Study in Computational Science & Engineering 2-D Conservation of Mass uu dx dy vv (x,y)

CIS/ME 794Y A Case Study in Computational Science & Engineering

Navier-Stokes equations for 2-D, compressible flow

The conservation of mass and momentum equations for a Newtonian fluid are known as the Navier-Stokes equations. In 2-D, they are:

0y

)v(x

)u(t

y

u

x

v

yx

u2

y

v

x

u

3

2

xx

P

y

uv

x

uu

t

u:directionx

x

v

y

u

xy

v2

y

v

x

u

3

2

yy

P

y

vv

x

vu

t

v:directiony

Page 8: CIS/ME 794Y A Case Study in Computational Science & Engineering 2-D Conservation of Mass uu dx dy vv (x,y)

CIS/ME 794Y A Case Study in Computational Science & Engineering

Navier-Stokes equations for 2-D, compressible flow in Conservative Form

The Navier-Stokes equations can be re-written using the chain-rule for differentiation and the conservation of mass equation, as:

0y

)v(

x

)u(

t

y

u

x

v

yx

u2

y

v

x

u

3

2

xx

P

y

uv

x

u

t

u:directionx2

x

v

y

u

xy

v2

y

v

x

u

3

2

yy

P

y

v

x

uv

t

v:directiony

2

(1)

(2)

(3)

Page 9: CIS/ME 794Y A Case Study in Computational Science & Engineering 2-D Conservation of Mass uu dx dy vv (x,y)

CIS/ME 794Y A Case Study in Computational Science & Engineering

Conservation of energy and species

The additional governing equations for conservation of energy and species are:

222

222

2222

x

v

y

u

y

v

x

u2

y

v

x

u

3

2

y

Tk

yx

Tk

xvP

2

v

2

uRT

2

3

y

uP2

v

2

uRT

2

3

x2

v

2

uRT

2

3

t

:EnergyofonConservati

ii

ii

iiii n

y

nD

yx

nD

xvn

yun

xt

n

(4)

(5)

Page 10: CIS/ME 794Y A Case Study in Computational Science & Engineering 2-D Conservation of Mass uu dx dy vv (x,y)

CIS/ME 794Y A Case Study in Computational Science & Engineering

Summary for 2-D compressible flow

UNKNOWNS: , u, v, T, P, ni N+5, for N speciesEQUATIONS:• Navier-Stokes equations (3 equations: conservation

of mass and conservation of momentum in x and y directions)

• Conservation of Energy (1 equation)• Conservation of Species ((N-1) equations for n

species)• Ideal gas equation of state (1 equation)

• Definition of density: (1 equation)

N

1iiinm

Page 11: CIS/ME 794Y A Case Study in Computational Science & Engineering 2-D Conservation of Mass uu dx dy vv (x,y)

CIS/ME 794Y A Case Study in Computational Science & Engineering

Recapitulation

So far, Formulation of case study:quasi 1-D compressible flow Numerical solution techniques

Steady vs. Time-marching to steady state Finite differences (FD). Time marching to steady state

(a) Explicit schemes (McCormack, FTBS) Easier to program Restricted to small t for stiff problems May not yield a solution at all for really stiff

systems.

Page 12: CIS/ME 794Y A Case Study in Computational Science & Engineering 2-D Conservation of Mass uu dx dy vv (x,y)

CIS/ME 794Y A Case Study in Computational Science & Engineering

Recapitulation (contd.)

(b)Implicit schemes (LBI): Harder to program Allows use of larger t even for stiff problems May be the only way to find a solution for really

stiff systems

Finite elements (FE), time marching to steady state

(a)Linearization same as for LBI FD method

(b)well-suited for complex geometries.

Page 13: CIS/ME 794Y A Case Study in Computational Science & Engineering 2-D Conservation of Mass uu dx dy vv (x,y)

CIS/ME 794Y A Case Study in Computational Science & Engineering

Recapitulation (contd.)

Both FD and FE techniques ultimately require solution of linear equations Mx = f

In the LBI method, M is a block tri-diagonal matrix

Solution of systems such as Mx = f using PETSc allows you to explore parallel solution vs. serial solution. implications for performance Iterative methods (ex. Conjugate gradient) are well-

suited to parallelization.

Page 14: CIS/ME 794Y A Case Study in Computational Science & Engineering 2-D Conservation of Mass uu dx dy vv (x,y)

CIS/ME 794Y A Case Study in Computational Science & Engineering

Extension of LBI method to 2-D flows

• Non-dimensionalize the 2-D governing equations exactly as we did the quasi 1-D governing equations.

• Take geometry into account. For example,

CenterBody

Outer Body

Page 15: CIS/ME 794Y A Case Study in Computational Science & Engineering 2-D Conservation of Mass uu dx dy vv (x,y)

CIS/ME 794Y A Case Study in Computational Science & Engineering

• Let ri(x) represent the inner boundary, where x is measured along the flow direction.

• Let ro(x) represent the outer boundary, where x is along the flow direction.

ri(x)ro(x)

Page 16: CIS/ME 794Y A Case Study in Computational Science & Engineering 2-D Conservation of Mass uu dx dy vv (x,y)

CIS/ME 794Y A Case Study in Computational Science & Engineering

• The real domain

is then transformed into a rectangular computational domain, using coordinate transformation:

x

y or r

Page 17: CIS/ME 794Y A Case Study in Computational Science & Engineering 2-D Conservation of Mass uu dx dy vv (x,y)

CIS/ME 794Y A Case Study in Computational Science & Engineering

• The coordinate transformation is given by:

• The governing equations are then transformed:

)x(r)x(r

)x(ry,x

io

i

2io

ioi

iio

rr

dx

dr

dx

drry

dx

drrr

xxx

Page 18: CIS/ME 794Y A Case Study in Computational Science & Engineering 2-D Conservation of Mass uu dx dy vv (x,y)

CIS/ME 794Y A Case Study in Computational Science & Engineering

Or,

and

etc.

dx

dr

dx

dr

rrdx

dr

rr

1xxx

io

io

i

io

io rr

1

yyy

2

2

2io

2

2

rr

1

yyy

Page 19: CIS/ME 794Y A Case Study in Computational Science & Engineering 2-D Conservation of Mass uu dx dy vv (x,y)

CIS/ME 794Y A Case Study in Computational Science & Engineering

This will result in a PDE with and as the independent variables; for example,

Recall that for quasi 1-D flow, we had equations of the form

)(D)(Dt

)(Dt x

Page 20: CIS/ME 794Y A Case Study in Computational Science & Engineering 2-D Conservation of Mass uu dx dy vv (x,y)

CIS/ME 794Y A Case Study in Computational Science & Engineering

Applying the LBI method yielded:

or,

2D

t

n1n

x

n1n

n

n1n

xn1n

2D)t(

nx

n1nx D)t(D

2

)t(I

Page 21: CIS/ME 794Y A Case Study in Computational Science & Engineering 2-D Conservation of Mass uu dx dy vv (x,y)

CIS/ME 794Y A Case Study in Computational Science & Engineering

Applying the same procedure to our transformed 2-D problem would yield:

Recall that after linearization of the quasi 1-D problem, the resulting matrix system was:

nn1n DD)t(D2

)t(D

2

)t(I

1Nx

nN

n3

n2

n1

1x)2N(

1N

N

2

1

0

)2N(Nx

NNN

333

222

111

F

F

F

F

ADB000

0

0ADB0

00ADB

000ADB

Page 22: CIS/ME 794Y A Case Study in Computational Science & Engineering 2-D Conservation of Mass uu dx dy vv (x,y)

CIS/ME 794Y A Case Study in Computational Science & Engineering

Now, in 2-D, the linearization procedure will result in:

NN

1N

222

11

GF

H

0

HGF

HG

Where each Fi, Gi, Hi are themselves block tri-diagonal systems as in the quasi 1-D problem. In other words,

etc.

N,gN,g

1N,g

2g2g2g

1g1g

1

DB

A

0

ADB

AD

G