CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   uniformValue table meaning in propeller tutorial (https://www.cfd-online.com/Forums/openfoam-solving/149841-uniformvalue-table-meaning-propeller-tutorial.html)

donQi March 9, 2015 20:20

uniformValue table meaning in propeller tutorial
 
Dear all,

is my following interpretation correct?

Code:

    inlet
        {
                type uniformFixedValue;
                uniformValue table
                (
                        (0 (0 0 0))
                        (0.01 (0 -15 0))
                        (100 (0 -15 0))
                );
                value $internalField;
        }

[extract from openfoam231/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/0.org/U]

the meaning is :
- from time 0 to 0.01s the velocity varies linearly from 0 to -15m/s
- from time 0.01 to 100s the velocity stays constant at -15m/s

right?

thank you in advance
donQi

Svensen March 10, 2015 07:20

Yes, it's correct for the velocity component (Y). X and Z stays as zeros

Sakun October 29, 2022 08:32

Hi,


i know this a old thread but can i apply this "table" condition for compressible cases ? specially for pressure ?


thank you,

Yann October 31, 2022 03:32

Hi,

Sure you can, as long as you adapt the syntax (scalar instead of vector).
There are several BC which can be used with tables, depending on the OpenFOAM version you are using.

Regards
Yann

Sakun October 31, 2022 05:26

Quote:

Originally Posted by Yann (Post 838509)
Hi,

Sure you can, as long as you adapt the syntax (scalar instead of vector).
There are several BC which can be used with tables, depending on the OpenFOAM version you are using.

Regards
Yann


Hi Yann,


Thank you very much for your kind reply,


I am using openFOAM v2112, This is my "p" file in my simulation so i need to give pressure gradually for the simulation, Since i am having unstable pressure condition:confused:


I am really grateful if you can help me on this :(



Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  v2112                                |
|  \\  /    A nd          | Website:  www.openfoam.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      volScalarField;
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


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

internalField  uniform 97251;

boundaryField
{
    INLET
    {
        //type            freestreamPressure;
        //freestreamValue uniform $pOut;

        type            totalPressure;
        p0                uniform 115775;
        value          uniform 115775;

        // Optional entries
          U              U;
        phi            phi;
        rho            rho;
   
        //type            fixedValue;
        //value          uniform 84636.34;
    }

    OUTLET
    {
        //type            freestreamPressure;
        //freestreamValue $internalField;   
           
        type            fixedValue;
        value          uniform 97251;

       
        //type            fixedFluxPressure;
   
    }

    CASCADE
    {
        type            zeroGradient;
    }

    "(TOP|BOTTOM)"
    {
        type            cyclicAMI;
    }

    frontAndBackPlanes
    {
        type            empty;
    }
}


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


Yann October 31, 2022 06:00

Something like this should do the job, up to you to adjust it to your needs:

Code:

OUTLET
{
        type        uniformFixedValue;
        uniformValue        table
        (
                (0 0)
                (0.01 97251)
                (100 97251)
        );
        value        $internalField;
}

If you intend to ramp the inlet pressure, there is also a boundary condition named uniformTotalPressure to be able to define a table for p0.

Cheers,
Yann

Sakun October 31, 2022 07:02

1 Attachment(s)
Quote:

Originally Posted by Yann (Post 838522)
Something like this should do the job, up to you to adjust it to your needs:

Code:

OUTLET
{
    type    uniformFixedValue;
    uniformValue    table
    (
        (0 0)
        (0.01 97251)
        (100 97251)
    );
    value    $internalField;
}

If you intend to ramp the inlet pressure, there is also a boundary condition named uniformTotalPressure to be able to define a table for p0.

Cheers,
Yann


so adjusted total pressure to uniform total pressure bc as below,
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  v2112                                |
|  \\  /    A nd          | Website:  www.openfoam.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      volScalarField;
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


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

internalField  uniform 97251;

boundaryField
{
    INLET
    {
        //type            freestreamPressure;
        //freestreamValue uniform $pOut;

    /*    type            totalPressure;
        p0                uniform 115775;
        value          uniform 115775;

        // Optional entries
          U              U;
        phi            phi;
        rho            rho;
    */
        //type            fixedValue;
        //value          uniform 84636.34;

        type            uniformTotalPressure;
        p0              table
        (
            (0 10000)
            (100 20000)
            (500 30000)
            (1000 40000)
            (2000 50000)
            (3000 60000)
            (4000 70000)
            (5000 80000)
            (6000 90000)
            (7000 100000)
            (8000 110000)
            (9000 115775)
        );

    }

    OUTLET
    {
        //type            freestreamPressure;
        //freestreamValue $internalField;   
           
        type            fixedValue;
        value          uniform 97251;

       
        //type            fixedFluxPressure;
   
    }

    CASCADE
    {
        type            zeroGradient;
    }

    "(TOP|BOTTOM)"
    {
        type            cyclicAMI;
    }

    frontAndBackPlanes
    {
        type            empty;
    }
}


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


when i running the simulation i realize pressure is already too high in paraview,

when its meant to be in a range of 70000-80000 pa between 3000- to 4000 iterations according to the table.


does this mean inserting the table for total pressure is not working or do i have to do the table values for the fixedvalues as well. :confused:

Yann October 31, 2022 08:11

Are you sure the pressure is too high?
It is not very clear on your screenshot but the inlet pressure seems to be close to what you are expecting. To make sure you can load only your inlet patch in paraview and check the pressure values.

If your concern is related to what is going on inside the domain, then this is another topic (your boundary condition only defines values on the boundary).

Does it make sens to start your simulation with a total pressure of 10000 Pa at the inlet while you already have a fixed static pressure of 97251 Pa at the outlet?

A better approach would probably be to start with a pressure drop close to zero and increase inlet pressure up to the pressure drop you aim for.

Regards,
Yann

Sakun October 31, 2022 08:46

1 Attachment(s)
Quote:

Originally Posted by Yann (Post 838529)
Are you sure the pressure is too high?
It is not very clear on your screenshot but the inlet pressure seems to be close to what you are expecting. To make sure you can load only your inlet patch in paraview and check the pressure values.

If your concern is related to what is going on inside the domain, then this is another topic (your boundary condition only defines values on the boundary).

Does it make sens to start your simulation with a total pressure of 10000 Pa at the inlet while you already have a fixed static pressure of 97251 Pa at the outlet?

A better approach would probably be to start with a pressure drop close to zero and increase inlet pressure up to the pressure drop you aim for.

Regards,
Yann


apologies for the low quality picture.

you are correct actually, it seems inlet p is in the range of 100000 and 120000.

i attached a picture of inlet pressure bc contour.



i have posted (1 & 2 below) my problem in the forum months ago but did not get a reply since :(


1) https://www.cfd-online.com/Forums/op...es-p-file.html


2) https://www.cfd-online.com/Forums/op...sor-blade.html




Quote:

Does it make sens to start your simulation with a total pressure of 10000 Pa at the inlet while you already have a fixed static pressure of 97251 Pa at the outlet?

A better approach would probably be to start with a pressure drop close to zero and increase inlet pressure up to the pressure drop you aim for.
as for this statement , are you suggesting that i should start the simulation as below, as an example,


Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  v2112                                |
|  \\  /    A nd          | Website:  www.openfoam.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      volScalarField;
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


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

internalField  uniform 97251;

boundaryField
{
    INLET
    {
        //type            freestreamPressure;
        //freestreamValue uniform $pOut;

    /*    type            totalPressure;
        p0                uniform 115775;
        value          uniform 115775;

        // Optional entries
          U              U;
        phi            phi;
        rho            rho;
    */
        //type            fixedValue;
        //value          uniform 84636.34;

        type            uniformTotalPressure;
        p0              table
        (
            (0 50)
            (100 100)
            (200 500)
            (300 1000)
            (500 2000)
            (1000 4000)
            (2000 6000)
            (4000 8000)
            (6000 10000)
            (7000 20000)
            (8000 30000)
            (9000 40000)
            (10000 50000)
            (11000 60000)
            (12000 70000)
            (13000 80000)
            (14000 90000)
            (15000 100000)
            (16000 110000)
            (18000 115775)
        );

    }

    OUTLET
    {
        //type            freestreamPressure;
        //freestreamValue $internalField;   
           
        type            fixedValue;
        value          uniform 97251;

       
        //type            fixedFluxPressure;
   
    }

    CASCADE
    {
        type            zeroGradient;
    }

    "(TOP|BOTTOM)"
    {
        type            cyclicAMI;
    }

    frontAndBackPlanes
    {
        type            empty;
    }
}


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



Again i am really thankful for you for supporting me in this case ,casue you are the only person who replied for this issue.

Yann November 2, 2022 03:46

Hi Sakun,

On you screenshot, the pressure on the inlet patch is 115775 Pa, which is the total pressure value your assigned in your boundary condition (p0=115775 Pa is the last line of your table).

Do you get any flow inside your domain? What velocity do you get at inlet?

Regards,
Yann

Sakun November 2, 2022 17:55

1 Attachment(s)
Quote:

Originally Posted by Yann (Post 838632)
Hi Sakun,

On you screenshot, the pressure on the inlet patch is 115775 Pa, which is the total pressure value your assigned in your boundary condition (p0=115775 Pa is the last line of your table).

Do you get any flow inside your domain? What velocity do you get at inlet?

Regards,
Yann


Understood, really appriciate for the guidence.


p File,


Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  v2112                                |
|  \\  /    A nd          | Website:  www.openfoam.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      volScalarField;
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


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

internalField  uniform 97251;

boundaryField
{
    INLET
    {
        //type            freestreamPressure;
        //freestreamValue uniform $pOut;

        type            totalPressure;
        p0                uniform 115775;
        value          uniform 115775;
   
        //type            fixedValue;
        //value          uniform 84636.34;
    }

    OUTLET
    {
        //type            freestreamPressure;
        //freestreamValue $internalField;   
           
        type            fixedValue;
        value          uniform 97251;
    }

    CASCADE
    {
        type            zeroGradient;
    }

    "(TOP|BOTTOM)"
    {
        type            cyclicAMI;
    }

    frontAndBackPlanes
    {
        type            empty;
    }
}


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


U File,


Code:

/*--------------------------------*- C++ -*----------------------------------* \
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  v2112                                |
|  \\  /    A nd          | Website:  www.openfoam.com                      |
|    \\/    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
{
    INLET
    {
        //type            pressureInletOutletVelocity;
        //value          uniform $Uinlet;

        //type            freestreamVelocity;
        //freestreamValue uniform $Uinlet;
        //value          uniform $Uinlet;
   
        //type            fixedValue;
        //value          uniform (232.43 20.34 0);
       
        type pressureDirectedInletVelocity;
        inletDirection uniform (0.631623456 -0.775275312 0); //geometric inlet angle is 50.83
        value uniform (0 0 0);
    }

    OUTLET
    {
        //type          inletOutlet;
        //inletValue    uniform (0 0 0);
        //value        $internalField;

        //type            zeroGradient;
       
        type            pressureInletOutletVelocity;
        value          $internalField;
    }

    CASCADE
    {
        type            noSlip;
    }
   
    "(TOP|BOTTOM)"
    {
        type            cyclicAMI;
    }

    frontAndBackPlanes
    {
        type            empty;
    }

   
}


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


I am running the simulation using only pressure values. (tot_pressure=115775 and static_pressure=97251)


Even though paper has mentioned(attached picture) that, there is a 0.7 mach speed at the inlet, i did not apply to the U file because i do not have the speed of sound for that particular mach number.



Thank you,


Regards,
Sakun

Yann November 3, 2022 03:35

Hi,

Sure you cannot impose both pressure and velocity values at the inlet. What I meant was: have you checked the velocity computed at the inlet and what values do you get there?

Yann

Sakun November 3, 2022 07:54

2 Attachment(s)
Quote:

Originally Posted by Yann (Post 838719)
Hi,

Sure you cannot impose both pressure and velocity values at the inlet. What I meant was: have you checked the velocity computed at the inlet and what values do you get there?

Yann

Hello Yann,

I attached a picture of INLET before the divergence and velocity was 3.6 m/s.

and the other picture was the velocity at the INLET when i continue the simulation even after the divergence, which has a velocity of 160 m/s.

Thank you,

Best regards,


All times are GMT -4. The time now is 23:59.