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

internal flow BCs: pressure driven versus velocity driven

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

Like Tree5Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 17, 2012, 14:29
Default internal flow BCs: pressure driven versus velocity driven
  #1
Senior Member
 
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 195
Rep Power: 16
mihaipruna is on a distinguished road
this is what I have in my p and U files for a flow driven by velocity. it seems to run fine:

for velocity:
SDuctWallface1
{
type fixedValue;
value uniform (0 0 0);
}
SDuctWallface2
{
type fixedValue;
value uniform (0 0 0);
}
SDuctInletface1
{
type surfaceNormalFixedValue;
refValue uniform -20.000000;
}
SDuctOutletface1
{
type zeroGradient;
}





for pressure:

SDuctWallface1
{
type zeroGradient;
}
SDuctWallface2
{
type zeroGradient;
}
SDuctInletface1
{
type zeroGradient;
}
SDuctOutletface1
{
type fixedValue;
value uniform 0.000000;
}


now, trying on a case where I want to run a flow driven by the difference between inlet total pressure and outlet pressure:

for velocity:
SDuctWallface1
{
type fixedValue;
value uniform (0 0 0);
}
SDuctWallface2
{
type fixedValue;
value uniform (0 0 0);
}
SDuctInletface1
{
type pressureInletVelocity;
}
SDuctOutletface1
{
type zeroGradient;
}



for pressure:
SDuctWallface1
{
type zeroGradient;
}
SDuctWallface2
{
type zeroGradient;
}
SDuctInletface1
{
type totalPressure;
value uniform 100000.000000;
}
SDuctOutletface1
{
type fixedValue;
value uniform 0.000000;
}

error:

--> FOAM FATAL IO ERROR:
keyword gamma is undefined in dictionary "/home/cadne
/run/sductpres/0/p::boundaryField::SDuctInletface1"

file: /home/cadnexus/OpenFOAM/cadnexus-2.1.0/run/sduc
DuctInletface1 from line 51 to line 52.

From function dictionary::lookupEntry(const word&
in file db/dictionary/dictionary.C at line 400.


I'm running simpleFoam so it's incompressible.
__________________
Mihai Pruna's Bio
mihaipruna is offline   Reply With Quote

Old   April 18, 2012, 16:01
Default
  #2
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 17
kmooney is on a distinguished road
It's complaining because there are more components required to define the totalPressure boundary condition you have set at the inlet. You might have meant fixedValue, like this:

SDuctInletface1
{
type fixedValue;
value uniform 100000.000000;
}
kmooney is offline   Reply With Quote

Old   April 18, 2012, 16:34
Default
  #3
Senior Member
 
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 195
Rep Power: 16
mihaipruna is on a distinguished road
Quote:
Originally Posted by kmooney View Post
It's complaining because there are more components required to define the totalPressure boundary condition you have set at the inlet. You might have meant fixedValue, like this:

SDuctInletface1
{
type fixedValue;
value uniform 100000.000000;
}
if you set it as a fixed value, and set an outlet pressure, while leaving the velocity as I set it, will it work as intended?
to me it seems there would be too many unknowns to establish the flow field.
__________________
Mihai Pruna's Bio
mihaipruna is offline   Reply With Quote

Old   April 18, 2012, 16:38
Default
  #4
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 17
kmooney is on a distinguished road
You might need to set your velocity inlet as zeroGradient.
kmooney is offline   Reply With Quote

Old   April 18, 2012, 16:48
Default
  #5
Senior Member
 
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 195
Rep Power: 16
mihaipruna is on a distinguished road
it's worth a try.
__________________
Mihai Pruna's Bio
mihaipruna is offline   Reply With Quote

Old   April 19, 2012, 09:18
Default
  #6
Senior Member
 
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 195
Rep Power: 16
mihaipruna is on a distinguished road
that didn't yield good results. At all.

Can anyone give me a good example of a total pressure BC and extra parameters set up?
__________________
Mihai Pruna's Bio
mihaipruna is offline   Reply With Quote

Old   April 19, 2012, 09:30
Default
  #7
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 17
kmooney is on a distinguished road
Quote:
Originally Posted by mihaipruna View Post
that didn't yield good results. At all.

Can anyone give me a good example of a total pressure BC and extra parameters set up?
Works just fine for me....

kmooney is offline   Reply With Quote

Old   April 19, 2012, 10:19
Default
  #8
Senior Member
 
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 195
Rep Power: 16
mihaipruna is on a distinguished road
is this one of the tutorials? if so, which one?
thanks!
__________________
Mihai Pruna's Bio
mihaipruna is offline   Reply With Quote

Old   April 19, 2012, 10:22
Default
  #9
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 17
kmooney is on a distinguished road
It's the elbow tutorial (modified) for icoFoam. I changed the BC's to be pressure driven. I put zeroGradient U BC's on inlets and the outlet, no slip on the walls. I assigned a pressure drop of 10 Pa.
kmooney is offline   Reply With Quote

Old   April 19, 2012, 10:38
Default
  #10
Senior Member
 
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 195
Rep Power: 16
mihaipruna is on a distinguished road
Quote:
Originally Posted by kmooney View Post
It's the elbow tutorial (modified) for icoFoam. I changed the BC's to be pressure driven. I put zeroGradient U BC's on inlets and the outlet, no slip on the walls. I assigned a pressure drop of 10 Pa.
Can you please paste the content of your p and U files? Maybe I'm making a silly mistake.
Thanks!
__________________
Mihai Pruna's Bio
mihaipruna is offline   Reply With Quote

Old   April 19, 2012, 10:59
Default
  #11
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 17
kmooney is on a distinguished road
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM Extend Project: Open Source CFD |
| \\ / O peration | Version: 1.6-ext |
| \\ / A nd | Web: www.extend-project.de |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 2 -2 0 0 0 0];

