Skip to content

docs: Add Non-Uniform WENO Showcase - #616

Merged
ChrisRackauckas merged 3 commits into
SciML:masterfrom
utkuyilmaz1903:capstone-test
Aug 6, 2026
Merged

ChrisRackauckas merged 3 commits into
SciML:masterfrom
utkuyilmaz1903:capstone-test

Conversation

@utkuyilmaz1903

@utkuyilmaz1903 utkuyilmaz1903 commented Aug 4, 2026 •

Copy link
Copy Markdown
Member

Summary

Final piece of the non-uniform WENO GSoC work: a quantitative showcase of what the new infrastructure buys, plus two small regression tests covering the regimes it exercises.

Docs: new tutorial page (docs/src/tutorials/weno_showcase.md)

Two problems with exact solutions, both advection-dominated with steep-but-smooth profiles:

Part A — Stationary viscous shock (viscous Burgers, ν = 2e-3). Starting from the exact tanh steady state, the scheme must hold an O(ν)-wide interior layer in place for t = 1.

  • WENO on a density-clustered grid, N = 129: relative L2 error ≈ 1e-4, overshoot at the 1e-8 level.
  • WENO on a uniform grid needs N = 257 to even be stable, and is still ~2 orders of magnitude worse.
  • First-order upwind does not converge at all in this range: its numerical viscosity exceeds the physical ν until N ≳ 1000.
01_layer_after_t1 02_accuracy_per_grid_point

Uniform WENO appears as a single point because the N = 129 uniform run is unstable (the sub-cell layer aborts the integration) — under-resolution is a failure regime, not a small-error regime.

Part B — Front crossing a two-domain interface into a porous region (flow-battery-inspired). A concentration front compresses 2x as a variable velocity v(x) slows it down, crossing the seam onto an independently generated, ~2x finer grid. Against the exact characteristic solution:

  • seam continuity at machine precision (the interface identification is algebraic);
  • solution bounded in [0, 1] to within 1e-3 while the steep front crosses grids;
  • weighted L2 error < 1e-2 at both checkpoints, beating an evenly split uniform pair at equal total points.
03_front_compression

The page also documents limitations explicitly: non-conservative form (Hou–LeFloch — not a shock-tube solver), mismatched-grid interfaces support first-order derivatives only, and under-resolution being a failure regime rather than a small-error regime.

Tests: two compact regression blocks, no new files (~1.5 min added to Convection_WENO)

  • MOL_1D_WENO_NU_Convergence.jl: mixed WENO advection + centered diffusion on the same variable, on a strongly clustered grid (viscous shock held for t = 1).
  • MOL_1D_WENO_NU_Interface.jl: variable-coefficient advection across a mismatched non-uniform interface.

These are the two operator/interface combinations not covered by the existing convergence and interface tests.

@utkuyilmaz1903
utkuyilmaz1903 marked this pull request as ready for review August 4, 2026 09:29
Comment thread docs/src/tutorials/weno_showcase.md Outdated

an interior layer of width ``O(\nu)`` pinned at ``x = 0`` — the finite-difference prototype of a steep interfacial gradient. With ``\nu = 2 \times 10^{-3}`` the layer is ``\sim 0.01`` wide: a uniform grid needs thousands of points to see it, yet 98% of those points sit in regions where the solution is essentially constant.

The test protocol: start *from* the exact steady state and integrate to ``t = 1``. A perfect scheme holds the layer exactly; a real scheme smears it, shifts it, or rings around it, and the error against ``u_\infty`` measures precisely that. (Starting from a smeared initial profile instead would measure the metastable, ``O(e^{c/\nu})``-slow layer relaxation of viscous Burgers — a property of the physics, not of the discretization.)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"real scheme", you mean an inaccurate scheme, or a finite difference scheme?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that was vague. Meant any discretization, not FD specifically. Reworded.

Comment thread docs/src/tutorials/weno_showcase.md Outdated

- **First-order upwind** replaces the physical viscosity ``\nu`` with its own numerical viscosity ``\sim u\,\Delta x / 2 \approx 8 \times 10^{-3} \gg \nu`` and relaxes the layer to the corresponding *wrong* width.
- **Uniform WENO at N=257** barely fits the layer into one cell. It stays non-oscillatory (the WENO weights see the layer as a near-discontinuity), but accuracy is limited — and on the *N=129* uniform grid the sub-cell layer is not even stable to integrate. Under-resolution is not a small-error regime; it is a failure regime.
- **Clustered WENO at N=129** resolves the layer with ``\sim 25`` points and holds it to a relative error of ``\sim 10^{-4}`` — two orders of magnitude better than the uniform grid with *twice* the points, with the largest overshoot at the ``10^{-8}`` level.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should describe how you're choosing the non-uniformity? Where are you clustering the points and why, in order to achieve this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a paragraph right after the density definition. Doing this without a-priori feature knowledge is tracked in #610, which could make this much more powerful down the line.

@ChrisRackauckas

Copy link
Copy Markdown
Member

Looks amazing! Just a few small comments.

@ChrisRackauckas

Copy link
Copy Markdown
Member

The docs build dies, but I don't think it's this.

@ChrisRackauckas
ChrisRackauckas merged commit 3f45b34 into SciML:master Aug 6, 2026
55 of 66 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants