Add friction-induced heat

Also be loyal to the computation procedures of original paper.
Minor changes
Fix bugs