1. The advection equation in DG form
For the linear advection problem
[
u_t+u_x=0 ,\qquad x\in\Omega=[0,1],;t>0 ,
]
the discontinuous‑Galerkin (DG) formulation is obtained by multiplying the
equation by a test function (v) that is allowed to be discontinuous at the
element interfaces, integrating over an element (K) and integrating by parts:
[
\int_K u_t,v,dx-\int_K u,v_x,dx+[u,v]_{\partial K}=0 .
]
The boundary term is replaced by a numerical flux (F(u^-,u^+)) that
depends on the values of (u) on the two sides of the interface.
For the constant‑speed advection problem the upwind flux is
[
F(u^-,u^+)=
\begin{cases}
u^- , & \text{if the speed }a>0,\[2pt]
u^+ , & \text{if }a<0 .
\end{cases}
]
With (a=1) we always take the left (upwind) value.
2. Collocation DG = spectral element method
In the collocation (or nodal) DG method we choose as basis the
Lagrange polynomials ({\ell_j(x)}_{j=0}^N) that are 1 at the
collocation point (x_j) and 0 at all other points.
The solution in an element (K) is represented as
[
u_h(x,t)=\sum_{j=0}^N u_j(t),\ell_j(x) .
]
The derivative of the basis functions at the collocation points is
assembled into the differentiation matrix
[
D_{ij}= \ell_j'(x_i), \qquad i,j=0,\dots,N .
]
If we simply inserted this matrix into the semi‑discrete equations we would
obtain a central derivative everywhere – the same as a high‑order
finite‑difference scheme.
The key point is that the flux term coming from the boundary integral
modifies the equations at the two end nodes of each element.
3. Semi‑discrete equations
Let (u_i(t)) denote the coefficient at node (x_i) in element (K).
Choosing the test function (v=\ell_i) and using the collocation property
(\int_K \ell_j,\ell_i,dx = w_j,\delta_{ij}) (with (w_j) the quadrature
weights) gives
[
\frac{d u_i}{dt}
= -\sum_{j=0}^N D_{ij},u_j
- \frac{1}{h_K}\Bigl( F_{i+1/2}-F_{i-1/2}\Bigr),
\qquad i=0,\dots,N ,
]
where (h_K) is the element length and
[
F_{i+1/2}=
\begin{cases}
u_i^- , & a>0,\
u_{i+1}^+ , & a<0 .
\end{cases}
]
Because the collocation points include the element endpoints
((x_0) and (x_N)), the fluxes only affect the boundary nodes:
-
Interior nodes ((i=1,\dots,N-1))
[
\frac{d u_i}{dt}= -\sum_{j=0}^N D_{ij},u_j .
]
The derivative is the full spectral derivative – a central operator.
-
Left boundary node ((i=0))
[
\frac{d u_0}{dt}= -\sum_{j=0}^N D_{0j},u_j
- \frac{1}{h_K}\bigl( u_0^- - F_{-1/2}\bigr).
]
For (a>0) the numerical flux at the left face is the upwind value
from the neighbouring element, (F_{-1/2}=u_{\text{left}}^+).
Thus the term (-F_{-1/2}) replaces the contribution that would have
come from the downwind side, turning the derivative at this node into
a one‑sided difference.
-
Right boundary node ((i=N))
[
\frac{d u_N}{dt}= -\sum_{j=0}^N D_{Nj},u_j
- \frac{1}{h_K}\bigl( F_{N+1/2} - u_N^-\bigr).
]
Again, for (a>0) the flux (F_{N+1/2}=u_{\text{right}}^-) is the
upwind value from the right element, so the derivative at the right
node becomes one‑sided.
In matrix form the semi‑discrete system can be written as
[
\frac{d\mathbf{u}}{dt}= -\bigl( D - \frac{1}{h_K}B \bigr)\mathbf{u},
]
where (B) is a sparse matrix that contains only the two boundary rows
and implements the upwind flux.
The operator (A=D-\frac{1}{h_K}B) is not a pure central
derivative: at the element interfaces it contains the one‑sided
contributions that guarantee stability.
4. Intuition
-
Inside an element the polynomial is smooth, so the spectral derivative
(D) is a very accurate (essentially exact for the polynomial
representation) approximation of the spatial derivative.
-
At an element interface the polynomial is discontinuous.
The DG method does not try to differentiate across the jump; instead
it replaces the derivative by a numerical flux that uses only the
information from the upwind side.
This is exactly what a one‑sided derivative does in a finite‑difference
scheme.
-
Consequently, the derivative operator is central in the interior of
each element and one‑sided at the boundaries.
The collocation DG method therefore behaves like a high‑order
finite‑difference scheme with upwind fluxes at the element interfaces.
5. Practical implications
-
Stability – The upwind flux introduces the necessary numerical
dissipation at the interfaces, which is why the collocation DG method
is stable for pure advection.
-
Accuracy – The interior derivative is spectral (high‑order),
while the interface treatment is only first‑order accurate.
However, because the interface error is confined to a set of measure
zero (the element faces), the overall scheme remains high‑order.
-
Implementation – In code one usually builds the differentiation
matrix once per element, then adds the flux contributions only to the
first and last rows.
The resulting matrix is block‑diagonal with small dense blocks
(the differentiation matrices) plus a sparse coupling through the
fluxes.
-
Extensions – The same idea works in multiple dimensions,
on curved elements, with variable coefficients, and with higher‑order
time integrators. The flux term is always the only place where the
upwind/downwind choice appears.
6. Bottom line
The collocation DG method for the advection equation is a high‑order
spectral element method in which the interior derivative is computed
by a full differentiation matrix (central), while the boundary nodes
receive a correction that implements the upwind flux. This correction
turns the derivative at the element interfaces into a one‑sided
operator, exactly as in a finite‑difference upwind scheme. The
combination of a central derivative inside each element and an
upwind flux at the interfaces gives the method its stability and
accuracy.