# internal flow BCs: pressure driven versus velocity driven

 Register Blogs Members List Search Today's Posts Mark Forums Read

 September 7, 2012, 14:18 #21 New Member   anonymous Join Date: Oct 2010 Posts: 4 Rep Power: 7 Since you are using simpleFoam just add the following: type totalPressure; gamma 1.0; p0 uniform 0; value uniform 0; You should be O.K now.

March 6, 2014, 11:00
BC Total Pressure
#22
Member

Join Date: Feb 2014
Posts: 56
Rep Power: 3
Dear OpenFoamers,

I would like to set up my study case: a water flow through a channel by simpleFoam.

I want to set boundary conditions as total pressure: (1 bar at inlet and 0 bar at outlet).

Now I have:

================================================== ====
p
================================================== ====
inlet
type fixedValue
uniform 100

? for simpleFoam pressure = pressure/mass density, right?

outlet
type fixedValue
uniform 0

================================================== ====
U
================================================== ====

inlet
type pressureInletVelocity
uniform (0 0 0)

outlet

It does not work when I ran simpleFoam! It stops after several iterations.

I really don't understand what happened.

Do you known why, rather why not?

I am looking to hear from you all...

Regards,

T

Quote:
 Originally Posted by Tobi Hi all, for the totalPressure BC there are different ways for calculation. It depends on the initialization of the BC. But first to your question @lobstar. gamma = Heat capacity ratio That is the important code for totalPressure: Code: ``` if (psiName_ == "none" && rhoName_ == "none") { operator==(p0p - 0.5*(1.0 - pos(phip))*magSqr(Up)); } else if (rhoName_ == "none") { const fvPatchField& psip = patch().lookupPatchField(psiName_); if (gamma_ > 1.0) { scalar gM1ByG = (gamma_ - 1.0)/gamma_; operator== ( p0p /pow ( (1.0 + 0.5*psip*gM1ByG*(1.0 - pos(phip))*magSqr(Up)), 1.0/gM1ByG ) ); } else { operator==(p0p/(1.0 + 0.5*psip*(1.0 - pos(phip))*magSqr(Up))); } } else if (psiName_ == "none") { const fvPatchField& rho = patch().lookupPatchField(rhoName_); operator==(p0p - 0.5*rho*(1.0 - pos(phip))*magSqr(Up)); }``` depend on your BC initialization you calculate in different ways. In the constructors you find the way how to set this bc correct and if you do not set an value which value would be set instead - an example that works: Code: ```outlet { type totalPressure; p0 uniform 100000; psi none; gamma 0; rho rho; value uniform 100000; } and that lead you to that calculation: operator==(p0p - 0.5*rho*(1.0 - pos(phip))*magSqr(Up));``` If you set rho=none and psi=none (like in incompressible flows) you get the same calculation without rho: Code: ```operator==(p0p - 0.5*(1.0 - pos(phip))*magSqr(Up)); its here: if (psiName_ == "none" && rhoName_ == "none") { operator==(p0p - 0.5*(1.0 - pos(phip))*magSqr(Up)); }``` Hope it will help you. Tobi

 March 6, 2014, 11:06 #23 Member   Join Date: Feb 2014 Posts: 56 Rep Power: 3 Thank MBA for your answer. That's for p, right? And for both inlet and outlet? Preciously, I change in constant/transportProperties nu = 1e-6 to simulate water. It's OK? May you give me more details... That's would be useful.

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post cdevalve FLUENT 3 January 14, 2012 01:11 frmap1 Main CFD Forum 0 April 15, 2010 10:32 gabriel OpenFOAM Running, Solving & CFD 16 September 30, 2009 18:20 farhan OpenFOAM Running, Solving & CFD 1 April 14, 2009 14:34 HB &DS CFX 0 January 9, 2000 14:19

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