Docsity

CFD Analysis process - Computational Fluid Dynamics I - Slides | ENAE 684, Study notes of Aerospace Engineering

Toggle sidebar
bg1
Fall 2008 - James D. Baeder
ENAE684 - Computational Fluid Dynamics I
Lecture #2 - 1
ENAE684 - Lecture #2
ENAE684 - Lecture #2
•CFD Analysis Process
•Review of Basic Fluid Mechanics
•Navier-Stokes Equation
•1-D Unsteady Euler Equation
•PDE for Scalars
•Simple Model Equations
•Time Accurate
•Diffusion (Dissipation)
•Convection (Advection)
•Convection-Diffusion
•Steady-State
•Poisson!s Equation
•Equal-Spaced Mesh
•Justification for Cartesian Equi-spaced Grids
•Point Difference Operator Preparing for Numerics
0123456
-1.5
-1
-0.5
0
0.5
1
1.5
Solution at t = 6.283; anu = 0.1; a = 1
X
U
Fall 2008 - James D. Baeder
ENAE684 - Computational Fluid Dynamics I
Lecture #2 - 2
CFD Analysis Process
CFD Analysis Process
•Problem Statement --> information about the flow
•Mathematical Model --> IBVP = PDE + IC + BC
•Mesh Generation --> nodes/cells, time steps
•Space Discretization --> coupled ODE/DAE systems
•Time Discretization --> algebraic systems Ax = b
•Iterative Solver --> discrete function values
•CFD Software --> implementation, debugging
•Simulation Run --> parameters, stopping criteria
•Postprocessing --> visualization, analysis
•Verification --> model validation, adjustment
From
last
lecture!
Fall 2008 - James D. Baeder
ENAE684 - Computational Fluid Dynamics I
Lecture #2 - 3
Conservation Laws -
Conservation Laws -
Reynold
Reynold!
!s
s Transport Theorem
Transport Theorem
•Integral Form:
•Arbitrary Control Volume:
•Can discretize directly in physical space (Finite Volume Method)
•Due to McDonald, 1971/ MacCormack & Paullay, 1972
!
U
r
v
"
u#U
"
quantity
unit mass
$
%
& '
(
)
!
"
"
tUdV
V
#=$
r
F •r
n
( )
S
#dS +
r
Q
S•r
n
( )
S
#dS +QVdV
V
#
!
r
Q
S
!
U
!
dV
!
dS
!
QV
!
r
F
D
!
r
F
C
!
S
!
V
From
last
lecture!
Fall 2008 - James D. Baeder
ENAE684 - Computational Fluid Dynamics I
Lecture #2 - 4
Conservation Laws (2)
Conservation Laws (2)
Reynold
Reynold!
!s
s Transport Theorem
Transport Theorem
•General Differential Conservation Law Form
•Flux can take two forms
•Convective Flux (w/ local fluid)
•Diffusive Flux (away from concentration)
•Then, one can write:
!
"#
u
"
t+
r
$ •
#
r
v u %
r
Q
S%
&#
r
$ u
( )
=QV
!
r
F
D" #
$%
r
& u
$
"diffusivity constant
( )
!
r
F
C"r
v U =
#
r
v u u "U
#
quantity
unit mass
$
%
& '
(
)
pf3
pf4
pf5
pf8
pf9
pfa
Discount

On special offer

Partial preview of the text

Download CFD Analysis process - Computational Fluid Dynamics I - Slides | ENAE 684 and more Study notes Aerospace Engineering in PDF only on Docsity!

ENAE684 - Computational Fluid Dynamics I Fall 2008 - James D. Baeder

Lecture #2 - 1

ENAE684 - Lecture #2 ENAE684 - Lecture

  • CFD Analysis Process
  • Review of Basic Fluid Mechanics
    • Navier-Stokes Equation
    • 1-D Unsteady Euler Equation
    • PDE for Scalars
  • Simple Model Equations
    • Time Accurate
      • Diffusion (Dissipation)
      • Convection (Advection)
      • Convection-Diffusion
    • Steady-State
      • Poisson! s Equation
  • Equal-Spaced Mesh
    • Justification for Cartesian Equi-spaced Grids
  • Point Difference Operator Preparing for Numerics

