A granular material is a conglomeration of discrete solid, macroscopic particles characterized by a loss of energy whenever the particles interact (the most common example would be friction when grains collide). The constituents that compose granular material must be large enough such that they are not subject to thermal motion fluctuations. Thus, the lower size limit for grains in granular material is about 1 µm. On the upper size limit, the physics of granular materials may be applied to ice floes where the individual grains are icebergs and to asteroid belts of the Solar System with individual grains being asteroids.
Some examples of granular materials are snow, nuts, coal, sand, rice, coffee, corn flakes, fertilizer and ball bearings. Powders are a special class of granular material due to their small particle size, which makes them more cohesive and more easily suspended in a gas. Granular materials are commercially important in applications as diverse as pharmaceutical industry, agriculture, and energy production. Research into granular materials is thus directly applicable and goes back at least to Charles-Augustin de Coulomb, whose law of friction was originally stated for granular materials.
The soldier/physicist Brigadier Ralph Alger Bagnold was an early pioneer of the physics of granular matter and whose book The Physics of Blown Sand and Desert Dunes remains an important reference to this day.
In some sense, granular materials do not constitute a single phase of matter but have characteristics reminiscent of solids, liquids, or gases depending on the average energy per grain. However, in each of these states granular materials also exhibit properties which are unique.
Granular materials also exhibit a wide range of pattern forming behaviors when excited (e.g. vibrated or allowed to flow). As such granular materials under excitation can be thought of as an example of a complex system.
When the average energy of the individual grains is low and the grains are fairly stationary relative to each other, the granular material acts like a solid. In general, stress in a granular solid is not distributed uniformly but is conducted away along so-called force chains which are networks of grains resting on one another. Between these chains are regions of low stress whose grains are shielded for the effects of the grains above by vaulting and arching.
If the granular material is driven harder such that contacts between the grains become highly infrequent, the material enters a gaseous state. Correspondingly, one can define a granular temperature equal to the root mean square of grain velocity fluctuations that is analogous to thermodynamic temperature. Unlike conventional gases, granular materials will tend to cluster and clump due to the [dissipative] nature of the collisions between grains. This clustering has some interesting consequences. For example, if a partially partitioned box of granular materials is vigorously shaken then grains will over time tend to collect in one of the partitions rather than spread evenly into both partitions as would happen in a conventional gas. This effect, known as the granular Maxwell's demon, does not violate any thermodynamics principles since energy is constantly being lost from the system in the process.
Granular systems are known to exhibit jamming and undergo a jamming transition which is thought of as a thermodynamic phase transition to a jammed state. The Lubachevsky-Stillinger algorithm of jamming allows one to produce simulated jammed granular configurations. 
Excited granular matter is a rich pattern-forming system. Some of the pattern-forming behaviours seen in granular materials are:
Some of the pattern-forming behaviours have been possible to reproduce in computer simulations.  There are two main computational approaches to such simulations, time-stepped and event-driven, the former being the most efficient for a higher density of the material and the motions of a lower intensity, and the latter for a lower density of the material and the motions of a higher intensity.
Some beach sands, such as those of the aptly named Squeaky Beach, exhibit squeaking when walked upon. Some desert dunes are known to exhibit booming during avalanching or when their surface is otherwise disturbed. Granular materials discharged from silos produce loud acoustic emissions in a process known as silo honking.
Several methods are available for modeling of granular materials. Most of these methods consist of the statistical methods by which various statistical properties, derived from either point data or an image, are extracted and used to generate stochastic models of the granular medium. A recent and comprehensive review of such methods is available in Tahmasebi and other (2017).