Skip to content

Commit

Permalink
Burgers.m: Correct sign errors, fix minmod and add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhinder committed Sep 29, 2010
1 parent 18adf96 commit eef77e0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Examples/Burgers.m
Expand Up @@ -83,6 +83,11 @@
(* Evolution equations *)
(**************************************************************************************)

(* Burger's equation is dot[u] + PD[F,x] = 0
with F[ui] = 1/2 u^2
*)

burgersFlux[u_] := 1/2 u^2;

zeroRHSCalc[] :=
Expand All @@ -107,7 +112,7 @@
{
slopeL -> DiffMinus[u, i],
slopeR -> DiffPlus[u, i],
slope -> IfThen[Abs[slopeL] < Abs[slopeR], slopeL, slopeR],
slope -> IfThen[slopeL slopeR < 0, 0, IfThen[Abs[slopeL] < Abs[slopeR], slopeL, slopeR]],
uLeft -> u - 0.5 slope,
uR -> u + 0.5 slope
}
Expand All @@ -121,7 +126,7 @@
Schedule -> {"in MoL_CalcRHS after burgers_reconstruct_" <> ToString[i]},
Equations ->
{
uF -> 1/2 (f[uLeft] + f[ShiftMinus[uR,i]] + alpha (uLeft - ShiftMinus[uR,i]))
uF -> 1/2 (f[uLeft] + f[ShiftMinus[uR,i]] + alpha (ShiftMinus[uR,i] - uLeft))
}
};

Expand All @@ -132,7 +137,7 @@
Where -> Interior,
Equations ->
{
dot[u] -> dot[u] + PDplus[uF, i]
dot[u] -> dot[u] - PDplus[uF, i]
}
};

Expand Down

0 comments on commit eef77e0

Please sign in to comment.