Convection and size separation occur when granular material is shaken in the
vertical direction. Convective flow takes the form of rolls that
continuously
transport grains up and then down again. In cylindrical or rectangular
vessels
the flow will be upwards in the center and downwards in a thin stream
along
the side walls, leading to the formation of a central heap. With different
boundary conditions, such as side walls that are slanted outward, it is
possible to reverse the sense of the convection roll and to induce
downward
flow in the center, resulting in two heaps flanking a central depression.

This data set, obtained from MRI data shows the vertical component, vz(z), of the convection velocity (displacement per tap) of granular material along the central axis in a vibrated cylinder for several values of the applied, peak acceleration (in units of the Earth's acceleration, g = 9.81 m/s2). Positive values for v(z) indicate upward movement of the particles. Note that in this plot a straight line indicates an exponential increase of the velocity as the depth, z, below the top surface is decreased. Near the very top surface, i.e. near z = 0, v(z) is reduced since the material no longer is moving only vertically upward, but also moves out toward the cylinder walls (this gives rise to a large horizontal component which is not shown here). This data set, as well as the corresponding MR images are described further and analyzed in a recent paper. More detailed data on the depth dependence of the axial flow (along the cylinder axis) can be obtained by direct visual particle tracking (see Knight et al, Experimental Study of Granular Convection). Our experiments show the existance of a typical lengthscale over which the convection velocity decays below the top surface, and thus also the depth of the convection rolls as well as a typical timescale that characterizes the convection speed. Both paramters scale with vibration parameters, such as shaking amplitude and frequency.
MRI can also provide detailed information about the radial convection
velocity profile, vz(r), as shown below:

In this data set, the three curves show data obtained from MRI data for three different size containers. The radial coordinate, r, is measured from the central axis of the cylindrical container (in units of the bead diameter, d). Also shown are fits to a parabolic flow profile (as one would expect for simple laminar flow of a liquid in a pipe; clearly this does not work for granular flow!), and to a functional form (cosh or certain Bessel functions) that exhibit an exponential decay of the velocity away from the walls. Such exponential, radial decay appears to fit extremely well and naturally leads to the blunt velocity profiles observed in the wider containers. In all cases the stippled lines give the location of the control lines before the shake was applied, and their widths indicate the widths of the containers. Note how the flow is upward (positive v) in the middle of the container, and downward (negative v) in a narrow region near the walls. This and many more detailed data sets, a scaling analysis, and a simple model for both the vertical and radial velocities are contained in our recent paper(Knight et al, Experimental Study of Granular Convection).
One way to reverse the sense of the convection rolls is to change the
boundary conditions. Specifically, if instead of a straight cylindrical
vessel (as in the examples above) a vessel with flared-out walls is used,
the flow can be reversed (depending on the applied acceleration and other
parameters such as the wall angle) and now beads move down in the center
and up along the walls. Below we show this for a quasi two-dimensional geometry
(about ten particle diameters deep, a few hundred wide) with circular walls:

Top left (a) shows the system before vertical shaking began (the layering,
using different color sand in the actual experiment, is for easier visualization).
In image (b) shaking has commenced and clearly the upward deformation
of the stripes along the walls is visable. After a few minutes of shaking
the sand is all mixed (c), and particles flow up along the sides and avalanche
down towards the central depression. (d)At higher applied accelerations the
heap angle steepens.
A color image of this situation shows that there is radial segregation.
(Note the white particles are smaller and/or rougher than the colored ones).
These pictures are adapted from an overview article that appeared in the MRS Bulletin in 1994.
A detailed investigation of roll reversal can be found in our paper (Knight, External Boundaries and Internal Shear Bands in Granular Convection).
If there are larger grains in a mixture of granular media confined to
a vessel with rough, vertical walls then they will invariably rise to the
top if the mix is subjected to vertical vibrations. This is often referred
to as the Brazil Nut Effect, and it can be a nuisance or a blessing
for industry, depending on the application.
The main question is: if shaking fluidizes a granular material, why do larger objects move up and why don't they sink down as they would in any ordinary fluid?
What happened to entropy if shaking induces de-mixing?
The answer is that we are dealing with a system which is far from equilibrium, and that dynamic effects outweigh any thermodynamical considerations.
Instead of a nut mix with lots of large Brazil nuts, consider instead a
bunch of coffee beans embedded in smaller coffee grounds. This system is
easily imaged via MRI as shown here in a cross-section :
(image by J. Knight and D. Kovar)
Our research shows an intimate connection of the Brazil nut phenomenon with granular convection:
the larger particles are carried along with the convective motion of the
smaller, background particles. Once at the top surface, the larger ones
become trapped when they cannot fit into the narrow region along the walls
reserved for the downward flow. The set of images below demonstrates this
for five large coffee beans that were placed inside a background of poppy
seeds (the poppy seeds provide the stronger MRI signal, so the beans appear
as dark holes):

Time in this picture runs from left to right; the initial placement of
the beans is visible in the left column of images, the next columns show
snapshots at later times. The four rows show four vertical cuts through
the cylindrical container: one close to the front, two near the center (that's
why they are slightly wider!), and one closer to the back. You can clearly
see the beans rise as time progresses, and you can also see an indication
of the radial velocity profiles (the beans near
the central container axis rise faster). The above image is taken from
unpublished work by Jim Knight.