Generalized model of metal bonding and cleaning from wafer surfaces