We study the expansion of low-density cavities produced by active galactic nucleus jets in clusters of galaxies. The long-term stability of these cavities requires the presence of linked magnetic fields. We find solutions describing the self-similar expansion of structures containing large-scale electromagnetic fields. Unlike the force-free spheromak-like configurations, these solutions have no surface currents and, thus, are less susceptible to resistive decay. The cavities are internally confined by external pressure, with zero gradient at the surface. If the adiabatic index of the plasma within the cavity is Γ > 4/3, the expansion ultimately leads to the formation of large-scale current sheets. The resulting dissipation of the magnetic field can only partially offset the adiabatic and radiative losses of radio-emitting electrons.
We demonstrate that if the formation of large-scale current sheets is accompanied by explosive reconnection of the magnetic field, the resulting reconnection layer can accelerate cosmic rays to ultrahigh energies. We speculate that the enhanced flux of ultrahigh energy cosmic rays towards Centaurus A originates at the cavities due to magnetic reconnection.