|
[Sponsors] |
July 27, 2022, 06:13 |
p_rgh doesn't get the right pressure
|
#1 |
New Member
Join Date: May 2022
Posts: 29
Rep Power: 4 |
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!! |
|
July 28, 2022, 05:50 |
|
#2 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 747
Rep Power: 14 |
First up, p_rgh is not "dynamic pressure"; dynamic pressure is a measure of the kinetic energy of the flow, . 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. |
|
August 2, 2022, 07:16 |
|
#3 |
New Member
Join Date: May 2022
Posts: 29
Rep Power: 4 |
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. |
|
August 2, 2022, 07:19 |
|
#4 |
New Member
Join Date: May 2022
Posts: 29
Rep Power: 4 |
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; // ************************************************************************* // |
|
December 7, 2022, 12:48 |
p_rgh and mesh.C()
|
#5 |
New Member
Aaron B.
Join Date: Nov 2019
Posts: 6
Rep Power: 7 |
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)?
|
|
December 7, 2022, 18:22 |
|
#6 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 747
Rep Power: 14 |
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 |
|
December 7, 2022, 19:16 |
|
#7 |
New Member
Aaron B.
Join Date: Nov 2019
Posts: 6
Rep Power: 7 |
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? |
|
December 8, 2022, 04:59 |
|
#8 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 747
Rep Power: 14 |
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.
|
|
|
|
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 |