Numerical Simulation of a Segmented Thermoelectric Generator