CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   pressure and velocity in OpenFoam is smaller than Fluent (https://www.cfd-online.com/Forums/openfoam/123658-pressure-velocity-openfoam-smaller-than-fluent.html)

mechy September 18, 2013 05:32

how I can increase the accuracy of pressure ?
 
Hi all
I have simulated flow around a cylinder by OF and FLUENT
In both software, I use a high quality and fine structure mesh which lead to y+<5 over walls and use Kw-sst model

also the setting for OF and FLUENT is as follow

FLUENT BCs:
inlet ========> velocity inlet U=7m/sec k=.2 omega=170
outlet=======> pressure outlet
FLUENT settigs
solver =============> PISO
residual=1e-5


In OF I have used pimpleFoam and setting are as follow

any help will be appreciated


Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM Extend Project: Open source CFD        |
|  \\    /  O peration    | Version:  1.6-ext                              |
|  \\  /    A nd          | Web:      www.extend-project.de                |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      volScalarField;
    location    "0";
    object      k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField  uniform 0.2;

boundaryField
{
    wallup
    {
        type            kLowReWallFunction;
        value          uniform .2;
    }

    outlet
    {
        type            inletOutlet;
        inletValue      uniform .2;
        value          uniform .2;
    }
    inlet
    {
        type            turbulentIntensityKineticEnergyInlet;
        intensity      0.02;
        value          uniform .2;
    }
    circle
    {
        type            kLowReWallFunction;
        value          uniform .2;
    }
    frontAndBackPlanes
    {
        type            empty;
    }
}


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

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM Extend Project: Open source CFD        |
|  \\    /  O peration    | Version:  1.6-ext                              |
|  \\  /    A nd          | Web:      www.extend-project.de                |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      volVectorField;
    location    "0";
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField  uniform ( 0 0 0 );

boundaryField
{

    wallup
    {
        type            fixedValue;
        value          uniform ( 0 0 0 );
    }

    circle
    {
        type            fixedValue;
        value          uniform ( 0 0 0 );
    }

    inlet
    {
        type            fixedValue;
        value          uniform ( 7. 0 0 );
    }
    outlet
    {
        type            inletOutlet;
        inletValue      uniform ( 0 0 0 );
        value          uniform ( 0 0 0 );
    }
    frontAndBackPlanes
    {
        type            empty;
    }
}


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

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM Extend Project: Open source CFD        |
|  \\    /  O peration    | Version:  1.6-ext                              |
|  \\  /    A nd          | Web:      www.extend-project.de                |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      volScalarField;
    location    "0";
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField  uniform 0;

boundaryField
{

    wallup
    {
        type            zeroGradient;
    }
 
    circle
    {
        type            zeroGradient;
    }

    inlet
    {
        type            zeroGradient;
    }
    outlet
    {
        type            fixedValue;
        value          uniform 0;
    }
    frontAndBackPlanes
    {
        type            empty;
    }
}


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

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM Extend Project: Open source CFD        |
|  \\    /  O peration    | Version:  1.6-ext                              |
|  \\  /    A nd          | Web:      www.extend-project.de                |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      volScalarField;
    location    "0";
    object      omega;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField  uniform 170;

boundaryField
{
    wallup
    {
        type            omegaWallFunction;
        value          uniform 170;
    }
    wallp
    {
        type            omegaWallFunction;
        value          uniform 170;
    }
    outlet
    {
        type            inletOutlet;
        inletValue      uniform 170;
        value          uniform 170;
    }
    inlet
    {
        type            turbulentMixingLengthFrequencyInlet;
        mixingLength    0.005;
        phi            phi;
        k              k;
        value          uniform 170;
    }
    plate
    {
        type            omegaWallFunction;
        value          uniform 170;
    }
    circle
    {
        type            omegaWallFunction;
        value          uniform 170;
    }
    frontAndBackPlanes
    {
        type            empty;
    }
}


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

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM Extend Project: Open source CFD        |
|  \\    /  O peration    | Version:  1.6-ext                              |
|  \\  /    A nd          | Web:      www.extend-project.de                |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      volScalarField;
    location    "0";
    object      nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField  uniform 0;

boundaryField
{
    wallup
    {
        type            nutUSpaldingWallFunction;
        value          uniform 0;
    }
    wallp
    {
        type            nutUSpaldingWallFunction;
        value          uniform 0;
    }
    outlet
    {
        type            calculated;
        value          uniform 0;
    }
    inlet
    {
        type            calculated;
        value          uniform 0;
    }
    plate
    {
        type            nutUSpaldingWallFunction;
        value          uniform 0;
    }
    circle
    {
        type            nutUSpaldingWallFunction;
        value          uniform 0;
    }
    frontAndBackPlanes
    {
        type            empty;
    }
}


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


andre.weiner September 18, 2013 08:56

Hello!

I don't have OF 1.6-ext installed, so i it's difficult to know what the bc's for k, omega and nut do.
In your case (simple geometry) i would just set the following settings :
k - zeroGradient
omega - an automatic wallfunction like here
nut - 0 or calculated

Also note that the implementation of k-omega-sst may not be the same as there are various types of source terms (for example for near-wall treatment).

How do you control the residuals (fvSolution file)?

Hope i could help!

Best regards

mechy September 18, 2013 10:11

Hi
thanks for reply
I use the OF 2.2 not 1.6-ext (only the header have 1.6)
also my fvScheme an fvSolution are :


Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.3                                  |
|  \\  /    A nd          | Web:      http://www.openfoam.org              |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version        2.0;
    format          ascii;
    class          dictionary;
    object          fvSolution;
}

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

