CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   p_rgh in OF 1.7 (

stawrogin September 27, 2010 04:57

p_rgh in OF 1.7
Dear Foamers,

I'm a little bit confused about the new pressure p_rgh in OpenFOAM. How is it defined? I worry a little bit the boundary conditions I have to define. For example if I would like to have a constant "pressure" at the outflow, how can this be defined ? If I define p_rgh = 0, does that mean that the pressure + (rho)*g*z is fixed to zero in this case?

Also I wonder why in some solvers I find a p-file and p_rgh file. Is the p-file only used for postprocessing or is it also possible to define boundary conditions there?

Thanks in advance.


juho September 27, 2010 05:20

In the 1.7.x buoyantPimpleFoam, both the p and p_rgh files are read. The p is used in the thermodynamic model.

In the createFields the p_rgh is defined as:

p_rgh = p - rho*gh;

So it is the pressure without the hydrostatic pressure and is intialized from the pressure field in the p-file.

In the pEqn.H file, the pressure equation is written and solved for the p_rgh, so the boundary conditions important for the pressure solution are the p_rgh conditions. After the pressure solution, the p is calculated with:

p = p_rgh + rho*gh;

stawrogin September 27, 2010 05:27

Dear Juho,

thanks a lot for the help. Now it's clear for me.


deniggo September 30, 2010 06:22

Hi Juho,
p_rgh seems to be the dynamic pressure. I work with pimpleFoam and pisoFoam. Is it possible to adjust these codes to obtain p_rgh?



Angela Wang October 5, 2010 17:52

Hi Nico,

Does p_rgh stand for the dynamic pressure, which means p_rgh=1/2*rho*U^2?

I checked the tutorial dam break case, why the value of p_rgh is greater than p? It implies that the rho*g*h is negative.

I am so confused.


Originally Posted by deniggo (Post 277252)
Hi Juho,
p_rgh seems to be the dynamic pressure. I work with pimpleFoam and pisoFoam. Is it possible to adjust these codes to obtain p_rgh?



kjmaki October 5, 2010 19:20

Hi Angela,

p_rgh is p - rho*g*h, or, the dynamic pressure. It was called pd in version 1.5, they solved for total pressure in version 1.6, and now are back to solving for only the dynamic pressure in version 1.7.


deniggo October 6, 2010 03:07

Hi Kevin,

but why p_rgh is higher than p? How a negative static pressure (rho*g*h) is possible?

Shouldn’t 1/2*rho*U^2 (dynamic pressure def.) leads to p_rgh? Post-Calculation of U-field does not.


nbadano October 29, 2010 15:19

Why p_rgh is greater than p
Dear fellows,

Oddly enough, gh is defined in openFoam as:
gh = g & mesh.C()
In other words, gh is the dot product of the g vector and the cell center position vector. As g is usually defined as (0 0 -9.81), gh often results negative in the positive z cuadrant!

Finally, as:
p_rgh = p - rho * gh
p_rgh is greater than p if z > 0

Hope this helps.

Best regards


Angela Wang October 29, 2010 15:26

Thanks. My problem is solved. p_rgh is the dynamic pressure = p- rho*g*h

Logan Page November 17, 2010 13:01

one more question regarding this:

Using the buoyantBoussinesqSimpleFoam solver, the units of p and p_rgh is (m^2)/(s^2) [i.e Kinematic Pressure]

obviously this is quite simply defined by: (p_rgh / rho) = (p / rho) - g*h
My questions is what density is used when dividing through. Is it rhok = 1 - beta (T - Tref) ??


kerim December 3, 2010 13:20

Hi fellows,

I'd like to continue Nico's idea. It seems to me that p_rgh is not dynamic pressure. I changed endtime to 500 in the laminar dambreak case. After that time initial transition flow will be stationary. So the there no dynamic pressure at t=500. But interfoam gives non zero p_rgh pressure. That is why I assume that p_rgh is not dynamic pressure. Could someone еxplaine me what is going on? Or am I wrong ?


nbadano December 3, 2010 14:29

Hi Kerim,

p_rgh is not really dynamic pressure, specially in multiphase flow where rho changes throughout the domain. Is just de difference between real pressure and the rho*g*z field. I think that's one of the reasons the field is no longer called pd, as in 1.5 version of OF.

Just to add to the confusion, bear in mind thart rho*g*z is not the real hydrostatic pressure either!! Even if rho is constant it differes from hydrostastic component by a constant (the distance between the z=0 plane and the atmosphere p=0 plane times rho*g).

Here's a quick sketch of the relation between p_rgh, rgh and p for a hydrostatic condition (no movement at all). Hope this helps

Best regards!


Cristiano December 13, 2010 10:21

p and p_rgh files
Hello there,

I'm modelling a burner which has been tested at atmospheric condition and I'm a bit confused :confused:.

How can I do to set the boundary conditions properly for p and p_rgh?

Inlet -->

Thank you indeed.


linch January 14, 2011 11:44



I agree to your sketch: if the p-field is smooth, the h-field is also smooth, the g-field is uniform and there is a jump in the rho-field at h=h2, so the must be a jump in the p_rgh field. But if you set up your example in interFoam you'll notice, that the p_rgh field is uniform also. Though the p_rgh definition might be a littlte different.

Well, theoretically you'll get an uniform field, if you divide p_rgh by rho, but in this case you wouldn't get the p-dimension [kg*m^-1*s^-2]. So somehow the hydrostatic pressure is being substracted and not the simple product of rho*g*z.
Sorry, I was wrong about it. P_rgh is not uniform.

christianfrias February 10, 2011 11:55

Despite this a very simple suggestion it is worth to say it.
In case you have an OpenFOAM 1.6 case that had run successfully and want to run it in OpenFOAM 1.7 remember that you can just rename your p file to p_rgh (and also change some other parameters in your transportProperties and fvSchemes files). Then change the value of g from (0 0 -9.81) to (0 0 0). The case should work the same as in OpenFOAM 1.6 and you won't have to worry about if the BC that you are using in OpenFOAM 1.7 are ok if they were ok in OpenFOAM 1.6.


Christian F.

The King May 17, 2011 16:30

To understand the different pressures, look at Bernoulli:

Dynamic pressure --> 1/2*rho*v^2
Hydraulic pressure--> rho*g*h
Static pressure --> p

1/2*rho*v^2 + rho*g*h + p = Constant

From the openFoam site, p_rgh = p - rho*g*h.

So, p_rgh is the static pressure minus the hydraulic pressure, based on a arbitrary height.

I do not understand where the dynamic pressure came into this discussion. I think it has nothing to do p_rgh. Dynamic pressure is the pressure of the moving fluid and it will convert into static pressure if you bring the velocity of the fluid to zero. Conservation of energy, back to Bernoulli.

Good to know:
To get my VOF model working, I placed in the fvSolutions file under the PISO solver
pRefPoint (0.0 0.0 0.0);
pRefValue 1e5;


deniggo June 24, 2011 08:39

thanks King, for the clearing explanation.

To finish the pressure confusion: The postprocessing utility "ptot" calculates the total pressure (static + dynamic) for every time step:



fasfcastro November 19, 2011 06:52

I think: P_rgh is the perturbation pressure (from an hydrostatic equilibrium state) that is actually used during the simulations in the momentum equations.

Oke'e November 29, 2011 10:11

why does p_rgh have units of m^2s^-2 in the bouyantBoussinesqPimpleFoam and the bouyantBoussinesqSimpleFoam examples, but has units of kgm^-1s^-2 under the (multiphase) interFoam examples?

Andrea_85 November 29, 2011 10:23

Because it is divided by the density in the first two cases. To have the "real" pressure" you have to multiply by density [kg/m^3].


All times are GMT -4. The time now is 12:30.