Packing of spherical particles in a container is a preliminary step in simulation of fluid flow in porous media. Digital modeling of the porous media is also a requirement in many industrial and research areas, such as Rock Mechanics, Chemical and Petrochemical Engineering, Civil Engineering, etc.In addition to that,the significance and high importance of the subject in the simulation of oil, gas and water in the underground petroleum reservoirs should be emphasized, as it can play an important role in the development of more efficient methods for the exploration and utilization of the oil resources in Iran.Among different approaches that have been utilized for the digital construction of porous media, the Discrete Element Method (DEM) is a well-known technique that has been used by numerous researchers throughout the world and its credibility has been thoroughly verified for several applications. In the present work, using DEM and parallel programming on the graphical processing units (GPU), we have developed a program for the digital packing of a very large number of spherical particles with various diameters. In order to pack such a large number of particles, we have introduced new techniques such as (1) layered packing (2) multiple time step and (3) intelligent methods for determining the right time for updating the neighbor list. To validate the results and the findings of the present work, we have compared the packing density, the coordinate number and the number of loose particles with the values reported by other groups. We have also developed tools that make it possible to zoom in any desired portion of the digitally constructed media and to visually observe that the packing is correct.Contemporary numerical optimization techniques such as memory alignment and increasing the multiprocessor occupancy are exploited along with some novel optimization strategies to enhance the computational performance on graphics processors using C for CUDA programming language. Speed-up of more than 50 times over single processors is achieved on a variety of GPU devices ranging from conventional graphics cards to advanced, high-end GPUs, while the numerical results are in excellent agreement with the available analytical and numerical ones in the literature.In this thesis only packing of particles in a given container has been thoroughly discussed. In addition to that we have numerically simulated a barrier breakage and a rotating container and the results have been briefly discussed. It should, however, be emphasized that the same technique could be used for the analysis of many other important problems in different industries and research fields. Keywords: Packed bed, Discrete Element Method, Parallel programming, Graphics Processing Unit, Granular flow, Density.