CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Native Meshers: snappyHexMesh and Others

Solution Snappy Hex 2D Msh with Surface Layers and cyclic bc for symmetric geometry

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

Reply
 
LinkBack Thread Tools Display Modes
Old   May 24, 2013, 08:38
Default Solution Snappy Hex 2D Msh with Surface Layers and cyclic bc for symmetric geometry
  #1
New Member
 
Felix
Join Date: Aug 2012
Posts: 7
Rep Power: 5
flexi182 is on a distinguished road
Dear Foamers,

1 week till now I tried to generate a 2D Mesh with snappyHexMesh. The mesh should have surface layers and cyclic boundaries.
Now I will present my workflow. This solution only works for symmetric geometries because I used mirrorMesh!
If you have questions, please ask

Here is the shell script:

Code:
#!/bin/sh
 
# clean folders
cd small_snappy
rm constant/polyMesh/*.gz constant/polyMesh/boundary
rm -r 0
rm log.*
 
# background mesh
blockMesh > log.blockMesh # Only the half of the geometry get an backroundmesh because we want mirror it later
 
# snappyHexMesh 3D
renumberMesh -overwrite
snappyHexMesh -overwrite  > log.snappy
setSet -batch middlePlane.setSet -noSync # Cut through the mesh, we want a patch with boundary layers for Extrusion
subsetMesh -overwrite halfBoxSlaveCells
flattenMesh
 
# extrudeMesh 2D extrude
cd ../small_extrude
rm -r 0
rm -r constant/polyMesh/
rm log.*
extrudeMesh > log.extrude
mirrorMesh > log.mirror
autoPatch 50 -overwrite
 
# Rename and convert patches
kate 0/polyMesh/boundary 
createPatch -overwrite
checkMesh > log.mesh
cd ../
Have Fun!
flexi182 is offline   Reply With Quote

Reply

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



All times are GMT -4. The time now is 15:37.