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

[blockMesh] Prism Mesh with OpenFoam

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 15, 2013, 12:17
Default Prism Mesh with OpenFoam
  #1
New Member
 
Giancarlo
Join Date: Apr 2013
Location: Milan
Posts: 21
Rep Power: 12
Giancarlo_IngChimico is on a distinguished road
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
Giancarlo_IngChimico is offline   Reply With Quote

Old   April 15, 2013, 14:03
Default
  #2
Member
 
Yosmcer Mocktai
Join Date: Apr 2013
Location: Behind a computer
Posts: 50
Rep Power: 16
Yosmcer will become famous soon enough
  • 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
Yosmcer is offline   Reply With Quote

Old   August 29, 2013, 09:54
Default
  #3
Member
 
xuhe-openfoam
Join Date: Aug 2013
Location: DaLian,china
Posts: 82
Rep Power: 12
bieshuxuhe is on a distinguished road
Could you tell me how to use "prism" in blockMeshDict ?
I think maybe you have known it.
bieshuxuhe is offline   Reply With Quote

Old   August 29, 2013, 11:29
Default
  #4
Member
 
Yosmcer Mocktai
Join Date: Apr 2013
Location: Behind a computer
Posts: 50
Rep Power: 16
Yosmcer will become famous soon enough
Quote:
Originally Posted by Yosmcer View Post
  • 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 View Post
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)
Yosmcer is offline   Reply With Quote

Old   August 29, 2013, 11:38
Default
  #5
Member
 
xuhe-openfoam
Join Date: Aug 2013
Location: DaLian,china
Posts: 82
Rep Power: 12
bieshuxuhe is on a distinguished road
Thank you very much!
bieshuxuhe is offline   Reply With Quote

Old   October 7, 2013, 07:57
Default
  #6
Senior Member
 
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 21
zfaraday will become famous soon enough
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...

Last edited by zfaraday; October 7, 2013 at 08:03. Reason: Orthography and format adited.
zfaraday is offline   Reply With Quote

Old   October 18, 2013, 11:19
Default
  #7
Senior Member
 
ok
Join Date: Oct 2013
Posts: 346
Rep Power: 13
Maimouna is on a distinguished road
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
Maimouna is offline   Reply With Quote

Old   October 18, 2013, 17:22
Default
  #8
Member
 
Yosmcer Mocktai
Join Date: Apr 2013
Location: Behind a computer
Posts: 50
Rep Power: 16
Yosmcer will become famous soon enough
Quote:
Originally Posted by zfaraday View Post
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 View Post
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.
Yosmcer is offline   Reply With Quote

Old   March 24, 2014, 07:17
Default Documented
  #9
New Member
 
Richel Bilderbeek
Join Date: Nov 2013
Posts: 14
Rep Power: 12
assert is on a distinguished road
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)
    );
  }
);






__________________
I will never accept a 'Friend' request, I will always accept beer
assert is offline   Reply With Quote

Old   April 12, 2015, 10:48
Default
  #10
New Member
 
Nilotpole Kalita
Join Date: Oct 2014
Posts: 2
Rep Power: 0
nilotpole is on a distinguished road
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:rintStack(Foam::Ostream&) at ??:?
#1 Foam::sigSegv::sigHandler(int) at ??:?
#2 Uninterpreted:
#3 Foam::block::createPoints() const at ??:?
#4 Foam::block:oints() 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 is offline   Reply With Quote

Old   April 15, 2015, 04:13
Default
  #11
New Member
 
Nilotpole Kalita
Join Date: Oct 2014
Posts: 2
Rep Power: 0
nilotpole is on a distinguished road
can anyone please help me?

nilotpole
nilotpole is offline   Reply With Quote

Old   April 15, 2015, 04:32
Default
  #12
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
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
alexeym is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Map of the OpenFOAM Forum - Understanding where to post your questions! wyldckat OpenFOAM 10 September 2, 2021 06:29
How to contribute to the community of OpenFOAM users and to the OpenFOAM technology wyldckat OpenFOAM 17 November 10, 2017 16:54
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Meshing & Mesh Conversion 2 March 27, 2011 22:11
Convergence moving mesh lr103476 OpenFOAM Running, Solving & CFD 30 November 19, 2007 15:09


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