backwardFacingStep2D

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

runApplication blockMesh
runApplication simpleFoam

if notTest $@
then
# Create validation plots

# Test if gnuplot exists on the system
command -v gnuplot >/dev/null 2>&1 || {
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
}

# Test if awk exists on the system
command -v awk >/dev/null 2>&1 || {
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

m -f Cx.$$ tau.$$

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

実行年月:07/10/2018