How to model thermal gradients in an interferometer cavity