0 1 2 3 4 5 6

-1.

-

-0.

0

0.

1

1.

Solution at t = 6.283; anu = 0.1; a = 1

X

U

ENAE684 - Computational Fluid Dynamics I Fall 2008 - James D. Baeder

Lecture #2 - 2

CFD Analysis Process CFD Analysis Process

  • Problem Statement --> information about the flow
  • Mathematical Model --> IBVP = PDE + IC + BC
  • Mesh Generation --> nodes/cells, time steps
  • Space Discretization --> coupled ODE/DAE systems
  • Time Discretization --> algebraic systems Ax = b
  • Iterative Solver --> discrete function values
  • CFD Software --> implementation, debugging
  • Simulation Run --> parameters, stopping criteria
  • Postprocessing --> visualization, analysis
  • Verification --> model validation, adjustment

From

last

lecture!

ENAE684 - Computational Fluid Dynamics I Fall 2008 - James D. Baeder

Lecture #2 - 3

Conservation Laws -Conservation Laws -

Reynold Reynold !! ss Transport TheoremTransport Theorem

  • Integral Form:
    • Arbitrary Control Volume:
    • Can discretize directly in physical space (Finite Volume Method)
      • Due to McDonald, 1971/ MacCormack & Paullay, 1972
U

r

v

u #

U

quantity

unit mass

!

"

" t

UdV

V

= $

r

F •

r

n ( )

S

dS +

r

Q S

r

n ( )

S

dS + Q V

dV

V

!

r

Q S

!

U

!

dV

!

r

n

!

dS

!

Q V

!

r

F D

!

r

F C

!

S

!

V

From

last

lecture!

ENAE684 - Computational Fluid Dynamics I Fall 2008 - James D. Baeder

Lecture #2 - 4

Conservation Laws (2)Conservation Laws (2)

Reynold Reynold !! ss Transport TheoremTransport Theorem

  • General Differential Conservation Law Form
  • Flux can take two forms
    • Convective Flux (w/ local fluid)
    • Diffusive Flux (away from concentration)
  • Then, one can write:

"# u

" t

r

r

v u %

r

Q

S

r

$ u

= Q

V

!

r

F

D

r

