Photospheric vortex flows as a cause for two-ribbon flares: A topological model