2012-04-15 17:43:52 +00:00
|
|
|
#!/bin/bash
|
2013-07-18 01:02:34 +00:00
|
|
|
#
|
2012-04-15 17:43:52 +00:00
|
|
|
#set -x
|
|
|
|
|
|
|
|
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
|
|
|
|
2013-07-18 01:02:34 +00:00
|
|
|
# Load additional RunFunctions
|
2012-04-15 17:43:52 +00:00
|
|
|
. ./RunFunctionsSupplemental
|
|
|
|
|
|
|
|
export caseName=`basename $PWD`
|
|
|
|
|
|
|
|
#We stop this script when we encounter a problem
|
2012-04-23 15:18:22 +00:00
|
|
|
#trap "exit -1" ERR
|
2012-04-15 17:43:52 +00:00
|
|
|
|
|
|
|
echo "$caseName: Creating the file blockMeshDict using m4"
|
|
|
|
(cd constant/polyMesh; m4 -P blockMeshDict.m4 > blockMeshDict)
|
|
|
|
|
|
|
|
echo "$caseName: Running blockMesh"
|
|
|
|
runApplicationAndReportOnError blockMesh
|
|
|
|
|
|
|
|
echo "$caseName: Updating the boundary file"
|
2012-04-23 15:18:22 +00:00
|
|
|
# Let's see if pyFoamChangeMixingPlaneBoundary.py is available
|
|
|
|
command -v pyFoamChangeMixingPlaneBoundary.py >/dev/null
|
|
|
|
if [ $? -eq 0 ];
|
|
|
|
then
|
|
|
|
echo "Using pyFoamChangeMixingPlaneBoundary.py"
|
|
|
|
pyFoamChangeMixingPlaneBoundary.py . upstreamMixingPlanePatch \
|
2013-07-18 01:43:15 +00:00
|
|
|
--shadowPatch downstreamMixingPlanePatch \
|
2013-08-19 21:17:41 +00:00
|
|
|
--zone upstreamMixingPlaneZone \
|
|
|
|
--ribbonPatchDiscretisation bothPatches \
|
|
|
|
--ribbonPatchStackAxis Z \
|
|
|
|
--ribbonPatchSweepAxis Theta \
|
2013-07-18 01:43:15 +00:00
|
|
|
--coordinateSystemType cylindrical \
|
|
|
|
--coordinateSystemOrigin "(0 0 0)" \
|
|
|
|
--coordinateSystemE1 "(1 0 0)" \
|
|
|
|
--coordinateSystemE3 "(0 0 1)"
|
2012-04-23 15:18:22 +00:00
|
|
|
|
|
|
|
pyFoamChangeMixingPlaneBoundary.py . downstreamMixingPlanePatch \
|
2013-07-18 01:43:15 +00:00
|
|
|
--shadowPatch upstreamMixingPlanePatch \
|
2013-08-19 21:17:41 +00:00
|
|
|
--zone downstreamMixingPlaneZone \
|
|
|
|
--ribbonPatchDiscretisation bothPatches \
|
|
|
|
--ribbonPatchStackAxis Z \
|
|
|
|
--ribbonPatchSweepAxis Theta \
|
2013-07-18 01:43:15 +00:00
|
|
|
--coordinateSystemType cylindrical \
|
|
|
|
--coordinateSystemOrigin "(0 0 0)" \
|
|
|
|
--coordinateSystemE1 "(1 0 0)" \
|
|
|
|
--coordinateSystemE3 "(0 0 1)"
|
2012-04-23 15:18:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
echo "Using pyFoamChangeGGIBoundary.py"
|
|
|
|
pyFoamChangeGGIBoundary.py . upstreamPerio1 \
|
|
|
|
--shadowPatch upstreamPerio2 \
|
|
|
|
--rotationAxis "(0 0 1)" \
|
|
|
|
--rotationAngle 36 \
|
|
|
|
--zone upstreamPerio1Zone
|
|
|
|
|
|
|
|
pyFoamChangeGGIBoundary.py . upstreamPerio2 \
|
|
|
|
--shadowPatch upstreamPerio1 \
|
|
|
|
--rotationAxis "(0 0 1)" \
|
|
|
|
--rotationAngle -36 \
|
|
|
|
--zone upstreamPerio2Zone
|
|
|
|
|
|
|
|
pyFoamChangeGGIBoundary.py . downstreamPerio1 \
|
|
|
|
--shadowPatch downstreamPerio2 \
|
|
|
|
--rotationAxis "(0 0 1)" \
|
|
|
|
--rotationAngle 90 \
|
|
|
|
--zone downstreamPerio1Zone
|
|
|
|
|
|
|
|
pyFoamChangeGGIBoundary.py . downstreamPerio2 \
|
|
|
|
--shadowPatch downstreamPerio1 \
|
|
|
|
--rotationAxis "(0 0 1)" \
|
|
|
|
--rotationAngle -90 \
|
|
|
|
--zone downstreamPerio2Zone
|
|
|
|
else
|
|
|
|
echo "pyFoamChangeMixingPlaneBoundary.py is missing. Using the file constant/polyMesh/boundary.preconfigured"
|
|
|
|
cp constant/polyMesh/boundary.preconfigured constant/polyMesh/boundary
|
|
|
|
fi
|
|
|
|
|
2012-04-15 17:43:52 +00:00
|
|
|
|
|
|
|
echo "$caseName: Creating the starting time directory"
|
|
|
|
cp -r 0_orig 0
|
2013-08-19 21:17:41 +00:00
|
|
|
echo "$caseName: Creating zones for the mixingPlane"
|
|
|
|
runApplicationAndReportOnError setSet -batch setBatchMixingPlane
|
|
|
|
runApplicationAndReportOnError setsToZones -noFlipMap
|
|
|
|
mv log.setSet log.setSet_MixingPlane
|
|
|
|
mv log.setsToZones log.setsToZones_MixingPlane
|
2012-04-15 17:43:52 +00:00
|
|
|
|
|
|
|
runApplicationAndReportOnError setSet -batch setBatchGGIZone
|
|
|
|
runApplicationAndReportOnError setsToZones -noFlipMap
|
2013-08-19 21:17:41 +00:00
|
|
|
mv log.setSet log.setSet_GGIZone
|
|
|
|
mv log.setsToZones log.setsToZones_GGIZone
|
2012-04-15 17:43:52 +00:00
|
|
|
|
|
|
|
echo "$caseName: Running potentialFoam"
|
|
|
|
runApplicationAndReportOnError potentialFoam
|
|
|
|
|
|
|
|
echo "$caseName: Running simpleFoam"
|
|
|
|
runApplicationAndReportOnError simpleFoam
|
|
|
|
|
|
|
|
|