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/)
-   -   pisoFOAM not converged (https://www.cfd-online.com/Forums/openfoam-solving/219705-pisofoam-not-converged.html)

Virtual-iCFD August 5, 2019 23:32

pisoFOAM not converged
 
Hi Foamers,

I attempt to solve transient laminar flow with pimplefoam.

During the simulation, the solver says not converged after 5 iterations (see below message).

I am wondering if something i set wrong (tolerance, relTol, etc..)

Below are my fvSolution and fvSchemes files.


HTML Code:

Courant Number mean: 0 max: 0
deltaT = 1e-06
Time = 1e-06

PIMPLE: iteration 1
GAMG:  Solving for p, Initial residual = 1, Final residual = 0.00596631, No Iterations 1
GAMG:  Solving for p, Initial residual = 0.00898104, Final residual = 7.7366e-05, No Iterations 11
time step continuity errors : sum local = 2.89319e-06, global = 2.036e-08, cumulative = 2.036e-08
GAMG:  Solving for p, Initial residual = 0.53187, Final residual = 0.00265644, No Iterations 2
GAMG:  Solving for p, Initial residual = 0.0064018, Final residual = 7.237e-07, No Iterations 40
time step continuity errors : sum local = 2.73227e-08, global = 1.78046e-09, cumulative = 2.21404e-08
PIMPLE: iteration 2
GAMG:  Solving for p, Initial residual = 0.539447, Final residual = 0.00538843, No Iterations 2
GAMG:  Solving for p, Initial residual = 0.00812699, Final residual = 6.43329e-05, No Iterations 13
time step continuity errors : sum local = 2.50622e-06, global = 1.0398e-07, cumulative = 1.2612e-07
GAMG:  Solving for p, Initial residual = 0.318756, Final residual = 0.00307184, No Iterations 2
GAMG:  Solving for p, Initial residual = 0.0055863, Final residual = 6.78875e-07, No Iterations 47
time step continuity errors : sum local = 2.63915e-08, global = -2.57425e-10, cumulative = 1.25863e-07
PIMPLE: iteration 3
GAMG:  Solving for p, Initial residual = 0.314438, Final residual = 0.00192229, No Iterations 3
GAMG:  Solving for p, Initial residual = 0.00504608, Final residual = 4.54241e-05, No Iterations 14
time step continuity errors : sum local = 1.73605e-06, global = 1.91983e-08, cumulative = 1.45061e-07
GAMG:  Solving for p, Initial residual = 0.197118, Final residual = 0.00105657, No Iterations 3
GAMG:  Solving for p, Initial residual = 0.00334511, Final residual = 8.51928e-07, No Iterations 53
time step continuity errors : sum local = 3.24481e-08, global = 2.8933e-09, cumulative = 1.47954e-07
PIMPLE: iteration 4
GAMG:  Solving for p, Initial residual = 0.192587, Final residual = 0.00101836, No Iterations 3
GAMG:  Solving for p, Initial residual = 0.00324218, Final residual = 2.77573e-05, No Iterations 13
time step continuity errors : sum local = 1.04059e-06, global = 3.65136e-08, cumulative = 1.84468e-07
GAMG:  Solving for p, Initial residual = 0.12529, Final residual = 0.000974064, No Iterations 2
GAMG:  Solving for p, Initial residual = 0.00237622, Final residual = 8.42289e-07, No Iterations 30
time step continuity errors : sum local = 3.14838e-08, global = 1.31643e-09, cumulative = 1.85784e-07
PIMPLE: iteration 5
GAMG:  Solving for p, Initial residual = 0.124905, Final residual = 0.000884491, No Iterations 2
GAMG:  Solving for p, Initial residual = 0.0020957, Final residual = 2.03358e-05, No Iterations 16
time step continuity errors : sum local = 8.2739e-07, global = 5.32205e-08, cumulative = 2.39005e-07
GAMG:  Solving for p, Initial residual = 0.00243198, Final residual = 1.79189e-05, No Iterations 13
GAMG:  Solving for p, Initial residual = 0.000253813, Final residual = 8.22938e-07, No Iterations 20
time step continuity errors : sum local = 3.32897e-08, global = 1.18679e-09, cumulative = 2.40192e-07
PIMPLE: not converged within 5 iterations


HTML Code:

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

solvers
{
    p
    {
        solver          GAMG;
        tolerance      1e-06;
        relTol          0.01;
        smoother        GaussSeidel;
        cacheAgglomeration true;
        nCellsInCoarsestLevel 10;
        agglomerator    faceAreaPair;
        mergeLevels    1;
    }

    pFinal
    {
        solver          GAMG;
        tolerance      1e-06;
        relTol          0;
        smoother        GaussSeidel;
        cacheAgglomeration true;
        nCellsInCoarsestLevel 10;
        agglomerator    faceAreaPair;
        mergeLevels    1;
    }

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

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

PIMPLE
{
    momentumPredictor no;
    nOuterCorrectors 5;
    nCorrectors    2;
    nNonOrthogonalCorrectors 1;
    pRefCell        0;
    pRefValue      0;
    residualControl
    {
        "(U)"
        {
                tolerance  1e-3;
                relTol      0;
        }
        p
        {
                tolerance  1e-3;
                relTol      0;
        }
    }
}

relaxationFactors
{
    fields
    {
            p                        0.3;
    }

    equations
    {
        "(U|k|epsilon)"          0.9;
        "(U|K|epsilon)Final"      1;
    }
}


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


HTML Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  5                                    |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "system";
    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,epsilon) Gauss limitedLinear 1;
    div(phi,R)      Gauss limitedLinear 1;
    div(R)          Gauss linear;
    div(phi,nuTilda) Gauss limitedLinear 1;
    div((nuEff*dev2(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
    default        Gauss linear corrected;
}

interpolationSchemes
{
    default        linear;
}

snGradSchemes
{
    default        corrected;
}


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


RobertHB August 6, 2019 05:23

Are you running Pimple or PisoFoam? You are providing different information. If you want pisoFoam, your fvSolution uses a PIMPLE subdictionary, which is not read by PisoFoam. You'll want a PISO sub-dict.


Next up, for some reason your solver is not solving for solving for fluid part. You do not have a timestep. How do you expect to solve a transient problem without a time step? What ever you did, try here.

Virtual-iCFD August 6, 2019 14:58

Sorry, my title is wrong. It should be pimpleFOAM.
Here is my controlDict with timestep

HTML Code:

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

application    pimpleFoam;

startFrom      startTime;

startTime      0;

stopAt          endTime;

endTime                0.00005;

deltaT                0.000005;

writeControl    adjustableRunTime;

writeInterval  0.00001;

purgeWrite      0;

writeFormat    ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision  6;

runTimeModifiable yes;

adjustTimeStep  yes;

maxCo          10;

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


Virtual-iCFD August 6, 2019 15:21

Here is my boundary condition. My intent is to apply inlet and outlet pressure BC.

HTML Code:

/*----------------------------------------------------------------------------------------------------*\
|                                                                                                      |
|
|                                                                                                      |
\*----------------------------------------------------------------------------------------------------*/



FoamFile
{
        version 2.0;
        format binary;
        class volScalarField;
        location "";
        object p;
}
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/


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

internalField uniform 0.;


boundaryField
{
        outlet
        {
                type            fixedValue;
                value          uniform 0;
        }

        inlet
        {
                type            fixedValue;
                value          uniform 865.470938;
        }

        post1
        {
                type zeroGradient;
        }

        post2
        {
                type zeroGradient;
        }

        post3
        {
                type zeroGradient;
        }

        post4
        {
                type zeroGradient;
        }

        post5
        {
                type zeroGradient;
        }

        post6
        {
                type zeroGradient;
        }

        wall1
        {
                type zeroGradient;
        }

        wall2
        {
                type zeroGradient;
        }


}


HTML Code:

FoamFile
{
        version 2.0;
        format binary;
        class volVectorField;
        location "";
        object U;
}
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/


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

internalField uniform ( 0. 0. 0. );


boundaryField
{
        outlet
        {
                type zeroGradient;
        }

        inlet
        {
                type zeroGradient;
        }

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

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

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

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

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

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

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

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


}


shereez234 August 6, 2019 17:57

What happens if you try to increase the relTol of pressure from 0.01 to 0.1? and relTol of U to 0.01 or 0.001? also put minIter in U to something like 5 or 10. Just shooting some guesses ;)

cryabroad August 11, 2019 09:25

It is telling you that in 5 iterations (the nOuterCorrectors entry you have in the fvSolutions file) the solution is not converged, simplest thing would be just increase this number, something between 5 ~ 50 is what I use frequently.

Note that sometimes this doesn't necessarily mean your solution is diverging. You set the relTol for both p and U to 1e-03, which means that their residuals have to drop three orders of magnitude. Sometimes this is not easy to achieve and if you don't reach 1e-03, it doesn't suggest that the solution is wrong. What you should do to make sure you have convergence is to 1. Check the residuals, normally for pressure it is every easy to have it drop two orders of magnitude; 2. Set up some probes in the flow field and check their pressure (velocity and so on), make sure they are not diverging.

peterhess August 11, 2019 09:44

Changing the velocity at the outlet from:

zeroGradient

to

inletOutlet

also if you dont have back flow stabilizes the simulation much!


All times are GMT -4. The time now is 22:35.