diff options
author | Ian Hinder <ian.hinder@aei.mpg.de> | 2010-09-30 20:55:45 +0200 |
---|---|---|
committer | Ian Hinder <ian.hinder@aei.mpg.de> | 2010-09-30 20:55:45 +0200 |
commit | 479530a00b62a629c923ab22387949e55ac9a2e8 (patch) | |
tree | 864e296e23ed6853b666622eaa8151befa79dcd6 /Examples/Euler.m | |
parent | 360447ee27288198b70c30bf2f2f10ace3dc29b9 (diff) |
Euler.m: Add van Leer slope limiter
Diffstat (limited to 'Examples/Euler.m')
-rw-r--r-- | Examples/Euler.m | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Examples/Euler.m b/Examples/Euler.m index 75f678f..e3c22ad 100644 --- a/Examples/Euler.m +++ b/Examples/Euler.m @@ -184,6 +184,15 @@ minmodVar[v_, i_, vLeft_, vRight_] := vRight -> v + 0.5 slope } +vanLeerVar[v_, i_, vLeft_, vRight_] := +{ + slopeL -> DiffMinus[v, i], + slopeR -> DiffPlus[v, i], + slope -> VanLeer[slopeL, slopeR], + vLeft -> v - 0.5 slope, + vRight -> v + 0.5 slope +} + reconstructCalc[i_] := { Name -> "euler_reconstruct_" <> ToString[i], @@ -194,11 +203,11 @@ reconstructCalc[i_] := ApplyBCs -> True, Equations -> Flatten[{ - minmodVar[rho,i, rhoLeft, rhoRight], + vanLeerVar[rho,i, rhoLeft, rhoRight], Flatten[Table[ - minmodVar[v[j], i, Symbol["vLeft"<>ToString[j]], + vanLeerVar[v[j], i, Symbol["vLeft"<>ToString[j]], Symbol["vRight"<>ToString[j]]], {j, 1, 3}],1], - minmodVar[p,i, pLeft, pRight] + vanLeerVar[p,i, pLeft, pRight] },1] }; |