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/)
-   -   pimpleFoam Simulation aroud a cylinder does not converges (https://www.cfd-online.com/Forums/openfoam-solving/152303-pimplefoam-simulation-aroud-cylinder-does-not-converges.html)

ASo April 28, 2015 08:27

pimpleFoam Simulation aroud a cylinder does not converges
 
Hi all,

I'm trying to learn how to use pimpleFoam. In order to do this I'm trying to simulate the flow around a cylinder, I'm doing this at high Reynolds (7.10^6) because I will have to make simulations at this Reynolds. I read this about pimpleFoam :
http://www.cfd-online.com/Forums/blo...hm-part-i.html
http://www.cfd-online.com/Forums/blo...m-part-ii.html


At all of the timesteps, the simulation did not converged after 50 pimple iterations (nOuterCorrectors = 50).

It seems to be an easy simulation (flow around a cylinder). Can you tell me what is wrong in my simulation ..

Thanks for answers !!


An extract of the log.pimpleFoam file (first part of the file and a part of the last timestep):

Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.3.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.3.0
Exec  : pimpleFoam -parallel
Date  : Apr 27 2015
Time  : 15:48:10
Host  : "nemo1"
PID    : 12414
Case  : /data/cylindre_insta4
nProcs : 32
Slaves :
31
(
"nemo1.12415"
"nemo1.12416"
"nemo1.12417"
"nemo1.12418"
"nemo1.12419"
"nemo1.12420"
"nemo1.12421"
"nemo1.12422"
"nemo1.12423"
"nemo1.12424"
"nemo1.12425"
"nemo1.12426"
"nemo1.12427"
"nemo1.12428"
"nemo1.12429"
"nemo1.12430"
"nemo1.12431"
"nemo1.12432"
"nemo1.12433"
"nemo1.12434"
"nemo1.12435"
"nemo1.12436"
"nemo1.12437"
"nemo1.12438"
"nemo1.12439"
"nemo1.12440"
"nemo1.12441"
"nemo1.12442"
"nemo1.12443"
"nemo1.12444"
"nemo1.12445"
)

Pstream initialized with:
    floatTransfer      : 0
    nProcsSimpleSum    : 0
    commsType          : nonBlocking
    polling iterations : 0
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type RASModel
Selecting RAS turbulence model kOmegaSST
kOmegaSSTCoeffs
{
    alphaK1        0.85034;
    alphaK2        1;
    alphaOmega1    0.5;
    alphaOmega2    0.85616;
    gamma1          0.5532;
    gamma2          0.4403;
    beta1          0.075;
    beta2          0.0828;
    betaStar        0.09;
    a1              0.31;
    b1              1;
    c1              10;
    F3              false;
}

No finite volume options present


PIMPLE: max iterations = 50
    field U    : relTol 0, tolerance 1e-05
    field p    : relTol 0, tolerance 0.0005


Starting time loop

.
.
.
.
.
.

Courant Number mean: 1.27401 max: 9.54351
Time = 5

PIMPLE: iteration 1
smoothSolver:  Solving for Ux, Initial residual = 0.0059193, Final residual = 4.07869e-05, No Iterations 1
smoothSolver:  Solving for Uy, Initial residual = 0.00996702, Final residual = 8.40309e-05, No Iterations 1
smoothSolver:  Solving for Uz, Initial residual = 0.00529798, Final residual = 5.20881e-05, No Iterations 1
GAMG:  Solving for p, Initial residual = 0.536424, Final residual = 0.00275772, No Iterations 2
time step continuity errors : sum local = 2.97493e-05, global = 5.66073e-06, cumulative = 0.00585719
PIMPLE: iteration 2
.
.
.
.
.
.
.
.
.
PIMPLE: iteration 47
smoothSolver:  Solving for Ux, Initial residual = 0.000179332, Final residual = 1.82244e-06, No Iterations 1
smoothSolver:  Solving for Uy, Initial residual = 0.000553898, Final residual = 4.81264e-06, No Iterations 1
smoothSolver:  Solving for Uz, Initial residual = 0.000286557, Final residual = 2.57935e-06, No Iterations 1
GAMG:  Solving for p, Initial residual = 0.0244919, Final residual = 0.000130336, No Iterations 3
time step continuity errors : sum local = 1.74618e-06, global = 4.28654e-07, cumulative = 0.0058756
PIMPLE: iteration 48
smoothSolver:  Solving for Ux, Initial residual = 0.000177181, Final residual = 1.74186e-06, No Iterations 1
smoothSolver:  Solving for Uy, Initial residual = 0.000562329, Final residual = 4.91611e-06, No Iterations 1
smoothSolver:  Solving for Uz, Initial residual = 0.000281855, Final residual = 2.38418e-06, No Iterations 1
GAMG:  Solving for p, Initial residual = 0.024675, Final residual = 0.000131996, No Iterations 3
time step continuity errors : sum local = 1.7573e-06, global = -4.33255e-07, cumulative = 0.00587516
PIMPLE: iteration 49
smoothSolver:  Solving for Ux, Initial residual = 0.000178031, Final residual = 1.77695e-06, No Iterations 1
smoothSolver:  Solving for Uy, Initial residual = 0.000554551, Final residual = 4.84694e-06, No Iterations 1
smoothSolver:  Solving for Uz, Initial residual = 0.000284683, Final residual = 2.50979e-06, No Iterations 1
GAMG:  Solving for p, Initial residual = 0.0244865, Final residual = 0.000131006, No Iterations 3
time step continuity errors : sum local = 1.75527e-06, global = 4.31808e-07, cumulative = 0.0058756
PIMPLE: iteration 50
smoothSolver:  Solving for Ux, Initial residual = 0.00131143, Final residual = 7.81589e-06, No Iterations 5
smoothSolver:  Solving for Uy, Initial residual = 0.00361828, Final residual = 8.30476e-06, No Iterations 7
smoothSolver:  Solving for Uz, Initial residual = 0.0022754, Final residual = 6.55988e-06, No Iterations 7
GAMG:  Solving for p, Initial residual = 0.507878, Final residual = 8.37436e-08, No Iterations 14
time step continuity errors : sum local = 2.59953e-09, global = -2.61579e-10, cumulative = 0.0058756
smoothSolver:  Solving for omega, Initial residual = 0.00988738, Final residual = 5.73628e-06, No Iterations 6
smoothSolver:  Solving for k, Initial residual = 0.00649944, Final residual = 6.7763e-06, No Iterations 8
PIMPLE: not converged within 50 iterations
ExecutionTime = 20304.7 s  ClockTime = 20311 s

End

Finalising parallel run

fvSolution file :

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.3.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
    p
    {
        solver          GAMG;
        tolerance        1e-7;
        relTol          0.01;

        smoother        DICGaussSeidel;

        cacheAgglomeration true;
        nCellsInCoarsestLevel 10;
        agglomerator    faceAreaPair;
        mergeLevels      1;
    }

    pFinal
    {
        $p;
        relTol          0;
    }

    "(U|k|omega)"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance      1e-05;
        relTol          0.1;
    }

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

