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

How to set pressure bc?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 12, 2023, 10:50
Exclamation How to set pressure bc?
  #1
New Member
 
riccardo
Join Date: Mar 2023
Posts: 7
Rep Power: 3
ricx is on a distinguished road
Hi, I am modeling a vertical pipe, with inlet at the top and outlet at the bottom.
I set the velocity at the top. I would like to fix pressure at the top and, in a sense, see the pressure changes at the bottom, is it possible?
I have both a file for p and for p_rgh.
The problem is that the pressure at the bottom remains fixed to the initial value, while it changes at the inlet. For the moment I have set:

p_rgh:
inlet
{
type fixedFluxPressure;
value $internalField;
}
outlet
{
type prghPressure;
p $internalField;
value $internalField;
}

p:
inlet
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}

However using different condition (for example zerogradient for p_rgh at outlet) ends up in an error.
ricx is offline   Reply With Quote

Old   May 14, 2023, 07:29
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Hello Riccardo,

Knowing what solver you are using could be helpful here.
Usually on solvers using p_rgh, we set the BC on p_rgh and p only uses calculated BCs (basically p is computed based on p_rgh, and you need to focus on setting proper BCs on p_rgh)

On the setup you posted, you are fixing the pressure at the outlet using prghPressure, and you let it "free" at the inlet with fixedFluxPressure. So you get the expected behavior: the pressure is fixed at the outlet and it changes at the inlet (fixedFluxPressure basically adjusts pressure gradient to satisfy the velocity fixed on the patch)

You will not be able to fix both pressure and velocity at the inlet as it will lead to numerical issues. You cannot use fixedFluxPressure + zeroGradient either since both are setting gradients and you need to fix a pressure value somewhere.
If you want to fix an inlet pressure you will probably have to define an outlet velocity rather than an inlet one, and it might be more unstable.

More about BCs general principles here: https://doc.cfd.direct/notes/cfd-gen...ary-conditions

Hope this helps,
Yann
Yann is offline   Reply With Quote

Old   May 15, 2023, 04:43
Default
  #3
New Member
 
riccardo
Join Date: Mar 2023
Posts: 7
Rep Power: 3
ricx is on a distinguished road
Quote:
Originally Posted by Yann View Post
Hello Riccardo,

Knowing what solver you are using could be helpful here.
Usually on solvers using p_rgh, we set the BC on p_rgh and p only uses calculated BCs (basically p is computed based on p_rgh, and you need to focus on setting proper BCs on p_rgh)

On the setup you posted, you are fixing the pressure at the outlet using prghPressure, and you let it "free" at the inlet with fixedFluxPressure. So you get the expected behavior: the pressure is fixed at the outlet and it changes at the inlet (fixedFluxPressure basically adjusts pressure gradient to satisfy the velocity fixed on the patch)

You will not be able to fix both pressure and velocity at the inlet as it will lead to numerical issues. You cannot use fixedFluxPressure + zeroGradient either since both are setting gradients and you need to fix a pressure value somewhere.
If you want to fix an inlet pressure you will probably have to define an outlet velocity rather than an inlet one, and it might be more unstable.

More about BCs general principles here: https://doc.cfd.direct/notes/cfd-gen...ary-conditions

Hope this helps,
Yann
Thanks a lot for your answer, I have a further doubt: defining the bc like this:
p_rgh:
inlet
{
type prghPressure;
p $internalField;
value $internalField;
}
outlet
{
type fixedFluxPressure;
value $internalField;
}

gives some results that for my modeling are better because at outlet I see pressure changes. However I was wondering if this makes sense
ricx is offline   Reply With Quote

Old   May 15, 2023, 06:14
Default
  #4
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Quote:
Originally Posted by ricx View Post
However I was wondering if this makes sense
It depends on what you set for U on those patches. Pressure and velocity are coupled, so their BCs must work together.

More generally speaking, it's not possible to tell if your setup makes sense without knowing what kind of physics you are trying to simulate and which solver you are using.

Yann
Yann is offline   Reply With Quote

Reply

Tags
bc's, openfoam, pressure, vertical pipe, zerogradient


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
[ICEM] ICEM Scripting Issues tylerplowright ANSYS Meshing & Geometry 33 September 27, 2021 17:35
What is difference between static pressure and gauge pressure? aja1345 FLUENT 1 July 20, 2018 21:05
how to set exit pressure correctly? sms1424 STAR-CCM+ 1 April 26, 2016 16:49
How to set environment variables kanishka OpenFOAM Installation 1 September 4, 2005 11:15
what the result is negatif pressure at inlet chong chee nan FLUENT 0 December 29, 2001 06:13


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