CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Appropriate pressure boundary condition in incompressible flow (https://www.cfd-online.com/Forums/openfoam-solving/143237-appropriate-pressure-boundary-condition-incompressible-flow.html)

lonelywing October 20, 2014 02:01

Appropriate pressure boundary condition in incompressible flow
 
Dear Foamers,

I frequently account this problem and hasn't got answer for an year since I started using OpenFOAM solving incompressible external flow with pisoFoam or simpleFoam.

First is that I don't understand why do we require pressure boundary condition in solving incompressible flow except for providing reference pressure. I do understand that zeroGradient is imposed on the no-slip wall, but it is usually guaranteed naturally, isn't it?

At first I thought it was kinda 'fill in the blank' form for OpenFOAM boundary condition and does not do any special roles when solving stuff.

But when I solve external flow with stationary boundary(which means ambient flow with no flow direction specified), this pressure boundary condition bothers me a lot. Continuity error diverges, I guess pressure BC somehow 'block' the domain so that continuity is not satisfied.

I usually impose zeroGradient at the inlet, and fixedValue for the outlet or opening(where flow direction is not specified).

Someday I tried totalPressure boundary condition and it worked(solution converged). I started to wonder whether how these pressure boundary conditions work.

Is there any pressure BC update procedure inside simpleFoam or pisoFoam? If there is, then why is it required?


Second question is then what is appropriate sets of BC for external flow with no flow direction is specified?

I'd like to simulate jet entrainment when there is a strong jet impinging on the wall.

Freestream BC(which is variant of inletOutlet) seems to block (or to specify flow velocity) the flow whenever there is reversal, which is not appropriate for my case.


I would appreciate any help for this problem.


Many thanks

JP

wc34071209 October 20, 2014 17:21

Maybe try to take a look at pressueInletOutletVelocity or pressureOutletInletVelocity. i dont have much experience,but just keep mind of back flow which might help.

AshwaniAssam October 21, 2014 02:18

Hi,

Quote:

First is that I don't understand why do we require pressure boundary condition in solving incompressible flow except for providing reference pressure. I do understand that zeroGradient is imposed on the no-slip wall, but it is usually guaranteed naturally, isn't it?
If you see the step 4 on this wiki page and rest, the algorithm http://openfoamwiki.net/index.php/Th...hm_in_OpenFOAM , you can see how the boundary conditions is updated for pressure. Anyhow, pressure is solved through iterative scheme, so it would need boundary condition to be updated.

If you are getting reverse flow then, you can check look at pressueInletOutletVelocity or pressureOutletInletVelocity boundary condition as suggested by @Cong.

For total Presssure boundary condition, I have seen it used for Internal compressible flow problems, like nozzle.
"Setting total pressure at inlet allows you to obtain a completely developed profile in all pipe extension" , I found this statement in the post http://www.cfd-online.com/Forums/ope...-velocity.html .
You can further reserach, how total pressure is leading to converge solution. Do you get correct solution with total pressure boundary conditions?

Thanks,

lonelywing October 21, 2014 03:48

I appreciate both of the replies, @Cong, @Ashwani. It really helped me a lot.

But can I also ask the reason why the pressure BC such as zeroGradient or fixedValue is not appropriate for some cases?

pressureInletOutletVelocity boundary condition is the one that I've been looking for, but it is a velocity boundary condition and says that I have to input the value like the one on the fifth line.

type pressureInletOutletVelocity;
phi phi;
rho rho;
tangentialVelocity uniform (0 0 0);
value uniform (0 0 0);

What does this value mean? I checked out the code and it seems like it wouldn't care what the value is since refGrad() is zero vector, but I just want to make sure.

Total pressure BC sounds compressible BC for me, too. It's just that I've tried several BCs and it's the only BC that makes the solution converges. Otherwise the domain would blow up with because of continuity error, or outer iteration goes forever. Residual plot shows that residuals oscillates to a band after some thousands of iterations. (Although I don't know what this banded oscillation of residual means... Mesh qualities are decent, but I guess fine enough for the RANS computation. They are full-hexa mesh with quality examined by ICEM has no value lower than 0.45. There are few meshes with Mesh expansion factor of 22, but mostly less than 10.)

The solution I got using totalPressureBC seems 'qualitively and physically' correct, but unfortunately there's no experimental data that I can verify this.

wc34071209 October 21, 2014 04:29

Quote:

Originally Posted by lonelywing (Post 515299)
I appreciate both of the replies, @Cong, @Ashwani. It really helped me a lot.

But can I also ask the reason why the pressure BC such as zeroGradient or fixedValue is not appropriate for some cases?

pressureInletOutletVelocity boundary condition is the one that I've been looking for, but it is a velocity boundary condition and says that I have to input the value like the one on the fifth line.

type pressureInletOutletVelocity;
phi phi;
rho rho;
tangentialVelocity uniform (0 0 0);
value uniform (0 0 0);

