SUMMARYInhomogeneous flows involving dense particulate media display clear size effects, in which the particle length scale has an important effect on flow fields. Hence, nonlocal constitutive relations must be used in order to predict these flows. Recently, a class of nonlocal fluidity models have been developed for emulsions and subsequently adapted to granular materials. These models have successfully provided a quantitative description of experimental flows in many different flow configurations. In this work, we present a finiteelement-based numerical approach for solving the nonlocal constitutive equations for granular materials, which involve an additional, non-standard nodal degree-of-freedom -the granular fluidity, which is a scalar state parameter describing the susceptibility of a granular element to flow. Our implementation is applied to three canonical inhomogeneous flow configurations: (i) linear shear with gravity, (ii) annular shear flow without gravity, and (iii) annular shear flow with gravity. We verify our implementation, demonstrate convergence, and show that our results are mesh-independent.