The simulation of resistive plate chambers in avalanche mode: charge spectra and efficiency