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

solvers
{
    p
    {
        solver petsc;

        petsc
        {
            options
            {
                ksp_type  cg;
                ksp_cg_single_reduction  true;
                ksp_norm_type none;

// With or without hypre
#if 0
                pc_type  hypre;
                pc_hypre_type boomeramg;
                pc_hypre_boomeramg_max_iter "1";
                pc_hypre_boomeramg_strong_threshold "0.25";
                pc_hypre_boomeramg_grid_sweeps_up "1";
                pc_hypre_boomeramg_grid_sweeps_down "1";
                pc_hypre_boomeramg_agg_nl "1";
                pc_hypre_boomeramg_agg_num_paths "1";
                pc_hypre_boomeramg_max_levels "25";
                pc_hypre_boomeramg_coarsen_type HMIS;
                pc_hypre_boomeramg_interp_type ext+i;
                pc_hypre_boomeramg_P_max "1";
                pc_hypre_boomeramg_truncfactor "0.3";
#else
                pc_type bjacobi;
                sub_pc_type ilu;
#endif
            }

            caching
            {
                matrix
                {
                    update always;
                }

                preconditioner
                {
                    update always;
                }
            }
        }

        tolerance       1e-07;
        relTol          0.01;
    }

    Phi
    {
        $p;
    }

    U
    {
        solver petsc;

        petsc
        {
            options
            {
                ksp_type bicg;
                pc_type bjacobi;
                sub_pc_type ilu;
            }

            caching
            {
                matrix
                {
                    update always;
                }

                preconditioner
                {
                    update always;
                }
            }
        }

        tolerance       1e-8;
        relTol          0.1;
    }

    k
    {
        solver petsc;

        petsc
        {
            options
            {
                ksp_type bicg;
                pc_type bjacobi;
                sub_pc_type ilu;
            }

            caching
            {
                matrix
                {
                    update always;
                }

                preconditioner
                {
                    update always;
                }
            }
        }

        tolerance       1e-8;
        relTol          0.1;
    }

    omega
    {
        solver petsc;

        petsc
        {
            options
            {
                ksp_type bicg;
                pc_type bjacobi;
                sub_pc_type ilu;
            }

            caching
            {
                matrix
                {
                    update always;
                }

                preconditioner
                {
                    update always;
                }
            }
        }

        tolerance       1e-8;
        relTol          0.1;
    }
}

SIMPLE
{
    nNonOrthogonalCorrectors 0;
    consistent yes;
}

potentialFlow
{
    nNonOrthogonalCorrectors 10;
}

relaxationFactors
{
    equations
    {
        U               0.9;
        k               0.7;
        omega           0.7;
    }
}

cache
{
    grad(U);
}

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