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

bouyantpressure and fixedFluxPressure

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 22, 2016, 06:03
Default bouyantpressure and fixedFluxPressure
  #1
Member
 
Milad Setareh
Join Date: Oct 2012
Location: Tehran, Iran
Posts: 35
Rep Power: 13
milad653279 is on a distinguished road
Dear Guys

Could anyones explain the difference between bouyantpressure and fixedFluxPressure boundary conditions? Please explain with mathematical formula.

Regards
milad653279 is offline   Reply With Quote

Old   June 22, 2016, 09:12
Default
  #2
Senior Member
 
Join Date: Sep 2013
Posts: 353
Rep Power: 20
Bloerb will become famous soon enough
The best advice i can give is to learn the basics of the code language. Which is difficult because there nearly no documentation but it is quite straightforward:

bouyantpressure
Code:
    // If the variable name is "p_rgh", "ph_rgh" or "pd"
    // assume it is p? - rho*g.h and set the gradient appropriately.
    // Otherwise assume the variable is the static pressure.
    if
    (
        dimensionedInternalField().name() == "p_rgh"
     || dimensionedInternalField().name() == "ph_rgh"
     || dimensionedInternalField().name() == "pd"
    )
    {
        gradient() = -rho.snGrad()*(g.value() & patch().Cf());
    }
    else
    {
        gradient() = rho*(g.value() & patch().nf());
}
If your field name is p_rgh you set grad p = - rho*g ...
|| is c++ lingo for "or"
gradient is always the surface normal gradient of the field your boundary condition is applied for
rho.snGrad is the surface normal gradient of the density field.
"&" is the scalar product and Cf is the face center vector nf is the face normal vector. Hence the gradient in normal direction equals rho*g or n*grad(rho)*g

fixedFluxPressure
Code:
        gradient() = (phiHbyAp - phip)/patch().magSf()/(*DppPtr);
This one is different as you can see. phip is the flux at the patch. The flux is the velocity at the face of a cell (times density for compressible solvers). magSf is the surface area vector. To understand phiHbyAp you need to understand how to simple algorithm in openfoam works, but it is a predicted flux. DppPtr is the pressure diffusivity field. I have seen good explanations on this forum for this boundary condition so you should be able to find something. The basic idea is that this becomes a zeroGradient if phiHbyAp - phip equals zero. Which it should. It is simply calculated a bit differently for better performance.

Not quite what you might be looking for but it should get you started.
Bloerb is offline   Reply With Quote

Old   June 22, 2016, 11:44
Default
  #3
Member
 
mo_na's Avatar
 
Mona
Join Date: Mar 2016
Location: Berlin
Posts: 49
Rep Power: 10
mo_na is on a distinguished road
you can also check out this thread:
http://www.cfd-online.com/Forums/ope...tml#post514589
mo_na 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
solver for evaporation/condensation modeling gaza OpenFOAM Programming & Development 33 February 11, 2021 10:19


All times are GMT -4. The time now is 17:21.