Thermal modeling of THz quantum cascade lasers