Solution (source code)

= Solution

Let $D/Dt=\partial_t+\mathbf u\cdot\nabla$ be the <material derivative>, and write $h$ for <specific enthalpy>. The <ideal magnetohydrodynamic induction equation> and <Gauss's law for magnetism> give
$$
\frac{D\mathbf B}{Dt}=(\mathbf B\cdot\nabla)\mathbf u-\mathbf B\nabla\cdot\mathbf u.
$$
Dotting the momentum equation with $\mathbf B$ eliminates the <Lorentz force density>. Therefore the <cross-helicity> density satisfies
$$
\begin{aligned}
\frac{D(\mathbf u\cdot\mathbf B)}{Dt}
&=-\mathbf B\cdot\nabla\Phi-\frac{\mathbf B\cdot\nabla p}{\rho}
+\mathbf B\cdot\nabla\frac{u^2}{2}-(\mathbf u\cdot\mathbf B)\nabla\cdot\mathbf u.
\end{aligned}
$$
The <first law of thermodynamics> gives $dh=T\,ds+dp/\rho$ for <specific entropy> $s$, without requiring uniform <entropy>. Consequently
$$
\partial_t h_c+\nabla\cdot(\mathbf u h_c)
=-\mathbf B\cdot\nabla\left(h+\Phi-\frac{u^2}{2}\right)+T\mathbf B\cdot\nabla s.
$$
Since $\nabla\cdot\mathbf B=0$, the first term on the right is a <divergence>. This proves the <cross-helicity conservation law>, with flux
$$
\boxed{\mathbf F=\mathbf u(\mathbf u\cdot\mathbf B)+\mathbf B\left(h+\Phi-\frac{u^2}{2}\right).}
$$
For the <perfect gas> used here, $h=\gamma p/[(\gamma-1)\rho]$.