Different definitions have been put forward for secondary flow in turbomachinery, such as "Secondary flow in broad terms means flow at right angles to intended primary flow".
Secondary flows occur in the main, or primary, flowpath in turbomachinery compressors and turbines (see also unrelated use of term for flow in the secondary air system of a gas turbine engine). They are always present when a wall boundary layer is turned through an angle by a curved surface. They are a source of total pressure loss and limit the efficiency that can be achieved for the compressor or turbine. Modelling the flow enables blade, vane and end-wall surfaces to be shaped to reduce the losses.
Secondary flows occur throughout the impeller in a centrifugal compressor but are less marked in axial compressors due to shorter passage lengths. Flow turning is low in axial compressors but boundary layers are thick on the annulus walls which gives significant secondary flows. Flow turning in turbine blading and vanes is high and generates strong secondary flow.
Secondary flows also occur in pumps for liquids and include inlet prerotation, or intake vorticity, tip clearance flow (tip leakage), flow separation when operating away from the design condition, and secondary vorticity.
The following, from Dixon, shows the secondary flow generated by flow turning in an axial compressor blade or stator passage. Consider flow with an approach velocity c1. The velocity profile will be non-uniform due to friction between the annulus wall and the fluid. The vorticity of this boundary layer is normal to the approach velocity  and of magnitude
 where z is the distance to the wall.
As the vorticity of each blade onto each other will be of opposite directions, a secondary vorticity will be generated. If the deflection angle, e, between the guide vanes is small, the magnitude of the secondary vorticity is represented as
This secondary flow will be the integrated effect of the distribution of secondary vorticity along the blade length.