Abstract: An inlet duct of an aircraft connects the air intake mounted on the fuselage to the engine within the aircraft body. The ideal outflow quality of the duct is steady, uniform and of high total pressure. Recently compact S-shaped inlet ducts are drawing more attention in the design of UAVs with short propulsion system. Compact ducts usually involve strong streamwise adverse pressure gradient and transverse secondary flow, leading to large-scale harmful vortical structures in the outflow. To improve the outflow quality modern flow control techniques have to be applied. Before designing successful flow control methods a solid understanding of the baseline flow field with the duct is crucial. In this work the fundamental mechanism of how the three dimensional flow topology evolves when the relevant parameters such as the duct geometry and boundary layer thickness are varied, is studied carefully. Two distinct secondary-flow patterns are identified. For the first time the sensitivity of the flow topology to the inflow boundary layer thickness in long ducts is clearly addressed. The interaction between the transverse motion induced by the transverse pressure gradient and the streamwise separation is revealed as the crucial reason for the various flow patterns existing in short ducts. A non-symmetric flow pattern is identified for the first time in both experiments and simulations in short ducts in which the intensity of the streamwise separation and the transverse invasion are in the same order of magnitude. A theory of energy accumulation and solution bifurcation is used to give a reasonable explanation for this non-symmetry. After gaining the knowledge of where and how the harmful vortical structures are generated several flow control techniques are tested to achieve a better outflow quality. The analysis of the flow control cases also provides a deeper insight into the behavior of the three-dimensional flow within the ducts. The conventional separation control method of Coanda injection is proved to be less effective in short ducts dominated by strong three-dimensional effects. Besides, the injection enhances the energy accumulation in duct with the asymmetric pattern and leads to the amplification of the asymmetry. Vortex generator jets are applied to generate spanwise near-wall motions opposing the transverse invasion and to break the strong interaction between the invasion and the separation. Symmetry is regained successfully.