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

Pressure equation for compressible solver

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 2 Post By wyldckat
  • 2 Post By wyldckat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 9, 2015, 09:06
Default Pressure equation for compressible solver
  #1
Member
 
Akshay Kumar
Join Date: Aug 2010
Location: India
Posts: 84
Rep Power: 16
Akshay is on a distinguished road
Hello!

I was trying to understand how the pressure equation(how 'p' is calculated) is formulated for a compressible flow(pressure based solver). I looked up openfoam's simpleFoam & rhoSimpleFoam to understand the differences but things are still unclear.
rhoSimpleFoam
fvScalarMatrix pEqn
(
fvm::div(phid, p)
- fvm::laplacian(rho*rAU, p) == fvOptions(psi, p, rho.name())
);

simpleFoam
fvScalarMatrix pEqn
(
fvm::laplacian(rAU, p) == fvc::div(phiHbyA)
);

Could someone help me with these equations?

Another thing I noticed in the rhoSimpleFoam solver is that they use setReference for pressure....I thought this referencing is needed only for incompressible flows that do not have any pressure boundaries so that the pressure values are not floating.

pEqn.setReference(pRefCell, pRefValue);

So why is this used in the compressible solver?

Regards
Akshay
Akshay is offline   Reply With Quote

Old   September 12, 2015, 07:29
Default Shoutout to bruno!!
  #2
Member
 
Akshay Kumar
Join Date: Aug 2010
Location: India
Posts: 84
Rep Power: 16
Akshay is on a distinguished road
Hey Bruno!!! As usual...I'm relying on you to point me in the right direction
Akshay is offline   Reply With Quote

Old   September 12, 2015, 16:55
Default
  #3
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick answers:
Quote:
Originally Posted by Akshay View Post
Hey Bruno!!! As usual...I'm relying on you to point me in the right direction
OK... you should perhaps re-read again this post: http://www.cfd-online.com/Forums/ope...-get-help.html - you'll understand why in my next answer...

Quote:
Originally Posted by Akshay View Post
Could someone help me with these equations?
Your question is not clear. What exactly don't you understand?

Quote:
Originally Posted by Akshay View Post
pEqn.setReference(pRefCell, pRefValue);

So why is this used in the compressible solver?
The subsection "4.5.3.1 Pressure referencing" in the OpenFOAM User Guide addresses why this reference pressure is needed, namely because it's how relative pressure has to be dealt with. This means that the solver rhoSimpleFoam can also operate with relative pressure, even if it's compressible.
Beyond this, this pressure referencing is needed when no boundary condition defines a pressure value, e.g. if all BCs are zero gradient, then the equation would be undefined, hence the need for a reference pressure value in a specific point.
stamufa and alishafiee like this.
wyldckat is offline   Reply With Quote

Old   September 18, 2015, 10:24
Default
  #4
Member
 
Akshay Kumar
Join Date: Aug 2010
Location: India
Posts: 84
Rep Power: 16
Akshay is on a distinguished road
1. I basically wanted to know the difference between the pressure equations solved for an incompressible flow and pressure equation for a compressible flow.

2. Regarding reference pressure locations - I think some of the commercial codes use this only for incompressible solvers. Right? If yes, then why is that?
Akshay is offline   Reply With Quote

Old   September 19, 2015, 13:07
Default
  #5
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Akshay,

Quote:
Originally Posted by Akshay View Post
1. I basically wanted to know the difference between the pressure equations solved for an incompressible flow and pressure equation for a compressible flow.
I've been using OpenFOAM for so long that it's affecting me. Essentially, since OpenFOAM is really picky about every single detail, I'm getting picky about every single detail as well
Anyway, the reason why I don't understand you question is as follows...

rhoSimpleFoam
Code:
fvScalarMatrix pEqn                        
(    
    fvm::div(phid, p)  
  - fvm::laplacian(rho*rAU, p)  == fvOptions(psi, p, rho.name())  
);
"fvOptions" is used for source terms. If you ignore this, you have this equation:
Code:
fvScalarMatrix pEqn                        
(    
    fvm::div(phid, p)  
  - fvm::laplacian(rho*rAU, p)  == 0
);
which is the same as:
Code:
fvScalarMatrix pEqn                        
(    
    fvm::laplacian(rho*rAU, p) == fvm::div(phid, p)  
);
It's pretty much the same structure as in simpleFoam:
Code:
fvScalarMatrix pEqn
(
     fvm::laplacian(rAU, p) == fvc::div(phiHbyA)
);
with the exception that "rho" is not present, because it's constant and cancels out.

