mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
tutorial scripts
This commit is contained in:
21
tutorials/engineFoam/kivaTest/Allclean
Executable file
21
tutorials/engineFoam/kivaTest/Allclean
Executable file
@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Get application name from directory
|
||||
parentDir=`dirname $PWD`
|
||||
application=`basename $parentDir`
|
||||
|
||||
# Find and source additional functions
|
||||
tutorialPath=$PWD
|
||||
while [ ! -f $tutorialPath/CleanFunctions ]
|
||||
do
|
||||
tutorialPath="$tutorialPath/.."
|
||||
done
|
||||
. $tutorialPath/CleanFunctions
|
||||
|
||||
|
||||
|
||||
mv ./-180 temp180
|
||||
rm -rf 0
|
||||
cp system/controlDict.1st system/controlDict
|
||||
cleanCase
|
||||
mv temp180 ./-180
|
||||
43
tutorials/engineFoam/kivaTest/Allrun
Executable file
43
tutorials/engineFoam/kivaTest/Allrun
Executable file
@ -0,0 +1,43 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Get application name from directory
|
||||
parentDir=`dirname $PWD`
|
||||
application=`basename $parentDir`
|
||||
|
||||
# Find and source additional functions
|
||||
tutorialPath=$PWD
|
||||
while [ ! -f $tutorialPath/RunFunctions ]
|
||||
do
|
||||
tutorialPath="$tutorialPath/.."
|
||||
done
|
||||
. $tutorialPath/RunFunctions
|
||||
|
||||
|
||||
|
||||
runKivaToFoam ()
|
||||
{
|
||||
if [ -f log.kivaToFoam ] ; then
|
||||
echo "kivaToFoam already run on $PWD: remove log file to run"
|
||||
else
|
||||
echo "kivaToFoam: converting kiva file"
|
||||
kivaToFoam -file $1 > log.kivaToFoam 2>&1
|
||||
fi
|
||||
}
|
||||
|
||||
restartApplication ()
|
||||
{
|
||||
if [ -f log-2.$1 ] ; then
|
||||
echo "$1 already run on $PWD: remove log file to run"
|
||||
else
|
||||
echo "Running $1 on $PWD"
|
||||
$1 > log-2.$1 2>&1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
runKivaToFoam . $case/otape17
|
||||
cp system/controlDict.1st system/controlDict
|
||||
runApplication $application
|
||||
cp system/controlDict.2nd system/controlDict
|
||||
restartApplication $application
|
||||
Reference in New Issue
Block a user