CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Running, Solving & CFD

Lid driven cavity for pimple: solution oscillates

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   February 11, 2017, 15:53
Default Lid driven cavity for pimple: solution oscillates
Senior Member
piu58's Avatar
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 196
Rep Power: 3
piu58 is on a distinguished road
Good evening,

I just started using OpenFoam. The first question which I want to calculate really is the flow around a sphere (starting with a cylinder) at very high Reynolds numbers.

Bevore diving in that I try to understand how Openfoam works. I use the lid driven cavity for that. I found very accurate solutions for the cavity. I got very similar results from pisoFoam/LES even for quite high Re.

As I understand pimple may be better suited for my task. I tried calculating the cavity for a moderate Re=1000, mesh 100x100 and a grades mesh (finer to the boundaries. The mesh is the one from the tutorial incompressible-iso-cavityGrade.

I give the main parameters I chosed:
- mesh from the tutorial but I use finer mesh:
hex (0 1 4 3 9 10 13 12) (50 50 1) simpleGrading (2 2 1)
- boundary conditions ...
... fixed value for U at all walls (except the empty front/back)
... zeroGradient for p at all walls (except...)
... kqRWallFunction for k, value uniform 0.00325 at all walls
... epsilonWallFunction for eps value uniform 0.000765 at all walls
... nutkWallFunction for nut, value 0.

I don't understand wall functions full and grabed it from the piso cavity.
The fvSchemes and fvSolutions I understand even lesser and took them form the piso tutorial too (may be with slight variations; pimple needs a reference pressure so I included it)

    default         Euler;

    default         Gauss linear;
    grad(p)         Gauss linear;
    grad(U)         Gauss linear;

    default         none;
    div(phi,U)      bounded Gauss linearUpwind grad(U);
    div(phi,k)      bounded Gauss upwind;
    div(phi,epsilon) bounded Gauss upwind;
    div(phi,R)      bounded Gauss upwind;
    div(R)          Gauss linear;
    div(phi,nuTilda) bounded Gauss upwind;
    div((nuEff*dev2(T(grad(U))))) Gauss linear;

    default         none;
    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;

    default         linear;
    interpolate(U)  linear;

    default         corrected;
        solver           GAMG;
        tolerance        1e-7;
        relTol           0.01;

        smoother         DICGaussSeidel;

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

        relTol          0;

        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-05;
        relTol          0.1;

        relTol          0;

    nNonOrthogonalCorrectors 0;
    nCorrectors         2;
	pRefPoint (0 0 0);
	pRefValue 0;
pplication     pimpleFoam;

startFrom       latestTime;

startTime       0;

stopAt          endTime;

endTime         5;

deltaT          0.0002;

writeControl    adjustableRunTime;

writeInterval   0.1;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable yes;

adjustTimeStep  yes;

maxCo           5;
What happens?

With piso/LES the solution gets stable after some seconds computed time. I compared the results with the example for, Yiannis, and it fits very good. I used the centre coordinates of the vortexes and the given velocities across both midlines of the computed area: All is fine.
With pimple the solution gets nearly stable at a computed time of around 2.6 seconds, and starts oscillating then. It doesn't stop oscillation, even if I simulate really long times (100 seconds). The Courant number is around 4 which woud be much to high for piso. I had bad feelings with it and changed adjustTimeStep in controlDict to no and selected a tiny time step ( 0.0002 ) which leads to a Courant no of 0.25. This is the maximum value I accepted in piso.
The solutions remains oscillating.

Any ideas?

If you are interested you may download the whole case:

Thank you very much,

Uwe Pilz, Leipzig, Germany.
piu58 is offline   Reply With Quote

Old   February 11, 2017, 19:29
Senior Member
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,616
Rep Power: 27
alexeym will become famous soon enoughalexeym will become famous soon enough

Maybe I am not quite get meaning of "oscillating", yet, your case with modified settings has more-or-less stable flow field after ~2.8 s (see figure).

The most significant modification is a use of residualContol for PIMPLE (see system/fvSolution).

I have changed GAMG to PCG, since GAMG does all there interpolations and can cause oscillations (at least in case of van Karman vortex street it does).

Guess, you can check spatial discretisation schemes dependence yourself (I've put vanLeer since in general it just works ).
Attached Images
File Type: png flow-field.png (128.6 KB, 4 views)
Attached Files
File Type: gz cavity.tar.gz (2.2 KB, 2 views)
alexeym is offline   Reply With Quote

Old   February 12, 2017, 11:13
Senior Member
piu58's Avatar
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 196
Rep Power: 3
piu58 is on a distinguished road
Dear Alex,

thank you for your help. I experimented a little with your and my old parameters. The reason for the oscillation was the solver.
In my younger days, 25 years ago, I calculated electrical fields with non linear boundary condition (electroplating). My friend Ulli said those days: Use conjugated gradients as solver. I did and was always happy with it.
I am very happy that I am now at (bi)CG again, my beloved solver.

I also learned that is quite easy to ensure a maximum Courant number with automatic time control.

If anybody wants to see what I mean with oscillation: I prepared a film
The first one has 12 Megabytes

The smaller but coarser one has 5 Megabytes
Uwe Pilz
Sie ahnen nicht, wieviel Poesie in der Berechnung
einer Logarithmentafel enthalten ist (Carl Friedrich Gauß)
piu58 is offline   Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Methods to optimize the performance of simpleFoam solver for lid driven cavity case Sumeet Patil OpenFOAM 0 October 15, 2016 05:06
Boundary Conditions at Corners, lid driven cavity t.teschner Main CFD Forum 8 August 17, 2016 08:20
Lid driven Cavity suman91 SU2 2 October 20, 2014 15:38
2-D Lid Driven Cavity (Matlab) DaBears13 Main CFD Forum 0 May 5, 2013 04:11
Paraview - Lid Driven Cavity kieranhood OpenFOAM Paraview & paraFoam 0 February 13, 2010 17:28

All times are GMT -4. The time now is 06:03.