Particle-in-cell techniques for the study of space charge effects in an electrostatic ion beam trap.