In this paper, a novel flexible AC transmission system (FACTS) device named generalized optimal unified power flow controller (GOUPFC) is introduced to control the power flows in multi transmission lines and to regulate the voltages and angles at the load buses. The detailed power injection modeling of GOUPFC is presented in this paper. The optimal location of GOUPFC is determined based on line collapse proximity indicator (LCPI). A multi-objective function is framed in terms of average voltage deviation (AVDI), real power loss (Ploss) and average line collapse proximity indicator (LCPIavg) to test the effectiveness of the proposed device. The simulation studies are performed on standard IEEE 57-bus test system under single line contingency and considering various renewable energy source (RES) penetrations. The control parameters of GOUPFC are optimized by using whale optimization (WO-BAT) algorithm, by hybridizing WOA and BAT algorithms, and the superiority of WO-BAT is observed in minimizing the proposed objective function and enhancing the voltage profile.