2 2

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

Water Pump - Mesh Generation Script

All steps of mesh generation introduced in previous sections can be done using the following script, e.g. run-1-mesh:

 

#!/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

# partial meshes
cd meshFactory
for region in rotor stator; do
    cd mesh-$region
    echo
    echo "Create mesh for region \"$region\""
    ./convertMesh || exit -1
    rm -rf ../../constant/$region/polyMesh
    cp -R final/polyMesh ../../constant/$region/
    cd ..
done

echo