By examining a systematic set of direct numerical simulations, we develop a model which captures the effect of roughness density on global and local heat transfer in forced convection. The surfaces considered are zero-skewed three-dimensional sinusoidal rough walls with solidities, $\varLambda$ (defined as the frontal area divided by the total plan area), ranging from low $\varLambda = 0.09$ , medium $\varLambda = 0.18$ to high $\varLambda = 0.36$ . For each solidity, we vary the roughness height characterised by the roughness Reynolds number, $k^+$ , from transitionally rough to fully rough conditions. The findings indicate that, as the fully rough regime is approached, there is a pronounced breakdown in the analogy between heat and momentum transfer, whereby the velocity roughness function $\Delta U^+$ continues to increase and the temperature roughness function $\Delta \varTheta ^+$ attains a peak with increasing $k^+$ . This breakdown occurs at higher sand-grain roughness Reynolds numbers ( $k_s^+$ ) with increasing solidity. Locally, we find that the heat transfer can be meaningfully partitioned into two categories: exposed, high-shear regions experiencing higher heat transfer obeying a local Reynolds analogy and sheltered, reversed-flow regions experiencing lower and spatially uniform heat transfer. The relative contribution of these distinct mechanisms to the global heat transfer depends on the fraction of the total surface area covered by these regions, which ultimately depends on $\varLambda$ . These insights enable us to develop a model for the rough-wall heat-transfer coefficient, ${C_{h,k}(k^+, \varLambda, Pr)}$ , where $Pr$ is the molecular Prandtl number, that assumes different heat-transfer laws in exposed and sheltered regions. We show that the exposed–sheltered surface-area fractions can be modelled through simple ray tracing that is solely dependent on the surface topography and a prescribed sheltering angle. Model predictions compare well when applied to heat-transfer data of traverse ribs from the literature.