We have built up a computer simulation of the detection mechanism in the diamond radiation detectors. The diamond detectors can be fabricated from a chemical vapour deposition polycrystalline diamond film. In this case, the trapping-detrapping and recombination at the defects inside the grains and at the grain boundaries degrade the transport properties of the material and the charge induction processes. These effects may strongly influence the device's response. Previous simulations of this kind of phenomena in the diamond detectors have generally been restricted to the simple detector geometries and homogeneous distribution of the defects. In our model, the diamond film (diamond detector) is simulated by a grid. We apply a spatial and time discretization, regulated by the grid resolution, to the equations describing the charge transport and, by using the Shockley-Ramo theorem, we calculate the signal induced on the electrodes. In this way, we can simulate the effects of the nonhomogeneous distributions of the trapping, recombination, or scattering centers and can investigate the differences observed when different particles, energies, and electrode configurations are used. The simulation shows that the efficiency of the detector increases linearly with the average grain size, that the charge collection distance is small compared to the dimensions of a single grain, and that for small grains, the trapping at the intragrain defects is insignificant compared to the effect of the grain boundaries. (C) 2004 American Institute of Physics.