We report a conceptually simple and robust particle-scale model of hydrodynamic erosion. The model treats each particle of the granular matrix as a discrete element, and computes the erosive and cohesive forces acting upon it due to the oil flow and the surrounding particles. A stochastic erosion criterion is then used to determine if the particle is eroded, depending on the nett force acting upon it and the geometrical constraints imposed on it by the neighbouring particles. The erosion is allowed to progress particle-by-particle, and the pressure field is successively recalculated to take account of the modified particle matrix. The model predicts the formation of wormhole-like voids, which grow upstream into the particle matrix, and develop into a dendritic network. Wormhole growth does not begin until the ratio of erosive to cohesive force exceeds a critical value; as this ratio increases, the amount of erosion increases. The model also shows that non-uniform distributions of permeability, such as those due to localized geological features like intrusions, can significantly modify the characteristics of the erosion and reduce the total amount erosion. These findings are in agreement with previous experimental observations.