CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

Pressure fields in FOAM, p field, total pressure, etc.

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree15Likes
  • 6 Post By Tobi
  • 6 Post By Tobi
  • 1 Post By Tobi
  • 2 Post By simrego

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 6, 2019, 12:39
Default Pressure fields in FOAM, p field, total pressure, etc.
  #1
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi all,

I am trying to understand the pressure fields in FOAM better in order to set-up the boundary conditions for p_rgh more properly. So I made a simple test geometry which is easy to understand and easy for manual re-calculation based on Bernoulli.

Pressure in OpenFOAM
Please correct me if I am wrong (and probably, I am)
  • For incompressible cases, it is clear. The pressure is divided by the density and the absolute value does not matter in the momentum equation as we do not solve any ideal gas equation etc.
  • For compressible solvers, the pressure field p is the static pressure
  • For compressible solvers, we solve the pressure field p_rgh which is actual the static pressure p field minus the hydrostatic part named as working pressure in some literature
  • The total pressure is the sum of the static pressure + kinematic pressure. This means that it is equal to the p_rgh + rho * g * h + 1/2 rho U^2


Based on Bernoulli, the energy should be everywhere constant. Thus:

p + 0.5 \rho U^2 + \rho g h = constant

In the simulation, I am using a prghPressure at the inlet (top patch) and I set the field hRef to its level. That means at the top patch, the p_rgh field is equal to the static pressure p as:

p_{rgh} = p - \rho g h
while h = 0 at the top patch. After the fluid flows into the small channel, it accelerates and the kinematic pressure rises while the static pressure is reduced (which can be seen in the pitcture). However, the total pressure should be constant there, shouldnīt it? Nevertheless, we can see at the section where the fluid enters into the channel, that the total pressure is non-uniform.

I would expect that the total pressure should be uniformly increasing from top to bottom (based on the hydrostatic part) while the static part and the kinematic part are changing depending on the velocity/pressure distribution.

For any reason, I am missing something here.
By the way, I am using the buoyantPimpleFoam solver with polynomial coefficients for the properties (water) and the outlet boundary condition is a prghPressure condition too (same static pressure, thus I was expecting that the hydrostatic part will be the driving force) - however, the numerical results are not identical to the analytical calculation.

The height difference from top patch to the outlet is 2 m while at the top patch only the hydrostatic pressure acts in the Bernoulli equation. The kinematic pressure is zero and the hydrostatic part is zero to as the height is zero:

p_1 = p_2 + \rho U^2 / 2 + \rho g h
The static pressure at the top (p_1) is equal to the static pressure at the outlet (p_2) thus:

\rho g h = \rho U^2 / 2

and therefore:

U = \sqrt(2 g h)

Nevertheless, the result is 6.26 m/s which I do not achieve at the outlet.
Rough estimation.

