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

Hydrostatic pressure issue

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 3, 2013, 18:05
Unhappy Hydrostatic pressure issue
  #1
New Member
 
Join Date: Nov 2011
Posts: 17
Rep Power: 5
Gimlas is on a distinguished road
I am totally confused with the hydrostatic pressure calculations in openfoam. I've prepared a simulation of air flow through a vertical pipe (buoyantBoussinesqSimpleFoam). I've used following BC for pressures:

p
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.2.0                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     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
    {
        type            calculated;
        value           $internalField;
    }
    Inlet
    {
        type            calculated;
        value           $internalField;
    }
    Outlet
    {
        type            fixedMean;
        meanValue       0;
    value        uniform 0;
       
    }
}

// ************************************************************************* //
p_rgh
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.2.0                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform 0;

boundaryField
{
    Wall
    {
        type            fixedFluxPressure;
        rho             rhok;
        value           $internalField;
    }

    Inlet
    {
        type            fixedFluxPressure;
        rho             rhok;
        value           $internalField;
    }
    Outlet
    {
        type            fixedMean;
        meanValue       0;
    value        uniform 0;
    }
}

// ************************************************************************* //
p_rgh profile is identical to the results obtained from Ansys Fluent (please see attached image). However the p profile is wrong. Althouth uniform 0 value was set at the Outlet, the results show high undepressure. I've made my own calculations using calculator filter in paraView (see p_calculated image). The profile was obtained as follows:
Code:
p = p_rgh+(H-coordsY)*9.81*1.225
where H is the pipe height, 9.81 is gravity and 1.225 is air density
As you can see this profile is correct.

My qestion is: why the original p calculations went so wrong? Is there a mistake in the BC?

I've also tried to run calculations without p file in 0 folder. But in next iterations such file was created with incorect pressure field.

Please, help me
Attached Images
File Type: jpg p_rgh_OF.jpg (20.2 KB, 12 views)
File Type: jpg p_OF.jpg (21.2 KB, 13 views)
File Type: jpg p_calculated.jpg (18.6 KB, 14 views)
Gimlas is offline   Reply With Quote

Old   July 4, 2013, 07:30
Default
  #2
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Delft, Netherlands
Posts: 163
Rep Power: 8
tomf is on a distinguished road
Send a message via MSN to tomf Send a message via Skype™ to tomf
Dear Gimlas,

buoyantBoussinesqSimpleFoam is an incompressible solver, meaning that it solves for kinematic pressure, in this case corrected for hydrostatic pressure. This means that the actual pressure value is irrelevant, it is only the gradient that needs to be correct. If you compare your calculated p with the p from buoyantBoussinesqSimpleFoam you see the same gradient, except the calculated one has a density factor for the hydrostatic part, which should not be there, since p_rgh is in fact the kinematic pressure (p_rgh/rho). So you can subtract any value from p in paraview to make sure it is zero at the outlet, or equivalently move you outlet to z=0 and rerun the simulation. The gradient should not be different.

Regards,
Tom
tomf is offline   Reply With Quote

Old   July 4, 2013, 08:39
Default
  #3
New Member
 
Join Date: Nov 2011
Posts: 17
Rep Power: 5
Gimlas is on a distinguished road
Dear tomf,

Of course you're right with the density in the calculated pressure. All calculations are based on the kinematic pressure (m^2/s^2) therefore the correct equation is p_calc = p_rgh+(H-coordsY)*g.

But I'm not sure if I understand you correctly: in order to receive both p and p_rgh pressures equal to 0 I would have to move the whole domain towards -Y axis (vertical one) in order to place the outlet patch at 0 m? If yes, is there an another way to achieve that changing BCs or solution settings? I've tried to change the pressure reference point but it didn't work.
Gimlas is offline   Reply With Quote

Old   July 4, 2013, 08:53
Default
  #4
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Delft, Netherlands
Posts: 163
Rep Power: 8
tomf is on a distinguished road
Send a message via MSN to tomf Send a message via Skype™ to tomf
Well you can just add any pressure value to the p or p_rgh value, it does not matter for the solution of your problem (the flow or temperature will not change). This is because only the pressure gradient is important, not it's actual value.

In this case the difference between the pressure p and p_rgh at the outlet is only a consequence of the y-coordinate of your outlet, following your formula. The reference point for the pressure is only used in case of a closed domain (no inlet or outlet), so it makes sense that nothing changed there.

Hope this clarifies my point.
Tom
tomf is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Recorded Pressure Issue Benjikos FLUENT 0 November 30, 2010 11:06
single phase hydrostatic pressure problem erkan FLUENT 1 March 1, 2010 13:29
Does star cd takes reference pressure? monica CD-adapco 1 April 19, 2007 12:26
Gas pressure question Dan Moskal Main CFD Forum 0 October 24, 2002 23:02
Hydrostatic pressure in 2-phase flow modeling (CFX4.2) HB &DS CFX 0 January 9, 2000 14:19


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