A Thermodynamical Theory with Internal Variables Describing Thermal Effects in Viscous Fluids