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

Combining multiple mesh blocks

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

LinkBack Thread Tools Display Modes
Old   August 11, 2014, 19:10
Default Combining multiple mesh blocks
New Member
Ingo Jahn
Join Date: Aug 2014
Location: Australia
Posts: 1
Rep Power: 0
ingojahn is on a distinguished road

I am currently trying to write a simple mesh converter from our in-house grid generator e3prep to OpenFoam.
e3prep, is a multi-block meshing tools, that generates the mesh as a multitude hexahedra, each of which has its own internal mesh structure. These blocks are then linked at the interfaces, through face matching.

Now I want to create the ability to convert these multi-block meshes into an OpenFoam mesh.

What I have done so far: (and this works)
For a mesh consisting of a single block, I have written an output function (in python) for our meshing tool, which directly writes files in the /Polymesh folder (boundary, faces, owner, points, neighbour). Boundaries are automatically defined as North, South, East, West, Top, Bottom.

What i want to do:
Now if I have a multi-block mesh, I want to combine all the blocks into a single OpenFoam mesh.

Option 1: (this works, but becomes tedious as number of blocks increases)
I run the following sequence of commands (bnnnn are names of respective blocks)
mergeMeshes b0000 b0001 -overwrite
createPatch (together with createPatchDict, to combine respective patches on the blocks)
stitchMesh internal1 internal2 -perfect -overwrite
Repeat the above until I have added all the blocks. Obviously this works for 2-3 blocks and could be scripted, but once you start to add 20-30 blocks this becomes tedious and error prone

Option 2: (not tried yet)
Rather than writing the individual files within the /PolyMesh folder, I could write a script to create a "blockMeshDict" file.
Effectively I would turn each individual cell from each of my block into an individual hex e.g.[hex (0 1 2 3 4 5 6 7)(1 1 1) simpleGrading(1 1 1)].
Then use the mergePatchPairs to connect the internal faces.

At the moment I am leaning towards option 2, as this is more universal.
However before proceeding, I just wanted to check that I haven't overlooked some obvious solution.

Thanks for your help.
ingojahn is offline   Reply With Quote

Old   August 18, 2014, 03:19
Senior Member
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 211
Rep Power: 19
GerhardHolzinger will become famous soon enoughGerhardHolzinger will become famous soon enough
I followed option 2 for my meshes, for which I did the deconstruction into blocks manually with pencil and paper. For domains with some sort of regularity this works pretty well, e.g. a largely axi-symmetric 3d domain.
Attached Images
File Type: jpg stirredTank_aeratorRotor_cut.jpg (77.7 KB, 22 views)
GerhardHolzinger is offline   Reply With Quote


Thread Tools
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
sliding mesh problem in CFX Saima CFX 45 September 22, 2015 10:53
[ICEM] Fine mesh of Local block methods. Sheyko ANSYS Meshing & Geometry 0 January 29, 2014 11:35
snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Native Meshers: snappyHexMesh and Others 2 March 27, 2011 21:11
external flow with snappyHexMesh chelvistero OpenFOAM 11 January 15, 2010 20:43
Icemcfd 11: Loss of mesh from surface mesh option? Joe CFX 2 March 26, 2007 18:10

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