I am learning the theory behind DG-FEM methods using the Hesthaven/Warburton book and I am a bit confused about the role of the 'numerical flux.' I apologize if this is a basic question, but I have looked and not found a satisfactory answer to it.
Consider the linear scalar wave equation: $$\frac{\partial u}{\partial t} + \frac{\partial f(u)}{\partial x} = 0$$ where the linear flux is given as $f(u) = au$.
As introduced in Hesthaven's book, for each element $k$, we end up with $N$ equations, one for each basis function, enforcing that the residual vanishes weakly:
$$R_h(x,t) = \frac{\partial u_h}{\partial t} + \frac{\partial au_h}{\partial x}$$
$$\int_{D^k} R_h(x,t) \psi_n(x) \, dx = 0 $$
Fine. So we go through integration by parts once to arrive at the 'weak form' (1) and integrate by parts twice to get the 'strong form' (2). I will adopt Hesthaven's sort-of-overkill but easily generalized surface integral form in 1D:
(1) $$ \int_{D^k} \left( \frac{\partial u_h^k}{\partial t} \psi_n-au_h^k\frac{d \psi_n}{d x} \right)\, dx = - \int_{\partial D^k} \hat{n}\cdot(au_h)^*\psi_n \,dx \qquad 1 \leq n\leq N$$
(2) $$ \int_{D^k} R_h \psi_n\, dx = \int_{\partial D^k} \hat{n}\cdot \left( au_h^k-(au_h)^* \right)\psi_n \,dx \qquad 1 \leq n\leq N $$
Why do we choose a numerical flux? Why don't we use the value of $au_h^k$ at the boundary in (1) instead of using a flux? Yes, it's true that the value of this quantity may be multiply defined across elements, but each equation is only over 1 element $D^k$, so why does this matter?
Further, the boundary term of the second integration by parts clearly yields a different quantity $au_h^k$ the second time in (2), which makes no sense to me. We are doing the same operation! Why wouldn't the two boundary terms just cancel, making (2) useless? How have we introduced new information?
Clearly I am missing something crucial to the method, and I would like to fix this. I have done some real and functional analysis, so if there is a more theory-based answer regarding the formulation, I would like to know!