2 2

Next: Model setting without an Up: Alternative formulation Previous: Alternative formulation   Contents   Index

Script for Creating Mesh - Spiral Region

Following bash script can be used to run all at once. It is recommended to create file, e.g. buildMesh:

 

#!/bin/bash
# --------------------------------------------------------------------------- #
#   ==   ===  ==                                                              #
#  ||   ||=  || ))  support s. r. o. 2014, www.cfdsupport.com                 #
#   ==        ==                                                              #
# --------------------------------------------------------------------------- #

# check environment
if [[ $(echo $WM_PROJECT_VERSION |  cut -c1-3) != "2.3" ]]; then
    echo "You need OpenFOAM 2.3 to build the mesh."
    exit 0
fi

rm -rf 1 2 3 4 5 6 processor*
rm -f final *.log log.*


# echo "   - running fluent3DMeshToFoam"
# fluent3DMeshToFoam savka_low.msh | tee -a log > log.fluent3DMeshToFoam 2>&1 

echo "   - running surfaceFeatureExtract"
surfaceFeatureExtract | tee -a log > log.01.surfaceFeatureExtract 2>&1

echo "   - running blockMesh"
blockMesh | tee -a log >  log.02.blockMesh 2>&1

echo "   - running autoPatch"
autoPatch 40 | tee -a log >  log.03.autoPatch 2>&1

echo "   - running decomposePar"
decomposePar | tee -a log >  log.04.decomposePar 2>&1

echo "   - running snappyHexMesh"
mpirun -np 6 snappyHexMesh -parallel | tee -a log >  log.05.snappyHexMesh 2>&1

echo "   - running snappyHexMesh including boundary layer"
mpirun -np 6 snappyHexMesh -parallel -dict system/snappyHexMeshDict.addBL | tee -a log >  log.06.snappyHexMeshAddLayers 2>&1

echo "   - running reconstructParMesh"
reconstructParMesh -latestTime | tee -a log >  log.07.reconstructParMesh 2>&1

echo "   - running createPatch"
createPatch | tee -a log >  log.08.createPatch 2>&1

# echo "   - reordering patches"
# createPatch -dict system/createPatchDict.renamePatches | tee -a log > log.createPatch2 2>&1 
# 

echo "   - reordering boundary types"
changeDictionary | tee -a log > log.09.changeDictionary 2>&1 
 
echo "   - running renumberMesh"
renumberMesh -latestTime | tee -a log >  log.10.renumberMesh 2>&1

echo "   - running checkMesh"
checkMesh -latestTime | tee -a log >  log.11.checkMesh 2>&1
 
cp -rf 6/polyMesh/* constant/polyMesh/
 
ln -s 6 final

Script can be executed, e.g.: convertMesh

# sh convertMesh

pump cfd openfoam full snappyHexMesh 14
Figure: Water Pump complete snappyHexMesh model view. Two regions of computational model: rotor; stator;