Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko...

190
Simulation of Fluid Flows Zlatko Petrovi´ c University of Belgrade Faculty of Mechanical Engineering Bitola, October 5, 2005

Transcript of Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko...

Page 1: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Simulation of Fluid Flows

Zlatko Petrovic

University of BelgradeFaculty of Mechanical Engineering

Bitola, October 5, 2005

Page 2: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Structure of the Lecture

I Physical Laws described by PDE-s’

I Discretization utilizing Finite difference methodI Two Simple Examples

I 2D compressible potential flow about airfoilI Driven cavity flow utilizing Navier-Stokes ekuation

Page 3: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Structure of the Lecture

I Physical Laws described by PDE-s’

I Discretization utilizing Finite difference methodI Two Simple Examples

I 2D compressible potential flow about airfoilI Driven cavity flow utilizing Navier-Stokes ekuation

Page 4: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Structure of the Lecture

I Physical Laws described by PDE-s’

I Discretization utilizing Finite difference methodI Two Simple Examples

I 2D compressible potential flow about airfoilI Driven cavity flow utilizing Navier-Stokes ekuation

Page 5: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Structure of the Lecture

I Physical Laws described by PDE-s’

I Discretization utilizing Finite difference methodI Two Simple Examples

I 2D compressible potential flow about airfoilI Driven cavity flow utilizing Navier-Stokes ekuation

Page 6: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Structure of the Lecture

I Physical Laws described by PDE-s’

I Discretization utilizing Finite difference methodI Two Simple Examples

I 2D compressible potential flow about airfoilI Driven cavity flow utilizing Navier-Stokes ekuation

Page 7: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Structure of the Lecture

I Physical Laws described by PDE-s’

I Discretization utilizing Finite difference methodI Two Simple Examples

I 2D compressible potential flow about airfoilI Driven cavity flow utilizing Navier-Stokes ekuation

Page 8: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Structure of the Lecture

I Physical Laws described by PDE-s’

I Discretization utilizing Finite difference methodI Two Simple Examples

I 2D compressible potential flow about airfoilI Driven cavity flow utilizing Navier-Stokes ekuation

Page 9: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Part I

Physical Laws

Page 10: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Physical Laws

Main Symbols

Basic Assumptions

Transport TheoremControl Mass and Control Volume

Governing EquationsConservation of MassNewton’s Second Law of MotionThe First Principle of ThermodynamicsDifferential FormStress Velocity RelationshipVolume ForcesEquation of StateConservative Form of PDE

Boundary Conditions

Page 11: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Main Symbols

I Pressure, density and temperature

p, %, T

I Velocity components

~V = u~ı+ v~+ w~k

I Normal and tangential stress

σ, τ

I Cartezian and curvilinear coordinates

(x , y , z), (ξ, η, ζ)

Page 12: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Main Symbols

I Pressure, density and temperature

p, %, T

I Velocity components

~V = u~ı+ v~+ w~k

I Normal and tangential stress

σ, τ

I Cartezian and curvilinear coordinates

(x , y , z), (ξ, η, ζ)

Page 13: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Main Symbols

I Pressure, density and temperature

p, %, T

I Velocity components

~V = u~ı+ v~+ w~k

I Normal and tangential stress

σ, τ

I Cartezian and curvilinear coordinates

(x , y , z), (ξ, η, ζ)

Page 14: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Main Symbols

I Pressure, density and temperature

p, %, T

I Velocity components

~V = u~ı+ v~+ w~k

I Normal and tangential stress

σ, τ

I Cartezian and curvilinear coordinates

(x , y , z), (ξ, η, ζ)

Page 15: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Basic Assumptions

I Fluid is continuous environment, thus the followingassumptions have sense:

lim∆A→0

~n ·∆~F∆A

= −p lim∆A→0

~t ·∆~F∆A

= τ lim∆V→0

∆m

∆V= %

I Thus, tools of Mathematical analysis can be applied!

I Fluid can be in equilibrium under arbitrary loads only when itis in motion.

Page 16: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Basic Assumptions

I Fluid is continuous environment, thus the followingassumptions have sense:

lim∆A→0

~n ·∆~F∆A

= −p lim∆A→0

~t ·∆~F∆A

= τ lim∆V→0

∆m

∆V= %

I Thus, tools of Mathematical analysis can be applied!

I Fluid can be in equilibrium under arbitrary loads only when itis in motion.

Page 17: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Basic Assumptions

I Fluid is continuous environment, thus the followingassumptions have sense:

lim∆A→0

~n ·∆~F∆A

= −p lim∆A→0

~t ·∆~F∆A

= τ lim∆V→0

∆m

∆V= %

I Thus, tools of Mathematical analysis can be applied!

I Fluid can be in equilibrium under arbitrary loads only when itis in motion.

Page 18: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Basic Assumptions

I Fluid is continuous environment, thus the followingassumptions have sense:

lim∆A→0

~n ·∆~F∆A

= −p lim∆A→0

~t ·∆~F∆A

= τ lim∆V→0

∆m

∆V= %

I Thus, tools of Mathematical analysis can be applied!

I Fluid can be in equilibrium under arbitrary loads only when itis in motion.

Page 19: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Basic Assumptions

I Fluid is continuous environment, thus the followingassumptions have sense:

lim∆A→0

~n ·∆~F∆A

= −p lim∆A→0

~t ·∆~F∆A

= τ lim∆V→0

∆m

∆V= %

I Thus, tools of Mathematical analysis can be applied!

I Fluid can be in equilibrium under arbitrary loads only when itis in motion.

Page 20: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Transport Theorem

I Control volume loose and gain various particles – physicallaws are not defined for such case!

I Physical laws are defined for control system having the sameparticles all the time! (ControlVolume.gif)

For any global system property B and property per unit massb = B/m it is valid:

dBdt

=

∫VCV

∂t(%b) dV +

∮SCV

%b(~V − ~v

)· ~n dS

dBdt

=

∫VCV

∂t(%b) + div

[%b(~V − ~v

)]dV

where ~v is the velocity of the system boundary!

Page 21: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Transport Theorem

I Control volume loose and gain various particles – physicallaws are not defined for such case!

I Physical laws are defined for control system having the sameparticles all the time! (ControlVolume.gif)

For any global system property B and property per unit massb = B/m it is valid:

dBdt

=

∫VCV

∂t(%b) dV +

∮SCV

%b(~V − ~v

)· ~n dS

dBdt

=

∫VCV

∂t(%b) + div

[%b(~V − ~v

)]dV

where ~v is the velocity of the system boundary!

Page 22: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Transport Theorem

I Control volume loose and gain various particles – physicallaws are not defined for such case!

I Physical laws are defined for control system having the sameparticles all the time! (ControlVolume.gif)

For any global system property B and property per unit massb = B/m it is valid:

dBdt

=

∫VCV

∂t(%b) dV +

∮SCV

%b(~V − ~v

)· ~n dS

dBdt

=

∫VCV

∂t(%b) + div

[%b(~V − ~v

)]dV

where ~v is the velocity of the system boundary!

Page 23: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Transport Theorem

I Control volume loose and gain various particles – physicallaws are not defined for such case!

I Physical laws are defined for control system having the sameparticles all the time! (ControlVolume.gif)

For any global system property B and property per unit massb = B/m it is valid:

dBdt

=

∫VCV

∂t(%b) dV +

∮SCV

%b(~V − ~v

)· ~n dS

dBdt

=

∫VCV

∂t(%b) + div

[%b(~V − ~v

)]dV

where ~v is the velocity of the system boundary!

Page 24: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Transport Theorem

I Control volume loose and gain various particles – physicallaws are not defined for such case!

I Physical laws are defined for control system having the sameparticles all the time! (ControlVolume.gif)

For any global system property B and property per unit massb = B/m it is valid:

dBdt

=

∫VCV

∂t(%b) dV +

∮SCV

%b(~V − ~v

)· ~n dS

dBdt

=

∫VCV

∂t(%b) + div

[%b(~V − ~v

)]dV

where ~v is the velocity of the system boundary!

Page 25: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Control Mass and Control Volume

At t = 0 control volume occupy the same space as control mass.Physical laws are derived for control mass.

Page 26: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Conservation of mass

dm

dt= 0

System property: B = m. Property per unit mass: b = m/m = 1.

dm

dt=

∫VCV

∂%

∂tdV +

∮SCV

%(~V − ~v

)· ~n dS = 0

or:dm

dt=

∫VCV

∂%

∂t+ div

[%(~V − ~v

)]dV = 0

Page 27: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Conservation of mass

dm

dt= 0

System property: B = m. Property per unit mass: b = m/m = 1.

dm

dt=

∫VCV

∂%

∂tdV +

∮SCV

%(~V − ~v

)· ~n dS = 0

or:dm

dt=

∫VCV

∂%

∂t+ div

[%(~V − ~v

)]dV = 0

Page 28: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Conservation of mass

dm

dt= 0

System property: B = m. Property per unit mass: b = m/m = 1.

dm

dt=

∫VCV

∂%

∂tdV +

∮SCV

%(~V − ~v

)· ~n dS = 0

or:dm

dt=

∫VCV

∂%

∂t+ div

[%(~V − ~v

)]dV = 0

Page 29: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Newton’s Second Law of Motion

d(m~V )

dt=∑

~F =∑

~FS +∑

~FV

System property: B = m~V . Property per unit mass:b = m~V /m = ~V .

d(m~V )

dt=

∫VCV

∂t(%~V ) dV+

∮SCV

%~V(~V − ~v

)·~n dS =

∑~FS+

∑~FV

or: ∫VCV

∂t(%~V ) + div

[%~V(~V − ~v

)]dV =

∑~FS +

∑~FV

where∑ ~FS are surface forces, and

∑ ~FV are volume forces

Page 30: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Newton’s Second Law of Motion

d(m~V )

dt=∑

~F =∑

~FS +∑

~FV

System property: B = m~V . Property per unit mass:b = m~V /m = ~V .

d(m~V )

dt=

∫VCV

∂t(%~V ) dV+

∮SCV

%~V(~V − ~v

)·~n dS =

∑~FS+

∑~FV

or: ∫VCV

∂t(%~V ) + div

[%~V(~V − ~v

)]dV =

∑~FS +

∑~FV

where∑ ~FS are surface forces, and

∑ ~FV are volume forces

