1-D Advection Equation Solver
Transport a pulse around a periodic one-dimensional domain with the linear advection equation. The solver chooses the upwind direction from the sign of velocity and plots how numerical diffusion changes the profile.
How this tool works
For v>0, first-order upwind uses uᵢⁿ⁺¹=uᵢⁿ−C(uᵢⁿ−uᵢ₋₁ⁿ), with C=vΔt/Δx and periodic indexing. A common stability condition is |C|≤1.
Example
Use a narrow Gaussian pulse at v=1. Over time the pulse moves to the right and gradually broadens because first-order upwind is numerically diffusive.
Common questions
Why does the pulse smear even when the CFL condition passes?
The first-order upwind method is stable but dissipative. Numerical diffusion broadens sharp gradients unless the grid is refined or a higher-order scheme is used.
What happens for negative velocity?
The solver reverses the upwind direction so information is taken from the physically upstream side.