PIMPLE
{
    nNonOrthogonalCorrectors 0;
    nCorrectors        1;
    nOuterCorrectors    50;

    residualControl
    {
        U
        {
                tolerance  1e-5;
                relTol    0;
        }
        p
        {
                tolerance  5e-4;
                relTol    0;
        }
    }
}

relaxationFactors
{
    fields
    {
        p      0.3;
        pFinal  1;
    }
    equations
    {
        "U|k|omega"          0.3;
        "(U|k|omega)Final"    1;
    }
}
potentialFlow
{
    nNonOrthogonalCorrectors 10;
pRefCell        0;
    pRefValue      0;

    residualControl
    {
        p              1e-5;
        U              1e-5;
   
      k        1e-5;
    omega 1e-5;
    }
}

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

fvSchemes file :

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.3.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "system";
    object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
    default        Euler;
}

gradSchemes
{
    default        Gauss linear;
    grad(p)        Gauss linear;
    grad(U)        Gauss linear;
}

divSchemes
{
    default        none;
    div(phi,U)      bounded Gauss linearUpwind grad(U);
    div(phi,k)      bounded Gauss upwind;
//    div(phi,epsilon) bounded Gauss upwind;
    div(phi,omega)      bounded Gauss upwind;
//    div(R)          Gauss linear;
//    div(phi,nuTilda) bounded Gauss upwind;
    div((nuEff*dev(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
    default        Gauss linear corrected;
//    laplacian(nuEff,U) Gauss linear corrected;
//    laplacian(rAUf,p)  Gauss linear corrected;
//    laplacian(DkEff,k) Gauss linear corrected;
//    laplacian(DepsilonEff,epsilon) Gauss linear corrected;
//    laplacian(DREff,R) Gauss linear corrected;
//    laplacian(DnuTildaEff,nuTilda) Gauss linear corrected;
}

interpolationSchemes
{
    default        linear;
    interpolate(U)  linear;
}

snGradSchemes
{
    default        corrected;
}

fluxRequired
{
    default        no;
    p              ;
}


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


tomf April 29, 2015 04:19

Hi,

You can probably use higher relaxation factors in your inner iterations:

Code:

relaxationFactors
{
    fields
    {
        p      0.8;
        pFinal  1;
    }
    equations
    {
        "U|k|omega"          0.8;
        "(U|k|omega)Final"    1;
    }
}

You would have to play around with these on how high you can go.

There may however be something wrong with your boundary conditions or mesh as well.

ASo April 30, 2015 05:05

Thanks for the answer !!

As you thought with higher relaxation factors it does not converge.

Does anyone have an idea about something that could be bad with my mesh or other ??

alexeym April 30, 2015 05:14

Hi,

As usual, please post:

1. checkMesh output
2. Your initial and boundary conditions (or just an archive of 0 folder)
3. And finally geometry of your problem (or a screenshot of the mesh), as several times on this forum people thought they are simulating flow around cylinder and yet they were not.

ASo April 30, 2015 05:35

4 Attachment(s)
Thanks for answer :
Here are the information you ask me.

There is :
  • The log.checkMesh code
  • An archive of 0 folder
  • Three screenshots of the mesh from paraview :
  • -3dmesh is a view oh the internal mesh
  • -meshcut is a slice of the internal mesh in the "normal to the cylinder axis and central plane".
  • -meshcut_cylinder is the same slice with the mesh of the patch "cylinder" represented as a surface.
If you need more information tell me !!


The log.checkMesh file :

Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.3.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.3.0
Exec  : checkMesh
Date  : Apr 29 2015
Time  : 22:23:59
Host  : "nemo1"
PID    : 27356
Case  : /data/cylindre_insta4
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create polyMesh for time = 0

Time = 0

Mesh stats
    points:          244368
    faces:            697280
    internal faces:  679552
    cells:            226560
    faces per cell:  6.07712
    boundary patches: 6
    point zones:      0
    face zones:      0
    cell zones:      0

Overall number of cells of each type:
    hexahedra:    218400
    prisms:        1536
    wedges:        0
    pyramids:      0
    tet wedges:    0
    tetrahedra:    0
    polyhedra:    6624
    Breakdown of polyhedra by number of faces:
        faces  number of cells
            6  2112
            9  2688
          12  1824

Checking topology...
    Boundary definition OK.
    Cell to face addressing OK.
    Point usage OK.
    Upper triangular ordering OK.
    Face vertices OK.
    Number of regions: 1 (OK).

Checking patch topology for multiply connected surfaces...
                  Patch    Faces  Points                  Surface topology
            frontAndBack    7936    8352  ok (non-closed singly connected)
                  outlet      576      625  ok (non-closed singly connected)
                  inlet      576      625  ok (non-closed singly connected)
              lowerWall    2016    2125  ok (non-closed singly connected)
              upperWall    2016    2125  ok (non-closed singly connected)
                cylindre    4608    4656  ok (non-closed singly connected)

Checking geometry...
    Overall domain bounding box (-6 -3 -3) (15 3 3)
    Mesh (non-empty, non-wedge) directions (1 1 1)
    Mesh (non-empty) directions (1 1 1)
    Boundary openness (-4.92725e-19 2.71585e-16 -1.4847e-16) OK.
    Max cell openness = 3.3278e-16 OK.
    Max aspect ratio = 2.56187 OK.
    Minimum face area = 0.00149621. Maximum face area = 0.0635283.  Face area magnitudes OK.
    Min volume = 9.46489e-05. Max volume = 0.0158862.  Total volume = 751.325.  Cell volumes OK.
    Mesh non-orthogonality Max: 26.2533 average: 4.97247
    Non-orthogonality check OK.
    Face pyramids OK.
    Max skewness = 0.341876 OK.
    Coupled point location match (average 0) OK.

Mesh OK.

End


tomf April 30, 2015 05:40

Change the boundary condition for pressure on your inlet to zeroGradient. I generally do not use the freestream boundary types, but I guess they could be used. I do believe there is also a freestreampressure boundary condition, that one may also work.

Regards,
Tom

alexeym April 30, 2015 07:06

Hi,

Agree with tomf about BC for pressure. You impose inlet velocity and no pressure gradient along the channel. It is a little bit strange, no?

Mesh seems to be OK (hope inlet is really inlet and outlet is really outlet), though usually people make it denser not only around cylinder but also near the center of the channel.

ASo May 4, 2015 10:15

Thanks for answers :

I'm confused about pressure boundary conditions:
If I want to simulate my the cylinder in a total free flow (not in a channel), should I use zeroGradient for all of the boundaries (even for inlet and oulet) ??

tomf May 6, 2015 04:20

Well your setup inevitably results in a channel-like flow. If you want (almost) freestream conditions I would suggest this setup:

Increase the height of your domain and prescribe your freestream conditions on the top and bottom boundaries as if they were inlets: fixedValue for velocity and turbulence, zeroGradient for pressure.

For the outlet set a fixedValue pressure (0) and zeroGradient for all other variables. Otherwise look at the setup for the case:

$FOAM_TUTORIALS/incompressible/simpleFoam/airFoil2D

That one uses a setup with freestream boundary conditions.

Regards,
Tom

ASo May 6, 2015 07:33

Ok thanks for the details about boundary conditions.

I'e seen the airfoilD tutorial but it is a 2D simulation, I would like to do this in 3D but I don't know what boundary condition to use for the frontAndBack patches.

I will try the first solution you gave me.

tomf May 6, 2015 07:46

Quote:

Originally Posted by ASo (Post 545212)
I'e seen the airfoilD tutorial but it is a 2D simulation, I would like to do this in 3D but I don't know what boundary condition to use for the frontAndBack patches.

Yes it is 2D, but it shows the use of the freestream boundary conditions.

For 3D I would use slip on the frontAndBack patches for velocity, calculated for nut and zeroGradient for all others. If you have a finite length of your cylinder and want to include end effects you could make these freestream as well, but I think you should decide that for yourself after thinking about what it is exactly that you want to simulate.

ASo May 7, 2015 08:43

1 Attachment(s)
One more thanks for answer

Quote:

Originally Posted by tomf (Post 544432)
Change the boundary condition for pressure on your inlet to zeroGradient. I generally do not use the freestream boundary types, but I guess they could be used. I do believe there is also a freestreampressure boundary condition, that one may also work.

Regards,
Tom

This worked : after few time steps it converges after few Pimple iterations (8 for example depends of the other parameters).

Quote:

Originally Posted by tomf (Post 545213)
Yes it is 2D, but it shows the use of the freestream boundary conditions.

For 3D I would use slip on the frontAndBack patches for velocity, calculated for nut and zeroGradient for all others. If you have a finite length of your cylinder and want to include end effects you could make these freestream as well, but I think you should decide that for yourself after thinking about what it is exactly that you want to simulate.


I'm still trying to set freestream boundary conditions when I'm using those parameters I've got an error about field p.

I join the 0 folder.

Here is an extract of the log.pimpleFoam with the error message :
Code:

[16]
[16]
[16] --> FOAM FATAL IO ERROR:
[16] Unable to set reference cell for field p
    Please supply either pRefCell or pRefPoint
[16]
[16]
[16] file: IOstream.PIMPLE from line 0 to line 0.
[16]
[16]    From function void Foam::setRefCell
(
    const volScalarField&,
    const volScalarField&,
    const dictionary&,
    label& scalar&,
    bool
)
[16]    in file cfdTools/general/findRefCell/findRefCell.C at line 125.
[16]
FOAM parallel run exiting
[16]


tomf May 7, 2015 09:33

This means you need something like this in your system/fvSolution (the bold font part) but than in the PIMPLE subDict. Instead of pRefCell you can also use pRefPoint (search the forum for explanations). I took this from the airfoil2D tutorial.

Code:

SIMPLE
{
    nNonOrthogonalCorrectors 0;
    pRefCell        0;
    pRefValue      0;


    residualControl
    {
        p              1e-5;
        U              1e-5;
        nuTilda        1e-5;
    }
}

Please note that if you have vortex shedding you may see an effect of an alternating pressure in the entire domain, which probably messes up any animations, but should not effect your forces.


All times are GMT -4. The time now is 02:35.