# How to update velocity to include pressure when using P2/P1 elements

I am in the process of writing a finite element code to solve the Navier-Stokes equations using the theta method for time stepping (basically Crank-Nicholson for diffusion and forward Euler for nonlinear terms). To find the pressure I use the pressure correction method. Once I find the pressure I need to update the velocities to include contributions from the pressure gradient. For example I need to compute:

$\frac{\partial{u}}{\partial{t}} = -\frac{\partial{p}}{\partial{x}}$

The problem is the the velocities are defined on quadratic triangular elements (6 points) while the pressure is defined on linear triangular elements (3 points). I think this means I need to interpolate the pressure gradient to the extra three points in the quadratic velocity element when updating the velocity to include the pressure gradient. My question is how do I do this? I was thinking of using the barycentric interpolation method but I am not sure if this is the right thing to do. Also I think this would only be linear interpolation so I am not what you would do if you trying to get a second order solution.

• Just as a point worth correcting, the equation you show can't be right -- the velocity is a vector, and so is its time derivative, whereas on the right the pressure is a scalar and so is its x-derivative. I assume you mean the gradient of the pressure. – Wolfgang Bangerth Jun 28 '15 at 22:13
• @WolfgangBangerth yes in the above I got lazy and only wrote the u-velocity equation (so in the above I didnt mean u to be $\vec{u}$ but instead just the horizontal velocity). I should have put u in bold and wrote the gradient of pressure. What I wrote was like a 1-D analogue. – James Jun 29 '15 at 4:58

The pressure is represented over the entire element, say element $e$, by its shape functions: $$p_h^e(x)=\sum_i P_i^e \phi_i^e(x)$$ So, you can simply evaluate it where you need it. If $x_k$ is a point on the velocity element, you simply compute: $$p_h^e(x_k)=\sum_i P_i^e \phi_i^e(x_k)$$ Now, you've probably used a master element formulation for your integration, so you may need to map the points $x_k$ onto the master element in order to do this, but presumably you've already done this since you needed those points on the master element for your work on the velocity.