CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Problem understanding nFaces / startFace (https://www.cfd-online.com/Forums/openfoam/69786-problem-understanding-nfaces-startface.html)

Horus November 4, 2009 17:22

Beginners Problem: patch is not divisible by the number of cells
 
Hello,

I've been playing around with openfoam for some time (actually freefoam which is based on openfoam 1.5) and after having worked through the tutorials I want to start my own little pet case.
So far I've successfully created the geometry. It is 2D, with an inlet on side and an outlet on the other. There is a rectangle (balken) in the middle, all other boundaries are empty (frontAndBack). This is my blockMeshDict file.
Code:

FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    object      blockMeshDict;
}

convertToMeters 1;

vertices       
(
    (0 0 0)
    (10 0 0)
    (10 10 0)
    (0 10 0)
    (0 0 1)
    (10 0 1)
    (10 10 1)
    (0 10 1)

    (4 4 0)
    (6 4 0)
    (6 6 0)
    (4 6 0)

    (4 4 1)
    (6 4 1)
    (6 6 1)
    (4 6 1)

);

blocks         
(
    hex (0 1 2 3 4 5 6 7) (40 40 1) simpleGrading (1 1 1)  // global
    hex (8 9 10 11 12 13 14 15) (1 1 1) simpleGrading (1 1 1) // balken, the solid rectangle
);

edges         
(
);

patches       
(
    wall balken
    (
        (8 9 10 11)
        (12 13 14 15)
        (8 11 15 12)
        (11 10 14 15)
        (10 9 13 14)
        (8 9 13 12)
    )

    patch inlet
    (
        (0 3 7 4)
    )

    patch outlet
    (
        (2 6 5 1)
    )
    empty frontAndBack
    (
        (0 3 2 1)
        (4 5 6 7)
        (1 5 4 0)
        (3 7 6 2)
    )

);

mergePatchPairs
(
);

blockMesh gives no errors and the geometry in Paraview looks fine. However icoFoam complains:
Code:

This mesh contains patches of type empty but is not 1D or 2D
    by virtue of the fact that the number of faces of this
    empty patch is not divisible by the number of cells.

    From function emptyFvPatchField<Type>::updateCoeffs()
    in file /Users/florian/freeFoam/build/include/finiteVolume/../../../freefoam-0.1.0rc4/src/finiteVolume/fields/fvPatchFields/constraint/empty/emptyFvPatchField.C at line 148

What could be the problem here? Could it be that I put one block (balken) just over the the first one (which is my global domain)?

Thanks for any hints,

Florian

hjasak November 5, 2009 02:28

You did not define the empty patch correctly. This is meant for 2-D or 1-D, for the front and back plane: it means that the number of faces in the empty patch (for 2-D) should be twice the number of cells.

The code says this is not the case for you. Have a look at the mesh in paraview, switch on patch names and it should be obvious.

Enjoy,

Hrv

Horus November 5, 2009 06:57

Hello,
for me the mesh looks fine in Paraview. frontAndBack is a mesh that covers the two sides and "ceiling" and "floor", forming a kind of rectangular tunnel.
How do I define the number faces? The file boundary which contains the nFaces entry is created from the blockMesh utility, so there is no use to edit something there.
Sorry, I still don't see what is the problem here. Could you be a bit more detailed?

Thanks,

Florian

madad2005 November 5, 2009 07:15

Florian,

run it through checkMesh for more information.

Horus November 5, 2009 09:54

Ok, the complete checkMesh output is:

Code:

Create time

Create polyMesh for time = constant

Time = constant

Mesh stats
    points:          3370
    internal points:  0
    faces:            6486
    internal faces:  3120
    cells:            1601
    boundary patches: 4
    point zones:      0
    face zones:      0
    cell zones:      0

Number of cells of each type:
    hexahedra:    1601
    prisms:        0
    wedges:        0
    pyramids:      0
    tet wedges:    0
    tetrahedra:    0
    polyhedra:    0

Checking topology...
    Boundary definition OK.
    Point usage OK.
    Upper triangular ordering OK.
    Face vertices OK.
  *Number of regions: 2
    The mesh has multiple regions which are not connected by any face.
  <<Writing region information to "constant/cellToRegion"

Checking patch topology for multiply connected surfaces ...
    Patch              Faces    Points  Surface topology                 
    balken              6        8        ok (closed singly connected)     
    inlet              40      82      ok (non-closed singly connected) 
    outlet              40      82      ok (non-closed singly connected) 
    frontAndBack        3280    3362    ok (non-closed singly connected) 

Checking geometry...
    Overall domain bounding box (0 0 0) (10 10 1)
    Mesh (non-empty) directions (1 0 0)
    Mesh (non-empty, non-wedge) dimensions 1
    All edges aligned with or perpendicular to non-empty directions.
