#!/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 pyFoamChangeGGIBoundary.py is available command -v pyFoamChangeGGIBoundary.py >/dev/null if [ $? -eq 0 ]; then echo "Using pyFoamChangeGGIBoundary.py" pyFoamChangeGGIBoundary.py . B_UPSTREAM \ --shadowPatch B_DOWNSTREAM \ --zone B_UPSTREAMZone \ --bridgeOverlap false pyFoamChangeGGIBoundary.py . B_DOWNSTREAM \ --shadowPatch B_UPSTREAM \ --zone B_DOWNSTREAMZone \ --bridgeOverlap false else echo "pyFoamChangeGGIBoundary.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 runApplication setSet -batch setBatchGgi runApplication setsToZones -noFlipMap echo "$caseName: Running addSwirlAndRotation" runApplicationAndReportOnError addSwirlAndRotation echo "$caseName: Running simpleFoam" runApplicationAndReportOnError simpleFoam echo "$caseName: Postprocessing" cd postProcessing # Find latest time directory latestAvailTimeDir=`foamInfoExec -case .. -times | tail -1` echo "Analysing results for time: $latestAvailTimeDir" # Run sample runApplicationAndReportOnError sample -case .. -latestTime # Adjust compareAll.gplt: replace "Case1.1" "??" by "Case1.1_GGI" "$latestAvailTimeDir" sed -i.old "s/\"Case1.1\".*$/\"$caseName\" \"$latestAvailTimeDir\"/g" compareAll.gplt # Run gnuplot to generate the comparison charts runApplicationAndReportOnError gnuplot compareAll.gplt ; mv log.gnuplot log.gnuplotCompareAll # Run foamLog runApplicationAndReportOnError foamLog ../log.simpleFoam # Run gnuplot for the residuals runApplicationAndReportOnError gnuplot plotResiduals.gplt; mv log.gnuplot log.gnuplotPlotResiduals