Prediction of colloid detachment in a model porous media: Thermodynamics