CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

SimpleFoam Diverge on Coil HeatExchanger Tank

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 2, 2020, 15:24
Thumbs up SimpleFoam Diverge on Coil HeatExchanger Tank
  #1
New Member
 
Lionel Ivan's Avatar
 
Lionel Ivan
Join Date: May 2020
Location: Argentina, Buenos Aires
Posts: 2
Rep Power: 0
Lionel Ivan is on a distinguished road
Hello Foamers,
I've experimenting converge problems with SimpleFoam, my intention is to run a Forced Heat Convection Case (FCTest), at first with a variation of tutorial's room "movingFanInRoom". As it had multiple problems, I re-wrote all the case in a new type of problem: a coil heat exchange tank. Schematically something like:

Tube Coil Heat Exchanger schematic - Image

With FreeCAD, I build some kind of version for my new case:

FCTest-3 Body Like - Image

Check Mesh give me:

Code:
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  7
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
Build  : 7-1ff648926f77
Exec   : checkMesh
Date   : May 02 2020
Time   : 17:03:56
Host   : "3ece253b8250"
PID    : 366
I/O    : uncollated
Case   : /home/openfoam/run/FCTest-3
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

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

Create polyMesh for time = 0

Time = 0

Mesh stats
    points:           1793428
    faces:            4953396
    internal faces:   4722081
    cells:            1582927
    faces per cell:   6.1124
    boundary patches: 4
    point zones:      0
    face zones:       0
    cell zones:       0

Overall number of cells of each type:
    hexahedra:     1499468
    prisms:        3566
    wedges:        0
    pyramids:      0
    tet wedges:    8
    tetrahedra:    0
    polyhedra:     79885
    Breakdown of polyhedra by number of faces:
        faces   number of cells
            4   6538
            5   7291
            6   7064
            9   51660
           12   6368
           15   964

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
                   inLet      248      287  ok (non-closed singly connected)
                  outLet      574      597  ok (non-closed singly connected)
              conteiner2   162660   162769  ok (non-closed singly connected)
                helice-3    67833    77515      ok (closed singly connected)

Checking geometry...
    Overall domain bounding box (0.00299734 0.00299863 0.00299783) (0.297003 0.200038 0.503003)
    Mesh has 3 geometric (non-empty/wedge) directions (1 1 1)
    Mesh has 3 solution (non-empty) directions (1 1 1)
    Boundary openness (-9.65822e-17 -6.47508e-16 5.6816e-16) OK.
    Max cell openness = 3.58514e-16 OK.
    Max aspect ratio = 10.7391 OK.
    Minimum face area = 2.77567e-07. Maximum face area = 2.19009e-05.  Face area magnitudes OK.
    Min volume = 6.26419e-10. Max volume = 5.67002e-08.  Total volume = 0.0277642.  Cell volumes OK.
    Mesh non-orthogonality Max: 64.9115 average: 8.08358
    Non-orthogonality check OK.
    Face pyramids OK.
    Max skewness = 3.93848 OK.
    Coupled point location match (average 0) OK.

Mesh OK.

End
My boundaries are 4, "Conteiner2" is the rectangular tank, "helice-3" is Coil, "inLet" the upper hole, and the "outLet" side hole. You can see a list here (image version).

Here's how case mesh looks like - image

When I run simpleFoam at first instance to check that flows goes fine, k grows up (blows up) from time 9 to 13 approximately when Foam experiments floating point exception. K max initially is around 2.27e0 but then jumps above 5e+68.

I analysed results with paraFoam and found a singularity point (see image1 or image2) where flows accelerates x2 approximately without a physical reason. Then the acceleration expands to all container like a bomb, and also K. I made a few cuts of that region (you can see image gallery).

I think that is a kind of mistake with wall calculations because I've got same singularity in my previous case (the room) also in a wall corner.

I'm investigating Convergent factors, but I'm really new in CFD and also OpenFoam, so probably there is something that I'm not seeing right now.

I change my relaxation factors (lower), and decrease my time step. It works better, i could reach T=14 but still having the same problem.


Here's my last fvSchemes and fvSolution code:

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

solvers
{
    p_rgh
    {
        solver           GAMG;
        tolerance        1e-7;   //antes -7
        relTol           0.01;

        smoother         DICGaussSeidel;

    }
  
    p
    {
        solver          GAMG;
        tolerance       1e-06;  //antes -6
        relTol          0.01;
        smoother        GaussSeidel;
    }

    "(U|k|epsilon|h)"
    {
        solver 		smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-05; //antes -5
        relTol          0.01;
    }
}

