CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Native Meshers: blockMesh (http://www.cfd-online.com/Forums/openfoam-meshing-blockmesh/)
-   -   Prism Mesh with OpenFoam (http://www.cfd-online.com/Forums/openfoam-meshing-blockmesh/116224-prism-mesh-openfoam.html)

Giancarlo_IngChimico April 15, 2013 11:17

Prism Mesh with OpenFoam
 
Hi everybody,

does anybody know how to create a mesh with PRIMS instead of HEX in "blocks" in blockMeshDict?
Is there any guide online?
Thanks

Yosmcer April 15, 2013 13:03

  • If you want less faces (prism with triangular base), you can define the hex with two pair of points that are the same:

    ( 0 0 1 2 3 3 4 5 6)

    Will make you a prism with base 0 1 2.

    The same manipulations can lead to pyramids (with quad or triangular base).
  • If you want more faces, you can add some hex to en up with the wanted geometry (example, 6 triangular prism to have a hexagonal prism).


I'm a newbie in the cfd world, so I can have missed something.

The guides I know existing:

Official:
http://www.openfoam.org/docs/user/

Non official:
http://openfoamwiki.net/index.php

bieshuxuhe August 29, 2013 08:54

Could you tell me how to use "prism" in blockMeshDict ?
I think maybe you have known it.

Yosmcer August 29, 2013 10:29

Quote:

Originally Posted by Yosmcer (Post 420736)
  • If you want less faces (prism with triangular base), you can define the hex with two pair of points that are the same:

    ( 0 0 1 2 3 3 4 5)

    Will make you a prism with base 0 1 2 and the opposite face 3 4 5.

    The same manipulations can lead to pyramids (with quad or triangular base).
  • If you want more faces, you can add some hex to en up with the wanted geometry (example, 6 triangular prism to have a hexagonal prism).


I'm a newbie in the cfd world, so I can have missed something.

The guides I know existing:

Official:
http://www.openfoam.org/docs/user/

Non official:
http://openfoamwiki.net/index.php

There was a litle mistake, I corrected it here (I cannot edit the previous message as there is more than a month that it has been created.

Quote:

Originally Posted by bieshuxuhe (Post 448725)
Could you tell me how to use "prism" in blockMeshDict ?
I think maybe you have known it.

This is just a normal hex, but with the nodes collapsed:

hex ( 0 0 1 2 3 3 4 5) (a b c) simpleGrading (1 1 1)

bieshuxuhe August 29, 2013 10:38

Thank you very much!

zfaraday October 7, 2013 06:57

Hello Yosmcer!!

First of all I have to say that I'm a complete newbie in OpenFOAM (although I have read all the User's Guide).

I've been trying to generate a prism cell since a few days ago but i can't find the proper way. I read the way to collapse points in the Guide, some advices here in the forum coming from advanced users but I still have problems executing blockMesh. Here is my blockMeshDict file after having read how to implement a prism cell:

Code:

vertices
(
  ( 0  0  0  )
  ( 5  5  0  )
  ( 0  10 0  )
  ( 0  0  10 )
  ( 5  5  10 )
  ( 0  10 10 ) 

);

blocks
(
    prism ( 0 1 2 0 3 4 5 3 ) (1 1 1) simpleGrading (1 1 1)

);
edges
(
);
boundary
(
    inlet
    {
      type patch;
      faces
      (
          (0 0 1 2)
      );
    }
    outlet
    {
      type patch;
      faces
      (
          (3 5 4 3)
      );
    }
    walls
    {
      type wall;
      faces
      (
          (0 1 4 3)
          (1 2 5 4)
          (2 0 3 5)
      );
    }
    collapsed
    {
      type empty;
      faces
      (
          (0 3 3 0)
      );
    }
);
mergePatchPairs
(
);

As you can see, I applied an empty patch to the collapsed face as I understood I had to do according to the Guide. This is the error message I got:

--> FOAM FATAL ERROR:
face 0 in patch 0 does not have neighbour cell face: 4(0 0 1 2)

Thanks a lot in advance. And sorry for my english, english is not my mother tongue at all...

Maimouna October 18, 2013 10:19

Hi,

I did the changes for blockMeshDict for prism instead of hex as above in cavity. But, when I apply icoFoam, I got this following error (as shown in attached screenshot ).

Can you help me to solve the problem?
Are my steps correct?

Regards
Maimouna

Yosmcer October 18, 2013 16:22

Quote:

Originally Posted by zfaraday (Post 455459)
Hello Yosmcer!!

First of all I have to say that I'm a complete newbie in OpenFOAM (although I have read all the User's Guide).

Hello, I'm neither an advanced user. I made some try few days ago, but didn't found out what is the problem. I'll need to have some time to look at it further.

Quote:

Originally Posted by Maimouna (Post 457677)
Hi,
I got this following error (as shown in attached screenshot ).

Sorry, I can't see any screenshot. I think something goes wrong when you tried to attach it.

To display errors codes, I think the best is to use [CODE] tags.

assert March 24, 2014 07:17

Documented
 
Because I could not find a complete example (with image) of how to create prisms in block Mesh, I documented this myself.

Below I will paste the comment-stripped blockMeshDict of a two-prism cube, and an image that displays the resulting mesh its point and face indices. More details can be found at
http://richelbilderbeek.nl/ToolOpenFoamExample24.htm

Enjoy, assert

Code:

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

convertToMeters 1.0;

vertices
(
    (-1 -1 -1)
    ( 1 -1 -1)
    (-1  1 -1)
    ( 1  1 -1)
    (-1 -1  1)
    ( 1 -1  1)
    (-1  1  1)
    ( 1  1  1)
);

blocks
(
  hex (0 1 1 2 4 5 5 6) (1 1 1) simpleGrading (1 1 1)
  hex (2 1 1 3 6 5 5 7) (1 1 1) simpleGrading (1 1 1)
);

edges
(
);

boundary
(
  my_faces
  {
  type patch;
  faces
  (
      (0 1 1 2)
      (2 1 1 3)
      (0 4 6 2)
      (1 5 4 0)
      (3 7 5 1)
      (2 6 7 3)
      (4 5 5 6)
      (6 5 5 7)
    );
  }
);




http://richelbilderbeek.nl/ToolOpenFoamExample24.png



nilotpole April 12, 2015 09:48

Hi all,
I am trying to implement prism for the first time in my blockMesh. I am trying to create a cavity with negative slanted angles at the front and aft wall. My blockMesh file is:

vertices
(
(0 0 0)
(2.5 0 0)
(5 0 0)
(10 0 0)
(15 0 0)
(17.5 0 0)
(20 0 0)
(2.5 5 0)
(5 5 0)
(10 5 0)
(15 5 0)
(17.5 5 0)
(-5 10 0)
(5 10 0)
(10 10 0)
(15 10 0)
(40 10 0)
(-5 50 0)
(5 50 0)
(10 50 0)
(15 50 0)
(40 50 0)
(0 0 10)
(2.5 0 10)
(5 0 10)
(10 0 10)
(15 0 10)
(17.5 0 10)
(20 0 10)
(2.5 5 10)
(5 5 10)
(10 5 10)
(15 5 10)
(17.5 5 10)
(-5 10 10)
(5 10 10)
(10 10 10)
(15 10 10)
(40 10 10)
(-5 50 10)
(5 50 10)
(10 50 10)
(15 50 10)
(40 50 10)
);

blocks
(
prism (0 1 7 22 23 29) (10 10 1) simpleGrading (1 1 1)
prism (7 8 13 29 30 35) (10 10 1) simpleGrading (1 1 1)
hex (1 2 8 7 23 24 30 29) (10 10 1) simpleGrading (1 1 1)
hex (8 9 14 13 30 31 36 35) (10 10 1) simpleGrading (1 1 1)
hex (2 3 9 8 24 25 31 30) (10 10 1) simpleGrading (1 1 1)
hex (9 10 15 14 31 32 37 36) (10 10 1) simpleGrading (1 1 1)
hex (3 4 10 9 25 26 32 31) (10 10 1) simpleGrading (1 1 1)
prism (10 11 15 32 33 37) (10 10 1) simpleGrading (1 1 1)
hex (4 5 11 10 26 27 33 32) (10 10 1) simpleGrading (1 1 1)
prism (5 6 11 27 28 33) (10 10 1) simpleGrading (1 1 1)
hex (12 13 18 17 34 35 40 39) (10 10 1) simpleGrading (1 1 1)
hex (13 14 19 18 35 36 41 40) (10 10 1) simpleGrading (1 1 1)
hex (14 15 20 19 36 37 42 41) (10 10 1) simpleGrading (1 1 1)
hex (15 16 21 20 37 38 43 42) (10 10 1) simpleGrading (1 1 1)
);

edges
(
);

boundary
(
inlet
{
type patch;
faces
(
(12 34 39 17)
);
}
outlet
{
type patch;
faces
(
(16 21 43 38)
(18 17 39 40)
(19 18 40 41)
(20 19 41 42)
(21 20 42 43)
);
}

fixedWalls
{
type wall;
faces
(
(12 13 35 34)
(13 7 29 35)
(7 0 22 29)
(0 1 23 22)
(1 2 24 23)
(2 3 25 24)
(3 4 26 25)
(4 5 27 26)
(5 6 28 27)
(6 11 33 28)
(11 15 37 33)
(15 16 38 37)
);
}
frontin
{
type cyclic;
neighbourPatch backin;
faces
(
(22 23 29)
(29 30 35)
(23 24 30 29)
(30 31 36 35)
(24 25 31 30)
(31 32 37 36)
(25 26 32 31)
(32 33 37)
(26 27 33 32)
(27 28 33)
);
}
frontout
{
type cyclic;
neighbourPatch backout;
faces
(
(34 35 40 39)
(35 36 41 40)
(36 37 42 41)
(37 38 43 42)
);
}
backin
{
type cyclic;
neighbourPatch frontin;
faces
(
(1 0 7)
(8 7 13)
(2 1 7 8)
(9 8 13 14)
(3 2 8 9)
(10 9 14 15)
(4 3 9 10)
(11 10 15)
(5 4 10 11)
(6 5 11)
);
}

backout
{
type cyclic;
neighbourPatch frontout;
faces
(
(13 12 17 18)
(14 13 18 19)
(15 14 19 20)
(16 15 20 21)
);
}
);
mergePatchPairs
(
);

On typing blockMesh in the terminal i am getting the following error message:

Create time

Creating block mesh from
"/home/nilotpole/OpenFOAM/nilotpole-2.3.0/run/tutorials/compressible/sonicFoam/ras/cavitysup/constant/polyMesh/blockMeshDict"
Creating curved edges
Creating topology blocks
Creating topology patches

Creating block mesh topology

Check topology

Basic statistics
Number of internal faces : 17
Number of boundary faces : 46
Number of defined boundary faces : 46
Number of undefined boundary faces : 0
Checking patch -> block consistency

Creating block offsets
Creating merge list #0 Foam::error::printStack(Foam::Ostream&) at ??:?
#1 Foam::sigSegv::sigHandler(int) at ??:?
#2 Uninterpreted:
#3 Foam::block::createPoints() const at ??:?
#4 Foam::block::points() const at ??:?
#5 Foam::blockMesh::calcMergeInfo() at ??:?
#6 Foam::blockMesh::blockMesh(Foam::IOdictionary const&, Foam::word const&) at ??:?
#7
at ??:?
#8 __libc_start_main in "/lib/i386-linux-gnu/libc.so.6"
#9
at ??:?
Segmentation fault (core dumped)

Can anyone help me with my problem? I have been trying this for a long time, however, i am failing all the time.
Please help me.

nilotpole

nilotpole April 15, 2015 03:13

can anyone please help me?

nilotpole

alexeym April 15, 2015 03:32

Hi,

Can you please:

1. Attach blockMeshDict as an archive (or even archive of the case? usually it is not very convenient to check contents of dictionaries inside message body)

2. Post geometry you are trying to mesh. blockMesh is not the only mesh generator capable of producing hexagonal meshes compatible with OpenFOAM.

3. And finally if you comment out boundary definitions, the error becomes

Code:

--> FOAM FATAL ERROR:
Inconsistent point locations between block pair 0 and 2
    probably due to inconsistent grading.

    From function blockMesh::calcMergeInfo()
    in file blockMesh/blockMeshMerge.C at line 294.

FOAM exiting



All times are GMT -4. The time now is 21:33.