The branch of physics that deals with the relationship between heat and mechanical energy is called thermodynamics. In more detail , the branch of physics that deals with the relationship between heat , mechanical energy, and different types of energy, such as electrical energy , magnetic energy, and scattered energy, is called thermodynamics.