CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[blockMesh] Meshing a "triangle" with blockMesh

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

LinkBack Thread Tools Search this Thread Display Modes
Old   April 2, 2020, 12:04
Default Meshing a "triangle" with blockMesh
New Member
Marc Batlle
Join Date: Mar 2017
Posts: 9
Rep Power: 7
Marc Batlle is on a distinguished road
Good afternoon Foamers,

These days I am facing problems to mesh a triangular shape together with rectangle the way I want. I think the best explanation comes with a representative sketch.

I attach two images, the "OP_1" is what I am looking for, and, the "OP_2" what I obtain.

I already tried to mergePatchPair unsuccesfully, wondered about splitMesh but dismissed due to a lack of information ..

Any help is welcomed
Attached Files
File Type: pdf OP_1.pdf (32.2 KB, 76 views)
File Type: pdf OP_2.pdf (32.2 KB, 48 views)
Marc Batlle is offline   Reply With Quote

Old   April 2, 2020, 16:48
Senior Member
HPE's Avatar
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 932
Rep Power: 10
HPE is on a distinguished road
Any blockMeshDict, which doesn't work? Working over it might help.
HPE is offline   Reply With Quote

Old   April 3, 2020, 02:53
Bram Kerkhofs1
Join Date: Oct 2016
Posts: 30
Rep Power: 7
brammekeuh987 is on a distinguished road
Hi Marc

I would make two meshes: A rectangle (block1) and a parallelogram (block2). Then try to cut the parallelogram in 2, in order to get the triangle.

Cutting the mesh up, you can use splitMesh. To figure out how it works, type splitMesh -help in your terminal.
There you see something like this :
Usage: splitMesh [OPTIONS] <faceSet> <master> <slave> 
<faceSet>         The faces used for splitting                                                                          
<master>          The master patch name                                                                                 
<slave>           The slave patch name                                                                                
-case <dir>       Specify case directory to use (instead of the cwd)                                                    
-overwrite        Overwrite existing mesh/results files                                                                 
-doc              Display documentation in browser                                                                      
-help             Display short help and exit                                                                           
-help-compat      Display compatibility options and exit                                                                
-help-full        Display full help and exit                                                                                                                                                                                                  Splits mesh by making internal faces external at defined faceSet
At the top it says how to use it, completely on the bottom it says what it does. As you see, you need to get a faceSet.
You can use setSet for this, or topoSet. setSet does the same as topoSet, but if you google the topoSet wiki, it has a more complete explanation regarding the possibilities.
In order to define the domain, you can use a searchableBox, and make it of the dimensions so all the cells of the triangle are in there, and than filter the right faces out. I would do something like this:

cellSet of all cells in the triangle
cellSet inverted version of above cells (to invert it, you first need to copy it, and than invert it)
faceSet of the first cellSet
faceSet of the second cellSet
faceSet subset of first cellSet with second cellSet

So cut the mesh, and than use stitchMesh to stitch it.

Hope this helps!
brammekeuh987 is offline   Reply With Quote

Old   April 3, 2020, 04:52
Franco Marra
Join Date: Mar 2009
Location: Napoli - Italy
Posts: 67
Rep Power: 15
francescomarra is on a distinguished road
Dear Marc,

a possible solution could be to split the triangle (that is the real problem) into three subfigures as in the attached picture.

Best regards,


francescomarra is offline   Reply With Quote

Old   April 3, 2020, 10:40
New Member
Marc Batlle
Join Date: Mar 2017
Posts: 9
Rep Power: 7
Marc Batlle is on a distinguished road
Hello again and thanks for your replies,

I have been working on Bram's answer without success for the moment.

As requested, I attach a simple case only meshing the "triangle" which initially I define as a parallelogram with only 4 cells for simplicity. A topoSetDict file can also be found in /system with my interpretation from Bram's suggestions.

Thanks again.
Attached Files
File Type: gz case.tar.gz (3.7 KB, 20 views)
Marc Batlle is offline   Reply With Quote

Old   May 13, 2022, 13:31
New Member
M. Constanza Sadino Riquelme
Join Date: May 2022
Posts: 1
Rep Power: 0
sadinori is on a distinguished road
Hello Marc,

I want to create a similar mesh. Could you find a strategy for this?

Thank you
sadinori is offline   Reply With Quote


blockmesh, mergepatchpair, splitmesh, triangle

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
[ANSYS Meshing] Cooper Method Meshing RTN3000 ANSYS Meshing & Geometry 1 March 1, 2015 23:59
[ANSYS Meshing] Meshing strategy for External Flows Hybrid ANSYS Meshing & Geometry 0 January 24, 2012 14:27
[blockMesh] error Meshing a 3D cube geometry with blockMesh GodOfLove OpenFOAM Meshing & Mesh Conversion 5 July 14, 2009 15:30
Best Meshing scheme for Cylinder Nutrex Main CFD Forum 4 July 29, 2008 11:03
Volume Meshing & Face Meshing? singularity of grid ken FLUENT 0 September 4, 2003 11:08

All times are GMT -4. The time now is 18:03.