Vortex structures are defined by their vorticity, the local rotation rate of fluid particles. They can be formed via the phenomenon known as boundary layer separation which can occur when a fluid moves over a surface and experiences a rapid acceleration from the fluid velocity to zero due to the no-slip condition. This rapid negative acceleration creates a boundary layer which causes a local rotation of fluid at the wall (i.e. vorticity) which is referred to as the wall shear rate. The thickness of this boundary layer is proportional to  (where v is the free stream fluid velocity and t is time).
If the diameter or thickness of the vessel or fluid is less than the boundary layer thickness then the boundary layer will not separate and vortices will not form. However, when the boundary layer does grow beyond this critical boundary layer thickness then separation will occur which will generate vortices. 
This boundary layer separation can also occur in the presence of combatting pressure gradients (i.e. a pressure that develops downstream). This is present in curved surfaces and general geometry changes like a convex surface. A unique example of severe geometric changes is at the trailing edge of a bluff body where the fluid flow deceleration, and therefore boundary layer and vortex formation, is located.
Another form of vortex formation on a boundary is when fluid flows perpendicularly into a wall and creates a splash effect. The velocity streamlines are immediately deflected and decelerated so that the boundary layer separates and forms a toroidal vortex ring.