/*--------------------------------*- 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;
    location    "system";
    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-06;
        relTol          0.1;
    }

    "(U|k|epsilon|omega|f|v2)"
    {
        solver petsc;

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

            caching
            {
                matrix
                {
                    update always;
                }

                preconditioner
                {
                    update always;
                }
            }
        }

        tolerance       1e-05;
        relTol          0.1;
    }
}

SIMPLE
{
    nNonOrthogonalCorrectors 0;
    consistent      yes;

    residualControl
    {
        p               1e-2;
        U               1e-3;
        "(k|epsilon|omega|f|v2)" 1e-3;
    }
}

relaxationFactors
{
    equations
    {
        U               0.9; // 0.9 is more stable but 0.95 more convergent
        ".*"            0.9; // 0.9 is more stable but 0.95 more convergent
    }
}


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