I'm trying to follow an example problem from my class on fluid mechanics however I don't follow the solutions. I don't have much of a background in vector calculus unfortunately so I'm really struggling here. I was hoping that someone might be able to explain the steps to me in the simplest possible terms. Many thanks.
The question is as follows.
Consider the incompressible Navier–Stokes equations on a bounded domain $\mathbb{T}_d$ with periodic boundary conditions. The goal of this tutorial is to derive some energy estimates and achieve some fluency in performing these types of calculations.
Show that the Navier–Stokes equations can be expressed in the form $$\frac{\partial\mathbf{u}}{\partial t}+\mathbf{\omega}\times\mathbf{u}=\nu\Delta\mathbf{u}-\nabla(p+\frac{1}{2}|\mathbf{u}|^2)+\mathbf{f}$$
This is fine. Just use the identity: $\mathbf{u}\bullet\nabla\mathbf{u}=\frac{1}{2}\nabla(|\mathbf{u}|^2)-\mathbf{u}\times(\nabla\times\mathbf{u})$ in the standard form of the Navier-Stokes equations.
Directly compute $\frac{d}{dt}\|\mathbf{u}\|^2_{L^2}$
\begin{align} \frac{d}{dt}\frac{1}{2}\|\mathbf{u}\|^2_{L^2}=&\frac{1}{2}\int_{\mathbb{T}_d}\frac{\partial}{\partial t}(\mathbf{u}\bullet\mathbf{u})\;d\mathbf{x}\\ =&\frac{1}{2}\int_{\mathbb{T}_d}2\mathbf{u}\bullet\frac{\partial \mathbf{u}}{\partial t}\;d\mathbf{x}\\ =&\int_{\mathbb{T}_d}\mathbf{u}\bullet(-\mathbf{\omega}\times\mathbf{u}+\nu\Delta\mathbf{u}-\nabla(p+\frac{1}{2}|\mathbf{u}|^2)+\mathbf{f})\;d\mathbf{x}\\ =&-\nu\int_{\mathbb{T}_d}|\nabla\mathbf{u}|^2\;d\mathbf{x}+\int_{\mathbb{T}_d}(\mathbf{u}\bullet\mathbf{f})\;d\mathbf{x} \end{align}
The problem is that I don't follow the chain of equalities. My main concern is the 3rd to the 4th line. The explanation I'm given is that
$$\mathbf{u}\bullet(\mathbf{\omega}\times\mathbf{u})\equiv 0$$ I'm happy with that but I really don't understand the following two lines. $$\int_{\mathbb{T}_d}\mathbf{u}\bullet\nabla(p+\frac{1}{2}|\mathbf{u}|^2))\;d\mathbf{x}=\int_{\mathbb{T}_d}\nabla\bullet\mathbf{u}(p+\frac{1}{2}|\mathbf{u}|^2))\;d\mathbf{x}-\int_{\mathbb{T}_d}(\nabla\bullet\mathbf{u})(p+\frac{1}{2}|\mathbf{u}|^2))\;d\mathbf{x}=0$$ and $$\int_{\mathbb{T}_d}\mathbf{u}\bullet(\Delta\mathbf{u})\;d\mathbf{x}=\int_{\mathbb{T}_d}\nabla\bullet((\nabla\mathbf{u})\bullet\mathbf{u})\;d\mathbf{x}-\int_{\mathbb{T}_d}|\nabla\mathbf{u}|^2\;d\mathbf{x}=-\int_{\mathbb{T}_d}|\nabla\mathbf{u}|^2\;d\mathbf{x}$$
Then by the divergence theorem the divergence terms on the right are zero and using incompressibility we get line 4.
If anyone could explain the vector calculus of these lines I would be very greatful.
The first line uses the identity $\nabla \cdot (\phi \mathbf{u}) = \mathbf{u} \cdot \nabla \phi + \phi \nabla \cdot \mathbf{u},$ where $\phi = p + \frac1{2}|\mathbf{u}|^2.$
The second integral on the RHS vanishes by virtue of the solenoidal condition $\nabla \cdot \mathbf{u} = 0$ for an incompressible fluid.
An argument can be made that the first integral on the RHS must vanish as well. First apply the divergence theorem and recast as a surface integral over the boundary of $T_d$
$$\int_{\mathbb{T}_d}\nabla \cdot\left[\mathbf{u}\left(p+\frac{1}{2}|\mathbf{u}|^2\right)\right]\;d\mathbf{x}= \int_{\partial\mathbb{T}_d} \left(p+\frac{1}{2}|\mathbf{u}|^2\right)\mathbf{u} \cdot \mathbf{n} \, dS.$$
Evidently this surface integral vanishes as a consequence of the periodic boundary conditions. This is most easily visualized if $T_d$ is a cube where the sign of $\mathbf{u} \cdot \mathbf{n}$ must alternate between opposing faces -- since $\mathbf{n}$ is the outward-pointed unit normal vector.
A similar rationale applies to the second line.