Due to tight thermal integration and the requirement for large volumetric flow rates, air ducting of a power plant is boxy in structure and contains abrupt changes in flow direction and cross-section, flow splits and mergers. Achieving a desired flow distribution among several possible paths is therefore a difficult task. In recent years, computational fluid dynamics (CFD) has emerged as a useful tool for flow analysis in a number of industrial applications. In the present study, a flow control algorithm is developed for optimally locating guide vanes in header manifolds to achieve a desired flow distribution. It is based on evaluating approximately the sensitivity of flow distribution at a flow split to the orientation of guide vanes. A simple gradient-based method has been developed which enables a robust, automated procedure for finding the optimal orientation of guide vanes in a small number of CFD computations. Its application to a typical industrial flow situation containing sharp bends and flow splits has been illustrated through a case study and verified experimentally. © 2015 Elsevier Ltd. All rights reserved.