mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
TUT: oneCellThickPlaneChannel/planeChannel: update the tutorial
This commit is contained in:
committed by
Andrew Heather
parent
745fc42dee
commit
ec96010ffb
@ -18,9 +18,9 @@ plot_R_patch() {
|
||||
|
||||
setup="$1"
|
||||
|
||||
endTime=$(foamDictionary results/$setup/settings/controlDict -entry endTime -value)
|
||||
# benchmarkFile="ReTau-395/dataset/chan395.reystress"
|
||||
sampleFile="results/$setup/postProcessing/sampleCellPoint/$endTime/inletPatch_columnAverage:columnAverage(UPrime2Mean).xy"
|
||||
endTime=$(foamDictionary results/"$setup"/system/controlDict -entry endTime -value)
|
||||
benchmarkFile="resources/dataset/chan395.reystress"
|
||||
sampleFile="results/$setup/postProcessing/sampleUPrime2Mean/$endTime/inletPatch_columnAverage(UPrime2Mean).xy"
|
||||
image="plots/$setup/R_patch.png"
|
||||
|
||||
gnuplot<<PLT_R_PATCH
|
||||
@ -38,7 +38,7 @@ plot_R_patch() {
|
||||
set title "Reynolds stresses on patch"
|
||||
|
||||
# Benchmark - DNS
|
||||
# benchmark = "$benchmarkFile"
|
||||
benchmark = "$benchmarkFile"
|
||||
|
||||
# Samples - OpenFOAM
|
||||
samples="$sampleFile"
|
||||
@ -47,23 +47,58 @@ plot_R_patch() {
|
||||
samples u 1:2 t "<u^' u^'>" w l lw 2 lc rgb "#009E73", \
|
||||
samples u 1:5 t "<v^' v^'>" w l lw 2 lc rgb "#F0E440", \
|
||||
samples u 1:7 t "<w^' w^'>" w l lw 2 lc rgb "#0072B2", \
|
||||
samples u 1:3 t "<u^' v^'>" w l lw 2 lc rgb "#D55E00"
|
||||
|
||||
# benchmark u 1:3 t "<u^' u^'>_{DNS}" w l lw 2 dt 2 lc rgb "#009E73", \
|
||||
# benchmark u 1:4 t "<v^' v^'>_{DNS}" w l lw 2 dt 2 lc rgb "#F0E440", \
|
||||
# benchmark u 1:5 t "<w^' w^'>_{DNS}" w l lw 2 dt 2 lc rgb "#0072B2", \
|
||||
# benchmark u 1:6 t "<u^' v^'>_{DNS}" w l lw 2 dt 2 lc rgb "#D55E00"
|
||||
samples u 1:3 t "<u^' v^'>" w l lw 2 lc rgb "#D55E00", \
|
||||
benchmark u 1:3 t "<u^' u^'>_{DNS}" w l lw 2 dt 2 lc rgb "#009E73", \
|
||||
benchmark u 1:4 t "<v^' v^'>_{DNS}" w l lw 2 dt 2 lc rgb "#F0E440", \
|
||||
benchmark u 1:5 t "<w^' w^'>_{DNS}" w l lw 2 dt 2 lc rgb "#0072B2", \
|
||||
benchmark u 1:6 t "<u^' v^'>_{DNS}" w l lw 2 dt 2 lc rgb "#D55E00"
|
||||
PLT_R_PATCH
|
||||
}
|
||||
|
||||
|
||||
plot_TR_patch() {
|
||||
|
||||
setup="$1"
|
||||
|
||||
endTime=$(foamDictionary results/"$setup"/system/controlDict -entry endTime -value)
|
||||
benchmarkFile="resources/dataset/chan395.reystress"
|
||||
sampleFile="results/$setup/postProcessing/sampleTPrime2Mean/$endTime/inletPatch_columnAverage(TPrime2Mean).xy"
|
||||
image="plots/$setup/TR_patch.png"
|
||||
|
||||
gnuplot<<PLT_TR_PATCH
|
||||
set terminal pngcairo font "helvetica,20" size 1000, 1000
|
||||
set grid
|
||||
set key top right
|
||||
set xrange [0:1]
|
||||
set yrange [-1:8]
|
||||
set key samplen 2
|
||||
set key spacing 0.75
|
||||
set xlabel "Channel height [m]"
|
||||
set ylabel "<T^' T^'> [-]"
|
||||
set offset .05, .05
|
||||
set output "$image"
|
||||
set title "Scalar Reynolds stresses on patch"
|
||||
|
||||
# Benchmark - DNS
|
||||
benchmark = "$benchmarkFile"
|
||||
|
||||
# Samples - OpenFOAM
|
||||
samples="$sampleFile"
|
||||
|
||||
plot \
|
||||
samples u 1:2 t "<T^' T^'>_{input}" w l lw 2 lc rgb "#D55E00", \
|
||||
benchmark u 1:3 t "<T^' T^'>_{output}" w l lw 2 dt 2 lc rgb "#009E73"
|
||||
PLT_TR_PATCH
|
||||
}
|
||||
|
||||
|
||||
plot_R_cell() {
|
||||
|
||||
setup="$1"
|
||||
|
||||
endTime=$(foamDictionary results/$setup/settings/controlDict -entry endTime -value)
|
||||
# benchmarkFile="ReTau-395/dataset/chan395.reystress"
|
||||
sampleFile="results/$setup/postProcessing/sampleCellPoint/$endTime/inletCell_columnAverage:columnAverage(UPrime2Mean).xy"
|
||||
endTime=$(foamDictionary results/"$setup"/system/controlDict -entry endTime -value)
|
||||
benchmarkFile="resources/dataset/chan395.reystress"
|
||||
sampleFile="results/$setup/postProcessing/sampleUPrime2Mean/$endTime/inletCell_columnAverage(UPrime2Mean).xy"
|
||||
image="plots/$setup/R_cell.png"
|
||||
|
||||
gnuplot<<PLT_R_CELL
|
||||
@ -81,7 +116,7 @@ plot_R_cell() {
|
||||
set title "Reynolds stresses on cell"
|
||||
|
||||
# Benchmark - DNS
|
||||
# benchmark= "$benchmarkFile"
|
||||
benchmark= "$benchmarkFile"
|
||||
|
||||
# Samples - OpenFOAM
|
||||
samples="$sampleFile"
|
||||
@ -90,23 +125,58 @@ plot_R_cell() {
|
||||
samples u 1:2 t "<u^' u^'>" w l lw 2 lc rgb "#009E73", \
|
||||
samples u 1:5 t "<v^' v^'>" w l lw 2 lc rgb "#F0E440", \
|
||||
samples u 1:7 t "<w^' w^'>" w l lw 2 lc rgb "#0072B2", \
|
||||
samples u 1:3 t "<u^' v^'>" w l lw 2 lc rgb "#D55E00"
|
||||
|
||||
# benchmark u 1:3 t "<u^' u^'>_{DNS}" w l lw 2 dt 2 lc rgb "#009E73", \
|
||||
# benchmark u 1:4 t "<v^' v^'>_{DNS}" w l lw 2 dt 2 lc rgb "#F0E440", \
|
||||
# benchmark u 1:5 t "<w^' w^'>_{DNS}" w l lw 2 dt 2 lc rgb "#0072B2", \
|
||||
# benchmark u 1:6 t "<u^' v^'>_{DNS}" w l lw 2 dt 2 lc rgb "#D55E00"
|
||||
samples u 1:3 t "<u^' v^'>" w l lw 2 lc rgb "#D55E00", \
|
||||
benchmark u 1:3 t "<u^' u^'>_{DNS}" w l lw 2 dt 2 lc rgb "#009E73", \
|
||||
benchmark u 1:4 t "<v^' v^'>_{DNS}" w l lw 2 dt 2 lc rgb "#F0E440", \
|
||||
benchmark u 1:5 t "<w^' w^'>_{DNS}" w l lw 2 dt 2 lc rgb "#0072B2", \
|
||||
benchmark u 1:6 t "<u^' v^'>_{DNS}" w l lw 2 dt 2 lc rgb "#D55E00"
|
||||
PLT_R_CELL
|
||||
}
|
||||
|
||||
|
||||
plot_TR_cell() {
|
||||
|
||||
setup="$1"
|
||||
|
||||
endTime=$(foamDictionary results/"$setup"/system/controlDict -entry endTime -value)
|
||||
benchmarkFile="resources/dataset/chan395.reystress"
|
||||
sampleFile="results/$setup/postProcessing/sampleTPrime2Mean/$endTime/inletCell_columnAverage(TPrime2Mean).xy"
|
||||
image="plots/$setup/TR_cell.png"
|
||||
|
||||
gnuplot<<PLT_TR_CELL
|
||||
set terminal pngcairo font "helvetica,20" size 1000, 1000
|
||||
set grid
|
||||
set key top right
|
||||
set xrange [0:1]
|
||||
set yrange [-1:8]
|
||||
set key samplen 2
|
||||
set key spacing 0.75
|
||||
set xlabel "Channel height [m]"
|
||||
set ylabel "<T^' T^'> [-]"
|
||||
set offset .05, .05
|
||||
set output "$image"
|
||||
set title "Reynolds stresses on cell"
|
||||
|
||||
# Benchmark - DNS
|
||||
benchmark= "$benchmarkFile"
|
||||
|
||||
# Samples - OpenFOAM
|
||||
samples="$sampleFile"
|
||||
|
||||
plot \
|
||||
samples u 1:2 t "<T^' T^'>_{input}" w l lw 2 lc rgb "#D55E00", \
|
||||
benchmark u 1:3 t "<T^' T^'>_{output}" w l lw 2 dt 2 lc rgb "#009E73"
|
||||
PLT_TR_CELL
|
||||
}
|
||||
|
||||
|
||||
plot_UMean_patch() {
|
||||
|
||||
setup="$1"
|
||||
|
||||
endTime=$(foamDictionary results/$setup/settings/controlDict -entry endTime -value)
|
||||
benchmarkFile="../../resources/incompressible/oneCellThickPlaneChannelFlow/ReTau-395/dataset/chan395.means"
|
||||
sampleFile="results/$setup/postProcessing/sampleCellPoint/$endTime/inletPatch_columnAverage:columnAverage(UMean).xy"
|
||||
endTime=$(foamDictionary results/"$setup"/system/controlDict -entry endTime -value)
|
||||
benchmarkFile="resources/dataset/chan395.means"
|
||||
sampleFile="results/$setup/postProcessing/sampleUMean/$endTime/inletPatch_columnAverage(UMean).xy"
|
||||
image="plots/$setup/UMean_patch.png"
|
||||
|
||||
gnuplot<<PLT_UMEAN_PATCH
|
||||
@ -124,19 +194,54 @@ plot_UMean_patch() {
|
||||
set title "Streamwise mean flow speed on patch"
|
||||
|
||||
# Benchmark - DNS
|
||||
# benchmark = "$benchmarkFile"
|
||||
benchmark = "$benchmarkFile"
|
||||
|
||||
# Samples - OpenFOAM
|
||||
samples="$sampleFile"
|
||||
|
||||
plot \
|
||||
samples u 1:2 t "u" w l lw 2 lc rgb "#009E73"
|
||||
|
||||
# benchmark u 1:3 t "u_{DNS}" w l lw 2 dt 2 lc rgb "#009E73"
|
||||
samples u 1:2 t "u" w l lw 2 lc rgb "#009E73", \
|
||||
benchmark u 1:3 t "u_{DNS}" w l lw 2 dt 2 lc rgb "#009E73"
|
||||
PLT_UMEAN_PATCH
|
||||
}
|
||||
|
||||
|
||||
plot_TMean_patch() {
|
||||
|
||||
setup="$1"
|
||||
|
||||
endTime=$(foamDictionary results/"$setup"/system/controlDict -entry endTime -value)
|
||||
benchmarkFile="resources/dataset/chan395.means"
|
||||
sampleFile="results/$setup/postProcessing/sampleTMean/$endTime/inletPatch_columnAverage(TMean).xy"
|
||||
image="plots/$setup/TMean_patch.png"
|
||||
|
||||
gnuplot<<PLT_TMEAN_PATCH
|
||||
set terminal pngcairo font "helvetica,20" size 1000, 1000
|
||||
set grid
|
||||
set key top right
|
||||
set xrange [0:1]
|
||||
set yrange [0:25]
|
||||
set key samplen 2
|
||||
set key spacing 0.75
|
||||
set xlabel "Channel height [m]"
|
||||
set ylabel "T [-]"
|
||||
set offset .05, .05
|
||||
set output "$image"
|
||||
set title "Streamwise mean scalar on patch"
|
||||
|
||||
# Benchmark - DNS
|
||||
benchmark = "$benchmarkFile"
|
||||
|
||||
# Samples - OpenFOAM
|
||||
samples="$sampleFile"
|
||||
|
||||
plot \
|
||||
samples u 1:2 t "T_{output}" w l lw 2 lc rgb "#009E73", \
|
||||
benchmark u 1:3 t "T_{input}" w l lw 2 dt 2 lc rgb "#009E73"
|
||||
PLT_TMEAN_PATCH
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Require gnuplot
|
||||
@ -156,11 +261,15 @@ command -v gnuplot >/dev/null || {
|
||||
|
||||
for setup in $setups
|
||||
do
|
||||
|
||||
echo ""
|
||||
echo "# Plots for the setup: $setup"
|
||||
echo ""
|
||||
|
||||
[ -d "results/$setup" ] || {
|
||||
echo "No results/$setup directory found - skipping graph creation" 1>&2
|
||||
continue
|
||||
}
|
||||
|
||||
dirPlots="plots/$setup"
|
||||
[ -d "$dirPlots" ] || mkdir -p "$dirPlots"
|
||||
|
||||
@ -170,6 +279,12 @@ do
|
||||
|
||||
plot_UMean_patch "$setup"
|
||||
|
||||
|
||||
plot_TR_patch "$setup"
|
||||
|
||||
plot_TR_cell "$setup"
|
||||
|
||||
plot_TMean_patch "$setup"
|
||||
done
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user