Lax-Wendroff order of accuracy on Burgers equation

195 Views Asked by At

Statement of the problem

Is it possible to achieve the second order of convergence (OOC) of Lax-Wendroff scheme applied to solve inviscid Burgers equations with discontinuous initial data? If no, then how to achieve OOC of 2nd order in quasilinear problem?

Wolfram Mathematica code

(*Initial data*)
 u0[x_] := 1 - UnitStep[x - 0.1];
Flux[u_] := 0.5 u^2;
u = u0[xTbl];
dt = Abs[\[Sigma]] /Abs[Max[u]] dx;
un = 0*u;
F = Flux[u];

(*LW*)
t = 0;
While[t < tFin,
(*Main loop*)
un[[2 ;; nx - 1]] = u[[2 ;; nx - 1]] -
  0.50 \[Sigma] (F[[3 ;; nx]] - F[[1 ;; nx - 2]]) +
  0.25 \[Sigma]^2 ((u[[3 ;; nx]] + u[[2 ;; nx - 1]]) (F[[3 ;; nx]] - 
     F[[2 ;; nx - 1]]) - (u[[2 ;; nx - 1]] + 
     u[[1 ;; nx - 2]]) (F[[2 ;; nx - 1]] - F[[1 ;; nx - 2]]));
(*BC*)
un[[1]] = u[[1]];
un[[nx]] = u[[nx]];
(*Update*)
u = un;
F = Flux[u];
nstep = nstep + 1;
t = t + dt
];

Output

nx = {50, 100, 200, 400, 800};
L1err = {0.0217352, 0.0107321, 0.00533915, 0.00207726, 0.00132978};
p = {1.0181, 1.00725, 1.36192, 0.643502}

Average OOC equals

1.00769
0

There are 0 best solutions below