An efficient preconditioned conjugate gradient method applied to nonlinear problems in fluid dynamics via least square formulations