Thermal energy is primarily defined as the energy associated with the motion of particles within a substance. This means it relates to the kinetic energy of particles due to their movement, which is influenced by temperature.
So, the correct answer is: A. The energy associated with the motion of particles within a substance.