Computational Fluid Dynamics · Chapter 2 of 10 · Intermediate
The Governing Equations
Mass, momentum, and energy are conserved. Writing those three statements as a single transport equation, with one variable swapped, is the unifying idea that lets one solver handle them all.
Readiness check
This chapter is the calculus of conservation. Tick only what you can do closed-notes.
- Take partial derivatives of a multivariable field.
- Compute the divergence of a velocity field.
- Recall conservation of mass and momentum.
- Integrate a simple derivative to recover a function.
- Distinguish convection from diffusion in words.
The core idea
Every conservation law has the same shape: rate of change, plus convection out, equals diffusion in, plus sources. Choosing what the transported quantity is gives continuity, momentum, or energy.
∂(ρφ)/∂t + div(ρuφ) = div(Γ grad φ) + Sφφ = 1 ⇒ continuityφ = u ⇒ momentum (Navier-Stokes)The general transport equation states that, for any conserved quantity φ, the rate it accumulates in a control volume plus the net amount carried out by the flow (convection) equals the net amount diffusing in plus any sources. Setting φ = 1 with no diffusion or source gives mass conservation, the continuity equation. Setting φ equal to a velocity component, with Γ the viscosity, gives a momentum equation, and the set of them is the Navier-Stokes equations. Setting φ to enthalpy gives energy. One template, one numerical method, three physics. The finite volume method discretizes exactly this equation, which is why the whole course rests on it.
The skills, taught in order
Five skills cover mass, momentum, the transport template, conservative form, and boundary conditions.
2.1 Mass conservation and continuity
Conservation of mass for a control volume gives the continuity equation ∂ρ/∂t + div(ρu) = 0. For an incompressible flow, density is constant, so it reduces to div(u) = 0: the velocity field must be divergence-free everywhere.
2.2 Momentum and Navier-Stokes
Applying Newton's second law to a fluid element gives the momentum equations: the rate of change of momentum equals pressure, viscous, and body forces. With the Newtonian stress law these become the Navier-Stokes equations, the core of fluid dynamics and the hardest part to solve.
2.3 The general transport equation
All of these share one form for a transported scalar φ: transient + convection = diffusion + source. Recognising each equation as this template with a specific φ, diffusion coefficient Γ, and source S is what lets a single code solve them all.
| Set φ to | Diffusion Γ | Equation |
|---|---|---|
| 1 | 0 | continuity (mass) |
| velocity u | viscosity μ | momentum (Navier-Stokes) |
| enthalpy or T | k/cp | energy |
2.4 Conservative form
Writing the convection term as div(ρuφ) rather than expanding it keeps the equation in conservative form, so the discretized fluxes telescope and global conservation is exact. CFD codes use this form to guarantee that mass and momentum are conserved to machine precision.
2.5 Boundary conditions
The equations need conditions at every boundary: a velocity or mass-flow inlet, a pressure outlet, a no-slip wall, or a symmetry plane. The solution is only as meaningful as these conditions, which encode the physics the domain cannot.
Engineering connection: the transport equation is discretized for diffusion in Chapter 3 and convection in Chapter 4, building the method one term at a time.
Worked example 1: checking continuity
A two-dimensional incompressible velocity field is u = x² − y², v = −2xy. Verify that it satisfies continuity.
- ProblemVerify that the field in Figure 1 satisfies incompressible continuity.
- Given / findu = x² − y², v = −2xy. Check whether ∂u/∂x + ∂v/∂y = 0.
- AssumptionsTwo-dimensional, incompressible, so continuity is div(u) = 0.
- ModelCompute the two partial derivatives and add them.
- Equations∂u/∂x + ∂v/∂y = 0
- Solve∂u/∂x = 2x and ∂v/∂y = −2x, so the sum is 2x − 2x = 0 at every point. Continuity is satisfied.
- CheckThe cancellation holds for all x and y, not just one point, which is what continuity demands. This field is in fact an ideal-flow pattern.
- ConclusionA velocity field is only physically admissible if it conserves mass. Continuity is the constraint that the pressure field enforces in Chapter 5.
Worked example 2: finding the third velocity component
A three-dimensional incompressible flow has u = 2x² − xy + z² and v = x² − 4xy + y². Find the component w that makes the field conserve mass, given w = 0 at z = 0.
- ProblemFind w for the field in Figure 2 so that mass is conserved.
- Given / findu = 2x² − xy + z², v = x² − 4xy + y², w = 0 at z = 0. Find w(x, y, z).
- AssumptionsThree-dimensional, incompressible, so ∂u/∂x + ∂v/∂y + ∂w/∂z = 0.
- ModelCompute the known divergence terms, set ∂w/∂z to cancel them, and integrate in z.
- Equations∂w/∂z = −(∂u/∂x + ∂v/∂y)
- Solve∂u/∂x = 4x − y and ∂v/∂y = −4x + 2y, so their sum is y. Then ∂w/∂z = −y, and integrating, w = −yz + f(x, y). The condition w = 0 at z = 0 gives f = 0, so w = −yz.
- CheckWith w = −yz, ∂w/∂z = −y, and the full divergence is y + (−y) = 0 everywhere, confirming mass conservation.
- ConclusionContinuity is not optional: it determines what the third component must be. Any solver enforces this link between the velocity components at every cell.
Misconceptions and diagnostics
| Mistake | Symptom | Diagnostic question | Correction |
|---|---|---|---|
| Ignoring continuity | A velocity field that does not conserve mass | "Is the divergence zero?" | An incompressible field must satisfy div(u) = 0. |
| Non-conservative convection | Global mass or momentum drifts | "Is the equation in conservative form?" | Keep the flux form div(ρuφ) so fluxes telescope. |
| Confusing convection and diffusion | Wrong term assigned to a physical effect | "Is this carried by the flow or by gradients?" | Convection is flow transport; diffusion is gradient transport. |
| Under-specified boundaries | No unique or unphysical solution | "Is every boundary given a condition?" | Specify inlets, outlets, walls, and symmetry explicitly. |
Practice ladder
Does the field u = 3x, v = −3y satisfy two-dimensional continuity?
Show answer
∂u/∂x = 3, ∂v/∂y = −3, sum = 0. Yes, it conserves mass.
For u = x², v = ?, find v (in 2D) so the field conserves mass, with v = 0 at y = 0.
Show answer
∂u/∂x = 2x, so ∂v/∂y = −2x, giving v = −2xy + f(x); with v = 0 at y = 0, f = 0, so v = −2xy.
Identify the φ, Γ, and source that turn the general transport equation into the energy equation, and say what each physical term represents.
Show answer
φ = enthalpy (or temperature), Γ = k/cp, source = volumetric heating and pressure work. Transient is stored energy, convection is energy carried by flow, diffusion is conduction.
For a real flow you would simulate, list the boundary conditions you would impose at each boundary and justify each choice.
What good work looks like
A velocity or mass-flow inlet, a pressure outlet, no-slip walls, and any symmetry planes, each tied to the physics of that boundary.
Working with AI, and proving it yourself
Use AI as an examiner, not a solver
Portfolio task
Take a real flow problem, write its governing equations as transport equations identifying φ, Γ, and source for each, and list the boundary conditions the domain needs.
Retrieval and spaced review
Closed notes. Answer out loud, then reveal.
1. Write incompressible continuity.
div(u) = 0; the velocity field is divergence-free.
2. What are the Navier-Stokes equations?
The momentum equations for a Newtonian fluid: rate of change of momentum equals pressure, viscous, and body forces.
3. Write the general transport equation.
∂(ρφ)/∂t + div(ρuφ) = div(Γ grad φ) + Sφ.
4. Why use conservative form?
The discretized fluxes telescope, so global mass and momentum are conserved exactly.
5. Name four boundary condition types.
Velocity or mass-flow inlet, pressure outlet, no-slip wall, symmetry plane.
Textbook mapping
| Item | Mapping |
|---|---|
| Primary source | Versteeg and Malalasekera, An Introduction to Computational Fluid Dynamics, Chapter 2 (Conservation Laws) |
| Cross-reference | Anderson, Ch. 2 · Fluid Mechanics, Ch. 4 |
| Core topics | 2.1 Continuity · 2.2 Navier-Stokes · 2.3 Transport equation · 2.4 Conservative form · 2.5 Boundary conditions |
| Engineering connection | The transport equation is the object the finite volume method discretizes. |
| Read next | Chapter 3: The Finite Volume Method for Diffusion. |