Does this answer your question? If not, then please be specific about what you want to understand .



Quote:
Originally Posted by Akshay View Post
2. Regarding reference pressure locations - I think some of the commercial codes use this only for incompressible solvers. Right? If yes, then why is that?
I believe I already answered that question. But here's another thread on this topic: http://www.cfd-online.com/Forums/ope...-openfoam.html

The missing detail is probably what you're not asking: Why is the pressure relative to a reference value and not absolute? A few answers:
Best regards,
Bruno
Akshay and jherb like this.
__________________
wyldckat is offline   Reply With Quote

Old   September 21, 2015, 04:03
Default
  #6
Member
 
Akshay Kumar
Join Date: Aug 2010
Location: India
Posts: 84
Rep Power: 16
Akshay is on a distinguished road
Thanks Bruno and I apologize for not being able to hit the nail on the head with regards to my questions. Things are clear now but I have a follow up question ....
  • The rhoSimpleFoam solver we are talking about here is a pressure based solver. Yes it can have a reference pressure location(referencing). If we talk about a density based solver (rhoCentralFoam) then there is no pressure equation(pressure obtained using equation of state) to solve and we wouldn't need a reference pressure location for such a solver. Am I making sense?
Reg
Akshay
Akshay is offline   Reply With Quote

Old   September 21, 2015, 13:21
Default
  #7
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by Akshay View Post
The rhoSimpleFoam solver we are talking about here is a pressure based solver. Yes it can have a reference pressure location(referencing). If we talk about a density based solver (rhoCentralFoam) then there is no pressure equation(pressure obtained using equation of state) to solve and we wouldn't need a reference pressure location for such a solver. Am I making sense?
Quick answer: It does make sense what you're saying and seems to be correct. Nonetheless, do keep in mind that it can depend on the implementation; I say this because one possible implementation (which probably doesn't make much sense for compressible flow) would be to make the density "rho" relative to a reference
wyldckat is offline   Reply With Quote

Old   September 28, 2015, 05:47
Default
  #8
Member
 
Akshay Kumar
Join Date: Aug 2010
Location: India
Posts: 84
Rep Power: 16
Akshay is on a distinguished road
Hmm...to continue on this topic....

Interestingly, it looks like this referencing is not used for rhoPimpleFoam pressure equation but it is used for rhoSimpleFoam. What does steady or transient have to do with referencing the pressure value??
Akshay is offline   Reply With Quote

Old   October 3, 2015, 10:22
Default
  #9
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Akshay,

From what I can deduce, there are at least two possible reasons:
  1. The developers were not asked to implement this feature into rhoPimpleFoam.
  2. By looking at the source code, the same happens in the solvers buoyantSimpleFoam and buoyantPimpleFoam. This leads us to think about what is actually is being modelled: steady-state simulations are used mostly because the simulations should be faster to run than running a transient solver; which means that when simulating the steady-state flow profile, what we want is what the flow looks like when it reaches steady-state or a somewhat averaged result of a near steady-state.
For #2, think of it this way:
  • A steady-state simulation will very likely have a specific point where the pressure is constant and you may know what is the exact pressure value or at least have an idea of it. For example, at the top or bottom of the domain, due to gravity.
  • On the other hand, in a transient simulation, the probability of having a specific point inside the domain that has a constant pressure level is usually very unlikely, unless you're trying to simulate stale air inside a closed box with no source of momentum or pressure variation
Best regards,
Bruno
__________________
wyldckat 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
[ANSYS Meshing] Help with element size sandri_92 ANSYS Meshing & Geometry 14 November 14, 2018 08:54
mass flow in is not equal to mass flow out saii CFX 12 March 19, 2018 06:21
static vs. total pressure auf dem feld FLUENT 17 February 26, 2016 14:04
lid-driven cavity in matlab using BiCGStab Don456 Main CFD Forum 1 January 19, 2012 16:00
Neumann pressure BC and velocity field Antech Main CFD Forum 0 April 25, 2006 03:15


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