/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  13
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    "(rho|rhoFinal)"
    {
        solver          PCG
        preconditioner  DIC;
        tolerance       1e-7;
        relTol          0;
    }

    p_rgh
    {
        solver           GAMG;
        tolerance        1e-7;
        relTol           0.01;

        smoother         GaussSeidel;
        maxIter          100;
    }

    "(U|h|e|k|omega|epsilon)"
    {
        solver          PBiCGStab;
        preconditioner  DILU;
        tolerance       1e-6;
        relTol          0.1;
    }

    "(G|Ii.*)"
    {
        $p_rgh;
        tolerance       1e-7;
        relTol          0.1;
    }

    p_rghFinal
    {
        $p_rgh;
        relTol         0;
    }

    "(U|h|e|k|omega|epsilon)Final"
    {
        $U;
        relTol         0;
    }

    GFinal
    {
        $G;
        relTol         0;
    }
}

// timeScheme = steadyState for a steady-state simulation; otherwise transient
timeScheme $fvSchemes!ddtSchemes/default;

PIMPLE
{
    momentumPredictor yes;
    nNonOrthogonalCorrectors 0;

// Steady-state and transient correctors
#ifeq $timeScheme steadyState
    nOuterCorrectors 1;
    nCorrectors     1;
#else
    nOuterCorrectors 2;
    nCorrectors     2;
#endif
}

// Relaxation factors for incompressible and compressible solution
#ifeq $timeScheme steadyState
relaxationFactors
{
    fields
    {
        p               0.3;
        rho             1.0;
    }
    equations
    {
        U                       0.3;
        "(e|h|k|epsilon|omega)" 0.7;
        "G"                     1.0;
        "ILambda.*"             1.0;
    }
}
#else
relaxationFactors
{
    // Transient relaxation factors
    equations
    {
        ".*"  1;
    }
}
#endif

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