Spontaneous solid-state foaming of nanocrystalline thermoelectric compounds at elevated temperatures