Now the theoretical background. For the derivation of equations for isothermal and non-isothermal flow we will look at the conservation of mass. There is a continuity equation. And the we relate the velocity with the different equation.
So the continuity equation is basically the water volume or water comes in and the same water has to go out, because there is a conservation of mass. And therefore you can see here that the volume of liquid that is entering the system and the volume which is going out, and if you consider in a small unit of time you get the equation which a gradient of velocity into the total volume.
And therefore the change in the volume stored in the control element per unit of time is derivity of volume of water with respect to time. And with the continuity equation both should equal. And this gives us the continuity equation.