I do anything wrong. Maybe someone can light me up (:
Attached Images
File Type: jpg P_Field.jpg (34.6 KB, 273 views)
File Type: jpg totalP_Field.jpg (33.6 KB, 195 views)
File Type: jpg U_Field.jpg (33.3 KB, 186 views)
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   September 9, 2019, 06:38
Default
  #2
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi all,

I freed my brain and got it.
The p_rgh field is not the static pressure minus the hydrostatic part as the reference height is always different. Thatīs why we name it "working" pressure. However, some small hints:
  • prghTotalPressure is equivalent to totalPressure
  • prghTotalHydrostaticPressure cannot be applied for common cases as the field ph_rgh is not available
  • prghPressure is the BC one should use in the case above while using correct values for the static pressure value
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   September 9, 2019, 08:22
Default
  #3
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14
simrego is on a distinguished road
Hi Tobi!


How do you mean that the reference height is always different? It is zero by default.
Also the prghPressure BC uses the hRef value from the db() so it will be the same again. I think hRef is always the same.



Sorry if this is a stupid question, but you made me a bit confused now


And what was the solution for your problem? (just to clarify )
simrego is offline   Reply With Quote

Old   September 9, 2019, 10:54
Default
  #4
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Yes hRef is always set to zero by default. I am sorry for not describing it well. Lets talk about my case above. For me the reference is always the top level of the liquid. Means in my case, the top of the big storage tank. My reference value for analystic calculation should be set to 3m here. Therefore, the hydrostatic part (rho g h) will increase with respect to the top patch of the big storage tank (:


You are right, the reference height is always set to zero. However, if you move the geometry 2 m up or down, the p_rgh value will change accordingly (which made me always a bit messed up).

The solution is as follows (not 100 % clear for me now):

- Setting up prghTotalPressure for the inlet (1e5 Pa)
- Setting up prghPressure for the outlet (1e5 Pa)
- Setting hRef to 3 m

It follows:

p_rgh at the inlet is equal to the static pressure corrected by the fluxes (in this boundary condition no rho g h is used as the prghTotalPressure is equivalent to totalPressure)
p_rgh at the outlet is equal to the static pressure - rho g dh (~2 m)

Thus, the driving force is the \Delta p_{rgh} difference.
Nevertheless, I thought that the potential energy difference (rho g \Deltah) from top patch of the inlet to the outlet will relate to the velocity we achieve. I will try to make a clear statment:

Position 0 (inlet; top patch of large tank
  • static pressure = 1e5
  • velocity = 0
  • potential energy = \rho g \Delta h (h = 3 m)

Position 1 (outlet)
  • static pressure = 1e5
  • velocity = ?
  • potential energy = \rho g \Delta h (h = 2 m)

Bernoulli

Energy at Position (1) is equal to (2):

p_0 + 0.5 \rho U_0^2 + \rho g h_0 = p_1 + 0.5 \rho U_1^2 + \rho g h_1

p_0 = p_1

U_0 \approx 0 infinit large tank

Therefore, it follows:

U_1 = \sqrt{2 g \Delta h} = \sqrt{2 \cdot 9.81 \cdot 2} = 6.26 m/s


However, I do not reach this velocity at all. Right now I have 0.6 m/s (not converged yet).
Raphael_Santos likes this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   September 10, 2019, 03:00
Default
  #5
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14
simrego is on a distinguished road
I just made a toy case. Please don't check the turbulent BCs, random numbers... And mostly not a really correct case. BUT!
Fluid: water
deltaH: 3m
calculated velocity: 7.672 m/s
resulted max velocity at outlet: 7.6861 m/s


case:
  • inlet: total pressure = 0
  • outlet: static pressure = 0
calculation:
p_0 + 0.5 \rho U_0^2 + \rho g h_0 = p_1 + 0.5 \rho U_1^2 + \rho g h_1
here, p_0 + 0.5 \rho U_0^2 = 0 (prescribed total pressure)
p_1 = 0 (prescribed static pressure)
thus U_1 = \sqrt{2 g \Delta h}, the same as you did.


toy case attached. (WARNING! Really poor case, but correct results. At least I accept it. )
Attached Files
File Type: zip bernoulli.zip (41.1 KB, 74 views)
simrego is offline   Reply With Quote

Old   September 10, 2019, 03:14
Default
  #6
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Did not check the case right now but I agree that the inlet boundary condition should be totalPressure (or prghTotalPressure) in order to reduce the pressure gradient based on the fluxes.

You case should accelerate the fluid until infinty and crash if you set a staticPressure to the inlet too.

Thank you very much for investigating into my "simple" topic. I will check you case now.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   January 27, 2022, 03:29
Default
  #7
New Member
 
Lourens Aanen
Join Date: Mar 2009
Posts: 16
Rep Power: 17
lourens is on a distinguished road
Hi Tobias,
I realise that this tread is old, but I hope you are able to answer my question. You state that ph_rgh is not available, which is also my experiance. Do you have any idea in which cases the boundary condition should be used?


Btw, looking at your geometry it makes sense that you do not reach the velocity of 6.26 m/s. In the flow you have two sudden contractions, two sharp edges and two sudden expansions. Especially the first two come with a pressure drop.


Regards,


Lourens
lourens is offline   Reply With Quote

Old   January 27, 2022, 07:58
Default
  #8
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi,

I did not further investigate into that topic but probably we could resolve the issue I had by using the prghTotalHydrostaticPressure boundary condition or a normal one but initialize the case by using the hydrostaticPressure FO.

Tobi
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   January 31, 2022, 04:08
Default
  #9
New Member
 
Lourens Aanen
Join Date: Mar 2009
Posts: 16
Rep Power: 17
lourens is on a distinguished road
Hi Tobias,


If I do understand well: the prghTotalHydrostaticPressure is a constant prgh boundary condition corrected for Bernoulli. What I do not understand is the meaning of the ph_rgh term in the equation. It looks like a way to describe the pressure at the boundary to be used for e.g. water flowing out of a container. This is confusing me, since I expected a p_rgh boundary to be there for buoyant flows (e.g. natural convection is a room). What is also confusing me, is that the value of ph_rgh inthe equation is seems to be a function of the local density. If the differences in density are small over height, this a good approximation. If not an integral over height should be used.



What do you mean by "initialize the case by using the hydrostaticPressure FO"?
What exactly was your issue?



Lourens.
lourens is offline   Reply With Quote

Old   March 25, 2022, 01:33
Default
  #10
Member
 
Join Date: Nov 2020
Posts: 53
Rep Power: 5
mikulo is on a distinguished road
Hi Simrego,

I did run your test case but it blew up in OF 7. I tried to refine your mesh 10 times but at around 9,600 iterations, it blew up again. The maximum velocity in the outlet at that time is still around 6.4 m/s. I don't understand why your simulation ran pretty well.

-Mike
mikulo is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[Other] mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 13 March 7, 2022 17:22
a reconstructPar issue immortality OpenFOAM Post-Processing 8 June 16, 2013 11:25
Difference between pressure, absolute pressure and Total Pressure shaswat CFX 1 September 6, 2012 06:12
Total pressure in CFX famarcfd CFX 0 June 17, 2011 10:33
[Other] StarToFoam error Kart OpenFOAM Meshing & Mesh Conversion 1 February 4, 2010 04:38


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