It's pretty much impossible to separate sand, mud and waste. So one could simply make new substances for the mixed states that absorb quantities of both materials.
And what happens when those mix?
i think if you want this done right you'll have to have a damned huge multidimensional table containing all possible interations between all existing liquids under all possible temperatures and pressures. The interaction then will take time to complete and can be interrupted ol altered if contents of the tile changes.
That's what seems right. And you'll have to keep track on how much of each liquid is there on the tile up to some (previously specified) accuracy.
Like, specify accuracy of 0.01 and you'll have consider a tile where there's .14 mercury, .50water, .11wine(which is in turn .9 water and .1 alcohol),.17 dwarf blood with the rest being air under 300K and normal pressure.
You look into your badass table where everything is written and conclude that mercury sinks to the fllor of the tile, other things start to form a solution on top of it, to complete it after 47 frames, and then you'll have to calculate the flow for each of liquids (mercury and water-based blood and alcohol solution) independently and recalculate solutions when something else is thrown in the mix.
The thing will murder your processor without any doubt, but any other way just doesn't seem right. The only thing i can imagine to make it less FPS-murderous is lower the amount of liquids by all means possible, like only leaving water, magma as generic molten rock, alcohol and generic blood. That's pretty much the same we have today, except there's no alcohol or blood.
edit: and it'll murder your ram, too, because it is very much info per tile to store. Or, if you dump that to disk for some tiles, it will murder some more fps.