Solution (source code)

= Solution

For an axisymmetric <magnetic field>, the solenoidal condition becomes $\partial_R(RB_R)+\partial_z(RB_z)=0$. Locally introduce a <poloidal magnetic flux function> $\Psi$ by
$$
\boxed{B_R=-\frac1R\partial_z\Psi,\qquad B_z=\frac1R\partial_R\Psi,\qquad
\mathbf B_p=\nabla\Psi\times\nabla\phi.}
$$
The divergence condition is exactly the integrability condition for these two derivatives. The additive constant in $\Psi$ fixes the reference flux. For a field regular on the axis choose $\Psi(0,z,t)=0$. Then the <magnetic flux> through a horizontal disk of radius $R$ is $2\pi\Psi(R,z,t)$, and the flux between two such surfaces is $2\pi\Delta\Psi$.

Since $\mathbf B_p\cdot\nabla\Psi=0$ and $\partial_\phi\Psi=0$, the level surfaces of $\Psi$ contain the complete <magnetic field>, including its <toroidal magnetic field> component. Thus regular levels are <poloidal flux surfaces>. Their meridional contours trace the projected field lines. The representation is local on regular regions; disconnected flux surfaces with the same label need not share additional physical data.

The azimuthal component of $\mathbf u\times\mathbf B$ is $u_zB_R-u_RB_z=-\mathbf u_p\cdot\nabla\Psi/R$. The <ideal magnetohydrodynamic induction equation>, equivalently Faraday's law with $\mathbf E=-\mathbf u\times\mathbf B$, gives $\Psi_t=R(\mathbf u\times\mathbf B)_\phi$ up to a time-dependent reference constant. Fixing that reference gives the <material advection of an axisymmetric magnetic flux function>:
$$
\boxed{\partial_t\Psi+\mathbf u_p\cdot\nabla\Psi=0,\qquad D\Psi/Dt=0.}
$$
Axisymmetry removes the azimuthal contribution to the <material derivative>. This is <magnetic flux freezing> expressed using one scalar flux label.

The azimuthal component itself is generally not an advected scalar. Including the cylindrical basis-vector derivatives in the induction equation gives
$$
\frac{DB_\phi}{Dt}=R\mathbf B_p\cdot\nabla\left(\frac{u_\phi}{R}\right)
 +\frac{u_R}{R}B_\phi-B_\phi\nabla\cdot\mathbf u.
$$
Using <mass conservation>, $D\rho/Dt=-\rho\nabla\cdot\mathbf u$, and $DR/Dt=u_R$, this becomes the <toroidal magnetic-field winding equation>:
$$
\boxed{\frac D{Dt}\left(\frac{B_\phi}{\rho R}\right)
=\frac{\mathbf B_p}{\rho}\cdot\nabla\Omega,\qquad \Omega=u_\phi/R.}
$$
Thus $B_\phi/(\rho R)$ is conserved following the flow if the <angular velocity> is constant along the <poloidal magnetic field>, including the case of no rotation. Otherwise differential rotation winds poloidal field into toroidal field.

There is also an explicit flux-conservation form,
$$
\partial_tB_\phi+\partial_R(u_RB_\phi-u_\phi B_R)
+\partial_z(u_zB_\phi-u_\phi B_z)=0.
$$
Integrating this over a meridional region converts its change of toroidal flux to boundary terms. Hence such a flux is conserved when the indicated boundary transport vanishes. More generally <magnetic flux freezing> conserves flux through every material surface, but a meridional coordinate surface need not remain material when the fluid rotates. \b[Toroidal flux conservation therefore does not imply that $B_\phi$ itself is materially constant.]