Segregation and flow during the solidification of alloys