ABSTRACT Analytic arguments have been advanced that the degree of differential rotation in a neutron star depends on whether the topology of the internal magnetic field is open or closed. To test this assertion, the ideal-magnetohydrodynamics solver pluto is employed to investigate numerically the flow of an incompressible, viscous fluid threaded by a magnetic field with open and closed topologies in a conducting, differentially rotating, spherical shell. Rigid body corotation with the outer sphere is enforced on the Alfvén time-scale, along magnetic field lines that connect the northern and southern hemispheres of the outer sphere. Along other field lines, however, the behaviour is more complicated. For example, an initial point dipole field evolves to produce an approximately closed equatorial flux tube containing at least one predominantly toroidal and approximately closed field line surrounded by a bundle of predominantly toroidal but open field lines. Inside the equatorial flux tube, the field-line-averaged magnetic tension approaches zero, and the fluid rotates differentially, adjusting its angular velocity on the viscous time-scale to match the boundary conditions on the flux tube’s toroidal surface. Outside the equatorial flux tube, the differential rotation increases, as the magnetic tension averaged along open field lines decreases.