The present work proposes a design methodology to achieve a desired single phase flow distribution in a T-junction. The desired flow control is achieved by contouring the flow path of the duct using three bi-quadratic Bézier curves. A Bézier curve is one of the parametric curves which is defined by a set of a few control points. These curves possess some interesting properties which render them as a good choice for the representation of smooth curves. A bi-quadratic Bézier curve is defined by five control points of which four are fixed in the present work (two control points to mark initial and final positions and another two points adjacent to them for tangent continuity). Different curves, which are nothing but the contours depicting the flow path, are obtained by moving the remaining one control point for each curve. Since in two-dimensional simulation, each control point is defined by two coordinates, in total, there are six optimization design variables for the three Bézier curves. The present work determines the optimal values of these design variables using CFD based optimization. The optimization is carried out using Box’s complex method with the objective function being the minimization of the percentage absolute error in the flow rate in the branch outlet. Constraint surfaces for the design variables are described such that the Bézier curves do not intersect each other. Numerical simulation of the geometry yields the value of objective function. The geometry creation and numerical simulation are performed in GAMBIT and FLUENT respectively in batch mode by integrating MATLAB, GAMBIT and FLUENT to enable automated optimization. Two dimensional numerical simulations were performed on a T-junction for three cases with branch outlet flow rates of 30, 50 and 70% of the incoming flow rates. The optimal geometry for all the studied cases is determined within an flow rate error of 3%. © Springer India 2017.