laws of thermodynamics in mechanical engineering