A discrete reduced distance method to generate 2-D and 3-D granular po
rous media is presented. The main property of the method is to produce
heterogeneous and/or anisotropic packed beds of joined grains with ar
bitrary shapes and optimum fitting (i.e., minimum porosity). The itera
tive generation process starts with the coarsest grain and adjusts the
size and location of the next ones depending on the updated available
space. Hence, grain size distribution cannot be specified directly bu
t is merely the consequence of user defined input parameters. The latt
er consists of a set of randomly distributed initial points, a few typ
ical predefined grain shapes as well as the minimum and maximum grain
diameters. The simulated granular media can readily be processed by an
appropriate mesh generator to allow for subsequent numerical solution
s of differential equations.