Flow of freezing liquid or a melting solid If a liquid is freezing, is equation of continuity violated? As the liquid flows, some portion of it is getting frozen. The mass of the fluid thus keeps dropping. Similarly, when a molten fluid flows over a solid, its mass may increase because the solid over which it flows also melts. In either of these flows, can we assume that div u = 0, where u is the velocity vector.
 A: The continuity equation is not violated in either of the situations you describe above. The generic continuity equation for some scalar quantity (such as density) can be written as 
$\frac{\partial \psi}{\partial t} + \nabla . \psi\mathbf{u} = \sigma$,            (1)
where here $\psi$ is the some conseverd scalar quantity, $\mathbf{u}$ is the velocity field and $\sigma$ is the is the generation of $\psi$ per unit volume per unit time (or source term). This source term is introduced when you are adding or taking away from the substance under consideration (or indeed changing its state). 
For a ordinary incompressible flow (with the fluid not changing state), the continuity equation can be written as
$\frac{\partial \rho}{\partial t} + \nabla . \rho\mathbf{u} = 0$.           (2)
Taking the density of the fluid to be constant we find (as you point out) 
$\nabla . \mathbf{u} = 0$.            (3)
However, for the situation describe above, it is not this simplified version that will model the flow correctly as the density is not constant. As long as you model the substance with correct continuity equation, nothing will be violated. In fact, for the cases you speak of, you can still treat the molten metal, or melting ice and as the same continuous substance, but instead of the simplified version of the continuity equation (the divergence free condition you have stated (3)), would need to use equation (2). To model the flow only, where you would treat the solidification as a change in volume/mass you would also need to include the source term (equation (1)).
I hope this helps.
