Simulation of dynamic changes in near-surface composition during ion bombardment