Hi i had the same problem i even format 20 times restalled el captain then even went back to lion soon as i switch it on fan running at 6500 very loud ..NEVER DID THAT BEFORE contacted apple my luck warranty gone.. they told me to restart computer press d .. it came back smc problem .. told me contact service centre they hadn't a clue .. they just cleaned it and give it back to me same problem as before .. told them they didn't fix it and wouldn't pay .. then they said i would have to replace motherboard 600 dollars .. i asked them to just replace fan sensor .. they say all they do on all machines is clean it and replace motherboard.. what a joke... so i search internet and found this https://www.tunabellysoftware.com/tgpro/ download the free trail set the fan speed and it work now mac running same as before without paying 600 dollars ... i know this will help as took me over week of head scratching lol