Numerical techniques for the study of wetting on rough surfaces and contact angle hysteresis