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

channelFoam for a 3D pipe

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 7, 2010, 14:01
Default channelFoam for a 3D pipe
  #1
Senior Member
 
Robert Sawko
Join Date: Mar 2009
Posts: 117
Rep Power: 22
AlmostSurelyRob will become famous soon enough
Dear All,

I would value your advice on the case I am trying to set up. Basically I wish to adapt channelFoam tutorial to a certain type of 3D pipeline mesh. (see attached).

I believe I have already sorted out the meshing. However blockMesh still gives me an output with warnings about negative volumes.

Code:
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  1.7.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 1.7.1-03e7e056c215
Exec   : blockMesh
Date   : Dec 07 2010
Time   : 17:44:19
Host   : soli31888c
PID    : 28450
Case   : /home/c111269/OpenFOAM/c111269-1.7.1/cases
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

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


Creating block mesh from
    "/home/c111269/OpenFOAM/c111269-1.7.1/cases/constant/polyMesh/blockMeshDict"


Creating blockCorners

Creating curved edges

Creating blocks

Creating patches

Creating block mesh topology
--> FOAM Warning : 
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.666667 for face 0
--> FOAM Warning : 
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.666667 for face 1
--> FOAM Warning : 
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.666667 for face 2
--> FOAM Warning : 
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.666667 for face 3
--> FOAM Warning : 
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.666667 for face 4
--> FOAM Warning : 
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.666667 for face 5
--> FOAM Warning : 
    From function blockMesh::createTopology(IOdictionary&)
    in file createTopology.C at line 397
    negative volume block : 0, probably defined inside-out
--> FOAM Warning : 
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.5 for face 0
--> FOAM Warning : 
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.5 for face 1
--> FOAM Warning : 
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.5 for face 2
--> FOAM Warning : 
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.5 for face 3
--> FOAM Warning : 
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.333333 for face 4
--> FOAM Warning : 
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.666667 for face 5
--> FOAM Warning : 
    From function blockMesh::createTopology(IOdictionary&)
    in file createTopology.C at line 397
    negative volume block : 1, probably defined inside-out
--> FOAM Warning : 
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.5 for face 0
--> FOAM Warning : 
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.5 for face 1
--> FOAM Warning : 
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.5 for face 2
--> FOAM Warning : 
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.5 for face 3
--> FOAM Warning : 
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.333333 for face 4
--> FOAM Warning : 
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.666667 for face 5
--> FOAM Warning : 
    From function blockMesh::createTopology(IOdictionary&)
    in file createTopology.C at line 397
    negative volume block : 2, probably defined inside-out
--> FOAM Warning : 
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.5 for face 0
--> FOAM Warning : 
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.5 for face 1
--> FOAM Warning : 
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.5 for face 2
--> FOAM Warning : 
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.5 for face 3
--> FOAM Warning : 
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.333333 for face 4
--> FOAM Warning : 
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.666667 for face 5
--> FOAM Warning : 
    From function blockMesh::createTopology(IOdictionary&)
    in file createTopology.C at line 397
    negative volume block : 3, probably defined inside-out
--> FOAM Warning : 
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.5 for face 0
--> FOAM Warning : 
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.5 for face 1
--> FOAM Warning : 
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.5 for face 2
--> FOAM Warning : 
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.5 for face 3
--> FOAM Warning : 
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.333333 for face 4
--> FOAM Warning : 
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -0.666667 for face 5
--> FOAM Warning : 
    From function blockMesh::createTopology(IOdictionary&)
    in file createTopology.C at line 397
    negative volume block : 4, probably defined inside-out

Default patch type set to empty

Check block mesh topology

        Basic statistics
                Number of internal faces : 8
                Number of boundary faces : 14
                Number of defined boundary faces : 14
                Number of undefined boundary faces : 0

        Checking patch -> block consistency

Creating block offsets

Creating merge list .

Creating points with scale 1

Creating cells

Creating patches

Creating mesh from block mesh

Default patch type set to empty

Writing polyMesh

End
I construct this mesh by creating the cube in the centre, adding the surrounding edges and than creating blocks for each section. Please, note that the number of outer and internal faces is correct.

Here's my blockMeshDict:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  1.7.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1;

