Beam flatness is an important parameter that determines the performance and the lifetime of a gridded ion thruster. To improve the beam flatness of the 30 cm (LIPS-300) ion thruster, variable aperture ion optics that adapts to the decreasing ion density as the radius increases is proposed. It is the ion optics that the screen grid surface is divided into several zones, where the aperture diameter in each zone is determined by the ion density and the electron temperature upstream of the screen grid. The beam current density in the central area is artificially reduced. A particle in cell-Monte Carlo collision model is applied in this work to investigating the effect of variable aperture on the perveance and the maximum beam current per aperture by simulating the extraction, focusing and acceleration processes of ions. Taking into account the engineering implementability, the screen grid surface is divided into four zones. The hole diameter in each zone is decreased from 1.95 mm to 1.8 mm, 1.9 mm, 1.8 mm and 1.7 mm, respectively. The simulation results show that the maximum ion density in the center area of grid is decreased by 10.6% and 6.99%, while it is increased by 6.49% and 22.3% in the edge region, respectively. The beam flatness of the variable aperture ion optics is improved from 0.69 to 0.88. The erosion rate is decreased by 31.9%, but the total beam current is also decreased by 7.15%. The simulation results can provide a valuable reference of the development of the ion thruster.