In the incompressible Navier-Stokes equations, \begin{align*} \rho\left(\mathbf{u}_t + (\mathbf{u} \cdot \nabla)\mathbf{u}\right) &= - \nabla p + \mu\Delta\mathbf{u} + \mathbf{f}\\ \nabla\cdot\mathbf{u} &= 0 \end{align*} the pressure term is often referred to as a Lagrange multiplier enforcing the incompressibility condition.
In what sense is this true? Is there a formulation of the incompressible Navier-Stokes equations as an optimization problem subject to the incompressiblity constraint? If so, is there a numerical analog in which the equations of incompressible fluid flow are solved within an optimization framework?