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

Pressure Calculation p/p_rgh

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By Astrodan

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 6, 2014, 11:09
Default Pressure Calculation p/p_rgh
  #1
Member
 
Timm Severin
Join Date: Mar 2014
Location: Munich
Posts: 63
Rep Power: 12
Astrodan is on a distinguished road
Hi everyone!

As I plan to write my own solver that merges several capabilities of existing solvers, right now I'm trying to understand what is going on in existing codes.
My primary interest is in settlingFoam/driftFluxFoam and interFoam right now.

But somehow I'm stuck at the pressure calculations in createFields.H (and pEqn.H):

As input the solvers use the p_rgh value, which appears to be the static pressure in my domain. Later in the code the piezometric pressure p is calculated from density and phase concentrations.
What I don't get here is the part of the hydrostatic pressure. Density rho as well as gamma (g*h) are volScalarFields, and should represent the value in the cell center (if I'm not wrong). Now, calculating
Code:
p = p_rgh + rho * gh
(L.111) it appears to me that the local cell density is used, and thus the pressure is highly dependent on alpha, and not on the type of fluid that is above the cell.

So, what I had expected was a pressure calculation by integration from the top of the domain to the cell:
\int_{p_0}^{p} dp = p_{hyd} = - \int_{z_0}^{z} \rho(z^\ast)\, g dz^{\ast}

Can anyone explain to me what is going on there?
I already read:
Thank you in advance,
-Timm

Sidenote:
I'm aware that there is an implementation of an interSettlingFoam solver created at Chalmers in one of the courses, but for sake of clarity I'm trying to understand the solver-creation-process a bit more detailed.
Astrodan is offline   Reply With Quote

Old   May 6, 2014, 12:29
Default
  #2
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
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 Timm,

just for you as an hint. The calculation of "p" in the createFields.H is just an initial guess of the pressure field. While you are calculating/solving your problem, you solve other pressure equations.

Regards
Tobi


PS: Are you doing your Ph.D. in Munic ? <-- okay you profil showed me that this is true (:
Tobi is offline   Reply With Quote

Old   May 7, 2014, 12:32
Default
  #3
Member
 
Timm Severin
Join Date: Mar 2014
Location: Munich
Posts: 63
Rep Power: 12
Astrodan is on a distinguished road
Hi Tobi,

thanks for the answer. I indeed realise that the p is not used for any solving operation. But that confuses me rather more than before.
Apparently p is only used, when a reference pressure is needed, i.e. no fixedValue pressure boundary is given.
So, in many cases it will not be required at all?
And still, rho*gh is used to calculate p, when a reference cell is being used, where the rho*gh field looks kind of weird to me (also see attached pictures below).

Just for a comparison I did a small modification of the laminar damBreak case. And added a second water field floating in mid-air above the original (but now smaller) one.

From the three fields discussed p seems to be pretty reasonable to me at t=0.05s:
0.05-p.jpg

p_rgh on the other hand shows a - to me - completely confusing profile. Why can we calculate velocities with this a profile?
0.05-p_rgh.jpg

For completeness I also have rho*gh (written by modified interFoam). Here I have logical problems with the simple gradient resulting from the simple assumtion of constant density over height, which presumably is the reason for the profile in p_rgh.
0.05-rgh.jpg

Now my basic question would be: What is the "correct" pressure (the one I would physically measure)? I assume it must be p, but don't understand the why adding rho*gh should give the correct solution.

I'm still pretty new to OpenFOAM (and CFD as such), since I only started two month ago. So I'd also be happy if there was any document which describes the pressure calculation for these multiphase cases (more than the usual SIMPLE/PISO description).
__________________
PhD Student at the Institute of Biochemical Engineering at TU München
Modelling of fluid dynamics in open photobioreactors.

System:
OpenFOAM 2.3.x, 64bit, 8 Core Xeon Workstation
Astrodan is offline   Reply With Quote

Old   May 8, 2014, 06:40
Default
  #4
Member
 
Timm Severin
Join Date: Mar 2014
Location: Munich
Posts: 63
Rep Power: 12
Astrodan is on a distinguished road
Okay, I think I worked half of it out:

p_rgh is the static pressure field, which is independent from kinematics and hydrostatic. Thus it is used since it offers the easiest definition of BC and is (apperently) treated better in a numerical way.

Previous not correct thought: And since the hydrostatic pressure only depends on its gradient and not the absolute value, the calculation utilizes the ghf field and the gradient of the density in ghf*fvc::snGrad(rho) for the flux calculation.

Now, the absolute pressure field written should still be wrong? Which is what - I assume - was the original intention of the interFoamPressure tool (which seems to be not applicable to the current OF Version) to correct.

I hope this is correct now, thank you anyways.
-Timm

Small correction:
I finally found this thread, which seems to explain the matter. The use of the static pressure introduces an error due to an additional force in the momentum equation based on the derivative of rho. By removing the term from the flux field this error is being corrected.
EliB and Linmunn like this.
__________________
PhD Student at the Institute of Biochemical Engineering at TU München
Modelling of fluid dynamics in open photobioreactors.

System:
OpenFOAM 2.3.x, 64bit, 8 Core Xeon Workstation

Last edited by Astrodan; May 8, 2014 at 10:18.
Astrodan 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
[Help!] impeller torque calculation: pressure and viscous moments ghost82 Main CFD Forum 1 March 27, 2014 03:37
reference pressure and compressible flow bingo10 CFX 0 September 11, 2013 08:32
Pressure drag calculation lc05 Main CFD Forum 2 November 1, 2010 08:50
Neumann pressure BC and velocity field Antech Main CFD Forum 0 April 25, 2006 03:15
Hydrostatic pressure in 2-phase flow modeling (CFX4.2) HB &DS CFX 0 January 9, 2000 14:19


All times are GMT -4. The time now is 07:55.