solving the navier-stokes equations...fmia isbn 978-3-319-16873-9 fluid mechanics and its...

11
FMIA ISBN 978-3-319-16873-9 Fluid Mechanics and Its Applications Fluid Mechanics and Its Applications Series Editor: A. Thess F. Moukalled L. Mangani M. Darwish The Finite Volume Method in Computational Fluid Dynamics An Advanced Introduction with OpenFOAM® and Matlab® The Finite Volume Method in Computational Fluid Dynamics Moukalled · Mangani · Darwish 113 F. Moukalled · L. Mangani · M. Darwish The Finite Volume Method in Computational Fluid Dynamics An Advanced Introduction with OpenFOAM® and Matlab® This textbook explores both the theoretical foundation of the Finite Volume Method (FVM) and its applications in Computational Fluid Dynamics (CFD). Readers will discover a thorough explanation of the FVM numerics and algorithms used in the simulation of incompressible and compressible fluid flows, along with a detailed examination of the components needed for the development of a collocated unstructured pressure-based CFD solver. Two particular CFD codes are explored. The first is uFVM, a three-dimensional unstructured pressure-based finite volume academic CFD code, implemented within Matlab®. The second is OpenFOAM®, an open source framework used in the development of a range of CFD programs for the simulation of industrial scale flow problems. With over 220 figures, numerous examples and more than one hundred exercises on FVM numerics, programming, and applications, this textbook is suitable for use in an introductory course on the FVM, in an advanced course on CFD algorithms, and as a reference for CFD programmers and researchers. Engineering 9 783319 168739 Solving the Navier-Stokes Equations Chapter 16

Upload: others

Post on 13-Apr-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Solving the Navier-Stokes Equations...FMIA ISBN 978-3-319-16873-9 Fluid Mechanics and Its Applications Fluid Mechanics and Its Applications Series Editor: A. Thess F.Moukalled L. Mangani

FMIA

ISBN 978-3-319-16873-9

Fluid Mechanics and Its ApplicationsFluid Mechanics and Its ApplicationsSeries Editor: A. Thess

F. MoukalledL. ManganiM. Darwish

The Finite Volume Method in Computational Fluid DynamicsAn Advanced Introduction with OpenFOAM® and Matlab®

The Finite Volume Method in Computational Fluid Dynamics

Moukalled · Mangani · Darwish

113

F. Moukalled · L. Mangani · M. Darwish The Finite Volume Method in Computational Fluid Dynamics An Advanced Introduction with OpenFOAM® and Matlab ®

This textbook explores both the theoretical foundation of the Finite Volume Method (FVM) and its applications in Computational Fluid Dynamics (CFD). Readers will discover a thorough explanation of the FVM numerics and algorithms used in the simulation of incompressible and compressible fluid flows, along with a detailed examination of the components needed for the development of a collocated unstructured pressure-based CFD solver. Two particular CFD codes are explored. The first is uFVM, a three-dimensional unstructured pressure-based finite volume academic CFD code, implemented within Matlab®. The second is OpenFOAM®, an open source framework used in the development of a range of CFD programs for the simulation of industrial scale flow problems.

With over 220 figures, numerous examples and more than one hundred exercises on FVM numerics, programming, and applications, this textbook is suitable for use in an introductory course on the FVM, in an advanced course on CFD algorithms, and as a reference for CFD programmers and researchers.

Engineering

9 783319 168739

Solving the Navier-Stokes Equations

Chapter 16

Page 2: Solving the Navier-Stokes Equations...FMIA ISBN 978-3-319-16873-9 Fluid Mechanics and Its Applications Fluid Mechanics and Its Applications Series Editor: A. Thess F.Moukalled L. Mangani

Pressure Equation for Compressible Flow

Page 3: Solving the Navier-Stokes Equations...FMIA ISBN 978-3-319-16873-9 Fluid Mechanics and Its Applications Fluid Mechanics and Its Applications Series Editor: A. Thess F.Moukalled L. Mangani

Compressible Flow

∂ρ∂t

+ ∇ ⋅ ρv( ) = 0

∂ ρv( )∂t

+ ∇ ⋅ ρvv( ) = ∇ ⋅ τ −∇p+ B

ρ = Cρ p

ρ P∗ + ′P( ) = ρ P( ) +∂ρ∂P

′p ⇒ ′ρ =∂ρ∂P

⎛⎝⎜

⎞⎠⎟ ′p = Cρ ′p

p = p(n) + ′p

ρ = ρ(n) + ′ρ

v = v* + ′v

Page 4: Solving the Navier-Stokes Equations...FMIA ISBN 978-3-319-16873-9 Fluid Mechanics and Its Applications Fluid Mechanics and Its Applications Series Editor: A. Thess F.Moukalled L. Mangani

