In this paper, we consider device to device (D2D) communication overlaying cellular network where a group of D2D users exchange messages among themselves. We investigate the case when the channel conditions of the direct links among these D2D users are not strong enough to support direct communication and hence, an intermediate relay node assists the communication among the D2D users. Here we consider capacity achieving lattice codes at the D2D users along with compute-and-forward protocol at the relay. Based on these, we derive the received signal to noise ratio (SNR) at the relay, as well as the D2D users and formulate upper bounds on the achievable sum rate. We also investigate the achievable sum rate when the devices communicate using the direct links and compare with that of the relay aided D2D communication. We find that when the D2D users are closer to the relay, relay aided communication achieves better performance compared to direct communication. However, for the same distances, the sum rate degrades more for relay aided communication. It is also shown that when the links between most of the D2D users and the relay have good channel conditions compared to the direct links, relay aided communication can achieve better sum rate performance than the direct communication.