BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / tutorials / heatTransfer / buoyantSimpleFoam / buoyantCavity / validation / createGraphs
blob2d9ceeb49a128a8d79c850a4c95ec7af0db83e72
1 #!/bin/sh
2 #------------------------------------------------------------------------------
3 # ========= |
4 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 # \\ / O peration |
6 # \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 # \\/ M anipulation |
8 #-------------------------------------------------------------------------------
9 # License
10 # This file is part of OpenFOAM.
12 # OpenFOAM is free software: you can redistribute it and/or modify it
13 # under the terms of the GNU General Public License as published by
14 # the Free Software Foundation, either version 3 of the License, or
15 # (at your option) any later version.
17 # OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
18 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 # for more details.
22 # You should have received a copy of the GNU General Public License
23 # along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 # Script
26 # createGraphs
28 # Description
29 # Creates .eps graphs of OpenFOAM results vs experiment for the buoyant
30 # cavity case
32 #------------------------------------------------------------------------------
34 createEpsT()
36 index=$1
37 OF=$2
38 EXPT=$3
40 gnuplot<<EOF
41 set terminal postscript eps color enhanced
42 set output "OF_vs_EXPT_T$i.eps"
43 set xlabel "Channel width, x / [m]"
44 set ylabel "Temperature / [K]"
45 set grid
46 set key left top
47 set size 0.6, 0.6
48 set xrange [0:0.08]
49 set yrange [285:310]
50 plot \
51 "$EXPT" u (\$1/1000):(\$2+273.15) title "Expt 0.$index" with points lt 1 pt 6, \
52 "$OF" title "OpenFOAM 0.$index" with lines linetype -1
53 EOF
57 createEpsU()
59 index=$1
60 OF=$2
61 EXPT=$3
63 gnuplot<<EOF
64 set terminal postscript eps color enhanced
65 set output "OF_vs_EXPT_U$i.eps"
66 set xlabel "Channel width, x / [m]"
67 set ylabel "Vertical velocity component, Uy / [m/s]"
68 set grid
69 set key left top
70 set size 0.6, 0.6
71 set xrange [0:0.08]
72 set yrange [-0.2:0.2]
73 plot \
74 "$EXPT" u (\$1/1000):(\$2) title "Expt 0.$index" with points lt 1 pt 6, \
75 "$OF" u 1:3 title "OpenFOAM 0.$index" with lines linetype -1
76 EOF
80 # test if gnuplot exists on the system
81 type -P gnuplot &>/dev/null || {
82 echo "gnuplot not found - skipping graph creation" >&2
83 exit 1
86 # paths to data
87 LATESTTIME=`ls ../sets`
88 OFDATAROOT=../sets/$LATESTTIME
90 EXPTDATAROOT=./exptData
92 # generate temperature profiles
93 TSets="1 3 4 5 6 7 9"
94 for i in $TSets
96 echo " processing temperature profile at y/yMax of 0.$i"
98 OF="$OFDATAROOT/y0.${i}_T.xy"
99 EXPT="$EXPTDATAROOT/mt_z0_${i}0_lo.dat"
101 createEpsT $i $OF $EXPT
102 done
105 # generate velocity profiles
106 USets="1 3 4 5 6 7 9"
107 for i in $USets
109 echo " processing velocity profile at y/yMax of 0.$i"
111 OF="$OFDATAROOT/y0.${i}_U.xy"
112 EXPT="$EXPTDATAROOT/mv_z0_${i}0_lo.dat"
114 createEpsU $i $OF $EXPT
115 done
117 echo Done
119 #------------------------------------------------------------------------------