/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Version:  OpenFoam-9 (commit f8d11b031)
    \\  /    A nd           | Multiphase-org: A Wikki Brasil project
     \\/     M anipulation  | Version:  v21.12
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


coupledSolvers
{
    solveCoupledAlphas          false;

    Alphas
    {
        saveSystem                  true;
        robustSumCheck              true;
        updatePrecondFrequency      1;  
        updateMatrixCoeffs          true;      
    }
}

solvers
{
    "alpha.*"
    {
        nAlphaCorr      1;
        nAlphaSubCycles 1;
        solver          diagonal;
    }

    p_rgh
    {
        solver          PCG;
        preconditioner
        {
            preconditioner          GAMG;
            smoother                DIC;
            nPreSweeps              0;             
            nPostSweeps             2;             
            nFinestSweeps           2;
            cacheAgglomeration      true;
            nCellsInCoarsestLevel   5;
            agglomerator            faceAreaPair;
            mergeLevels             1;        
        }
        tolerance        1e-08;
        relTol           1e-04;
        minIter          1;
        maxIter          20;       
    }
    PMono
    {
        solver          PCG;
        preconditioner
        {
            preconditioner          GAMG;
            smoother                DIC;
            nPreSweeps              0;             
            nPostSweeps             2;             
            nFinestSweeps           2;
            cacheAgglomeration      true;
            nCellsInCoarsestLevel   5;
            agglomerator            faceAreaPair;
            mergeLevels             1;        
        }
        tolerance        1e-08;
        relTol           1e-04;
        minIter          1;
        maxIter          20;       
    }
    /*
    p_rgh
    {        
        solverType       eigenSolver; 
         
        solver           BiCGSTAB;
                  
        saveSystem               true;
        updatePrecondFrequency   -1;
        updateMatrixCoeffs       true;
        
        tolerance        1e-12;
        maxIter          1000;
       
        preconditioner
        {
            preconditioner       ILUT;
            dropTol              1e-80;
            fillFactor           200;
        }       
    }    
    
    p_rgh
    {
        solverType       hypreSolver;
        
        solver           GMRES;
        
        saveSystem       false;
                
        tolerance        1e-12;
        maxIter          20;
        
        preconditioner
        {
            preconditioner       BoomerAMG;
            maxIter              10;
        }    
    }
    */
    
    p_rghFinal
    {
        $p_rgh
        minIter          1;
        relTol           0;
        tolerance        1e-08;
    }

    "U.*"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-6;
        relTol          0;
        minIter         1;
    }

    "(e|h).*"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-6;
        relTol          0;
        minIter         1;
        maxIter         20;
    }

    "(k|epsilon|Theta).*"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-8;
        relTol          0;
        minIter         1;
    }

    "Yi.*"
    {
        solver          PBiCGStab;
        preconditioner  DILU;
        tolerance       1e-12;
        relTol          0;
        minIter         1;
        residualAlpha   1e-10;
    }
}

PIMPLE
{
    faceMomentum                yes;
    fluidStaticInitialisation   no;
    
    nFluidStaticCorrectors      5;
    nOuterCorrectors            50;  // máximo de iterações do acoplamento
    nCorrectors                 1;
    nNonOrthogonalCorrectors    0;
        
    outerCorrectorResidualControl
    {
        p_rgh
        {
            tolerance   1e-5;
            relTol      0;
        }
        d1.water
        {
            tolerance   5e-7;
            relTol      0;
        }
    }
}

relaxationFactors
{
    fields
    {
        p_rgh           1;
        p_rghFinal      1;      
        "U.*"           1;
        "UFinal.*"      1;
    }
    equations 
    {
        "U.*"           1;
        "UFinal.*"      1;
    }
}


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