Modeling and simulation of trickle-bed magnetohydrodynamics in inhomogeneous magnetic fields