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

Appropriate pressure boundary condition in incompressible flow

Register Blogs Community New Posts Updated Threads Search

Like Tree15Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 20, 2014, 03:01
Default Appropriate pressure boundary condition in incompressible flow
  #1
New Member
 
Junshin Park
Join Date: Oct 2013
Posts: 6
Rep Power: 13
lonelywing is on a distinguished road
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

Last edited by lonelywing; October 20, 2014 at 23:18.
lonelywing is offline   Reply With Quote

Old   October 20, 2014, 18:21
Default
  #2
Senior Member
 
Yuehan
Join Date: Nov 2012
Posts: 142
Rep Power: 14
wc34071209 is on a distinguished road
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.
wc34071209 is offline   Reply With Quote

Old   October 21, 2014, 03:18
Default
  #3
Senior Member
 
Ashwani
Join Date: Sep 2013
Location: Hyderabad
Posts: 154
Rep Power: 13
AshwaniAssam is on a distinguished road
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,
calf.Z likes this.
AshwaniAssam is offline   Reply With Quote

Old   October 21, 2014, 04:48
Default
  #4
New Member
 
Junshin Park
Join Date: Oct 2013
Posts: 6
Rep Power: 13
lonelywing is on a distinguished road
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.
lonelywing is offline   Reply With Quote

Old   October 21, 2014, 05:29
Default
  #5
Senior Member
 
Yuehan
Join Date: Nov 2012
Posts: 142
Rep Power: 14
wc34071209 is on a distinguished road
Quote:
Originally Posted by lonelywing View Post
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.
wc34071209 is offline   Reply With Quote

Old   October 21, 2014, 06:22
Default
  #6
New Member
 
Junshin Park
Join Date: Oct 2013
Posts: 6
Rep Power: 13
lonelywing is on a distinguished road
Quote:
Originally Posted by wc34071209 View Post
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 View Post
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?
lonelywing is offline   Reply With Quote

Old   October 21, 2014, 06:39
Default
  #7
Senior Member
 
Yuehan
Join Date: Nov 2012
Posts: 142
Rep Power: 14
wc34071209 is on a distinguished road
Quote:
Originally Posted by lonelywing View Post
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 is offline   Reply With Quote

Old   October 21, 2014, 12:06
Default
  #8
Senior Member
 
Yuehan
Join Date: Nov 2012
Posts: 142
Rep Power: 14
wc34071209 is on a distinguished road
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.
wc34071209 is offline   Reply With Quote

Old   October 22, 2014, 07:56
Default
  #9
Senior Member
 
Ashwani
Join Date: Sep 2013
Location: Hyderabad
Posts: 154
Rep Power: 13
AshwaniAssam is on a distinguished road
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.

Last edited by AshwaniAssam; October 22, 2014 at 07:57. Reason: missed few words
AshwaniAssam is offline   Reply With Quote

Old   October 22, 2014, 23:06
Default
  #10
New Member
 
Junshin Park
Join Date: Oct 2013
Posts: 6
Rep Power: 13
lonelywing is on a distinguished road
I appreciate to both of you. I learned a lot
lonelywing is offline   Reply With Quote

Old   November 18, 2016, 10:45
Default
  #11
Senior Member
 
Join Date: Jun 2016
Posts: 102
Rep Power: 10
xuegy is on a distinguished road
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 View Post
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.

Last edited by xuegy; November 22, 2016 at 00:34.
xuegy is offline   Reply With Quote

Old   November 23, 2016, 22:31
Default
  #12
New Member
 
Join Date: Jul 2014
Posts: 2
Rep Power: 0
haer is on a distinguished road
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 View Post
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.
haer is offline   Reply With Quote

Old   November 25, 2016, 03:14
Default
  #13
New Member
 
Bo Kong
Join Date: Oct 2016
Location: China
Posts: 22
Rep Power: 10
huangfei is on a distinguished road
I am also trying a similar case.
huangfei is offline   Reply With Quote

Old   November 28, 2016, 17:39
Default
  #14
Senior Member
 
Join Date: Jun 2016
Posts: 102
Rep Power: 10
xuegy is on a distinguished road
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.

Last edited by xuegy; November 29, 2016 at 16:12.
xuegy is offline   Reply With Quote

Old   May 12, 2017, 10:40
Default flow rate at inlet and outlet
  #15
New Member
 
Bharadwaj Bhushan
Join Date: Mar 2017
Posts: 19
Rep Power: 9
Bharath Bhushan is on a distinguished road
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
Bharath Bhushan is offline   Reply With Quote

Old   May 24, 2020, 18:52
Default
  #16
Member
 
Hector
Join Date: Jul 2010
Location: Barcelona
Posts: 30
Rep Power: 16
hectorgabriel85 is on a distinguished road
Quote:
Originally Posted by wc34071209 View Post
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
hectorgabriel85 is offline   Reply With Quote

Old   May 24, 2020, 20:11
Default
  #17
Member
 
Ardalan
Join Date: Jul 2012
Location: Atlanta, USA
Posts: 77
Rep Power: 14
Ardali is on a distinguished road
Why do you want it? use pressureInletOutletVelocity with zeroGradient does the same!
Ardali is offline   Reply With Quote

Old   May 26, 2020, 18:34
Default
  #18
Member
 
Hector
Join Date: Jul 2010
Location: Barcelona
Posts: 30
Rep Power: 16
hectorgabriel85 is on a distinguished road
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.

Last edited by hectorgabriel85; May 27, 2020 at 00:08.
hectorgabriel85 is offline   Reply With Quote

Old   May 26, 2020, 20:33
Default
  #19
Member
 
Ardalan
Join Date: Jul 2012
Location: Atlanta, USA
Posts: 77
Rep Power: 14
Ardali is on a distinguished road
No, they merged them together!
hectorgabriel85 likes this.
Ardali is offline   Reply With Quote

Old   September 14, 2020, 11:48
Default
  #20
Senior Member
 
Join Date: Jul 2019
Posts: 148
Rep Power: 7
Bodo1993 is on a distinguished road
Quote:
Originally Posted by wc34071209 View Post
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.
Bodo1993 is offline   Reply With Quote

Reply

Tags
incompressible flow, pressure bc, simplefoam not converged


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
Time dependant pressure boundary condition yosuke1984 OpenFOAM Verification & Validation 3 May 6, 2015 07:16
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 18:44
strange flow of pressure boundary adjacent periodic condition oilsok FLUENT 2 May 26, 2012 13:51
RPM in Wind Turbine Pankaj CFX 9 November 23, 2009 05:05
External,incompressible flow boundary condition? John Main CFD Forum 0 October 1, 2003 01:00


All times are GMT -4. The time now is 11:07.