Page 31: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Newton’s Second Law of Motion

d(m~V )

dt=∑

~F =∑

~FS +∑

~FV

System property: B = m~V . Property per unit mass:b = m~V /m = ~V .

d(m~V )

dt=

∫VCV

∂t(%~V ) dV+

∮SCV

%~V(~V − ~v

)·~n dS =

∑~FS+

∑~FV

or: ∫VCV

∂t(%~V ) + div

[%~V(~V − ~v

)]dV =

∑~FS +

∑~FV

where∑ ~FS are surface forces, and

∑ ~FV are volume forces

Page 32: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Newton’s Second Law of Motion

d(m~V )

dt=∑

~F =∑

~FS +∑

~FV

System property: B = m~V . Property per unit mass:b = m~V /m = ~V .

d(m~V )

dt=

∫VCV

∂t(%~V ) dV+

∮SCV

%~V(~V − ~v

)·~n dS =

∑~FS+

∑~FV

or: ∫VCV

∂t(%~V ) + div

[%~V(~V − ~v

)]dV =

∑~FS +

∑~FV

where∑ ~FS are surface forces, and

∑ ~FV are volume forces

Page 33: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

The First Principle of Thermodynamics

Rate of change of the energy of the system is equal to the rate oftransfer of energy to the system!

dE

dt=

dQ

dt− dW

dt

System property: B = E . Property per unit mass: b = E/m = e.

dE

dt=

∫VCV

∂(% e)

∂tdV +

∮SCV

% e(~V − ~v

)· ~n dS = Q − W

∫VCV

∂(% e)

∂t+ div

[% e(~V − ~v

)]dV = Q − W

where:

e = eo +V 2

2+

p

%− ~g ·~r + · · · eo = CV T

Page 34: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

The First Principle of Thermodynamics

Rate of change of the energy of the system is equal to the rate oftransfer of energy to the system!

dE

dt=

dQ

dt− dW

dt

System property: B = E . Property per unit mass: b = E/m = e.

dE

dt=

∫VCV

∂(% e)

∂tdV +

∮SCV

% e(~V − ~v

)· ~n dS = Q − W

∫VCV

∂(% e)

∂t+ div

[% e(~V − ~v

)]dV = Q − W

where:

e = eo +V 2

2+

p

%− ~g ·~r + · · · eo = CV T

Page 35: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

The First Principle of Thermodynamics

Rate of change of the energy of the system is equal to the rate oftransfer of energy to the system!

dE

dt=

dQ

dt− dW

dt

System property: B = E . Property per unit mass: b = E/m = e.

dE

dt=

∫VCV

∂(% e)

∂tdV +

∮SCV

% e(~V − ~v

)· ~n dS = Q − W

∫VCV

∂(% e)

∂t+ div

[% e(~V − ~v

)]dV = Q − W

where:

e = eo +V 2

2+

p

%− ~g ·~r + · · · eo = CV T

Page 36: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

The First Principle of Thermodynamics

Rate of change of the energy of the system is equal to the rate oftransfer of energy to the system!

dE

dt=

dQ

dt− dW

dt

System property: B = E . Property per unit mass: b = E/m = e.

dE

dt=

∫VCV

∂(% e)

∂tdV +

∮SCV

% e(~V − ~v

)· ~n dS = Q − W

∫VCV

∂(% e)

∂t+ div

[% e(~V − ~v

)]dV = Q − W

where:

e = eo +V 2

2+

p

%− ~g ·~r + · · · eo = CV T

Page 37: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

The First Principle of Thermodynamics

Rate of change of the energy of the system is equal to the rate oftransfer of energy to the system!

dE

dt=

dQ

dt− dW

dt

System property: B = E . Property per unit mass: b = E/m = e.

dE

dt=

∫VCV

∂(% e)

∂tdV +

∮SCV

% e(~V − ~v

)· ~n dS = Q − W

∫VCV

∂(% e)

∂t+ div

[% e(~V − ~v

)]dV = Q − W

where:

e = eo +V 2

2+

p

%− ~g ·~r + · · · eo = CV T

Page 38: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Differential Form

Conservation of Mass

∂%

∂t+∂%u

∂x+∂%v

∂y+∂%w

∂z= 0

Momentum Equations

%Du

Dt=∂(−p + τxx)

∂x+∂τyx∂y

+∂τzx∂z

+ Sx

%Dv

Dt=∂τxy∂x

+∂(−p + τyy )

∂y+∂τzy∂z

+ Sy

%Dw

Dt=∂τxz∂x

+∂τyz∂y

+∂(−p + τzz)

∂y+ Sz

Page 39: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Differential Form

Conservation of Mass

∂%

∂t+∂%u

∂x+∂%v

∂y+∂%w

∂z= 0

Momentum Equations

%Du

Dt=∂(−p + τxx)

∂x+∂τyx∂y

+∂τzx∂z

+ Sx

%Dv

Dt=∂τxy∂x

+∂(−p + τyy )

∂y+∂τzy∂z

+ Sy

%Dw

Dt=∂τxz∂x

+∂τyz∂y

+∂(−p + τzz)

∂y+ Sz

Page 40: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Differential Form

Conservation of Mass

∂%

∂t+∂%u

∂x+∂%v

∂y+∂%w

∂z= 0

Momentum Equations

%Du

Dt=∂(−p + τxx)

∂x+∂τyx∂y

+∂τzx∂z

+ Sx

%Dv

Dt=∂τxy∂x

+∂(−p + τyy )

∂y+∂τzy∂z

+ Sy

%Dw

Dt=∂τxz∂x

+∂τyz∂y

+∂(−p + τzz)

∂y+ Sz

Page 41: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Differential Form

Conservation of Mass

∂%

∂t+∂%u

∂x+∂%v

∂y+∂%w

∂z= 0

Momentum Equations

%Du

Dt=∂(−p + τxx)

∂x+∂τyx∂y

+∂τzx∂z

+ Sx

%Dv

Dt=∂τxy∂x

+∂(−p + τyy )

∂y+∂τzy∂z

+ Sy

%Dw

Dt=∂τxz∂x

+∂τyz∂y

+∂(−p + τzz)

∂y+ Sz

Page 42: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Differential Form Energy Equations

%De

Dt= −∇(%~V ) +

∂(uτxx)

∂x+∂(uτyx)

∂y+∂(uτzx)

∂z+∂(vτxy )

∂x

+∂(vτyy )

∂y+∂(vτzy )

∂z+∂(wτxz)

∂x+∂(wτyz)

∂y+∂(wτzz)

∂z

+∇ · (κ∇T ) + SE

Mechanical Energy Equation

%D(V 2/2)

Dt= −~V · ∇p + u

(∂τxx∂x

+∂τyx∂y

+∂τzx∂z

)+

+v

(∂τxy∂x

+∂τyy∂y

+∂τzy∂z

)+ w

(∂τxz∂x

+∂τyz∂y

+∂τzz∂z

)+ ~V · ~S

Page 43: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Differential Form Energy Equations

%De

Dt= −∇(%~V ) +

∂(uτxx)

∂x+∂(uτyx)

∂y+∂(uτzx)

∂z+∂(vτxy )

∂x

+∂(vτyy )

∂y+∂(vτzy )

∂z+∂(wτxz)

∂x+∂(wτyz)

∂y+∂(wτzz)

∂z

+∇ · (κ∇T ) + SE

Mechanical Energy Equation

%D(V 2/2)

Dt= −~V · ∇p + u

(∂τxx∂x

+∂τyx∂y

+∂τzx∂z

)+

+v

(∂τxy∂x

+∂τyy∂y

+∂τzy∂z

)+ w

(∂τxz∂x

+∂τyz∂y

+∂τzz∂z

)+ ~V · ~S

Page 44: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Stress Velocity Relationship

This assumption (valid for certain fluids) reduces number ofunknowns: τxx τxy τxz

τyx τyy τyzτzx τzy τzz

= −µ

2∂u∂x

∂u∂y + ∂v

∂x∂u∂z + ∂w

∂x∂v∂x + ∂u

∂y 2∂v∂y

∂v∂z + ∂w

∂y∂w∂x + ∂u

∂z∂w∂y + ∂v

∂z 2∂w∂z

Page 45: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Volume Forces

I Gravitational Force (Sx = 0, Sy = 0, Sz = −%g).

I Force due to electric and magnetic fields.

I Inertial Force.

Page 46: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Volume Forces

I Gravitational Force (Sx = 0, Sy = 0, Sz = −%g).

I Force due to electric and magnetic fields.

I Inertial Force.

Page 47: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Volume Forces

I Gravitational Force (Sx = 0, Sy = 0, Sz = −%g).

I Force due to electric and magnetic fields.

I Inertial Force.

Page 48: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Equation of State

Under assumption of thermodynamic equilibrium we assume:

p = p(%,T ), eo = eo(%,T )

for perfect gas:.

p = %RT , eo = CV T

for isentropic flow:

p = p(%), p = po

