A unified accretion disc model for supermassive black holes in galaxy formation simulations: method and implementation Article in Monthly Notices of the Royal Astronomical Society (June 2024)