The hypothesis explaining the vortex effect and tornado as two manifestations of the same thermodynamic cycle is substantiated. It is shown that in the equilibrium vortex, which is formed after the end of all transient processes, the gas energy is evenly distributed between its three components (degrees of freedom): kinetic, potential and internal energies. Relations for the distributions of temperature, pressure and gas velocity in an equilibrium vortex are derived. It is shown that if you start to supply heat to the periphery of the equilibrium vortex, and in the central part of the vortex to remove heat, then such a vortex will leave the equilibrium state and will work as a heat engine. The entry of cold air from a thunderstorm cloud into the center of the forming tornado is equivalent to the cooling of the central part of the gas vortex. The warm air at the periphery of a tornado creates the temperature difference necessary for the operation of a heat engine, which unwinds the air flow in a tornado or whirlwind. If, on the contrary, heat is supplied to the central part of the equilibrium vortex and removed from the periphery, then such a vortex will work as a cooling machine, transforming the mechanical energy of the rotating gas into two heat flows. The article compares the experimental data obtained on vortex tubes with the results predicted by the proposed hypothesis. Almost exact coincidence of the maximum temperature difference in the equilibrium vortex and the maximum temperature difference achieved in the vortex tube was obtained.