CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   p_rgh in OF 1.7 (https://www.cfd-online.com/Forums/openfoam-solving/80454-p_rgh-1-7-a.html)

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.

Stawrogin

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.

Stawrogin

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?

Thanks,

Nico

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.


Quote:

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?

Thanks,

Nico


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.

Kevin

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.

nico

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

Nicolas

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 12: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) ??

Thnks

kerim December 3, 2010 12: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 ?

Kerim

nbadano December 3, 2010 13: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

http://lausinacreativa.com.ar/OpenFO...H_equals_P.jpg

Best regards!

Nico

Cristiano December 13, 2010 09: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 -->
Outlet->
Wall--->

Thank you indeed.

Cristiano

linch January 14, 2011 10:44

Quote:

@nbadano

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 10:55

Tip
 
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.

Cheers,

Christian F.

The King May 17, 2011 16:30

Bernoulli
 
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;

Succes!

deniggo June 24, 2011 08:39

Hello,
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:

http://www.cfd-online.com/Forums/ope...lds-write.html

Cheers,

Nico

fasfcastro November 19, 2011 05: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 09: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 09: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].

best
andrea

MOHAMMAD67 June 14, 2012 10:12

Hydrostatic Pressure????
 
Dear Friends
Hi
Here, a lot of discussion about p and p-rgh were done. But I myself couldn't get the final results from the discussions. I want to know, for a multiphase flow, which pressure should be used in order to compare with experimental data? as you know, We can have just hydrostatic pressure in the lab.
Is the p-rgh value depended on the origin of the domain?

christianfrias August 16, 2012 15:24

I see that since p_rgh is not the dynamic pressure it means that p is not the total pressure (as we could think) and is actually the static pressure. To calculate the total pressure you can use ptot (this will calculate 1/2*rho*U^2 [dynamic pressure] + p [static pressure)]). So, to compare experimental data with the results from OpenFOAM I will use the p file which is the static pressure in OpenFOAM.

sharonyue November 25, 2012 03:27

Quote:

Originally Posted by christianfrias (Post 377402)
I see that since p_rgh is not the dynamic pressure it means that p is not the total pressure (as we could think) and is actually the static pressure. To calculate the total pressure you can use ptot (this will calculate 1/2*rho*U^2 [dynamic pressure] + p [static pressure)]). So, to compare experimental data with the results from OpenFOAM I will use the p file which is the static pressure in OpenFOAM.


so is the p(static pressure) plus 1/2*rho*U^2(dynamic pressure) usually measured in experiment? Why I remember usually in a tube or something ,static pressure is measured in a pressure gauge

vonboett May 24, 2013 10:49

Quote:

Originally Posted by sharonyue (Post 394021)
so is the p(static pressure) plus 1/2*rho*U^2(dynamic pressure) usually measured in experiment? Why I remember usually in a tube or something ,static pressure is measured in a pressure gauge

Depending on what you measure. Water pressure level sensors (and piezometers) yust measure the equivalent hydrostatic pressure above the sensor, so they are liquid level sensors and you should compare measurements to p in OF. If you measure the pressure in flow direction to gain drag forces etc. it is more difficult to directly compare measurements and simulation.

baedmaen July 8, 2013 07:58

Pressure things ...
 
1 Attachment(s)
Hi all,

now i am confused about multiphase pressure. Could anybody put the corresponding qualitative pressure profiles into the file attached?
First figure:
stationary two phase system (water and air); i think nbadano already posted the answer at December 3, 2010, via this thread
Second figure:
bubble rising to surface; snap shot
Third picture; first contact of a water drop with water surface

Thank you very much!

Dream April 6, 2014 21:51

Cannot find patchField entry for wall?
 
We set up the separator model, and stimulates the multiphase flow. After we ran the setFields, the following information occurred:

Setting field default values
Setting internal values of volScalarField alphaair
Setting internal values of volScalarField alphawater


--> FOAM FATAL IO ERROR:
Cannot find patchField entry for wall

file: /home/dell/OpenFOAM/damBreak4phaseFinelmxlmx/0/alphawater.boundaryField from line 34 to line 56.

From function GeometricField<Type, PatchField, GeoMesh>::GeometricBoundaryField::readField(const DimensionedField<Type, GeoMesh>&, const dictionary&)
in file /home/opencfd/OpenFOAM/OpenFOAM-2.2.2/src/OpenFOAM/lnInclude/GeometricBoundaryField.C at line 206.

FOAM exiting
-----------------------------------alphawater-------------------------------------------
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.2 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object alphawater;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 0 0 0 0 0 0];

internalField uniform 1;

boundaryField
{
Wall
{
type zeroGradient;
//value uniform 0;
}
new_new_out
{
type fixedValue;//;
value uniform 1;
}
new_out
{
type fixedValue;
value uniform 1;
}
out
{
type fixedValue;//outletInlet;
value uniform 1;
}
in
{
type outletOutlet;
outletValue uniform 0;
value uniform 0;
}
}

-----------------------------
Maybe the boundary conditions were set incorrectly, but we didn't know how to revise them.
Thanks so much for help!

Andrea_85 April 7, 2014 02:35

Hi,

replace

Wall
{
type zeroGradient;
//value uniform 0;
}


with

wall
{
type zeroGradient;
//value uniform 0;
}

Best,

andrea

vonboett April 7, 2014 04:04

2 Attachment(s)
Quote:

Originally Posted by baedmaen (Post 438422)
Hi all,

now i am confused about multiphase pressure. Could anybody put the corresponding qualitative pressure profiles into the file attached?
First figure:
stationary two phase system (water and air); i think nbadano already posted the answer at December 3, 2010, via this thread
Second figure:
bubble rising to surface; snap shot
Third picture; first contact of a water drop with water surface

