Modeling classical wavefront sensors