When ships enter ports, they discharge ballast water. Ballast water, or seawater from foreign countries, causes marine pollution when discharged into ports without sterilization treatment owing to the harmful marine life that it contains. Thus, the International Maritime Organization (IMO) mandates the installation of ballast water sterilization devices to preserve marine ecosystems. This study aims to increase the generation of microbubbles by mounting a static mixer on a tube connected to a ballast tank and a three-layer membrane structure around the static mixer to improve the efficiency of the electric sterilization method. Microbubble generation is expected to increase as the pressure between the inlet and outlet of the pipe and the vorticity decrease. This study intends to implement an optimal NaOH continuous generation system by determining the optimal seawater flow rate, bed sphere diameter, and porosity through numerical analysis. The results show that the conditions of seawater with a flow rate of 220 lph, a bed sphere diameter of 0.01 m, and a porosity of 0.3 were optimized for the NaOH continuous generation system.