I am a complete newcomer when it comes to fluid simulations. I'm currently working through some tutorials to understand the idea of of the discretized Navier-Stokes equations for numerical simulations.
My question is related to the pressure solve for incompressible NS.
The first source I found [1] uses: $$ \nabla^2 p = -\nabla \cdot \bf{u}$$
where $p$ is the pressure vector, and $\bf{u}$ is the velocity vector field.
However, when I tried to derive the Poisson pressure equation using notes from [2], I arrived at: $$ \nabla^2 p = -\rho\left( \frac{\partial u}{\partial x} \frac{\partial u}{\partial x} + 2 \frac{\partial u}{\partial y} \frac{\partial v}{\partial x} + \frac{\partial v}{\partial y} \frac{\partial v}{\partial y}\right)$$
where $u,v$ are the components of velocity, and $\rho$ is the (constant) density of the fluid.
Is one of these correct? Or are they both acceptable, since ultimately they will each be approximated?
Sources:
[1] https://github.com/tunabrain/incremental-fluids/blob/master/1-matrixless/Documentation.md
[2] http://lorenabarba.com/blog/cfd-python-12-steps-to-navier-stokes/ Step (xi), "cavity flow".