Continuity Equation (Conservation of Mass)
M.M. Yovanovich
CONTEQN1.MWS
Derivation of the continuity equation (conservation of mass) in cartesian coordinates.
Two partial differential equations are obtained.
The first is first order and it is based on the velocity components.
The second partial differential equation is based on the velocity potential.
For steady, incompressible flow without sources, the equation is the Laplace equation for the velocity potential.
> restart:
Use aliases to simplify the appearance of the Maple input and output.
> alias(u=u(x,y,z,t), v=v(x,y,z,t), w=w(x,y,z,t), rho=rho(x,y,z,t)):
Mass flow rates into and out of the differential control volume
.
> m[x]:= rho*u*dA[x];
> m[y]:= rho*v*dA[y];
> m[z]:= rho*w*dA[z];
> m[x+dx]:= m[x]+Diff(m[x],x)*dx;
> m[y+dy]:= m[y]+Diff(m[y],y)*dy;
> m[z+dz]:= m[z]+Diff(m[z],z)*dz;
Differential Flow Areas
> dA[x]:= dy*dz; dA[y]:= dx*dz; dA[z]:= dx*dy;
Mass Storage Term
> m[`storage rate`]:= Diff(rho,t)*dV;
Differential Volume
> dV:= dx*dy*dz;
Apply conservation of mass principle.
> pde:= m[`storage rate`] - (m[x]+m[y]+m[z]-m[x+dx]-m[y+dy]-m[z+dz]) = 0;
Divide through by the differential volume.
> pde:= expand(pde/dV);
Maple does not cancel the differential arclengths. Rewrite the PDE. This is the general form of the continuity equation for variable mass density and transient flow. Consult any fluids texts for details.
> conteq:= Diff(rho,t) + Diff(rho*u,x) + Diff(rho*v,y) + Diff(rho*w,z) = 0;
Expanded Form of Continuity Equation
> conteq2:= value(conteq);
Alternative forms of Continuity Equation
> conteq3:= Diff(rho,t) + rho*(Diff(u,x)+Diff(v,y)+Diff(w,z)) + u*Diff(rho,x)+v*Diff(rho,y)+w*Diff(rho,z)=0;
> conteq4:= value(subs(rho=constant, conteq3));
> conteq4:= Diff(u,x) + Diff(v,y) + Diff(w,z)=0;
> conteq; conteq5:= value(conteq);
Velocity Potential
The velocity potential is introduced for the steady, incompressible flow.
> alias(phi = phi(x,y,z,t)):
> u:= diff(phi,x); v:= diff(phi,y); w:= diff(phi,z);
> conteq4;
This equation can be written in the conventional form. It is the three-dimensional Laplace equation for the velocity potential.
> conteq5:= Diff(phi,x$2)+Diff(phi,y$2)+Diff(phi,z$2)=0;
Consult any fluids text for details.