Sudden changes in the flow direction are quite common but are inevitable in the lay-out in gas ducting in process and power plants. While it is well known that such changes lead to high pressure drops and flow separation, the scope for optimization is limited by constraints such as on-site fabrication and lay-out limitations. In the present paper, we present an efficient, computational fluid dynamics (CFD)-based shape optimization method which results in lesser pressure drop and more streamlined flow while adhering to site-specific constraints in terms of the extent of changes that can be made. The method is based on velocity defect in the plane of the bend: if, at a particular streamwise location, the average velocity in one half of cross section is above (or below) the cross sectional average velocity by, say, 10% or more, then the width of the duct locally is increased (or decreased), if it is possible to do so within the lay-out restrictions. An iterative application of this criterion using a commercial CFD code is shown to lead to better design of the bend. The optimized solution is validated with experimental results. © 2013 The Institution of Chemical Engineers.