#!/bin/sh

cd ${0%/*} || exit 1

. $WM_PROJECT_DIR/bin/tools/RunFunctions
#runApplication chemkinToFoam chemkin/chem2.dat chemkin/thermo30.dat chemkin/transportProperties constant/reactions constant/thermo.compressibleGas

runApplication blockMesh



#runApplication topoSet
#runApplication subsetMesh -overwrite c0 -patch sides

#rm log.topoSet
#runApplication topoSet
#refineMesh -overwrite
#runApplication topoSet
#refineMesh -overwrite


#runApplication setFields

#------------------------------------------------------------------------------
echo -e "   - Extract the face zone in which the rapture disc is located"
topoSet >> logMeshing


#------------------------------------------------------------------------------
echo -e "   - Use the face zone to create 4 duplications of the internal faces"
echo -e "     2x cyclic and 2x walls"
createBaffles -overwrite >> logMeshing


#------------------------------------------------------------------------------
echo -e "   - Merge the two walls into one patch"
createPatch -overwrite >> logMeshing

runApplication decomposePar

mpirun -np 10 XiFoam -parallel
#runApplication rhoReactingFoam
#reactingFoam -postProcess -func yPlus


#------------------------------------------------------------------------------
