ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / tutorials / incompressible / boundaryFoam / boundaryWallFunctionsProfile / Allrun
blobd30f1362fcadcbec82ad6537e7b846d481719847
1 #!/bin/bash
2 cd ${0%/*} || exit 1 # run from this directory
4 # Source tutorial run functions
5 . $WM_PROJECT_DIR/bin/tools/RunFunctions
7 runApplication blockMesh
9 exponents="2 3 4 5 6 7 8"
11 echo "# yPlus vs uPlus" > yPlus_vs_uPlus
13 for e in $exponents
15 echo " Setting nu to 1e-$e"
17 sed "s/XXX/$e/g" constant/transportProperties.template \
18 > constant/transportProperties
20 runApplication `getApplication`
22 mv log.boundaryFoam log.boundaryFoam_$e
24 # extract y+, U+
25 # note: both must be added to foamLog.db
26 runApplication foamLog log.boundaryFoam_$e
28 mv log.foamLog log.foamLog_$e
30 if [ -e logs/yPlus_0 ]
31 then
32 yPlus=`awk < logs/yPlus_0 'END{print $2}'`
33 uPlus=`awk < logs/uPlus_0 'END{print $2}'`
35 echo "$yPlus $uPlus" >> yPlus_vs_uPlus
38 rm -rf logs
39 done
42 # create validation plot
43 # test if gnuplot exists on the system
44 type -P gnuplot &>/dev/null || {
45 echo "gnuplot not found - skipping graph creation" >&2
46 exit 1
48 graphName="OF_vs_ANAYTICAL.eps"
50 echo "Creating graph of u+ vs y+ to $graphName"
51 gnuplot<<EOF
52 set terminal postscript eps color enhanced
53 set output "$graphName"
54 set grid
55 set xlabel "y+"
56 set ylabel "u+"
57 set key top left
58 set size 0.75, 0.75
59 set parametric
60 # u+ range
61 set trange [0:35]
62 # Spaldings law
63 k=0.41
64 E=9.8
65 f(t) = t + 1/E*(exp(k*t) - 1 - k*t*(1 + 0.5*k*t) - 1/6*k*t**3)
66 set logscale x
67 set format x "10^{%T}"
68 plot f(t),t title "Spalding" with lines linetype -1, \
69 "yPlus_vs_uPlus" title "OpenFOAM" with points lt 1 pt 6
70 EOF
72 echo Done
74 # ----------------------------------------------------------------- end-of-file