Homogenization of second order discrete model and application to traffic flow