If you measured all the energy related to motion and all the stored energy in the particles of a substance, you would be measuring the thermal energy of the particles. If there is movement of the particles, they are also releasing energy in the form of heat.