Two-dimensional Advection#
The linear advection equation in 2-d is:
In conservative form, we’d write this as:
We can develop a finite volume method by defining an average as:
and our final update would look like (dropping the \(\langle \rangle\)):
where \(F^{(x)} = u a\) and \(F^{(y)} = v a\).
This can be solved using the same method-of-lines technique we did in 1-d, but now we need to create and manage a 2-d grid, fill ghost cells on both \(x\) and \(y\) boundaries, and compute fluxes through both \(x\) and \(y\) interfaces.
The flux computations are done simply by reconstructing in one coordinate direction and solving the Riemann problem in that direction.
The timestep limiter needs to be adapted a bit, and is now:
Try it#
Code up a 2-d advection solver and test it on advecting a Gaussian.