# Deriving the Momentum and Energy Equations in Fluid Dynamics

> A rigorous look at how conservation principles translate into the governing equations for compressible flow.

[Watch on YouTube](https://www.youtube.com/watch?v=uu9miJA9xxE)

---

## Conservation of Momentum: Starting Principles

Momentum conservation provides one of the three pillars of fluid mechanics, alongside mass and energy. For any control volume, the rate at which momentum increases inside must balance the net momentum flux crossing the boundaries plus all forces acting on the fluid. This principle, rooted in Newton's second law, becomes powerful when expressed in integral form: the time rate of change of momentum in a volume equals the negative net outflux across its surface plus the net force acting on that volume.

![The conceptual foundation: rate of increase in momentum equals the negative net outflux across the surface plus net forces acting on the volume.](http://www.farzi.me/jobs/job-1780907892068-8w6yx7/screenshots/t128.jpg)
*[2:08] The conceptual foundation: rate of increase in momentum equals the negative net outflux across the surface plus net forces acting on the volume.*

Forces in a flowing fluid come in two varieties. Body forces—such as gravity or electromagnetic fields—act throughout the volume. Surface forces arise from stresses at the boundary. In gas dynamics, body forces are typically negligible, leaving pressure and shear stress as the dominant contributors. The stress tensor encapsulates both: diagonal terms represent normal stresses (pressure), while off-diagonal terms capture shear. For inviscid flows, shear vanishes, simplifying the analysis considerably.

## From Integral to Differential Form

Translating the integral momentum statement into a point-wise differential equation requires careful mathematics. The flux term—density times velocity times velocity integrated over the surface—does not immediately yield to divergence conversion. Instead, vector identities decompose products of vectors and scalars into more manageable pieces. One such identity allows the dot product of velocity with its own gradient to be rewritten using the divergence operator and the curl of velocity.

![Applying vector identities step-by-step to convert the surface integral of momentum flux into volume integrals, preparing for differential formulation.](http://www.farzi.me/jobs/job-1780907892068-8w6yx7/screenshots/t293.jpg)
*[4:53] Applying vector identities step-by-step to convert the surface integral of momentum flux into volume integrals, preparing for differential formulation.*

Through successive application of product rules and vector calculus identities, the outflux integral separates into terms involving time derivatives, velocity gradients, and density gradients. Crucially, some of these terms combine to reproduce the continuity equation—the statement of mass conservation. When mass conservation holds, those grouped terms vanish, dramatically simplifying the momentum equation. This cross-linking between conservation laws is a hallmark of fluid dynamics: one equation aids in simplifying another.

![Building the momentum equation on the board: time derivatives, flux terms, and pressure gradients come together with careful algebra.](http://www.farzi.me/jobs/job-1780907892068-8w6yx7/screenshots/t416.jpg)
*[6:56] Building the momentum equation on the board: time derivatives, flux terms, and pressure gradients come together with careful algebra.*

## The Compressible Momentum Equation

After algebraic manipulation and invoking the continuity equation, the momentum equation for an inviscid, compressible gas takes a compact form. In differential terms, it reads: the density times the material derivative of velocity equals the negative gradient of pressure. The material derivative—combining the local time rate of change with advection—captures how velocity evolves as fluid parcels move through space. This formulation is valid for compressible flows despite the absence of an explicit density time derivative in the final simplified expression.

> **KEY** — The simplified momentum equation is valid for compressible flow precisely because mass conservation has been used in its derivation. Density variation is implicitly accounted for through the continuity equation, even though it does not appear explicitly in the final form.

![The final differential momentum equation on the board, showing time derivatives, advection terms, and the pressure gradient—valid for compressible flows.](http://www.farzi.me/jobs/job-1780907892068-8w6yx7/screenshots/t930.jpg)
*[15:30] The final differential momentum equation on the board, showing time derivatives, advection terms, and the pressure gradient—valid for compressible flows.*

A common misconception is that the absence of a direct density time derivative implies incompressibility. In fact, the full equation before simplification includes density variation; the continuity equation merely allows us to eliminate redundant terms. This subtlety is a classic interview trap: always remember that the simplified form emerges from a compressible starting point.

## Conservation of Energy: Accounting for All Terms

Energy conservation follows the same control-volume logic as momentum. The rate at which energy accumulates inside a volume equals the net influx of energy across boundaries, minus the rate at which the fluid does work on its surroundings, plus any heat transfer into the system. Energy here encompasses both internal energy—related to temperature and molecular motion—and kinetic energy from bulk flow. Integrating these over the control volume yields the total energy content.

![Conceptual setup for energy conservation: a control volume with flow crossing boundaries, heat conduction through surfaces, and work done by pressure forces.](http://www.farzi.me/jobs/job-1780907892068-8w6yx7/screenshots/t1547.jpg)
*[25:47] Conceptual setup for energy conservation: a control volume with flow crossing boundaries, heat conduction through surfaces, and work done by pressure forces.*

Heat transfer enters primarily through conduction, governed by Fourier's law: heat flux is proportional to the temperature gradient, with the constant of proportionality being thermal conductivity. The direction of heat flow opposes the temperature gradient—heat flows from hot to cold. On the boundary, this heat flux dotted with the outward normal accounts for energy crossing the surface. Radiation and chemical reactions could also contribute, but in elementary gas dynamics, these are typically neglected.

## Work Done by the Flow

Work represents energy transfer via forces moving through distances. In a flowing fluid, both pressure forces and viscous stresses do work. The rate of work is force dotted with velocity: pressure acting on a surface element times the velocity component normal to that surface gives the power output due to pressure. For inviscid flows, viscous work vanishes, leaving only pressure work. The stress tensor multiplied by velocity and integrated over the surface captures the total work rate.

![Developing the work term: pressure acting through velocity at the boundary contributes to energy outflow from the control volume.](http://www.farzi.me/jobs/job-1780907892068-8w6yx7/screenshots/t1640.jpg)
*[27:20] Developing the work term: pressure acting through velocity at the boundary contributes to energy outflow from the control volume.*

Sign conventions matter. When fluid moves against a pressure gradient, it does work on the surroundings. Conversely, the surroundings do work on the fluid when pressure pushes it forward. Viscous stresses, when present, can either dissipate energy or, in rare cases, inject it depending on velocity gradients. For our purposes, shaft work—such as from turbines or compressors—is another potential term, though it is often omitted in the derivation of field equations and introduced later as a boundary condition or source term.

## Assembling the Energy Equation

Combining all terms—energy accumulation, flux, work, and heat—yields an integral energy equation. Converting surface integrals to volume integrals via the divergence theorem, and applying product rules where necessary, transforms this into a differential statement. The resulting equation balances the time rate of change of total energy density with the divergence of enthalpy flux, pressure-velocity work, viscous dissipation, and heat conduction.

![The full energy equation emerging on the board, incorporating heat flux, work terms, and the time derivative of energy density.](http://www.farzi.me/jobs/job-1780907892068-8w6yx7/screenshots/t1844.jpg)
*[30:44] The full energy equation emerging on the board, incorporating heat flux, work terms, and the time derivative of energy density.*

```latex
\frac{\partial}{\partial t} \left( \rho \left( e + \frac{u^2}{2} \right) \right) + \nabla \cdot \left( \rho \vec{u} \left( e + \frac{u^2}{2} \right) \right) = -\nabla \cdot (P \vec{u}) - \nabla \cdot \vec{q}
```

In simplified gas dynamics, heat conduction and shaft work are often set to zero, and viscous dissipation ignored. The equation then describes adiabatic, inviscid flow. Yet the full form remains essential in problems involving heat transfer or when analyzing shock structures where gradients are steep and dissipation cannot be neglected.

## Connecting Thermodynamics: Entropy and State

The momentum and energy equations, together with the continuity equation, form a system of five scalar equations. They involve velocity components, density, pressure, temperature, and internal energy—seemingly more than five variables. However, thermodynamic relations reduce this count. The equation of state for an ideal gas relates pressure, density, and temperature. Internal energy and enthalpy depend solely on temperature for calorically perfect gases, eliminating redundancy.

> **ASIDE** — Thermodynamic identities such as dS = dH/T - dP/(ρT) or dS = dE/T + P dV/T link entropy changes to other variables, ensuring the system is closed and solvable.

Entropy serves as a consistency check and a measure of irreversibility. For isentropic flows, entropy remains constant along streamlines, simplifying analysis. When shocks or viscous effects appear, entropy increases, signaling energy dissipation. The gas law and entropy relations close the system: five equations, five unknowns, a determinate problem ready for boundary and initial conditions.

![Writing the final differential form of the energy equation, linking all terms and preparing the foundation for solving compressible flow problems.](http://www.farzi.me/jobs/job-1780907892068-8w6yx7/screenshots/t2106.jpg)
*[35:06] Writing the final differential form of the energy equation, linking all terms and preparing the foundation for solving compressible flow problems.*

## Transition to Application

With mass, momentum, and energy equations in hand—both in integral and differential forms—the groundwork for gas dynamics is complete. These equations govern everything from subsonic flow over airfoils to supersonic jets and shock waves. The next phase moves from derivation to application: solving these equations under various conditions, understanding their physical implications, and interpreting results.

![The culmination of the derivation: all conservation laws expressed as differential equations ready for analysis and application.](http://www.farzi.me/jobs/job-1780907892068-8w6yx7/screenshots/t2296.jpg)
*[38:16] The culmination of the derivation: all conservation laws expressed as differential equations ready for analysis and application.*

Real problems impose boundary conditions—walls, inlets, outlets—and initial states. Analytical solutions exist for idealized cases; numerical methods handle the rest. The rigor of this derivation ensures that any solution, approximate or exact, respects fundamental conservation principles. From here, the study of gas dynamics becomes a matter of technique, insight, and computational power.

## Key takeaways

- The momentum equation for compressible, inviscid flow can be derived from Newton's second law applied to a control volume, using vector identities to convert surface integrals into volume integrals.
- Simplification via the continuity equation eliminates redundant terms, yielding a compact differential form valid for compressible flows despite no explicit density time derivative.
- Energy conservation accounts for internal and kinetic energy changes, heat conduction, pressure work, and potential shaft work, leading to a differential equation balancing these contributions.
- Heat transfer is governed by Fourier's law of conduction, and work is computed from stress-velocity products, with careful sign conventions ensuring energy balance.
- Thermodynamic state equations and entropy relations close the system, making the five conservation and state equations determinate for five primary variables: velocity components, density, pressure, and temperature.


---
*Generated by Farzipedia from [https://www.youtube.com/watch?v=uu9miJA9xxE](https://www.youtube.com/watch?v=uu9miJA9xxE).*
