  Using density functional theory combined with quasi-harmonic approximation,
we investigate the thermal expansion behaviors of three different types
({\alpha}, {\beta}, and {\gamma}) of graphyne which is a two-dimensional carbon
allotrope composed of sp and $sp^2$ bonds. For each type of graphyne, we obtain
the temperature dependent area variation by minimizing its free energy as a
function of temperature, which is calculated by considering all the phonon
modes in the whole Brillouin zone. We find that all three types of graphyne
exhibit negative in-plane thermal expansion up to $T\lesssim1000$ K. The
observed in-plane thermal contraction can be attributed partially to the ripple
effect, similarly in graphene. The ripple effect itself, however, is not
sufficient to explain anomalously larger thermal contraction found in graphyne
than in graphene. Our deliberate analysis on the phonon modes observed in
graphyne enables us to discover another source causing such thermal expansion
anomaly. We find that there are particular phonon modes with frequencies around
a few hundreds of cm$^{-1}$ existing exclusively in graphyne that may fill
empty spaces resulting in area reduction. These modes are identified as "rigid
unit modes" corresponding to the libration of each rigid unit composed of
$sp^2$ bonds.
