Melt migration and chemical differentiation by reactive porosity waves