CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Pressure boundary condition for unsteady velocity inlet (

DanM December 31, 2012 05:44

Pressure boundary condition for unsteady velocity inlet
Hello everyone,

I have a fairly general question: When solving a flow problem with an unsteady velocity inlet, how should the pressure boundary condition at the inlet be defined? For steady flow a zero gradient condition is adequate and ensures consistency at the inlet boundary. However, for an unsteady velocity boundary I believe the pressure should also fluctuate in time and space. Zero gradient is still often used for the unsteady case, but doesn't that introduce an error?

I would appreciate your comments!

Thanks a lot,


mlubej January 2, 2013 16:27

Hello Dan,

I do not see a problem with zeroGradient boundary condition for pressure at unsteady inlet velocity. The zeroGradient means that the normal gradient of pressure is zero, so if your inlet is normal to x, then dp/dx=0, but it doesnt mean that dp/dt=0, the value of pressure at inlet can still change based on the velocity, if the outlet pressure is constant.


DanM January 3, 2013 06:07

Dear Martin,

Thank you very much for your reply. The problem I see is that in certain cases the pressure field associated with a time varying velocity field does not satisfy dp/dx=0 (assuming the inlet normal points in the x direction). Take for example the simulation of an ocean wave. Here, the pressure gradient in x-direction is not zero, yet when solving these kind of problems, a zeroGradient condition for the pressure is typically used. See for example the pressure files in the following tutorial:

When defining a velocity field at a boundary a zeroGradient pressure condition implies that there are no pressure forces introduced that might be inconsistent with the defined velocity field. However, I would think that in cases where the normal pressure gradient is not zero, an error in the p field is introduced. I would appreciate your thoughts!

Thank you,


immortality July 9, 2013 08:05

Hi Dan
did you find out your answer?
and what in case of outlet boundaries in unsteady cases?does a fixed pressure have any sense?and setting velocity and temperature are zeroGradient in your opinion?

achyutan July 9, 2013 08:21


this seems to be a nice discussion.

ZeroGradient is generally suited for unsteady cases also as already pointed out. In cases where normal pressure gradient at inlet is expected to be non-zero, one can try to extrapolate pressure based on internal field values. This will better capture the wavy distribution of pressure. But again, something must be known about the flow field prior to the computation.

At outlet for an u/s case, one can use convective b.c (solving an ode for that field) for incompressible flow.


immortality July 9, 2013 08:36

Hi achyutan
my case is can I use convective BC?
and how can I write it by groovyBC?whats the formulas of it to simulate?

kazem.66 July 5, 2015 09:21

Hi Dan
did you get your answer? I have the same problem, If anyone can help me:(

All times are GMT -4. The time now is 05:52.