diff --git a/tutorials/XiFoam/Allrun b/tutorials/XiFoam/Allrun index c32a0b032e..a07a780037 100755 --- a/tutorials/XiFoam/Allrun +++ b/tutorials/XiFoam/Allrun @@ -3,7 +3,7 @@ . $WM_PROJECT_DIR/bin/tools/RunFunctions # Get application name from directory -application=`basename $PWD` +application=${PWD##*/} setControlDict () { controlDict="system/controlDict" diff --git a/tutorials/icoFoam/Allrun b/tutorials/icoFoam/Allrun index fcea17d98e..914e53d07d 100755 --- a/tutorials/icoFoam/Allrun +++ b/tutorials/icoFoam/Allrun @@ -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" diff --git a/tutorials/interFoam/Allrun b/tutorials/interFoam/Allrun index 3e7961c94b..4adf8e9374 100755 --- a/tutorials/interFoam/Allrun +++ b/tutorials/interFoam/Allrun @@ -3,7 +3,7 @@ . $WM_PROJECT_DIR/bin/tools/RunFunctions # Get application name from directory -application=`basename $PWD` +application=${PWD##*/} setDamBreakFine () { diff --git a/tutorials/laplacianFoam/flange/Allrun b/tutorials/laplacianFoam/flange/Allrun index 6e3250d8c6..497eed73f8 100755 --- a/tutorials/laplacianFoam/flange/Allrun +++ b/tutorials/laplacianFoam/flange/Allrun @@ -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 diff --git a/tutorials/lesCavitatingFoam/Allrun b/tutorials/lesCavitatingFoam/Allrun index 33517002c0..af563a0512 100755 --- a/tutorials/lesCavitatingFoam/Allrun +++ b/tutorials/lesCavitatingFoam/Allrun @@ -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 + 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 + 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 diff --git a/tutorials/rasCavitatingFoam/throttle/Allrun b/tutorials/rasCavitatingFoam/throttle/Allrun index 972d1f37c9..83a53ae761 100755 --- a/tutorials/rasCavitatingFoam/throttle/Allrun +++ b/tutorials/rasCavitatingFoam/throttle/Allrun @@ -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 + 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 + 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 + diff --git a/tutorials/rhoCentralFoam/Allrun b/tutorials/rhoCentralFoam/Allrun index e41004597b..dbd8b7758f 100755 --- a/tutorials/rhoCentralFoam/Allrun +++ b/tutorials/rhoCentralFoam/Allrun @@ -1,10 +1,9 @@ #!/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 diff --git a/tutorials/sonicLiquidFoam/Allrun b/tutorials/sonicLiquidFoam/Allrun index 4afc525e8b..db8cdfa08a 100755 --- a/tutorials/sonicLiquidFoam/Allrun +++ b/tutorials/sonicLiquidFoam/Allrun @@ -3,7 +3,7 @@ . $WM_PROJECT_DIR/bin/tools/RunFunctions # Get application name from directory -application=`basename $PWD` +application=${PWD##*/} setDecompressionTankFine () { diff --git a/tutorials/sonicTurbFoam/Allrun b/tutorials/sonicTurbFoam/Allrun index cb60b8cc06..810c6525eb 100755 --- a/tutorials/sonicTurbFoam/Allrun +++ b/tutorials/sonicTurbFoam/Allrun @@ -3,7 +3,7 @@ . $WM_PROJECT_DIR/bin/tools/RunFunctions # Get application name from directory -application=`basename $PWD` +application=${PWD##*/} runStarToFoam () {