SIMPLE
{
    nNonOrthogonalCorrectors 0;
    consistent      yes;

    residualControl
    {
        p               1e-2;
        U               1e-3;
        "(k|epsilon|omega|f|v2)" 1e-3;
    }
    pRefCell    0;
    pRefValue    0;
}

relaxationFactors
{
    equations
    {
        U               0.7; // 0.9 is more stable but 0.95 more convergent
	k		0.7;
	epsilon  	0.7;
        ".*"            0.7; // 0.9 is more stable but 0.95 more convergent
    }
}


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

ddtSchemes
{
    default         steadyState;
}

gradSchemes
{
    default         Gauss linear;
}

divSchemes
{
    default         none;
    div(phi,U)      bounded Gauss linearUpwind grad(U);
    div(phi,k)      bounded Gauss limitedLinear 1;
    div(phi,epsilon) bounded Gauss limitedLinear 1;
    div(phi,K)      bounded Gauss upwind;  
    div(phi,h)      bounded Gauss upwind; //limitedLinear 0.2
    // div(phi,omega)  bounded Gauss limitedLinear 1;
    // div(phi,v2)     bounded Gauss limitedLinear 1;
    div((nuEff*dev2(T(grad(U))))) Gauss linear;
    div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
    div(nonlinearStress) Gauss linear;
}

laplacianSchemes
{
    default         Gauss linear corrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}

wallDist
{
    method meshWave;
}


// ************************************************************************* //
I'm running OpenFoam 7 in Fedora Linux 31 inside a docker container, on a cuad-core Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz with 8 GB of Ram and 5 GB of Swap.

All case files you can find in this link.
Error Log is here.

I'll appreciate all kind of help or advices,
Thanks you in advance
__________________
Eng. Lionel Ivan

Last edited by Lionel Ivan; May 3, 2020 at 09:00.
Lionel Ivan is offline   Reply With Quote

Old   May 9, 2020, 12:36
Default
  #2
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 932
Rep Power: 12
HPE is on a distinguished road
Hi,

- Could you please execute the following to obtain a more detailed mesh quality info:

Code:
checkMesh -allGeometry -allTopology -latestTime
- Is the y1+ of the field of interest around or above 30 or less? The standard kEpsilon model is not derived for y1+ below 30, might consider a low-Re-type kEpsilon model?
- Sometimes, the kEpsilon closure model becomes numerically unstable for the initial steps even though every setting is plausible. Few suggestions:
- Change "gradSchemes" of velocity from:

Code:
gradSchemes
{
    default         Gauss linear;
}
to

Code:
gradSchemes
{
    default         Gauss linear;
    grad(U)        cellMDLimited Gauss linear 1;
}
- Change "divSchemes" for "k" and "epsilon" from

Code:
    div(phi,k)      bounded Gauss limitedLinear 1;
    div(phi,epsilon) bounded Gauss limitedLinear 1;
to (you can increase the constraints once your simulation is numerically stable)

Code:
    div(phi,k)      bounded Gauss upwind;
    div(phi,epsilon) bounded Gauss upwind;
- Please reduce "relaxationFactors" for "k" and "epsilon" until the stability is reached.

- Could you please try to use "kOmegaSST" instead?

Hope these help.
HPE is offline   Reply With Quote

Old   May 9, 2020, 18:03
Default
  #3
New Member
 
Lionel Ivan's Avatar
 
Lionel Ivan
Join Date: May 2020
Location: Argentina, Buenos Aires
Posts: 2
Rep Power: 0
Lionel Ivan is on a distinguished road
Hey HPE, thanks you for your reply! It's really useful for me.

Here I copy the output of CheckMesh Command:

Code:
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  7
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
Build  : 7-1ff648926f77
Exec   : checkMesh -allGeometry -allTopology -latestTime
Date   : May 09 2020
Time   : 21:45:23
Host   : "13ee4b67678f"
PID    : 202
I/O    : uncollated
Case   : /home/openfoam/run/FCTest-3
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

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

Create polyMesh for time = 120

Enabling all (cell, face, edge, point) topology checks.

Enabling all geometry checks.

Time = 120

Mesh stats
    points:           1793428
    faces:            4953396
    internal faces:   4722081
    cells:            1582927
    faces per cell:   6.1124
    boundary patches: 4
    point zones:      0
    face zones:       0
    cell zones:       0