vertices        
(
//internal square
    (0 -1 -1) //0
    (1 -1 -1) //1
    (1 -1  1) //2
    (0 -1  1) //3
    (0  1 -1) //4
    (1  1 -1) //5
    (1  1  1) //6
    (0  1  1) //7
//Going clockwise with sections
//North section
    (0  2  2) //8
    (0 -2  2) //9
    (1  2  2) //10
    (1 -2  2) //11
//East section
    (0  2 -2) //12
    (1  2 -2) //13
//South section
    (0 -2 -2) //14
    (1 -2 -2) //15
);

edges           
(
//North section
   arc  8  9 (0  0     2.82)
   arc 10 11 (1  0     2.82)
//East section
   arc  8 12 (0  2.82  0)
   arc 10 13 (1  2.82  0)
//South section
   arc 12 14 (0  0 -2.82 )
   arc 13 15 (1  0 -2.82 )
//West section
   arc 14  9 (0  -2.82 0)
   arc 15 11 (1  -2.82 0)
);

blocks          
(
//Centre
    hex (0 1 2 3 4 5 6 7) (32 48 48) simpleGrading (1 1 1)
//East section
    hex (7 6 2 3 8 10 11 9) (32 48 92) simpleGrading (1 1 0.25)
//East section
    hex (4 5 6 7 12 13 10 8) (32 48 92) simpleGrading (1 1 0.25)
//South section
    hex (0 1 5 4 14 15 13 12) (32 48 92) simpleGrading (1 1 0.25)
//West section
    hex (3 2 1 0 9 11 15 14) (32 48 92) simpleGrading (1 1 0.25)
);

patches         
(
    wall pipeWall
    (
        (9 11 10 8)
        (8 10 13 12)
        (12 14 15 13)
        (14 9 11 15)
    )
    cyclic cNorth
    (
        (9  3 7  8)
        (11 2 6 10)
    )
    cyclic cEast
    (
        (7  4 12  8)
        (6  5 13 10)
    )
    cyclic cSouth
    (
        (0 14 12 4)
        (1 5 13 15)
    )
    cyclic cWest
    (
        (0 14 9 3)
        (1 15 11 2)
    )
    cyclic cCentre
    (
        (0 4 7 3)
        (1 2 6 5)
    )
);

mergePatchPairs
(
);

// ************************************************************************* //

After setting up all other dictionaries, running channelFoam results in an error:

Code:
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  1.7.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 1.7.1-03e7e056c215
Exec   : channelFoam
Date   : Dec 07 2010
Time   : 17:46:09
Host   : soli31888c
PID    : 28478
Case   : /home/c111269/OpenFOAM/c111269-1.7.1/cases
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

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

Create mesh for time = 0

                                                                                                                                                                                    
Reading transportProperties                                                                                                                                                         
                                                                                                                                                                                    
Reading field p                                                                                                                                                                     
                                                                                                                                                                                    
Reading field U                                                                                                                                                                     
                                                                                                                                                                                    
Reading/calculating face flux field phi                                                                                                                                             
                                                                                                                                                                                    
Selecting incompressible transport model Newtonian                                                                                                                                  
Selecting LES turbulence model oneEqEddy                                                                                                                                            
oneEqEddyCoeffs                                                                                                                                                                     
{                                                                                                                                                                                   
    ce              1.048;                                                                                                                                                          
    ck              0.094;                                                                                                                                                          
}                                                                                                                                                                                   
                                                                                                                                                                                    
Initializing with 0 pressure gradient                                                                                                                                               
                                                                                                                                                                                    
                                                                                                                                                                                    
Starting time loop
                                                                                                                                                                                    
Reading/calculating field UMean                                                                                                                                                     
                                                                                                                                                                                    
Reading/calculating field pMean                                                                                                                                                     
                                                                                                                                                                                    
Reading/calculating field UPrime2Mean                                                                                                                                               

Reading/calculating field pPrime2Mean

fieldAverage: starting averaging at time 0

Time = 0.02

