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
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
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
]
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
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
48 graphName
="OF_vs_ANAYTICAL.eps"
50 echo "Creating graph of u+ vs y+ to $graphName"
52 set terminal postscript eps color enhanced
53 set output "$graphName"
65 f(t) = t + 1/E*(exp(k*t) - 1 - k*t*(1 + 0.5*k*t) - 1/6*k*t**3)
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
74 # ----------------------------------------------------------------- end-of-file