ENH: Updates to tutorial Allrun scripts

This commit is contained in:
andy
2012-10-26 10:27:30 +01:00
parent 9429143369
commit 182f660634
12 changed files with 51 additions and 55 deletions

View File

@ -7,36 +7,14 @@ cd ${0%/*} || exit 1 # run from this directory
# Get application name
application=`getApplication`
runKivaToFoam()
{
if [ -f log.kivaToFoam ]
then
echo "kivaToFoam already run: remove log file to re-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: remove log file to re-run"
else
echo "Running $1"
$1 > log-2.$1 2>&1
fi
}
runKivaToFoam otape17
runApplication kivaToFoam -file otape17
cp system/controlDict.1st system/controlDict
runApplication $application
mv log.$application log.$application.1
cp system/controlDict.2nd system/controlDict
restartApplication $application
runApplication $application
mv log.$application log.$application.2
# ----------------------------------------------------------------- end-of-file

View File

@ -1,5 +1,8 @@
#!/bin/sh
set -x
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
m4 < constant/polyMesh/blockMeshDict.m4 > constant/polyMesh/blockMeshDict
blockMesh > log.blockMesh 2>&1
runApplication blockMesh

View File

@ -7,24 +7,13 @@ cd ${0%/*} || exit 1 # run from this directory
# Get application name
application=`getApplication`
runStarToFoam()
{
if [ -f log.star3ToFoam -o -f log.starToFoam ]
then
echo "star3ToFoam already run on $PWD: remove log file to re-run"
else
echo "star3ToFoam: converting mesh $1"
star3ToFoam $1 > log.star3ToFoam 2>&1
fi
}
runApplication star3ToFoam prostar/nacaAirfoil
runStarToFoam prostar/nacaAirfoil
mv constant/polyMesh/boundary temp
sed -e s/"\([\t ]*type[\t ]*\)symmetryPlane"/"\1empty"/g \
temp > constant/polyMesh/boundary
rm temp
runApplication $application
# end-of-file
# ----------------------------------------------------------------- end-of-file

View File

@ -83,8 +83,16 @@ type -P gnuplot &>/dev/null || {
exit 1
}
SETSDIR="../sets"
if [ ! -d $SETSDIR ]
then
echo "createGraphs: results sets not available in folder $SETSDIR"
exit 0
fi
# paths to data
LATESTTIME=`ls ../sets`
LATESTTIME=`ls $SETSDIR`
OFDATAROOT=../sets/$LATESTTIME
EXPTDATAROOT=./exptData

View File

@ -13,7 +13,7 @@ unset FOAM_SETNAN
unset FOAM_SIGFPE
# Create first baffle
createBaffles baffleFaces '(baffle1Wall_0 baffle1Wall_1)' -overwrite > log.createBaffles 2>&1
runApplication createBaffles baffleFaces '(baffle1Wall_0 baffle1Wall_1)' -overwrite
# Create region
runApplication extrudeToRegionMesh -overwrite

View File

@ -1,5 +1,11 @@
#!/bin/sh
set -x
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
m4 < constant/polyMesh/blockMeshDict.m4 > constant/polyMesh/blockMeshDict
blockMesh > log.blockMesh 2>&1
runApplication blockMesh
# ----------------------------------------------------------------- end-of-file

View File

@ -1,7 +1,6 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions

View File

@ -1,6 +1,13 @@
#!/bin/sh
set -x
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
m4 < constant/polyMesh/blockMeshDict.m4 > constant/polyMesh/blockMeshDict
blockMesh > log.blockMesh 2>&1
topoSet
runApplication blockMesh
runApplication topoSet
# ----------------------------------------------------------------- end-of-file

View File

@ -16,9 +16,13 @@ unset FOAM_SETNAN
# Create faceZones for fan and baffles
runApplication topoSet
# Create fan cyclics
createBaffles cyclicFaces '(fan_half0 fan_half1)' -overwrite > log.createBaffles 2>&1
runApplication createBaffles cyclicFaces '(fan_half0 fan_half1)' -overwrite
mv log.createBaffles log.createBaffles.1
# Create wall baffles
createBaffles baffleFaces '(baffles baffles)' -overwrite > log.createBaffles 2>&1
runApplication createBaffles baffleFaces '(baffles baffles)' -overwrite
mv log.createBaffles log.createBaffles.2
runApplication $application

View File

@ -8,7 +8,7 @@ cd ${0%/*} || exit 1 # run from this directory
application=`getApplication`
runApplication blockMesh
transformPoints -scale '(1.6666 1 1)'
runApplication transformPoints -scale '(1.6666 1 1)'
runApplication changeDictionary -instance system -dict system/changeDictionaryDict.X
runApplication mirrorMesh -overwrite

View File

@ -21,10 +21,12 @@ setsToZones -noFlipMap > log.setsToZones 2>&1
# - use binary writing to avoid 'nan'
# - use setFields to set values
unset FOAM_SIGFPE
createBaffles cycLeft '(cycLeft_half0 cycLeft_half1)' -overwrite > log.createBaffles1 2>&1
runApplication createBaffles cycLeft '(cycLeft_half0 cycLeft_half1)' -overwrite
mv log.createBaffles log.createBaffles1
# create the second cyclic - rhs of porous zone
createBaffles cycRight '(cycRight_half0 cycRight_half1)' -overwrite > log.createBaffles2 2>&1
runApplication createBaffles cycRight '(cycRight_half0 cycRight_half1)' -overwrite
mv log.createBaffles log.createBaffles2
# Initialise newly created patchFields to 0
runApplication changeDictionary

View File

@ -16,7 +16,7 @@ unset FOAM_SETNAN
# Create faceZones for porous baffles
runApplication topoSet
createBaffles cyclicZoneFaces '(porous_half0 porous_half1)' -overwrite > log.createBaffles 2>&1
runApplication createBaffles cyclicZoneFaces '(porous_half0 porous_half1)' -overwrite
runApplication changeDictionary