  We present a method to impose linear shear flow in discrete-velocity kinetic
models of hydrodynamics through the use of sliding periodic boundary
conditions. Our method is derived by an explicit coarse-graining of the
Lees-Edwards boundary conditions for Couette flow in molecular dynamics,
followed by a projection of the resulting equations onto the subspace spanned
by the discrete velocities of the lattice Boltzmann method. The boundary
conditions are obtained without resort to perturbative expansions or
modifications of the discrete velocity equilibria, allowing our method to be
applied to a wide class of lattice Boltzmann models. Our numerical results for
the sheared hydrodynamics of a one-component isothermal fluid show excellent
agreement with analytical results, while for a two-component fluid the results
show a clear improvement over previous methods for introducing Lees-Edwards
boundary conditions into lattice Boltzmann. Using our method, we obtain a
dynamical steady state in a sheared spinodally decomposing two-dimensional
fluid, under conditions where previous methods give spurious finite-size
artifacts.
