During the collapse, the potential energy of infalling hydrogen atoms is converted to kinetic energy, heating the core. As the temperature goes up, the pressure goes up to stop the collapse. Convection is the motion of heated material, such as bubbles in boiling water. When the temperature is high and all the atoms are stripped of their electrons, the opacity is low and radiation transfer is dominant. When the temperature drops, such as in the outer layers of the solar interior, the protons and electrons recombine to form atoms and the opacity goes up.
High opacity slows the transfer of energy by radiation, so bubbles form.
These bubbles are hot and low in density, thus starting a convective flow. These 5 relationships, described as mathematical formula, show how energy is generated, how that energy effects the structure of the Sun and how that energy is transported to the surface to make the Sun shine. The primary output from nuclear reactions are photons in the form of gamma-rays, but a large number of other particles are important as well. Each scattering exchanges energy so that the photons convert into visible, UV, IR and radio photons, as well as high energy ones, producing a thermal spectrum. The details are similar to seismic waves and are used to investigate the density changes in the core.