Well, you're right that the term div(grad(u_mid))
is redundant for CG1 elements. But it is included to keep r
looking as the residual of the strong advection-diffusion equation. You can also increase order of an element and r
will still be valid.
Added stabilization term is consistent, i.e. it takes zero value for exact solution. You can derive it by integration by parts on every cell separately. (Note that you are not able to do this integration by parts globally because you lack regularity. But stabilization term is just cell-wise integral - it does not take into account potential Dirac-$\delta$ on facets.)
Further reading:
T. E. TEZDUYAR: Stabilized Finite Element Formulations for Incompressible Flow Computations. ADVANCES IN APPLIED MECHANICS. VOLUME 28 (1992) 1-44.
Tayfun Tezduyar and Sunil Sathe: STABILIZATION PARAMETERS IN SUPG AND PSPG
FORMULATIONS. Journal of Computational and Applied Mechanics, Vol. 4., No. 1., (2003), pp. 71-88.