  We discuss the effects of nonhomogeneous magnetic fields in liquid metal
flows in two different configurations. In the first configuration, we briefly
report the impact of fringing magnetic fields in a turbulent
Rayleigh-B{\'e}nard convection setup, where it was shown that the global heat
transport decreases with an increase of fringe-width. The convective motion in
regions of strong magnetic fields is confined near the sidewalls. In the second
configuration, we numerically study the effects of an oscillating magnetic
obstacle with different frequencies of oscillation on liquid metal flow in a
duct. The Reynolds number is low such that the wake of the stationary magnetic
obstacle is steady. The transverse oscillation of the magnet creates a
sinusoidal time-dependent wake reminiscent of the vortex shedding behind solid
obstacles. We examine the behavior of the streamwise and spanwise components of
the Lorentz forces as well as the work done by the magnets on the fluid. The
frequency of the oscillation of the streamwise component of Lorentz force is
twice that of the spanwise component as in the case of lift and drag on solid
cylindrical obstacles. The total drag force and the energy transferred from the
magnets to the fluid show a non-monotonic dependence on the frequency of
oscillation of the magnetic obstacle indicative of a resonant excitation of the
sinusoidal vortex shedding.
