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

totalPressure (why flux direction dependend)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 11, 2016, 07:49
Default totalPressure (why flux direction dependend)
  #1
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi all,

I have a question to the totalPressure. First the simple test case I made. It is a 2d rectangle with inlet left and outlet right; top bottom wall and of course empty patches for front and back.

The velocity at inlet and outlet is adjusted by the pressure.
The pressure at the outlet is totalPressure with p0 = 0 and the inlet is -5 or +5 as fixed value.

Behavior

Okay if I set a fixed pressure drop (pressure gradient) of inlet and outlet (both fixedValue), the fluid will accelerate till infinity because we will keep the pressure gradient, that will accelerate the fluid more and more. That is clear.

If we fix the inlet pressure and use totalPressure at the outlet, then (as far as I understand) the pressure at the faces should be adjusted due to the fluxes and the totalPressure we set.

Code:
    1. incompressible subsonic:
        \f[
            p_p = p_0 - 0.5 |U|^2
        \f]
So far so good.

Working boundary condition set-up

inlet p fixedValue < 0
outlet p totalPressure p0 = 0

In this set-up the flow is entering at the outlet and leaving at the inlet and hence the pressure at the faces are adjusted till a balance between pressure and fluxes fulfill the totalPressure condition.

NOT working boundary condition set-up

inlet p fixedValue > 0
outlet p totalPressure p0 = 0

In this set-up the flow is entering at the inlet and leaving at the outlet but the pressure at the outlet is kept at 0 Pa (like the total pressure).


Reason for the "NOT working boundary condition set-up"

The reason why the second case is not working as I expect is due to the fact that this line in the source file:

Code:
operator==(p0p - 0.5*(1.0 - pos(phip))*magSqr(Up));
will be at least

Code:
operator==p0p;
because pos(phip) is 1 if the flux is directed outside and 0 if the flux is directed inside.

My question

Is there a reason for the direction (only working if the flux is going inside that patch?). I made a test where I switched from:

Code:
operator==(p0p - 0.5*(1.0 - pos(phip))*magSqr(Up));
to

Code:
operator==(p0p - 0.5*(-1.0*sign(phip))*magSqr(Up));
that is actual working for the inflow and outflow.

For the inflow I get the same result as the normal one (that is clear)
For the outflow I get another result that looks okay but the velocities are total different.


At the moment I am only searching for the reason why outflow is not valid (or forbidden)?

Thanks in advance,
Tobi


Answer:
Its clear. TotalPressure acts as fixedValue for outflow and for inflow we adjust the pressure due to fluxes.
Attached Images
File Type: png totalPressure.png (33.3 KB, 70 views)
__________________
Keep foaming,
Tobias Holzmann

Last edited by Tobi; April 13, 2016 at 07:20.
Tobi is offline   Reply With Quote

Old   April 13, 2016, 14:14
Default
  #2
Member
 
Geir Karlsen
Join Date: Nov 2013
Location: Norway
Posts: 59
Rep Power: 13
gkarlsen is on a distinguished road
Interested in this topic also. However, what you are describing appears to make sense to me. Considering a fluid at rest outside of the domain. Acceleration of the fluid into the domain would decrease the static pressure, however during discharge from domain to surroundings the kinetic energy is lost so the velocity term should not be taken into account?

This was quite a lot of assumptions on my part, but consider it a free bump on your post
gkarlsen is offline   Reply With Quote

Old   April 13, 2016, 16:32
Default
  #3
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Quote:
Originally Posted by gkarlsen View Post
Interested in this topic also. However, what you are describing appears to make sense to me. Considering a fluid at rest outside of the domain. Acceleration of the fluid into the domain would decrease the static pressure, however during discharge from domain to surroundings the kinetic energy is lost so the velocity term should not be taken into account?

This was quite a lot of assumptions on my part, but consider it a free bump on your post
Dear Karlsen,

thanks for the replay. I do not understand this sentence:
Quote:
Acceleration of the fluid into the domain would decrease the static pressure, however during discharge from domain to surroundings the kinetic energy is lost so the velocity term should not be taken into account?
If we have outflow the velocity is not taken into account, if inflow, yes. Therefore the static pressure will decrease and at last the pressure at the face is P_total - 1/2 mag(U)^2 (for incompressible fluids).
__________________
Keep foaming,
Tobias Holzmann

Last edited by wyldckat; April 16, 2016 at 11:55. Reason: fixed broken end quote marker
Tobi is offline   Reply With Quote

Old   October 17, 2019, 22:27
Default
  #4
Senior Member
 
Ruiyan Chen
Join Date: Jul 2016
Location: Hangzhou, China
Posts: 162
Rep Power: 9
cryabroad is on a distinguished road
Almost four years past since you posted this thread, and I happen to work on similar things so I'll report what I found. I'm looking for the answer as well!

I'm working on a 3D LES simulation for a circular pipe, just for validation and fun. I used a velocity profile at the inlet, which is based on the 1/7 law. I've tested two cases, one with fixedValue of p at the outlet, and the other one with totalPressure of p at the outlet. What I found is the same as yours, that the pressure at the outlet using totalPressure behaves exactly the same as one using fixedValue. This is kind of surprising, as I would guess that by using totalPressure, I get p_outlet = total pressure - 1/2*U^2, which makes more sense from a physical point of view doesn't it?
cryabroad is offline   Reply With Quote

Reply


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
Radiation in semi-transparent media with surface-to-surface model? mpeppels CFX 11 August 22, 2019 07:30
Udf for moving heat flux in 2D cylindrical geometry devia21 Fluent UDF and Scheme Programming 0 April 20, 2015 00:27
Question about heat transfer coefficient setting for CFX Anna Tian CFX 1 June 16, 2013 06:28
Problem setting with chtmultiregionFoam Antonin OpenFOAM 10 April 24, 2012 09:50
Replace periodic by inlet-outlet pair lego CFX 3 November 5, 2002 20:09


All times are GMT -4. The time now is 18:37.