CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Pressure Inlet Velocity (https://www.cfd-online.com/Forums/openfoam/65577-pressure-inlet-velocity.html)

 prapanj June 19, 2009 00:18

Pressure Inlet Velocity

Hi,

I am trying to solve flow through a 'S' shaped pipe. Both the bends in the pipe are very close to the inlet and the outlet. The inner wall of the pipe has a lot of projections. I want to see what average flow velocity I would be getting after setting a pressure difference between inlet and outlet.
I had set a pressure value 15 Pa at the inlet and 0 Pa at the outlet. I used pressureInletVelocity BC at inlet and inletOutlet BC for outlet for the velocity. And for pressure, I used fixedValue BC at the inlet and outlet. After about 400 iterations ( steady state incompressible flow) I checked the field and found very high value for pressure within the field ( of the order of 10^30 ) . Could someone please point me the mistakes with my boundary condition or suggest me a solution?

Thanks,
Prapanj.

 Julian K. June 19, 2009 04:10

Hi,

I have experienced a similar effect. I'm simulating a convergent-divergent supersonic nozzle. I also set the pressure difference of 300mbar between inlet and outlet.

BCs for inlet: - pressure: 'totalPressure
- velocity: 'pressureInletVelocity'
BCs for outlet: - pressure: 'static pressure'

I'm using the sonicFoam solver.

What happens is that at some point during the iteration process the velocity near the outlet increases drastically, furthermore, also at the outlet, value for pressure are either very high or negative.

I suppose this effect is evoked by the outlet boundary condition.

 prapanj June 19, 2009 05:23

Julian,

Could you explain why you used totalPressure at Inlet? For viscous compressible flow, there will be a total pressure loss if there is a stationary shock in the CD nozzle. Have you used totalPressure at inlet before?

Prapanj.

 Julian K. June 19, 2009 05:41

Actually my task is to compare the results of the OpenFoam simuatlion of the CD nozzle with results we got from calculation with a different solvers. In these calculations there was a total pressure defined at the inlet., so I did the same in order to be as synchron as possible.

Nevertheless, I also used the 'fixedValue' BC-type for the pressure at inlet and outlet and got the same effect of instability.

I didn't use the 'totalPressure' BC in any of my other simulations.

 prapanj June 19, 2009 06:00

Hey,

When you say static pressure, do you mean fixedValue? If not, set a fixedValue for pressure at the outlet. Or, try this:

Use wave transmissive pressure . I hope you have the user guide for openfoam, which available for download (google for it). Page U-129, there is table. Look for pressureTransmissive, that lets you set a pInf for ambient pressure. You issue may be due to shock waves being reflected off the outlet. Have you tried visualizing your interim results?

Prapanj.

 Julian K. June 19, 2009 07:38

Yes, by static pressure I mean 'fixedValue' type of boundary condition for pressure - I hope my interpretation of 'fixedValue' for pressure is correct.
Thus, as mentioned, I already tried a 'fixedValue' BC for pressure at the outlet but came the same result -but thanks for the hint.

As you suggested, I looked at page U-129 for finding the definiton of the 'pressureTransmissive' BC. That sounds promising. However, when I was looking in the internet for a description on how to define 'pressureTransmissive' I found that this BC was substituted by the 'waveTransmissive' BC in OpenFOAM v.1.4: http://www.openfoamwiki.net/index.ph...dary_condition
Furthermore, I couldn't find 'pressureTransmissive' BC in the OF C++ Source Guide.

Anyway, I applied the 'waveTransmissive' BC to the outlet and it seems to work! However, the simulation is still running and I couldn't yet take a look at the results. But anyway, thank you very much prapanj :)! Here is my /0/p file:

Code:

```inlet     {     type    totalPressure;     p0        uniform 1.01325e+05;//:p_in     U        U;     phi      phi;     rho      none;     psi      none;     gamma        1.4;     value    uniform 1.01325e+05;     } outlet     {     type            waveTransmissive;     value          uniform 71325;    //important for correct I/O     field            p;                //the name of the field that we are working on     gamma      1.4;              //the ratio of specific heats     phi              phi;              //the name of the volumetric flux field (or if you use the mass flux phi, it will be divided by rho)     rho            rho;              //the name of the density field     psi            psi;              //the name of the field that is the deriv. of density with respect to pressure     lInf            1;            //a measure of how far away the far-field condition should be     fieldInf        71325;            //the far-field value to be applied to p     }```
While I was searching the internet I found the following BCs, which could also be adequate for my problem:
- waveTranmissive
(- pressureTransmissive)
- freestream
- frestreamPressure
- supersonicFreestream

Unfortunately, I wasn't able to find an appropriate description of the last three BCs, listed above. Do you know, what they do?

 prapanj June 19, 2009 07:48

Hey,

What version of OF do you use? Is it 1.4?

Well ther eis a later version 1.5 that is realease. And a even recent version 1.5.x released. However you will have to compile 1.5.x. The boundaries that are missing in your installation may be found in 1.5.x

Freestream as I understand is suitable for use in external compressible flow. Like, flow around aerofoil etc. And I haven't looked into the codes of those (Even if I look, I am not sure I can figure out).

Check the intermediate results and say if it works.

Prapanj. (Ps: are you from a German University? )

 Julian K. June 19, 2009 08:06

I'm using OF 1.5.

The interim results look okay; simulations are still running and stable. Thanks!. I hope they won't blow up again. At the beginning of next week I can tell if it worked out.

Yes, I'm a Bachelor student at the university of Duisburg-Essen, located in Duisburg, Germany.

 prapanj June 19, 2009 08:08

Np.

And do post if it worked . :)

 Julian K. June 22, 2009 05:40

