  In the context of subaqueous ripple and dune formation, we present here a
Reynolds averaged calculation of the turbulent flow over a topography. We
perform a weakly non-linear expansion of the velocity field, sufficiently
accurate to recover the separation of streamlines and the formation of a
recirculation bubble above some aspect ratio. The basal stresses are
investigated in details; in particular, we show that the phase shift of the
shear stress with respect to the topography, responsible for the formation of
bedforms, appears in an inner boundary layer where shear stress and pressure
gradients balance. We study the sensitivity of the calculation with respect to
(i) the choice of the turbulence closure, (ii) the motion of the bottom (growth
or propagation), (iii) the physics at work in the surface layer, responsible
for the hydrodynamic roughness of the bottom, (iv) the aspect ratio of the
bedform and (v) the effect of the free surface, which can be interpreted in
terms of standing gravity waves excited by topography. The most important
effects are those of points (iii) to (v). We show that the dynamical mechanisms
controlling the hydrodynamical roughness (mixing due to roughness elements,
viscosity, sediment transport, etc) have an influence on the basal shear stress
when the thickness of the surface layer is comparable to that of the inner
layer. We evidence that non-linear effects tend to oppose linear ones and are
of the same order for bedform aspect ratios of the order of 1/10. We show that
the influence of the free surface on the basal shear stress is dominant when
the wavelength is large compared to the flow depth, so that the inner layer
extends throughout the flow and in the resonant conditions, and when the
downstream material velocity balances the upstream wave propagation.
