Thermodynamic of waste generation