internalField uniform 0;

boundaryField
{
wall-4
{
type zeroGradient;
}

velocity-inlet-5
{
type fixedValue;
value uniform 10;
}

velocity-inlet-6
{
type fixedValue;
value uniform 10;
}

pressure-outlet-7
{
type fixedValue;
value uniform 0;
}

wall-8
{
type zeroGradient;
}

frontAndBackPlanes
{
type empty;
}
}

// ************************************************** *********************** //



/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM Extend Project: Open Source CFD |
| \\ / O peration | Version: 1.6-ext |
| \\ / A nd | Web: www.extend-project.de |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 1 -1 0 0 0 0];

internalField uniform (0 0 0);

boundaryField
{
wall-4
{
type fixedValue;
value uniform (0 0 0);
}

velocity-inlet-5
{
type zeroGradient;
}

velocity-inlet-6
{
type zeroGradient;
}

pressure-outlet-7
{
type zeroGradient;
}

wall-8
{
type fixedValue;
value uniform (0 0 0);
}

frontAndBackPlanes
{
type empty;
}
}





kmou and Caio Martins like this.
kmooney is offline   Reply With Quote

Old   April 19, 2012, 11:11
Default
  #12
Senior Member
 
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 195
Rep Power: 16
mihaipruna is on a distinguished road
this is the velocity driven flow, not pressure driven.
__________________
Mihai Pruna's Bio
mihaipruna is offline   Reply With Quote

Old   April 19, 2012, 11:15
Default
  #13
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 17
kmooney is on a distinguished road
I've assigned a fixed deltaP between the inlets and the outlets. Dirchlet BC's are assigned for U at the walls only as no slip, no penetration. Von Neumann conditions at the inlet and outlet for U.

Please explain your reasoning for describing this as a velocity driven flow.
smog likes this.
kmooney is offline   Reply With Quote

Old   April 19, 2012, 11:25
Default
  #14