Thank you very much!

Well, p_rgh depends on your ccordinate system, boundary conditions and eventually a pRefValue and pRefPoint. However, if you have something like an atmosphere pressure = 0 Pa in the air above the surface by specifying an atmosphere boundary condition or a pRefValue = 0 Pa, and your water density and g is specified correctly, you will get a nice triangular hydrostatic pressure starting from zero at the surface for p, but not for p_rgh. The solvers I use work with p_rgh in the Navier-Stokes equations but I use p as result for comparison. I attatched two screenshots of a 3D domain starting at z = 2m at the bottom and reaching z = 3m at the top, with atmospheric pressure 0 Pa, and a bubble at z = 2.25 m and a water drop at z = 2.51 m, both with 0.01 m radius, and the free surface at 2.5 m. The screenshots are taken at T = 0.01 s after simulation start, cell size is 5mm in all directions. Note how the density affects p_rgh, 24680 Pa = 2.51m * g * rho_water

Dream April 7, 2014 20:28

Thanks so much!
 
Quote:

Originally Posted by Andrea_85 (Post 484283)
Hi,

replace

Wall
{
type zeroGradient;
//value uniform 0;
}


with

wall
{
type zeroGradient;
//value uniform 0;
}

Best,

andrea

thanks so much!
we have solved this problem. the reason is that we wrote the capital letter W with respect to the word wall.

John Handel Kennedy March 1, 2016 11:33

Flow in a straight pipe
 
Hi,
I am trying to simulate Flow in a Straight Pipe with Heat transfer.
I am using the buoyantBoussinesqSimpleFoam solver.
I have made g and beta to be zero.
The temperature of the wall is 373K and inlet fluid temperature is 293K.
The inlet velocity is 1m/s.
The diameter of the pipe is 1m and the nu value is 0.01 which makes a Reynolds number to be 100.
The laminar Prandtl number is 1.5.

I got fully developed flow in simpleFoam i.e. the velocity jumped to 2m/s.
However I am not able to get the same velocity profile in buoyantBoussinesqSimpleFoam, The velocity is decreasing towards the outlet.

How do we solve this problem?
What should I specify in the alpha_t and p_rgh files?

Regards
John

SRKR June 25, 2018 06:19

p_rgh is not Dynamic pressure
 
P_rgh doesn't indicate 'dynamic pressure'. 'P' indicates static pressure which usually contains 2 components pressure of state and hydrostatic pressure. So, p_rgh indicates state pressure. The reason why do we need to use this pressure is in dealing with multiphase flows along with continuity, momentum and energy equations eqn. Of state is also required.
This in my opinion. Please, Correct me if I am wrong.:)

Bdew8556 April 16, 2019 19:25

Morning. I can't seem to access what I'm sure is a fantastic figure.

YUGU May 28, 2019 11:54

Quote:

Originally Posted by nbadano (Post 285912)
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

http://lausinacreativa.com.ar/OpenFO...H_equals_P.jpg

Best regards!

Nico

Hi,



can someone show me the sketch? It's not visible already.


Best regards,

Harish Selvam February 18, 2020 03:39

P_rgh and p in OpenFOAM
 
Dear all,
I am new to OpenFOAM. I am using interFoam, a multiphase solver for my research work. As far as I understood, 'p_rgh' is not a dynamic pressure. So, it is better to think of using 'p' which incorporates all the pressure term (static and dynamic) for your measurement.

Suppose, if you take a numerical tank of 0.5m*0.5m of water depth 0.4m and grid size of 0.05m*0.05m and measure p_rgh and p at different points (say (0.25,0), (0.25,0.05), (0.25,0.1)), the p_rgh gives same value (i.e., 3924 pa) whereas p gives (3678.75 pa, 3188.25pa, 2697.75pa). This was my experience with the p_rgh and p when I checked simply for the hydrostatic condition. If p_rgh is dynamic pressure, it should be zero practically. However, it is not the case.

p_rgh is simply the pressure measured about the boundary incorporating dynamic pressure about that cell in which it is solving while p is the pressure corrected for the cell centers after solving. Maybe you can think p_rgh as a reference pressure with dynamic pressure incorporated.

Kindly note that I have not checked this case with rotational flows.
Solvers incorporate p_rgh in calculations. Since pressure difference is the driving force for any fluid motion, it would not affect the results I think

All the above discussions are based on my experience in this short term. Please correct me if I am wrong

Regards
Harish

granzer January 17, 2022 05:49

Relative Pressure
 
It can be called relative pressure. Total_pressure-static_pressure=dynamic_pressure; Total_pressure-(hydrostaic_pressure+Reference_pressure-etc) = Relative_pressure

finn_amann April 8, 2023 09:22

Quote:

Originally Posted by The King (Post 308037)
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;

Succes!


So it is therefore impossible to compute the real water depth from a multiphase simulation via the Bernoulli equation, correct?

We have

0.5*rho*u^2 + p + rho*g*h = p_total

In this equation, p would also be the p in our results folders of our interFoam simulation.

p can be rewritten p = p_rgh + rho*g*h. Plugging this in will cancel out rho*g*h

0.5*rho*u^2 + p_rgh = p_total.

and p_total is dependent on a reference height.


In general, we know that

p_rgh = p - rho*g*h

However, h is not really the water depth, its just a reference height given by the user. It's zero by default, but can be given in an hRef file in the constant folder.

Unfortunately, this also means, that if you have a deformed water surface, which is the big feature of interFoam (imo), your hRef will definitely not be the water surface elevation. This effectively prevents us from directly computing the water depth via the Bernoulli equation.

This is really annoying, if you want to compare pressure results from multiphase simulations with other solvers.

Please correct me if I got some stuff wrong.


All times are GMT -4. The time now is 01:20.