In the diesel particulate filters technology a key aspect is represented by the properties of the particulate matter that is collected inside their structure. The work presented is focused on the development of an innovative mathematical tool based on the particle-in-cell method (PIC) for the simulation of the soot distribution inside a single channel of a diesel particulate filter. The basic fluid dynamic equations are solved for the gas phase inside the channel using a novel technique based on the solution of the same set of equations everywhere in the system including the porous medium. This approach is presented as alternative to the more conventional methods of matching conditions across the boundary of the porous region where a Darcy-like flow is developed. The motion of the soot solid particles is instead described through a particle-by-particle approach based on Newton's equations of motion. The coupling between the dynamics of the gas and that of the soot particles, i.e. between these two sub-models, is performed through the implementation of the particle-in-cell technique. This model allows the detailed simulation of the deposition and compaction of the soot inside the filter channels and its characterization in terms of density, permeability and thickness. The model then represents a unique tool for the optimization of the design of diesel particulate filters. The details of the technique implementation and some paradigmatic examples will be shown.