Global energy balance in a diesel engine with a thermoelectric generator