Discretized Equations

!mf = ρ f

(n) + ′ρ f( ) v f• + ′v f( ) ⋅S f

= ρ f(n)v f

• ⋅S f

!mf•

" #$ %$+ ρ f

(n) ′v f ⋅S f + ′ρ fv f• ⋅S f + ′ρ f ′v f ⋅S f

′!mf

" #$$$$$$ %$$$$$$

!mf = ρ f v f• + ′v f( ) ⋅S f = ρ fv f

• ⋅S f

!mf•

"#$ %$+ ρ f ′v f ⋅S f

′!mf

"#$ %$

∂ρ∂t

+ ∇ ⋅ ρv( ) = 0

ρP + ′ρP − ρP(n)( )

ΔtVP + !mf

∗ + ′!mf( )f =nb(P )∑ = 0

Compressible

˙ m f∗ + ˙ ′ m f( )

f = nb(P )∑ = 0

Incompressible

Page 5: Solving the Navier-Stokes Equations...FMIA ISBN 978-3-319-16873-9 Fluid Mechanics and Its Applications Fluid Mechanics and Its Applications Series Editor: A. Thess F.Moukalled L. Mangani

Velocity Correction

! ′mf = ρ f(n) ′v f ⋅S f − ρ f

(n)D f ∇ ′pf −∇ ′pf( ) ⋅S f

(1)" #$$$$$$ %$$$$$$

+!mf•

ρ f(n) ⋅S f

⎝⎜⎞

⎠⎟Cρ , f ′pf

(2)" #$$$ %$$$

!mf• = ρ f

(n)v f• ⋅S f − ρ f

(n)D f ∇pf(n) −∇pf

(n)( ) ⋅S f

ρ f(n)v f

• ⋅S f

!mf•

" #$ %$+ ρ f

(n) ′v f ⋅S ff + ′ρ fv f• ⋅S f + ′ρ f ′v f ⋅S f

! ′mf

" #$$$$$$ %$$$$$$

Page 6: Solving the Navier-Stokes Equations...FMIA ISBN 978-3-319-16873-9 Fluid Mechanics and Its Applications Fluid Mechanics and Its Applications Series Editor: A. Thess F.Moukalled L. Mangani

Pressure Equation

VPΔtCρ ′pC + −ρ f

(n)D f∇ ′pf ⋅S f +!mf•

ρ f(n)

⎝⎜⎞

⎠⎟Cρ ′pf

⎧⎨⎪

⎩⎪

⎫⎬⎪

⎭⎪f =nb(P )∑ =

− ρC(n) − ρC

o

ΔtVC + !mf

f =nb(C )∑

⎝⎜⎞

⎠⎟− ρ f

(n) ′v f +D f∇ ′pf( ) ⋅S ff =nb(C )∑ − ′ρ f ′v f ⋅S f

f =nb(C )∑

′ρ f ′v f +D f∇ ′pf( ) ⋅S ff =nb(C )∑ = −H f ′v[ ]⋅S f

f =nb(P )∑ = −0.5 ′HC + ′HN( ) ⋅S f

f =nb(C )∑

= −0.5 aNBPaP

′vNBP⎛⎝⎜

⎞⎠⎟NBP(C )

∑ + aNBFaF

′vNBF⎛⎝⎜

⎞⎠⎟NB(F )

∑⎛

⎝⎜⎞

⎠⎟⋅S f

f =nb(C )∑

ρC + ′ρC − ρC(n)( )

ΔtVC + !mf

• + ′!mf( )f =nb(C )∑ = 0

Page 7: Solving the Navier-Stokes Equations...FMIA ISBN 978-3-319-16873-9 Fluid Mechanics and Its Applications Fluid Mechanics and Its Applications Series Editor: A. Thess F.Moukalled L. Mangani

aC =VCCρ

Δt+

Cρ , f

ρ f(n) !mf

∗ ,0⎛

⎝⎜⎞

⎠⎟f =nb(C )∑ + ρ f

(n)D ff =nb(C )∑

aF = − − !mf∗ ,0

Cρ , f

ρ f(n) − ρ f

(n)D f

bC = −ρC(n) − ρC

"( )Δt

VC + !mf∗

f =nb(C )∑

⎝⎜

⎠⎟ + ρ f

(n) D f∇ ′pf( ) ⋅Tff =nb(C )∑

Pressure Equation

VCCρ

Δt′pC

transient−liketerm

!"# $#+ Cρ

%mf∗

ρ f(n)

⎝⎜⎞

⎠⎟′pf

⎣⎢⎢

⎦⎥⎥f =nb(C )

∑convection−like term

! "### $###

