CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Fluid flow through wall U %3d 0 ignored when set pressure gradient for buoyancy (

kar February 29, 2008 17:40

Hi there, I added buoyant f
Hi there,

I added buoyant force (1 + alpha*T)*g to an extended icoFoam solver, g = (0 -9.81 0), then set BCs for p as pressure gradient such that eq grad(p) = g is satisfied. And what happens is - fluid goes through a boundary where BC U=(0 0 0) is set! Maybe you have an idea why?


mike_jaworski March 1, 2008 01:27

Karlis, I'm guessing you'r
I'm guessing you're setting this BC at the bottom of the domain. Have you tried setting it to a fixedValue boundary with a value of rho*g*h where h is your fluid depth? That strikes me as a more direct approach.

Mike J.

hjasak March 1, 2008 07:33

the flow you are seeing is bec
the flow you are seeing is because of your PRESSURE boundary condition. A non-zero pressure gradient means there must be flow through the boundary because of the pressure Laplacian. You did not account for this in the pressure equation and hence you are getting non-zero flux.

Remember, boundary conditions on p and U are not independent - as I am sure you already know.



kar March 1, 2008 12:34

Harvoje, I wouldn't ask and

I wouldn't ask and make such useless experiments if I knew about BC non-independence etc.
Decided to implement gravitational force and temperature dependent density in icoFoam.

Looking at the buoyantFoam solver I see some dynamic pressure introduced and only that is used for laplace( p ). Don't understand that stuff yet...
-> Where to read more about how to build buoyant solver for incompressible fluid? I read your thesis, Harvoje, but I would appreciate if someone point me in the right direction for buoyancy stuff..
-> When I finish that solver, I would be happy to share it. Also I haven't found a BC patch type for convective + radiation heat transfer; BC is this:

grad(T) = - surfaceNormalVector/k * ( h*(T - Treference) + sigma*epsilon(T^4 - Treference^4) )

For sake of good usage constants h, Treference, epsilon must be read from 0/T file. I already begin a thread about this, but there is no reply so far. I wasn't able to access T field defined in solver from separate *.C file which defined class temperatureOpeningFvPatchScalarField : public fixedGradientFvPatchScalarField.

Best regards,

kar March 1, 2008 13:25

Harvoje, I found in an old

I found in an old thread ( ), there was boussinesqBuoyantFoam by you, but link doesn't work... Maybe you could post it in again if you consider it useful?


mike_jaworski March 1, 2008 23:53

Karlis, I do not believe t
I do not believe the pressure gradient term is correct as a boundary condition in the way you have used it. Namely, the gradient of the pressure is necessary *within* the fluid because of momentum balance. At a physical wall, however, pressure has a specific value. If you write out the equations for a momentum balance of the wall itself, the wall-fluid force is the (pressure)*(area), and has nothing to do with the gradient.

There already is a buoyant solver in OpenFOAM if I recall correctly. What does it specify for pressures?

Mike J.

kar March 2, 2008 06:42

Michael, first about BC: ph

first about BC: physically there is gradient. Is there any reason to say it cannot be implemented in OpenFOAM?
Harvoje said: "You did not account for this in the pressure equation and hence you are getting non-zero flux."
So, my problem (one of..) appears to be writing correct pressure eq!

Second - I don't like specifying pressure because it is an integral quantity. There is static pressure and dynamic, but in case when density changes and flow is present, I'm not sure if it's still that simple. So I decided to use gradient as BC!

About buoyantFoam - it is for compressible flow and tries to separate p = pd + rho*gh + pRef; But I currently cannot accept that. How to show that it solves the same N-S equation with same conditions as for full pressure p?


All times are GMT -4. The time now is 04:42.