Numerical simulation of glass fogging and defogging