Smokey Yunick did it on a race car but that was only because it had a problem throwing belts.
It seems to me that such a set-up would increase aero drag thus cancelling or more than cancelling out any gains. I had that "brilliant" idea as a kid but my engineer uncle explained why it probably wouldn't work. For sure it would fail bolted on the roof, for example.
Someone recently suggested putting one in the engine compartment, an already draggy place with lots of airflow(?). I think it would either still increase aero drag but maybe not enough to notice. And/or it might not spin enough, enough of the time to keep the battery charged.
Maybe the answer isn't simple?