Computing diffusivities from particle models out of equilibrium