#!/bin/sh
cd ${0%/*} || exit 1    # Run from this directory

# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions


workDir=$FOAM_TUTORIALS/multiphase/interFoam/laminar/damBreak

cd $workDir

./Allclean; rm -f log*

cp $workDir/damBreak/system/decomposeParDict $workDir/damBreak/system/decomposeParDict.test

runApplication blockMesh -case damBreak
runApplication setFields -case damBreak

runApplication -s 1 decomposePar -case damBreak -dict damBreak/system/decomposeParDict -force
runApplication -s 2 decomposePar -case damBreak -dict damBreak/system/decomposeParDict.test -force
runApplication -s 3 decomposePar -case damBreak -dict $workDir/damBreak/system/decomposeParDict.test -force

runApplication -s 4 decomposePar -case $workDir/damBreak -dict damBreak/system/decomposeParDict -force
runApplication -s 5 decomposePar -case $workDir/damBreak -dict damBreak/system/decomposeParDict.test -force
runApplication -s 6 decomposePar -case $workDir/damBreak -dict $workDir/damBreak/system/decomposeParDict.test -force

cd damBreak
runApplication -s 7 decomposePar -force
runApplication -s 8 decomposePar -dict system/decomposeParDict -force
runApplication -s 9 decomposePar -dict system/decomposeParDict.test -force
