CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

simpleFoam - pressure

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 18, 2016, 10:40
Default simpleFoam - pressure
  #1
New Member
 
igor.leo93's Avatar
 
Igor Leonardo
Join Date: Jul 2016
Location: Brazil - SP - SJC
Posts: 20
Rep Power: 10
igor.leo93 is on a distinguished road
Hello everyone,

So i been reading around the forum, regarding pressure using simpleFoam.

Imagine a simple model, like a straight tube, with one inlet, one outlet and some walls.

If we use such boundary conditions, for U and P, as the follwing:

U:

Code:
dimensions      [0 1 -1 0 0 0 0];

internalField   uniform (0 0 0);

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform (54.87 0 0);
    }
    outlet
    {
        type            zeroGradient;
    }
    walls
    {
        type            noSlip;
    }
}
p:

Code:
dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    inlet
    {
        type            zeroGradient;
    }
    outlet
    {
        type            fixedValue;
        value           uniform 0;
    }
    walls
    {
        type            zeroGradient;
    }
}
From what i been reading around, this kind of setup would give us the pressure difference.

My questions are the follwing:

1- With this kind of setup, using simpleFoam, the resulting pressure i would get when i looked at it on paraview for example, would also be p/rho right? So if wanted the actual pressure difference, or head loss, i would have to multiply everything by the density correct?

2- Now suppose that for a simple tube like that, i know the inlet velocity, and also the static pressure on the inlet. What would be the optimal boundary conditions for that situation? Or perhaps, i could keep the same setup, and then just subtract the value of the pressure that i know on the inlet with the values from pressure i obtained on the simulation?

I hope i could make my self clear, if i couldn't, please let me know and i will ty to elaborate further.

Thanks everyone in advance,

Best regards,
Igor Carvalho
igor.leo93 is offline   Reply With Quote

Old   August 19, 2016, 02:31
Default
  #2
Member
 
Mohammed Gowhar
Join Date: Feb 2014
Posts: 48
Rep Power: 12
mdgowhar is on a distinguished road
Quote:
With this kind of setup, using simpleFoam, the resulting pressure i would get when i looked at it on paraview for example, would also be p/rho right? So if wanted the actual pressure difference, or head loss, i would have to multiply everything by the density correct?
Yes.. it is p/rho.
The pressure difference also same (Pressure_out- Pressure_inlet). It is not required to multiply by density.

Quote:
2- Now suppose that for a simple tube like that, i know the inlet velocity, and also the static pressure on the inlet. What would be the optimal boundary conditions for that situation? Or perhaps, i could keep the same setup, and then just subtract the value of the pressure that i know on the inlet with the values from pressure i obtained on the simulation?
How you can have two boundary conditions at inlet?
mdgowhar is offline   Reply With Quote

Old   August 19, 2016, 09:34
Default s
  #3
New Member
 
igor.leo93's Avatar
 
Igor Leonardo
Join Date: Jul 2016
Location: Brazil - SP - SJC
Posts: 20
Rep Power: 10
igor.leo93 is on a distinguished road
Quote:
Originally Posted by mdgowhar View Post
Yes.. it is p/rho.
The pressure difference also same (Pressure_out- Pressure_inlet). It is not required to multiply by density.
Ok so it is p/rho.
I didn't understand your second statement.
pout/rho - pin/rho = Delta p/rho
So the actual Delta p would have to be multiplied by rho, to be just Delta p, right? Or am i confusing something?

Quote:
Originally Posted by mdgowhar View Post
How you can have two boundary conditions at inlet?
If pressure and velocity are known at the inlet, then i could use a fixed value for p and u on the inlet, and let the solver calculate both parameters on the outlet for example, what do you think?

Something like this:

U:

Code:
dimensions      [0 1 -1 0 0 0 0];  
internalField   uniform (0 0 0); 
boundaryField
{   
inlet    
{         
type            fixedValue;         
value           uniform (54.87 0 0);    
}    
outlet     
{         
type            zeroGradient; // or calculated perhaps?    
}     
walls     
{        
type            noSlip;     
} 
}
p:

Code:
dimensions      [0 2 -2 0 0 0 0];  
internalField   uniform 0;  
boundaryField 
{     
inlet     
{         
type            fixedValue;        
value           uniform 100; //value of actual p/rho     
}     
outlet     
{        
type            zeroGradient; //or calculated perhaps?     
}     
walls     
{         
type            zeroGradient;     
}
}

This kinda of setup is just something that i though of for a situation of which both velocity and pressure are known on the inlet and not known for the outlet, but i never tried this i don't know if it would work.

My question was if there are appropriate boundary conditions for such case, or if we can assume what i said on my first post, that is, if by using pressure boundary conditions of zeroGradient on the inlet, and fixed value zero, on the outlet, then we could just subtract the value of the pressure that i know on the inlet with the values from pressure i obtained on the simulation, to obtain the actual pressure distribution.

Thanks for looking at this thread.

Best regards,
Igor
igor.leo93 is offline   Reply With Quote