Overall number of cells of each type:
    hexahedra:     1499468
    prisms:        3566
    wedges:        0
    pyramids:      0
    tet wedges:    8
    tetrahedra:    0
    polyhedra:     79885
    Breakdown of polyhedra by number of faces:
        faces   number of cells
            4   6538
            5   7291
            6   7064
            9   51660
           12   6368
           15   964

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
                   inLet      248      287  ok (non-closed singly connected) (0.130049 0.199705 0.0300393) (0.17004 0.200038 0.0699604)
                  outLet      574      597  ok (non-closed singly connected) (0.130075 0.0300683 0.502986) (0.169955 0.0699267 0.503003)
              conteiner2   162660   162769  ok (non-closed singly connected) (0.00299734 0.00299863 0.00299783) (0.297003 0.2 0.503)
                helice-3    67833    77515      ok (closed singly connected) (0.0685578 0.0185422 0.0936609) (0.231468 0.181481 0.40633)

Checking geometry...
    Overall domain bounding box (0.00299734 0.00299863 0.00299783) (0.297003 0.200038 0.503003)
    Mesh has 3 geometric (non-empty/wedge) directions (1 1 1)
    Mesh has 3 solution (non-empty) directions (1 1 1)
    Boundary openness (-9.65822e-17 -6.47508e-16 5.6816e-16) OK.
    Max cell openness = 3.58514e-16 OK.
    Max aspect ratio = 10.7391 OK.
    Minimum face area = 2.77567e-07. Maximum face area = 2.19009e-05.  Face area magnitudes OK.
    Min volume = 6.26419e-10. Max volume = 5.67002e-08.  Total volume = 0.0277642.  Cell volumes OK.
    Mesh non-orthogonality Max: 64.9115 average: 8.08358
    Non-orthogonality check OK.
    Face pyramids OK.
    Max skewness = 3.93848 OK.
    Coupled point location match (average 0) OK.
    Face tets OK.
    Min/max edge length = 4.43851e-05 0.0061257 OK.
   *There are 4977 faces with concave angles between consecutive edges. Max concave angle = 75.5406 degrees.
  <<Writing 4977 faces with concave angles to set concaveFaces
    Face flatness (1 = flat, 0 = butterfly) : min = 0.719631  average = 0.999484
   *There are 155 faces with ratio between projected and actual area < 0.8
    Minimum ratio (minimum flatness, maximum warpage) = 0.719631
  <<Writing 155 warped faces to set warpedFaces
    Cell determinant (wellposedness) : minimum: 0.084231 average: 7.07777
    Cell determinant check OK.
 ***Concave cells (using face planes) found, number of cells: 41229
  <<Writing 41229 concave cells to set concaveCells
    Face interpolation weight : minimum: 0.128579 average: 0.484793
    Face interpolation weight check OK.
    Face volume ratio : minimum: 0.103903 average: 0.924498
    Face volume ratio check OK.

Failed 1 mesh checks.

End

I've been investigating and decided to apply another turbulence model (I incorrectly thought that K-Epsilon would be easier for me as new user). Fortunately I had chosen KOmegaSST, and... It works! You are right!

I've been running for almost 6 hours so stopped it at Time = 120. Here last log of solver:

Code:
Time = 119.75

smoothSolver:  Solving for Ux, Initial residual = 0.0146202, Final residual = 0.00124374, No Iterations 5
smoothSolver:  Solving for Uy, Initial residual = 0.0112093, Final residual = 0.000941393, No Iterations 5
smoothSolver:  Solving for Uz, Initial residual = 0.018397, Final residual = 0.00159775, No Iterations 5
smoothSolver:  Solving for Ux, Initial residual = 0.014646, Final residual = 0.00125485, No Iterations 5
smoothSolver:  Solving for Uy, Initial residual = 0.0111445, Final residual = 0.000943403, No Iterations 5
smoothSolver:  Solving for Uz, Initial residual = 0.018326, Final residual = 0.00159918, No Iterations 5
GAMG:  Solving for p, Initial residual = 0.0404628, Final residual = 0.00258905, No Iterations 2
time step continuity errors : sum local = 0.00339386, global = -1.1418e-05, cumulative = -0.00979684
GAMG:  Solving for p, Initial residual = 0.0403479, Final residual = 0.00253144, No Iterations 2
time step continuity errors : sum local = 0.00332066, global = -1.16226e-05, cumulative = -0.00978542
smoothSolver:  Solving for omega, Initial residual = 0.00355531, Final residual = 0.000107591, No Iterations 2
smoothSolver:  Solving for k, Initial residual = 0.00909062, Final residual = 0.000515162, No Iterations 2
bounding k, min: -2.92472e-05 max: 0.0117795 average: 0.000501664
smoothSolver:  Solving for omega, Initial residual = 0.00355179, Final residual = 0.000107708, No Iterations 2
smoothSolver:  Solving for k, Initial residual = 0.00909774, Final residual = 0.00051932, No Iterations 2
bounding k, min: -6.34132e-05 max: 0.0117395 average: 0.00050137
ExecutionTime = 19099.2 s  ClockTime = 20090 s

