CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

Cyclic boundary condition in foam-extend 4.0

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 12, 2019, 10:01
Default Cyclic boundary condition in foam-extend 4.0
  #1
New Member
 
Ville
Join Date: Jun 2018
Posts: 2
Rep Power: 0
rellumeister is on a distinguished road
Hello!

I'm working on a result validation setup for a LES pipe flow using immersed boundary conditions to model the pipe wall. The idea is to loop an initially fully-developed and perturbed laminar flow profile through the pipe, so the cyclic neighbors are surprisingly the inlet and the outlet of the pipe.

I have produced a similar setup in OF5 with a body-fitted mesh using the following blockMeshDict file, boundary file and initial boundary conditions (please keep in mind, that the actual initial U-field is modified to the perturbed fully-developed profile and is not shown below. However, the boundary conditions apply):

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.1.0                                  |
|   \\  /    A nd           | Web:      http://www.OpenFOAM.com               |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/

FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
convertToMeters 1;
 
vertices        
(
    (  0  0  0 )          //0
    (  0  0  6. )          //1
        
    ( -0.2 -0.2  0 )               //2
    ( -0.2 -0.2  6. )        //3
    
    (  0.2 -0.2  0 )               //4
    (  0.2 -0.2  6. )        //5
    
    (  0.2  0.2  0 )               //6
    (  0.2  0.2  6. )        //7
    
    ( -0.2  0.2  0 )               //8
    ( -0.2  0.2  6. )        //9
        
    (  0.353553390593274  0.353553390593274  0 )           //10
    (  0.353553390593274  0.353553390593274  6. )    //11
    ( -0.353553390593274  0.353553390593274  0 )           //12
    ( -0.353553390593274  0.353553390593274  6. )    //13
    ( -0.353553390593274 -0.353553390593274  0 )           //14
    ( -0.353553390593274 -0.353553390593274  6. )    //15
    (  0.353553390593274 -0.353553390593274  0 )           //16
    (  0.353553390593274 -0.353553390593274  6. )    //17
); 

blocks          
(
    //Pipe blocks
    hex (2 4 6 8 3 5 7 9) (20 20 50) simpleGrading (1 1 1)          //0 inner block
    hex (16 10 6 4 17 11 7 5) (20 40 50) simpleGrading ( 1 9 1 )
    hex (10 12 8 6 11 13 9 7) (20 40 50) simpleGrading ( 1 9 1 )
    hex (12 14 2 8 13 15 3 9) (20 40 50) simpleGrading ( 1 9 1 )
    hex (14 16 4 2 15 17 5 3) (20 40 50) simpleGrading ( 1 9 1 )
    
);
 
 edges           
 ( 
      arc  10 12 (  0  0.5  0 ) 
      arc  11 13 (  0  0.5  6. ) 
     
      
      arc 12 14  ( -0.5  0  0 )   
      arc 13 15  ( -0.5  0  6. )  
     
      
      arc 14 16 ( 0  -0.5  0 )
      arc 15 17 ( 0  -0.5  6. )
      
      
     arc  16 10 (  0.5  0  0 )    
     arc  17 11 (  0.5  0  6. ) 
    
 );
boundary
(
     inlet
     {
          type cyclic;
           neighbourPatch outlet;
        
         faces
         (
             (2 4 6 8)
             (4 16 10 6)
             (10 12 8 6)
             (12 14 2 8)
             (14 16 4 2)
         
         );
     }
     
     outlet
     {
         type cyclic;
           neighbourPatch inlet;
           
           faces
         (    
             (3 5 7 9)
             (17 11 7 5)
             (11 13 9 7)
             (13 15 3 9)
             (15 17 5 3)
         );
     }

     walls
     {
         type wall;
         faces
         (    
             (10 11 17 16)
             
             (10 11 13 12)
             
             (12 13 15 14)
             
             
             (14 15 17 16)
         );
     
     }
);
 
mergePatchPairs 
(
);
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  5.x                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      binary;
    class       polyBoundaryMesh;
    location    "constant/polyMesh";
    object      boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

3
(
    inlet
    {
        type            cyclic;
        inGroups        1(cyclic);
        nFaces          3600;
        startFace       534400;
        matchTolerance  0.0001;
        transform       unknown;
        neighbourPatch  outlet;
    }
    outlet
    {
        type            cyclic;
        inGroups        1(cyclic);
        nFaces          3600;
        startFace       538000;
        matchTolerance  0.0001;
        transform       unknown;
        neighbourPatch  inlet;
    }
    walls
    {
        type            wall;
        inGroups        1(wall);
        nFaces          4000;
        startFace       541600;
    }
)

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

dimensions      [0 1 -1 0 0 0 0];