& u ( $ " diffusivity constant)

r

F

C

r

v U = #

r

v u u "

U

quantity

unit mass

ENAE684 - Computational Fluid Dynamics I Fall 2008 - James D. Baeder

Lecture #2 - 5

Finite VolumeFinite Volume

  • Convenient for making sure system remains
truly conservative, e.g. for each subdomain:
  • If we add them up, we have:

i.e. All internal fluxes and surface sources cancel!

!

"

" t

UdV

V

r

F •

r

n

AEBCA

dS =

r

Q S

r

n

AEBCA

dS + Q V

dV

V

!

"

" t

UdV

V 1

# +^

r

F •

r

n

ABCA

# dS^ =^

r

Q S

r

n

ABCA

# dS^ +^ QV dV

V 1

"

" t

UdV

V 2

# +^

r

F •

r

n

DEBD

# dS^ =^

r

Q S

r

n

DEBD

# dS^ +^ QV dV

V 2

"

" t

UdV

V 3

# +^

r

F •

r

n

AEDA

# dS^ =^

r

Q S

r

n

AEDA

# dS^ +^ QV dV

V 3

!

V 1

!

V 2

!

V 3

!

A

!

B

!

C

!

D

!

E

ENAE684 - Computational Fluid Dynamics I Fall 2008 - James D. Baeder

Lecture #2 - 6

Finite Volume (2) Finite Volume (2)

  • If we assume that we have some average value
in the volume (finite) and a flux at the sides one
can write for each volume, i:
  • N.B.:
    • Easily extendible to arbitrary number of sides
    • Flux / surface source not defined at cell center or as cell

average

" t

U

i

V

i

r

F

ij

r

S

ij

j = 1

of sides

r

Q

ij

r

S

ij

j = 1

of sides

+ Q

V i

V

i

From

last

lecture!

ENAE684 - Computational Fluid Dynamics I Fall 2008 - James D. Baeder

Lecture #2 - 7

Differential Form Differential Form

  • A more common approach is to convert to
differential form using Gausses! theorem
  • For continuous fluxes and surface sources:
  • Or, in divergence form:

Can discretize using finite differences (Euler, 1768)

" U

" t

dV +

r

r

F

dV

V

V

r

r

Q

( S )

dV

V

+ Q

V

dV

V

r

F •

r

n

S

dS =

r

r

F

dV

V

" U

" t

r

r

F

C

r

Q

S

r

F

( D )

= Q

V

From

last

lecture!

ENAE684 - Computational Fluid Dynamics I Fall 2008 - James D. Baeder

Lecture #2 - 8

Navier-Stokes Navier-Stokes

  • One can derive for N.S.:
    • Mass (Continuity)
    • Similar for Momentum & Energy (see terms below)
  • Can write as system of equations:

! t

r

r

( v ) = 0

" t

r

v

# E

U

r

r

v

r

v +

r

v + pI , -

r

v E

r

F C

r

v p , - •

r

v

,

r

Q S

, k * T

r

F D

r

f e

r

f e

r

v + q H

Q V

u " 1 ;

r

Q

S

" 0 ; # " 0 ; Q

V

ENAE684 - Computational Fluid Dynamics I Fall 2008 - James D. Baeder

Lecture #2 - 13

Characteristic EquationsCharacteristic Equations

  • Decoupled Characteristic Equations
    • Simple scalar wave equations for characteristic quantities
    • Can solve in wave space and re-couple to physical space

Forms the basis of the method of characteristics

  • So, as a first step
    • Can consider scalar PDEs (hyperbolic)
    • Results can be extended to system of PDEs

" w i

" t

i

" w i

" x

= 0 for i = 1,2, 3

ENAE684 - Computational Fluid Dynamics I Fall 2008 - James D. Baeder

Lecture #2 - 14

Scalar Scalar PDEPDE !! ss

  • Linearized Euler Equations
    • Consider perturbations (small) around an

undisturbed medium in 1-D with no mean velocity:

  • Then …in class… it can be shown that:
    • Where c 0 is the uniform speed of sound

0

  • " $( x , t )

p # p 0

  • p $ (^) ( x , t )

u # u $ (^) ( x , t )

"

2 $#

" t

2

% c 0

2 "

2 $#

" x

2

ENAE684 - Computational Fluid Dynamics I Fall 2008 - James D. Baeder

Lecture #2 - 15

Scalar Scalar (^) PDEPDE !! ss (2)(2)

  • Many Examples Derived From Fluid Physics
    • 1-D Diffusion of Heat (w/ source)
      • Examine energy equation:
      • For u<<1 --> incompressible (density ~ constant)
        • --> continuity gives therefore u ~ constant (and small)
        • Now for the stagnation temperature:
        • Thus:
          • Or where

" t

_c

v_

T

0 ( )

" x

_uc

v_

T

0

  • up $ u μ

" u

" x

$ k

" T

" x

  • =^ # f e

u + q H

!

" u

" x

= 0

!

T 0

= T +

u

2

2 c p

" T

" c v

t

( T ) $^ k

2 T

x

2

= q H

T

t

= " T

xx

  • q

" # k $ c v

; q # q H

$ c v

ENAE684 - Computational Fluid Dynamics I Fall 2008 - James D. Baeder

Lecture #2 - 16

Simple Model Equations Simple Model Equations

Out of all the possible equations we will

focus on the following in ENAE684:

  • Time Accurate
    • Diffusion (Dissipation) Equation
    • Convection (Advection) Equation
    • Convection-Diffusion Equation
  • Steady-State
    • Poisson! s Equation
Why focus on these?

(parabolic)

(hyperbolic)

(parabolic)

(elliptic)

ENAE684 - Computational Fluid Dynamics I Fall 2008 - James D. Baeder

Lecture #2 - 17

Diffusion (Dissipation)Diffusion (Dissipation)^ EqEq..

  • Solution
    • Sinusoidal w/ exponential decay if fixed bc
    • Linear steady-state
    • Note:
      • Decrease in amplitude for positive real dissipation
      • Increased damping with increasing wave number, k
        • Quadratic
      • No phase shifting or dispersion

" u

" t

"

2 u

" x

2

(parabolic) u xx

; 0 $ x $ L

u = u 0 k

e

! " k

2 t

sin kx

k

  • u x = 0

  • u x = 0

! u x = L [ ]

x

L

ENAE684 - Computational Fluid Dynamics I Fall 2008 - James D. Baeder

Lecture #2 - 18

Diffusion Diffusion EqEq. (2). (2)

  • From x-t diagram
    • Requires:
      • Initial condition at t=
      • Boundary conditions at x=0 and x=L
        • Dirichlet (specify u)
        • Von Neumann (specify du/dx)
        • Mixed: Robin (specify au+bdu/dx)

x = 0 x = L

t = 0

t

x

u(x,0)

u(0,t)

u(L,t)

ENAE684 - Computational Fluid Dynamics I Fall 2008 - James D. Baeder

Lecture #2 - 19

0 1 2 3 4 5 6

-1.

-

-0.

0

0.

1

1.

Solution at t = 6.283; anu = 0.05; a = 0

X

U

Diffusion Diffusion EqEq. (3). (3)

  • Note:
    • High Frequencies

dampen out the

fastest

  • Low frequencies

dampen out the

slowest

  • How is this like at

a music concert?

t = 0.

t = 1.

t = 6.

ENAE684 - Computational Fluid Dynamics I Fall 2008 - James D. Baeder

Lecture #2 - 20

Convection (Advection) Convection (Advection) EqEq..

  • Solution
    • Note:
      • No physical damping or dissipation
      • Wave-like (phase shift)
      • Characteristic speed of a
        • solution constant along characteristic

! u

! t

  • a

! u

! x

= 0 (hyperbolic) u x

u = u 0 k

e

! ikat e

ikx

k

" = u 0 k

e

ik ( x! at )

k

"

ENAE684 - Computational Fluid Dynamics I Fall 2008 - James D. Baeder

Lecture #2 - 25

0 1 2 3 4 5 6

-1.

-

-0.

0

0.

1

1.

Solution at t = 6.283; anu = 0.01; a = 1

X

U

Convection-Diffusion Convection-Diffusion EqEq. (2). (2)

t = 0.

t = 1.

t = 6.

  • Note:
    • High Frequencies

dampen out the

fastest

  • Low frequencies

dampen out the

slowest

  • Note movement

(convection) of

the waves as well

as damping with

time

  • How is this like at

a music concert?

ENAE684 - Computational Fluid Dynamics I Fall 2008 - James D. Baeder

Lecture #2 - 26

PoissonPoisson !! s Equations Equation

  • Note:
    • Elliptic with imaginary eigenvalues
      • No characteristic speeds or directions
    • Boundary conditions on all sides
    • Initial solution is irrelevant
    • Can use iterative (relaxation methods)
      • Gradually satisfy governing equation and boundary conditions
    • Can add fictitious time derivative and march to steady-state!

2 "

! x

2

2 "

! y

2

= f ( x , y ) (elliptic)

x

y

b.c.

ENAE684 - Computational Fluid Dynamics I Fall 2008 - James D. Baeder

Lecture #2 - 27

Equal-Spaced Mesh Equal-Spaced Mesh

  • Justification for Cartesian, Equi-spaced Grids
    • Can perform transformation of coordinates
      • Smooth & accurate --> local accuracy same in both spaces
      • Equi-spaced Cartesian mesh in transformed (computational) space

Justify inJustify in

Class?Class?

ENAE684 - Computational Fluid Dynamics I Fall 2008 - James D. Baeder

Lecture #2 - 28

Abbreviations and NotationAbbreviations and Notation

ODE: Ordinary Differential Equation

O"E: Ordinary Difference Equation

PDE: Partial Differential Equation

FDE: Finite Difference Equation

u: Dependent Variable

t,x,y,z: Independent Variables (Time & Space)

  • --> u = u (t,x,y,z)

If

  • u=u(t) -->
  • u=u(t,x) -->

du

dt

is ordinary derivative &

du

dt

! u "

!u

!t

is partial derivative &

!u

!t

" u t

ENAE684 - Computational Fluid Dynamics I Fall 2008 - James D. Baeder

Lecture #2 - 29

Analytical Analytical vsvs. Discrete. Discrete

  • Analytical
    • u(x) known everywhere
    • Exact representation of PDE
    • Difficult to solve on computer
    • Functional form may yield insight
  • Discrete
    • u(x j ) known only at discrete pts.
    • Approximate representation
      • Finite precision (round-off)
    • Suited to digital computer
    • More difficult to gain insight

x

u(x)

x

u(x j )

ENAE684 - Computational Fluid Dynamics I Fall 2008 - James D. Baeder

Lecture #2 - 30

Differential and DifferenceDifferential and Difference

OperatorsOperators

  • Differential:
    • Unique, since:
  • Difference:
    • Not unique, depends upon approximation & "x:
      • E.g.

u x

"u

"x

! lim

x $ 0

u ( x + # x ) % u ( x )

x

" x

u =

u j + 1

_u

j_ # 1

2 $ x

% u x

ENAE684 - Computational Fluid Dynamics I Fall 2008 - James D. Baeder

Lecture #2 - 31

Space-Time GridSpace-Time Grid

  • For equi-spaced grid:
  • Indexing:
  • Displacement (Shift) Operator:

x = x j

= j! x

t = t n

= n! t = nh

u ( t + kh ) = u n + k

u ( x + m! x ) = u j + m

u (^) ( t + kh , x + m! x ) = u j + m

n + k

E

x

u j

= u j + 1

Eu

n = u

n + 1

E

x

m u j

= u j + m

E

k u

n = u

n + k

ENAE684 - Computational Fluid Dynamics I Fall 2008 - James D. Baeder

Lecture #2 - 32

Point Differential Operator Point Differential Operator

  • Define relationship at one point in the mesh
    • Eg. Space, !u

!x j

x

u j

x

u j

x

u

j-1 j j+

ENAE684 - Computational Fluid Dynamics I Fall 2008 - James D. Baeder

Lecture #2 - 37

Second DerivativeSecond Derivative

  • We could do the same for the second derivative:
    • Eg. Central in space, O("x

2 )

  • Eg. Forward in space, O("x)

xx

u j

u j + 1

$ 2 u j

  • u j $ 1

% x

2

E

x

$ 2 + E

x

$ 1

% x

2

u j

xx

u j

xx

u j

u j + 2

$ 2 u j + 1

  • u j

% x

2

E

x

2 $ 2 E x

% x

2

u j

xx

u j

ENAE684 - Computational Fluid Dynamics I Fall 2008 - James D. Baeder

Lecture #2 - 38

Point Difference Operator - Time Point Difference Operator - Time

  • We could do the same for the time derivative:
    • Eg. Central in time (Leapfrog), O("t

2 )

  • Eg. Forward in time (Euler Explicit), O("t)
  • Eg. Backward in time (Euler Implicit), O("t)

Note: Time derivative is usually written as update!

u n + 1

! u n " 1

  • 2 h u # n

u n + 1

! u n

  • h u " n + 1

u n + 1

! u n

  • h u " n

ENAE684 - Computational Fluid Dynamics I Fall 2008 - James D. Baeder

Lecture #2 - 39

Point Difference Operators II Point Difference Operators II

  • These were all point operators
    • Do not tell how other points are differenced
    • Do not tell how boundary conditions are enforced
  • This will require a more sophisticated
formulation
  • Matrix Difference Operators
  • Discussed more in later lecture
… So, how does one determine accuracy of
difference approximations?

ENAE684 - Computational Fluid Dynamics I Fall 2008 - James D. Baeder

Lecture #2 - 40

Taylor Series Analysis Taylor Series Analysis

  • From Calculus
    • Solution anywhere described by Taylor series

expansion of function and derivatives at one point!

  • As long as solution is continuous, i.e. derivatives exist
  • So, for example:

u j + k

= u j

  • (^) ( k! x )

" u

" x

j

( k! x )

2 "^

2

u

" x

2

j

+ K

n!

( k! x )

n^ "^

n u

" x

n

j

u j + 1

= u j

+! x

" u

" x

j

! x

2

2 u

" x

2

j

+ K+

n!

! x

n

n u

" x

n

j

ENAE684 - Computational Fluid Dynamics I Fall 2008 - James D. Baeder

Lecture #2 - 41

Taylor Series Analysis (2) Taylor Series Analysis (2)

  • One can easily see
    • Subtracting u j from both sides
    • Dividing by "x:
    • This is a first order approximation to first derivative at pt j
  • This process can be formalized with Taylor Tables

---> Method of Undetermined Coefficients

(reduces chances for errors)

u j + 1

! u j

" x

u

x

j

" x

2 u

x

2

j

+ K +

n!

" x

n! 1

n u

x

n

j

ENAE684 - Computational Fluid Dynamics I Fall 2008 - James D. Baeder

Lecture #2 - 42

Taylor Table Taylor Table

  • Example #
    • GIVEN: 3-pt backwards approximation to 1st derivative
    • REQUIRED:
        1. What are a 2

, a 1

, and a 0

for greatest accuracy?

    1. What is er t

=? (<--- Taylor series error)

  • SOLUTION:
    • Let! s construct a Taylor Table!
    • Solve linear system to determine coefficients

u x

j

" x

a 0

u j

  • a 1

u j # 1

  • a 2

u ( (^) j # 2 )

  • er t

Next Next

ClassClass

ENAE684 - Computational Fluid Dynamics I Fall 2008 - James D. Baeder

Lecture #2 - 43

For Next Class For Next Class

  • Work on Homework #
  • Read Lecture Notes #2 Carefully
    • How to derive governing equations?
    • Why can examine scalar PDE instead of coupled set?
    • Why can use equi-spaced Cartesian meshes?
    • Why is difference operator non-unique?
    • Solve Example #1 using Taylor series analysis?
  • Preview Chapter 3 of Lomax et al
    • Taylor Tables / Method of Undetermined Coefficients
  • How can we use Taylor series to formalize accuracy?

ENAE684 - Computational Fluid Dynamics I Fall 2008 - James D. Baeder

Lecture #2 - 44

Summary Summary

  • Governing equations are derived using conservation principles and can be written either at a point (finite

difference) or over a control volume (finite volume). Conservation principles consider the change in a quantity

as made up of convective and diffusive fluxes as well as the volume and surface sources. Although, generally

in fluid mechanics, the Navier-Stokes equations are considered to be of primary importance for modeling

continuum flow it is often times more insightful and efficient to solve simple governing equations if possible.

  • In the simplest of cases, the governing equation can be simplified all the way from a system of nonlinear PDE

to a scalar linear PDE. In this class we will often times look at simplified model problems that mathematically

can be explained as representative of parabolic, hyperbolic and elliptic equations. Physically, these are

explained as diffusion (or dissipation), convection (or diffusion) and Poisson’s equation. Because of the

varying mathematics and physics represented by these different model equations we will often times develop

differing numerical methods. One also needs to consider both physical and numerical boundary conditions.

One can take advantage of the fact that complicated geometries can be handled through coordinate

transformations; therefore we will limit ourselves this semester to solve scalar PDE problems on equi-spaced

Cartesian meshes.

  • Mathematically, the differential operator is strictly defined and is unique. However, a difference operator is

non-unique and can vary according to the number of points used to derive the difference operator, the method

used to determine the coefficients associated with each of the points, the size of the mesh spacing and the level

of numerical precision. These choices will affect the accuracy of the solution (Taylor series) as well as

possibly affect the stability and convergence when these approximations are used to discretize a PDE into a set

of algebraic equations!

Not inNot in

ClassClass