  Chemistry plays a key role in many aspects of astrophysical fluids. Atoms and
molecules are agents for heating and cooling, determine the ionization
fraction, serve as observational tracers, and build the molecular foundation of
life. We present the implementation of a chemistry module in the publicly
available magneto-hydrodynamic code Athena++. We implement several chemical
networks and heating and cooling processes suitable for simulating the
interstellar medium (ISM). A general chemical network framework in the KIDA
format is also included, allowing the user to easily implement their own
chemistry. Radiation transfer and cosmic-ray ionization are coupled with
chemistry and solved with the simple six-ray approximation. The chemical and
thermal processes are evolved as a system of coupled ODEs with an implicit
solver from the CVODE library. We perform and present a series of tests to
ensure the numerical accuracy and convergence of the code. Many tests combine
chemistry with gas dynamics, including comparisons with analytic solutions, 1D
problems of the photo-dissociation regions and shocks, and realistic 3D
simulations of the turbulent ISM. We release the code with the new public
version of Athena++, aiming to provide a robust and flexible code for the
astrochemical simulation community.
