Hydrodynamic signatures in thermal transport in devices based on two-dimensional materials : an ab initio study