Kinetic theory and acoustic measurements have proven that the bulk viscosity associated with the expansion or compression effect cannot be ignored in compressible fluids except for monatomic gases. A new theoretical formula for the bulk viscosity coefficient (BVC)
is derived by the continuum medium methodology, which provides a further understanding of the bulk viscosity, i.e.
is equal to the product of the bulk modulus
and the relaxation time
). The continuum and kinetic theories present consistent results from macro- and microperspectives respectively, only differing in terms of a coefficient. The theoretical predictions of the BVC in diatomic molecules, such as
and CO, show good agreement with the experimental data over a wide range of temperature. In addition, the vibrational contributions to
are controlled by a rapid exponential decrease at high temperatures, while at low temperatures a slow linear increase proceeds for the rotational cases. The relaxation time
, collision number
and ratio of bulk-to-shear viscosities
in the vibrational mode are found to be several orders of magnitude larger than those in the rotational mode.