PW #2: Burgers equation
Given a scalar conservation law, there exist several schemes to solve the equation. But the solutions provided by these algorithms are not equivalent. For instance, it is relevant to compare accuracy on equiv- alent meshes, computational costs and time, stability or consistency conditions, and so on. This work is thus devoted to comparing some numerical schemes when solving theBurgersequation:
∂tu+∂xF(u)=0, (1a)
with:
F(u)=u2
2 . (1b)
This problem is restricted to theperiodic boundary condition casein the present work.
Let us introduce the homogeneous cartesian meshxj = j∆xfor a given mesh size∆x. The natural framework for solving Syst. (1) consists in defining cells of whichxjis the middle. Consequently, we note xj+1/2 =¡
j+12¢
∆x such thatxj is the middle ofIj =]xj−1/2,xj+1/2[. Likewise, the time discretization is denoted bytn=n∆t,∆t>0. The approximation of the solutionuatxj andtnisunj (the unknowns are located in the center of the cells).
1 Non-conservative schemes
Provided that the solutionuis smooth enough, Eq. (1a) may be rewritten as:
∂tu+u∂xu=0. (2)
On the one hand, given this new formulation, we can derive a natural scheme aiming at solving Eq. (2):
unj+1−unj
∆t +unj
unj −unj−1
∆x =0, if unj ≥0, (3a) un+1j −unj
∆t +unj
unj+1−unj
∆x =0, if unj <0. (3b) This scheme will be referred to as theupwind non-conservative scheme.
On the other hand, Eq. (2) may be considered as a transport equation for which the velocity field is unknown. Themethod of characteristics(MOC) provides a classical scheme for this kind of equations. It consists in tracking particules in their motion due to the velocity field (characteristic curves) in order to keep track of relevant values. More precisely, we introduce the characteristic flow as the solution to the
ODE: dX
dt =u¡
t,X(t;s,x)¢
, X(s;s,x)=x.
This flow represents the position at time t of a particule located in x at times. Under smoothness as- sumptions onu, the existence (and uniqueness) of the solutionX is guaranteed by the Cauchy-Lipschitz
The MOC relies on the following remark. Ifuis a solution to Syst. (1), then:
d dt
£u¡
t,X(t;s,x)¢¤
=0.
This means thatuis constant along characteristic curves:
u¡
t,X(t;s,x)¢
=u(s,x).
This leads to the scheme (takingt=tn,s=tn+1andx=xj):
unj+1=uˆn(ξnj), ξnj ≈X(tn;tn+1,xj). (4a) This scheme hence consists in two steps:
• Time step: resolution of the ODE forX on [tn,tn+1]. A 1st-order approximation is:
ξnj =xj−unj∆t. (4b)
• Space step: after localizingξnj in the interval [xk,xk+1), this step is based on a spatial interpolation using valuesunk andunk+1. More precisely:
un+1j =
xk+1−ξnj
∆x unk+1+ξnj−xk
∆x unk. (4c)
This scheme is nonlinear but unconditionally stable.
2 Conservative schemes
Among schemes solving Syst. (1), there exists a class called “conservative schemes” due to aL1-norm con- servation principle. They read:
un+1j −unj
∆t +
Fnj+1/2−Fjn−1/2
∆x =0, (5a)
whereFj+1/2n is the numerical flux. This term comes from the finite volume framework. Indeed, when integrating Eq. (1a) over [tn,tn+1]×[xj−1/2,xj+1/2], we get:
Un+1j −Unj + Z tn+1
tn
£F¡
u(t,xj+1/2)¢
−F¡
u(t,xj−1/2)¢¤
dt=0,
where the fluxes at the boundary of the cells appear. We get intersted in the sequel in numerical fluxes of the type:
Fnj+1/2=F(unj,unj+1), (5b) for every fluxFsatisfying the consistency conditionF(u,u)=F(u).
Here are several possible fluxes:
• Upwind conservative scheme:
Fupw(unj,unj+1)=
F(unj) ifunj ≥0, F(unj+1) ifunj <0.
• Lax-Friedrichs:
FLF(unj,unj+1)=1 2
¡F(unj)+F(unj+1)¢
− ∆t 2∆x
¡unj+1−unj¢ .
• Richtmyer-Lax-Wendroff:
FLW(unj,unj+1)=F(un+1/2j+1/2), whereun+1/2j+1/2 =1 2
¡unj+1+unj¢
− ∆t 2∆x
¡F(unj+1)−F(unj)¢ .
• MacCormack:
FMcC(unj,unj+1)=1 2
hF(unj+1)+F(un+1/2j )i
, whereun+1/2j =unj−∆t
∆x
¡F(unj+1)−F(unj)¢ .
• Godunov: the idea of the Godunov scheme relies on a piecewise constant approximation over cells.
More precisely, we consider at timetnthe function ˆunsuch that ˆun(tn,x)=Unj ifx∈Ij.Ujndenotes the mean value of the approached solution ˆun at timetn over the cellIj. To progress in time, we introduce Riemann problems at each interfacexj+1/2. Letwbe the solution to the Riemann model problem:
∂tw+∂xF(w)=0, w(0,x;uL,uR)=
uL ifx<0, uR ifx>0.
Integrating Eq. (1a) over [tn,tn+1]×Ij, the Godunov scheme writes as (5a) with:
F(unj,unj+1)= 1
∆t Z tn+1
tn F¡ ˆ
un(t,xj+1/2)¢
dt=F¡ ˆ
un(tn+1,xj+1/2)¢ ,
for ˆun(tn+1,xj+1/2)=w(∆t, 0;Unj,Unj+1). For theBurgersequation, the solution to the Riemann prob- lem is a similarity solution and readsw(t,x;uL,uR)=wˆ³x
t;uL,uR
´ where:
w(ξ;ˆ uL,uR)=
uL ifξ≤uL, ξ ifuL<ξ<uR, uR ifξ≥uR, ifuL≤uRand:
ˆ
w(ξ;uL,uR)=
uL ifξ≤σ, uR ifξ>σ,
3 Kinetic scheme
A scheme may be obtained by considering Syst. (1) as the limit of the following kinetic equation when ε→0:
∂tf +a(v)∂xf =1 ε
¡χu(v)−f¢
, (6a)
with:
a(v)=F0(v). (6b)
The functionχu(v) is defined by:
χu(v)=
1 if 0<v<u,
−1 ifu<v<0, 0 otherwise,
(7)
and the unknows of Syst. (1) and Syst. (6) are linked by the relationship:
u(x,t)= Z
Rf(x,v,t)d v. (8)
We use a spliting scheme to approach the solution of Syst. (6):
• Step 1: Linear transport step
∂tf +a(v)∂xf =0. (9)
We consider here an upwind scheme:
fn+
1 2
j (v)=fjn(v)−∆t
∆x
ha+(v)³
fjn(v)−fj−1n (v)´
−a−(v)³
fj+1n (v)−fjn(v)´i
(10) wherea+(v)=max(a(v), 0) anda−(v)=max(−a(v), 0).
• Step 2: Collision step
∂tf =1 ε
¡χu−f¢
. (11)
Whenε→0, this step reduces to f =χuand thus, the second step of the scheme consists in solving:
fjn+1(v)=χ
un+
1 2 j
(v), (12)
whereun+
1 2
j =
Z
Rfn+
1 2
j (v)d v. Noting thatun+1j =
Z
Rfjn+1(v)d v = Z
Rχ
un+
12 j
(v)d v=un+
1 2
j , we can now return to variables of interest, that isunj. Integrating Eq. (10) with respect tov∈Ryields an equation of the form (5a) where the fluxFjn+1/2 is defined by:
Fj+1/2n = Z
Ra+(v)χunj−a−(v)χunj+1d v.
4 Directions
You may consider the periodic domain [0, 2] and three initial conditions for theBurgersequation:
• u01(x)=x;
• u02(x)=1[1/4,3/4](x);
• u03(x)=exp
µ−(x−1/2)2 x(1−x)
¶
1(0,1)(x).
You may implement 1 non-conservative scheme, 3 conservative schemes and the kinetic scheme. In each case, try to highlight theCFL condition.
Eventually, compare the solutions to Syst. (1) and the ones to:
∂tv+∂xFˆ(v)=0,
withv=u2and ˆF(v)=23v3/2. These equations are equivalent in the smooth case.
You may deliver your results electronically at latest onFebruary 6, 2011.
([email protected]@inria.fr)