Project 06 · Case study
Heat and advection solver

Forced Convection in a Differentially Heated Cavity

A cell-centred finite-volume simulation of transient heat transport driven by a prescribed incompressible vortex.

  • Python
  • Finite-volume method
  • Advection-diffusion
  • Grid convergence
Select another grid to compare resolutionViewing 80 × 80
Boundary temperatures TL = 1 and TR = 0
Flow field Prescribed incompressible vortex with U0 = 1
Thermal diffusivity α = 10−3
Physical model

Heat transfer inside a forced recirculating flow

The left wall is hot, the right wall is cold and the horizontal walls are adiabatic. The cavity starts at the cold-wall temperature.

Differentially heated square cavity with hot left wall, cold right wall, adiabatic horizontal walls and a circulating flow
Prescribed circulation redistributes heat without solving the momentum equations.
Governing balance
Velocity field u = −U0 sin(πx) cos(πy)
v = U0 cos(πx) sin(πy)
Thermal boundaries Fixed temperature on the vertical walls and zero normal temperature gradient on the horizontal walls
Numerical method

A conservative finite-volume formulation

Face fluxes transport heat through every control volume while ghost cells impose the thermal boundary conditions.

01

Advection

First-order upwind face values maintain a stable and bounded temperature field.

02

Diffusion

Second-order central gradients represent the constant-diffusivity thermal fluxes.

03

Time integration

Forward Euler advances the transient solution with a combined advection-diffusion stability restriction.

04

Stationarity

Near steady state is accepted after the maximum temperature-change rate remains below 10−6 over repeated checks.

Transient transport

The vortex bends the temperature field

Heat enters through the left wall and is carried around the cavity by the imposed circulation.

Warm fluid travels toward the upper and right regions while colder fluid returns toward the hot side along the lower part of the cavity. Diffusion smooths the field and forms the wall gradients.

Near-steady 80 by 80 temperature field with the prescribed vortex shown by white arrows
Finest 80 × 80 result near the end of the recorded simulation.
Grid convergence

Four grids, one refinement trend

Refinement sharpens the near-wall gradients and reduces the visible numerical diffusion of the first-order upwind scheme.

20 × 20 Δx = 0.0500 Δt ≈ 0.02404

Low-cost overview with broad thermal gradients.

40 × 40 Δx = 0.0250 Δt ≈ 0.01157

Clearer boundary layers and stronger internal detail.

60 × 60 Δx ≈ 0.01667 Δt ≈ 0.00744

Smooth contours close to the finest-grid behaviour.

80 × 80 Δx = 0.0125 Δt ≈ 0.005388

Reference case with the most resolved wall gradients.

Practical conclusion

The 60 × 60 and 80 × 80 fields show only small visual differences, indicating that the solution is approaching practical grid convergence.

Engineering outcome

A verified solver for coupled transport

The project combined conservation, numerical stability and grid refinement in one transient thermal model.

It demonstrated how imposed circulation reshapes heat transfer and how increasing resolution improves the representation of thermal boundary layers.

  • Finite-volume balance
  • Upwind advection
  • Central diffusion
  • Grid convergence