What does this value mean? I checked out the code and it seems like it wouldn't care what the value is since refGrad() is zero vector, but I just want to make sure.

Total pressure BC sounds compressible BC for me, too. It's just that I've tried several BCs and it's the only BC that makes the solution converges. Otherwise the domain would blow up with because of continuity error, or outer iteration goes forever. Residual plot shows that residuals oscillates to a band after some thousands of iterations. (Although I don't know what this banded oscillation of residual means... Mesh qualities are decent, but I guess fine enough for the RANS computation. They are full-hexa mesh with quality examined by ICEM has no value lower than 0.45. There are few meshes with Mesh expansion factor of 22, but mostly less than 10.)

The solution I got using totalPressureBC seems 'qualitively and physically' correct, but unfortunately there's no experimental data that I can verify this.


According to my limited knowledge, the cases when fixedValue or zeroGradient doesn't work usually have a back flow at the openings. The pressureInletOutletVelocity along with totalPressure for p is kind of a combination of zeroVeclocity and zeroGradient, switching between each other depending on the flow direction.

lonelywing October 21, 2014 05:22

Quote:

Originally Posted by wc34071209 (Post 515305)
According to my limited knowledge, the cases when fixedValue or zeroGradient doesn't work usually have a back flow at the openings.

Thanks a lot. I'll take a careful look at it inside the code.

Quote:

Originally Posted by wc34071209 (Post 515305)
The pressureInletOutletVelocity along with totalPressure for p is kind of a combination of zeroVeclocity and zeroGradient, switching between each other depending on the flow direction.

You said zeroVelocity, so does that mean backflow(flow inside the domain) is actually blocked?

wc34071209 October 21, 2014 05:39

Quote:

Originally Posted by lonelywing (Post 515323)
Thanks a lot. I'll take a careful look at it inside the code.



You said zeroVelocity, so does that mean backflow(flow inside the domain) is actually blocked?

It is my typing mistake. There is no b.c. called zeroVelocity.


Anyway, it treats inward flow and outward flow differently and therefore should be more stable when back flow occurs.

wc34071209 October 21, 2014 11:06

I just thought a little bit and got a few statements below:

1) You cannot specify both velocity and pressure at the same side (either inlet or outlet or whatever). Put simply, if one variable is specified as a value, the other must be specified as a gradient at the same side.

2) Velocity and pressure b.c. at the outlet depends highly on what b.c. you set for velocity and pressure at the inlet.

3) If you specify velocity/flow rate at the inlet/outlet, you should specify pressure at the outlet/inlet.

4) You can specify 'totalPressure' for pressure at the inlet, and then you need to specify velocity/flow rate at the outlet. Instead of specifying velocity at the outlet, you can also in principle specify static pressure at the outlet. However, this has been said to be not so stable.

5) If you are afraid of back flow at the outlet, OpenFOAM allows you to specify b.c. like this:

a. for velocity, you set 'pressureInletOutletVelocity' and for pressure, 'totalPressure', on the condition that you know the inflow pressure. This combination treats inflow and outflow differently.

b. in case you have no idea of the inflow pressure but you DO know the inflow velocity, you can set
velocity: freestream; pressure: freestreamPressure;



Of course it is possible that I am wrong with one or perhaps all the above statements. So everybody is welcome to correct me.

AshwaniAssam October 22, 2014 06:56

Quote:

why the pressure BC such as zeroGradient or fixedValue is not appropriate for some cases
Unless the flow is not fully developed at outlet, using of fixed value pressure boundary condition is not numerically correct.

lonelywing October 22, 2014 22:06

I appreciate to both of you. I learned a lot :D

xuegy November 18, 2016 09:45

Hi.

I'm simulating a incompressible jet flow. All I know is inlet velocity. Outlet velocity in unknown and I don't care about pressure since it's incompressible.

Now I'm using the following BCs
Inlet: U turbulentInlet P zeroGradient
Outlet: U pressureInletOutletVelocity P fixedValue
This will work in most cases. However I can still get some strange backflow in extreme conditions.

You said freestream can deal with the backflow problem. But I can't use it on outlet since I don't know the outlet velocity at all. So do you know how to apply freestream BC for my case?

Thanks.

Quote:

Originally Posted by wc34071209 (Post 515383)
I just thought a little bit and got a few statements below:

1) You cannot specify both velocity and pressure at the same side (either inlet or outlet or whatever). Put simply, if one variable is specified as a value, the other must be specified as a gradient at the same side.

2) Velocity and pressure b.c. at the outlet depends highly on what b.c. you set for velocity and pressure at the inlet.

3) If you specify velocity/flow rate at the inlet/outlet, you should specify pressure at the outlet/inlet.

4) You can specify 'totalPressure' for pressure at the inlet, and then you need to specify velocity/flow rate at the outlet. Instead of specifying velocity at the outlet, you can also in principle specify static pressure at the outlet. However, this has been said to be not so stable.

