CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   2D airfoil simulation pressure not getting lower than 0.1 (https://www.cfd-online.com/Forums/openfoam/217713-2d-airfoil-simulation-pressure-not-getting-lower-than-0-1-a.html)

losiola May 22, 2019 05:28

2D airfoil simulation pressure not getting lower than 0.1
 
1 Attachment(s)
Hello Foamers ,
I am making a 2D airfoil simualtion for an airfoil using both simpleFoam (steadyState) and pimpleFoam (transient) i ve generated my mesh uding Gambit than converted it to Openfoam .


I want to calculate the Cd Cl and Cm aerodynamic Coefficient and i am using the K-Omega SST turbulence Model with wall functions (y+>30)


once i run the simualtion for different angles of attack ( alpha > 8 ) i get Cd Cl that are far from the experimental data


so i visualised the residuals in real time and i vve noticed that the residuals for pressure and velovity and are not getting anyLower than 0.1and 0.001 (like in the picture attached ).


and these are the files for my case in the system directory :


controlDict





Code:

application    pimpleFoam;

startFrom      startTime;

startTime      0;

stopAt          endTime;

endTime        5;

deltaT          1e-5;

writeControl    adjustableRunTime;

writeInterval  1e-2;

purgeWrite      0;

writeFormat    binary;

writePrecision  10;

writeCompression off;

timeFormat      general;

timePrecision  6;

runTimeModifiable true;

adjustTimeStep  yes;

maxCo          0.9;

functions
{
#includeFunc residuals
 forces
    {
        type                forces;
        libs                ("libforces.so");
        writeControl        timeStep;
        writeInterval      10;
        patches            (wing);
        rho                rhoInf;
        log                true;
        rhoInf              1.2047;
        CofR                (0 0 0);
    }
forceCoeffs1
{
    // Mandatory entries
    type            forceCoeffs;
    libs            ("libforces.so");
    patches        (wing);


    // Optional entries

    // Field names
    p              p;
    U              U;
    rho            rhoInf;
    rhoInf        1.2047;
  // rhoInf            1.204;
    // Reference pressure [Pa]
    pRef            0;

    // Include porosity effects?
    porosity        no;

    // Store and write volume field representations of forces and moments
    writeFields    yes;

    // Centre of rotation for moment calculations
    CofR            (0 0 0);

    // Lift direction
    liftDir        (0 1 0);

    // Drag direction
    dragDir        (1 0 0);

    // Pitch axis
    pitchAxis      (0 0 -1);

    // Freestream velocity magnitude [m/s]
    magUInf        10.578;

    // Reference length [m]
    lRef            1;

    // Reference area [m2]
    Aref            1;

    // Spatial data binning
    // - extents given by the bounds of the input geometry

}
}

fvShemes

Code:

ddtSchemes
{
    default Euler;
}

gradSchemes
{
    default        Gauss linear;
    grad(p)        Gauss linear;
    grad(U)        Gauss linear;
}

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

laplacianSchemes
{
    default        Gauss linear limited corrected 0.5;
}

interpolationSchemes
{
    default        linear;
}

snGradSchemes
{
    default        corrected;
}

wallDist
{
    method meshWave;
}

fvSolution

Code:

solvers
{
    "pcorr.*"
    {
        solver          GAMG;
        tolerance        0.02;
        relTol          0;
        smoother        GaussSeidel;
    }

    p
    {
        $pcorr;
        tolerance        1e-7;
        relTol          0.01;
    }

    pFinal
    {
        $p;
        tolerance        1e-7;
        relTol          0;
    }

    "(U|k|omega)"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance      1e-06;
        relTol          0.1;
    }

    "(U|k|omega)Final"
    {
        $U;
        tolerance      1e-06;
        relTol          0;
    }


}

PIMPLE
{
  // correctPhi          yes;
    nOuterCorrectors    2;
    nCorrectors        2;
    nNonOrthogonalCorrectors 2;
}

relaxationFactors
{
    fields
    {
        p              0.3;
    }
    equations
    {
        "(U|k|omega)"  0.7;
        "(U|k|omega)Final" 1.0;
    }
}

cache
{
    grad(U);
}


I ve tried to increse the number of iterations of PIMPLE by setting nOuterCorrectors to 100 , and in the log display i can see that there is an improvement of the pressure residuals whith each iteration but after T= 0.09 s i ve noticed that in the final iteration the initial residuals jumps back up as you can see and the residuals continue to be the same for the rest of the simualtion (t =1.4 sec)



Code:

