Files
OpenFOAM-12/tutorials/incompressibleFluid/roomResidenceTime/validation/Allrun
Will Bainbridge 303e3d1f60 tutorials: Consistency of All* scripts
Various minor changes to tutorial scripts. In particular, ensuring that
they all change to the containing directory so that batches of tutorials
can be run easily from the root of the installation.
2024-06-28 14:31:05 +01:00

40 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
cd ${0%/*} || exit 1 # Run from this directory
./Allclean
# ------ Pos 1 Evaluation
tail -n 1 ../postProcessing/probes1/*/age | xargs | sed 's/ /\n/g' | tail -n 30 > ageValues
head -n 30 ../postProcessing/probes1/*/age | cut -d' ' -f6 | cut -d')' -f1 > positionsZ
# Build dimless age value
V=45.36
Vdot=`cat ../postProcessing/inletFlowRate/*/surfaceFieldValue.dat | tail -n 1 | xargs | cut -d' ' -f2`
Vdot=`echo $Vdot | sed 's/e/*10^/'`
while IFS= read -r line
do
echo "scale=5; $line/($V/($Vdot*-1.))" | bc >> ageDimless1
done < "ageValues"
paste positionsZ ageDimless1 > Pos1_OF
# ------ Pos 2 Evaluation
tail -n 1 ../postProcessing/probes2/*/age | xargs | sed 's/ /\n/g' | tail -n 30 > ageValues
head -n 30 ../postProcessing/probes2/*/age | cut -d' ' -f6 | cut -d')' -f1 > positionsZ
# Build dimless age value
while IFS= read -r line
do
echo "scale=5; $line/($V/($Vdot*-1.))" | bc >> ageDimless2
done < "ageValues"
paste positionsZ ageDimless2 > Pos2_OF
# ------ Plot the results
gnuplot plot*
#------------------------------------------------------------------------------