Trying to instantiate 'mpiPstreamImpl'
    Boundary openness (0 0 0) OK.
    Max cell openness = 0 OK.
    Max aspect ratio = 4 OK.
    Minumum face area = 0.0625. Maximum face area = 4.  Face area magnitudes OK.
    Min volume = 0.0625. Max volume = 4.  Total volume = 104.  Cell volumes OK.
    Mesh non-orthogonality Max: 0 average: 0
    Non-orthogonality check OK.
    Face pyramids OK.
    Max skewness = 0 OK.

Mesh OK.

End

At least there are a lot of OKs. ;-)
I guess:
Code:

  *Number of regions: 2
    The mesh has multiple regions which are not connected by any face.
  <<Writing region information to "constant/cellToRegion"

could indicate a problem. The cellToRegion file contains a dictionary with a lot 0, with a single 1 as the last entry.

But so far I'm still helpless...

Thanks your help,

Florian

Horus November 7, 2009 12:01

Dare to bump it up. Anybody any hint for me?

RBJ November 20, 2009 06:20

Maybe a bit late, but if you look at your empty frontAndBack, there might be a problem with the part of "balken" there. A small portion of your front and back sides are formed by global AND balken. Maybe you should merge the balken patches of this side as slaves to global as master:

Code:

mergePatchPairs
 

(
<frontAndBack> <balken> )
);



or without the <> or with the vertices in places of the name. I don't really know, but I think it's something like this

Horus November 21, 2009 03:34

My freeFoam (which is based on openFoam 1.5) says:

mergePatchPairs not currently supported.

Currently I'm running it on a Mac but since I'm about to migrate to Linux I'll try it again there with 1.6 in a couple of days.

Thanks,

Florian

Pat December 12, 2009 16:36

Hallo
Maybe somebody can help. I've got the same Problem. I have created (in ICEM)a 2D geometrie and Mesh for airfoil in canal. in Parawien the mesh ist 2D (no split in z direction) but wenn i run the case (rhoSimpleFoam) i've got the following error :
This mesh contains patches of type empty but is not 1D or 2D
by virtue of the fact that the number of faces of this
empty patch is not divisible by the number of cells.

From function emptyFvPatchField<Type>::updateCoeffs()
in file /Users/florian/freeFoam/build/include/finiteVolume/../../../freefoam-0.1.0rc4/src/finiteVolume/fields/fvPatchFields/constraint/empty/emptyFvPatchField.C at line 148
please tell me what kann i do?

RBJ December 13, 2009 12:26

IS the amount of cells in z-direction equal to 1?

Horus December 13, 2009 15:34

For my part: Yes (see my first posting). I have now upgraded from 1.5 to 1.6 on Linux but I get still the same error as Pat.

When I chang my blockMeshDict file to:
Code:

mergePatchPairs
(
 (<frontAndBack> <balken> )
);

as proposed by RBJ I get a segfault:
Code:

lorian@horus:~/OpenFOAM/run/canal> blockMesh
/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.6                                  |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 1.6-f802ff2d6c5a                                                     
Exec  : blockMesh                                                           
Date  : Dec 13 2009                                                         
Time  : 21:34:12                                                             
Host  : horus                                                               
PID    : 5105                                                                 
Case  : /home/florian/OpenFOAM/run/canal                                     
nProcs : 1                                                                   
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).           

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


Creating block mesh from
    "/home/florian/OpenFOAM/run/canal/constant/polyMesh/blockMeshDict"


Creating blockCorners

Creating curved edges

Creating blocks

Creating patches

Creating block mesh topology

Default patch type set to empty

Check block mesh topology

        Basic statistics
                Number of internal faces : 0
                Number of boundary faces : 12
                Number of defined boundary faces : 12
                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
Creating merge patch pairs

#0  Foam::error::printStack(Foam::Ostream&) in "/home/florian/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libOpenFOAM.so"
#1  Foam::sigSegv::sigSegvHandler(int) in "/home/florian/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libOpenFOAM.so"
#2  ?? in "/lib64/libc.so.6"
#3  main in "/home/florian/OpenFOAM/OpenFOAM-1.6/applications/bin/linux64GccDPOpt/blockMesh"
#4  __libc_start_main in "/lib64/libc.so.6"
#5  _start at /usr/src/packages/BUILD/glibc-2.9/csu/../sysdeps/x86_64/elf/start.S:116
Segmentation fault

Thanks,

Florian

Pat December 15, 2009 14:33

Thank you RBJ for your reply. i ve found my error now my mesh work fine.
I haved make mistake ICEM. I ve not correctly select the mesh for frontAndback someone was merged with internalMesh.


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