Simulation of aerosol agglomeration in the free molecular and continuum flow regimes