Simulations relevant to the beam instability in the foreshock