Today, I looked at the results of my calculations. They are stable :)! The BC 'waveTransmissve' seems to stabilize the simulations. There is no drastic increase anymore in pressure or velocity. So far so good.

However, there is a different problem. For the simulation of my nozzle I need to have a pressure difference of 300mbar between the outlet and the inlet. At the inlet I have atmospheric pressure:
Code:

```inlet     {         type            totalPressure;     p0        uniform 1.01325e+05;//:p_in     U        U;     phi        phi;     rho        none;     psi        none;     gamma        1.4;     value        uniform 1.01325e+05;     }```
At the outlet I have 'atmospheric pressure' - 300mbar:
Code:

```outlet     {     type            waveTransmissive;           value          uniform 71325;    //important for correct I/O           field          p;                //the name of the field that we are working on           gamma          1.4;              //the ratio of specific heats           phi            phi;              //the name of the volumetric flux field (or if you use the mass flux phi, it will be divided by rho)           rho            rho;              //the name of the density field           psi            psi;              //the name of the field that is the deriv. of density with respect to pressure           lInf            1;            //a measure of how far away the far-field condition should be           fieldInf        71325;            //the far-field value to be applied to p     }```
Now, the problem is that after some time, the pressure at the outlet will tend towards a value of 120mbar, which is far too low. With this pressure the instationary effects which I want to observe in the nozzle will not occur. Instead, the flow through the nozzle becomes stationary.

So, what can I do to establish a pressure of ~700mbar at the outlet using the 'waveTransmissive' BC? Maybe I have to change the value for 'lInf'. What measure does this variable have, anyway? Is it in m or mm or dimensionless?

By the way, can I use the 'waveTransmissive' BC for the inlet, as well? I encountered some shock waves, which traveled towards the inlet and unfortunately were reflected.

 prapanj June 22, 2009 23:57

Hi Julian,

You have set 'rho' as none at the inlet. Can you change it to 'rho' as in " rho rho; " and try again. I don't know if this would help.

Prapanj.

 statesman June 23, 2009 11:15

Hey ive been following this discussion

I am trying to model barrell shocks in an axisymmetric model. Inlet air is M=1. The exit is a subsonic outlet.

I am using rhoSonicFoam [modified to read p , rho, T, U fields , so that the solver can accept derived BCs ] , Im using non-reflective BCs at the exit for rho, since for subsonic outlet , the eigenvalue correspding to rho is -ve. However i am not getting the inlet BCs correct .
I however am not getting the right combination of BC at inlet for p & rho.

I ll summarize the Bc i have tried :--

p
Inlet : totalPressure outlet : fixedValue [ static]

rho
inlet: fixedValue outlet : nonReflective.

U
inlet : 350 outlet : zeroGradient

T
Inlet : 250 outlet : zerogradient

kindly suggest me a better combination ....

 All times are GMT -4. The time now is 20:12.