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

simpleFoam + cyclic pipe = unstable?

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By RodriguezFatz
  • 2 Post By alexeym
  • 1 Post By RodriguezFatz

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 27, 2014, 06:25
Default simpleFoam + cyclic pipe = unstable?
  #1
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 27
RodriguezFatz will become famous soon enough
Hi all,

I usually use profile for U,k,epsilon,omega from cyclic pipe simulations as input for my actual case. Unfortunately, I don't get them converged in openFOAM.

So the setup is a short pipe that I mesh with ICEM:
grid.png

After loading the mesh to openFoam (fluent3dMeshtoFoam), I change the constant/polyMesh/boundary file to:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.3.x                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       polyBoundaryMesh;
    location    "constant/polyMesh";
    object      boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

3
(
    PER_PIPE_INLET
    {
        type            cyclic;
        nFaces          3060;
        startFace       170068;
        neighbourPatch    PER_PIPE_OUTLET;
    }
    PER_PIPE_OUTLET
    {
        type            cyclic;
        nFaces          3060;
        startFace       173128;
        neighbourPatch    PER_PIPE_INLET;
    }
    PER_PIPE_WALL
    {
        type            wall;
        inGroups        1(wall);
        nFaces          2584;
        startFace       176188;
    }
)
// ************************************************************************* //
Then, I change every boundary condition (p,U,k,epsilon) for the inlet and outlet in my 0/ directory to "cyclic":
Code:
PER_PIPE_INLET
    {
        type cyclic;
    }

    PER_PIPE_OUTLET
    {
        type cyclic;
    }
I set the system/fvOptions to
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.2.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

momentumSource
{
    type            pressureGradientExplicitSource;
    active          on;            //on/off switch
    selectionMode   all;       //cellSet // points //cellZone

    pressureGradientExplicitSourceCoeffs
    {
        fieldNames  (U);
        Ubar        ( 70 0 0 );
    }
}


// ************************************************************************* //
In this case, I use realizableKE model with wallfunctions for the pipe walls. But this whole problem also happens for wall resolved flow and other turbulence models.

This is how a typical residual plot looks like:
pressure.jpeg

So I get these crazy jumps in residuals and no smooth convergence at all. However, profiles of the solution look reasonable (here "U"):

U.png

What I already tried:
  • all different kinds of schemes, for gradient, with and without limiters, also for convective fluxes. Laplacian with and without correction... I think I tried every possible combination in that file...
  • solver settings, more or less tolerance, reducing relaxation factors,...
  • changing initial conditions
I know from a different thread, that others have comparable problems with channel flows + cyclic + simpleFoam.


Now: Can anyone please help me?
albet likes this.
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   November 27, 2014, 11:06
Default
  #2
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 27
RodriguezFatz will become famous soon enough
With the mappedPatch boundary I get pretty nice convergence, just as I expected:
pressure.jpeg
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   November 27, 2014, 13:05
Default
  #3
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

maybe I my guess on dimensions of the tube is not quite correct. Here's the case (attached to the message) with cyclic inlet/outlet and it seems to be converging (though rather slow). I've stopped simulation around 900th iteration (decided to reduce relTol of linear solvers and it seems to increase convergence rate), residuals evolution plot is also attached to the message.

As usual, mesh is in GEO format, so you need Gmsh to run the case.
Attached Images
File Type: png residuals.png (57.9 KB, 146 views)
Attached Files
File Type: gz tube-cyclic.tar.gz (62.1 KB, 99 views)
alexeym is offline   Reply With Quote

Old   November 27, 2014, 16:26
Default
  #4
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Though it seems, simulation got stuck at pressure residuals of order 1e-2.
RodriguezFatz and albet like this.
alexeym is offline   Reply With Quote

Old   November 28, 2014, 07:13
Default
  #5
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 27
RodriguezFatz will become famous soon enough
Right, it's always like "Yeahaaa it works!!! .... well... no..."
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   November 28, 2014, 07:42
Default
  #6
Member
 
Florian Ries
Join Date: Feb 2014
Location: Darmstadt, Germany
Posts: 88
Rep Power: 12
itchy is on a distinguished road
Hi Philipp,

