  Many sedimentary rocks are formed by migration of sand ripples. Thin layers
of coarse and fine sand are present in these rocks, and understanding how
layers in sandstone are created has been a longstanding question. Here, we
propose a mechanism for the origin of the most common layered sedimentary
structures such as inverse graded climbing ripple lamination and
cross-stratification patterns. The mechanism involves a competition between
three segregation processes: (i) size-segregation and (ii) shape-segregation
during transport and rolling, and (iii) size segregation due to different
hopping lengths of the small and large grains. We develop a discrete model of
grain dynamics which incorporates the coupling between moving grains and the
static sand surface, as well as the different properties of grains, such as
size and roughness, in order to test the plausibility of this physical
mechanism.
