Application of the second law of thermodynamics to control: A review