We have developed a full numerical method to study the gas dynamics of cometary ultra-compact (UC) H II regions, and associated photodissociation regions (PDRs). The bow-shock and champagne-flow models with a $40.9/21.9 M_odot$ star are simulated. In the bow-shock models, the massive star is assumed to move through dense ($n=8000~cm^{-3}$) molecular material with a stellar velocity of $15~km~s^{-1}$. In the champagne-flow models, an exponential distribution of density with a scale height of 0.2 pc is assumed. The profiles of the [Ne II] 12.81mum and $H_2~S(2)$ lines from the ionized regions and PDRs are compared for two sets of models. In champagne-flow models, emission lines from the ionized gas clearly show the effect of acceleration along the direction toward the tail due to the density gradient. The kinematics of the molecular gas inside the dense shell is mainly due to the expansion of the H II region. However, in bow-shock models the ionized gas mainly moves in the same direction as the stellar motion. The kinematics of the molecular gas inside the dense shell simply reflects the motion of the dense shell with respect to the star. These differences can be used to distinguish two sets of models.