  Black holes are believed to be crucial in regulating star formation in
massive galaxies, which makes it essential to faithfully represent the physics
of these objects in cosmological hydrodynamics simulations. Limited spatial and
mass resolution and the associated discreteness noise make following the
dynamics of black holes especially challenging. In particular, dynamical
friction, which is responsible for driving massive black holes towards the
centres of galaxies, cannot be accurately modelled with softened $N$-body
interactions. A number of subgrid models have been proposed to mimic dynamical
friction or directly include its full effects in simulations. Each of these
methods has its individual benefits and shortcomings, while all suffer from a
common issue of being unable to represent black holes with masses below a few
times the simulated dark matter particle mass. In this paper, we propose a
correction for unresolved dynamical friction, which has been calibrated on
simulations run with the code KETJU, in which gravitational interactions of
black holes are not softened. We demonstrate that our correction is able to
sink black holes with masses greater than the dark matter particle mass at the
correct rate. We show that the impact of stochasticity is significant for
low-mass black holes ($M_{\rm BH} \leq 5 M_{\rm DM}$) and propose a correction
for stochastic heating. Combined, this approach is applicable to next
generation cosmological hydrodynamics simulations that jointly track galaxy and
black hole growth with realistic black hole orbits.