5) If you are afraid of back flow at the outlet, OpenFOAM allows you to specify b.c. like this:

a. for velocity, you set 'pressureInletOutletVelocity' and for pressure, 'totalPressure', on the condition that you know the inflow pressure. This combination treats inflow and outflow differently.

b. in case you have no idea of the inflow pressure but you DO know the inflow velocity, you can set
velocity: freestream; pressure: freestreamPressure;



Of course it is possible that I am wrong with one or perhaps all the above statements. So everybody is welcome to correct me.


haer November 23, 2016 21:31

hi xuegy,

i'm working on a similar case as you with a known inlet velocity but unknown conditions at the outlet except that the outlet would be at atmospheric pressure.

have you managed to get a suitable bc for your case?

also do you think your bc below can also be applied to my case?

im new on openfoam, appreciate if you or members here could share some knowledge.

thanks!

Quote:

Originally Posted by xuegy (Post 625871)
Hi.

I'm simulating a incompressible jet flow. All I know is inlet velocity. Outlet velocity in unknown and I don't care about pressure since it's incompressible.

Now I'm using the following BCs
Inlet: U turbulentInlet P zeroGradient
Outlet: U pressureInletOutletVelocity P fixedValue
This will work in most cases. However I can still get some strange backflow in extreme conditions.

You said freestream can deal with the backflow problem. But I can't use it on outlet since I don't know the outlet velocity at all. So do you know how to apply freestream BC for my case?

Thanks.


huangfei November 25, 2016 02:14

I am also trying a similar case.

xuegy November 28, 2016 16:39

Hello haer,

Currently I haven't found any alternative solutions yet. I have tried so many combinations and this is the only one works properly.

Bharath Bhushan May 12, 2017 09:40

flow rate at inlet and outlet
 
Hello friends,,

I am using Openfoam-2.3.1, mass flow rate at inlet and outlet differs by 0.2 kg/s. But it should be same, I am not getting what could be the reason for that difference. Please can anybody tell me what's the reason.

I am using 2 cases. one with

inlet
p totalPressure, U pressureInletOutletVelocity

outlet
p atmospheric pressure value U inletOutlet


and the 2nd case

inlet
p zeroGradient , U flowRateInletVelocity

outlet
p atmospheric pressure value U inletOutlet




Thanking you

hectorgabriel85 May 24, 2020 17:52

Quote:

Originally Posted by wc34071209 (Post 515241)
Maybe try to take a look at pressueInletOutletVelocity or pressureOutletInletVelocity. i dont have much experience,but just keep mind of back flow which might help.

I cannot find pressureOutletInletVelocity boundary condition in OpenFOAM v1812 or OpenFOAM v7

Ardali May 24, 2020 19:11

Why do you want it? use pressureInletOutletVelocity with zeroGradient does the same!

hectorgabriel85 May 26, 2020 17:34

Thanks for your answer Ardali. I am using it already. I was just curious about the other one mentioned pressureOutletInletVelocity. Does it exist at all? If not, some edition will be great to avoid confusion.

Ardali May 26, 2020 19:33

No, they merged them together!

Bodo1993 September 14, 2020 10:48

Quote:

Originally Posted by wc34071209 (Post 515383)
I just thought a little bit and got a few statements below:

1) You cannot specify both velocity and pressure at the same side (either inlet or outlet or whatever). Put simply, if one variable is specified as a value, the other must be specified as a gradient at the same side.

2) Velocity and pressure b.c. at the outlet depends highly on what b.c. you set for velocity and pressure at the inlet.

3) If you specify velocity/flow rate at the inlet/outlet, you should specify pressure at the outlet/inlet.

4) You can specify 'totalPressure' for pressure at the inlet, and then you need to specify velocity/flow rate at the outlet. Instead of specifying velocity at the outlet, you can also in principle specify static pressure at the outlet. However, this has been said to be not so stable.

5) If you are afraid of back flow at the outlet, OpenFOAM allows you to specify b.c. like this:

a. for velocity, you set 'pressureInletOutletVelocity' and for pressure, 'totalPressure', on the condition that you know the inflow pressure. This combination treats inflow and outflow differently.

b. in case you have no idea of the inflow pressure but you DO know the inflow velocity, you can set
velocity: freestream; pressure: freestreamPressure;



Of course it is possible that I am wrong with one or perhaps all the above statements. So everybody is welcome to correct me.

Hi, I have a single inlet and two outlets. The only information I know is the inlet velocity. I have tried pressureInletOutletVelocity for the inlet and totalPressure for the outlet. I get backflow problems with this combination. If I understand correctly, your suggestion is to use:

Inlet
U .. freestream
P .. zeroGradient

Outlet
U .. zeroGradient
P .. freestreamPressure

Please correct me if I am wrong. Thanks.


All times are GMT -4. The time now is 19:51.