A lipschitzian global optimization algorithm and machine learning for fluid dynamics