  Developing theoretical frameworks for vibrational strong coupling (VSC)
beyond the single-mode approximation is crucial for a comprehensive
understanding of experiments with planar Fabry-P\'erot cavities. Herein, a
generalized cavity molecular dynamics (CavMD) scheme is developed to simulate
VSC of a large ensemble of realistic molecules coupled to an arbitrary 1D or 2D
photonic environment. This approach is built upon the Power-Zienau-Woolley
Hamiltonian in the normal mode basis and uses a grid representation of the
molecular ensembles to reduce the computational cost. When simulating the
polariton dispersion relation for a homogeneous distribution of molecules in
planar Fabry-P\'erot cavities, our data highlight the importance of preserving
the in-plane translational symmetry of the molecular distribution. In this
homogeneous limit, CavMD yields the consistent polariton dispersion relation as
analytic theory, i.e., incorporating many cavity modes with varying in-plane
wave vectors ($k_{\parallel}$) produces the same spectrum as the system with a
single cavity mode. Furthermore, CavMD reveals that the validity of the single
mode approximation is challenged when nonequilibrium polariton dynamics are
considered, as polariton-polariton scattering occurs between modes with nearest
neighbor $k_{\parallel}$. The procedure for numerically approaching the
macroscopic limit is also demonstrated with CavMD by increasing the system
size. Looking forward, our generalized CavMD approach may facilitate
understanding vibrational polariton transport and condensation.
