CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Running, Solving & CFD

bouyantpressure and fixedFluxPressure

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

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

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

milad653279 is offline   Reply With Quote

Old   June 22, 2016, 09:12
Senior Member
Join Date: Sep 2013
Posts: 116
Rep Power: 6
Bloerb is on a distinguished road
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:

    // 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.
        dimensionedInternalField().name() == "p_rgh"
     || dimensionedInternalField().name() == "ph_rgh"
     || dimensionedInternalField().name() == "pd"
        gradient() = -rho.snGrad()*(g.value() & patch().Cf());
        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

        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
mo_na's Avatar
Join Date: Mar 2016
Location: Berlin
Posts: 49
Rep Power: 3
mo_na is on a distinguished road
you can also check out this thread:
mo_na is offline   Reply With Quote


Thread Tools
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
solver for evaporation/condensation modeling gaza OpenFOAM Programming & Development 30 March 8, 2016 06:11

All times are GMT -4. The time now is 15:47.