This repository has been archived on 2023-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
foam-extend4.1-coherent-io/tutorials/incompressible/simpleFoam/mixingPlaneAxial/Allrun

99 lines
3.9 KiB
Bash
Executable file

#!/bin/bash
#
#set -x
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Load additional RunFunctions
. ./RunFunctionsSupplemental
export caseName=`basename $PWD`
#We stop this script when we encounter a problem
#trap "exit -1" ERR
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"
# 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 \
--shadowPatch downstreamMixingPlanePatch \
--zone upstreamMixingPlaneZone \
--ribbonPatchDiscretisation bothPatches \
--ribbonPatchStackAxis Z \
--ribbonPatchSweepAxis Theta \
--coordinateSystemType cylindrical \
--coordinateSystemOrigin "(0 0 0)" \
--coordinateSystemE1 "(1 0 0)" \
--coordinateSystemE3 "(0 0 1)"
pyFoamChangeMixingPlaneBoundary.py . downstreamMixingPlanePatch \
--shadowPatch upstreamMixingPlanePatch \
--zone downstreamMixingPlaneZone \
--ribbonPatchDiscretisation bothPatches \
--ribbonPatchStackAxis Z \
--ribbonPatchSweepAxis Theta \
--coordinateSystemType cylindrical \
--coordinateSystemOrigin "(0 0 0)" \
--coordinateSystemE1 "(1 0 0)" \
--coordinateSystemE3 "(0 0 1)"
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
echo "$caseName: Creating the starting time directory"
cp -r 0_orig 0
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
runApplicationAndReportOnError setSet -batch setBatchGGIZone
runApplicationAndReportOnError setsToZones -noFlipMap
mv log.setSet log.setSet_GGIZone
mv log.setsToZones log.setsToZones_GGIZone
echo "$caseName: Running potentialFoam"
runApplicationAndReportOnError potentialFoam
echo "$caseName: Running simpleFoam"
runApplicationAndReportOnError simpleFoam