CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   simpleFoam - pressure (https://www.cfd-online.com/Forums/openfoam-post-processing/176437-simplefoam-pressure.html)

igor.leo93 August 18, 2016 09:40

simpleFoam - pressure
 
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

mdgowhar August 19, 2016 01:31

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?

igor.leo93 August 19, 2016 08:34

s
 
Quote:

Originally Posted by mdgowhar (Post 614639)
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 (Post 614639)
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

mdgowhar August 20, 2016 06:57

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

igor.leo93 August 20, 2016 09:19

Velocity driven flow x Pressure driven flow
 
Quote:

Originally Posted by mdgowhar (Post 614754)

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.

mdgowhar August 24, 2016 06:12

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.


All times are GMT -4. The time now is 05:33.