In this project we develop efficient algorithms for the numerical simulation of large packings of granular materials. Large heaps of granular systems and packings deposited onto a solid surface appear in many scenarios in engineering and science. We investigate such systems by means of numerical simulations using the ballistic deposition algorithm, which allows us to produce packings of millions of particles in a few minutes of computing time. By extending this algorithm in order to account for complex particle shapes, we study the dynamics of agglomerates of nanoparticles. Our simulations reveal that nanopowders develop a robust fractal substructure after repeated fragmentation and reagglomeration.