Dynamical friction and the evolution of black holes in cosmological simulations: A new implementation in OpenGadget3 | Synapse