Time = 120

smoothSolver:  Solving for Ux, Initial residual = 0.0146202, Final residual = 0.00124374, No Iterations 5
smoothSolver:  Solving for Uy, Initial residual = 0.0112093, Final residual = 0.000941393, No Iterations 5
smoothSolver:  Solving for Uz, Initial residual = 0.018397, Final residual = 0.00159775, No Iterations 5
GAMG:  Solving for p, Initial residual = 0.0404628, Final residual = 0.00258905, No Iterations 2
time step continuity errors : sum local = 0.00339386, global = -1.1418e-05, cumulative = -0.00979684
smoothSolver:  Solving for omega, Initial residual = 0.00355531, Final residual = 0.000107591, No Iterations 2
smoothSolver:  Solving for k, Initial residual = 0.00909062, Final residual = 0.000515162, No Iterations 2
bounding k, min: -2.92472e-05 max: 0.0117795 average: 0.000501664
--> FOAM Warning : 
    From function bool Foam::rmDir(const Foam::fileName&)
    in file POSIX.C at line 1069
    cannot open directory ""
ExecutionTime = 19086.6 s  ClockTime = 20110 s

End

--> FOAM Warning : 
    From function bool Foam::rmDir(const Foam::fileName&)
    in file POSIX.C at line 1069
    cannot open directory ""
ExecutionTime = 19130.1 s  ClockTime = 20122 s

End
I've uploaded six new images of paraFoam's velocity view. (Here's one)

Now I'll try run bouyantSimpleFoam to solve heat transfer. I'll tell you if I get success.

Finally, I will re-run kEpsilon model with your corrections.

Thanks you again!

PS: New fvSchemes and fvSolution configuration.

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

solvers
{
    p_rgh
    {
        solver           GAMG;
        tolerance        1e-7;   //antes -7
        relTol           0.1;

        smoother         DICGaussSeidel;

    }
  
    p
    {
        solver          GAMG;
        tolerance       1e-06;  //antes -6
        relTol          0.1;
        smoother        GaussSeidel;
    }

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

SIMPLE
{
    nNonOrthogonalCorrectors 0;
    consistent      yes;

    residualControl
    {
        p               1e-2;
        U               1e-3;
        "(k|epsilon|omega|f|v2)" 1e-3;
    }
    pRefCell    0;
    pRefValue    0;
}

relaxationFactors
{
    equations
    {
        U               0.9; // 0.9 is more stable but 0.95 more convergent
	k		0.9;
	epsilon  	0.9;
	omega		0.9;
        ".*"            0.9; // 0.9 is more stable but 0.95 more convergent
    }
}


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

ddtSchemes
{
    default         steadyState;
}

gradSchemes
{
    default         Gauss linear;
}

divSchemes
{
    default         none;
    div(phi,U)      bounded Gauss linearUpwind grad(U);
    div(phi,k)      bounded Gauss limitedLinear 1;
    div(phi,epsilon) bounded Gauss limitedLinear 1;
    div(phi,omega)  bounded Gauss limitedLinear 1;
    div(phi,v2)     bounded Gauss limitedLinear 1;
    div((nuEff*dev2(T(grad(U))))) Gauss linear;
    div(nonlinearStress) Gauss linear;
}

laplacianSchemes
{
    default         Gauss linear corrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}

wallDist
{
    method meshWave;
}


// ************************************************************************* //
__________________
Eng. Lionel Ivan
Lionel Ivan is offline   Reply With Quote

Reply

Tags
divergence, kepsilon, kepsilonmodel, simplefoam, simplefoam convergence

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ANSYS Fluent Sloshing in baffled tank simulation Fisya CFD Freelancers 2 August 27, 2019 17:55
coil tank yassoub FLUENT 0 September 14, 2017 09:40
simpleFoam parallel solver & Fluent polyhedral mesh Zlatko OpenFOAM Running, Solving & CFD 3 September 26, 2014 06:53
Mixing Tank using simpleFoam - PLEASE HELP! sbusmayer OpenFOAM Running, Solving & CFD 3 October 23, 2013 18:30
Emptying Tank simpleFoam idrama OpenFOAM 6 May 10, 2013 03:38


All times are GMT -4. The time now is 17:24.