All the terms: $$ \partial_t {\bf q} + \nabla \cdot {\bf f} + A \cdot \nabla {\bf q} = \nabla \left( D \cdot \nabla {\bf q} \right) + {\bf s}. $$
In mergers
For $\partial_t q + \partial_x f = 0$ get local speed $$ \partial_t q + \color{red}{\partial_q f} \partial_x q = 0. $$
For system $\partial_t {\bf q} + A \partial_x {\bf q} = 0$ diagonalize to get $$ {\bf w} = L {\bf q}, \quad \partial_t {\bf w} + \Lambda \partial_x {\bf w} = 0. $$ Extend to nonlinear case with care.
Integrate over cell $i \to \hat{q}_i$: $$ \frac{\text{d}}{\text{d} t} \hat{q}_i + \frac{1}{|V_i|} \oint_{\partial V_i} f(q) = 0. $$ Restrict to one dimension: $$ \frac{\text{d}}{\text{d} t} \hat{q}_i = \frac{1}{\Delta x} \left[ f_{i-1/2} - f_{i+1/2} \right]. $$ Gives discrete conservation.
Godunov:
HLLE: to find $$ f_{i+1/2} = F(\hat{q}_i, \hat{q}_{i+1}) = F(q_L, q_R): $$
Godunov isn't good enough:
Rethink Godunov as three steps:
Reconstruction loses accuracy.
Fourier Series:
discontinuities $\implies$ oscillations.
Monotonicity: scheme doesn't introduce oscillations.
Godunov's theorem: linear monotonic schemes are first order accurate.
Assume $q(x) = \hat{q}_i + \tfrac{x - x_i}{2} \sigma$.
Slope $\sigma$ could be
All would give oscillations. Limit slope: $$ \bar{\sigma} \equiv \bar{\sigma}(\sigma_{\text{u}}, \sigma_{\text{d}}) \overset{\text{(eg)}}{=} \begin{cases} 0 & \text{if } \sigma_{\text{u}} \cdot \sigma_{\text{d}} \le 0 \\ \sigma_{\text{u}} & \text{if } | \sigma_{\text{u}} | < | \sigma_{\text{d}} | \\ \sigma_{\text{d}} & \text{if } | \sigma_{\text{u}} | > | \sigma_{\text{d}} | \end{cases}. $$
In $N$-d, finite volume needs a surface integral: expensive.
Instead, write a finite difference method as $$ \frac{\text{d}}{\text{d} t} q_i = \frac{1}{\Delta x} \left[ f_{i-1/2} - f_{i+1/2} \right]. $$ Now $f_{i \pm 1/2}$ not intercell fluxes. Directly reconstruct flux.
For stability must split flux: $$ f = f^{(+)} + f^{(-)}, \quad f^{(\pm)} = \tfrac{1}{2} \left( f \pm \max | \lambda | q \right). $$
Constraint ${\cal C} = \nabla \cdot {\bf B} = 0$ needed.
Either
Use vector potential ${\bf A}$, so ${\bf B} = \nabla \times {\bf A}$.
We have discussed
Next lecture: some aspects of the future.