Radio relics are diffuse synchrotron sources that illuminate shock waves in the intracluster medium. In recent years, radio telescopes have provided detailed observations about relics. Consequently, cosmological simulations of radio relics need to provide a similar amount of detail. In this methodological work, we include information on adiabatic compression and expansion, which have been neglected in the past in the modelling of relics. In a cosmological simulation of a merging galaxy cluster, we follow the energy spectra of shock accelerated cosmic-ray electrons using Lagrangian tracer particles. On board of each tracer particle, we compute the temporal evolution of the energy spectrum under the influence of synchrotron radiation, inverse Compton scattering, and adiabatic compression and expansion. Exploratory tests show that the total radio power and, hence, the integrated radio spectrum are not sensitive to the adiabatic processes. This is attributed to small changes in the compression ratio over time.