CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

p_rgh doesn't get the right pressure

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Tobermory

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 27, 2022, 06:13
Default p_rgh doesn't get the right pressure
  #1
New Member
 
Join Date: May 2022
Posts: 29
Rep Power: 4
cfd_saad is on a distinguished road
Hi foamers,

I have been struggling to get the right dynamic pressure from p_rgh. I looked for other subjects dealing with p_rgh and p but I can't found a satisfactory response.

I am studying a cube and I am using interFoam as a solver.

My p_rgh is much higher than p.

I saw in the source file pEqn.H and interFoam.C , that pressures are defined as follow :

p = p_rgh + rho*gh
p_rgh = p - rho*gh

And gh = (g & mesh.C()) - ghRef
with ghRef = (- mag(g)*hRef)

In doxygen manual I found : hRef by default is equal to 0 m

I defined the origin (0 0 0) of my coord system at the bottom so my freesurface is at +32 m.

Do I have to define my coord system's origin at my freesurface or should I create a file hRef in constant folder in which I indicate the height of my freesurface ?

Thanks!!
cfd_saad is offline   Reply With Quote

Old   July 28, 2022, 05:50
Default
  #2
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 747
Rep Power: 14
Tobermory will become famous soon enough
First up, p_rgh is not "dynamic pressure"; dynamic pressure is a measure of the kinetic energy of the flow, \frac{1}{2}\rho U^2. p_rgh is an OpenFOAM construct, that makes some of the equations simpler. It has no real physical meaning, although in incompressible, constant density flows it is equivalent to the deviation from the hydrostatic pressure.

As for where to set hRef - it really doesn't matter. Fluid flow is driven by gradients in p_rgh, and so the absolute value is unimportant (by contrast, the absolute value of p can be important, eg for defining density in vapour flows, but again that is not affected by hRef). Simplest, though, is to set hRef to a value that sets p_rgh for the majority of the domain to be close to zero ... and that would mean setting it at the free surface. Do that with a constant/hRef file, as you noted.
cfd_saad likes this.
Tobermory is offline   Reply With Quote

Old   August 2, 2022, 07:16
Default
  #3
New Member
 
Join Date: May 2022
Posts: 29
Rep Power: 4
cfd_saad is on a distinguished road
Excellent! I did put hRef value at my free surface, now I have the right pressure value without the hydrostatic pressure for p_rgh.

But for the incompressible flows, we can call p_rgh the dynamic pressure ? since only dynamic components are taken into account.
cfd_saad is offline   Reply With Quote

Old   August 2, 2022, 07:19
Default
  #4
New Member
 
Join Date: May 2022
Posts: 29
Rep Power: 4
cfd_saad is on a distinguished road
Here is the file hRef, for those interested :

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  3.0.x                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       uniformDimensionedScalarField;
    location    "constant";
    object      hRef;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 0 0 0 0 0];
value           32;

// ************************************************************************* //
cfd_saad is offline   Reply With Quote

Old   December 7, 2022, 12:48
Default p_rgh and mesh.C()
  #5
New Member
 
Aaron B.
Join Date: Nov 2019
Posts: 6
Rep Power: 7
buesinaw is on a distinguished road
So if one gets a p_rgh value from a probe location (x y z) defined in the controlDict, is that p_rgh value for that exact (x y z) location or is it the p_rgh value for the mesh.C() location nearest to the probe location (x y z)?
buesinaw is offline   Reply With Quote

Old   December 7, 2022, 18:22
Default
  #6
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 747
Rep Power: 14
Tobermory will become famous soon enough
I think that by default it interpolates the cell centre values to the probe location ... may have that wrong; suggest you test it.

You can control whether it interpolates or just uses the nearest cell centre with the interpolationScheme parameter - check out for example:

https://www.openfoam.com/documentati...#x30-1330007.4
Tobermory is offline   Reply With Quote

Old   December 7, 2022, 19:16
Default
  #7
New Member
 
Aaron B.
Join Date: Nov 2019
Posts: 6
Rep Power: 7
buesinaw is on a distinguished road
You're correct, I should test it. Sorry that I haven't, I will, but thank you for your reply.

How would one get the coordinates of the center of the cell in which the probe is located?
buesinaw is offline   Reply With Quote

Old   December 8, 2022, 04:59
Default
  #8
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 747
Rep Power: 14
Tobermory will become famous soon enough
As a test, if you know what the approximate cell size is, D, then you can just put in say 10 probes, spaced D/5 apart and then see whether the results you get from the 10 probes follow a linear profile or a staircase profile as they traverse the 2 or 3 cells.
Tobermory is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
postprocessing result pressure in the inlet using simplefoam rjomega OpenFOAM Verification & Validation 0 March 20, 2022 03:39
Simple Box - Gravity with Pressure Outlet - Unrealistic Reverse Flow pyccknn FLUENT 2 December 1, 2021 18:31
What is difference between static pressure and gauge pressure? aja1345 FLUENT 1 July 20, 2018 21:05
Periodic flow using Cyclic - comparison with Fluent nusivares OpenFOAM Running, Solving & CFD 30 December 12, 2017 06:35
Discharge of Pressure Vessel into Pipe with Regulator gajowni2 System Analysis 0 October 31, 2015 19:57


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