Accretion on to supermassive black holes (SMBHs) in galaxy formation simulations is frequently modelled by the Bondi–Hoyle formalism. Here we examine the validity of this approach analytically and numerically. We argue that the character of the flow where one evaluates the gas properties is unlikely to satisfy the simple Bondi–Hoyle model. Only in the specific case of hot virialized gas with zero angular momentum and negligible radiative cooling is the Bondi–Hoyle solution relevant. In the opposite extreme, where the gas is in a state of free-fall at the evaluation radius due to efficient cooling and the dominant gravity of the surrounding halo, the Bondi–Hoyle formalism can be erroneous by orders of magnitude in either direction. This may impose artificial trends with halo mass in cosmological simulations by being wrong by different factors for different halo masses. We propose an expression for the sub-grid accretion rate which interpolates between the free-fall regime and the Bondi–Hoyle regime, therefore taking account of the contribution of the halo to the gas dynamics.