Commit ab5c014a authored by Mark Olesen's avatar Mark Olesen
Browse files

tweaked tutorial run scripts, avoid some bashisms

parent 28696e51
......@@ -3,7 +3,7 @@
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name from directory
application=`basename $PWD`
application=${PWD##*/}
setControlDict () {
controlDict="system/controlDict"
......
......@@ -3,7 +3,7 @@
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name from directory
application=`basename $PWD`
application=${PWD##*/}
cavityCases="cavity cavityFine cavityGrade cavityHighRe cavityClipped"
......
......@@ -3,7 +3,7 @@
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name from directory
application=`basename $PWD`
application=${PWD##*/}
setDamBreakFine ()
{
......
......@@ -5,9 +5,10 @@
# Get application directory
application="laplacianFoam"
runIdeasToFoam ()
runAnsysToFoam()
{
if [ -f log.ideasToFoam ] ; then
if [ -f log.ansysToFoam ]
then
echo "ansysToFoam already run on $PWD: remove log file to run"
else
echo "ansysToFoam: converting mesh $1"
......@@ -15,7 +16,7 @@ runIdeasToFoam ()
fi
}
runIdeasToFoam flange.ans 0.001
runAnsysToFoam flange.ans 0.001
runApplication $application
runApplication foamToFieldview9
runApplication foamToEnsight
......@@ -7,21 +7,21 @@ application="lesCavitatingFoam"
refineMeshByCellSet()
{
echo "creating cell set for primary zone - $1"
cp system/cellSetDict.$1 system/cellSetDict
cellSet >& log.cellSet.$1
echo "refining primary zone - $1"
refineMesh -dict -overwrite >& log.refineMesh.$1
while [ $# -ge 1 ]
do
echo "creating cell set for primary zone - $1"
cp system/cellSetDict.$1 system/cellSetDict
cellSet > log.cellSet.$1 2>&1
echo "refining primary zone - $1"
refineMesh -dict -overwrite > log.refineMesh.$1 2>&1
shift
done
}
cd throttle
runApplication blockMesh
refineMeshByCellSet 1
refineMeshByCellSet 2
refineMeshByCellSet 3
refineMeshByCellSet 1 2 3
runApplication $application
cd ..
......@@ -29,10 +29,7 @@ cd throttle3D
cp -r 0.org 0
runApplication blockMesh
refineMeshByCellSet 1
refineMeshByCellSet 2
refineMeshByCellSet 3
refineMeshByCellSet 1 2 3
echo "mapping fields from 2D throttle case"
mapFields ../throttle -sourceTime latestTime >& log.mapFields
......
......@@ -7,20 +7,19 @@ application="rasCavitatingFoam"
refineMeshByCellSet()
{
echo "creating cell set for primary zone - $1"
cp system/cellSetDict.$1 system/cellSetDict
cellSet >& log.cellSet.$1
echo "refining primary zone - $1"
refineMesh -dict -overwrite >& log.refineMesh.$1
while [ $# -ge 1 ]
do
echo "creating cell set for primary zone - $1"
cp system/cellSetDict.$1 system/cellSetDict
cellSet > log.cellSet.$1 2>&1
echo "refining primary zone - $1"
refineMesh -dict -overwrite > log.refineMesh.$1 2>&1
shift
done
}
runApplication blockMesh
refineMeshByCellSet 1
refineMeshByCellSet 2
refineMeshByCellSet 3
refineMeshByCellSet 1 2 3
runApplication $application
#!/bin/sh
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name from directory
application=`basename $PWD`
application=${PWD##*/}
cases=" \
shockTube \
......@@ -15,12 +14,13 @@ LadenburgJet60psi \
biconic25-55Run35 \
"
moveTimeMeshToConstant () {
DT=`foamInfoExec -times | tail -1`
if [ $DT != 0 ] ; then
mv ${DT}/polyMesh/* constant/polyMesh
rm -rf ${DT}
fi
moveTimeMeshToConstant ()
{
DT=`foamInfoExec -times | tail -1`
if [ "$DT" != 0 ] ; then
mv ${DT}/polyMesh/* constant/polyMesh
rm -rf ${DT}
fi
}
for case in $cases
......@@ -51,4 +51,4 @@ do
fi
#
(cd $case && runApplication $application)
done
\ No newline at end of file
done
......@@ -3,7 +3,7 @@
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name from directory
application=`basename $PWD`
application=${PWD##*/}
setDecompressionTankFine ()
{
......
......@@ -3,7 +3,7 @@
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name from directory
application=`basename $PWD`
application=${PWD##*/}
runStarToFoam ()
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment