upwind_1st

Family
finite_difference
Grid family
cartesian
Kind
scheme
Accuracy
O(dx)
Applies to
grad(u), dim=x
Rule file
discretizations/finite_difference/upwind_1st.json
Tags
#finite-difference #upwind #uniform #first-order

Stencil

upwind_1st stencil — −1/dx at i−1, +1/dx at i
One-sided upwind stencil. The branch shown corresponds to the positive-velocity case (information flowing from i−1 to i); the negative-velocity branch is the mirror image (offsets 0 and +1 with sign-flipped coefficients).

Coefficients

selector kindaxisoffsetcoeff
cartesian$x−1−1 / dx
cartesian$x0+1 / dx

Combined as +. Adds an explicit (dx/2) · u′′(x) numerical-diffusion term; this stabilizes advection-dominated problems but is the source of well-known upwind smearing.

Convergence

Empirical convergence — slope ≈ −1
L∞ error of upwind-1 on u(x) = sin(2πx) with N up to 512. The slope cleanly matches the expected −1 reference.

Fixture: discretizations/finite_difference/upwind_1st/fixtures/convergence/