CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Convergence problem (

xxxx February 11, 2013 10:53

Convergence problem
1 Attachment(s)
Hello everybody,
I'm trying to run a case with simpleFoam. It's a stationary simulation with k-espilon turbulence model.
Initially it seems the simulation is converging but after some step suddenly the residuals show a strange behaviour and from this on the results have no phisical sense.
I attach the residuals vs iteration plot.
Is there anyone who can help me?
I tryied to make modification to the mesh, to the relaxation factor and to the fvScheme but I wasn't able to solve the problem.

immortality February 11, 2013 12:52

i have a problem like you.whats your case?do you have some region of high gradients?

danvica February 11, 2013 13:54

Can you send your controlDict / fvSolution and fvScheme ?

immortality February 11, 2013 15:47

I use compressible solvers like rhoPimpleFoam but now changing to sonicFoam.

immortality February 11, 2013 16:00


application    rhoPimpleFoam;

startFrom      latestTime;

startTime      0;

stopAt          endTime;

endTime        .02;//0.020708089

deltaT          5.6e-9;

writeControl    adjustableRunTime;

writeInterval  .000001;

purgeWrite      0;

writeFormat    binary;

writePrecision  10;

writeCompression on;

timeFormat      general;

timePrecision  6;

runTimeModifiable true;

adjustTimeStep  yes;

maxCo          0.1;

maxDeltaT      .0001;

libs ( "" "" ) ;


    default        backward;

    default        Gauss linear;
    grad(p)        Gauss linear;
    grad(U)        Gauss linear;//cellLimited leastSquares 1.0

    default        none;
    div(phi,U)      Gauss upwind;
    div(phid,p)    Gauss upwind;// upwind
    div(phi,K)      Gauss upwind;
    div(phi,h)      Gauss upwind;
    div(phi,k)      Gauss upwind;
    div(phi,epsilon) Gauss upwind;
    div(phi,R)      Gauss upwind;
    div(phi,omega)  Gauss upwind;
    div((rho*R))    Gauss limitedLinear 1;
    div(R)          Gauss limitedLinear 1;
    div(U)          Gauss limitedLinear 1;
    div((muEff*dev2(T(grad(U))))) Gauss linear;
    div(tauMC)  Gauss linear;

    default        Gauss linear limited .5;//limited .5
    /*laplacian(muEff,U) Gauss linear corrected;
    laplacian(mut,U) Gauss linear corrected;
    laplacian(DkEff,k) Gauss linear corrected;
    laplacian(DepsilonEff,epsilon) Gauss linear corrected;
    laplacian(DREff,R) Gauss linear corrected;
    laplacian(DomegaEff,omega) Gauss linear corrected;
    laplacian((rho*(1|A(U))),p) Gauss linear corrected;
    laplacian(alphaEff,h) Gauss linear corrected;
    laplacian(k,T)  Gauss linear corrected; 
    laplacian(alpha,e) Gauss linear corrected;
    laplacian(alphaEff,e)  Gauss linear corrected;*/

    default        linear;

    default      limited .5;//corrected

    default        no;
    p              ;


      solver PCG;
      preconditioner DIC;
      tolerance  1e-13;
      relTol 0;
      maxIter 25000;

    /*solver          GAMG;
        smoother  DICGaussSeidel;
        cacheAgglomeration true;
        nCellsInCoarsestLevel 200;
        nPreSweeps      0;
        nPostSweeps    2;
        nFinestSweeps  2;
        agglomerator  faceAreaPair;
        mergeLevels 2;
        tolerance      1e-012;
        relTol          0;*/

        relTol          0;

        tolerance      1e-11;
        relTol          0;

        solver          PBiCG;
        preconditioner  DILU;
        tolerance      1e-11;
        relTol          0;
        maxIter 25000;

        relTol          0;

    momentumPredictor yes;
    nOuterCorrectors 4;
    nCorrectors    3;
    nNonOrthogonalCorrectors 0;
    rhoMin          rhoMin [ 1 -3 0 0 0 ] 0.5;
    rhoMax          rhoMax [ 1 -3 0 0 0 ] 6;

            relTol          0;
            tolerance      0.00000000001;

xxxx February 11, 2013 17:22

Thanks for your answers.
My case is steasy state incompressible flow in a duct of quite complex geometry. I tried to simplify the geometry by removing chamfers and small details. The mesh is unstructured, with boundary layer, about 500'000 nodes.
I noticed that, since some iterations before the computation failed, the mass flow continuity started not to be satisfied.
Then in some region of the mesh the values of velocity or pressure rise suddenly. When I change the mesh and restart another simulation the point in which the anomalous values appears mooves.
When i do the checkMesh i don't find any error or warning. The skew value is around 0.7 . I tried to change the fvScheme. I set 1st order scheme everywere. This allowed me to make the simulation run for 1 hundred iteration more before to have the same problem.
Does anyone have an idea of the causes?

xxxx February 13, 2013 16:36

Please, can someone answer to some dubts?
1- when computing a simulation, should one let it run without modify relaxation factors or is it possible/advised to modify them? It happens that changing a relaxation factor completely changes the convergence. But is it right to do so?
2- how can i understand when the simulation is converged? Sometimes it happens that although the residuals are low, the results have no physical sense. On the other hand, sometimes although the residuals are high macroscopic quantities ,pressure drop for example, do not change much through time steps and results seem to be quite good. Is there any way to be quite sure that simulation has reached convergence?

danvica February 15, 2013 07:16

Without posting the necessary info ( it's difficult to help you.

I had a similar problem regarding mass flow rate in a tet mesh... just a blind hint: in your fvsolution use relTol=0 for p.

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