In this research, a combined method of computational fluid dynamics and population balance model were used to simulate the electrostatic desalter units using the ANSYS Fluent software. The goal of this study is to investigate the effective parameters in separating brine from oil and optimizing the desalter performance. The model was subjected to sensitivity analysis for four parameters: temperature, wash water percentage, inlet distributor, and electrodes arrangements. The results showed that raising the temperature up to 130 °C and increasing the wash water percentage improved the separation. Also, the separation is greatly improved by switching to a T-shaped input distributor. The separation is not considerably affected by the number of horizontal electrodes, while the vertical electrodes have a negative impact. Finally, sensitivity analysis was performed on an existing desalter located in one of the Iran’s oil fields. The findings demonstrated that the current situation does not meet the acceptable limit of 0.3% vol of brine in the oil outlet. The desalter outlet meet the specifications by switching the type of distributor to a T-shaped one, and additionally when the temperature is 90 °C and 10% wash water or 100 °C and 8.3% wash water without changing the geometry.