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/ERCOFTAC_ConicalDiffuser/Case1.1_mixingPlane/Allrun

57 lines
1.6 KiB
Text
Raw Normal View History

2012-04-15 17:43:52 +00:00
#!/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
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_mixingPlane" "$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