+ −ρ f(n)D f ∇ ′p( ) f ⋅S f

⎡⎣ ⎤⎦f =nb(C )∑

diffusion−like term! "#### $####

= −ρC(n) − ρC

&( )Δt

VC + %mf∗

f =nb(C )∑

⎝⎜

⎠⎟

source−like term! "##### $#####

−ρ f(n)D f ∇ ′p( ) f ⋅S f

⎡⎣ ⎤⎦ = −ρ f(n)D f ∇ ′p( ) f ⋅ E f +Tf( )⎡⎣ ⎤⎦

f =nb(P )∑

f =nb(P )∑

Df =

d fuEx, f + d f

vEy, f

dPF

⎝⎜

⎠⎟

= −ρ f(n)D f ⋅ ′pF − ′pC( )⎡⎣ ⎤⎦

f =nb(P )∑

!mf∗

ρ f(n)

⎝⎜⎞

⎠⎟′pf

⎣⎢⎢

⎦⎥⎥f =nb(C )

∑ = !mf• ,0

Cρ , f

ρ f(n) ′pC − − !mf

• ,0Cρ , f

ρ f(n) ′pF

Page 8: Solving the Navier-Stokes Equations...FMIA ISBN 978-3-319-16873-9 Fluid Mechanics and Its Applications Fluid Mechanics and Its Applications Series Editor: A. Thess F.Moukalled L. Mangani

Pressure Equation

VCCρΔt

′pC( )+ CρU f• ′P( )

f− ρ f

•D f ∇ ′p( ) f ⋅S f( )f=nb C( )∑

f=nb C( )∑ =−

VCΔtρC

• −ρC!( )− ρ f

*U f*( )

f=nb C( )∑ − ′ρ f ′v f ⋅S f( )

f=nb C( )∑ − ρ f

• ′v f +D f ∇ ′P( )f( )⋅S f

⎣⎢⎢

⎦⎥⎥f=nb C( )

∑High Resolution

Neglect

VCCρΔt

′pC( )+ CρU f• ′pf +ρ f

• ′v f −D f ∇ ′p −∇ ′p( )f

Rhie-Chow interpolation! "### $###

⎜⎜⎜⎜⎜⎜⎜⎜

⎟⎟⎟⎟⎟⎟⎟⎟⎟⋅S f

⎢⎢⎢⎢⎢

⎥⎥⎥⎥⎥

f∑ =−

VCΔtρC

• −ρC%( )− &mf

f=nb C( )∑ − ′ρ f ′v f ⋅S f( )

f=nb C( )∑

SIMPLESIMPLECSIMPLERSIMPLESTSIMPLE-M

PISO

treatment leadsto variety of schemes

aC ′pC + aF ′pF

F=NB(C )∑ = bC

VCCρΔt

′pC( )+ Cρ!mf

ρ f•′pf

⎝⎜⎜⎜⎜

⎠⎟⎟⎟⎟⎟− ρ f

•D f ∇ ′p( ) f ⋅S f( )f=nb C( )∑

f=nb C( )∑ =−

ΩΔtρP

• −ρPo( )+ !mf

f=nb C( )∑

⎝⎜⎜⎜⎜

⎠⎟⎟⎟⎟⎟

Residual" #$$$$ %$$$$

p•,v••, !m••

Page 9: Solving the Navier-Stokes Equations...FMIA ISBN 978-3-319-16873-9 Fluid Mechanics and Its Applications Fluid Mechanics and Its Applications Series Editor: A. Thess F.Moukalled L. Mangani

All-Speed Flow Algorithms

Figure 7. (a) Pressure contours and (b) Mach number distributions along the upper and lower walls for supersonic flow over a bump (Minlet¼ 1.4). Convergencehistory plots of the various algorithms using the (c) single-grid, (d ) prolongation grid, and (e) multigrid methodologies for supersonic flow over a bump (Minlet¼ 1.4).

20

Figure 7. (a) Pressure contours and (b) Mach number distributions along the upper and lower walls for supersonic flow over a bump (Minlet¼ 1.4). Convergencehistory plots of the various algorithms using the (c) single-grid, (d ) prolongation grid, and (e) multigrid methodologies for supersonic flow over a bump (Minlet¼ 1.4).

20

Figure 6. (a) Pressure contours and (b) Mach number distributions along the upper and lower walls for transonic flow over a bump (Minlet¼ 0.675). Convergencehistory plots of the various algorithms using the (c) single-grid, (d ) prolongation grid, and (e) multigrid methodologies for transonic flow over a bump (Minlet¼ 0.675).

18