solvers
{
    p
    {
        solver          GAMG;
        tolerance        1e-5;
        relTol          .0;
        smoother        GaussSeidel;
        nPreSweeps      1;
        nPostSweeps      2;
        cacheAgglomeration true;
        directSolveCoarsest true;
        agglomerator    faceAreaPair;
        nCellsInCoarsestLevel 20;
        mergeLevels      1;
        minIter          1;
    }
    pFinal
    {
        solver          GAMG;
        tolerance        1e-8;
        relTol          0;
        smoother        GaussSeidel;
        nPreSweeps      1;
        nPostSweeps      2;
        cacheAgglomeration true;
        agglomerator    faceAreaPair;
        nCellsInCoarsestLevel 20;
        mergeLevels      1;
        minIter          1;
    }

    "(U|k|omega)"
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance        1e-5;
        relTol          0;
        nSweeps          1;   
        minIter          1;
    }
    "(UFinal|kFinal|omegaFinal)"
    {

        solver          smoothSolver;
        smoother        GaussSeidel;
        tolerance        1e-6;
        relTol          0.0;
        nSweeps          1; 
        minIter          1;
    }
}

PIMPLE
{
    nOuterCorrectors    10;
    nCorrectors        2;
    nNonOrthogonalCorrectors 3;

    pRefCell            0;
    pRefValue          0;
//    momentumPredictor yes;
    ddtPhiCorr no;
    correctPhi no;

}


relaxationFactors
{
    fields
    {
        p              0.3;
    }
    equations
    {
        U              0.7;
        k              0.7;
        omega          0.7;
    }
}
cache
{
    grad(U);
}

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

Code:


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

ddtSchemes
{
    default Euler;
}

gradSchemes
{
    default          Gauss linear ;
}

divSchemes
{
    default        none;
    div(phi,U)      Gauss limitedLinearV 1;
    div(phi,k)      Gauss limitedLinear 1;
    div(phi,omega)  Gauss limitedLinear 1;
    div((nuEff*dev(T(grad(U))))) Gauss linear;
    div((nuEff*dev(grad(U).T())))  Gauss linear;
}

laplacianSchemes
{
    default        Gauss linear corrected;
}

interpolationSchemes
{
    default        linear;
}

snGradSchemes
{
    default        corrected;
}

fluxRequired
{
    default        no;
    p;
}


andre.weiner September 18, 2013 11:37

Have you tried to run the simulation in pure PISO mode?
It shouldn't make any difference but i think it's worth a try.

How much is the difference between the results?
Do the fields look similar in both simulations?

mechy September 18, 2013 16:19

the flow field in both of them, are similar
but the value of pressure has a about 10% difference
the min p in OF about 10 pa greater than FLUENT
for example if p in OF = -50 in FLUent minp=-60


All times are GMT -4. The time now is 17:26.