CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Main CFD Forum (
-   -   Dirichlet BC for Pressure Poisson Equation (

Chandra October 3, 2008 07:54

Dirichlet BC for Pressure Poisson Equation

In my CFD program, at the Outlet, I am using a Dirichlet velocity BC and so, I can't use a Dirichlet BC for pressure at the same time. So, I am using Neumann BC after calculating dp/dn from the NS-Equation. Case is same at all other boundaries also, i.e. Neumann BC for Pressure Poisson Equation.

However, I heard from someone that I need to use Dirichlet pressure BC at at-least one point in order to get a realistic value of the pressure field. If any of you have any idea, could you please focus some light on this issue.

In my problem, I am solving a transient flow-field using the MAC algorithm and I am using a realistic values for pressure and velocity fields as initial condition. Well, to advance in time, I am using a modified version of the Runge-Kutta scheme suitable for stiff DAE-equations and that requires a realistic initial condition.

Thank you!

Jed October 3, 2008 10:41

Re: Dirichlet BC for Pressure Poisson Equation
If there are no boundary conditions that fix pressure, then it will only be determined up to a constant. In this case, the matrix will have the constant pressure mode in its null space. Iterative methods usually work fine but you must remove the null space from the convergence test. Direct methods should complain that the matrix is singular, the normal way to fix that is to fix pressure at one point. This is not preferred for iterative solvers since this boundary condition perturbs the spectrum of the matrix which may slow convergence.

Usually you don't want Dirichlet velocity conditions everywhere because the discrete version must be consistent with incompressibility. This can be difficult to guarantee.

Chandra October 3, 2008 11:10

Re: Dirichlet BC for Pressure Poisson Equation
Hey Jed, thanks for your reply. However, as you mentioned:

"Iterative methods usually work fine but you must remove the null space from the convergence test",

could u please tell me how to remove the null space from the convergence test?? I am really willing to know it. I am using iterative method and if |(dp_new-dp_old)*100/dp_old| < 0.25, i.e. the pressure correction becomes less that 0.25%, I assume that the Poisson Equation has converged. Here, dp = pressure correction during course of iterations. For a Dirichlet Pressure BC, the conditions like "|dp| < 0.01%" worked well but after changing it to Numann BC, it no longer worked. I observed something strange: "dp" no longer varies and stays constant (to a value more than 0.01%) during iterations and therefore, the convergence criterion never reaches (and that is why I changed the convergence criterion what I described above). Now I believe, it has something to do with the null-space you mentioned in your reply. So, **please tell me how to remove this null-space.**

So, **after removal of the null-space, can I take the computed pressure as a realistic pressure?**

Finally, just for clarification of the point you mentioned in your last line about satisfaction of the incompressibility condition, I am using the velocity Dirichlet BC only for the normal component of the velocity. For the other two component, I am using Orlansky BC (essentially, a Neumann BC). Also, I modify the normal velocity component on every time step after keeping in mind the incompressibility condition.

Thank you. Please focus a bit on removal of the null-space.

Jed October 3, 2008 15:57

Re: Dirichlet BC for Pressure Poisson Equation
Suppose the operator is A and the orthonormal colums of Z form the null space of A. Let Q be the projection into the orthogonal complement of Z:

Q x = x - (x'Z)Z

Now suppose you are solving the preconditioned system

P A x = P b

with GMRES, hence the we will be expanding the solution x in the space

{Pb, (PA)Pb, (PA)^2Pb, ...}

and we would like x to have no component in the null space (x = Qx).

The natural way to achieve this is to replace every preconditioner application

y = P b


y = Q P b

hence the Krylov space becomes

{QPb, (QPA)Pb, (QPA)^2Pb, ...}

While this iteration can break down (there are a few papers on robust GMRES for singular systems) it is reasonably reliable. Note that the right hand side should be consistent (for a symmetric problem, just solve Ax=Qb) if you expect the converged solution to actually solve Ax=b. For your problem, Z is a single constant column vector.

I don't know what you mean by `realistic pressure'. It is only determined up to a constant. This will make it have zero mean, you can shift it however you like, but it's incorrect to attribute significance to the absolute value of pressure in this case, only the gradients are relevant.

My comment on incompressibility is that you need to satisfy the divergence theorem (the integrated flux through the boundary needs to be zero). Sometimes you use an exact solution for the boundary condition, but this doesn't imply that the *discrete* divergence also integrates to zero.

Chandra October 4, 2008 05:51

Re: Dirichlet BC for Pressure Poisson Equation
Jed, thanks a lot for explaining it in detail. It is certainly going to be very helpful to me.

As far as realistic pressure is concerned, what I meant by it is something like this: I started with a pressure value which is possible physically in an experimental setup of the system. Now, the flow has started in the experiment and I am also calculating the same flow field numerically. After 1 minute of flow, I have a pressure field both from the experiment and from the calculation. Would these calculated pressure fields be identical??

However, if I understood your explanation correctly, the pressure obtained from the calculation will differ from the experimental pressure field by a constant value everywhere. Am I right?

For the incompressibility condition on the boundary, I am making sure that the divergence is zero in discrete matter locally for the boundary cells as well as for overall domain i.e. total inlet mass = total outlet mass. This is not a problem.

Thank you very much once again.


Jed October 4, 2008 12:12

Re: Dirichlet BC for Pressure Poisson Equation
Right, just shift pressure so that the model and experimental pressures have the same global mean.

Allan October 7, 2008 06:22

Re: Dirichlet BC for Pressure Poisson Equation
Hi Chandra,

You could try the following when solving the Pressure Poisson Equation with Neumann BC on the boundary of the domain:

1) If the Pressure Poisson Equation is written as Ap = b, where A is the coefficient matrix, p is the pressure vector solution and b is the right hand side, then pick the row of the matrix A corresponding to the equation of the central node of the grid and make that row have only the diagonal term. This will enforce a Dirichlet condition in the interior of the domain.

2) The procedure in (1) will cause some disturbances in a region near the interior node where you have set a Dirichlet condition. In order to eliminate this errors, you should solve a Poisson Equation with Dirichlet BC after the procedure (1). This Poisson Equation has as BC the values of pressure obtained in the step (1). You can solve this Poisson Equation on a reduced domain if you wish, but remember that the central node must lie in this reduced domain and the boundary of this reduced domain must be a bit far from the central node.

I hope it will help you.


Chandra October 7, 2008 07:56

Re: Dirichlet BC for Pressure Poisson Equation
Allan, thanks for your suggestion. It sounds quite easy to implement. However, could you please also focus some light on the theory behind this idea?! I mean, what ate its physical implications??

Thank you,


Allan October 7, 2008 08:11

Re: Dirichlet BC for Pressure Poisson Equation
Hi Chandra,

I have seen this procedure in the paper below and I am currently using it and the pressure obtained is the real one as you were requesting in the previous threads.

"A Second Order Accurate Projection Method for the Incompressible Navier-Stokes Equations on Fully Adaptive Grids"

Go to section 3.3.2 Neumann Boundary Condition and you will get all the explanation.

If you have difficulty in finding or downloading this paper, please, give me your email and I will send it to you.



Chandra October 7, 2008 08:35

Re: Dirichlet BC for Pressure Poisson Equation
Hey Allan, thanks. I checked for this on Google but it seems the links it provides for the pdf is broken and the html version doesn't show any formula or picture. Please email me the paper. My email address is:

Thanks very much, -Chandra

Chandra October 29, 2008 04:12

Re: Dirichlet BC for Pressure Poisson Equation
Jed, I am sorry, it's been long but I have one more thing to ask in this regard:

As you mentioned, if my original equation is "Ax = b", I need to solve "Ax = Qb" to have the null-space removed for SYMMETRIC problems. However, I am using a non-uniform grid system and so, the resultant matrix would be a NON-symmetric. ** Could be please tell me what equation should I solve for a NON-symmetric co-efficient matrix to get the null-space removed?? **

Also, you mentioned that " Qx = x - (x'Z)Z ", where "Z" is a single constant column vector. From here, it seems that the matrix Q will be a square matrix with its diagonal elements zero and all the other elements -1. However, I am not very good in interpreting matrices and so, could you please confirm it. Also, is this way to determine Q is valid for NON-symmetric co-efficient matrices also??

Thanks a lot. Your suggestions are really very helpful to me!!

Chandra October 29, 2008 04:32

Re: Dirichlet BC for Pressure Poisson Equation
I realize that the Family of GMRES you had suggested can deal with the non-symmetric coefficient matrices also. However, currently, I am using the SOR and therefore, I needed to know if I can still solve the "Ax = Qb" to have the null-space removed (even for non-symmetric matrices).

Thank you very much. Please let me know what do you think.

All times are GMT -4. The time now is 23:35.