CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   vertice ordering? (http://www.cfd-online.com/Forums/openfoam/95548-vertice-ordering.html)

Bajji December 22, 2011 02:38

vertice ordering?
 
Hi,

I am trying to write the blockmeshDict file. can somebody please say how should i order my vertices?

1) where should my origin be in the block ? with the origin, I can figure out the direction using the right handed coordinate system but where to put my origin?
I have seen the user guide but no help in this..

Pl help. am getting tonnes of wrong oriented faces in checkMesh..

Bernhard December 22, 2011 03:09

The ordering of your points is not important. The ordering in the face and the hexes is. The face should be oriented such, the normal (defined via right-hand-rule) is pointing outward. In other wards: If you look from the inside out, you should order the point in a clockwise manner.

The numbering of the hexes is given in Fig 5.5: http://www.openfoam.org/docs/user/blockMesh.php

Have fun :)

Bajji December 22, 2011 05:29

Thanks for the reply.
Sorry i didn't put my question correctly. I try again:

1)in each hex block, i should start numbering from on vertex. How should i chose which vertex to start from? Once i know the starting vertex, I can start from there and move along the edges as shown in the user guide.

2) how should i orient the local co ordinate axis at the starting vertex? i can figure out that first i have to go along x(x1) , then in the direction of y(x2), finally in the direction of z(x3). After this i go along x and y in the new plane that is offset from the old one. But in which direction should i orient the local x axis in the first place?

Pl help.:(

Bajji December 23, 2011 06:09

origin of hex block
 
3 Attachment(s)
Hi ,

I am am still having the same problem. I am trying to mesh the space between 2 concentric cylinders and i couldn't figure out where to put the origin of each hex block.
I am ok with numbering scheme of faces, to have the normal pointing out.
In my attempts, I get a good mesh until 3 quadrants, shown in pic2. But when i join the fourth and final hex block to the third and first, I get blockmesh error:

--> FOAM FATAL IO ERROR:
ill defined primitiveEntry starting at keyword 'blocks' on line 40 and ending at line 115

file: /home/balaji/OpenFOAM/balaji-2.0.1/run/cc7/constant/polyMesh/blockMeshDict at line 115.

From function primitiveEntry::readEntry(const dictionary&, Istream&)
in file db/dictionary/primitiveEntry/primitiveEntryIO.C at line 165.

FOAM exiting

I have put the order of my origins in each block in pic 1 ( it is z=0 plane).
I have also posted my blockMeshDict. Some body pl help..

mturcios777 December 23, 2011 13:38

Make sure to read over your blockMesh file very carefully. Your blocks are defined just fine. You are missing a space on your last hex definition, between simpleGrading and the left parenthesis.

For future reference, when OF gives you an ill defined primitiveEntry error (in any input file), that means there is something wrong with the syntax, and you've likely missed a space/comma/colon/semicolon etc.

Bajji December 24, 2011 12:52

Thanks a lot.....
 
1 Attachment(s)
Thanks a thousand^thousand ton .
I got the mesh finally to look right. I didn't know blockMesh was so picky.
Thanks a lot mturcios777.
Have put a pic of my mesh below.

val46 March 29, 2012 02:30

Hi Bernhard,

Quote:

The ordering of your points is not important.
Are you sure about that?

The user guide says:

Quote:

- the x1 direction is described by moving from vertex 0 to vertex 1;
- the x2 direction is described by moving from vertex 1 to vertex 2;
I ordered my points in a different order and got tons of errors.


Best Regards,
Toni

Bernhard March 29, 2012 02:38

What you mention comes in only at the point where you define your blocks. This has to be consistent with the order in the vertices subdict. If you change the ordering in vertices, you have to change the numbers in your block and patch definitions.

val46 March 29, 2012 03:11

Hi Bernard,
thanks for your fast reply.
If I understand you right, it doesn't matter how I order my vertices as long as the new order matches the correct block definition.

My model consists of many blocks. I went back to just 2 blocks to see what I'm doing wrong:


Code:

convertToMeters 0.001;

vertices
(

    (0 0 0)
    (10 0 0)
    (30 0 0)

    (0 0 10)
    (10 0 10)
    (30 0 10)

    (0 8 0)
    (10 8 0)
    (30 8 0)

    (0 8 10)
    (10 8 10)
    (30 8 10)

);

blocks
(
    hex (0 1 4 3 6 7 10 9) (20 10 10) simpleGrading (1 1 1)
    hex (1 2 5 4 7 8 11 10) (10 10 10) simpleGrading (1 1 1)
);

edges
(
);

boundary
(
    inlet
    {
        type patch;
        faces
        (
            ( 0 6 9 3 )               
        );
    }
    outlet
    {
        type patch;
        faces
        (
            ( 2 8 11 5 )             
        );
    }
    sym_front
    {
        type symmetryPlane;
        faces
        (
            (0 1 4 3)
            (1 2 5 4)
        );
    }
    sym_back
    {
        type symmetryPlane;
        faces
        (
            ( 6 7 10 9 )
            ( 7 8 11 10 )
        );
    }
    sym_up
    {
        type symmetryPlane;
        faces
        (
            ( 3 4 10 9 )
            ( 4 5 11 10 )                               
        );
    }
    walls_solids
    {
        type wall;
        faces
        (
            ( 0 1 7 6 )
            ( 1 2 8 7 )
                             
        );
    }
);

mergePatchPairs
(
);

Now I get a mesh with these warnings:

Code:

--> 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: -133.3333 for face 0

My new guess is I have wrong face orientations. What do you think?

Bernhard March 29, 2012 03:18

Please make a sketch of your situation and follow the order in the as in the manual. You're now defining them the wrong way around:

Code:

hex( 0 1 7 6 3 4 10 9)
 hex( 1 2 8 7 4 5 11 10)

or
Code:

hex (0 3 4 1 6 9 10 7)
 hex(1 4 5 2 7 10 11 8)


val46 March 29, 2012 07:28

Finally...

I tried your first suggestion.
(I couldn't see how the second suggestion differs from my first try.)
It works, thank you!

Because of your help and the user guide i got it working.


All times are GMT -4. The time now is 14:36.