CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Pre-Processing (
-   -   inlet boundary condition based on specified water level (

Hale August 28, 2013 15:37

inlet boundary condition based on specified water level

I am dealing with a two phase flow problem where I need to specify a constant water level for the inlet. I do not want to do it by specifying a velocity or flux.

I tried to do it by specifying a hydrostatic pressure (rho*g*h) for p_rgh and zeroGradient for U but it blows up!

Is there any way to specify the height of the water at the inlet?


nimasam August 29, 2013 14:30

well i guess you can do it via non-uniform alpha1 (i assumed you use interFoam as solver ;) )

Hale August 30, 2013 03:53


Originally Posted by nimasam (Post 448776)
well i guess you can do it via non-uniform alpha1 (i assumed you use interFoam as solver ;) )

Hi Nima,

Thanks for the reply. Yes, I use interFoam. For the inlet where I need a constant water level I have defined alpha1=1 and zeroGradient for everwhere else. What did you mean with non-uniform alpha1?

nimasam August 30, 2013 04:05

well you can put a non-uniform alpha
something similar this :

y < h ? 1 : 0
where h is water level

you can used:

1- code stream
2: groovyBC

to create such nonuniform BC

Hale August 30, 2013 04:16

This is too complicated for me :) but would you please explain what will this non-uniform alpha1 do? I need a uniform water level at the inlet so why should I changed alpha1 to non-uniform?

nimasam August 30, 2013 04:41

in your post #1, you said you want a constant water level!, so i assumed! a portion of your inlet fill with water! if the whole inlet is water! then specify the velocity or flux whats wrong then? ;)

Hale August 30, 2013 09:52

The problem is that I'm simulating a real life problem where the flux is not known but the water level can be adjusted. Therefore I want to specify the water level in terms of hydrostatic pressure or something else that can allow the model to find the flux/velocity by itself.

Sim81 April 10, 2014 11:18

Different water levels; BCs OpenFOAM
I have a similar problem. I have two water tanks connected by a pipe. The tanks have two different water levels. I want to keep this difference constant but I do not know the flow rate at the inlet and outlet. Therefore I should find the BCs that allows me to keep the water levels constant in the tanks. Any help?

Thank you

All times are GMT -4. The time now is 14:33.