A model of vacancy flux induced segregation to grain-boundaries during cooling