A method for the simulation of plane or axisymmetric flows of incompressible fluids based on the concept of the stream function