CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   checkMesh (http://www.cfd-online.com/Forums/openfoam-programming-development/123667-checkmesh.html)

belkadi September 18, 2013 09:20

checkMesh
 
1 Attachment(s)
Dear Foamers,

I've a question regarding the checkMesh tool.
After creating my geomertry, It runs without any errors the blockMesh and I well presented my required geometry in ParaFoam.
Howver, I wanted to verify the mesh before doing any calculations by using the checkMesh.
I've an error message : Failed 1 mesh checks.
Is it an error to take into consideration or ignore it ? I thinks that something went wrong with the mesh but I don't know exactely what is it ! I've read the checkMesh report but without any help
Any helps please is welcome !
example in attached file

Thanks in advance

Kind regards

Krimo

GerhardHolzinger September 19, 2013 10:02

1 Attachment(s)
Your block definition is a little messed up, see the attached image.

What are the points 10, 13, 14 and 17 for? Edit your blockMeshDict so that you don't have any superflous points left.

BTW: I used pyFoamDisplayBlockMesh to visualize your block definition. That's a great tool to troubleshoot the block definition. It works, even when blockMesh fails to create a mesh, other than paraView.

belkadi September 19, 2013 12:51

1 Attachment(s)
Dear Gerhard Holzinger
Thank you very much for your reply.
What a powerful tool the pyFoam !!! Excellent
I'll try to install it on my computer.
The vertices 10 14 13 17 are used to define the left wall.
Do you thinks it's okay ?
Following your picture I've corrected the 13 and 17 vertices, but I still got a message fail with the checkMesh !
By the way, could you please check again my corrections.
I'll try to install the pyFoam on my computer.

Many thanks for your precious informations.
Kind regards

Krimo

GerhardHolzinger September 19, 2013 13:36

2 Attachment(s)
I'm sorry to tell you, that it does not work that way.

If you check the output of checkMesh, you will see, that there are two unconnected regions.

I am not a hundred percent sure if you can use points to define a face which are not part of a block definition. The points 10, 13, 14 and 17 are not part of your block definitions, so I would not use them to define patches.


Study the attached image. This reflects your key problem - connecting the small block to the large one.

The block ( 0 1 2 3 4 5 6 7 ) corresponds to the middle one of the large blocks.

The block ( 8 9 10 11 12 13 14 1 5 ) corresponds to the small block.


You connect the two blocks with the keyword mergePatchPairs.

Code:

boundary
(
master
{
type patch ;
faces
(
(1 2 6 5)
);
}
slave
{
type patch ;
faces
(
( 12 15 11 8 )
);
}
...


Code:

mergePatchPairs
(
( master slave )
);


belkadi September 20, 2013 04:10

Dear Gerhard Holzinger,

Again thank you for your useful informations.
I'll follow your suggestions to create two blocks and use the mergePatachesPairs.
I've only one question, I'll be very happy if your reply to it.
I'll use the mesh from your last picture.
Theb lock (8 9 10 11 12 13 14 15) I'll use it for example as an injector with air.
The block (0 1 2 3 4 5 6 7) will contain water for example.
I'll use the interFoam to simulate mixing water with air.
To define the right wall should I use the (1 5 6 2) ? As the left wall (0 4 7 3)
Or Define the right wall as : (5 12 8 1)
(1 8 11 2)
(2 11 15 6)
(5 12 15 6)

Kind regards

Many thanks

Krimo

GerhardHolzinger September 20, 2013 04:44

Quote:

To define the right wall should I use the (1 5 6 2) ? As the left wall (0 4 7 3)
Yes, this is the way to do it.

Then you define the left face of the small block as a patch and use mergePatchPairs to connect the two blocks.

What will happen is, that all the faces of the smaller patch (12 15 11 8) will be used to remove faces from the patch (1 2 6 5).

In the end, the small patch (12 15 11 8) will disappear, and the right wall of the large block, will have a hole.

Then, checkMesh will report only 1 region.

checkMesh will most probably report some errors due to the mesh modifications, e.g. concave cells. But that's another story.

belkadi September 20, 2013 04:49

Excellent !
I'll follow all these precious suggestions.
Will be back !

Many thanks

Krimo

belkadi September 20, 2013 05:28

1 Attachment(s)
I've modified my file.

When I use in the end of the blockMeshDict file the patches key word it works.
But when using the mergePatchPairs it doesn't work !
Could you please check the error for me. I don't understand the error source !

Thanks and apologies for the very basic questions !

Kind regards

Krimo

GerhardHolzinger September 20, 2013 05:52

I don't mean to be mean, but

read the error message!


Code:

--> FOAM FATAL ERROR:
Patch named leftwall not found.
Available patch names:
8
(
slave
inlet
leftWall
rightWall
upperWall
lowerWall
frontAndBack
defaultFaces
)


Can you find the problem?

belkadi September 20, 2013 06:21

:) ohhh
I've used leftwall instead leftWall
Many thanks ! now it works !
Now I can continue to thinks how I can solve the problem !
I'll not forget your help

Kind regards

Krimo

belkadi September 20, 2013 06:22

Just to add;

When I used the checkMesh,
I've Failed 2 mesh chacks. I'll see if I can ignore this
The blockMesh works

GerhardHolzinger September 20, 2013 07:04

In my test case (two blocks that are connected with mergePatchPairs) checkMesh reports no errors and checkMesh -allGeometry -allTopology reports two errors (concave cells and face tets).

I assume that this comes from the hanging nodes - or something similar.

Maybe someone that is more into the whole mesh generation thing can comment on that one.

belkadi September 20, 2013 08:02

I don't know if I can ignore these errors or try to fix it ?
If not how I can do it ? redfine the vertices of small block ?

GerhardHolzinger September 20, 2013 08:14

The errors are about the cells that result from the way blockMesh connects the two blocks.

Let me try some ascii, ignore the grey x'es.

o----o
|xxx |
|xxx o---o
|xxx |xx |
o----o---o


You see two cells, that are connected. The left cell has five nodes (the four corner nodes and the hanging node), whereas the right cell has only four. checkMesh will report the left cell as concave, because there are faces with parallel face normal vectors (the green and the blue face). However, there is nothing wrong with this cell.

If we - manually modify the location of the nodes, we get rid of the error

o----o
| xxx \
| xxxx o--o
| xxx / xs |
o----o-----o

Now we have moved the hanging node with the result, that the face normal vectors of the green and the blue faces are not parallel anymore.


You can try this if you connect two blocks that are meshed with only one cell. Then you can easily play around with the node coordinates.

belkadi September 20, 2013 09:16

1 Attachment(s)
I'm afraid, but I don't think that I've well understood your answer.
I've well meshed the two blocks with only one cell, the results is in attached file.
Should I change the coordinates of the face (1 5 6 2) ?
I don't think that I've got the message clearly to apply it to my own case.

Sorry for stupid questions !

Kind regards

Krimo

GerhardHolzinger September 20, 2013 09:38

1 Attachment(s)
Sorry, use 2 cells for the blocks, then you can play with the node coordinates.

Using 1 cell gives garbage results.

belkadi September 20, 2013 09:46

Where can I find the node coordinate ?
Is it inside the generated file points (created in the polymesh repository)
or it's simply the (1 2 6 5) vertices ?

GerhardHolzinger September 20, 2013 10:05

It's in the points file. This file is a list of coordinates.

There, the coordinates of the node X are at the X-th entry of this list.

belkadi September 20, 2013 10:15

Ok, So if I'll understood I've to find the hanging node in this file to modify it from the :
o----o
|xxx |
|xxx o---o
|xxx |xx |
o----o---o

to the following form :

o----o
| xxx \
| xxxx o--o
| xxx / xs |
o----o-----o

Right ?

belkadi September 20, 2013 10:44

1 Attachment(s)
Should I modify the cells coordinates which have a triangular form to a rectangular form ? This is what you mean ?
Sorry, I'm new with this issues and with openfoam.
I believe that it's a very basic questions but I want really to understand and learn.

Kind regards

Krimo


All times are GMT -4. The time now is 00:49.