Senior Member
 
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 195
Rep Power: 16
mihaipruna is on a distinguished road
my bad, since the patches were named velocity, didn't look at the header properly
sorry
thanks
__________________
Mihai Pruna's Bio
mihaipruna is offline   Reply With Quote

Old   April 19, 2012, 16:38
Default
  #15
Member
 
Saba Saeb
Join Date: Dec 2010
Location: Erlangen, Germany
Posts: 32
Rep Power: 15
saba_saeb is on a distinguished road
I think you just missed to specify a value for gamma, in case of using totalpressure, you also have to set a value for gamma, the boundary conditions that you sent in your first posts seem right.
saba_saeb is offline   Reply With Quote

Old   April 20, 2012, 12:48
Default
  #16
Senior Member
 
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 195
Rep Power: 16
mihaipruna is on a distinguished road
Quote:
Originally Posted by saba_saeb View Post
I think you just missed to specify a value for gamma, in case of using totalpressure, you also have to set a value for gamma, the boundary conditions that you sent in your first posts seem right.
Thanks.
I also had to change value uniform to p0 uniform.
it's running now with inlet specifying total pressure.
keep your fingers crossed.
__________________
Mihai Pruna's Bio
mihaipruna is offline   Reply With Quote

Old   April 21, 2012, 15:25
Default
  #17
Member
 
Saba Saeb
Join Date: Dec 2010
Location: Erlangen, Germany
Posts: 32
Rep Power: 15
saba_saeb is on a distinguished road
Quote:
Originally Posted by mihaipruna View Post
Thanks.
I also had to change value uniform to p0 uniform.
it's running now with inlet specifying total pressure.
keep your fingers crossed.
Good to hear that, but do you happen to know why we are supposed to use totalpressure boundary condition instead of fixedValue at inlet? I've read somewhere in the forum that it does not physically make sense to set both inlet and outlet fixedValue when we are considering pressure driven flow, but I didn't figure out the reason.

Cheers,
Saba
saba_saeb is offline   Reply With Quote

Old   April 21, 2012, 18:10
Default
  #18
Senior Member
 
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 195
Rep Power: 16
mihaipruna is on a distinguished road
from what i understand, it has to do with the way pressure is transmitted via waves. if you set both inlet and outlet to fixed pressures you are overconstraining the problem.
i think if you set fixed inlet you have to set wavetransmissive at the outlet.
with total pressure,it adjusts itself i guess.
not sure


my solution even with total pressure at inlet has a singularity and i am trying to figure out if the mesh is causing it or something else.
__________________
Mihai Pruna's Bio
mihaipruna is offline   Reply With Quote

Old   August 13, 2012, 10:16
Default
  #19
New Member
 
Oluwalogbon Akinnola
Join Date: Mar 2012
Posts: 23
Rep Power: 14
lobstar is on a distinguished road
What does gamma stand for in openFOAM?
lobstar is offline   Reply With Quote

Old   August 30, 2012, 03:53
Default
  #20
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,

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<scalar>& psip =
            patch().lookupPatchField<volScalarField, scalar>(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<scalar>& rho =
            patch().lookupPatchField<volScalarField, scalar>(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
kmou and alireza94 like this.

Last edited by Tobi; August 30, 2012 at 09:06.
Tobi is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Maintaining Static Pressure at Fluid Flow Inlet cdevalve FLUENT 3 January 14, 2012 00:11
Channel flow: Inlet pressure AND uniform velocity? frmap1 Main CFD Forum 0 April 15, 2010 10:32
Pressure driven laminar flow simpleFoam pressure higher at the outlet than inlet gabriel OpenFOAM Running, Solving & CFD 16 September 30, 2009 18:20
Urgent: How to model a stationary sphere in a pressure driven flow using Ansys CFX? farhan OpenFOAM Running, Solving & CFD 1 April 14, 2009 14:34
Hydrostatic pressure in 2-phase flow modeling (CFX4.2) HB &DS CFX 0 January 9, 2000 13:19


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