There’s a method of directly generating energy from heat (Seebeck effect), but it’s extremely inefficient. About 5% efficiency compared to the steam method which can be around 40% efficiency.
In general, it’s just not useful. However some technologies in space utilizes thermoelectric generators for simple electronics. In that case, most space probes are energy efficient enough that a steady small energy generation can be useful.
Latest Answers