Solution (source code)

= Solution

Let $E_B=\int_VB^2/(2\mu_0)\,dV$ be the total <magnetic energy>. Multiply the curl form of the <resistive induction equation> by $\mathbf B/\mu_0$ and integrate over the fixed volume. The identity
$$
\int_V\mathbf B\cdot\nabla\times\mathbf C\,dV=\int_V\mathbf C\cdot\nabla\times\mathbf B\,dV+\int_{\partial V}\mathbf n\cdot(\mathbf C\times\mathbf B)\,dS
$$
follows from the <divergence theorem>. The stated zero boundary fields remove its surface term. Applying it to the motional and resistive contributions yields the <magnetic energy balance in resistive magnetohydrodynamics>:
$$
\boxed{\dot E_B=\int_V(\mathbf u\times\mathbf B)\cdot\mathbf J\,dV-\frac\eta{\mu_0^2}\int_V|\nabla\times\mathbf B|^2\,dV
=-\int_V\mathbf u\cdot(\mathbf J\times\mathbf B)\,dV-\eta\int_VJ^2\,dV.}
$$
The first term is the negative of the mechanical power delivered to the fluid by the <Lorentz force density>. It transfers <energy> between fluid motion and the <magnetic field>, with either sign. The second is the nonpositive magnetic contribution to <Joule heating>. A nonzero positive <electrical resistivity> therefore dissipates <magnetic energy> at rate $\eta\int_VJ^2\,dV$; it does not force the total <magnetic energy> to decrease when fluid motion supplies a larger positive power.