A model for erosion kinetics of a hydrogel matrix