  This is a study of the Euler equations for free surface water waves in the
case of varying bathymetry, considering the problem in the shallow water
scaling regime. In the case of rapidly varying periodic bottom boundaries this
is a problem of homogenization theory. In this setting we derive a new model
system of equations, consisting of the classical shallow water equations
coupled with nonlocal evolution equations for a periodic corrector term. We
also exhibit a new resonance phenomenon between surface waves and a periodic
bottom. This resonance, which gives rise to secular growth of surface wave
patterns, can be viewed as a nonlinear generalization of the classical Bragg
resonance. We justify the derivation of our model with a rigorous mathematical
analysis of the scaling limit and the resulting error terms. The principal
issue is that the shallow water limit and the homogenization process must be
performed simultaneously. Our model equations and the error analysis are valid
for both the two- and the three-dimensional physical problems.
