Flux dynamics in an annular long Josephson junction is studied. Three main topics are covered. The first is chaotic flux dynamics and its prediction via Melnikov integrals. It turns out that DC current bias cannot induce chaotic flux dynamics, while AC current bias can. The existence of a common root to the Melnikov integrals is a necessary condition for the existence of chaotic flux dynamics. The second topic is on the components of the global attractor and the bifurcation in the perturbation parameter measuring the strength of loss, bias and irregularity of the junction. The global attractor can contain co-existing local attractors e.g. a local chaotic attractor and a local regular attractor. In the infinite dimensional phase space setting, the bifurcation is very complicated. Chaotic attractors can appear and disappear in a random fashion. Three types of attractors (chaos, breather, spatially uniform and temporally periodic attractor) are identified. The third topic is ratchet effect. Ratchet effect can be achieved by a current bias field which corresponds to an asymmetric potential, in which case the flux dynamics is ever lasting chaotic. When the current bias field corresponds to a symmetric potential, the flux dynamics is often transiently chaotic, in which case the ratchet effect disappears after sufficiently long time.