Courant Number mean: 0.519785 max: 1.7088
#0  Foam::error::printStack(Foam::Ostream&) in "/home/c111269/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccDPOpt/libOpenFOAM.so"
#1  Foam::sigFpe::sigFpeHandler(int) in "/home/c111269/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccDPOpt/libOpenFOAM.so"
#2   in "/lib64/libc.so.6"
#3  void Foam::magSqr<Foam::SymmTensor<double>, Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<Foam::SymmTensor<double>, Foam::fvPatchField, Foam::volMesh> const&) in "/home/c111269/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccDPOpt/libincompressibleLESModels.so"
#4  Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::magSqr<Foam::SymmTensor<double>, Foam::fvPatchField, Foam::volMesh>(Foam::tmp<Foam::GeometricField<Foam::SymmTensor<double>, Foam::fvPatchField, Foam::volMesh> > const&) in "/home/c111269/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccDPOpt/libincompressibleLESModels.so"
#5  Foam::incompressible::LESModels::oneEqEddy::correct(Foam::tmp<Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> > const&) in "/home/c111269/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccDPOpt/libincompressibleLESModels.so"
#6  Foam::incompressible::LESModel::correct() in "/home/c111269/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccDPOpt/libincompressibleLESModels.so"
#7  
 in "/home/c111269/OpenFOAM/OpenFOAM-1.7.1/applications/bin/linux64GccDPOpt/channelFoam"
#8  __libc_start_main in "/lib64/libc.so.6"
#9  
 at /usr/src/packages/BUILD/glibc-2.11.2/csu/../sysdeps/x86_64/elf/start.S:116
Floating point exception
which I guess means that it's diverging.

My questions are

1) Can I run channelFoam for any other geometry than channel?
2) Why do I get warnings about negative volumes?
3) Do I have to specify each cyclic patch separately?

Please let me know if you know of any other references on running 3D pipeline simulation in openFoam with cyclic boundary conditions. It would be great if you could advise me if I am on the right track at least with setting up my case.

Many thanks,
Robert
Attached Images
File Type: jpg mesh-type.jpg (39.2 KB, 260 views)
AlmostSurelyRob is offline   Reply With Quote

Old   December 7, 2010, 14:19
Default
  #2
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 22
MartinB will become famous soon enough
Hi Robert,

change your block definition to:
Code:
blocks          
(
//Centre
    hex (4 5 6 7 0 1 2 3) (32 48 48) simpleGrading (1 1 1)
//East section
    hex (8 10 11 9 7 6 2 3) (32 48 92) simpleGrading (1 1 0.25)
//East section
    hex (12 13 10 8 4 5 6 7) (32 48 92) simpleGrading (1 1 0.25)
//South section
    hex (14 15 13 12 0 1 5 4) (32 48 92) simpleGrading (1 1 0.25)
//West section
    hex (9 11 15 14 3 2 1 0) (32 48 92) simpleGrading (1 1 0.25)
);
Then the negative volumes are gone. Don't know about the rest, but may be it's running now...

Martin
MartinB is offline   Reply With Quote

Old   December 7, 2010, 14:41
Default
  #3
Senior Member
 
Robert Sawko
Join Date: Mar 2009
Posts: 117
Rep Power: 22
AlmostSurelyRob will become famous soon enough
Thanks Martin for such prompt and accurate reply. Yes the negative volumes were the issue. Now the simulation runs smoothly. I an eagerly waiting for some results now.

I am awfully sorry! Have I violated the right-hand side rule?
AlmostSurelyRob is offline   Reply With Quote

Old   June 24, 2011, 14:06
Default
  #4
New Member
 
Join Date: Oct 2010
Posts: 27
Rep Power: 16
albem is on a distinguished road
Hello

Could anybody help me to fix a grid for a square channel with curved edges?

Any reference is welcome

thanks in advance

Alberto
albem is offline   Reply With Quote

Reply

Tags
channelfoam, pipe


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
pipe in pipe heat exchanger JohannV FLUENT 3 December 3, 2009 03:53
CYCLIC BC in pipe flows matthias OpenFOAM 0 November 5, 2009 11:52
My Revised "Time Vs Energy" Article For Review Abhi Main CFD Forum 2 July 9, 2002 10:08
Terrible Mistake In Fluid Dynamics History Abhi Main CFD Forum 12 July 8, 2002 10:11
fluid flow fundas ram Main CFD Forum 5 June 17, 2000 22:31


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