Figure 6. (a) Pressure contours and (b) Mach number distributions along the upper and lower walls for transonic flow over a bump (Minlet¼ 0.675). Convergencehistory plots of the various algorithms using the (c) single-grid, (d ) prolongation grid, and (e) multigrid methodologies for transonic flow over a bump (Minlet¼ 0.675).

18

ΩCρ

Δt′ P P( ) + CρU f

* ′ P ( )f

f∑ − ρ f

* D f ∇ ′ P ( ) f ⋅S f( )f∑ = −

ΩΔt

ρP* − ρP

o( ) + ρ f*U f

*( )f∑

⎣ ⎢ ⎢

⎦ ⎥ ⎥ − ′ ρ f ′ v f ⋅S f( )

f∑ − ρ f

* H ′ v [ ] f ⋅S f( )f∑

Transient-like Term

Advection-like Termaccount for compressibility effects

Figure 7. (a) Pressure contours and (b) Mach number distributions along the upper and lower walls for supersonic flow over a bump (Minlet¼ 1.4). Convergencehistory plots of the various algorithms using the (c) single-grid, (d ) prolongation grid, and (e) multigrid methodologies for supersonic flow over a bump (Minlet¼ 1.4).

20

Page 10: Solving the Navier-Stokes Equations...FMIA ISBN 978-3-319-16873-9 Fluid Mechanics and Its Applications Fluid Mechanics and Its Applications Series Editor: A. Thess F.Moukalled L. Mangani

Multigrid Acceleration

Figure 1. (a) Prolongation and restriction. (b) Full multigrid algorithm cycles. (c) Converging-divergingnozzle test problem.

10 M. DARWISH ET AL.

Figure 1. (a) Prolongation and restriction. (b) Full multigrid algorithm cycles. (c) Converging-divergingnozzle test problem.

10 M. DARWISH ET AL.

Figure 7. (a) Pressure contours and (b) Mach number distributions along the upper and lower walls for supersonic flow over a bump (Minlet¼ 1.4). Convergencehistory plots of the various algorithms using the (c) single-grid, (d ) prolongation grid, and (e) multigrid methodologies for supersonic flow over a bump (Minlet¼ 1.4).

20

Figure 5. (a) Pressure contours and (b) Mach number distributions along the upper and lower walls for subsonic flow over a bump (Minlet¼ 0.5). Convergence historyplots of the various algorithms using the (c) single-grid, (d) prolongation grid, and (e) multigrid methodologies for subsonic flow over a bump (Minlet ¼ 0.5).

17

Figure 6. (a) Pressure contours and (b) Mach number distributions along the upper and lower walls for transonic flow over a bump (Minlet¼ 0.675). Convergencehistory plots of the various algorithms using the (c) single-grid, (d ) prolongation grid, and (e) multigrid methodologies for transonic flow over a bump (Minlet¼ 0.675).

18

Figure 6. (a) Pressure contours and (b) Mach number distributions along the upper and lower walls for transonic flow over a bump (Minlet¼ 0.675). Convergencehistory plots of the various algorithms using the (c) single-grid, (d ) prolongation grid, and (e) multigrid methodologies for transonic flow over a bump (Minlet¼ 0.675).

18

Figure 7. (a) Pressure contours and (b) Mach number distributions along the upper and lower walls for supersonic flow over a bump (Minlet¼ 1.4). Convergencehistory plots of the various algorithms using the (c) single-grid, (d ) prolongation grid, and (e) multigrid methodologies for supersonic flow over a bump (Minlet¼ 1.4).

20

Figure 7. (a) Pressure contours and (b) Mach number distributions along the upper and lower walls for supersonic flow over a bump (Minlet¼ 1.4). Convergencehistory plots of the various algorithms using the (c) single-grid, (d ) prolongation grid, and (e) multigrid methodologies for supersonic flow over a bump (Minlet¼ 1.4).

20

100 100 1100 1 1

1 100 1100 1 1

1 100 1100 100 1

1 1 1100 100 1

1 1 .01.01 .01 .01

1 1 .01.01 .01 .01

Figure 7. (a) Pressure contours and (b) Mach number distributions along the upper and lower walls for supersonic flow over a bump (Minlet¼ 1.4). Convergencehistory plots of the various algorithms using the (c) single-grid, (d ) prolongation grid, and (e) multigrid methodologies for supersonic flow over a bump (Minlet¼ 1.4).

20

Page 11: Solving the Navier-Stokes Equations...FMIA ISBN 978-3-319-16873-9 Fluid Mechanics and Its Applications Fluid Mechanics and Its Applications Series Editor: A. Thess F.Moukalled L. Mangani

Problem 1- Staggered Grid

• Use the SIMPLE procedure to compute p2, uB, and uC from the following data:

• As an initial guess, set

1 2 3uB

uC