|August 11, 2014, 19:10||
Combining multiple mesh blocks
Join Date: Aug 2014
Posts: 1Rep Power: 0
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.
|August 18, 2014, 03:19||
Join Date: Feb 2012
Posts: 200Rep Power: 19
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.
|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|