TUT: steadyBoundaryLayer: ensure compatibility with gnuplot version > 5.4
- fix various scripts
This commit is contained in:
parent
6103303b9a
commit
f75aa7fbc8
@ -5,6 +5,6 @@ cd "${0%/*}" || exit # Run from this directory
|
||||
|
||||
cleanCase0
|
||||
|
||||
rm -f validation/*.eps
|
||||
rm -f validation/*.png
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
@ -31,65 +31,46 @@ cd "${0%/*}" || exit # Run from this directory
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
plot_T()
|
||||
plot_x_vs_T_U()
|
||||
{
|
||||
index="$1"
|
||||
sampleFile="$2"
|
||||
benchmarkFile="$3"
|
||||
benchmarkDir="$3"
|
||||
|
||||
image="OF_vs_EXPT_T$index.png"
|
||||
|
||||
gnuplot<<PLT_T
|
||||
gnuplot<<PLT_T_U
|
||||
set terminal pngcairo font "helvetica,20" size 1000, 1000
|
||||
set grid
|
||||
set key left top
|
||||
set xrange [0:0.08]
|
||||
set xlabel "Channel width, x [m]"
|
||||
|
||||
# Benchmark - Experimental
|
||||
benchmarkT="$benchmarkDir/mt_z0_${index}0_lo.dat"
|
||||
benchmarkU="$benchmarkDir/mv_z0_${index}0_lo.dat"
|
||||
|
||||
# OpenFOAM
|
||||
samples="$sampleFile"
|
||||
|
||||
|
||||
# plot temperature profiles
|
||||
set yrange [285:310]
|
||||
set xlabel "Channel width, x / [m]"
|
||||
set ylabel "Temperature / [K]"
|
||||
set output "$image"
|
||||
|
||||
# Benchmark - Experimental
|
||||
benchmark="$benchmarkFile"
|
||||
|
||||
# OpenFOAM
|
||||
samples="$sampleFile"
|
||||
set ylabel "Temperature [K]"
|
||||
set output "OF_vs_EXPT_T$index.png"
|
||||
|
||||
plot \
|
||||
benchmark u (\$1/1000):(\$2+273.15) t "Expt 0.$index" w p lt 1 pt 6, \
|
||||
samples t "OpenFOAM 0.$index" w l lt -1
|
||||
PLT_T
|
||||
}
|
||||
benchmarkT u (\$1/1000):(\$2+273.15) t "Expt 0.$index" w p lt 1 pt 6, \
|
||||
samples u 1:2 t "OpenFOAM 0.$index" w l lt -1
|
||||
|
||||
|
||||
plot_U()
|
||||
{
|
||||
index=$1
|
||||
sampleFile="$2"
|
||||
benchmarkFile="$3"
|
||||
|
||||
image="OF_vs_EXPT_U$index.png"
|
||||
|
||||
gnuplot<<PLT_U
|
||||
set terminal pngcairo font "helvetica,20" size 1000, 1000
|
||||
set grid
|
||||
set key left top
|
||||
set xrange [0:0.08]
|
||||
# plot velocity profiles
|
||||
set yrange [-0.2:0.2]
|
||||
set xlabel "Channel width, x / [m]"
|
||||
set ylabel "Vertical velocity component, Uy / [m/s]"
|
||||
set output "$image"
|
||||
|
||||
# Benchmark - Experimental
|
||||
benchmark="$benchmarkFile"
|
||||
|
||||
# OpenFOAM
|
||||
samples="$sampleFile"
|
||||
|
||||
set ylabel "Vertical velocity component, Uy [m/s]"
|
||||
set output "OF_vs_EXPT_U$index.png"
|
||||
plot \
|
||||
benchmark u (\$1/1000):(\$2) t "Expt 0.$index" w p lt 1 pt 6, \
|
||||
samples u 1:3 title "OpenFOAM 0.$index" w l lt -1
|
||||
PLT_U
|
||||
benchmarkU u (\$1/1000):(\$2) t "Expt 0.$index" w p lt 1 pt 6, \
|
||||
samples u 1:4 title "OpenFOAM 0.$index" w l lt -1
|
||||
|
||||
PLT_T_U
|
||||
}
|
||||
|
||||
|
||||
@ -121,34 +102,16 @@ OFDATAROOT="$SETSDIR/$LATESTTIME"
|
||||
|
||||
EXPTDATAROOT=./exptData
|
||||
|
||||
# generate temperature profiles
|
||||
TSets="1 3 4 5 6 7 9"
|
||||
for i in $TSets
|
||||
# generate temperature and velocity profiles
|
||||
set="1 3 4 5 6 7 9"
|
||||
for i in $set
|
||||
do
|
||||
|
||||
echo " processing temperature profile at y/yMax of 0.$i"
|
||||
echo " processing temperature and velocity profiles at y/yMax of 0.$i"
|
||||
|
||||
OF="$OFDATAROOT/y0.${i}_T.xy"
|
||||
OF="$OFDATAROOT/y0.${i}_T_U.xy"
|
||||
|
||||
EXPT="$EXPTDATAROOT/mt_z0_${i}0_lo.dat"
|
||||
|
||||
plot_T "$i" "$OF" "$EXPT"
|
||||
|
||||
done
|
||||
|
||||
|
||||
# generate velocity profiles
|
||||
USets="1 3 4 5 6 7 9"
|
||||
for i in $USets
|
||||
do
|
||||
|
||||
echo " processing velocity profile at y/yMax of 0.$i"
|
||||
|
||||
OF="$OFDATAROOT/y0.${i}_U.xy"
|
||||
|
||||
EXPT="$EXPTDATAROOT/mv_z0_${i}0_lo.dat"
|
||||
|
||||
plot_U "$i" "$OF" "$EXPT"
|
||||
plot_x_vs_T_U "$i" "$OF" "$EXPTDATAROOT"
|
||||
|
||||
done
|
||||
|
||||
|
@ -28,9 +28,8 @@ plot_yPlus_vs_uPlus() {
|
||||
set key spacing 0.75
|
||||
set xlabel "y^+"
|
||||
set ylabel "u^+"
|
||||
set offset .05, .05
|
||||
set parametric
|
||||
set trange [0:1.5]
|
||||
set trange [0:30]
|
||||
set logscale x
|
||||
set format x "10^{%T}"
|
||||
set output "$image"
|
||||
|
@ -5,6 +5,6 @@ cd "${0%/*}" || exit # Run from this directory
|
||||
|
||||
cleanCase0
|
||||
|
||||
rm -f validation/*.eps
|
||||
rm -f validation/*.png
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
@ -2,6 +2,48 @@
|
||||
cd "${0%/*}" || exit # Run from this directory
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
plot()
|
||||
{
|
||||
gnuplot<<PLT
|
||||
set terminal pngcairo font "helvetica,20" size 1000, 1000
|
||||
set encoding utf8
|
||||
set termoption dash
|
||||
set style increment user
|
||||
set style line 1 lt 1 linecolor rgb "blue" linewidth 1.5
|
||||
set style line 11 lt 2 linecolor rgb "black" linewidth 1.5
|
||||
|
||||
# time = system("foamListTimes -case .. -latestTime")
|
||||
time=$(foamListTimes -case .. -latestTime)
|
||||
|
||||
# benchmark
|
||||
benchmark="exptData/T3A.dat"
|
||||
|
||||
# plot turbulent intensity profile
|
||||
samples="../postProcessing/kGraph/".time."/line_k.xy"
|
||||
set xlabel "x"
|
||||
set ylabel "u'"
|
||||
set output "x_vs_u.png"
|
||||
set title "T3A - Flat plate - Turbulent intensity"
|
||||
plot [:1.5][:0.05] \
|
||||
samples u (\$1-0.04):(1./5.4*sqrt(2./3.*\$2)) t "kOmegaSSTLM" w l ls 1, \
|
||||
benchmark u (\$1/1000):(\$3/100) t "Experiment" w p ls 11
|
||||
|
||||
|
||||
# plot skin-friction coefficient profile
|
||||
samples="../postProcessing/wallShearStressGraph/".time."/line_wallShearStress.xy"
|
||||
set xlabel "Re_x"
|
||||
set ylabel "c_f"
|
||||
set output "Rex_vs_cf.png"
|
||||
set title "T3A - Flat plate - C_f"
|
||||
plot [:6e+5][0:0.01] \
|
||||
samples u ((\$1-0.04)*5.4/1.5e-05):(-\$2/0.5/5.4**2) t "kOmegaSSTLM" w l, \
|
||||
benchmark u (\$1/1000*5.4/1.51e-05):2 t "Experiment" w p ls 11
|
||||
PLT
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Require gnuplot
|
||||
command -v gnuplot >/dev/null || {
|
||||
echo "FOAM FATAL ERROR: gnuplot not found - skipping graph creation" 1>&2
|
||||
@ -11,32 +53,7 @@ command -v gnuplot >/dev/null || {
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
gnuplot<<GNUPLOT
|
||||
set term post enhanced color solid linewidth 2.0 20
|
||||
set out "graphs.eps"
|
||||
set encoding utf8
|
||||
set termoption dash
|
||||
set style increment user
|
||||
set style line 1 lt 1 linecolor rgb "blue" linewidth 1.5
|
||||
set style line 11 lt 2 linecolor rgb "black" linewidth 1.5
|
||||
plot
|
||||
|
||||
time = system("foamListTimes -case .. -latestTime")
|
||||
|
||||
set xlabel "x"
|
||||
set ylabel "u'"
|
||||
set title "T3A - Flat Plate - turbulent intensity"
|
||||
plot [:1.5][:0.05] \
|
||||
"../postProcessing/kGraph/".time."/line_k.xy" \
|
||||
u (\$1-0.04):(1./5.4*sqrt(2./3.*\$2))title "kOmegaSSTLM" w l ls 1, \
|
||||
"exptData/T3A.dat" u (\$1/1000):(\$3/100) title "Exp T3A" w p ls 11
|
||||
|
||||
set xlabel "Re_x"
|
||||
set ylabel "c_f"
|
||||
set title "T3A - Flat Plate - C_f"
|
||||
plot [:6e+5][0:0.01] \
|
||||
"../postProcessing/wallShearStressGraph/".time."/line_wallShearStress.xy" \
|
||||
u ((\$1-0.04)*5.4/1.5e-05):(-\$2/0.5/5.4**2) title "kOmegaSSTLM" w l, \
|
||||
"exptData/T3A.dat" u (\$1/1000*5.4/1.51e-05):2 title "Exp" w p ls 11
|
||||
GNUPLOT
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
@ -14,16 +14,12 @@ plot_U() {
|
||||
gnuplot<<EOF1
|
||||
set terminal pngcairo font "helvetica,20" size 1000, 1000
|
||||
set grid
|
||||
set key top left
|
||||
set key top right
|
||||
set xrange [-0.4:1.2]
|
||||
set yrange [0:3]
|
||||
set xlabel "U/U_0"
|
||||
set ylabel "y/h"
|
||||
set output "$image"
|
||||
set lmargin 7.5
|
||||
set rmargin 1.5
|
||||
set tmargin 0.1
|
||||
set bmargin 3.2
|
||||
set format x "%.1f"
|
||||
set format y "%.1f"
|
||||
|
||||
@ -31,12 +27,13 @@ plot_U() {
|
||||
samples="$sampleDir"
|
||||
Uref="$Uref"
|
||||
href="$href"
|
||||
fields="p_U_turbulenceProperties:devReff.xy"
|
||||
|
||||
plot \
|
||||
"$sampleDir/x_by_h_01_U.xy" u (\$2/Uref):(\$1/href) w l lw 2 lc rgb "red" t "x/h = 1", \
|
||||
"$sampleDir/x_by_h_04_U.xy" u (\$2/Uref):(\$1/href) w l lw 2 lc rgb "green" t "x/h = 4", \
|
||||
"$sampleDir/x_by_h_06_U.xy" u (\$2/Uref):(\$1/href) w l lw 2 lc rgb "blue" t "x/h = 6", \
|
||||
"$sampleDir/x_by_h_10_U.xy" u (\$2/Uref):(\$1/href) w l lw 2 lc rgb "black" t "x/h = 10"
|
||||
samples."/x_by_h_01_".fields u (\$3/Uref):(\$1/href) w l lw 2 lc rgb "red" t "x/h = 1", \
|
||||
samples."/x_by_h_04_".fields u (\$3/Uref):(\$1/href) w l lw 2 lc rgb "green" t "x/h = 4", \
|
||||
samples."/x_by_h_06_".fields u (\$3/Uref):(\$1/href) w l lw 2 lc rgb "blue" t "x/h = 6", \
|
||||
samples."/x_by_h_10_".fields u (\$3/Uref):(\$1/href) w l lw 2 lc rgb "black" t "x/h = 10"
|
||||
EOF1
|
||||
}
|
||||
|
||||
@ -66,10 +63,6 @@ plot_tau() {
|
||||
set xlabel "x/h"
|
||||
set ylabel "C_f"
|
||||
set output "$image"
|
||||
set lmargin 10
|
||||
set rmargin 1.5
|
||||
set tmargin 0.1
|
||||
set bmargin 3.2
|
||||
|
||||
# OpenFOAM
|
||||
Uref="$Uref"
|
||||
@ -107,7 +100,7 @@ sampleDir=postProcessing/sample/"$timeDir"
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
Uref=$(awk '{print $2}' $sampleDir/Uref_U.xy)
|
||||
Uref=$(awk '{print $2}' $sampleDir/Uref_p_U_turbulenceProperties:devReff.xy)
|
||||
|
||||
echo ""
|
||||
echo "# Plots the U profiles"
|
||||
|
10
tutorials/incompressible/simpleFoam/rotatingCylinders/Allclean
Executable file
10
tutorials/incompressible/simpleFoam/rotatingCylinders/Allclean
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
cd "${0%/*}" || exit # Run from this directory
|
||||
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
cleanCase
|
||||
|
||||
rm -f *.png
|
||||
|
||||
#------------------------------------------------------------------------------
|
@ -26,17 +26,19 @@ gnuplot<<EOF
|
||||
C = 0.5*A*A*R1*R1 + 2.*A*B*log(R1) - 0.5*B*B/R1/R1
|
||||
analytical_p(r) = 0.5*A*A*r*r + 2.*A*B*log(r) - 0.5*B*B/r/r - C
|
||||
|
||||
samples="postProcessing/sample1/1000/centreLine_p_U_U:Transformed.xy"
|
||||
|
||||
set ylabel "Pressure, p"
|
||||
set output "p.png"
|
||||
set samples 20
|
||||
set key bottom right
|
||||
plot "postProcessing/sample1/1000/centreLine_p.xy" w lines lw 2 lc "black" t "OpenFOAM", \
|
||||
plot samples u 1:2 w lines lw 2 lc "black" t "OpenFOAM", \
|
||||
analytical_p(x) w p ps 2 pt 6 lw 2 lc rgb "red" t "analytical"
|
||||
|
||||
set ylabel "U_{/Symbol q}, rad/s"
|
||||
set output "Utheta.png"
|
||||
set samples 20
|
||||
set key top right
|
||||
plot "postProcessing/sample1/1000/centreLine_U_U:Transformed.xy" u 1:6 w lines lw 2 lc "black" t "OpenFOAM", \
|
||||
plot samples u 1:7 w lines lw 2 lc "black" t "OpenFOAM", \
|
||||
analytical_utheta(x) w p ps 2 pt 6 lw 2 lc rgb "red" t "analytical"
|
||||
EOF
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
cd "${0%/*}" || exit # Run from this directory
|
||||
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||
#------------------------------------------------------------------------------
|
||||
|
@ -375,7 +375,7 @@ do
|
||||
|
||||
endTime=$( \
|
||||
foamDictionary results/$setup/system/controlDict \
|
||||
-disableFunctionEntries -entry endTime -value \
|
||||
-entry endTime -value \
|
||||
)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user