|
12 | 12 | # the filter handle (`./mfc.sh test --only Convergence`); convergence cases |
13 | 13 | # are skipped by default. |
14 | 14 |
|
15 | | -# Advection convergence cases use cell-shift mode by default: T = K*h per |
16 | | -# resolution, compare q(T) to np.roll(q(0), -K) per dim. Spatial error scales |
17 | | -# as T*h^p = h^(p+1), so measured rate = p+1 (p = scheme order). Wins ~10-100x |
18 | | -# vs running a full period since Nt = K*c/CFL is independent of N. |
19 | | -# WENO7/TENO7 stay in period mode: at typical N their cell-shift error hits |
20 | | -# machine precision (h^8 < 1e-15 at N=64) before any rate signal develops. |
| 15 | +# Advection convergence cases. Cell-shift mode: T = K*h per resolution, compare |
| 16 | +# q(T) to np.roll(q(0), +K) per dim. Cost is O(1) in N (Nt = K*c/CFL independent |
| 17 | +# of resolution) — wins ~10-100x vs period mode (full advection period). |
| 18 | +# WENO7/TENO7 stay in period mode: at typical N their cell-shift signal sinks |
| 19 | +# below machine precision (h^8 < 1e-15 at N=64) before any rate develops. |
| 20 | +# |
| 21 | +# expected_order is always the scheme's spatial order p. The runner subtracts |
| 22 | +# 1 from the displayed rate in cell-shift mode (where raw rate = p+1) so the |
| 23 | +# reported "spatial order" matches expected_order in both modes. |
21 | 24 | _CONS_VARS_1D = [("density", 1), ("x-momentum", 2), ("energy", 3)] |
22 | 25 | _CONS_VARS_2D = [("density", 1), ("energy", 4)] |
23 | 26 | _CONS_VARS_3D = [("density", 1), ("energy", 5)] |
24 | 27 |
|
25 | 28 | # (label, extra_args, expected_order, tol, resolutions) |
26 | | -# expected_order = scheme order p + 1 in cell-shift mode (T scales with h). |
27 | | -# WENO3-JS reduces to 2 at smooth extrema → cell-shift expected = 3. |
28 | | -# MUSCL2 unlimited central → effective order 2 → cell-shift expected = 3. |
| 29 | +# WENO3-JS at smooth extrema empirically achieves ~1.5 in MFC (Henrick mapping |
| 30 | +# enabled). MUSCL2 unlimited central → effective spatial order 2. |
29 | 31 | _CONVERGENCE_1D_SCHEMES = [ |
30 | | - ("WENO5", ["--order", "5", "--cfl", "0.02"], 6, 0.3, [32, 64, 128]), |
31 | | - ("WENO3", ["--order", "3", "--cfl", "0.02"], 2.5, 0.3, [64, 128, 256]), |
32 | | - ("WENO1", ["--order", "1", "--cfl", "0.02"], 2, 0.2, [64, 128, 256]), |
33 | | - ("MUSCL2", ["--muscl", "--muscl-lim", "0", "--cfl", "0.02"], 3, 0.3, [64, 128, 256]), |
34 | | - ("TENO5", ["--order", "5", "--teno", "--teno-ct", "1e-6", "--cfl", "0.02"], 6, 0.3, [32, 64, 128]), |
| 32 | + ("WENO5", ["--order", "5", "--cfl", "0.02"], 5, 0.3, [32, 64, 128]), |
| 33 | + ("WENO3", ["--order", "3", "--cfl", "0.02"], 1.5, 0.3, [64, 128, 256]), |
| 34 | + ("WENO1", ["--order", "1", "--cfl", "0.02"], 1, 0.2, [64, 128, 256]), |
| 35 | + ("MUSCL2", ["--muscl", "--muscl-lim", "0", "--cfl", "0.02"], 2, 0.3, [64, 128, 256]), |
| 36 | + ("TENO5", ["--order", "5", "--teno", "--teno-ct", "1e-6", "--cfl", "0.02"], 5, 0.3, [32, 64, 128]), |
35 | 37 | ] |
36 | 38 | # WENO7/TENO7 in 1D: period mode (full period T=1.0, see 1D case.py). |
37 | 39 | _CONVERGENCE_1D_PERIOD_SCHEMES = [ |
|
40 | 42 | ] |
41 | 43 |
|
42 | 44 | _CONVERGENCE_2D_SCHEMES = [ |
43 | | - ("WENO5", ["--order", "5", "--cfl", "0.02"], 6, 0.3, [32, 64, 96]), |
44 | | - ("WENO3", ["--order", "3", "--cfl", "0.02"], 2.5, 0.3, [32, 64, 128]), |
45 | | - ("WENO1", ["--order", "1", "--cfl", "0.02"], 2, 0.2, [32, 64, 128]), |
46 | | - ("MUSCL2", ["--muscl", "--muscl-lim", "0", "--cfl", "0.02"], 3, 0.3, [32, 64, 128]), |
47 | | - ("TENO5", ["--order", "5", "--teno", "--teno-ct", "1e-6", "--cfl", "0.02"], 6, 0.3, [32, 64, 96]), |
| 45 | + ("WENO5", ["--order", "5", "--cfl", "0.02"], 5, 0.3, [32, 64, 96]), |
| 46 | + ("WENO3", ["--order", "3", "--cfl", "0.02"], 1.5, 0.3, [32, 64, 128]), |
| 47 | + ("WENO1", ["--order", "1", "--cfl", "0.02"], 1, 0.2, [32, 64, 128]), |
| 48 | + ("MUSCL2", ["--muscl", "--muscl-lim", "0", "--cfl", "0.02"], 2, 0.3, [32, 64, 128]), |
| 49 | + ("TENO5", ["--order", "5", "--teno", "--teno-ct", "1e-6", "--cfl", "0.02"], 5, 0.3, [32, 64, 96]), |
48 | 50 | ] |
49 | 51 | _CONVERGENCE_2D_PERIOD_SCHEMES = [ |
50 | 52 | ("WENO7", ["--order", "7", "--cfl", "0.005"], 7, 0.5, [80, 96]), |
|
55 | 57 | # would dominate CI even at N=64). WENO7/TENO7 skipped — at N=64 with K=1 |
56 | 58 | # the spatial error signal is below machine precision. |
57 | 59 | _CONVERGENCE_3D_SCHEMES = [ |
58 | | - ("WENO5", ["--order", "5", "--cfl", "0.02"], 6, 0.3, [32, 64]), |
59 | | - ("WENO3", ["--order", "3", "--cfl", "0.02"], 2.5, 0.3, [32, 64]), |
60 | | - ("WENO1", ["--order", "1", "--cfl", "0.02"], 2, 0.2, [32, 64]), |
61 | | - ("MUSCL2", ["--muscl", "--muscl-lim", "0", "--cfl", "0.02"], 3, 0.3, [32, 64]), |
62 | | - ("TENO5", ["--order", "5", "--teno", "--teno-ct", "1e-6", "--cfl", "0.02"], 6, 0.3, [32, 64]), |
| 60 | + ("WENO5", ["--order", "5", "--cfl", "0.02"], 5, 0.3, [32, 64]), |
| 61 | + ("WENO3", ["--order", "3", "--cfl", "0.02"], 1.5, 0.3, [32, 64]), |
| 62 | + ("WENO1", ["--order", "1", "--cfl", "0.02"], 1, 0.2, [32, 64]), |
| 63 | + ("MUSCL2", ["--muscl", "--muscl-lim", "0", "--cfl", "0.02"], 2, 0.3, [32, 64]), |
| 64 | + ("TENO5", ["--order", "5", "--teno", "--teno-ct", "1e-6", "--cfl", "0.02"], 5, 0.3, [32, 64]), |
63 | 65 | ] |
64 | 66 |
|
65 | 67 | # Sod L1 self-convergence: any conservative monotone scheme converges at L1 |
|
0 commit comments