/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2212                                |
|   \\  /    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-5;
        relTol           0.0001;
        smoother         GaussSeidel;
        nPreSweeps       0;
        nPostSweeps      2;
        cacheAgglomeration on;
        agglomerator     faceAreaPair;
        nCellsInCoarsestLevel 100;
        mergeLevels      1;
    }

    pFinal
    {
        solver           GAMG;
        tolerance        1e-6;
        relTol           0.0;
        smoother         GaussSeidel;
        nPreSweeps       0;
        nPostSweeps      2;
        cacheAgglomeration on;
        agglomerator     faceAreaPair;
        nCellsInCoarsestLevel 100;
        mergeLevels      1;
    }*/

    p
    {
        solver           PCG;
        preconditioner   DIC;
        tolerance        1e-5;
        relTol           0.0001;
    }

    pFinal
    {
        solver           PCG;
        preconditioner   DIC;
        tolerance        1e-6;
        relTol           0.0;
    }

    pcorr
    {
        solver           GAMG;
        tolerance        1e-5;
        relTol           0.0001;
        smoother         GaussSeidel;
        nPreSweeps       0;
        nPostSweeps      2;
        cacheAgglomeration on;
        agglomerator     faceAreaPair;
        nCellsInCoarsestLevel 100;
        mergeLevels      1;
    }

    pcorrFinal
    {
        solver           GAMG;
        tolerance        1e-6;
        relTol           0.0;
        smoother         GaussSeidel;
        nPreSweeps       0;
        nPostSweeps      2;
        cacheAgglomeration on;
        agglomerator     faceAreaPair;
        nCellsInCoarsestLevel 100;
        mergeLevels      1;
    }

    U
    {
        solver          PBiCGStab;
        preconditioner  DILU;
        tolerance       1e-08;
        relTol          0.0001;
    }

    UFinal
    {
        solver          PBiCGStab;
        preconditioner  DILU;
        tolerance       1e-09;
        relTol          0;
    }

    k
    {
        solver           PBiCGStab;//smoothSolver;
        preconditioner   DILU;//smoother   GaussSeidel;
        //nSweeps          1;
        tolerance        1e-9;
        relTol           0.0001;
    }

    kFinal
    {
        solver           PBiCGStab;//smoothSolver;
        preconditioner   DILU;//smoother   GaussSeidel;
        //nSweeps          1;
        tolerance        1e-10;
        relTol           0.0;
    }

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

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

}

PIMPLE
{
	nOuterCorrectors 1;// equal to 1, then it will run in Piso mode, to increase the Co number this number have to be higher than 2 (sometimes between 50-200)
    nCorrectors 2;// it calculates n times the p equation with the number of correctors set in nNonOrthogonalCorrectors
    nNonOrthogonalCorrectors 2;// calculates n more times the pressure (related with the orthogonality of the mesh)
        pRefCell        0;
        pRefValue       0;

    turbOnFinalIterOnly false;//for high turbulent flows it has to be set to false

    residualControl
    {
        U
        {
            tolerance 1e-5;
            relTol    0;
        }

        p
        {
            tolerance 1e-4;
            relTol    0;
        }
    }
}

relaxationFactors
{
    p        0.5;
    U        0.7;
    k        0.7;
    omega    0.7;
}

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