Differential Equation of Mass, Energy and Momentum Conservation

In today’s lesson, we will be covering the following topics:

1. Differential Equation of Mass Conservation

2. Differential Equation of Energy Conservation

3. Differential Equation of Linear Momentum Conservation (Navier-Stokes)

4. Differential Equation of Angular Momentum Conservation

Video will be here soon!

Differential Equation of Mass Conservation

Let’s look at a fluid going in and out of a 1D space – say, a pipe. Let’s set up a conservation of mass equation.

We can use this equation above for 1D flow. But when we want to set up an equation for 3D mass/energy/ momentum conservation, let’s say we have a box (or any shape through which fluid is flowing – this is called the Control Volume Approach, and I will refer to the box (the control volume) as CV from now on – this could be any shape where fluid is coming in and out from). You might also see all these equations referred to as the control volume form of the fluid mechanics equations, because the initial equations start with mass, energy, or momentum in and out.

I am showing a fluid of some mass entering and leaving my CV, the cube. This could be a pipe, a box, or any other shape:

Example of a CV, where fluid is entering and leaving.

The Conservation of Mass (mass balance) equation refers to the mass leaving plus the mass increase (the rate of accumulation) within the CV is equal to the mass entering, which can be shown using the below equation. This shows that the only way mass can be added or removed in this mass conservation equation is when there is a change in the fluid density. Otherwise, total mass cannot change

Conservation of Mass Equation written out in words
You can also replace the crossed out terms with the net mass flux instead
I have added in red what each term is equal to – how we can substitute variables instead of words for each term. The first term (rate of mass increase) is the change in mass over time. This is the derivative of mass with respect to time (dm/dt). The next two terms are the mass flow rate in and out (the rate of mass leaving or entering).

This can then we rewritten into the differential equation below. The three terms with p*u, p*v and p*w are density*velocity components u, v and w. Each term is the rate of mass into the CV, and is the mass flux (p*u, p*v, p*w) * surface area (dx dy dz) of the face that the mass is entering through (x, y or z face of the cube that was drawn above):

Conservation of Mass Equation rewritten as a differential equation.

How did we suddenly get to this? Let’s go through the steps:

This is how the first term of the equation was derived. We started with the change in mass over time, since the increase of mass is equal to the mass out subtracted by the mass in. From there, we turned it into a derivative, then a partial derivative. Note where I have shown the units in blue highlight for how I replaced mass (m) with density * volume (pV). We take the derivative of the volume (from p V/dt to p dxdydz/dt) because it changes with respect to time over the CV.
The other terms are all derived similar to how the x-term was derived here.

Then everything is divided through by dxdydz, to obtain the final form of the mass conservation (continuity) equation. It is called the continuity equation because it makes no assumptions except that the density and velocity are continuous. So you can use this with unsteady flow, viscous flow, frictionless flow, compressible or incompressible flow. This covers unsteady and compressible flow, so when we assume steady and incompressible flow, there will be terms that will drop out. For now, this is the general equation for Mass Conservation:


Conservation of Mass for an infinitesimal control volume (aka, Equation of Continuity)

We can simplify this a little further, and you may have seen the vector gradient operator (upside triangle) used before to give a different form of the equation. The vector gradient operator is defined by the following:

Along with the vector gradient operator, these terms below (which are the last 3 terms of the continuity equation in pink above), when put in front of the vector gradient operator, are equal to a value known as the divergence of the vector, and it simplifies to p*V (p is the density, and V is the velocity where the components of V were the u, v and w in the continuity equation in pink above).

Using both of these replacements in the continuity equation, we get the following. The p*u, p*v and p*w simplifies to p*V (u, v and w were the components of V as I mentioned above, and they have simplified into their non-component form which is just the overall velocity). This is multiplied by the vector gradient operator, which accounts for the differential terms in the continuity equation.

Note: Divergence is a scalar value that measures how much the flow is expanding past a given point. You don’t really have to know this, but because the continuity equation simplifies to p*V which is divergence, it’s helpful to know.

