openfoam/tutorials/XiFoam/Allrun
2008-06-12 19:32:10 +01:00

40 lines
836 B
Bash
Executable File

#!/bin/sh
# Get application name from directory
application=`basename $PWD`
# Find and source additional functions
tutorialPath=$PWD
while [ ! -f $tutorialPath/RunFunctions ]
do
tutorialPath="$tutorialPath/.."
done
. $tutorialPath/RunFunctions
setControlDict () {
controlDict="system/controlDict"
sed \
-e s/"\(deltaT[ \t]*\) 5e-06;"/"\1 1e-05;"/g \
-e s/"\(endTime[ \t]*\) 0.005;"/"\1 0.015;"/g \
-e s/"\(writeInterval[ \t]*\) 10;"/"\1 50;"/g \
$controlDict > temp.$$
mv temp.$$ $controlDict
}
# Do moriyoshiHomogeneous
(cd moriyoshiHomogeneous && $tutorialPath/runAll)
# Clone case
cloneCase moriyoshiHomogeneous moriyoshiHomogeneousPart2
# Modify and execute
cd moriyoshiHomogeneousPart2
cp -r ../moriyoshiHomogeneous/0.005 .
setControlDict
runApplication $application
cd ..