The espresso extraction process involves a complex transport inside a geometry-changing porous medium. Large solid grains forming the majority of the porous medium can migrate, swell, consolidate and they can also morphologically change during flow, i.e. being mechanically eroded by hydrodynamic forces. These processes can, in turn, have a significant back-effect on the flow and the related coffee extraction profiles. In this article, we devise a bottom-up erosion model in the framework of smoothed dissipative particle dynamics to consider flow-induced morphological changes of the coffee grains. We assume that the coffee grains are not completely wetted and remain brittle. We found that heterogeneity in both the filtration direction and the transverse direction can be induced. The former is controlled by the angle of internal friction while the latter is controlled by both the cohesion parameter and the angle of internal friction. Not restricted to the modeling of espresso extraction, our model can also be applied to other eroding porous media. Our results suggest that, under ideal porous flow conditions, we can control the heterogeneity (in both the pressure drop direction and the transverse direction) of an eroding medium by tuning the yield characteristics of the eroding material.