Processes, such as collisional excitation, ionization, and inverse Compton scattering, can cause the internal energy of the gas to be dissipated. In the simulation, cooling processes are realized by coupling cooling functions to energy equations. Besides the primordial cooling, at high temperature, 10 5 K < T < 10 7 K , heavy elements (metals) cooling dominates. When T < 10 4 K , the fine structure and molecular cooling also need to be considered to simulate the cold phase of the interstellar medium.