Linear gas stoppers are widely used to convert high-energy, rare-isotope beams and reaction products into low-energy beams with small transverse emittance and energy spread. Stopping of the high-energy ions is achieved through interaction with a buffer gas, typically helium, generating large quantities of He$^+$/e$^-$ pairs. The Advanced Cryogenic Gas Stopper (ACGS) was designed for fast, efficient stopping and extraction of high-intensity, rare-isotope beams. As part of the design process, a comprehensive particle-in-cell code was developed to optimize the transport and extraction of rare isotopes from the ACGS in the presence of space charge, including He$^+$/e$^-$ dynamics, buffer gas interactions including gas flow, RF carpets, and ion extraction through a nozzle or orifice. Details of the simulations are presented together with comparison to experiment when available.