Adding this to the original first term with the differential of density and time gives the following compact Continuity, or Conservation of Mass , equation for a fluid. This equation is in partial differential form (because it has the partial derivatives within it):

Differential Equation of Mass Conservation – more compact and in partial differential form from the equation above

When the flow is incompressible, the continuity equation reduces down to:

In cylindrical coordinates, the continuity equation can be given as follows:

And when it is (steady or unsteady) and incompressible, it reduces to:

Additionally, for steady and compressible flow, we can use this equation:

Note that if viscous effects are neglected, there is irrotational flow and the velocity potential function exists (we discuss this in a future lesson plan) such that:

Then the continuity equation reduces to Laplace’s equation:

The continuity/mass conservation equation derived from making a conservation equation for the mass in and the mass out of the CV. Now let’s go through this same conservation equation applied to the different variables below – energy, linear momentum and angular momentum.

Differential Equation of Energy Conservation

Applying the same principles from the Conservation of Mass equation, we can get the Conservation of Energy equation. This is based off of energy entering and leaving a CV, just like with the mass earlier.

You can rearrange this to get the (energy in – energy out) = change in the energy

But to put this equation into the form the textbook has it in (and into the actual Conservatioon of Energy equation that is widely known) let’s first start with the first law of thermodynamics – the internal energy of a system is equal to the heat added to the system plus the work done by the system (delta U = Q – W), as explained in this picture. Then we can rewrite the equation to make it a differential equation, as I have also done here. This changes the equation to make all the variables defined by their change over time.

This is because in Eqn. 2, the Q and W now have a dot on top, which means rate of change per unit time of each of these. Then dE/dt means the rate of energy change with respect to time:

The First Law of Thermodynamics is Eqn.1, and it is rewritten as each variable defined by a change over time.

Based off of this equation, there is an equation that can be derived known as the General Integral Equation for Conservation of Energy in a Control Volume. This is the equation, that utilizes many different forms in energy in and out of the system (based on the energy conservation equation that was written above below the CV image).

Each term is a different form of energy, all with respect to time or per unit time. Many of these different terms arise from types of work (which is a form of energy). For example, the entire last term is for work done by the pressure forces per unit time:

Based off of this, with some substitution using the Reynolds Transport Theorem (more on that another day – it is used to mathematically manipulate the equation), Fourier’s Law of conduction (a law in heat transfer) and a whole lot of math, we end up with the final differential energy equation:  

Differential Equation of Energy Conservation

Note that Fourier’s law has a negative sign in it to account for the fact that heat flux (the flow of energy per unit area per unit time) is negative in the sign of decreasing temperature. I have shown the side note in yellow to show how the vector gradient operator would look like in mathematical terms if it was expanded. In this equation, Fourier’s law is taken with a positive sign.

The expansion of the viscous dissipation function is also shown on the right hand side of the above image.

We won’t go through all of the derivation steps at the moment (or possibly in the future they will be up). The equations were derived based on the energy entering and leaving the CV, just like it was with mass above. So this is the final differential equation of Energy Conservation!

Differential Equation of Linear Momentum Conservation

Rate of Momentum In and Out of a Cube

To see a visual of 3D momentum flow, we can start with momentum coming in and out of the 3D CV, on all 6 faces of a cube. We have 3 directions – x, y, and z. When we derive the Navier-Stokes equations below, this is why you will notice we have three equations – one for each direction.

Now let’s add in the rate at which momentum is carried in and out of the CV. We will create this rate for all 6 faces – positive X, Y, Z and negative X, Y, Z directions. Starting with the physics momentum equation p = m*v (momentum = mass*velocity), in this class we use a u for velocity. So we start with p = m*u. From this momentum equation, we created an equation for rate of momentum (change in momentum per time). This is just for the x+ face, and we will repeat this for the other faces later:

Repeating this momentum flow for the other faces, and putting in the subscripts on u (eg. the x+, y-, etc) to show which face the velocity is for, can be put into a table. Although we derive the Conservation of Linear Momentum below, I did not show all the steps, such as the balance on the rate of momentum coming in and out of each face of the cube. I have shown the rate of momentum on each face in the table here, and it is used when deriving the Navier-Stokes equation.

