backwardFacingStep2D

#!/bin/sh
cd “${0%/*}” || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#——————————————————————————

runApplication blockMesh
runApplication simpleFoam

if notTest “$@”
then
# Create validation plots

# Require gnuplot
command -v gnuplot >/dev/null || {
echo “gnuplot not found – skipping graph creation” 1>&2
exit 1
}

# Copy results to the validation directory
timeDir=$(foamListTimes -latestTime)
sampleDir=postProcessing/sample/$timeDir

[ -d $sampleDir ] || {
echo “results directory not found – skipping graph creation” 1>&2
exit 1
}

# Require awk
command -v awk >/dev/null || {
echo “awk not found – skipping graph creation” 1>&2
exit 1
}

Uref=$(awk ‘{print $2}’ $sampleDir/Uref_U.xy)

graphNameU=”backwardStep2D_U.png”

echo “Creating U profiles graph to $graphNameU”
gnuplot Cx.$$
foamDictionary -entry boundaryField.lowerWall.value -value $timeDir/wallShearStress | \r
sed -n ‘/(/,/)/p’ | sed -e ‘s/[()]//g;/^s*$/d’ > tau.$$
paste -d ‘ ‘ Cx.$$ tau.$$ >> tauw.dat
rm -f Cx.$$ tau.$$

graphNameTau=”backwardStep2D_tau.png”
echo “Creating wallshear stress graph to $graphNameTau”
gnuplot

実行年月:08/01/2020