Thermoanalysis and Its Effect on the Multimode Beam-Wave Interaction for a 0.24-THz, Megawatt-Class Gyrotron