The Availability of Energy

Read this page. The second law of thermodynamics deals with heat transfer and explains why a perpetual motion machine can never exist.