CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Native Meshers: snappyHexMesh and Others (http://www.cfd-online.com/Forums/openfoam-meshing-snappyhexmesh/)
-   -   Solution Snappy Hex 2D Msh with Surface Layers and cyclic bc for symmetric geometry (http://www.cfd-online.com/Forums/openfoam-meshing-snappyhexmesh/118292-solution-snappy-hex-2d-msh-surface-layers-cyclic-bc-symmetric-geometry.html)

flexi182 May 24, 2013 08:38

Solution Snappy Hex 2D Msh with Surface Layers and cyclic bc for symmetric geometry
 
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!


All times are GMT -4. The time now is 17:12.