File size: 1,306 Bytes
5a600cf | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Run function links the appropriate mesh files and clones the case
run()
{
(
cd system
rm -f blockMeshDict.caseBlocks blockMeshDict.caseBoundary
ln -s blockMeshDict.${1}Blocks blockMeshDict.caseBlocks
ln -s blockMeshDict.${1}Boundary blockMeshDict.caseBoundary
)
cloneCase . ${1}
(
cd ${1}
runApplication blockMesh
runApplication decomposePar
runParallel foamRun
)
}
# Run with a fully resolved plenum
run resolved
# Run with the plenum modelled by a boundary condition
run modelled
if ! which gnuplot > /dev/null 2>&1
then
echo "gnuplot not found - skipping graph creation" >&2
exit 1
fi
# Plot a comparison of the pressure in the neck
cat << EOF | gnuplot -persist
set terminal postscript eps size 5,4 enhanced color
set xlabel "Time (s)"
set ylabel "Gauge pressure in the neck (Pa)"
set output "pressure.eps"
plot \
"resolved/postProcessing/probes/0/p" us 1:(\$4-1e5) t "Resolved Plenum" w l, \
"modelled/postProcessing/probes/0/p" us 1:(\$4-1e5) t "Modelled Plenum" w l
EOF
#------------------------------------------------------------------------------
|