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.

01

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.
0 or 1 weak itemsContinue with this chapter.
2 weak itemsRevisit continuity in Fluid Mechanics, Chapter 4.
3 or more weak itemsReview partial derivatives and divergence in Math: PDEs.
02

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 skill works when: you see each governing law as the transport equation with a particular φ, Γ, and source.
The skill breaks down when: continuity is forgotten, so a velocity field is used that does not conserve mass.
The concept. Mass fluxes cross every face of a control volume. Conservation says what flows in minus what flows out equals what accumulates inside, the balance the finite volume method enforces cell by cell.
03

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 φ toDiffusion ΓEquation
10continuity (mass)
velocity uviscosity μmomentum (Navier-Stokes)
enthalpy or Tk/cpenergy

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.

04

Worked example 1: checking continuity

A two-dimensional incompressible velocity field is u = x² − y², v = −2xy. Verify that it satisfies continuity.

Figure 1. The two partial derivatives cancel everywhere, so the field has zero divergence and conserves mass, a requirement any candidate flow must meet.
  1. ProblemVerify that the field in Figure 1 satisfies incompressible continuity.
  2. Given / findu = x² − y², v = −2xy. Check whether ∂u/∂x + ∂v/∂y = 0.
  3. AssumptionsTwo-dimensional, incompressible, so continuity is div(u) = 0.
  4. ModelCompute the two partial derivatives and add them.
  5. Equations∂u/∂x + ∂v/∂y = 0
  6. Solve∂u/∂x = 2x and ∂v/∂y = −2x, so the sum is 2x − 2x = 0 at every point. Continuity is satisfied.
  7. 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.
  8. ConclusionA velocity field is only physically admissible if it conserves mass. Continuity is the constraint that the pressure field enforces in Chapter 5.
Result. ∂u/∂x + ∂v/∂y = 2x − 2x = 0, so continuity holds.
05

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.

Figure 2. Continuity fixes the missing component: the divergence of the known part must be cancelled by ∂w/∂z, which integrates to w with the boundary condition.
  1. ProblemFind w for the field in Figure 2 so that mass is conserved.
  2. Given / findu = 2x² − xy + z², v = x² − 4xy + y², w = 0 at z = 0. Find w(x, y, z).
  3. AssumptionsThree-dimensional, incompressible, so ∂u/∂x + ∂v/∂y + ∂w/∂z = 0.
  4. ModelCompute the known divergence terms, set ∂w/∂z to cancel them, and integrate in z.
  5. Equations∂w/∂z = −(∂u/∂x + ∂v/∂y)
  6. 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.
  7. CheckWith w = −yz, ∂w/∂z = −y, and the full divergence is y + (−y) = 0 everywhere, confirming mass conservation.
  8. ConclusionContinuity is not optional: it determines what the third component must be. Any solver enforces this link between the velocity components at every cell.
Result. w = −yz, giving a divergence of zero everywhere.
06

Misconceptions and diagnostics

MistakeSymptomDiagnostic questionCorrection
Ignoring continuityA velocity field that does not conserve mass"Is the divergence zero?"An incompressible field must satisfy div(u) = 0.
Non-conservative convectionGlobal mass or momentum drifts"Is the equation in conservative form?"Keep the flux form div(ρuφ) so fluxes telescope.
Confusing convection and diffusionWrong 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 boundariesNo unique or unphysical solution"Is every boundary given a condition?"Specify inlets, outlets, walls, and symmetry explicitly.
07

Practice ladder

Level 1 · Direct skill

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.

Level 2 · Mixed concept

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.

Level 3 · Independent problem

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.

Level 4 · Transfer to real engineering

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.

08

Working with AI, and proving it yourself

Use AI as an examiner, not a solver

"Check that my velocity field is divergence-free."
"Give me four equations; I will match each to a φ in the transport template."
"Find the third velocity component." Integrating continuity yourself is the skill.
"Write the energy equation." Identifying φ, Γ, and source is the point.

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.

Must include: the continuity and momentum equations, a transport-template identification, and a boundary-condition list.
09

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.

TodayFinish this quiz and Levels 1 and 2 of the ladder.
+1 dayRe-derive the continuity checks from a blank page.
+3 daysMatch three equations to the transport template.
+7 daysCarry the transport equation into diffusion, Chapter 3.
+30 daysReuse continuity as the pressure constraint in SIMPLE.
10

Textbook mapping

ItemMapping
Primary sourceVersteeg and Malalasekera, An Introduction to Computational Fluid Dynamics, Chapter 2 (Conservation Laws)
Cross-referenceAnderson, Ch. 2 · Fluid Mechanics, Ch. 4
Core topics2.1 Continuity · 2.2 Navier-Stokes · 2.3 Transport equation · 2.4 Conservative form · 2.5 Boundary conditions
Engineering connectionThe transport equation is the object the finite volume method discretizes.
Read nextChapter 3: The Finite Volume Method for Diffusion.