Multiscale modeling of segregation in granular flows