An S-Band (2998 MHz) Radio Frequency (RF) cavity to accelerate electrons was developed taking into account the beam space charge, the relativistic change in velocity of the low energy beam particle distribution through the cavity, and the emittance growth. The electromagnetic design and geometry optimization were done using the codes Poisson Superfish (PSF) and CST Studio (CST). In addition, beam dynamics simulations were done using the program Travel to optimize the emittance and take into account the space charge effect.