(%

%o

for incompressible flow:

% = const. % = 1.225 [kg/m3] for air

Page 49: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Equation of State

Under assumption of thermodynamic equilibrium we assume:

p = p(%,T ), eo = eo(%,T )

for perfect gas:.

p = %RT , eo = CV T

for isentropic flow:

p = p(%), p = po

(%

%o

for incompressible flow:

% = const. % = 1.225 [kg/m3] for air

Page 50: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Equation of State

Under assumption of thermodynamic equilibrium we assume:

p = p(%,T ), eo = eo(%,T )

for perfect gas:.

p = %RT , eo = CV T

for isentropic flow:

p = p(%), p = po

(%

%o

for incompressible flow:

% = const. % = 1.225 [kg/m3] for air

Page 51: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Equation of State

Under assumption of thermodynamic equilibrium we assume:

p = p(%,T ), eo = eo(%,T )

for perfect gas:.

p = %RT , eo = CV T

for isentropic flow:

p = p(%), p = po

(%

%o

for incompressible flow:

% = const. % = 1.225 [kg/m3] for air

Page 52: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Conservative Form of PDE

Conservative form of governing equation is given as:

∂~Q

∂t+∂~E

∂x+∂~F

∂y+∂~G

∂z=∂~Ev

∂x+∂~Fv

∂y+∂~Gv

∂z

where:

~Q =

%%u%v%w%e

~E =

%u

%u2 + p%uv%uw

%ue + pu

~F =

%v%uv

%v2 + p%vw

%ve + pv

Page 53: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Conservative Form of PDE

Conservative form of governing equation is given as:

∂~Q

∂t+∂~E

∂x+∂~F

∂y+∂~G

∂z=∂~Ev

∂x+∂~Fv

∂y+∂~Gv

∂z

where:

~Q =

%%u%v%w%e

~E =

%u

%u2 + p%uv%uw

%ue + pu

~F =

%v%uv

%v2 + p%vw

%ve + pv

Page 54: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Conservative Form of PDE

Conservative form of governing equation is given as:

∂~Q

∂t+∂~E

∂x+∂~F

∂y+∂~G

∂z=∂~Ev

∂x+∂~Fv

∂y+∂~Gv

∂z

where:

~Q =

%%u%v%w%e

~E =

%u

%u2 + p%uv%uw

%ue + pu

~F =

%v%uv

%v2 + p%vw

%ve + pv

Page 55: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Conservative Form of PDE

Conservative form of governing equation is given as:

∂~Q

∂t+∂~E

∂x+∂~F

∂y+∂~G

∂z=∂~Ev

∂x+∂~Fv

∂y+∂~Gv

∂z

where:

~Q =

%%u%v%w%e

~E =

%u

%u2 + p%uv%uw

%ue + pu

~F =

%v%uv

%v2 + p%vw

%ve + pv

Page 56: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Conservative Form of PDE Continued

~G =

%w%uw%vw

%w2 + p%we + pw

~Ev =

0τxxτxyτxz

uτxx + vτxy + wτxz − qx

~Fv =

0τyxτyyτyz

uτyx + vτyy + wτyz − qy

Page 57: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Conservative Form of PDE Continued

~G =

%w%uw%vw

%w2 + p%we + pw

~Ev =

0τxxτxyτxz

uτxx + vτxy + wτxz − qx

~Fv =

0τyxτyyτyz

uτyx + vτyy + wτyz − qy

Page 58: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Conservative Form of PDE Continued

~G =

%w%uw%vw

%w2 + p%we + pw

~Ev =

0τxxτxyτxz

uτxx + vτxy + wτxz − qx

~Fv =

0τyxτyyτyz

uτyx + vτyy + wτyz − qy

Page 59: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Conservative Form of PDE Continued

~Gv =

0τwx

τwy

τwz

uτzx + vτzy + wτzz − qz

where:

~q = qz~ı+ qy~+ qz~k = κ∇T

Page 60: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Conservative Form of PDE Continued

~Gv =

0τwx

τwy

τwz

uτzx + vτzy + wτzz − qz

where:

~q = qz~ı+ qy~+ qz~k = κ∇T

Page 61: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Typical Boundary Conditions

I In contact with solid wall fluid particles have the same velocityas the wall itself – no-slip condition.

I If the plane of symmetry exist, velocity in the plane hasextreme value, while velocity normal to plane is zero –free-slip condition.

I inflow condition All components of the velocity must beknown, sometimes we estimate them by solving simplerproblem.

I outflow condition – there is no change of the velocitiesnormal to the boundary (exit).

I periodicity condition – flow parameters in correspondingpoints must match (have the same values).

Page 62: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Typical Boundary Conditions

I In contact with solid wall fluid particles have the same velocityas the wall itself – no-slip condition.

I If the plane of symmetry exist, velocity in the plane hasextreme value, while velocity normal to plane is zero –free-slip condition.

I inflow condition All components of the velocity must beknown, sometimes we estimate them by solving simplerproblem.

I outflow condition – there is no change of the velocitiesnormal to the boundary (exit).

I periodicity condition – flow parameters in correspondingpoints must match (have the same values).

Page 63: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Typical Boundary Conditions

I In contact with solid wall fluid particles have the same velocityas the wall itself – no-slip condition.

I If the plane of symmetry exist, velocity in the plane hasextreme value, while velocity normal to plane is zero –free-slip condition.

I inflow condition All components of the velocity must beknown, sometimes we estimate them by solving simplerproblem.

I outflow condition – there is no change of the velocitiesnormal to the boundary (exit).

I periodicity condition – flow parameters in correspondingpoints must match (have the same values).

Page 64: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Typical Boundary Conditions

I In contact with solid wall fluid particles have the same velocityas the wall itself – no-slip condition.

I If the plane of symmetry exist, velocity in the plane hasextreme value, while velocity normal to plane is zero –free-slip condition.

I inflow condition All components of the velocity must beknown, sometimes we estimate them by solving simplerproblem.

I outflow condition – there is no change of the velocitiesnormal to the boundary (exit).

I periodicity condition – flow parameters in correspondingpoints must match (have the same values).

Page 65: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Typical Boundary Conditions

I In contact with solid wall fluid particles have the same velocityas the wall itself – no-slip condition.

I If the plane of symmetry exist, velocity in the plane hasextreme value, while velocity normal to plane is zero –free-slip condition.

I inflow condition All components of the velocity must beknown, sometimes we estimate them by solving simplerproblem.

I outflow condition – there is no change of the velocitiesnormal to the boundary (exit).

I periodicity condition – flow parameters in correspondingpoints must match (have the same values).

Page 66: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Part II

Discretization

Page 67: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Discretization

Algorithm of FFS

Physical Models of Fluid Flow

Required Resources

Discretization TechniquesFDM – BasicsShort notationExplicit, Implicit, Consistency, StabilityConvergence

Page 68: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Algorithm of Fluid Flow Simulations

Page 69: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Physical Models of Fluid Flow

Page 70: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Required Computational Resources

Page 71: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Discretization Techniques

The most frequently utilized methods in engineering simulationsare:

I Finite Difference Method – FDM.

I Finite Element Method – FEM.

I Finite Volume Method – FVM.

In this lecture we explain here only the most simplest method, i.e.The Finite Difference Method!

Page 72: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Discretization Techniques

The most frequently utilized methods in engineering simulationsare:

I Finite Difference Method – FDM.

I Finite Element Method – FEM.

I Finite Volume Method – FVM.

In this lecture we explain here only the most simplest method, i.e.The Finite Difference Method!

Page 73: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Discretization Techniques

The most frequently utilized methods in engineering simulationsare:

I Finite Difference Method – FDM.

I Finite Element Method – FEM.

I Finite Volume Method – FVM.

In this lecture we explain here only the most simplest method, i.e.The Finite Difference Method!

Page 74: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Discretization Techniques

The most frequently utilized methods in engineering simulationsare:

I Finite Difference Method – FDM.

I Finite Element Method – FEM.

I Finite Volume Method – FVM.

In this lecture we explain here only the most simplest method, i.e.The Finite Difference Method!

Page 75: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Discretization Techniques

The most frequently utilized methods in engineering simulationsare:

I Finite Difference Method – FDM.

I Finite Element Method – FEM.

I Finite Volume Method – FVM.

In this lecture we explain here only the most simplest method, i.e.The Finite Difference Method!

Page 76: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

FDM – BasicsMathematical definition of the first derivative:

∂u

∂x= lim

∆x→0

u(x + ∆x , y , z , t)− u(x , y , z , t)

∆x

From the infinitely many ways to approximate the first derivativewe show only three: Forward difference approximation:

∂u

∂x≈ u(x + ∆x , y , z , t)− u(x , y , z , t)

∆x+ O(∆x)

Backward difference approximation:

∂u

∂x≈ u(x , y , z , t)− u(x −∆x , y , z , t)

∆x+ O(∆x)

Centered difference approximation:

∂u

∂x≈ u(x + ∆x , y , z , t)− u(x −∆x , y , z , t)

2∆x+ O(∆x)2

forward.gif, backward.gif, centered.gif

Page 77: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

FDM – BasicsFinite difference approximation:

∂u

∂x≈ u(x + ∆x , y , z , t)− u(x , y , z , t)

∆x

From the infinitely many ways to approximate the first derivativewe show only three: Forward difference approximation:

∂u

∂x≈ u(x + ∆x , y , z , t)− u(x , y , z , t)

∆x+ O(∆x)

Backward difference approximation:

∂u

∂x≈ u(x , y , z , t)− u(x −∆x , y , z , t)

∆x+ O(∆x)

Centered difference approximation:

∂u

∂x≈ u(x + ∆x , y , z , t)− u(x −∆x , y , z , t)

2∆x+ O(∆x)2

forward.gif, backward.gif, centered.gif

Page 78: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

FDM – BasicsFinite difference approximation:

∂u

∂x≈ u(x + ∆x , y , z , t)− u(x , y , z , t)

∆x

From the infinitely many ways to approximate the first derivativewe show only three: Forward difference approximation:

∂u

∂x≈ u(x + ∆x , y , z , t)− u(x , y , z , t)

∆x+ O(∆x)

Backward difference approximation:

∂u

∂x≈ u(x , y , z , t)− u(x −∆x , y , z , t)

∆x+ O(∆x)

Centered difference approximation:

∂u

∂x≈ u(x + ∆x , y , z , t)− u(x −∆x , y , z , t)

2∆x+ O(∆x)2

forward.gif, backward.gif, centered.gif

Page 79: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

FDM – BasicsFinite difference approximation:

∂u

∂x≈ u(x + ∆x , y , z , t)− u(x , y , z , t)

∆x

From the infinitely many ways to approximate the first derivativewe show only three: Forward difference approximation:

∂u

∂x≈ u(x + ∆x , y , z , t)− u(x , y , z , t)

∆x+ O(∆x)

Backward difference approximation:

∂u

∂x≈ u(x , y , z , t)− u(x −∆x , y , z , t)

∆x+ O(∆x)

Centered difference approximation:

∂u

∂x≈ u(x + ∆x , y , z , t)− u(x −∆x , y , z , t)

2∆x+ O(∆x)2

forward.gif, backward.gif, centered.gif

Page 80: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

FDM – BasicsFinite difference approximation:

∂u

∂x≈ u(x + ∆x , y , z , t)− u(x , y , z , t)

∆x

From the infinitely many ways to approximate the first derivativewe show only three: Forward difference approximation:

∂u

∂x≈ u(x + ∆x , y , z , t)− u(x , y , z , t)

∆x+ O(∆x)

Backward difference approximation:

∂u

∂x≈ u(x , y , z , t)− u(x −∆x , y , z , t)

∆x+ O(∆x)

Centered difference approximation:

∂u

∂x≈ u(x + ∆x , y , z , t)− u(x −∆x , y , z , t)

2∆x+ O(∆x)2

forward.gif, backward.gif, centered.gif

Page 81: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

FDM – BasicsFinite difference approximation:

∂u

∂x≈ u(x + ∆x , y , z , t)− u(x , y , z , t)

∆x

From the infinitely many ways to approximate the first derivativewe show only three: Forward difference approximation:

∂u

∂x≈ u(x + ∆x , y , z , t)− u(x , y , z , t)

∆x+ O(∆x)

Backward difference approximation:

∂u

∂x≈ u(x , y , z , t)− u(x −∆x , y , z , t)

∆x+ O(∆x)

Centered difference approximation:

∂u

∂x≈ u(x + ∆x , y , z , t)− u(x −∆x , y , z , t)

2∆x+ O(∆x)2

forward.gif, backward.gif, centered.gif

Page 82: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

FDM – BasicsFinite difference approximation:

∂u

∂x≈ u(x + ∆x , y , z , t)− u(x , y , z , t)

∆x

From the infinitely many ways to approximate the first derivativewe show only three: Forward difference approximation:

∂u

∂x≈ u(x + ∆x , y , z , t)− u(x , y , z , t)

∆x+ O(∆x)

Backward difference approximation:

∂u

∂x≈ u(x , y , z , t)− u(x −∆x , y , z , t)

∆x+ O(∆x)

Centered difference approximation:

∂u

∂x≈ u(x + ∆x , y , z , t)− u(x −∆x , y , z , t)

2∆x+ O(∆x)2

forward.gif, backward.gif, centered.gif

Page 83: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Illustration

Page 84: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

FDM – Basics Continued

Since the second derivative is the first derivative of the firstderivative:

∂2u

∂x2≈

∂u∂x (x + ∆x/2, y , z , t)− ∂u

∂x (x −∆x/2, y , z , t)

∆x

and:

∂2u

∂x2≈

u(x+∆x ,y ,z,t)−u(x ,y ,z,t)∆x − u(x ,y ,z,t)−u(x−∆x ,y ,z,t)

∆x

∆x

The second order derivative FD approximation is thus:

∂2u

∂x2≈ u(x + ∆x , y , z , t)− 2u(x , y , z , t) + u(x −∆x , y , z , t)

(∆x)2

Page 85: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

FDM – Basics Continued

Since the second derivative is the first derivative of the firstderivative:

∂2u

∂x2≈

∂u∂x (x + ∆x/2, y , z , t)− ∂u

∂x (x −∆x/2, y , z , t)

∆x

and:

∂2u

∂x2≈

u(x+∆x ,y ,z,t)−u(x ,y ,z,t)∆x − u(x ,y ,z,t)−u(x−∆x ,y ,z,t)

∆x

∆x

The second order derivative FD approximation is thus:

∂2u

∂x2≈ u(x + ∆x , y , z , t)− 2u(x , y , z , t) + u(x −∆x , y , z , t)

(∆x)2

Page 86: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

FDM – Basics Continued

Since the second derivative is the first derivative of the firstderivative:

∂2u

∂x2≈

∂u∂x (x + ∆x/2, y , z , t)− ∂u

∂x (x −∆x/2, y , z , t)

∆x

and:

∂2u

∂x2≈

u(x+∆x ,y ,z,t)−u(x ,y ,z,t)∆x − u(x ,y ,z,t)−u(x−∆x ,y ,z,t)

∆x

∆x

The second order derivative FD approximation is thus:

∂2u

∂x2≈ u(x + ∆x , y , z , t)− 2u(x , y , z , t) + u(x −∆x , y , z , t)

(∆x)2

Page 87: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Short notation

Short notation uni ,j ,k ≡ u(xi , yj , zk , tn)

For example:

∂u

∂t≈

un+1i − un

i

∆t≡ u(xi , tn + ∆t)− u(xi , tn)

∆t

and∂u

∂x≈

uni+1 − un

i−1

2∆x≡ u(xi + ∆x , tn)− u(xi , tN)

∆x

Replacing partial derivatives in PDE we convert the problem ofsolving PDE to problem of solution algebraic equation!

Page 88: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Short notation

Short notation uni ,j ,k ≡ u(xi , yj , zk , tn)

For example:

∂u

∂t≈

un+1i − un

i

∆t≡ u(xi , tn + ∆t)− u(xi , tn)

∆t

and∂u

∂x≈

uni+1 − un

i−1

2∆x≡ u(xi + ∆x , tn)− u(xi , tN)

∆x

Replacing partial derivatives in PDE we convert the problem ofsolving PDE to problem of solution algebraic equation!

Page 89: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Short notation

Short notation uni ,j ,k ≡ u(xi , yj , zk , tn)

For example:

∂u

∂t≈

un+1i − un

i

∆t≡ u(xi , tn + ∆t)− u(xi , tn)

∆t

and∂u

∂x≈

uni+1 − un

i−1

2∆x≡ u(xi + ∆x , tn)− u(xi , tN)

∆x

Replacing partial derivatives in PDE we convert the problem ofsolving PDE to problem of solution algebraic equation!

Page 90: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Short notation

Short notation uni ,j ,k ≡ u(xi , yj , zk , tn)

For example:

∂u

∂t≈

un+1i − un

i

∆t≡ u(xi , tn + ∆t)− u(xi , tn)

∆t

and∂u

∂x≈

uni+1 − un

i−1

2∆x≡ u(xi + ∆x , tn)− u(xi , tN)

∆x

Replacing partial derivatives in PDE we convert the problem ofsolving PDE to problem of solution algebraic equation!

Page 91: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Short notation

Short notation uni ,j ,k ≡ u(xi , yj , zk , tn)

For example:

∂u

∂t≈

un+1i − un

i

∆t≡ u(xi , tn + ∆t)− u(xi , tn)

∆t

and∂u

∂x≈

uni+1 − un

i−1

2∆x≡ u(xi + ∆x , tn)− u(xi , tN)

∆x

Replacing partial derivatives in PDE we convert the problem ofsolving PDE to problem of solution algebraic equation!

Page 92: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Short notation

Short notation uni ,j ,k ≡ u(xi , yj , zk , tn)

For example:

∂u

∂t≈

un+1i − un

i

∆t≡ u(xi , tn + ∆t)− u(xi , tn)

∆t

and∂u

∂x≈

uni+1 − un

i−1

2∆x≡ u(xi + ∆x , tn)− u(xi , tN)

∆x

Replacing partial derivatives in PDE we convert the problem ofsolving PDE to problem of solution algebraic equation!

Page 93: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Illustration of the short notation

Page 94: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

FDM – Basics: explicit, implicit, consistency

Let’s approximate first order one-dimensional wave equation:

∂u

∂t=∂u

∂x

When derivatives are replaced with finite differences we get:

un+1i − un

i

∆t=

uni+1 − un

i−1

2∆xor:

un+1i − un

i

∆t=

un+1i+1 − un+1

i−1

2∆x

Left-hand side approximation is explicit, i.e. has only oneunknown! , while right-hand side approximation is implicit i.e. weneed to solve system of equations.Both approximations are consistent!

Page 95: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

FDM – Basics: explicit, implicit, consistency

Let’s approximate first order one-dimensional wave equation:

∂u

∂t=∂u

∂x

When derivatives are replaced with finite differences we get:

un+1i − un

i

∆t=

uni+1 − un

i−1

2∆xor:

un+1i − un

i

∆t=

un+1i+1 − un+1

i−1

2∆x

Left-hand side approximation is explicit, i.e. has only oneunknown! , while right-hand side approximation is implicit i.e. weneed to solve system of equations.Both approximations are consistent!

Page 96: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

FDM – Basics: explicit, implicit, consistency

Let’s approximate first order one-dimensional wave equation:

∂u

∂t=∂u

∂x

When derivatives are replaced with finite differences we get:

un+1i − un

i

∆t=

uni+1 − un

i−1

2∆xor:

un+1i − un

i

∆t=

un+1i+1 − un+1

i−1

2∆x

Left-hand side approximation is explicit, i.e. has only oneunknown! , while right-hand side approximation is implicit i.e. weneed to solve system of equations.Both approximations are consistent!

Page 97: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

FDM – Basics: explicit, implicit, consistency

Let’s approximate first order one-dimensional wave equation:

∂u

∂t=∂u

∂x

When derivatives are replaced with finite differences we get:

un+1i − un

i

∆t=

uni+1 − un

i−1

2∆xor:

un+1i − un

i

∆t=

un+1i+1 − un+1

i−1

2∆x

Left-hand side approximation is explicit, i.e. has only oneunknown! , while right-hand side approximation is implicit i.e. weneed to solve system of equations.Both approximations are consistent!

Page 98: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

FDM – Basics: explicit, implicit, consistency

Let’s approximate first order one-dimensional wave equation:

∂u

∂t=∂u

∂x

When derivatives are replaced with finite differences we get:

un+1i − un

i

∆t=

uni+1 − un

i−1

2∆xor:

un+1i − un

i

∆t=

un+1i+1 − un+1

i−1

2∆x

Left-hand side approximation is explicit, i.e. has only oneunknown! , while right-hand side approximation is implicit i.e. weneed to solve system of equations.Both approximations are consistent!

Page 99: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

FDM – Basics: explicit, implicit, consistency

Let’s approximate first order one-dimensional wave equation:

∂u

∂t=∂u

∂x

When derivatives are replaced with finite differences we get:

un+1i − un

i

∆t=

uni+1 − un

i−1

2∆xor:

un+1i − un

i

∆t=

un+1i+1 − un+1

i−1

2∆x

Left-hand side approximation is explicit, i.e. has only oneunknown! , while right-hand side approximation is implicit i.e. weneed to solve system of equations.Both approximations are consistent!

Page 100: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

FDM – Basics: stability

One of possible explicit finite difference approximation of the PDE:

∂u

∂t= α

∂2u

∂x2

Lets rearrange both approximations into form:

un+1i = un

i +c

2· (un

i+1 − uni−1), c =

∆t

∆x

un+1i = un

i + d · (uni−1 − 2un

i + uni+1), d =

α∆t

(∆x)2

Lets observe how error grows (dies out) for d = 0.49, andd = 0.52.Animations:dif0 49.avi, dif0 52.avi

Page 101: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

FDM – Basics: stability

One of possible explicit finite difference approximation of the PDE:

is:un+1i − un

i

∆t= α

uni−1 − 2un

i + uni+1

(∆x)2

Lets rearrange both approximations into form:

un+1i = un

i +c

2· (un

i+1 − uni−1), c =

∆t

∆x

un+1i = un

i + d · (uni−1 − 2un

i + uni+1), d =

α∆t

(∆x)2

Lets observe how error grows (dies out) for d = 0.49, andd = 0.52.Animations:dif0 49.avi, dif0 52.avi

Page 102: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

FDM – Basics: stability

One of possible explicit finite difference approximation of the PDE:

is:un+1i − un

i

∆t= α

uni−1 − 2un

i + uni+1

(∆x)2

Lets rearrange both approximations into form:

un+1i = un

i +c

2· (un

i+1 − uni−1), c =

∆t

∆x

un+1i = un

i + d · (uni−1 − 2un

i + uni+1), d =

α∆t

(∆x)2

Lets observe how error grows (dies out) for d = 0.49, andd = 0.52.Animations:dif0 49.avi, dif0 52.avi

Page 103: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

FDM – Basics: stability

One of possible explicit finite difference approximation of the PDE:

is:un+1i − un

i

∆t= α

uni−1 − 2un

i + uni+1

(∆x)2

Lets rearrange both approximations into form:

un+1i = un

i +c

2· (un

i+1 − uni−1), c =

∆t

∆x

un+1i = un

i + d · (uni−1 − 2un

i + uni+1), d =

α∆t

(∆x)2

Lets observe how error grows (dies out) for d = 0.49, andd = 0.52.Animations:dif0 49.avi, dif0 52.avi

Page 104: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

FDM – Basics: convergence

Finite difference scheme converges (according to Lax) if:

I Approximation is consistent!

I Approximation is stable!

Page 105: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

FDM – Basics: convergence

Finite difference scheme converges (according to Lax) if:

I Approximation is consistent!

I Approximation is stable!

Page 106: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

FDM – Basics: convergence

Finite difference scheme converges (according to Lax) if:

I Approximation is consistent!

I Approximation is stable!

Page 107: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Part III

Examples

Page 108: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Examples

Example 1Problem StatementBoundary ConditionsSolution ProcedureGrid GenerationMetrics of transformationApproximation of the PDESolution procedureTypical Result

Example 2Example 2, Problem StatementBoundary ConditionsApproximation of PDEsApproximation of BCsComputational ProcedureResults

Page 109: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Physical Models of Fluid Flow

Page 110: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Example 1 – Problem statement 1/2

Potential compressible two-dimensional flow is described byconservation of mass equation:

∂x

(%∂φ

∂x

)+

∂y

(%∂φ

∂y

)= 0

and relationship between speed and density:

%o

%=

(1 +

γ − 1

2M2

)1/(γ−1)

, M =V

a

where~V = u~ı+ v~, V =

√u2 + v2

and:

u =∂φ

∂x≡ φx , v =

∂φ

∂y≡ φy

Page 111: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Example 1 – Problem statement 1/2

Potential compressible two-dimensional flow is described byconservation of mass equation:

∂x

(%∂φ

∂x

)+

∂y

(%∂φ

∂y

)= 0

and relationship between speed and density:

%o

%=

(1 +

γ − 1

2M2

)1/(γ−1)

, M =V

a

where~V = u~ı+ v~, V =

√u2 + v2

and:

u =∂φ

∂x≡ φx , v =

∂φ

∂y≡ φy

Page 112: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Example 1 – Problem statement 1/2

Potential compressible two-dimensional flow is described byconservation of mass equation:

∂x

(%∂φ

∂x

)+

∂y

(%∂φ

∂y

)= 0

and relationship between speed and density:

%o

%=

(1 +

γ − 1

2M2

)1/(γ−1)

, M =V

a

where~V = u~ı+ v~, V =

√u2 + v2

and:

u =∂φ

∂x≡ φx , v =

∂φ

∂y≡ φy

Page 113: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Example 1 – Problem statement 1/2

Potential compressible two-dimensional flow is described byconservation of mass equation:

∂x

(%∂φ

∂x

)+

∂y

(%∂φ

∂y

)= 0

and relationship between speed and density:

%o

%=

(1 +

γ − 1

2M2

)1/(γ−1)

, M =V

a

where~V = u~ı+ v~, V =

√u2 + v2

and:

u =∂φ

∂x≡ φx , v =

∂φ

∂y≡ φy

Page 114: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Example 1 – Problem statement 2/2

Non-dimensionalizing with critical speed of sound doesn’t changethe first equation:

∂x

(%∂φ

∂x

)+

∂y

(%∂φ

∂y

)= 0

Here we used short notation for derivatives:

φx ≡∂φ

∂x, φy ≡

∂φ

∂y, φxx ≡

∂2φ

∂x2

Nondimensional velocities:

u∞a∗

= M

√γ + 1

2 + (γ − 1)M2cosα

v∞a∗

= M

√γ + 1

2 + (γ − 1)M2sinα

Density equation reduces to:

%

%o=

[1− γ − 1

γ + 1· (u∗2 + v∗2)

]1/(γ−1)

Page 115: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Example 1 – Problem statement 2/2

Non-dimensionalizing with critical speed of sound doesn’t changethe first equation:

(%φx)x + (%φy )y = 0

Here we used short notation for derivatives:

φx ≡∂φ

∂x, φy ≡

∂φ

∂y, φxx ≡

∂2φ

∂x2

Nondimensional velocities:

u∞a∗

= M

√γ + 1

2 + (γ − 1)M2cosα

v∞a∗

= M

√γ + 1

2 + (γ − 1)M2sinα

Density equation reduces to:

%

%o=

[1− γ − 1

γ + 1· (u∗2 + v∗2)

]1/(γ−1)

Page 116: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Example 1 – Problem statement 2/2

Non-dimensionalizing with critical speed of sound doesn’t changethe first equation:

(%φx)x + (%φy )y = 0

Here we used short notation for derivatives:

φx ≡∂φ

∂x, φy ≡

∂φ

∂y, φxx ≡

∂2φ

∂x2

Nondimensional velocities:

u∞a∗

= M

√γ + 1

2 + (γ − 1)M2cosα

v∞a∗

= M

√γ + 1

2 + (γ − 1)M2sinα

Density equation reduces to:

%

%o=

[1− γ − 1

γ + 1· (u∗2 + v∗2)

]1/(γ−1)

Page 117: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Example 1 – Problem statement 2/2

Non-dimensionalizing with critical speed of sound doesn’t changethe first equation:

(%φx)x + (%φy )y = 0

Here we used short notation for derivatives:

φx ≡∂φ

∂x, φy ≡

∂φ

∂y, φxx ≡

∂2φ

∂x2

Nondimensional velocities:

u∞a∗

= M

√γ + 1

2 + (γ − 1)M2cosα

v∞a∗

= M

√γ + 1

2 + (γ − 1)M2sinα

Density equation reduces to:

%

%o=

[1− γ − 1

γ + 1· (u∗2 + v∗2)

]1/(γ−1)

Page 118: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Example 1 – Problem statement 2/2

Non-dimensionalizing with critical speed of sound doesn’t changethe first equation:

(%φx)x + (%φy )y = 0

Here we used short notation for derivatives:

φx ≡∂φ

∂x, φy ≡

∂φ

∂y, φxx ≡

∂2φ

∂x2

Nondimensional velocities:

u∞a∗

= M

√γ + 1

2 + (γ − 1)M2cosα

v∞a∗

= M

√γ + 1

2 + (γ − 1)M2sinα

Density equation reduces to:

%

%o=

[1− γ − 1

γ + 1· (u∗2 + v∗2)

]1/(γ−1)

Page 119: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Boundary Conditions

Page 120: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Question of uniqueness

Any combination of these two flows satisfy all boundary conditions!Uniqueness is achieved by imposing Kutta-Joukowsky condition!

Page 121: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Question of uniqueness

Any combination of these two flows satisfy all boundary conditions!Uniqueness is achieved by imposing Kutta-Joukowsky condition!

Page 122: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Solution Procedure 1/2

Solution has the jump of the potential what is not desirableproperty, we can split the solution in two parts: one which willcorrectly describe jump and other which is continuous andsupplements the first part to the complete solution!

φ = ϕ+Γ

2πarctan

y

x= ϕ+ Γ · Φ

Page 123: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Solution Procedure 1/2

Solution has the jump of the potential what is not desirableproperty, we can split the solution in two parts: one which willcorrectly describe jump and other which is continuous andsupplements the first part to the complete solution!

φ = ϕ+Γ

2πarctan

y

x= ϕ+ Γ · Φ

Page 124: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Solution Procedure 2/2

Our governing equation now looks:

(%ϕx)x + (%ϕy )y = −(%Φx)x + (%Φy )y︸ ︷︷ ︸Γ·%·f (x ,y)

where f (x , y) is known over the physical region!Boundary conditions:

∂φ

∂n=∂ϕ+ Γ · Φ

∂n= 0, ⇒ ∂ϕ

∂n= −Γ · ∂Φ

∂n

ϕ = u∞ · x + v∞ · y , Φ =1

2πarctan

y

x

ϕ is continuous over cut!

Page 125: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Solution Procedure 2/2

Our governing equation now looks:

(%ϕx)x + (%ϕy )y = −(%Φx)x + (%Φy )y︸ ︷︷ ︸Γ·%·f (x ,y)

where f (x , y) is known over the physical region!Boundary conditions:

∂φ

∂n=∂ϕ+ Γ · Φ

∂n= 0, ⇒ ∂ϕ

∂n= −Γ · ∂Φ

∂n

ϕ = u∞ · x + v∞ · y , Φ =1

2πarctan

y

x

ϕ is continuous over cut!

Page 126: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Solution Procedure 2/2

Our governing equation now looks:

(%ϕx)x + (%ϕy )y = −(%Φx)x + (%Φy )y︸ ︷︷ ︸Γ·%·f (x ,y)

where f (x , y) is known over the physical region!Boundary conditions:

∂φ

∂n=∂ϕ+ Γ · Φ

∂n= 0, ⇒ ∂ϕ

∂n= −Γ · ∂Φ

∂n

ϕ = u∞ · x + v∞ · y , Φ =1

2πarctan

y

x

ϕ is continuous over cut!

Page 127: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Solution Procedure 2/2

Our governing equation now looks:

(%ϕx)x + (%ϕy )y = −(%Φx)x + (%Φy )y︸ ︷︷ ︸Γ·%·f (x ,y)

where f (x , y) is known over the physical region!Boundary conditions:

∂φ

∂n=∂ϕ+ Γ · Φ

∂n= 0, ⇒ ∂ϕ

∂n= −Γ · ∂Φ

∂n

ϕ = u∞ · x + v∞ · y , Φ =1

2πarctan

y

x

ϕ is continuous over cut!

Page 128: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Solution Procedure 2/2

Our governing equation now looks:

(%ϕx)x + (%ϕy )y = −(%Φx)x + (%Φy )y︸ ︷︷ ︸Γ·%·f (x ,y)

where f (x , y) is known over the physical region!Boundary conditions:

∂φ

∂n=∂ϕ+ Γ · Φ

∂n= 0, ⇒ ∂ϕ

∂n= −Γ · ∂Φ

∂n

ϕ = u∞ · x + v∞ · y , Φ =1

2πarctan

y

x

ϕ is continuous over cut!

Page 129: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Grid Generation

Page 130: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Closer look at physical space

Page 131: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Grid generation by solving PDEs

We describe the grid as relationship of the form

ξ = ξ(x , y), η = η(x , y)

Grids are generated by solving:

∇2ξ = 0 ⇒ axξξ + 2bxξη + cxηη = 0

∇2η = 0 ⇒ ayξξ + 2byξη + cyηη = 0

a = J2(x2η + y2

η )

b = −J2(xξxη + yξyη)

c = J2(x2ξ + y2

ξ )

J =1

xξyη − xηyξ

We need the guess for the coefficients a, b, and c (algebraic grid)

Page 132: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Grid generation by solving PDEs

We describe the grid as relationship of the form

ξ = ξ(x , y), η = η(x , y)

Grids are generated by solving:

∇2ξ = 0 ⇒ axξξ + 2bxξη + cxηη = 0

∇2η = 0 ⇒ ayξξ + 2byξη + cyηη = 0

a = J2(x2η + y2

η )

b = −J2(xξxη + yξyη)

c = J2(x2ξ + y2

ξ )

J =1

xξyη − xηyξ

We need the guess for the coefficients a, b, and c (algebraic grid)

Page 133: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Grid generation by solving PDEs

We describe the grid as relationship of the form

ξ = ξ(x , y), η = η(x , y)

Grids are generated by solving:

∇2ξ = 0 ⇒ axξξ + 2bxξη + cxηη = 0

∇2η = 0 ⇒ ayξξ + 2byξη + cyηη = 0

a = J2(x2η + y2

η )

b = −J2(xξxη + yξyη)

c = J2(x2ξ + y2

ξ )

J =1

xξyη − xηyξ

We need the guess for the coefficients a, b, and c (algebraic grid)

Page 134: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Metrics of transformation

In the computational space our PDE looks:(%U

J

+

(%V

J

= 0

together with

% =

[1− γ − 1

γ + 1(Uφξ + Vφη)

]1/(γ−1)

On the airfoil:

∂φ

∂n

∣∣∣∣η=const

=bφξ + cφη√

c= 0

So we need J, a, b, and c to approximate our PDE in thecomputational space!

Page 135: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Metrics of transformation

In the computational space our PDE looks:(%U

J

+

(%V

J

= 0

together with

% =

[1− γ − 1

γ + 1(Uφξ + Vφη)

]1/(γ−1)

On the airfoil:

∂φ

∂n

∣∣∣∣η=const

=bφξ + cφη√

c= 0

So we need J, a, b, and c to approximate our PDE in thecomputational space!

Page 136: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Metrics of transformation

In the computational space our PDE looks:(%U

J

+

(%V

J

= 0

together with

% =

[1− γ − 1

γ + 1(Uφξ + Vφη)

]1/(γ−1)

On the airfoil:

∂φ

∂n

∣∣∣∣η=const

=bφξ + cφη√

c= 0

So we need J, a, b, and c to approximate our PDE in thecomputational space!

Page 137: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Metrics of transformation

In the computational space our PDE looks:(%U

J

+

(%V

J

= 0

together with

% =

[1− γ − 1

γ + 1(Uφξ + Vφη)

]1/(γ−1)

On the airfoil:

∂φ

∂n

∣∣∣∣η=const

=bφξ + cφη√

c= 0

So we need J, a, b, and c to approximate our PDE in thecomputational space!

Page 138: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

How these metrics look 1/4

Page 139: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

How these metrics look 2/4

Page 140: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

How these metrics look 3/4

Page 141: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

How these metrics look 4/4

Page 142: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Approximation of the PDE 1/3

Our PDE at the point (i , j) in the computational space looks:(%U

J

)ξi,j

+

(%V

J

)ηi,j

= 0

where:U = aφξ + bφη, V = bφξ + cφη

Since φ = ϕ+ Γ · Φ:(%U

J

)ξi,j

+

(%V

J

)ηi,j

= −

(%U

J

)ξi,j

(%V

J

)ηi,j

= Γ·%i ,j ·f (ξ, η)i ,j

where now:

U = aϕξ + bϕη, V = bϕξ + cϕη

Page 143: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Approximation of the PDE 1/3

Our PDE at the point (i , j) in the computational space looks:(%U

J

)ξi,j

+

(%V

J

)ηi,j

= 0

where:U = aφξ + bφη, V = bφξ + cφη

Since φ = ϕ+ Γ · Φ:(%U

J

)ξi,j

+

(%V

J

)ηi,j

= −

(%U

J

)ξi,j

(%V

J

)ηi,j

= Γ·%i ,j ·f (ξ, η)i ,j

where now:

U = aϕξ + bϕη, V = bϕξ + cϕη

Page 144: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Approximation of the PDE 1/3

Our PDE at the point (i , j) in the computational space looks:(%U

J

)ξi,j

+

(%V

J

)ηi,j

= 0

where:U = aφξ + bφη, V = bφξ + cφη

Since φ = ϕ+ Γ · Φ:(%U

J

)ξi,j

+

(%V

J

)ηi,j

= −

(%U

J

)ξi,j

(%V

J

)ηi,j

= Γ·%i ,j ·f (ξ, η)i ,j

where now:

U = aϕξ + bϕη, V = bϕξ + cϕη

Page 145: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Approximation of the PDE 1/3

Our PDE at the point (i , j) in the computational space looks:(%U

J

)ξi,j

+

(%V

J

)ηi,j

= 0

where:U = aφξ + bφη, V = bφξ + cφη

Since φ = ϕ+ Γ · Φ:(%U

J

)ξi,j

+

(%V

J

)ηi,j

= −

(%U

J

)ξi,j

(%V

J

)ηi,j

= Γ·%i ,j ·f (ξ, η)i ,j

where now:

U = aϕξ + bϕη, V = bϕξ + cϕη

Page 146: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Approximation of the PDE 2/3

Approximating the former equation with the finite differences wehave:(%U

J

)i+1/2,j

−(%U

J

)i−1/2,j

+

(%V

J

)i ,j+1/2

−(%V

J

)i ,j−1/2

= Γ·%i ,j ·fi ,j

where:

Ui+1/2,j ≈ ai+1/2,j(ϕi+1,j − ϕi ,j) +

+bi+1/2,jϕi+1,j+1 + ϕi ,j+1 − ϕi+1,j−1 − ϕi ,j−1

4Ui−1/2,j ≈ ai−1/2,j(ϕi ,j − ϕi−1,j) +

+bi−1/2,jϕi−1,j+1 + ϕi ,j+1 − ϕi−1,j−1 − ϕi ,j−1

4

Page 147: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Approximation of the PDE 2/3

Approximating the former equation with the finite differences wehave:(%U

J

)i+1/2,j

−(%U

J

)i−1/2,j

+

(%V

J

)i ,j+1/2

−(%V

J

)i ,j−1/2

= Γ·%i ,j ·fi ,j

where:

Ui+1/2,j ≈ ai+1/2,j(ϕi+1,j − ϕi ,j) +

+bi+1/2,jϕi+1,j+1 + ϕi ,j+1 − ϕi+1,j−1 − ϕi ,j−1

4Ui−1/2,j ≈ ai−1/2,j(ϕi ,j − ϕi−1,j) +

+bi−1/2,jϕi−1,j+1 + ϕi ,j+1 − ϕi−1,j−1 − ϕi ,j−1

4

Page 148: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Approximation of the PDE 3/3

and also:

Vi ,j+1/2 ≈ bi ,j+1/2ϕi+1,j+1 + ϕi+1,j − ϕi−1,j+1 − ϕi−1,j

4+

+ci ,j+1/2 · (ϕi ,j+1 − ϕi ,j)

Vi ,j−1/2 ≈ bi ,j−1/2ϕi+1,j−1 + ϕi+1,j − ϕi−1,j−1 − ϕi−1,j

4+

+ci ,j−1/2 · (ϕi ,j − ϕi ,j−1)

After substituting all of this approximations we get the following:

Aϕk+1i ,j = L(ϕk) ⇒ ϕk+1

i ,j =1

AL(ϕk)

where:

A =(%

Ja)

i+1/2,j+(%

Ja)

i−1/2,j+(%

Jc)

i ,j+1/2+(%

Jc)

i ,j+1/2

Page 149: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Approximation of the PDE 3/3

and also:

Vi ,j+1/2 ≈ bi ,j+1/2ϕi+1,j+1 + ϕi+1,j − ϕi−1,j+1 − ϕi−1,j

4+

+ci ,j+1/2 · (ϕi ,j+1 − ϕi ,j)

Vi ,j−1/2 ≈ bi ,j−1/2ϕi+1,j−1 + ϕi+1,j − ϕi−1,j−1 − ϕi−1,j

4+

+ci ,j−1/2 · (ϕi ,j − ϕi ,j−1)

After substituting all of this approximations we get the following:

Aϕk+1i ,j = L(ϕk) ⇒ ϕk+1

i ,j =1

AL(ϕk)

where:

A =(%

Ja)

i+1/2,j+(%

Ja)

i−1/2,j+(%

Jc)

i ,j+1/2+(%

Jc)

i ,j+1/2

Page 150: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Approximation of the PDE 3/3

and also:

Vi ,j+1/2 ≈ bi ,j+1/2ϕi+1,j+1 + ϕi+1,j − ϕi−1,j+1 − ϕi−1,j

4+

+ci ,j+1/2 · (ϕi ,j+1 − ϕi ,j)

Vi ,j−1/2 ≈ bi ,j−1/2ϕi+1,j−1 + ϕi+1,j − ϕi−1,j−1 − ϕi−1,j

4+

+ci ,j−1/2 · (ϕi ,j − ϕi ,j−1)

After substituting all of this approximations we get the following:

Aϕk+1i ,j = L(ϕk) ⇒ ϕk+1

i ,j =1

AL(ϕk)

where:

A =(%

Ja)

i+1/2,j+(%

Ja)

i−1/2,j+(%

Jc)

i ,j+1/2+(%

Jc)

i ,j+1/2

Page 151: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Solution procedure 1/3

Subtract from both side of the equation:

ϕk+1i ,j =

1

AL(ϕk)

ϕki ,j , we will get the correction from iteration k to the iteration

k + 1

∆ϕki ,j = ϕk+1

i ,j − ϕki ,j = −ϕk

i ,j +LA

(ϕk)

let us now magnify the correction ω times:

ϕk+1i ,j = ϕk

i ,j + ω∆ϕki ,j = (1− ω)ϕk

i ,j +ω

AL(ϕk)

we got so called SOR procedure

Page 152: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Solution procedure 1/3

Subtract from both side of the equation:

ϕk+1i ,j =

1

AL(ϕk)

ϕki ,j , we will get the correction from iteration k to the iteration

k + 1

∆ϕki ,j = ϕk+1

i ,j − ϕki ,j = −ϕk

i ,j +LA

(ϕk)

let us now magnify the correction ω times:

ϕk+1i ,j = ϕk

i ,j + ω∆ϕki ,j = (1− ω)ϕk

i ,j +ω

AL(ϕk)

we got so called SOR procedure

Page 153: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Solution procedure 1/3

Subtract from both side of the equation:

ϕk+1i ,j =

1

AL(ϕk)

ϕki ,j , we will get the correction from iteration k to the iteration

k + 1

∆ϕki ,j = ϕk+1

i ,j − ϕki ,j = −ϕk

i ,j +LA

(ϕk)

let us now magnify the correction ω times:

ϕk+1i ,j = ϕk

i ,j + ω∆ϕki ,j = (1− ω)ϕk

i ,j +ω

AL(ϕk)

we got so called SOR procedure

Page 154: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Solution procedure 1/3

Subtract from both side of the equation:

ϕk+1i ,j =

1

AL(ϕk)

ϕki ,j , we will get the correction from iteration k to the iteration

k + 1

∆ϕki ,j = ϕk+1

i ,j − ϕki ,j = −ϕk

i ,j +LA

(ϕk)

let us now magnify the correction ω times:

ϕk+1i ,j = ϕk

i ,j + ω∆ϕki ,j = (1− ω)ϕk

i ,j +ω

AL(ϕk)

we got so called SOR procedure

Page 155: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Solution procedure 2/3

At the coordinate line j = 1 we do not have values correspondingto the j − 1, so

I On the cut use the fact that the points on the other side ofthe computational space are below (above) the current point

I On the airfoil we need to use one sided approximation:

∂(ϕ+ Γ · Φ)

∂n= 0, ⇒ ∂ϕ

∂n= −Γ · ∂Φ

∂n= Γ · γ(x , y)

where

Φ =1

2πarctan

y

x

Circulation is determined from

Γk+1 = Γk + δ(V∗ − V ∗)

Page 156: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Solution procedure 2/3

At the coordinate line j = 1 we do not have values correspondingto the j − 1, so

I On the cut use the fact that the points on the other side ofthe computational space are below (above) the current point

I On the airfoil we need to use one sided approximation:

∂(ϕ+ Γ · Φ)

∂n= 0, ⇒ ∂ϕ

∂n= −Γ · ∂Φ

∂n= Γ · γ(x , y)

where

Φ =1

2πarctan

y

x

Circulation is determined from

Γk+1 = Γk + δ(V∗ − V ∗)

Page 157: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Solution procedure 2/3

At the coordinate line j = 1 we do not have values correspondingto the j − 1, so

I On the cut use the fact that the points on the other side ofthe computational space are below (above) the current point

I On the airfoil we need to use one sided approximation:

∂(ϕ+ Γ · Φ)

∂n= 0, ⇒ ∂ϕ

∂n= −Γ · ∂Φ

∂n= Γ · γ(x , y)

where

Φ =1

2πarctan

y

x

Circulation is determined from

Γk+1 = Γk + δ(V∗ − V ∗)

Page 158: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Solution procedure 2/3

At the coordinate line j = 1 we do not have values correspondingto the j − 1, so

I On the cut use the fact that the points on the other side ofthe computational space are below (above) the current point

I On the airfoil we need to use one sided approximation:

∂(ϕ+ Γ · Φ)

∂n= 0, ⇒ ∂ϕ

∂n= −Γ · ∂Φ

∂n= Γ · γ(x , y)

where

Φ =1

2πarctan

y

x

Circulation is determined from

Γk+1 = Γk + δ(V∗ − V ∗)

Page 159: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Solution procedure 2/3

At the coordinate line j = 1 we do not have values correspondingto the j − 1, so

I On the cut use the fact that the points on the other side ofthe computational space are below (above) the current point

I On the airfoil we need to use one sided approximation:

∂(ϕ+ Γ · Φ)

∂n= 0, ⇒ ∂ϕ

∂n= −Γ · ∂Φ

∂n= Γ · γ(x , y)

where

Φ =1

2πarctan

y

x

Circulation is determined from

Γk+1 = Γk + δ(V∗ − V ∗)

Page 160: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Solution procedure 3/3

In the computational space normal derivative looks:

∂ϕ

∂n=

1√c

(bϕξ + cϕη) = Γ · γ(x , y)

On the airfoil

bi ,1ϕi+1,1 − ϕi−1,1

2+ci ,1

−3ϕi ,1 + 4ϕi ,2 − ϕi ,3

4= Γ·√ci ,j ·γ(xi ,1, yi ,1)

From the equation above we can express ϕi ,1 in order to obtainnew guess for the value of the velocity potential at the airfoilsurface!

Page 161: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Solution procedure 3/3

In the computational space normal derivative looks:

∂ϕ

∂n=

1√c

(bϕξ + cϕη) = Γ · γ(x , y)

On the airfoil

bi ,1ϕi+1,1 − ϕi−1,1

2+ci ,1

−3ϕi ,1 + 4ϕi ,2 − ϕi ,3

4= Γ·√ci ,j ·γ(xi ,1, yi ,1)

From the equation above we can express ϕi ,1 in order to obtainnew guess for the value of the velocity potential at the airfoilsurface!

Page 162: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Solution procedure 3/3

In the computational space normal derivative looks:

∂ϕ

∂n=

1√c

(bϕξ + cϕη) = Γ · γ(x , y)

On the airfoil

bi ,1ϕi+1,1 − ϕi−1,1

2+ci ,1

−3ϕi ,1 + 4ϕi ,2 − ϕi ,3

4= Γ·√ci ,j ·γ(xi ,1, yi ,1)

From the equation above we can express ϕi ,1 in order to obtainnew guess for the value of the velocity potential at the airfoilsurface!

Page 163: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Typical Result

Page 164: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Example 2, Problem Statement

Nondimensional form of 2D N-S Equations look:

∂Ω

∂t+ u

∂Ω

∂x+ v

∂Ω

∂y=

1

Re∞

(∂2Ω

∂x2+∂2Ω

∂y2

)∂2ψ

∂x2+∂2ψ

∂y2= −Ω, u =

∂ψ

∂y, v = −∂ψ

∂x

u, v are x- and y -component of the velocity; Ω = ∇× ~V isvorticity, ψ - stream function,t - time, and

Re∞ =uoL

ν, Ω =

ΩL

uo, ψ =

ψ

uoL

t = t · uo

L, x =

x

L, y =

y

L

Page 165: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Boundary Conditions

Along boundary ABCDψ =const., and derivatives ofthe ψ along boundary are zero.

Along AB:

ψ = 0

Ωi ,1 = −∂2ψ

∂x2− ∂2ψ

∂y2= −∂

∂y2

u =∂ψ

∂y= 0, v = −∂ψ

∂x= 0

Along BC

ψ = 0

Ω(I , j) = −∂2ψ

∂x2

u =∂ψ

∂y= 0, v = −∂ψ

∂x= 0

Page 166: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Boundary Conditions

Along boundary ABCDψ =const., and derivatives ofthe ψ along boundary are zero.

Along AB:

ψ = 0

Ωi ,1 = −∂2ψ

∂x2− ∂2ψ

∂y2= −∂

∂y2

u =∂ψ

∂y= 0, v = −∂ψ

∂x= 0

Along BC

ψ = 0

Ω(I , j) = −∂2ψ

∂x2

u =∂ψ

∂y= 0, v = −∂ψ

∂x= 0

Page 167: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Boundary Conditions

Along boundary ABCDψ =const., and derivatives ofthe ψ along boundary are zero.

Along AB:

ψ = 0

Ωi ,1 = −∂2ψ

∂x2− ∂2ψ

∂y2= −∂

∂y2

u =∂ψ

∂y= 0, v = −∂ψ

∂x= 0

Along BC

ψ = 0

Ω(I , j) = −∂2ψ

∂x2

u =∂ψ

∂y= 0, v = −∂ψ

∂x= 0

Page 168: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Boundary Conditions Continued

Along CDψ = 0

Ωi ,J = −∂2ψ

∂y2

u =∂ψ

∂y= uo , v = −∂ψ

∂x= 0

Along DAψ = 0

Ω(1, j) = −∂2ψ

∂x2

u =∂ψ

∂y= 0, v = −∂ψ

∂x= 0

Page 169: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Boundary Conditions Continued

Along CDψ = 0

Ωi ,J = −∂2ψ

∂y2

u =∂ψ

∂y= uo , v = −∂ψ

∂x= 0

Along DAψ = 0

Ω(1, j) = −∂2ψ

∂x2

u =∂ψ

∂y= 0, v = −∂ψ

∂x= 0

Page 170: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Approximation of PDEs

Ωn+1i ,j − Ωn

i ,j

∆t+ un

i ,j

Ωni+1,j − Ωn

i−1,j

2∆x+ vn

i ,j

Ωni ,j+1 − Ωn

i ,j−1

2∆y=

=1

Re∞

[Ωn

i+1,j − 2Ωni ,j + Ωn

i−1,j

(∆x)2+

Ωni ,j+1 − 2Ωn

i ,j + Ωni ,j−1

(∆y)2

]

ψk+1i ,j =

(∆x)2Ωki ,j + ψk

i+1,j + ψki−1,j + β2

(ψk

i ,j+1 + ψki ,j−1

)2(1 + β2)

ψk+1i ,j = ωψk

i ,j + (1− ω)ψk+1i ,j

β =∆x

∆y, ui ,j =

ψi ,j+1 − ψi ,j−1

2∆y, vi ,j = −

ψi+1,j − ψi−1,j

2∆x

Page 171: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Approximation of PDEs

Ωn+1i ,j − Ωn

i ,j

∆t+ un

i ,j

Ωni+1,j − Ωn

i−1,j

2∆x+ vn

i ,j

Ωni ,j+1 − Ωn

i ,j−1

2∆y=

=1

Re∞

[Ωn

i+1,j − 2Ωni ,j + Ωn

i−1,j

(∆x)2+

Ωni ,j+1 − 2Ωn

i ,j + Ωni ,j−1

(∆y)2

]

ψk+1i ,j =

(∆x)2Ωki ,j + ψk

i+1,j + ψki−1,j + β2

(ψk

i ,j+1 + ψki ,j−1

)2(1 + β2)

ψk+1i ,j = ωψk

i ,j + (1− ω)ψk+1i ,j

β =∆x

∆y, ui ,j =

ψi ,j+1 − ψi ,j−1

2∆y, vi ,j = −

ψi+1,j − ψi−1,j

2∆x

Page 172: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Approximation of BCs

Along ABψi ,1 = 0

Taylor expansion gives

ψi ,2 = ψi ,1 +∂ψ

∂y

∣∣∣∣i ,1

∆y︸ ︷︷ ︸v=0

+∂2ψ

∂y2

∣∣∣∣i ,1

(∆y)2

2︸ ︷︷ ︸−Ωi,1

+ . . .

Ωi ,1 = 2 ·ψi ,1 − ψi ,2

(∆y)2= −2 ·

ψi ,2

(∆y)2

Similarly along BC and AD!

Page 173: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Approximation of BCs

Along ABψi ,1 = 0

Taylor expansion gives

ψi ,2 = ψi ,1 +∂ψ

∂y

∣∣∣∣i ,1

∆y︸ ︷︷ ︸v=0

+∂2ψ

∂y2

∣∣∣∣i ,1

(∆y)2

2︸ ︷︷ ︸−Ωi,1

+ . . .

Ωi ,1 = 2 ·ψi ,1 − ψi ,2

(∆y)2= −2 ·

ψi ,2

(∆y)2

Similarly along BC and AD!

Page 174: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Approximation of BCs Continued

Along BCψ(I , j) = 0

ΩI ,j = −2 ·ψI−1,j

(∆x)2

Along ADψ(1, j) = 0

Ω1,j = −2 ·ψ2,j

(∆x)2

Page 175: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Approximation of BCs Continued

Along BCψ(I , j) = 0

ΩI ,j = −2 ·ψI−1,j

(∆x)2

Along ADψ(1, j) = 0

Ω1,j = −2 ·ψ2,j

(∆x)2

Page 176: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Approximation of BCs Continued

Along CD we have to take into account that

u =∂ψ

∂y= uo

Taylor expansion:

ψJ−1,i = ψJ,i +∂ψ

∂y

∣∣∣∣J,i︸ ︷︷ ︸

uo

(−∆y) +∂2ψ

∂y2

∣∣∣∣J,i︸ ︷︷ ︸

−ΩJ,i

(∆y)2

2

from where:

ΩJ,i = −2ψJ−1,i

(∆y)2− 2 · uo

∆y

Page 177: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Approximation of BCs Continued

Along CD we have to take into account that

u =∂ψ

∂y= uo

Taylor expansion:

ψJ−1,i = ψJ,i +∂ψ

∂y

∣∣∣∣J,i︸ ︷︷ ︸

uo

(−∆y) +∂2ψ

∂y2

∣∣∣∣J,i︸ ︷︷ ︸

−ΩJ,i

(∆y)2

2

from where:

ΩJ,i = −2ψJ−1,i

(∆y)2− 2 · uo

∆y

Page 178: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Computational Procedure

1. Initialize all variables corresponding to t = 0

2. Calculate velocities inside the cavity

ui ,j =ψi ,j+1 − ψi ,j−1

2∆y

vi ,j =ψi−1,j − ψi+1,j

2∆x

3. Calculate vorticity over cavity:

Ωi ,j =vi+1,j − vi−1,j

2∆x−

ui ,j+1 − ui ,j−1

2∆y

Page 179: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Computational Procedure

1. Initialize all variables corresponding to t = 0

2. Calculate velocities inside the cavity

ui ,j =ψi ,j+1 − ψi ,j−1

2∆y

vi ,j =ψi−1,j − ψi+1,j

2∆x

3. Calculate vorticity over cavity:

Ωi ,j =vi+1,j − vi−1,j

2∆x−

ui ,j+1 − ui ,j−1

2∆y

Page 180: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Computational Procedure

1. Initialize all variables corresponding to t = 0

2. Calculate velocities inside the cavity

ui ,j =ψi ,j+1 − ψi ,j−1

2∆y

vi ,j =ψi−1,j − ψi+1,j

2∆x

3. Calculate vorticity over cavity:

Ωi ,j =vi+1,j − vi−1,j

2∆x−

ui ,j+1 − ui ,j−1

2∆y

Page 181: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Computational Procedure Continued

4. Calculate vorticities

Ωn+1i ,j − Ωn

i ,j

∆t+ un

i ,j

Ωni+1,j − Ωn

i−1,j

2∆x+ vn

i ,j

Ωni ,j+1 − Ωn

i ,j−1

2∆y=

=1

Re∞

[Ωn

i+1,j − 2Ωni ,j + Ωn

i−1,j

(∆x)2+

Ωni ,j+1 − 2Ωn

i ,j + Ωni ,j−1

(∆y)2

]5. Solve Poison’s equation

ψk+1i ,j =

(∆x)2Ωki ,j + ψk

i+1,j + ψki−1,j + β2

(ψk

i ,j+1 + ψki ,j−1

)2(1 + β2)

ψk+1i ,j = ωψk

i ,j + (1− ω)ψk+1i ,j

β =∆x

∆y, ui ,j =

ψi ,j+1 − ψi ,j−1

2∆y, vi ,j = −

ψi+1,j − ψi−1,j

2∆x

Page 182: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Computational Procedure Continued

4. Calculate vorticities

Ωn+1i ,j − Ωn

i ,j

∆t+ un

i ,j

Ωni+1,j − Ωn

i−1,j

2∆x+ vn

i ,j

Ωni ,j+1 − Ωn

i ,j−1

2∆y=

=1

Re∞

[Ωn

i+1,j − 2Ωni ,j + Ωn

i−1,j

(∆x)2+

Ωni ,j+1 − 2Ωn

i ,j + Ωni ,j−1

(∆y)2

]5. Solve Poison’s equation

ψk+1i ,j =

(∆x)2Ωki ,j + ψk

i+1,j + ψki−1,j + β2

(ψk

i ,j+1 + ψki ,j−1

)2(1 + β2)

ψk+1i ,j = ωψk

i ,j + (1− ω)ψk+1i ,j

β =∆x

∆y, ui ,j =

ψi ,j+1 − ψi ,j−1

2∆y, vi ,j = −

ψi+1,j − ψi−1,j

2∆x

Page 183: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Computational Procedure Continued

6. Update values of vorticity at the boundaries

Ωi ,1 = −2 ·ψi ,2

(∆y)2, ΩI ,j = −2 ·

ψI−1,j

(∆x)2

Ω1,j = −2 ·ψ2,j

(∆x)2, ΩJ,i = −2

ψJ−1,i

(∆y)2− 2 · uo

∆y

7. Calculate velocities

un+1i ,j =

ψn+1i ,j+1 − ψn+1

i ,j−1

2∆y

vn+1i ,j =

ψn+1i−1,j − ψn+1

i+1,j

2∆x

8. Check convergence

||un+1 − un|| < εu, ||vn+1 − vn|| < εv

Page 184: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Computational Procedure Continued

6. Update values of vorticity at the boundaries

Ωi ,1 = −2 ·ψi ,2

(∆y)2, ΩI ,j = −2 ·

ψI−1,j

(∆x)2

Ω1,j = −2 ·ψ2,j

(∆x)2, ΩJ,i = −2

ψJ−1,i

(∆y)2− 2 · uo

∆y

7. Calculate velocities

un+1i ,j =

ψn+1i ,j+1 − ψn+1

i ,j−1

2∆y

vn+1i ,j =

ψn+1i−1,j − ψn+1

i+1,j

2∆x

8. Check convergence

||un+1 − un|| < εu, ||vn+1 − vn|| < εv

Page 185: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Computational Procedure Continued

6. Update values of vorticity at the boundaries

Ωi ,1 = −2 ·ψi ,2

(∆y)2, ΩI ,j = −2 ·

ψI−1,j

(∆x)2

Ω1,j = −2 ·ψ2,j

(∆x)2, ΩJ,i = −2

ψJ−1,i

(∆y)2− 2 · uo

∆y

7. Calculate velocities

un+1i ,j =

ψn+1i ,j+1 − ψn+1

i ,j−1

2∆y

vn+1i ,j =

ψn+1i−1,j − ψn+1

i+1,j

2∆x

8. Check convergence

||un+1 − un|| < εu, ||vn+1 − vn|| < εv

Page 186: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

ResultsContour plot ψ = cosnt, I = 41, J = 31, ν = 0.0025 m2/s.uo = 5m/s

Page 187: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Results

Page 188: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Results

Page 189: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Results

Page 190: Simulation of Fluid Flows - Technische Universität München · Simulation of Fluid Flows Zlatko Petrovi´c University of Belgrade Faculty of Mechanical Engineering Bitola, October

Results