# Incompressible Navier-Stokes pressure solve in simulations

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:

[2] http://lorenabarba.com/blog/cfd-python-12-steps-to-navier-stokes/ Step (xi), "cavity flow".

• These equations do not make sense for many reasons. 1) pressure is a scalar. 2) NS equation has a $\mu \nabla^2 \bf{u}$ term. Are you looking at time independent potential flows? You need to give more information – Vaidyanathan Jun 5 '15 at 19:35
• @Vaidyanathan Sorry if I'm unclear. These are not time independent. Also, I think the pressure $p$ is a scalar field and the $\mu \nabla^2 \bf{u}$ term goes away when you take the divergence of NS due to the constraint $\nabla \cdot \bf{u} = 0$ (incompressibility). – tdenniston Jun 5 '15 at 19:38

For an incompressible fluid $\dot\rho=0$. Then the continuity equation implies $$\nabla\cdot u = 0 .$$ We can now take the divergence of the Navier-Stokes equation and get $$-\nabla^2 P = \rho\nabla_j(u_i\nabla_i u_j).$$ This means that the pressure is instantaneously determined by the velocity field (the pressure is no longer an independent hydrodynamic variable). The easiest way to solve this constraint is to convert the NS equation into an equation for the vorticity $\omega=\nabla\times u$. This equation is $$\frac{\partial}{\partial t} {\omega} + u\cdot\nabla {\omega} = \nu {\nabla}^2 {\omega} + \omega\cdot\nabla {u},$$ where $\nu=\eta/\rho$ is the kinetic (shear) viscosity.
To answer your specific questions: 1) Your first equation is obviously wrong ($\nabla\cdot u=0$ for an incompressible fluid). 2) Your second equation is right (in 2d, it is the same as my second equation). 3) You can't just use an approximate Poisson equation. 4) In practice it is easiest to eliminate the pressure, by working with vorticity.