K e y w o r d s: PathFinder code, porous media, granular beds, tortuosity. A b s t r a c t This paper discusses a new approach to analyzing fluid flow through a granular bed. The analysis involves the determination of a set of geometric parameters characterizing a granular bed based on information about the location and diameter of all bed particles. The above task has been achieved with the use of the PathFinder numeric code developed by the authors. The study proposes a new algorithm for calculating the parameters of granular beds composed of spherical particles with various diameters in the PathFinder program. The algorithm has been verified with the use of independent tools and implemented in the new version of the PathFinder code. The modified algorithm's effect on flow path tortuosity has been analyzed. Path length is used to determine tortuosity, a key parameter of pore geometry that is difficult to calculate. Comparative calculations were performed in a granular bed generated by the Discrete Element Method in the PFC 3D program