The generation of heat in order to maintain body temperature. The uncoupled oxidation of fatty acids contained within brown adipose tissue and shivering are examples of thermogenesis in mammals.