A recently understood ability of sound to cross narrow vacuum gaps between material bodies has numerous implications in modern technology, where it opens additional channels for the transfer of heat and acoustic signals between narrowly separated objects. Acoustic vibrations in a body are characterized by perturbations of its surface and of its material density, which affect molecules of another body via intermolecular forces. Methods of continuum mechanics allow the description of the acoustic waves initiated by external body forces, including van der Waals forces. The expressions for such forces have been known for many years, but their applications to configurations relevant to sound transmission are often based on restrictive approximations and asymptotic expansions, which are rarely satisfied in practical situations, where amplitudes of molecular displacements may be in a picometer range. This paper develops a method of accurate computations of van der Waals forces caused by such perturbations with scales comparable with intermolecular distances in a material. The accuracy of the developed approach is limited only by calculation errors, and the scope of its applications is not only limited to acoustic perturbations but also includes the description of van der Waals forces caused by arbitrary molecular density perturbations, by corrugated surfaces, contaminated materials, etc.