Momentum flow in each direction, where “u” is the total velocity “V” in the pictures above

Linear Momentum Equation + Conservation of Linear Momentum Equation

Now, first let us derive the Linear Momentum Equation before we get into the Conservation of Linear Momentum at Step 6 (which is where the Navier-Stokes equations are from):

Here is a little breakdown of what each part of the momentum equation means. “u” is total velocity “V” in the pictures above.

Putting these together gives non-linear, partial differential equations, which are known as the Equations of Motion or Newton’s Law for a Moving Fluid:

With inviscid/nonviscous/frictionless flow (note: inviscid flow is also irrotational as well as frictionless), there is no shear stress (tau). Using the equations above, the normal stress (sigma) is now equal to -p (negative pressure is equal to the normal stress, so this replacement can be made). This gives Euler’s Equations of Motion:

It can be written in vector form as well:

Note that if viscous effects are neglected, low-speed flows are irrotational and the velocity potential function exists (we discuss this in a future lesson plan) such that:

Then the momentum equation can be rearranged to get an equation known as Bernoulli’s Equation, which can be used with ideal fluids (incompressible and inviscid). Additionally, the flow also has to be along a streamline and be steady flow:

This equation can be rewritten in head form, which divides each term by g and writes the equation as two different points along a streamline. This specific form of the equation can be used with irrotational flow as well:

Incompressible Continuity Equations: Navier-Stokes

Using these equations of motion above and combining them with the incompressible continuity equations from the mass conservation section, we get the following Navier-Stokes Equations. There are 3 equations, one for each x, y, z face of the cube (or any other control volume that fluid would be flowing through, hence momentum would be flowing through).

The terms are as follows: u, v, w are respectively the x, y, z components of the velocity. All terms relating to acceleration of the fluid are on the left side, and all terms relating to the force are on the right side. The equations of motion, when combined with the incompressible continuity equations to give these Navier-Stokes equations, are the governing differential equations of motion for incompressible Newtonian fluids. These are non-linear, second order, partial differential equations.

We discussed cylindrical coordinates in an earlier lesson plan. Since the above Navier-Stokes equations were in Cartesian coordinates, here is what they would be in cylindrical coordinates:

Canceling out Terms

With different situations, we may need to cancel out terms. Let’s go through the simplification of the Navier-Stokes equations in each situation. Note that these equations are for use with incompressible fluids only. In your situation, more than one of these may apply, so you may have to cancel multiple terms:

(1) With steady flow, the first term on the left of the Navier-Stokes equation cancels out. I will take an example from the x-direction Cartesian coordinate equation, but this applies to all the Cartesian and cylindrical coordinate Navier-Stokes equations (in the cylindrical coordinates, it is the first term with time on the denominator that cancels out):

(2) With inviscid/nonviscous/frictionless flow (note: inviscid flow is also irrotational), the viscosity is cancelled out. This would make everything the viscosity is multiplied by in the last term also equal zero:

Differential Equation of Angular Momentum Conservation

Applying the same principles from the Conservation of Linear Momentum equation (from Newton’s second law), we can get the Conservation of Angular Momentum (Moment-of-Momentum) equation. This equation relates angular momentum with torque (moment). When torque is significant in a question, this equation is more convenient to use rather than Cartesian coordinates. We use the same “change in momentum is equal to force” setup that we did above for linear momentum. Then, knowing from previous engineering classes that moment (torque) = force * distance (and distance in cylindrical coordinates is the radius, r) we can obtain the following.

After some more derivation, we obtain the final solution to the angular momentum in and out of a system (which, just like linear momentum, includes the net flow into the system, along with the rate of change). The term on the left is the force, so it can be replaced with the sum of forces term on the bottom left. This equations states that the force (rate of change of momentum on the left) is equal to the net torque/moment (terms on the right):

Final Conservation of Angular Momentum (Moment of Momentum) Equation