diff --git a/tutorials/incompressible/adjointOptimisationFoam/sensitivityMaps/sbend/laminar/Allclean b/tutorials/incompressible/adjointOptimisationFoam/sensitivityMaps/sbend/laminar/Allclean index 61816694db..52a7c1663c 100755 --- a/tutorials/incompressible/adjointOptimisationFoam/sensitivityMaps/sbend/laminar/Allclean +++ b/tutorials/incompressible/adjointOptimisationFoam/sensitivityMaps/sbend/laminar/Allclean @@ -4,5 +4,7 @@ cd "${0%/*}" || exit # Run from this directory #------------------------------------------------------------------------------ cleanCase -rm 0/*.gz + +rm -f 0/*.gz + #------------------------------------------------------------------------------ diff --git a/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/Allclean b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/Allclean index 43b1e567b1..a7e5dc4a81 100755 --- a/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/Allclean +++ b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/Allclean @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit # Run from this directory +cd "${0%/*}" || exit # Run from this directory . ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions #------------------------------------------------------------------------------ diff --git a/tutorials/incompressible/pimpleFoam/laminar/mixerVesselAMI2D/mixerVesselAMI2D-topologyChange/Allrun b/tutorials/incompressible/pimpleFoam/laminar/mixerVesselAMI2D/mixerVesselAMI2D-topologyChange/Allrun index 0cae806083..3aaff9382e 100755 --- a/tutorials/incompressible/pimpleFoam/laminar/mixerVesselAMI2D/mixerVesselAMI2D-topologyChange/Allrun +++ b/tutorials/incompressible/pimpleFoam/laminar/mixerVesselAMI2D/mixerVesselAMI2D-topologyChange/Allrun @@ -1,6 +1,7 @@ #!/bin/sh -cd ${0%/*} || exit 1 # Run from this directory -. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions +#------------------------------------------------------------------------------ ./makeMesh diff --git a/tutorials/incompressible/pimpleFoam/laminar/mixerVesselAMI2D/mixerVesselAMI2D-topologyChange/makeMesh b/tutorials/incompressible/pimpleFoam/laminar/mixerVesselAMI2D/mixerVesselAMI2D-topologyChange/makeMesh index fc56e7be3c..5a991c3d4f 100755 --- a/tutorials/incompressible/pimpleFoam/laminar/mixerVesselAMI2D/mixerVesselAMI2D-topologyChange/makeMesh +++ b/tutorials/incompressible/pimpleFoam/laminar/mixerVesselAMI2D/mixerVesselAMI2D-topologyChange/makeMesh @@ -1,6 +1,7 @@ #!/bin/sh -cd ${0%/*} || exit 1 # Run from this directory -. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions +#------------------------------------------------------------------------------ m4 < system/blockMeshDict.m4 > system/blockMeshDict diff --git a/tutorials/mesh/refineMesh/refineFieldDirs/Allrun b/tutorials/mesh/refineMesh/refineFieldDirs/Allrun index 7909fb899c..ca48dae90a 100755 --- a/tutorials/mesh/refineMesh/refineFieldDirs/Allrun +++ b/tutorials/mesh/refineMesh/refineFieldDirs/Allrun @@ -14,45 +14,45 @@ wclean calcRadiusField runApplication blockMesh -##### Procedure for special refinement over Z - # We need the 0 folder to exist for these steps mkdir 0 # Refine over Z, in 6 passes for index in 1 2 3 4 5 6 do + suffix="tier$index" - runApplication -s tier$index calcRadiusField + runApplication -s "$suffix" calcRadiusField - runApplication -s tier$index \ - topoSet -dict system/topoSetDict.tier$index + runApplication -s "$suffix" \ + topoSet -dict system/topoSetDict.tier$index - ## foamToVTK -cellSet tier$index + ## foamToVTK -cellSet "$suffix" - runApplication -s tier$index \ - refineMesh -dict system/refineMeshDict.tier$index -overwrite - - rm -r 0/* + runApplication -s "$suffix" \ + refineMesh -dict system/refineMeshDict."$suffix" -overwrite + rm -r 0/* done # Refine over cylindrical coordinates, in 3 passes for index in 1 2 3 do + suffix="range$index" - runApplication -s range$index calcRadiusField -calcDirections + runApplication -s "$suffix" calcRadiusField -calcDirections - runApplication -s range$index \ - topoSet -dict system/topoSetDict.range$index + runApplication -s "$suffix" \ + topoSet -dict system/topoSetDict."$suffix" - ## foamToVTK -cellSet tier$index + ## foamToVTK -cellSet "$suffix" - runApplication -s range$index \ - refineMesh -dict system/refineMeshDict.range$index -overwrite - - rm -r 0/* + runApplication -s "$suffix" \ + refineMesh -dict system/refineMeshDict."$suffix" -overwrite + rm -r 0/* done +rmdir 0 2>/dev/null + #------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/compressibleInterDyMFoam/laminar/sloshingTank2D/Allclean b/tutorials/multiphase/compressibleInterDyMFoam/laminar/sloshingTank2D/Allclean index 8dfb6f7ba6..fb1f384730 100755 --- a/tutorials/multiphase/compressibleInterDyMFoam/laminar/sloshingTank2D/Allclean +++ b/tutorials/multiphase/compressibleInterDyMFoam/laminar/sloshingTank2D/Allclean @@ -1,5 +1,6 @@ #!/bin/sh cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions #------------------------------------------------------------------------------ cleanCase0 diff --git a/tutorials/multiphase/compressibleInterIsoFoam/laminar/depthCharge2D/Allclean b/tutorials/multiphase/compressibleInterIsoFoam/laminar/depthCharge2D/Allclean index 188f107b0e..faeb44ab75 100755 --- a/tutorials/multiphase/compressibleInterIsoFoam/laminar/depthCharge2D/Allclean +++ b/tutorials/multiphase/compressibleInterIsoFoam/laminar/depthCharge2D/Allclean @@ -1,8 +1,10 @@ #!/bin/sh -cd ${0%/*} || exit 1 # Run from this directory -. $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions +#------------------------------------------------------------------------------ cleanCase0 -rm -r sequencedVTK + +rm -rf sequencedVTK #------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/compressibleInterIsoFoam/laminar/depthCharge2D/Allrun b/tutorials/multiphase/compressibleInterIsoFoam/laminar/depthCharge2D/Allrun index 98b1a954b1..30fed9690e 100755 --- a/tutorials/multiphase/compressibleInterIsoFoam/laminar/depthCharge2D/Allrun +++ b/tutorials/multiphase/compressibleInterIsoFoam/laminar/depthCharge2D/Allrun @@ -1,6 +1,7 @@ #!/bin/sh -cd ${0%/*} || exit 1 # Run from this directory -. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions +#------------------------------------------------------------------------------ runApplication blockMesh restore0Dir diff --git a/tutorials/multiphase/compressibleInterIsoFoam/laminar/depthCharge3D/Allclean b/tutorials/multiphase/compressibleInterIsoFoam/laminar/depthCharge3D/Allclean index 3b8c6e8e2f..a3ef4042a2 100755 --- a/tutorials/multiphase/compressibleInterIsoFoam/laminar/depthCharge3D/Allclean +++ b/tutorials/multiphase/compressibleInterIsoFoam/laminar/depthCharge3D/Allclean @@ -1,8 +1,10 @@ #!/bin/sh -cd ${0%/*} || exit 1 # Run from this directory -. $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions +#------------------------------------------------------------------------------ cleanCase0 + rm -rf processor* #------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/compressibleInterIsoFoam/laminar/depthCharge3D/Allrun b/tutorials/multiphase/compressibleInterIsoFoam/laminar/depthCharge3D/Allrun index bdb96428fa..02b2d981f3 100755 --- a/tutorials/multiphase/compressibleInterIsoFoam/laminar/depthCharge3D/Allrun +++ b/tutorials/multiphase/compressibleInterIsoFoam/laminar/depthCharge3D/Allrun @@ -1,6 +1,7 @@ #!/bin/sh -cd ${0%/*} || exit 1 # Run from this directory -. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions +#------------------------------------------------------------------------------ runApplication blockMesh restore0Dir