#!/bin/sh
cd “${0%/*}” || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#——————————————————————————models=”
Maxwell
Stokes
”endTime=2
if notTest “$@”
then
endTime=25
fiif ! canCompile
then
echo “skipping tutorial $PWD”
exit 0
fi#——————————————————————————
# Compute the case in ‘serial’ mode, and collect the data
#
# $1 = endTime
# $* = models
# —-
serialRun() {
endTime=$1
shift 1
models=$*sed “s|END_TIME|$endTime|g” system/controlDict.template \r
> system/controlDict
resultDir=”results”runApplication blockMesh
wmake validation/WatersKingfor model in $models
do
sed “s|LAMINAR_MODEL|$model|g” constant/turbulenceProperties.template \r
> constant/turbulenceProperties# Compute numerical data
runApplication $(getApplication)
tail -n +4 postProcessing/probes/0/U | \r
tr -s ” ” | tr -d ‘(‘ | cut -d ” ” -f2-3 > “${model}.txt”# Collect numerical data
modelDir=”$resultDir/$model”
[ -d “$modelDir” ] || mkdir -p “$modelDir”
mv -f postProcessing log.* “$modelDir”
cleanTimeDirectories
donerunApplication WatersKing
}#——————————————————————————
serialRun $endTime $models
#——————————————————————————
実行年月:02/01/2021