In this paper, a Particle Swarm Optimization (PSO) algorithm is presented to find the optimal combination of corrosion rate parameters for a refining process in the oil industry. The experimental data in this paper are constituted by results obtained from field tests. Maintenance control is a very important aspect in order to prevent substantial damage to facilities, equipment and people. Other important factor to consider is the cost of maintenance which tends to reduce the required actions. The main parameters in corrosion control are flow, concentration of sulfur species, total acid number (TAN), temperature, and chromium content. However it is not easy to know the combined effect of different variables due to synergistic effects. Particle swarm optimization (PSO) is a population based stochastic optimization technique, inspired by social behavior of bird flocking or fish schooling. The system is initialized with a population of random solutions and searches for optima by updating generations. In PSO, the potential solutions, called particles, fly through the problem space by following the current optimum particles.