#!/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" cp constant/polyMesh/boundary.preconfigured constant/polyMesh/boundary 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