The concept of heat, work, and internal energy is well demonstrated in the first law of thermodynamics. It is extensively used for discussing the heat engines. Joule is used as a standard unit for all of these quantities. Although, sometimes these quantities may also be expressed in the BTU’s or calories.
All the bodies have a certain fluid called caloric. The caloric flow is observed from the high temperatures to the low temperatures and by increasing the caloric of the body, its temperature will be increased. If two bodies have different temperatures and they are brought in to the thermal contact then the cooler one will be warmed and the warmer one will be cooled. If there is thermal isolation of two bodies from the rest of the universe then the final state of both bodies will end up at the same temperatures.
Heat is the form of energy that is transferred between the system and the environment due to the temperature differences between them. Whereas, the direction of the flow of the heat is always from the higher temperatures to the lower temperature.
The work is also a kind of energy that is transferred between the system and the environment by the processes in which there is no direct involvement of the temperature differences. In mechanics, the work is essentially a scalar product of the force and displacement in the direction of the applied force. This mechanical definition of the work is consistent with the thermodynamic definition and it can be used for the quantification of work done in various situations.
The internal energy of the systems has an important role in thermodynamics and interestingly, it is related to the temperature. With the increase in the temperature of the system, the internal energy is also increased. In case when the fixed quantity of the gas is confined in the cylinder, then from the microscopic point of view the gas has many tiny particles that are randomly moving, and are continuously colliding with one another and with the walls of the containers. With an increase in the temperature of the gas, the average kinetic energy of the particles is also increased. So, the temperature is the measurement of the internal kinetic energy that is associated with the random movement of the molecules that make the gas. The internal energy is also the function of the state. When the system is in equilibrium then the internal energy is determined by the equilibrium state.