Modelling and numerical analysis of energy-dissipating systems with nonlocal free energy