I have the same problem with pipe. When I do the simulation with LES it works fine, but with RANS I don't get a convergent case.

For RANS I tried pimpleFoam and simpleFoam. The results looks not so bad (but not good enough), but the residuals are far from good.

How do you use mappedPatch boundary for pipeflow???
Do you use it with fvOptions??

kind regard
Florian
itchy is offline   Reply With Quote

Old   December 1, 2014, 04:53
Default
  #7
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 27
RodriguezFatz will become famous soon enough
Hi,

I changed the boundary file to
Code:
Inlet 
    { 
        type            mappedPatch;
        samplePatch    Outlet;
        sampleMode    nearestPatchFace;
        offsetMode uniform;
        offset (0 0 0.075); 
        nFaces 6180; 
        startFace 3689820; 
    } 
    Outlet 
    { 
               type patch;
               nFaces 6180; 
               startFace 3696000; 
    }
and deleted the fvOptions. "Offset" is obviously the offset between inlet and outlet.
Now, in my "0" directory I made some changes:
Velocity:
Code:
    Inlet
    {
        type mapped;
    value uniform (0 0 9.2);
    setAverage true;
    average (0 0 9.2);
    }
    Outlet
    {
        type inletOutlet;
    inletValue uniform (0 0 0);
    value uniform (0 0 0);
    }
Here, velocity will be regulated to an average of 9.2

pressure:
Code:
 
   Inlet
    {
        type            zeroGradient;
    }
    Outlet
    {
        type fixedValue;
        value uniform 0;
    }
All other values, such as "k":
Code:
    Inlet
    {
        type            mapped;
    value           uniform 1e-12;
    setAverage     false;
    average     1e-12;
    }
    Outlet
    {
        type         inletOutlet;
    inletValue     uniform 1e-12;
    value uniform     1e-12;
    }
I hope it works.
Philipp.
SHUBHAM9595 likes this.
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   December 1, 2014, 05:56
Default
  #8
Member
 
Florian Ries
Join Date: Feb 2014
Location: Darmstadt, Germany
Posts: 88
Rep Power: 12
itchy is on a distinguished road
Hi Philipp,

thx for your help.
k-epsilon works now. I will test some other models (k-omega, v2f ...).
I am a little bit confused why the cyclic bc + fvOptions does not work. I have done it with LES and everything works, but for RANS no chance.

kind regards
Florian
itchy is offline   Reply With Quote

Old   December 1, 2014, 06:17
Default
  #9
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 27
RodriguezFatz will become famous soon enough
I read a comment in this forum (don't know where) where someone states, that he thinks SIMPLE needs some kind of additional correction to work with cyclic. I don't know if that is true, but if PIMPLE / PISO works and SIMPLE doesn't it is at least some good idea...
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   December 1, 2014, 06:28
Default
  #10
Member
 
Florian Ries
Join Date: Feb 2014
Location: Darmstadt, Germany
Posts: 88
Rep Power: 12
itchy is on a distinguished road
Hi,

I have tested it with piso and pimple. The convergence was better but not good. With PISO/Pimple you can do some pseudo-timestepping. This improves your convergence. This works as well with the mapped bc. I will give it a shot and compare the rate of convergence.

I can live with your solution (using mapped boundary + SIMPLE).

kind regards
Florian
itchy is offline   Reply With Quote

Reply


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
How to setup cyclic BCs in simpleFOAM hhuang84 OpenFOAM Running, Solving & CFD 14 December 8, 2016 12:39
Possible createPatch/createBaffles bug? simpomann OpenFOAM Bugs 2 July 15, 2014 08:07
Problems with Cyclic & init. BCs for turbulent (k-eps) pipe flow florian_krause OpenFOAM 3 December 1, 2012 05:11
CYCLIC BC in pipe flows matthias OpenFOAM 0 November 5, 2009 11:52
Terrible Mistake In Fluid Dynamics History Abhi Main CFD Forum 12 July 8, 2002 10:11


All times are GMT -4. The time now is 07:42.