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 [Maple Math] .

> m[x]:= rho*u*dA[x];

[Maple Math]

> m[y]:= rho*v*dA[y];

[Maple Math]

> m[z]:= rho*w*dA[z];

[Maple Math]

> m[x+dx]:= m[x]+Diff(m[x],x)*dx;

[Maple Math]

> m[y+dy]:= m[y]+Diff(m[y],y)*dy;

[Maple Math]

> m[z+dz]:= m[z]+Diff(m[z],z)*dz;

[Maple Math]

Differential Flow Areas

> dA[x]:= dy*dz; dA[y]:= dx*dz; dA[z]:= dx*dy;

[Maple Math]

[Maple Math]

[Maple Math]

Mass Storage Term

> m[`storage rate`]:= Diff(rho,t)*dV;

[Maple Math]

Differential Volume

> dV:= dx*dy*dz;

[Maple Math]

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;

[Maple Math]

Divide through by the differential volume.

> pde:= expand(pde/dV);

[Maple Math]

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;

[Maple Math]

Expanded Form of Continuity Equation

> conteq2:= value(conteq);

[Maple Math]

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;

[Maple Math]

> conteq4:= value(subs(rho=constant, conteq3));

[Maple Math]

> conteq4:= Diff(u,x) + Diff(v,y) + Diff(w,z)=0;

[Maple Math]

> conteq; conteq5:= value(conteq);

[Maple Math]

[Maple Math]

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);

[Maple Math]

[Maple Math]

[Maple Math]

> conteq4;

[Maple Math]

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;

[Maple Math]

Consult any fluids text for details.