/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1806                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
    cellDisplacement
    {
        solver          GAMG;
        smoother        GaussSeidel;
        tolerance       1e-7;
        relTol          0.01;
    }

    p_rgh
    {
        solver PPCG;
        preconditioner DIC;
        tolerance 1e-6;
        relTol 0.001;
        minIter 3;
        maxIter 1000;
    }
/*
    p_rgh
    {
        solver           GAMG;
        smoother         DIC;
        tolerance        1e-6;
        relTol           0.001;
        minIter          1;
        maxIter          200;

        agglomerator     algebraicPair;

//        nCellsInCoarsestLevel 10; // needs to be low for directSolveCoarsest
//        directSolveCoarsest true;
//        coarsestLevelCorr
//        {
//            solver          PCGR;
//            preconditioner  DIC;
//            relTol          0.05;
//        }
    }
*/
    p_rghFinal
    {
        $p_rgh;
        relTol          0;
    }

    rho
    {
        $p_rgh;
    }

    rhoFinal
    {
        $rho;
        relTol          0;
    }
    
    "(U|T|h|e|k|epsilon|R|omega)"
    {
        solver          PBiCGStab; //smoothSolver;
//        smoother        DILUGaussSeidel;
        preconditioner  DILU;
        tolerance       1e-08; // refine after some time to 1e-8
        relTol          0.001;
    }
    "(U|T|h|e|k|epsilon|R|omega)Final"
    {
        $U;
        relTol          0;
    }

}

PIMPLE
{
    momentumPredictor yes;
    nOuterCorrectors 50;         
    nCorrectors     2;          
    nNonOrthogonalCorrectors 1;
    turbOnFinalIterOnly false;
    
//    pRefCell        0;
//    pRefValue       101325;

    consistent      yes;    // PIMPLE_C useful for large max courant number

    residualControl
    {
        "(U|T|h|k|epsilon|omega|R)"
        {
                tolerance  1e-4;
                relTol      0;
        }
        p_rgh
        {
                tolerance  1e-5;
                relTol      0;
        }
    }
}


relaxationFactors
{
    fields
    {
        p_rgh           1;
        ".*Final"        1;

    }
    equations
    {
        U                                 1;
        "(T|h|e)"                           1;
        "(k|epsilon|omega|R)"             1;
        ".*Final"                   1;
    }
}

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