internalField   uniform (0 0 0);


boundaryField
{
   

    inlet
    {
        type cyclic;
        
    }
    
    outlet
    {
        type cyclic;
        
    }
  
    walls
    {
        type noSlip;
    }


}

// ************************************************************************* //
This setup, keeps the laminar profile for some time until it destabilizes. So, I wish to accomplish a similar setup in foam-extend using the immersed boundary method. While writing this, I have not yet managed to create the perturbed and developed flow profile for the immersed boundary method, but instead I am initializing a uniform flow field with potentialFoam. It seems as though Foam-extend's cyclic boundary condition has to be set differently (the neighbor cyclic faces being under the same boundary condition), and I have managed to get the setup to run with the following files (mind here that the cylinder wall is introduced as a .ftr file during simulation, so it cannot be clearly seen in the setup files):



Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.1.0                                  |
|   \\  /    A nd           | Web:      http://www.OpenFOAM.com               |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/

FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
convertToMeters 1;
   
vertices        
(
    (-0.7    -0.7    0)    //0
    (-0.7    0.7    0)    //1
    (0.7    0.7    0)    //2
    (0.7    -0.7    0)    //3
   
    (-0.7    -0.7    6)    //4
    (-0.7    0.7    6)    //5
    (0.7    0.7    6)    //6
    (0.7    -0.7    6)    //7
); 

blocks          
(
    //Pipe blocks
    hex (5 6 7 4 1 2 3 0) (20 20 42) simpleGrading (1 1 1)
);
 
edges           
(        
);

boundary
(
     inletOutlet
     {
          type cyclic;
        
         faces
         (
             (4 5 6 7)

             (3 2 1 0)
         );
     }
     
     walls
     {
         type patch;
         faces
         (    
             (2 3 7 6)
             
             (0 1 5 4)
             
             (0 4 7 3)
             
             (1 2 6 5)
         );
     }   
);
 
mergePatchPairs 
(
);
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | foam-extend: Open Source CFD                    |
|  \\    /   O peration     | Version:     4.0                                |
|   \\  /    A nd           | Web:         http://www.foam-extend.org         |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       polyBoundaryMesh;
    location    "constant/polyMesh";
    object      boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

3
(
    ibCylinder
    {
        type            immersedBoundary;
        nFaces          0;
        startFace       48320;

        internalFlow    no;
    }
    inletOutlet
    {
        type            cyclic;
        nFaces          800;
        startFace       48320;
        featureCos      0.9;
    }
    walls
    {
        type            patch;
        nFaces          3360;
        startFace       49120;
    }
)


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

dimensions      [0 1 -1 0 0 0 0];

internalField   uniform (0 0 1.0);


boundaryField
{
    ibCylinder
    {
        type immersedBoundary;
        refValue uniform (0 0 0);
        refGradient  uniform (0 0 0);
        fixesValue yes;

        setDeadCellValue   yes;
        deadCellValue      (0 0 0);

        value uniform (0 0 0);
    }

     inletOutlet
    {
        type cyclic;
    }
  
    walls
    {
        type slip;
    }
}
// ************************************************************************* //
At first, the velocity profile starts to develop into a parabolic shape. However, the flow velocity maximum stays at the initialized bulk value and as the simulation progresses the flow loses momentum, i.e. momentum is lost in time.


The immersed boundary should not be the problem here, since a similar setup with separate inlet and outlet conditions do in fact produce a parabolic velocity profile. So I am led to believe that the problem lies in the cyclic boundary condition.

Am I setting up the cyclic boundary condition correctly for foam-extend? Any great ideas?

Br. Ville
rellumeister is offline   Reply With Quote

Old   June 28, 2019, 07:49
Default
  #2
New Member
 
Thang
Join Date: Apr 2019
Posts: 5
Rep Power: 2
thang_cegroup is on a distinguished road
Do you find the answer yet ?
thang_cegroup is offline   Reply With Quote

Reply

Tags
cyclic boundary condition, foam extend 4.0

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
Using createPatch and cyclicAMI in FOAM Extend to create periodicbox manuc OpenFOAM Running, Solving & CFD 0 November 27, 2018 04:21
Setting up cyclic boundary condition KateEisenhower OpenFOAM Pre-Processing 6 January 11, 2017 18:17
Cyclic Boundary Condition Errors? nyflyer OpenFOAM Running, Solving & CFD 2 April 26, 2016 15:14
Basic Nozzle-Expander Design karmavatar CFX 20 March 20, 2016 09:44
[blockMesh] BlockMesh FOAM warning gaottino OpenFOAM Meshing & Mesh Conversion 7 July 19, 2010 15:11


All times are GMT -4. The time now is 20:45.