A new numerical model for computing the formation of sedimentary structures in a fluvial environment is presented. The model has been used to explain the strata-forming processes under antidunes in detail, including water velocities, turbulence, free surface location, erosion, sedimentation and formation of each sediment layer. The Reynolds-Averaged Navier-Stokes equations were solved together with the k-epsilon turbulence model to determine the water flow field and the bed shear stress on a width-averaged two-dimensional grid. The sediment transport was computed by solving convectiondiffusion equations for multiple sediment sizes. An empirical formula for resuspension at the bed was used, enabling the computation of erosion and deposition for each sediment fraction. Five sediment sizes were used, from 0.5 to 2.5 mm. The bed sediment stratification was recorded using a very fine grid, resolving the bedding with up to 1000 cells in the vertical direction. A novel algorithm was used to vertically adapt the bed grid, enabling the computation of very large gradients of the grain size distribution, including thin laminae. The model was tested by computing sediment deposition in a channel with a Froude number of 1.21. The hydraulic parameters and the average sediment size were selected similar to an earlier laboratory flume study where downstream-migrating antidunes were observed.The antidunes started as small bed irregularities and increased in size as they moved in the downstream direction. Recirculation zones were observed behind bedforms with large slopes on the lee side. Here, sediments deposited in slides. Smaller sediment waves moving on top of the bedforms, depositing layers of a fine and a coarse material simultaneously. After the initial phase, stationary antidunes formed in the upstream and middle part of the flume, producing wavy sedimentary structures. Sinusoidal crosslamination formed in deposits under bedforms of different downstream velocities. The antidunes in the downstream part of the flume moved in the streamwise direction. They were affected by occasional upstream-moving surface waves, causing complex sedimentary structures to form. Figures and videos show the strata-forming process in detail, including velocity vectors, turbulence and layers of different particle diameters.