Modeling of inverse segregation and porosity formation in directionally solidified aluminum alloys