Thermodynamics is a branch of science concerned with the nature of HEAT and its conversion into other forms of energy. Heat is a form of energy associated with the positions and motion of the molecules of a body. The total energy that a body contains as a result of the positions and the motions of its molecules is called its internal energy.
The first law of thermodynamics states that in any process the change in a system's internal energy is equal to the heat absorbed from the environment minus the WORK done on the environment. This law is a general form of the law of conservation of energy. Energy can be transferred from one "system" to another in many forms. However, it can not be created nor destroyed. Thus, the total amount of energy available in the Universe is constant. This law is also called the Law of Conservation of Energy. Einstein's famous equation E = MC2 that describes the relationship between energy and matter deals with this law (in the equation energy (E) is equal to matter (M) times the square of a constant (C)).
The second law of thermodynamics states that in a system the entropy (the measure of the disorder or randomness of energy and matter in a system) cannot decrease for any spontaneous process. A consequence of this law is that an engine can deliver work only when heat is transferred from a hot reservoir to a cold reservoir or heat sink. Heat can never pass spontaneously from a colder to a hotter body. Thus, natural processes that involve energy transfer must have one direction, and all natural processes are irreversible. This law also predicts that the entropy of an isolated system always increases with time.
The third law of thermodynamics states that all bodies at absolute zero would have the same entropy; this state is defined as having zero entropy. In order to achieve this state we would have to remove all the thermal motion of atoms and molecules (kinetic energy). Basically, because nothing moves we would have perfect order. Absolute zero results in a temperature of 0 degrees Kelvin or -273.15 degrees Celsius. The Universe will attain absolute zero when all energy and matter is randomly distributed across (an infinitely large) space.
Scientist can use the laws of thermodynamics to calculate whether a given reaction will proceed spontaneously, and what the likely compounds will be that form in a given mixture of elements under given pressure/temperature conditions. Using sophisticated computer programs it is possible to model chemical processes in solutions (e.g. seawater, groundwater, pore waters of sediments), in molten materials (e.g. the lave that flows out of a volcano), and in gas mixtures (e.g. volcanic gases, chemical plants). This capability allows us to see whether certain conclusions we have reached from observing the rocks, are in agreement with the presumed underlying chemical processes.