  We model two-dimensional systems of granular aggregates confined between two
planes and demonstrate that at a critical grain volume fraction an abrupt
rigidity transition occurs. This transition is observed both in static and
shear tests. The grain volume fraction at which the transition occurs, $\nu_c$,
decreases with increasing friction between the grains. Densely packed grains,
with a volume fraction $\nu> \nu_c$, display an elastic-plastic rheology.
Dilute packings, with $\nu<\nu_c$, display gas-like characteristics. Packings
with $\nu=\nu_c$ display phase coexistance. It is shown that when volume
fraction is allowed to change freely (using constant normal stress boundary
condition), it evolves spontaneously to $\nu_c$ under a wide range of boundary
conditions, exhibiting 'self-organized criticality'.
