CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   RANS of 3D flow around a square cylinder (https://www.cfd-online.com/Forums/openfoam-solving/233929-rans-3d-flow-around-square-cylinder.html)

NotDrJeff February 17, 2021 09:33

RANS of 3D flow around a square cylinder
 
2 Attachment(s)
Hello all,
Firstly a disclaimer: I'm an idiot! I lack a lot of basic understanding of CFD and openFoam, so please be patient with me :)

I am working on a tutorial I found on wiki.openfoam.com from wolfdynamics. Here's the link. The case is 3D flow past a square cylinder at RE=21,400. The point of the tutorial is to compare RANS and LES turbulent models. The tutorial first uses simpleFoam with RANS. My attempt to run this simulation has lead to a whole heap of questions. See my geometry here: Attachment 82782

1) I know a-priori that this case will lead to vortex shedding (i.e. periodic motion). This immediately made me question why simpleFoam (a steady state solver) is being used. Is it ever "correct" to use a steady state solver for a problem that I know contains unsteady flow (even if it is periodic). Can this approach actually result in an accurate time-averaged flow or will the results always be garbage?

2) A brief google for flow around a square cylinder will show studies using URANS rather than RANS for this problem. What does URANS mean in an openFoam context? Does this simply mean using the RAS turbulence model, but with an unsteady solver (like pimpleFoam)? Or is there more to it than that?

3) Ultimately, my residuals aren't converging. For my initial mesh (which is quite coarse), they plateau around (E-4) - (E-7). I originally thought that while they weren't converging, they were still 'low enough'. But I've since read that the value alone isn't sufficient to judge convergence, but the amount that they drop. I've seen that a drop of (E-3) is considered a converged solution. Is this what I should be looking for? See my residuals here: Attachment 82783

4) The residuals oscillate a lot, but I'm not sure if this is because of the physical problem (oscillating flow) or because of the numerical schemes being used. My understanding of numerical schemes right now could be summed up as: 'use linearUpwind unless you know what your doing'. But in this case I am depending on the tutorial to give me recommended settings. My fvSchmes and fvSolution are below. Is there anything obvious that you think is preventing convergence?

Code:

ddtSchemes
{
    default        steadyState;
}

gradSchemes
{
    default        cellLimited Gauss linear 0.5;
    grad(U)        cellLimited Gauss linear 1;
}

divSchemes
{
    default        none;
    div(phi,U)      bounded Gauss linearUpwind grad(U);
    div(phi,k)                bounded Gauss upwind;
    div(phi,omega)        bounded Gauss upwind;
    div((nuEff*dev2(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
      default        Gauss linear limited 1;
}

interpolationSchemes
{
    default        linear;
}

snGradSchemes
{
    default        limited 1;
}

wallDist
{
    method            meshWave;
}

Code:

solvers
{
    p
    {
        solver          GAMG;
        tolerance        1e-6;
        relTol          0.01;
        smoother        GaussSeidel;
        nPreSweeps      0;
        nPostSweeps      2;
        cacheAgglomeration on;
        agglomerator    faceAreaPair;
        nCellsInCoarsestLevel 100;
        mergeLevels      1;
        minIter                3;
    }

    U
    {
        solver          PBiCGStab;
        preconditioner  DILU;
        tolerance      1e-08;
        relTol          0.001;
    }

    k
    {
        solver          PBiCGStab;
        preconditioner  DILU;
        tolerance      1e-08;
        relTol          0.001;
    }

    omega
    {
        solver          PBiCGStab;
        preconditioner  DILU;
        tolerance      1e-08;
        relTol          0.001;
    }

}

SIMPLE
{
    nNonOrthogonalCorrectors 2;
    pRefCell        0;
    pRefValue      0;

    consistent on;

    residualControl
    {
        p              1e-3;
        U              1e-3;
        nuTilda        1e-3;
        k              1e-3;
        omega          1e-3;
    }
}

//SIMPLEC URF
relaxationFactors
{
    fields
    {
        p              0.7;
    }
    equations
    {
        U              0.7;
        k              0.7;
        omega          0.7;
    }
}

5) I think that's enough questions for now! :D


Thank you for taking the time to read through this question. I hope to hear your response soon!

Jeffrey,


All times are GMT -4. The time now is 21:27.