Topic4 Computational Fluid Dynamics

Document Sample

```					                           Topic 4: Computational Fluid Dynamics

Lecture 4-1: Burgers Equation

Monday, March 15, 2010

Contents

1 The equations of ﬂuid dynamics                                                                      2

2 One Dimensional Burgers’ Equation                                                                   4

2.1 Lax-Wendroﬀ algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   6

2.2 Godunov algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   7

1
1 THE EQUATIONS OF FLUID DYNAMICS

1   The equations of ﬂuid dynamics

The equations of ﬂuid dynamics follow from conservation of mass and momentum.

Consider a volume V inside the ﬂuid. The mass of ﬂuid in this volume is given by

ρ dV ,

where ρ is the ﬂuid density. The rate at which this mass decreases is determined by the rate at which ﬂuid
leaves the volume
d
ρ dV = − ρu · dS ,
dt
where u is the ﬂuid velocity and the integral on the right is taken over the surface of the volume with dS
being a surface element with direction along the outward normal. Using the divergence theorem

ρu · dS =           · ρu dV ,

we obtain the continuity equation
∂ρ
+      · ρu = 0 .
∂t
Next, consider conservation of momentum
du
ρ      =F,
dt

2
1 THE EQUATIONS OF FLUID DYNAMICS

which is just Newton’s equation of motion for an element of ﬂuid with unit mass. The total derivative on
the left has two contributions
du ∂u
=      + (u · )u ,
dt    ∂t
the ﬁrst term on the right represents the change in ﬂuid velocity with t at a ﬁxed point in space, and the
second advective term represents the change in ﬂuid velocity due to motion of ﬂuid from neighboring points
in space.

The force density F has three contributions:

• external or body forces acting on the ﬂuid, for example the force of gravity
Fgravity = ρg ,
where g is the acceleration due to gravity
• pressure forces due to neighboring ﬂuid elements

−      p dS = −        p dV ,

Fpressure = − p ,
where p is the ﬂuid pressure and the integrals are taken over the surface and volume of the element,
respectively
• viscous forces due to internal friction or shearing stresses in the moving ﬂuid
2
Fviscous = µ       u + (µ + ξ) (   · u) ,
3
2 ONE DIMENSIONAL BURGERS’ EQUATION

where µ is the dynamic viscosity coeﬃcient and ξ is the bulk viscosity coeﬃcient of the ﬂuid.

A special case that is interesting for many applications is that of incompressible ﬂow
ρ = constant ,         ·u=0.
Taking these forces into account results in the Navier-Stokes equations for incompressible viscous ﬂow:
∂u                      1        2
+u·      u=g−          p+ν        u,
∂t                      ρ
where ν = µ/ρ is the kinematic viscosity.

2   One Dimensional Burgers’ Equation

J.M. Burgers, Adv. Appl. Mech. 1, 171 (1948), introduced Burgers equation
∂u    ∂u   ∂ 2u
+u    =ν 2 ,
∂t    ∂x   ∂x
as a simple model of shock propagation.

This is basically a Navier-Stokes equation in one dimension without a pressure term. The convective term
on the left is nonlinear. The diﬀusive term on the right represents the eﬀects of viscosity.

4
2 ONE DIMENSIONAL BURGERS’ EQUATION

The development of a shock can be seen by letting the kinematic vicosity ν = 0. This gives the inviscid
Burgers’ equation
∂u       ∂u
+u     =0.
∂t      ∂x
Compare this with the linear equation
∂u     ∂u
+c      =0,
∂t     ∂x
where c is a constant. The linear equation has the solution
u(x, t) = f (x − ct) ,
where f is any diﬀerentiable function. This solution represents a wave form with shape f (x) moving to the
right with constant speed c.

Now, in the inviscid Burgers’ equation, the “speed” c = u, i.e., the instantaneous speed of the wave form
is proportional to its amplitude u. This implies that a peak in the wave travels faster than a trough, which
implies that the wave will tend to break.

Breaking of two-dimensional surface waves is of course very familiar, see for example, Hokusai’s Great Wave
Oﬀ Kanagawa.

In one dimension, breaking is not allowed mathematically beacuse breaking implies that the solution u(x, t)
becomes multiple valued. What actually happens is that a shock front develops: this is a moving point at
which the solution is discontinuous.

5
2 ONE DIMENSIONAL BURGERS’ EQUATION                                                  2.1 Lax-Wendroﬀ algorithm

The viscous term in Burgers’ equation has two eﬀects. First, it causes the wave amplitude to damp to zero
in a diﬀusive fashion. Secondly, it prevents the development of a mathematical singularity at the shock
front: the amplitude is continuous albeit varying very rapidly through the front.

The code burgers.cpp solves Burger’s equation using various algorithms.

2.1   Lax-Wendroﬀ algorithm

The Lax-Wendroﬀ algorithm is constructed in two steps. First, the time and convective derivatives are
expressed in terms of a ﬂow function F as follows:
∂u    ∂u ∂u ∂F                            1
+u    =    +    ,            F (x, t) = u2(x, t) .
∂t    ∂x   ∂t   ∂x                        2

This is the form of a conservation equation with F representing the current of the quantity u.

Second, a Taylor series expansion in the time step τ of all varables is made and terms up to and including
O(τ 2) are retained, e.g.,
∂u τ 2 ∂ 2u
u(x, t + τ ) = u(x, t) + τ    +      2
+ O(τ 3) .
∂t   2 ∂t

6
2 ONE DIMENSIONAL BURGERS’ EQUATION                                                          2.2 Godunov algorithm

The resulting algorithm can be expressed as a two-step formula:
1 n                τ
u∗ 1 =
j+
uj + un −
j+1
n
Fj+1 − Fjn +
2     2                 2h
ντ 1 n                           1
uj+1 + un − 2un + un + un − 2un
j−1       j                               ,
2h2 2                            2 j+2     j   j+1

τ   ∗         ∗       ντ
un+1
j     = un −
j       Fj+ 1 − Fj− 1 + 2 un + un − 2un .
j+1  j−1   j
h      2        2      h

2.2   Godunov algorithm

Among the most interesting and diﬃcult problems in computational ﬂuid dynamics is the simulation of
discontinuities like shock fronts. Simple ﬁnite diﬀerence schemes cannot handle this type of singular behavior.

Following the work of Godunov, Mat. Sb. 47, 271 (1959), which was based on his Ph.D. thesis, many
eﬀective shock-capturing schemes were developed for applications in astrophysics and the aerospace industry.

Godunov’s algorithm is based on exact solutions to the Riemann Problem

7
2 ONE DIMENSIONAL BURGERS’ EQUATION                                                        2.2 Godunov algorithm

u(x, 0)

x

A simple form of initial condition is a step function or piece-wise constant value for u(x, 0), for example
as shown in the ﬁgure. This type of initial condition deﬁnes a Riemann problem. Physically, this initial
condition represents a shock front which moves with constant speed c without changing its shape.

Even though this is such a simple problem with a simple solution, it is very diﬃcult to simulate numerically.

The reason for this is that the derivative ∂u/∂x is inﬁnite at the discontinuity: mathematically it is a delta
function.

8
2 ONE DIMENSIONAL BURGERS’ EQUATION                                                            2.2 Godunov algorithm

Most ﬁnite diﬀerence schemes assume that the solution is smooth, i.e., the derivatives are bounded, so that
a Taylor series expansion in the spatial step size h is valid.

When this assumption is violated by a discontinuity, a ﬁrst order scheme tends to smear out the discontinuity,
and including higher orders results in unstable oscillations of the solution at the position of the discontinuity.

Godunov’s formula for updating u is
τ                    ντ
un+1 = un −
j      j        Fj+ 1 − Fj− 1 + 2 [uj+1 + uj−1 − 2uj ] ,
h      2        2    h
where Fj± 1    represents the average ﬂux on the cells to the right and left of the lattice point j respectively.
2

These average ﬂux values are computed from Riemann problems in the cells to the right and left of j using
upwind initial data
(+)    uj if uj > 0       (−)    uj if uj < 0
uj =                      uj =
0 otherwise               0 otherwise

The solution to the Riemann problem on the left cell is
1 (+) 2 1 (−) 2
Fj− 1 = max      (u ) , (u )               ,
2         2 j−1 2 j
and for the cell on the right
1 (+)    2       1 (−)   2
Fj+ 1 = max       u          ,     u             .
2           2 j              2 j+1

9
REFERENCES                                                                                  REFERENCES

References

[Recipes-C19-5] W.H. Press, S.A. Teukolsky, W. Vetterling, and B.P. Flannery, “Numerical Recipes in C”,
Chapter 19 §5: Relaxation Methods for Boundary Value Problems,
http://www.nrbook.com/a/bookcpdf/c19-5.pdf.

10

```
DOCUMENT INFO
Shared By:
Categories:
Stats:
 views: 42 posted: 6/1/2010 language: English pages: 10