P-wave attenuation by slow-wave diffusion is a significant loss mechanism at seismic frequencies. This effect is known as mesoscopic loss, because it is a consequence of fluid flow at mesoscopic-scale inhomogeneities. These are larger than the pore size but smaller than the wavelength, typically tens of centimeters, and are due to local variations in lithological properties or to patches of immiscible fluids. Basically, a P-wave traveling in a porous medium induces a fluid-pressure gradient in regions of different properties, such as patches saturated with different fluids, generating slow P-waves, which diffuse away from the interfaces separating the fluids. This mechanism can be explained by the combined effect of mesoscopic-scale inhomogeneities and mode conversion at interfaces. We consider a periodically stratified medium and perform numerical experiments to determine the P-wave quality factor in partially saturated rocks. The modeling method is an iterative domain-decomposition 2D finite-element algorithm for solving Biot equations of motion in a parallel computer, which is a requirement to run the numerical experiments at seismic frequencies. The simulated pulses show evidence of the mesoscopic-loss mechanism, and the quality factors estimated with the spectral-ratio and frequency-shift methods are in good agreement with the theoretical values predicted by the White theory. Errors in the estimation of the quality factor are less than 5% (spectral ratio) and 3% (frequency shift).