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/)
-   -   Divergence in simpleFoam (https://www.cfd-online.com/Forums/openfoam-solving/95236-divergence-simplefoam.html)

LB_K December 10, 2011 11:24

Divergence in simpleFoam
 
1 Attachment(s)
Hello everyone.
I am a newbie in OpenFoam, so don't be too strict to me. I have a task to calculate the steady state pressure and velocity field in cylinder with 2 cylinder holes - one of them inlet, and another one is outlet. The inlet velocity in known.

I tried to use icoFoam, but after a lot of calculation steps the courant number went very high and the solution diverged. So, i changed solver to simpleFoam.

Some information about how to use simpleFoam i've got from http://www.cfd-online.com/Forums/ope...am-solver.html

Simplefoam looks to work well, but starting from the 300th step something strange happens.

Quote:

Time = 301

smoothSolver: Solving for Ux, Initial residual = 0.00451893, Final residual = 4.43897e-05, No Iterations 2
smoothSolver: Solving for Uy, Initial residual = 0.0046188, Final residual = 4.43219e-05, No Iterations 2
smoothSolver: Solving for Uz, Initial residual = 0.00303527, Final residual = 2.93432e-05, No Iterations 2
GAMG: Solving for p, Initial residual = 0.141931, Final residual = 9.16397e-05, No Iterations 5
GAMG: Solving for p, Initial residual = 0.0308181, Final residual = 1.08156e-05, No Iterations 5
GAMG: Solving for p, Initial residual = 0.0111861, Final residual = 8.45965e-06, No Iterations 5
GAMG: Solving for p, Initial residual = 0.00815672, Final residual = 3.46598e-06, No Iterations 6
time step continuity errors : sum local = 6.31434e-06, global = 2.92482e-09, cumulative = 7.47596e-06
ExecutionTime = 2063.25 s ClockTime = 2110 s

Time = 302

smoothSolver: Solving for Ux, Initial residual = 0.00451987, Final residual = 4.44502e-05, No Iterations 2
smoothSolver: Solving for Uy, Initial residual = 0.00461933, Final residual = 4.42789e-05, No Iterations 2
smoothSolver: Solving for Uz, Initial residual = 0.00303333, Final residual = 2.93334e-05, No Iterations 2
GAMG: Solving for p, Initial residual = 0.143248, Final residual = 8.37238e-05, No Iterations 5
GAMG: Solving for p, Initial residual = 0.0304607, Final residual = 2.76634e+08, No Iterations 100
GAMG: Solving for p, Initial residual = 0.386885, Final residual = 5.57401e+12, No Iterations 100
GAMG: Solving for p, Initial residual = 0.386885, Final residual = 5.57401e+12, No Iterations 100
time step continuity errors : sum local = 4.2355e+34, global = 7.5829e+29, cumulative = 7.5829e+29
ExecutionTime = 2147.48 s ClockTime = 2212 s
/************************************************** ******/
Geometry -
http://www.cfd-online.com/Forums/mem...1-geometry.png

Mesh information -
Quote:

Mesh stats
points: 33093
faces: 344465
internal faces: 325947
cells: 167603
boundary patches: 3
point zones: 0
face zones: 0
cell zones: 1

Overall number of cells of each type:
hexahedra: 0
prisms: 0
wedges: 0
pyramids: 0
tet wedges: 0
tetrahedra: 167603
polyhedra: 0

Checking topology...
Boundary definition OK.
Cell to face addressing OK.
Point usage OK.
Upper triangular ordering OK.
Face vertices OK.
Topological cell zip-up check OK.
Face-face connectivity OK.
Number of regions: 1 (OK).

Checking patch topology for multiply connected surfaces ...
Patch Faces Points Surface topology Bounding box
wall 9810 5533 ok (non-closed singly connected) (-5 -5 0) (5 5 5)
inlet 4354 2492 ok (non-closed singly connected) (2 -1 2) (4 1 2)
outlet 4354 2492 ok (non-closed singly connected) (-4 -1 2) (-2 1 2)

Checking geometry...
Overall domain bounding box (-5 -5 0) (5 5 5)
Mesh (non-empty, non-wedge) directions (1 1 1)
Mesh (non-empty) directions (1 1 1)
Boundary openness (4.74506e-17 7.24893e-20 1.1664e-16) OK.
Max cell openness = 2.50855e-16 OK.
Max aspect ratio = 4.59859 OK.
Minumum face area = 2.60582e-05. Maximum face area = 1.33205. Face area magnitudes OK.
Min volume = 8.06256e-08. Max volume = 0.49308. Total volume = 377.31. Cell volumes OK.
Mesh non-orthogonality Max: 51.5241 average: 15.8802
Non-orthogonality check OK.
Face pyramids OK.
Max skewness = 0.87808 OK.
Coupled point location match (average 0) OK.
Face tets OK.
Min/max edge length = 0.00677553 1.94168 OK.
All angles in faces OK.
All face flatness OK.
Cell determinant (wellposedness) : minimum: 0.0209264 average: 1.49098
Cell determinant check OK.
Concave cell check OK.

Mesh OK.
I have not got any experience, so any help will be necessary to me.

Thanks.

danishdude December 12, 2011 13:57

What do your boundary conditions look like? In particular, you might try an inletOutlet condition on velocity. Basically, this sets a zeroGradient condition on the boundary when flow is going out, and a fixed value when flow is attempting to go back in. I've seen similar instabilities when there is a flow reversal on the exit boundary condition with a zeroGradient on velocity.

If the problem is in fact a flow reversal, you may also be able to get rid of it by further removing your boundary condition from your flow domain (although that's often not a practical solution).

LB_K December 12, 2011 14:52

For velocity i use these conditions
Code:

wall
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    inlet
    {
        type            fixedValue;
        value          uniform (0 0 1);
    }
    outlet
    {
        type            zeroGradient;
    }

and for pressure these -
Code:

wall
    {
        type            zeroGradient;
    }

    inlet
    {
        type                zeroGradient;
    }

    outlet
    {
        type            fixedValue;
        value          uniform 0;
    }

The problem dissappeared, after i'd change the solvers and played with relaxation factors.

Solver for velocity now is PBicG, before it was SmoothSolver.
Solver for pressure is PCG before it was GAMG.

Thanks.

LB_K December 14, 2011 20:01

I'd like to add that i thought that my Reynold number is about 1, but it was a great mistake - Re was about million, so i've such troubles with convergence.


All times are GMT -4. The time now is 12:36.