Old   August 20, 2016, 07:57
Default
  #4
Member
 
Mohammed Gowhar
Join Date: Feb 2014
Posts: 48
Rep Power: 12
mdgowhar is on a distinguished road
I am sorry, we have to multiply by density to get actual Pressure.

Quote:
If pressure and velocity are known at the inlet, then i could use a fixed value for p and u on the inlet, and let the solver calculate both parameters on the outlet for example, what do you think?
If you use two condition at the same time, your solution will diverge. In CFD terms its a wrong approach.
You can have boundary conditions as follow:
1. Velocity Inlet | Pressure Outlet
2. Mass flow rate Inlet | Pressure Outlet
3. Stagnation Inlet | Pressure Outlet

In conclusion, you have to use zeroGradient for Inlet for P
mdgowhar is offline   Reply With Quote

Old   August 20, 2016, 10:19
Default Velocity driven flow x Pressure driven flow
  #5
New Member
 
igor.leo93's Avatar
 
Igor Leonardo
Join Date: Jul 2016
Location: Brazil - SP - SJC
Posts: 20
Rep Power: 10
igor.leo93 is on a distinguished road
Quote:
Originally Posted by mdgowhar View Post

If you use two condition at the same time, your solution will diverge. In CFD terms its a wrong approach.
In conclusion, you have to use zeroGradient for Inlet for P
Ah i see, i suspected that, thank you for making it clear for me.

Sorry to bother you further but i have just 2 more questions:

Consider the case i mentioned above, a simple elbow tube, 1 inlet, 1 outlet, fixed walls.

The known parameters are inlet velocity and pressure.
The value we would be looking for would be the force acting on the elbow, for example.

1- If i use boundary conditions such as the ones i mentioned:

U:

Inlet: fixed velocity.
Outlet: zeroGradient.
Walls: noSlip.

p

Inlet: zeroGradiente;
Outlet: fixedValue zero;
Walls: zeroGradient;

This setup would be a velocity driven flow right?

With this setup i can assume the velocity field would be correct.
The pressure gradient i would obtain would be the head loss to that specific portion of the tube right?

Here let me elaborate further about my question to try make my question very clear:

Suppose that with this setup, i obtained the following data:
Pressure on the outlet: zero (Because it was fixed 0)
Pressure on the inlet: 500Pa.

So i could say that the head loss of this part of the tube is 500Pa.

But i know for a fact, that the pressure on the inlet is, for example, 10000Pa, so the real pressure i would have on my tube, considering this real pressure that i know would be:

Pressure on the inlet: 10000Pa
Pressure on the outlet 9500Pa.

and the velocity field for this pressure would be correct too right?

This concludes question number 1. If i need to elaborate further just tell me.

Question 2-

Now assume i would want to make a pressure driven flow, in your opinion, the following boundary conditions would be correct?

p:

Inlet: fixedValue 10000Pa.
Outlet: fixedValue 9500Pa.
Walls: zeroGradient.

U:

Inlet: pressureInletVelocity;
Outlet: zeroGradient;
Walls: zeroGradient;

And the results i should be expect is now a correct pressure gradient.
And for the velocity i'm not sure what i should expect?
It should get to a inlet velocity same as the velocity i know that is there for a fact?

This concludes question two.

Sorry for asking so many questions... but i'm sure this will clarify things not only for me but for many other.

Thanks for the awesome help in advantage.
Best regards,

Igor Carvalho.
igor.leo93 is offline   Reply With Quote

Old   August 24, 2016, 07:12
Default
  #6
Member
 
Mohammed Gowhar
Join Date: Feb 2014
Posts: 48
Rep Power: 12
mdgowhar is on a distinguished road
Hi,
Since I was very busy with my work , I could not able to reply on time.

Let me put it in simple words,
Total Pressure = Static pressure + Dynamic Pressure

Now consider the Bernoulli Equation, It always along the streamline.
Do you agree?
Rearrange the Bernoulli equation as follows
Code:
(P1-P2)/rho =  0.5*(V2^2 - V1^2)
here you can see P2-P1 always constant in CFD code. As per your first question, it will work.

Next question I will post the answer soon. Since I am in the middle of the work, I could not elaborate it right now.
mdgowhar is offline   Reply With Quote

Reply

Tags
boundary conditions, incompressible, p/rho, pressure, simplefoam


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
Getting hydrostatic pressure in a vertical box using simpleFOAM maxou1993 OpenFOAM Running, Solving & CFD 3 June 13, 2022 06:02
interFoam (HELYX-OS) pressure boundary conditions SFr OpenFOAM Running, Solving & CFD 8 June 23, 2016 17:36
CFX Solver stopped with error when requested for backup during solver running Mfaizan CFX 40 May 13, 2016 07:50
sonicFoam - pressure driven pipe: flow continuity violation and waveTransmissive BC Endel OpenFOAM Running, Solving & CFD 3 September 11, 2014 17:29
Pressure BC for combustion chamber Giuki FLUENT 1 July 19, 2011 12:35


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