PIMPLE: Iteration 98
smoothSolver:  Solving for Ux, Initial residual = 1.616474724e-11, Final residual = 1.616474724e-11, No Iterations 0
smoothSolver:  Solving for Uy, Initial residual = 1.960368055e-12, Final residual = 1.960368055e-12, No Iterations 0
GAMG:  Solving for p, Initial residual = 1.657865185e-05, Final residual = 3.719486792e-07, No Iterations 2
time step continuity errors : sum local = 4.844632515e-14, global = -9.071970864e-17, cumulative = -1.122173492e-10
GAMG:  Solving for p, Initial residual = 1.642056378e-05, Final residual = 3.701244997e-07, No Iterations 2
time step continuity errors : sum local = 4.820884777e-14, global = -8.295166997e-17, cumulative = -1.122174321e-10
PIMPLE: Iteration 99
smoothSolver:  Solving for Ux, Initial residual = 1.577131026e-11, Final residual = 1.577131026e-11, No Iterations 0
smoothSolver:  Solving for Uy, Initial residual = 1.910454271e-12, Final residual = 1.910454271e-12, No Iterations 0
GAMG:  Solving for p, Initial residual = 1.631649698e-05, Final residual = 3.667338769e-07, No Iterations 2
time step continuity errors : sum local = 4.776725338e-14, global = -8.843266574e-17, cumulative = -1.122175206e-10
GAMG:  Solving for p, Initial residual = 1.616322336e-05, Final residual = 3.649894645e-07, No Iterations 2
time step continuity errors : sum local = 4.754015883e-14, global = -8.080533709e-17, cumulative = -1.122176014e-10
PIMPLE: Iteration 100
smoothSolver:  Solving for Ux, Initial residual = 2.21101886e-11, Final residual = 2.21101886e-11, No Iterations 0
smoothSolver:  Solving for Uy, Initial residual = 2.667586351e-12, Final residual = 2.667586351e-12, No Iterations 0
GAMG:  Solving for p, Initial residual = 0.3573363803, Final residual = 0.002989077632, No Iterations 4
time step continuity errors : sum local = 4.237840817e-10, global = 6.188044041e-13, cumulative = -1.11598797e-10
GAMG:  Solving for p, Initial residual = 0.08131779127, Final residual = 7.551108567e-07, No Iterations 22
time step continuity errors : sum local = 7.381833497e-14, global = -8.421218529e-16, cumulative = -1.115996391e-10
smoothSolver:  Solving for omega, Initial residual = 1.444649303e-06, Final residual = 8.852480069e-08, No Iterations 1
smoothSolver:  Solving for k, Initial residual = 2.061374964e-06, Final residual = 1.15509241e-07, No Iterations 1
ExecutionTime = 639.93 s  ClockTime = 640 s

forceCoeffs forceCoeffs1 write:
    Cm    = -0.08949366665
    Cd    = 0.173624454
    Cl    = 1.367788881
    Cl(f) = 0.5944007738
    Cl(r) = 0.7733881071

Courant Number mean: 0.006269592047 max: 0.8947602155
deltaT = 0.0001149425287
Time = 0.091954






Do you hav nay idea about why is the pressure residuals not getting any lower residual values or do you have any ideas about how can i fixe the problem ?!!










thank you

blackpingu May 30, 2019 05:53

If you want lower residuals, you can change the tolerance in the fvsolution file.
However I dont know if you need lower, when your final residual for pressure is Final residual = 3.719486792e-07

losiola June 15, 2019 06:48

1 Attachment(s)
Quote:

Originally Posted by blackpingu (Post 735097)
If you want lower residuals, you can change the tolerance in the fvsolution file.
However I dont know if you need lower, when your final residual for pressure is Final residual = 3.719486792e-07




Hello ,
Thank you for the reply
well.. i have found that the plots i ve been getting are for the initial residuals for each time step, and are not the final residuals for each time step .


after plotting the final residuals for each time step i ve found that , indeed ,the residuals are lower than 1e-6 .


so my question is :since i am conducting transient simulation , How Can i know if my simulation is converging ?should the initial residuals converge too like in steady state(see pic ) ?Or it's okk that the initial residuals in each timestep are between (0.1-0.5) ? and how can i get the righ plot for transient simualtion convergence ?!!


Many Thanks

misospider August 2, 2019 03:18

As long as other parameters are ok, p residual value of 0.1-0.5 are ok, it is quite high though.

Because it is transient, you need to catch not a specific time, but to catch a range or a period.

If Cd or Cl is periodic, you may extract 1 cycle to plot your result.

And kwSST model phenomena in 2D airfoil of high AoA is well-known, kwSST can predict drag well but can not in lift because it over-estimates vortext generation at trail edge.

Simply say, stall will occur at much lower angle in simulation.

So it will give you much lower lift than experimental data at high AoA.


All times are GMT -4. The time now is 08:57.