diff --git a/applications/solvers/DNS/dnsFoam/Allwmake b/applications/solvers/DNS/dnsFoam/Allwmake
index 605293b5b6895acfecf4ed4c2e51b5a550bcc3ec..a066af95548aca4e1268cf90d508a41ba2c06e98 100755
--- a/applications/solvers/DNS/dnsFoam/Allwmake
+++ b/applications/solvers/DNS/dnsFoam/Allwmake
@@ -1,7 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                         # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-. $WM_PROJECT_DIR/wmake/scripts/have_fftw
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
+. ${WM_PROJECT_DIR:?}/wmake/scripts/have_fftw
 
 #------------------------------------------------------------------------------
 
diff --git a/applications/solvers/compressible/rhoCentralFoam/Allwmake b/applications/solvers/compressible/rhoCentralFoam/Allwmake
index 58648ff0444dcd34d437fdba26c4ff59c5b2d285..ff1edbfa0db7ce71532807a0f04f8875ed43a1b1 100755
--- a/applications/solvers/compressible/rhoCentralFoam/Allwmake
+++ b/applications/solvers/compressible/rhoCentralFoam/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 (wmake $targetType BCs && wmake $targetType && wmake $targetType rhoCentralDyMFoam)
 
diff --git a/applications/solvers/lagrangian/DPMFoam/Allwmake b/applications/solvers/lagrangian/DPMFoam/Allwmake
index 29e2940cd9f1bee00f1723ab8b1acdd893bdf648..e6a558c9724ed2f5d7bdabf50ed7691699c7bff4 100755
--- a/applications/solvers/lagrangian/DPMFoam/Allwmake
+++ b/applications/solvers/lagrangian/DPMFoam/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 
diff --git a/applications/solvers/multiphase/MPPICInterFoam/Allwmake b/applications/solvers/multiphase/MPPICInterFoam/Allwmake
index 0becbda84c5f72d3722a2a026ae5037b349b90e1..67940b9dc1effd4b31948a5a0140687e4da3cbbb 100755
--- a/applications/solvers/multiphase/MPPICInterFoam/Allwmake
+++ b/applications/solvers/multiphase/MPPICInterFoam/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                            # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 
diff --git a/applications/solvers/multiphase/compressibleInterFoam/Allwmake b/applications/solvers/multiphase/compressibleInterFoam/Allwmake
index 7a7a4e718020584c15ede6bf9309558da622eb52..b2a2c0e86153f5df68b931a003585c1dc2fbf550 100755
--- a/applications/solvers/multiphase/compressibleInterFoam/Allwmake
+++ b/applications/solvers/multiphase/compressibleInterFoam/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 
diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwmake b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwmake
index 0d361f95545c1d2ab6da0971af8da350f3f26aeb..c9a0de59a7dc9480cc3c7823c0881f7daffb8cdd 100755
--- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwmake
+++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 
diff --git a/applications/solvers/multiphase/driftFluxFoam/Allwmake b/applications/solvers/multiphase/driftFluxFoam/Allwmake
index 7571b50608b9288b4902f6a41905028ec35671a1..0d6973139b1aebe5835b820f7a7df90773615cac 100755
--- a/applications/solvers/multiphase/driftFluxFoam/Allwmake
+++ b/applications/solvers/multiphase/driftFluxFoam/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 
diff --git a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/Allwmake b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/Allwmake
index 114a214393d69c1e1a6cea34afcca30d6f33cab6..9abfd44e6063bf9afd905f03ff08e33e971c0699 100755
--- a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/Allwmake
+++ b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 
diff --git a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/Allwmake b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/Allwmake
index bb5db1b94fc986991a08cf3cb0577e2b9e65a262..55d43c17417d512f7745ad1a916bef1f4ff036ba 100755
--- a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/Allwmake
+++ b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 
diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/Allwmake b/applications/solvers/multiphase/interPhaseChangeFoam/Allwmake
index 6f577cedd66e7a7052af588aa1a4bdf6f7608ff8..aa304275053b6ebc6aaad94b1a7a594d8422a17a 100755
--- a/applications/solvers/multiphase/interPhaseChangeFoam/Allwmake
+++ b/applications/solvers/multiphase/interPhaseChangeFoam/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 
diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake b/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake
index e22e137bcb4b78fdd75047cae558f12da881a764..68d39777ad8c5076e08651a755ee7a62b0bf9261 100755
--- a/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake
+++ b/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/Allwmake b/applications/solvers/multiphase/multiphaseInterFoam/Allwmake
index 98754d570099e62f2fa783ae8c78bcf4e1da1661..e10d6d58239fc6f4465725353985fe5215335c42 100755
--- a/applications/solvers/multiphase/multiphaseInterFoam/Allwmake
+++ b/applications/solvers/multiphase/multiphaseInterFoam/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 
diff --git a/applications/solvers/multiphase/reactingEulerFoam/Allwmake b/applications/solvers/multiphase/reactingEulerFoam/Allwmake
index 7aa883fed9d33c5d203d767a5dc7d26bcfc37f83..3dbd571f891677da99bcfef2247ba91c3ec567d5 100755
--- a/applications/solvers/multiphase/reactingEulerFoam/Allwmake
+++ b/applications/solvers/multiphase/reactingEulerFoam/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 
diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwmake b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwmake
index ecb7039b93a994de65d349fce9bea25d936eea56..7bf70226d0acae024d2e140da5220c57fa7100d5 100755
--- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwmake
+++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 
diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwmake b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwmake
index ecb7039b93a994de65d349fce9bea25d936eea56..7bf70226d0acae024d2e140da5220c57fa7100d5 100755
--- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwmake
+++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/Allwmake b/applications/solvers/multiphase/twoPhaseEulerFoam/Allwmake
index 73f0733ef12ed504730aed1f288fdc18f6b177c3..8fbb3910666554ea5c010dac41f41d6aceced9f1 100755
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/Allwmake
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 
diff --git a/applications/test/fieldMapping/pipe1D/Allrun b/applications/test/fieldMapping/pipe1D/Allrun
index 130ff26742c4767cf2b8d889cb0383ea76b72721..8c29e97d11fb27e608000176f671375abf6f0c7d 100755
--- a/applications/test/fieldMapping/pipe1D/Allrun
+++ b/applications/test/fieldMapping/pipe1D/Allrun
@@ -1,10 +1,8 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Source tutorial run functions
-. $WM_PROJECT_DIR/bin/tools/RunFunctions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
-# Get application name
 application=Test-fieldMapping
 
 # Compile
diff --git a/applications/test/hexRef8/block/Allrun b/applications/test/hexRef8/block/Allrun
index 59757f310a2a8bfb769ad4ce94da527304fd42f4..01cc28c1bb94a65e229534527c183c42b9ceedb5 100755
--- a/applications/test/hexRef8/block/Allrun
+++ b/applications/test/hexRef8/block/Allrun
@@ -1,13 +1,10 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Source tutorial run functions
-. $WM_PROJECT_DIR/bin/tools/RunFunctions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
-# Get application name
 application=Test-hexRef8
 
-# Compile
 runApplication wmake ..
 
 runApplication blockMesh
diff --git a/applications/test/mapDistributePolyMesh/cavity/Allclean b/applications/test/mapDistributePolyMesh/cavity/Allclean
index 1ddaee91ff1648c391e96c435bdbf076d0f58b87..ca64f313b301c2dbf5d53bf25d2faab748b45de7 100755
--- a/applications/test/mapDistributePolyMesh/cavity/Allclean
+++ b/applications/test/mapDistributePolyMesh/cavity/Allclean
@@ -1,8 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Source tutorial clean functions
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/applications/test/mapDistributePolyMesh/cavity/Allrun b/applications/test/mapDistributePolyMesh/cavity/Allrun
index 9afaa5243d9a1630e3a7597ba8f52b83f7bb08d6..75b48fcd5eff2c783b81699d726b6bef9e80406a 100755
--- a/applications/test/mapDistributePolyMesh/cavity/Allrun
+++ b/applications/test/mapDistributePolyMesh/cavity/Allrun
@@ -1,8 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Source tutorial run functions
-. $WM_PROJECT_DIR/bin/tools/RunFunctions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/applications/test/parallelOverset/heatTransfer/Allclean b/applications/test/parallelOverset/heatTransfer/Allclean
index bd7671dd1e75ac5648712771db49551bd4343e61..becc3c757e1c000482e9f6500d2efa1c7d68d4e8 100755
--- a/applications/test/parallelOverset/heatTransfer/Allclean
+++ b/applications/test/parallelOverset/heatTransfer/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 rm -f constant/polyMesh/boundary
diff --git a/applications/test/parallelOverset/heatTransfer/Allrun.pre b/applications/test/parallelOverset/heatTransfer/Allrun.pre
index 16135b7062abc05e87173d93b3e9b3581ea8d825..2b7d44cffa1dfa6db2f350d301f3091ec314fc55 100755
--- a/applications/test/parallelOverset/heatTransfer/Allrun.pre
+++ b/applications/test/parallelOverset/heatTransfer/Allrun.pre
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/RunFunctions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/applications/test/volField/cavity/Allrun b/applications/test/volField/cavity/Allrun
index 03255c4d13cff085433ef08d7b84be1cc3ca98ec..619315f70c7d23b0b9399cb64fbec5eaeeebde21 100755
--- a/applications/test/volField/cavity/Allrun
+++ b/applications/test/volField/cavity/Allrun
@@ -1,13 +1,9 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
 
-# Source tutorial run functions
-. $WM_PROJECT_DIR/bin/tools/RunFunctions
-
-# Get application name
 application=Test-volField
 
-# Compile
 runApplication wmake ..
 
 runApplication blockMesh
diff --git a/applications/utilities/mesh/conversion/ccm/Allwmake b/applications/utilities/mesh/conversion/ccm/Allwmake
index 1fc0eea707d120c0a18413e83eb16aa9ce70622e..b64deac42480f98edab576cbe1922d74433ef567 100755
--- a/applications/utilities/mesh/conversion/ccm/Allwmake
+++ b/applications/utilities/mesh/conversion/ccm/Allwmake
@@ -1,7 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                            # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # (for error catching)
-. $WM_PROJECT_DIR/wmake/scripts/sysFunctions    # General system functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments # (error catching)
+. ${WM_PROJECT_DIR:?}/wmake/scripts/sysFunctions    # General system functions
 
 #------------------------------------------------------------------------------
 
diff --git a/applications/utilities/mesh/generation/Allwmake b/applications/utilities/mesh/generation/Allwmake
index 83876d367d25dd196a9f9e2b55592585129acbb6..fa8da9d1ff37c6191501d8f1968b91d0a4beba6d 100755
--- a/applications/utilities/mesh/generation/Allwmake
+++ b/applications/utilities/mesh/generation/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # (for error catching)
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments # (error catching)
 
 #------------------------------------------------------------------------------
 
diff --git a/applications/utilities/mesh/generation/extrude2DMesh/Allwmake b/applications/utilities/mesh/generation/extrude2DMesh/Allwmake
index 2b58cd08e1223bd1a5a14ee0c4636d2f0142c8dd..20f331844e78d032dc85d881b640b2482fd65d82 100755
--- a/applications/utilities/mesh/generation/extrude2DMesh/Allwmake
+++ b/applications/utilities/mesh/generation/extrude2DMesh/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 
diff --git a/applications/utilities/mesh/generation/foamyMesh/Allwmake b/applications/utilities/mesh/generation/foamyMesh/Allwmake
index beef89b54a597c48759e767b74a0782ed85db6ca..f1022241ded3eb2a165ff5104beb1252a77b9e54 100755
--- a/applications/utilities/mesh/generation/foamyMesh/Allwmake
+++ b/applications/utilities/mesh/generation/foamyMesh/Allwmake
@@ -1,10 +1,10 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-export WM_CONTINUE_ON_ERROR=true            # Optional unit
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # (for error catching)
-. $WM_PROJECT_DIR/wmake/scripts/have_cgal
-
+cd ${0%/*} || exit 1                                # Run from this directory
+export WM_CONTINUE_ON_ERROR=true                    # Optional unit
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments # (error catching)
+. ${WM_PROJECT_DIR:?}/wmake/scripts/have_cgal
 #------------------------------------------------------------------------------
+
 # Optional
 # - CGAL not installed, or installed but gives CMake problems
 
diff --git a/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshSurfaceSimplify/Allwmake b/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshSurfaceSimplify/Allwmake
index 1607b672aa08f80d109f8516a716d572c8a2e539..3b99eb9e29e667a09f6497e421e073ddb8fc4a5f 100755
--- a/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshSurfaceSimplify/Allwmake
+++ b/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshSurfaceSimplify/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # (for error catching)
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 
diff --git a/applications/utilities/mesh/manipulation/renumberMesh/Allwmake b/applications/utilities/mesh/manipulation/renumberMesh/Allwmake
index f89bab6e20b58e415bbb52e0fad2030fc8048060..5546fd33c7deb82aa037743b7ce5355837d527db 100755
--- a/applications/utilities/mesh/manipulation/renumberMesh/Allwmake
+++ b/applications/utilities/mesh/manipulation/renumberMesh/Allwmake
@@ -1,8 +1,8 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                            # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # (for error catching)
-. $WM_PROJECT_DIR/wmake/scripts/sysFunctions    # General system functions
-. $WM_PROJECT_DIR/wmake/scripts/have_zoltan
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments # (error catching)
+. ${WM_PROJECT_DIR:?}/wmake/scripts/sysFunctions    # General system functions
+. ${WM_PROJECT_DIR:?}/wmake/scripts/have_zoltan
 
 #------------------------------------------------------------------------------
 
diff --git a/applications/utilities/mesh/manipulation/setSet/Allwmake b/applications/utilities/mesh/manipulation/setSet/Allwmake
index dfee8bee52b5fa365c7e92e8d98da85824906beb..6a42c136ad776402c48dc7b6e82346102e0e7f62 100755
--- a/applications/utilities/mesh/manipulation/setSet/Allwmake
+++ b/applications/utilities/mesh/manipulation/setSet/Allwmake
@@ -1,7 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # (for error catching)
-. $WM_PROJECT_DIR/wmake/scripts/have_readline
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments # (error catching)
+. ${WM_PROJECT_DIR:?}/wmake/scripts/have_readline
 
 #------------------------------------------------------------------------------
 unset COMP_FLAGS LINK_FLAGS
diff --git a/applications/utilities/miscellaneous/OSspecific/Allwmake b/applications/utilities/miscellaneous/OSspecific/Allwmake
index cf32b145cec420dcbec3ab1a4dfa3e65f7cc589c..17badb940203dae59cc105f9703effaaca5025f7 100755
--- a/applications/utilities/miscellaneous/OSspecific/Allwmake
+++ b/applications/utilities/miscellaneous/OSspecific/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
 cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/sysFunctions
+. ${WM_PROJECT_DIR:?}/wmake/scripts/sysFunctions
 
 #------------------------------------------------------------------------------
 
diff --git a/applications/utilities/miscellaneous/foamHelp/Allwmake b/applications/utilities/miscellaneous/foamHelp/Allwmake
index 78dc109feca3b1eff40d1c76878110b69594b77a..807d0c7ca91dcaf62cf70998326af2324fe6dc4a 100755
--- a/applications/utilities/miscellaneous/foamHelp/Allwmake
+++ b/applications/utilities/miscellaneous/foamHelp/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/Allwclean b/applications/utilities/postProcessing/graphics/PVReaders/Allwclean
index 5b27d1316b9f59cee17bfa959ea5404fb96c9695..df49bb9d24a1dd583634588c84c4a2f83581a283 100755
--- a/applications/utilities/postProcessing/graphics/PVReaders/Allwclean
+++ b/applications/utilities/postProcessing/graphics/PVReaders/Allwclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                            # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/wmakeFunctions  # Source wmake functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/wmakeFunctions  # Require wmake functions
+#------------------------------------------------------------------------------
 
 # Cleanup libraries
 wclean libso foamPv
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/Allwmake b/applications/utilities/postProcessing/graphics/PVReaders/Allwmake
index 656c1e6d2fd97b438ea6d1840aeffb3d0aba69d1..e7c25a10497383f2ae4974166f10e5079d1467a7 100755
--- a/applications/utilities/postProcessing/graphics/PVReaders/Allwmake
+++ b/applications/utilities/postProcessing/graphics/PVReaders/Allwmake
@@ -1,9 +1,8 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                            # Run from this directory
-export WM_CONTINUE_ON_ERROR=true                # Optional unit
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-. $WM_PROJECT_DIR/wmake/scripts/paraviewFunctions  # CMake and PV functions
-
+cd ${0%/*} || exit 1                                # Run from this directory
+export WM_CONTINUE_ON_ERROR=true                    # Optional unit
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
+. ${WM_PROJECT_DIR:?}/wmake/scripts/paraviewFunctions # CMake, PV functions
 # -----------------------------------------------------------------------------
 
 warnIncomplete()
diff --git a/applications/utilities/postProcessing/noise/Allwmake b/applications/utilities/postProcessing/noise/Allwmake
index 2c9d265a5d535fe22c8e4d1fe0c912c7ce7a15ba..9cb77fb6350d2c4cb768f6e3b9398ab31d7920d3 100755
--- a/applications/utilities/postProcessing/noise/Allwmake
+++ b/applications/utilities/postProcessing/noise/Allwmake
@@ -1,7 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # (for error catching)
-. $WM_PROJECT_DIR/wmake/scripts/have_fftw
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments # (error catching)
+. ${WM_PROJECT_DIR:?}/wmake/scripts/have_fftw
 
 #------------------------------------------------------------------------------
 
diff --git a/applications/utilities/preProcessing/boxTurb/Allwmake b/applications/utilities/preProcessing/boxTurb/Allwmake
index 820f2da5524b50cced8f461d559d4c1d1b927201..906de00edfc262267cf67579055d345578ac4d9c 100755
--- a/applications/utilities/preProcessing/boxTurb/Allwmake
+++ b/applications/utilities/preProcessing/boxTurb/Allwmake
@@ -1,7 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                         # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # (for error catching)
-. $WM_PROJECT_DIR/wmake/scripts/have_fftw
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments # (error catching)
+. ${WM_PROJECT_DIR:?}/wmake/scripts/have_fftw
 
 #------------------------------------------------------------------------------
 
diff --git a/applications/utilities/preProcessing/wallFunctionTable/Allwmake b/applications/utilities/preProcessing/wallFunctionTable/Allwmake
index 27ff0f0215607aef31b8b8fc910b130b896fbe2e..06dd5733910b93825fa0eee641edebf138bcc093 100755
--- a/applications/utilities/preProcessing/wallFunctionTable/Allwmake
+++ b/applications/utilities/preProcessing/wallFunctionTable/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 
diff --git a/applications/utilities/surface/surfaceBooleanFeatures/Allwmake b/applications/utilities/surface/surfaceBooleanFeatures/Allwmake
index ba466eaf251e5675c6b2dcfa375ebd33da164139..e6e1bfa134af5b0ce8906471af372f0e7e3c8a54 100755
--- a/applications/utilities/surface/surfaceBooleanFeatures/Allwmake
+++ b/applications/utilities/surface/surfaceBooleanFeatures/Allwmake
@@ -1,7 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # (for error catching)
-. $WM_PROJECT_DIR/wmake/scripts/have_cgal
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments # (error catching)
+. ${WM_PROJECT_DIR:?}/wmake/scripts/have_cgal
 
 #------------------------------------------------------------------------------
 unset COMP_FLAGS LINK_FLAGS
diff --git a/applications/utilities/surface/surfaceFeatureExtract/Allwmake b/applications/utilities/surface/surfaceFeatureExtract/Allwmake
index ed3666a3da9fac41573d02439ea46c710eb653f9..c5c5ccb2be02225843c081c7fa5e1fa132879a48 100755
--- a/applications/utilities/surface/surfaceFeatureExtract/Allwmake
+++ b/applications/utilities/surface/surfaceFeatureExtract/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 (wmake $targetType extractionMethod && wmake $targetType)
 
diff --git a/src/OSspecific/MSwindows/Allwmake b/src/OSspecific/MSwindows/Allwmake
index 24fb418826f8f9b7d44c745e5fb780a4df187d5b..1c652edd72570e84b6a527f5cadf2237c4596546 100755
--- a/src/OSspecific/MSwindows/Allwmake
+++ b/src/OSspecific/MSwindows/Allwmake
@@ -1,7 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-targetType=libo                             # Preferred library type
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments $*
+cd ${0%/*} || exit 1                                # Run from this directory
+targetType=libo                                     # Preferred library type
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments $*
 
 #------------------------------------------------------------------------------
 unset COMP_FLAGS LINK_FLAGS
diff --git a/src/OSspecific/POSIX/Allwmake b/src/OSspecific/POSIX/Allwmake
index ef725400a69908d09562d09c334eebfc92bc5ee6..c765b061e5e0771a87a4b379f896a36b144f0126 100755
--- a/src/OSspecific/POSIX/Allwmake
+++ b/src/OSspecific/POSIX/Allwmake
@@ -1,7 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-targetType=libo                             # Preferred library type
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments $*
+cd ${0%/*} || exit 1                                # Run from this directory
+targetType=libo                                     # Preferred library type
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments $*
 
 #------------------------------------------------------------------------------
 unset COMP_FLAGS LINK_FLAGS
diff --git a/src/OpenFOAM/primitives/strings/stringOps/toScalar/createCode b/src/OpenFOAM/primitives/strings/stringOps/toScalar/createCode
index f90246730bec1bfa4a47ed8fe4f0dc037424ee2c..520298b42066cc053b83e9e0775fc56a304f95fb 100755
--- a/src/OpenFOAM/primitives/strings/stringOps/toScalar/createCode
+++ b/src/OpenFOAM/primitives/strings/stringOps/toScalar/createCode
@@ -1,10 +1,10 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
+cd ${0%/*} || exit 1                                # Run from this directory
 
 # Manually create ragel scanner and lemon parser header
 prefix=evalStringToScalar
 
-"$WM_PROJECT_DIR/wmake/scripts/makeParser" \
+"${WM_PROJECT_DIR:?}/wmake/scripts/makeParser" \
     -prefix="$prefix" \
     -scanner=Scanner.rl \
     -parser=LemonParser.lyy \
diff --git a/src/Pstream/Allwmake b/src/Pstream/Allwmake
index 77f2c9659b937fe1e889145c19de0c45aeeebdc1..76400e8d3ade842aa447d75be645f0f046e38e1e 100755
--- a/src/Pstream/Allwmake
+++ b/src/Pstream/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 
diff --git a/src/TurbulenceModels/Allwmake b/src/TurbulenceModels/Allwmake
index 717ff9f150c4f5b591e590f5a62064803afcc87a..b2f1ae7917b252b79dcdaa174d7636ea13cbe2bf 100755
--- a/src/TurbulenceModels/Allwmake
+++ b/src/TurbulenceModels/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 
diff --git a/src/conversion/Allwmake b/src/conversion/Allwmake
index e2fd470725b3ee4b9a1e096751e082686b93dcf6..926b65ccc6b09721178b78b041d981c752e62031 100755
--- a/src/conversion/Allwmake
+++ b/src/conversion/Allwmake
@@ -1,7 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-targetType=libso                            # Preferred library type
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+targetType=libso                                    # Preferred library type
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 
diff --git a/src/conversion/ccm/Allwmake b/src/conversion/ccm/Allwmake
index 0c358cc78110f85da67f6156644002c50a8ba930..d9ac45c153562b8616a262f60085d12bf0b5c4c5 100755
--- a/src/conversion/ccm/Allwmake
+++ b/src/conversion/ccm/Allwmake
@@ -1,7 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                         # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-. $WM_PROJECT_DIR/wmake/scripts/have_ccmio
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
+. ${WM_PROJECT_DIR:?}/wmake/scripts/have_ccmio
 
 #------------------------------------------------------------------------------
 # Optional
diff --git a/src/dummyThirdParty/Allwmake b/src/dummyThirdParty/Allwmake
index 5a5be522c73af777fd551ed024fe1051ce84cbc2..febb89f72dfc574a70a4c05bc63e60b3d34c1107 100755
--- a/src/dummyThirdParty/Allwmake
+++ b/src/dummyThirdParty/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 
diff --git a/src/fileFormats/stl/createCode b/src/fileFormats/stl/createCode
index aa7b8fd6448bcac8cd5aa8ef6635731e067038d1..23f488cdd2fbc53ee18b5cbc63fe03363eccdde7 100755
--- a/src/fileFormats/stl/createCode
+++ b/src/fileFormats/stl/createCode
@@ -1,8 +1,9 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-# Manually create ragel code
+cd ${0%/*} || exit 1                                # Run from this directory
 
-"$WM_PROJECT_DIR/wmake/scripts/makeParser" \
+# Manually create ragel scanner
+
+"${WM_PROJECT_DIR:?}/wmake/scripts/makeParser" \
     -scanner=STLAsciiParseRagel.rl \
     "$@"
 
diff --git a/src/functionObjects/Allwmake b/src/functionObjects/Allwmake
index 4ef262db1160c52d4dbdbb788d1b1296a33844cd..577c090edbb24b00e22cee1d5044208bf8aa4f22 100755
--- a/src/functionObjects/Allwmake
+++ b/src/functionObjects/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 
diff --git a/src/functionObjects/graphics/Allwmake b/src/functionObjects/graphics/Allwmake
index 5e531d4629067c1831f512f6f17c696432480090..4d045fd78af11e92c0eb20b509da32ca9889f302 100755
--- a/src/functionObjects/graphics/Allwmake
+++ b/src/functionObjects/graphics/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 if [ "$targetType" != "objects" ]
diff --git a/src/functionObjects/graphics/runTimePostProcessing/Allwclean b/src/functionObjects/graphics/runTimePostProcessing/Allwclean
index 140edc4bd1671ee71d588354fdc327eea715cda6..f442961aabbb50805cdd2266ed2b5a8c1a4b2910 100755
--- a/src/functionObjects/graphics/runTimePostProcessing/Allwclean
+++ b/src/functionObjects/graphics/runTimePostProcessing/Allwclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                            # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/wmakeFunctions  # Source wmake functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/wmakeFunctions  # Require wmake functions
+#------------------------------------------------------------------------------
 
 # This cleanup handles both cmake runTimePostProcessing and the dummy version
 
diff --git a/src/functionObjects/graphics/runTimePostProcessing/Allwmake b/src/functionObjects/graphics/runTimePostProcessing/Allwmake
index 94766cb758640ffdfef3d9dcd6237ed6b8be83ab..fecb6686144a94dc47a57b0b223cb21856761121 100755
--- a/src/functionObjects/graphics/runTimePostProcessing/Allwmake
+++ b/src/functionObjects/graphics/runTimePostProcessing/Allwmake
@@ -1,7 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                            # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/cmakeFunctions  # The CMake functions
-
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/cmakeFunctions  # Require cmake functions
 # -----------------------------------------------------------------------------
 
 echo "======================================================================"
diff --git a/src/functionObjects/randomProcesses/Allwmake b/src/functionObjects/randomProcesses/Allwmake
index c81ffedf7817dc95192fe7649ba032bf6e7488c9..eedf18476baf590089a19dcef03826e1f76a6b14 100755
--- a/src/functionObjects/randomProcesses/Allwmake
+++ b/src/functionObjects/randomProcesses/Allwmake
@@ -1,8 +1,8 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-targetType=libso                            # Preferred library type
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-. $WM_PROJECT_DIR/wmake/scripts/have_fftw
+cd ${0%/*} || exit 1                                # Run from this directory
+targetType=libso                                    # Preferred library type
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
+. ${WM_PROJECT_DIR:?}/wmake/scripts/have_fftw
 
 #------------------------------------------------------------------------------
 
diff --git a/src/fvAgglomerationMethods/Allwmake b/src/fvAgglomerationMethods/Allwmake
index 93a00b914434cdd15d0e55fdb6956313cec31d9b..e8982f6f9cf83e2936a479c9246667351a2dd544 100755
--- a/src/fvAgglomerationMethods/Allwmake
+++ b/src/fvAgglomerationMethods/Allwmake
@@ -1,7 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                         # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-. $WM_PROJECT_DIR/wmake/scripts/have_mgridgen
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
+. ${WM_PROJECT_DIR:?}/wmake/scripts/have_mgridgen
 
 #------------------------------------------------------------------------------
 
diff --git a/src/lagrangian/Allwmake b/src/lagrangian/Allwmake
index 0f58db93952c4da6efc20ef8504b42f364953482..228e5412ab620c37ea890e6ede158b3f8f4918ab 100755
--- a/src/lagrangian/Allwmake
+++ b/src/lagrangian/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 
diff --git a/src/lagrangian/molecularDynamics/Allwmake b/src/lagrangian/molecularDynamics/Allwmake
index ce45c96d26ac6c392a332aa2107649fd7280c646..60c5a189e8535d77dfde7fee5fffee4d2aed164d 100755
--- a/src/lagrangian/molecularDynamics/Allwmake
+++ b/src/lagrangian/molecularDynamics/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 
diff --git a/src/mesh/Allwmake b/src/mesh/Allwmake
index f9d7193a10ffd7b57bf6bf2f1ae36244a3c8f9d4..41c62196487ac24f631b906dfc0c42de802ea76f 100755
--- a/src/mesh/Allwmake
+++ b/src/mesh/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 
diff --git a/src/parallel/Allwmake b/src/parallel/Allwmake
index 15aba58375dac703487abeffeb05ca25e22214e4..6ecb623951fa2efaf66083e16f55468c05e046ed 100755
--- a/src/parallel/Allwmake
+++ b/src/parallel/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 
diff --git a/src/parallel/decompose/Allwmake b/src/parallel/decompose/Allwmake
index 4cf78f005e17c08dbd3d6ba958e8f87c32066d42..3f60c221d9dda4510ce5bb26a0643d56edc5bd60 100755
--- a/src/parallel/decompose/Allwmake
+++ b/src/parallel/decompose/Allwmake
@@ -1,9 +1,9 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-. $WM_PROJECT_DIR/wmake/scripts/have_kahip
-. $WM_PROJECT_DIR/wmake/scripts/have_metis
-. $WM_PROJECT_DIR/wmake/scripts/have_scotch
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
+. ${WM_PROJECT_DIR:?}/wmake/scripts/have_kahip
+. ${WM_PROJECT_DIR:?}/wmake/scripts/have_metis
+. ${WM_PROJECT_DIR:?}/wmake/scripts/have_scotch
 
 #------------------------------------------------------------------------------
 
diff --git a/src/parallel/reconstruct/Allwmake b/src/parallel/reconstruct/Allwmake
index d5089a9c4628306cd34566472d860979c81ab880..5b2fbb5af6764f32740a23bcffb047cb8d57ee54 100755
--- a/src/parallel/reconstruct/Allwmake
+++ b/src/parallel/reconstruct/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 
diff --git a/src/phaseSystemModels/Allwmake b/src/phaseSystemModels/Allwmake
index 4ff427d1684e97a30c728ecd9b7ac46dde83136f..759e13662fa12424919ce73603b1509898c11fb6 100755
--- a/src/phaseSystemModels/Allwmake
+++ b/src/phaseSystemModels/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 
diff --git a/src/randomProcesses/Allwmake b/src/randomProcesses/Allwmake
index c81ffedf7817dc95192fe7649ba032bf6e7488c9..eedf18476baf590089a19dcef03826e1f76a6b14 100755
--- a/src/randomProcesses/Allwmake
+++ b/src/randomProcesses/Allwmake
@@ -1,8 +1,8 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-targetType=libso                            # Preferred library type
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-. $WM_PROJECT_DIR/wmake/scripts/have_fftw
+cd ${0%/*} || exit 1                                # Run from this directory
+targetType=libso                                    # Preferred library type
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
+. ${WM_PROJECT_DIR:?}/wmake/scripts/have_fftw
 
 #------------------------------------------------------------------------------
 
diff --git a/src/regionModels/Allwmake b/src/regionModels/Allwmake
index d29ed140c7c515cfa2d932b6d6b334f3788d4c88..ff97a5899fd080326573135cf8acc6773f201222 100755
--- a/src/regionModels/Allwmake
+++ b/src/regionModels/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 
diff --git a/src/renumber/Allwmake b/src/renumber/Allwmake
index c8122c5a8862b9d36716fe18a0b4818454f49394..50e04920cfcc807ab95bf646db5ee1a73986a5ff 100755
--- a/src/renumber/Allwmake
+++ b/src/renumber/Allwmake
@@ -1,9 +1,9 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-targetType=libso                            # Preferred library type
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-. $WM_PROJECT_DIR/wmake/scripts/have_boost
-. $WM_PROJECT_DIR/wmake/scripts/have_zoltan
+cd ${0%/*} || exit 1                                # Run from this directory
+targetType=libso                                    # Preferred library type
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
+. ${WM_PROJECT_DIR:?}/wmake/scripts/have_boost
+. ${WM_PROJECT_DIR:?}/wmake/scripts/have_zoltan
 
 #------------------------------------------------------------------------------
 
diff --git a/src/thermophysicalModels/Allwmake b/src/thermophysicalModels/Allwmake
index 520a2d0af2b27eac36b235ac14ec09db2c689150..1efcd8e072983f1070248c6f51ea54570699f8e4 100755
--- a/src/thermophysicalModels/Allwmake
+++ b/src/thermophysicalModels/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 
diff --git a/src/transportModels/Allwmake b/src/transportModels/Allwmake
index 4790540e340032cc82bbd7304925d8ace24981f1..098cfb9b916cac55c5f88ccd3b1dbc151f7303e1 100755
--- a/src/transportModels/Allwmake
+++ b/src/transportModels/Allwmake
@@ -1,6 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 
diff --git a/tutorials/Allclean b/tutorials/Allclean
index 70e761244d6a538a4a7650a6940f403ffb8e41dd..259bbd83957f3ff583ab5915b23ea669f52d9e03 100755
--- a/tutorials/Allclean
+++ b/tutorials/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/LogFunctions    # Tutorial log-file functions
+cd ${0%/*} || exit 1                            # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/LogFunctions    # Tutorial log-file functions
+#------------------------------------------------------------------------------
 
 echo "--------"
 
diff --git a/tutorials/Allcollect b/tutorials/Allcollect
index 37f0bc2986e8d27a2b771069815c23306cd15d1e..0595c4fd7f3de7622e6725a922f08b0451ec5f8f 100755
--- a/tutorials/Allcollect
+++ b/tutorials/Allcollect
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/LogFunctions    # Tutorial log-file functions
+cd ${0%/*} || exit 1                            # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/LogFunctions    # Tutorial log-file functions
+#------------------------------------------------------------------------------
 
 # Collect log files as 'testLoopReport'
 collectLogs
diff --git a/tutorials/Allrun b/tutorials/Allrun
index 6cee4969a50274de6eec7e4ea1251e1310221ce5..ee970cf3350a533edc39c29a486dffe8a6bb8877 100755
--- a/tutorials/Allrun
+++ b/tutorials/Allrun
@@ -7,7 +7,7 @@
 #    \\/     M anipulation  |
 #------------------------------------------------------------------------------
 #     Copyright (C) 2011-2016 OpenFOAM Foundation
-#     Copyright (C) 2017 OpenCFD Ltd.
+#     Copyright (C) 2017-2019 OpenCFD Ltd.
 #------------------------------------------------------------------------------
 # License
 #     This file is part of OpenFOAM, licensed under GNU General Public License
@@ -67,7 +67,7 @@ do
 done
 
 #------------------------------------------------------------------------------
-. $WM_PROJECT_DIR/bin/tools/LogFunctions    # Tutorial log-file functions
+. ${WM_PROJECT_DIR:?}/bin/LogFunctions      # Tutorial log-file functions
 
 if [ -z "$optCollect" ]
 then
diff --git a/tutorials/Alltest b/tutorials/Alltest
index b43bdc177a2175032ff5d2152b2967de4dfabc25..b557405d3121f45fcbb16bbefb7d88d45fb5ac58 100755
--- a/tutorials/Alltest
+++ b/tutorials/Alltest
@@ -104,8 +104,8 @@ do
     shift
 done
 
-# Set FOAM_TUTORIALS directory location, as required.
-. "${WM_PROJECT_DIR:?}/bin/tools/RunFunctions"
+# Sets FOAM_TUTORIALS directory location, as required
+. "${WM_PROJECT_DIR:?}"/bin/tools/RunFunctions
 
 
 #------------------------------------------------------------------------------
diff --git a/tutorials/DNS/dnsFoam/boxTurb16/Allclean b/tutorials/DNS/dnsFoam/boxTurb16/Allclean
index 63c2af729c6aa613d5be9311e404ad84deb088dd..ba04bf4f4dea2dfe6dad52739ed9db2022ed5b44 100755
--- a/tutorials/DNS/dnsFoam/boxTurb16/Allclean
+++ b/tutorials/DNS/dnsFoam/boxTurb16/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 rm -f 0/enstrophy
diff --git a/tutorials/DNS/dnsFoam/boxTurb16/Allrun b/tutorials/DNS/dnsFoam/boxTurb16/Allrun
index 73fb0ad1aa26a7522b572aa0c4c66a9042feab17..5f632eef2ac6e1ee6f67fb44da5b21f29f411af5 100755
--- a/tutorials/DNS/dnsFoam/boxTurb16/Allrun
+++ b/tutorials/DNS/dnsFoam/boxTurb16/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication boxTurb
diff --git a/tutorials/IO/dictionary/Allrun b/tutorials/IO/dictionary/Allrun
index 2c4c344ab23df9fcc2a348e1483d5656c0e19918..369aa6dbcfd98b56af018346e6c21b6c17c1b5f8 100755
--- a/tutorials/IO/dictionary/Allrun
+++ b/tutorials/IO/dictionary/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication ./TestParsing -verbose "$@"
 
diff --git a/tutorials/IO/dictionary/Alltest b/tutorials/IO/dictionary/Alltest
index 850ea90ee4170c448b947e8b3134cf2f1e6c70d4..0f8df68908da52ca44d8bff5a71e74f9b3561758 100755
--- a/tutorials/IO/dictionary/Alltest
+++ b/tutorials/IO/dictionary/Alltest
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication ./TestParsing "$@"
 
diff --git a/tutorials/IO/dictionary/TestParsing b/tutorials/IO/dictionary/TestParsing
index 973b88749704bb4e04bea6e735d65f862366b064..7b656c9613d8726b4a1e3b443ff6d8071c76aaf7 100755
--- a/tutorials/IO/dictionary/TestParsing
+++ b/tutorials/IO/dictionary/TestParsing
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 echo "dictionary input tests"
 
diff --git a/tutorials/IO/fileHandler/Allclean b/tutorials/IO/fileHandler/Allclean
index b94239990e190425b97da497c64494391222b2fc..43db216ce9bc77c97beebc3b2d70f22394027832 100755
--- a/tutorials/IO/fileHandler/Allclean
+++ b/tutorials/IO/fileHandler/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/IO/fileHandler/Allrun b/tutorials/IO/fileHandler/Allrun
index ed0952fe54b252e1b754fefc8199ec48d6b73b17..5692f90ae6897ad8be6bc839c992f3e62c2c4159 100755
--- a/tutorials/IO/fileHandler/Allrun
+++ b/tutorials/IO/fileHandler/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 if isTest $@
 then
diff --git a/tutorials/IO/systemCall/Allrun b/tutorials/IO/systemCall/Allrun
index a42d43db7bc918cc07a906faaeb047cc364542ea..bfa19e1775977f098b03153305552fa1ba1f95e6 100755
--- a/tutorials/IO/systemCall/Allrun
+++ b/tutorials/IO/systemCall/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication decomposePar
diff --git a/tutorials/basic/laplacianFoam/flange/Allclean b/tutorials/basic/laplacianFoam/flange/Allclean
index 1c56b00e18e2767b3c2d27a34ffcb12d72805138..71c8a0892b1ad1327b56fa28ff1911b58f7c485b 100755
--- a/tutorials/basic/laplacianFoam/flange/Allclean
+++ b/tutorials/basic/laplacianFoam/flange/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 rm -rf Fieldview > /dev/null 2>&1
diff --git a/tutorials/basic/laplacianFoam/flange/Allrun b/tutorials/basic/laplacianFoam/flange/Allrun
index 53a0f0634acd4bef19b0aa40b4e0c4d32e45a0c5..d046b573f8065ecf2dbfa7e7c0b6b0227dc8dcd0 100755
--- a/tutorials/basic/laplacianFoam/flange/Allrun
+++ b/tutorials/basic/laplacianFoam/flange/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runAnsysToFoam()
 {
diff --git a/tutorials/basic/overLaplacianDyMFoam/heatTransfer/Allclean b/tutorials/basic/overLaplacianDyMFoam/heatTransfer/Allclean
index fad073e14312c34146bd5c64a803a9c9480e6869..a580cf3ad4bf7c137f2415831218bbee6428010b 100755
--- a/tutorials/basic/overLaplacianDyMFoam/heatTransfer/Allclean
+++ b/tutorials/basic/overLaplacianDyMFoam/heatTransfer/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/basic/overLaplacianDyMFoam/heatTransfer/Allrun b/tutorials/basic/overLaplacianDyMFoam/heatTransfer/Allrun
index 395446555eb05bf2c5026fb1afa8183c1da815d0..39eb3645d5ad0d5d66279dd95e04dbe0788710a5 100755
--- a/tutorials/basic/overLaplacianDyMFoam/heatTransfer/Allrun
+++ b/tutorials/basic/overLaplacianDyMFoam/heatTransfer/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/basic/overLaplacianDyMFoam/heatTransfer/Allrun.pre b/tutorials/basic/overLaplacianDyMFoam/heatTransfer/Allrun.pre
index baa7887883a881095cc39429a2c4ed0aaa15b0e4..2b7d44cffa1dfa6db2f350d301f3091ec314fc55 100755
--- a/tutorials/basic/overLaplacianDyMFoam/heatTransfer/Allrun.pre
+++ b/tutorials/basic/overLaplacianDyMFoam/heatTransfer/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/basic/overPotentialFoam/cylinder/Allclean b/tutorials/basic/overPotentialFoam/cylinder/Allclean
index 3f56512f8f0a538be6d62aa6442cdb85da479156..b99a7cdd056a589a0df09554b6d3f6914430248a 100755
--- a/tutorials/basic/overPotentialFoam/cylinder/Allclean
+++ b/tutorials/basic/overPotentialFoam/cylinder/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 # An extruded mesh around cylinder
 (cd cylinderAndBackground && ./Allclean)
diff --git a/tutorials/basic/overPotentialFoam/cylinder/Allrun b/tutorials/basic/overPotentialFoam/cylinder/Allrun
index a98fd76068981a93b833e87d7ff2d2fe6b540142..1f9e19cfa26e5640cba99154e18f7f4d70532e78 100755
--- a/tutorials/basic/overPotentialFoam/cylinder/Allrun
+++ b/tutorials/basic/overPotentialFoam/cylinder/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Extrude mesh around cylinder
 (cd cylinderMesh && ./Allrun.pre)
diff --git a/tutorials/basic/overPotentialFoam/cylinder/Allrun.pre b/tutorials/basic/overPotentialFoam/cylinder/Allrun.pre
index d87c892a62451ca186022496833adecbd1ae7ef7..a16bf252a5352748c2ba5f5dd883e656ff96d3ef 100755
--- a/tutorials/basic/overPotentialFoam/cylinder/Allrun.pre
+++ b/tutorials/basic/overPotentialFoam/cylinder/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Extrude mesh around cylinder
 (cd cylinderMesh && ./Allrun.pre)
diff --git a/tutorials/basic/overPotentialFoam/cylinder/cylinderAndBackground/Allclean b/tutorials/basic/overPotentialFoam/cylinder/cylinderAndBackground/Allclean
index aab71fa2ca4ea5faeb699a7c0497ec6841e7bce5..7a3d92a9d3b9a8627b7413c29072e777e14eb115 100755
--- a/tutorials/basic/overPotentialFoam/cylinder/cylinderAndBackground/Allclean
+++ b/tutorials/basic/overPotentialFoam/cylinder/cylinderAndBackground/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/basic/overPotentialFoam/cylinder/cylinderAndBackground/Allrun b/tutorials/basic/overPotentialFoam/cylinder/cylinderAndBackground/Allrun
index 675192355626c531ff90cf1dee41882714fa3ac4..b6b22e10a97e3d62fdf2f178a97290764127d3b1 100755
--- a/tutorials/basic/overPotentialFoam/cylinder/cylinderAndBackground/Allrun
+++ b/tutorials/basic/overPotentialFoam/cylinder/cylinderAndBackground/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/basic/overPotentialFoam/cylinder/cylinderAndBackground/Allrun.pre b/tutorials/basic/overPotentialFoam/cylinder/cylinderAndBackground/Allrun.pre
index fb7e1120bdf6d35eb6ad8e21168824b9d13db9d8..82380faff01b62e3b43b4af81d6883995e226802 100755
--- a/tutorials/basic/overPotentialFoam/cylinder/cylinderAndBackground/Allrun.pre
+++ b/tutorials/basic/overPotentialFoam/cylinder/cylinderAndBackground/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Create background mesh
 runApplication blockMesh
diff --git a/tutorials/basic/overPotentialFoam/cylinder/cylinderMesh/Allrun.pre b/tutorials/basic/overPotentialFoam/cylinder/cylinderMesh/Allrun.pre
index a86d9586601ab97370e670a5a868563c565ee912..020fb73544e5e42d369146470a5d4d0b99a66619 100755
--- a/tutorials/basic/overPotentialFoam/cylinder/cylinderMesh/Allrun.pre
+++ b/tutorials/basic/overPotentialFoam/cylinder/cylinderMesh/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Generate mesh from surface (in constant/triSurface)
 runApplication extrudeMesh
diff --git a/tutorials/basic/potentialFoam/cylinder/Allclean b/tutorials/basic/potentialFoam/cylinder/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/basic/potentialFoam/cylinder/Allclean
+++ b/tutorials/basic/potentialFoam/cylinder/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/basic/potentialFoam/cylinder/Allrun b/tutorials/basic/potentialFoam/cylinder/Allrun
index 754c15e58c070452c93b935e0e7d55aa377b8a6a..16054a18b3cc8d51dcd610fd3dbdde71a9799916 100755
--- a/tutorials/basic/potentialFoam/cylinder/Allrun
+++ b/tutorials/basic/potentialFoam/cylinder/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 runApplication blockMesh
diff --git a/tutorials/basic/potentialFoam/pitzDaily/Allclean b/tutorials/basic/potentialFoam/pitzDaily/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/basic/potentialFoam/pitzDaily/Allclean
+++ b/tutorials/basic/potentialFoam/pitzDaily/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/basic/potentialFoam/pitzDaily/Allrun b/tutorials/basic/potentialFoam/pitzDaily/Allrun
index 6ea7923d16b4d1bcee098b82a26edeba301da388..ddf63a27f71ca288feec3864abedf2d55ab6d090 100755
--- a/tutorials/basic/potentialFoam/pitzDaily/Allrun
+++ b/tutorials/basic/potentialFoam/pitzDaily/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 runApplication blockMesh
diff --git a/tutorials/combustion/PDRFoam/flamePropagationWithObstacles/Allclean b/tutorials/combustion/PDRFoam/flamePropagationWithObstacles/Allclean
index b6e861cc69cf5bac739cb28b55bfa2241f4dcacc..50f8b81b0ee363076d2b8377fd84884ea96008c7 100755
--- a/tutorials/combustion/PDRFoam/flamePropagationWithObstacles/Allclean
+++ b/tutorials/combustion/PDRFoam/flamePropagationWithObstacles/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/combustion/PDRFoam/flamePropagationWithObstacles/Allrun b/tutorials/combustion/PDRFoam/flamePropagationWithObstacles/Allrun
index 509c9850525e2342b1c3d50971e107df6d568940..e76474da80af613d61bf27ac7be4ec1b3d111ba9 100755
--- a/tutorials/combustion/PDRFoam/flamePropagationWithObstacles/Allrun
+++ b/tutorials/combustion/PDRFoam/flamePropagationWithObstacles/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 runApplication blockMesh
diff --git a/tutorials/combustion/XiDyMFoam/annularCombustorTurbine/Allclean b/tutorials/combustion/XiDyMFoam/annularCombustorTurbine/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/combustion/XiDyMFoam/annularCombustorTurbine/Allclean
+++ b/tutorials/combustion/XiDyMFoam/annularCombustorTurbine/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/combustion/XiDyMFoam/annularCombustorTurbine/Allrun b/tutorials/combustion/XiDyMFoam/annularCombustorTurbine/Allrun
index 5e6d5291c4c1add0115d5cca9c74794aa8649277..1154d59847811035555a17c28f78beb4240c588c 100755
--- a/tutorials/combustion/XiDyMFoam/annularCombustorTurbine/Allrun
+++ b/tutorials/combustion/XiDyMFoam/annularCombustorTurbine/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.mesh
 
diff --git a/tutorials/combustion/XiDyMFoam/annularCombustorTurbine/Allrun.mesh b/tutorials/combustion/XiDyMFoam/annularCombustorTurbine/Allrun.mesh
index b8e81fb24cd0845db8c54860de6772b19c8313a0..49917c0bdd4aa6685103b3a02447cfb71a1a2bce 100755
--- a/tutorials/combustion/XiDyMFoam/annularCombustorTurbine/Allrun.mesh
+++ b/tutorials/combustion/XiDyMFoam/annularCombustorTurbine/Allrun.mesh
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/combustion/XiEngineFoam/kivaTest/Allclean b/tutorials/combustion/XiEngineFoam/kivaTest/Allclean
index b2a02d49575487f5bd136fbbf9fe903a00c13391..9dc18dc0491c0af8fa0aadb77c27a52857a7051c 100755
--- a/tutorials/combustion/XiEngineFoam/kivaTest/Allclean
+++ b/tutorials/combustion/XiEngineFoam/kivaTest/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 mv ./-180 temp180
 cleanCase
diff --git a/tutorials/combustion/XiEngineFoam/kivaTest/Allrun b/tutorials/combustion/XiEngineFoam/kivaTest/Allrun
index 9cb48c6cf4751c0a4dd5ab3ea2e62d211cdf288d..a310dde2f73ca1ebdcc00f1ea877cd5e8150013f 100755
--- a/tutorials/combustion/XiEngineFoam/kivaTest/Allrun
+++ b/tutorials/combustion/XiEngineFoam/kivaTest/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication kivaToFoam -file otape17
 
diff --git a/tutorials/combustion/XiEngineFoam/kivaTest/Allrun-parallel b/tutorials/combustion/XiEngineFoam/kivaTest/Allrun-parallel
index 2f1caf98b50820226f3964be02d38fe1ceefcce5..82b19b9cdb3f3d24555b45a6407714d1581dbd61 100755
--- a/tutorials/combustion/XiEngineFoam/kivaTest/Allrun-parallel
+++ b/tutorials/combustion/XiEngineFoam/kivaTest/Allrun-parallel
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication kivaToFoam -file otape17
 
diff --git a/tutorials/combustion/XiFoam/RAS/Allclean b/tutorials/combustion/XiFoam/RAS/Allclean
index 39e9b455bf72e7541b306044ee21bdfd1f27270a..06c12fc9a5d46026c6313e5efcfa2cce27b12dd0 100755
--- a/tutorials/combustion/XiFoam/RAS/Allclean
+++ b/tutorials/combustion/XiFoam/RAS/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 keepCases="moriyoshiHomogeneous"
 loseCases="moriyoshiHomogeneousPart2 moriyoshiHomogeneousHydrogen"
diff --git a/tutorials/combustion/XiFoam/RAS/Allrun b/tutorials/combustion/XiFoam/RAS/Allrun
index a2adc5e8629ebac77cb8bac5397bd28f0dbaf374..8a43d2f16d0a3d6418c9246eea16b4175585cdf9 100755
--- a/tutorials/combustion/XiFoam/RAS/Allrun
+++ b/tutorials/combustion/XiFoam/RAS/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 setControlDict()
 {
diff --git a/tutorials/combustion/chemFoam/gri/Allclean b/tutorials/combustion/chemFoam/gri/Allclean
index 9bc42acc50cf995413c5d888773ac5fca486d54c..9f09e9930d422ba90b404a57028296c030a20483 100755
--- a/tutorials/combustion/chemFoam/gri/Allclean
+++ b/tutorials/combustion/chemFoam/gri/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/combustion/chemFoam/gri/Allrun b/tutorials/combustion/chemFoam/gri/Allrun
index ef926b994cc1e45468697c8e7182e8d357d11950..8a86732907548fb63516eedddb632551d2de0cd9 100755
--- a/tutorials/combustion/chemFoam/gri/Allrun
+++ b/tutorials/combustion/chemFoam/gri/Allrun
@@ -1,7 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/RunFunctions    # Tutorial run functions
-
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication chemkinToFoam \
                chemkin/chem.inp chemkin/therm.dat chemkin/transportProperties \
diff --git a/tutorials/combustion/chemFoam/h2/Allclean b/tutorials/combustion/chemFoam/h2/Allclean
index e01a93433e6ae57c05bd13269b7fd8531d3bf1c8..493b6b3b013e464d82ae37423d94463ea5e963fa 100755
--- a/tutorials/combustion/chemFoam/h2/Allclean
+++ b/tutorials/combustion/chemFoam/h2/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/combustion/chemFoam/h2/Allrun b/tutorials/combustion/chemFoam/h2/Allrun
index 5afa0c541e69cdfdbb28bf7847e45b26369e479d..de77cb7d567bef5ddc5a1068f47f0fb0e6c00fe4 100755
--- a/tutorials/combustion/chemFoam/h2/Allrun
+++ b/tutorials/combustion/chemFoam/h2/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication $(getApplication)
 
diff --git a/tutorials/combustion/chemFoam/ic8h18/Allclean b/tutorials/combustion/chemFoam/ic8h18/Allclean
index e01a93433e6ae57c05bd13269b7fd8531d3bf1c8..493b6b3b013e464d82ae37423d94463ea5e963fa 100755
--- a/tutorials/combustion/chemFoam/ic8h18/Allclean
+++ b/tutorials/combustion/chemFoam/ic8h18/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/combustion/chemFoam/ic8h18/Allrun b/tutorials/combustion/chemFoam/ic8h18/Allrun
index 5afa0c541e69cdfdbb28bf7847e45b26369e479d..de77cb7d567bef5ddc5a1068f47f0fb0e6c00fe4 100755
--- a/tutorials/combustion/chemFoam/ic8h18/Allrun
+++ b/tutorials/combustion/chemFoam/ic8h18/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication $(getApplication)
 
diff --git a/tutorials/combustion/chemFoam/ic8h18_TDAC/Allclean b/tutorials/combustion/chemFoam/ic8h18_TDAC/Allclean
index e01a93433e6ae57c05bd13269b7fd8531d3bf1c8..493b6b3b013e464d82ae37423d94463ea5e963fa 100755
--- a/tutorials/combustion/chemFoam/ic8h18_TDAC/Allclean
+++ b/tutorials/combustion/chemFoam/ic8h18_TDAC/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/combustion/chemFoam/ic8h18_TDAC/Allrun b/tutorials/combustion/chemFoam/ic8h18_TDAC/Allrun
index 5afa0c541e69cdfdbb28bf7847e45b26369e479d..de77cb7d567bef5ddc5a1068f47f0fb0e6c00fe4 100755
--- a/tutorials/combustion/chemFoam/ic8h18_TDAC/Allrun
+++ b/tutorials/combustion/chemFoam/ic8h18_TDAC/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication $(getApplication)
 
diff --git a/tutorials/combustion/chemFoam/nc7h16/Allclean b/tutorials/combustion/chemFoam/nc7h16/Allclean
index e01a93433e6ae57c05bd13269b7fd8531d3bf1c8..493b6b3b013e464d82ae37423d94463ea5e963fa 100755
--- a/tutorials/combustion/chemFoam/nc7h16/Allclean
+++ b/tutorials/combustion/chemFoam/nc7h16/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/combustion/chemFoam/nc7h16/Allrun b/tutorials/combustion/chemFoam/nc7h16/Allrun
index 5afa0c541e69cdfdbb28bf7847e45b26369e479d..de77cb7d567bef5ddc5a1068f47f0fb0e6c00fe4 100755
--- a/tutorials/combustion/chemFoam/nc7h16/Allrun
+++ b/tutorials/combustion/chemFoam/nc7h16/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication $(getApplication)
 
diff --git a/tutorials/combustion/fireFoam/LES/compartmentFire/Allclean b/tutorials/combustion/fireFoam/LES/compartmentFire/Allclean
index 9ead8681dec50a28f753ceeb57dae59efa309498..ae1a8004e756f1f30a32b8f5a438b03f1d56b6bb 100755
--- a/tutorials/combustion/fireFoam/LES/compartmentFire/Allclean
+++ b/tutorials/combustion/fireFoam/LES/compartmentFire/Allclean
@@ -1,9 +1,12 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
+
 rm -rf constant/panelRegion/polyMesh
 rm -f constant/polyMesh/boundary
 rm -f validation/*.eps
+
 #------------------------------------------------------------------------------
diff --git a/tutorials/combustion/fireFoam/LES/compartmentFire/Allrun b/tutorials/combustion/fireFoam/LES/compartmentFire/Allrun
index b8fad2b17f9ccdd6a185ac37129f60f4a406adea..b72d1f3424a9e0980f82a777fd41841616bf8868 100755
--- a/tutorials/combustion/fireFoam/LES/compartmentFire/Allrun
+++ b/tutorials/combustion/fireFoam/LES/compartmentFire/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # create the blockMesh file with the parametric one
 m4 system/blockMeshDict.m4 > system/blockMeshDict
diff --git a/tutorials/combustion/fireFoam/LES/flameSpreadWaterSuppressionPanel/Allclean b/tutorials/combustion/fireFoam/LES/flameSpreadWaterSuppressionPanel/Allclean
index b38edacb8971ae89be405fe393a89e387238a4a1..3dab827afbc9cb2035527cfd0ed897a274f73071 100755
--- a/tutorials/combustion/fireFoam/LES/flameSpreadWaterSuppressionPanel/Allclean
+++ b/tutorials/combustion/fireFoam/LES/flameSpreadWaterSuppressionPanel/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/combustion/fireFoam/LES/flameSpreadWaterSuppressionPanel/Allrun b/tutorials/combustion/fireFoam/LES/flameSpreadWaterSuppressionPanel/Allrun
index e99924ab9d446177eb24f250e4165f6937a39d5c..e078e04b7211a2245eb339619bf6b72fb21ed2da 100755
--- a/tutorials/combustion/fireFoam/LES/flameSpreadWaterSuppressionPanel/Allrun
+++ b/tutorials/combustion/fireFoam/LES/flameSpreadWaterSuppressionPanel/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # create the underlying block mesh
 runApplication blockMesh
diff --git a/tutorials/combustion/fireFoam/LES/oppositeBurningPanels/Allclean b/tutorials/combustion/fireFoam/LES/oppositeBurningPanels/Allclean
index fcfdc3257786af032eb6251eabfdf9b08f3a5576..d26961787e9d3baaefa5548663caa59a653e72e7 100755
--- a/tutorials/combustion/fireFoam/LES/oppositeBurningPanels/Allclean
+++ b/tutorials/combustion/fireFoam/LES/oppositeBurningPanels/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/combustion/fireFoam/LES/oppositeBurningPanels/Allrun b/tutorials/combustion/fireFoam/LES/oppositeBurningPanels/Allrun
index 259ca145a6bd3c14ad190ab831f4e4bede57b4a3..409b6d85e43cefb3de47f8ae6a93349b39d38047 100755
--- a/tutorials/combustion/fireFoam/LES/oppositeBurningPanels/Allrun
+++ b/tutorials/combustion/fireFoam/LES/oppositeBurningPanels/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/combustion/fireFoam/LES/simplePMMApanel/Allclean b/tutorials/combustion/fireFoam/LES/simplePMMApanel/Allclean
index 2e8de5d05fc635a9e9306804d73eddb8e3a3da3f..f627b3aadbe09b4d190cc17f81911d4bb7db031b 100755
--- a/tutorials/combustion/fireFoam/LES/simplePMMApanel/Allclean
+++ b/tutorials/combustion/fireFoam/LES/simplePMMApanel/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 rm -rf constant/panelRegion/polyMesh
diff --git a/tutorials/combustion/fireFoam/LES/simplePMMApanel/Allrun b/tutorials/combustion/fireFoam/LES/simplePMMApanel/Allrun
index dcd2bad0e5abb686bd824b9dc44c92afe5662646..51d8f6792726d532ddde2d12034a0807169f193b 100755
--- a/tutorials/combustion/fireFoam/LES/simplePMMApanel/Allrun
+++ b/tutorials/combustion/fireFoam/LES/simplePMMApanel/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication topoSet
diff --git a/tutorials/combustion/fireFoam/LES/smallPoolFire2D/Allclean b/tutorials/combustion/fireFoam/LES/smallPoolFire2D/Allclean
index b75804a65ba7061ab8ad898306b05b412f4ff74c..08eea3e9c3baa099a863db2f4a1db0578820c846 100755
--- a/tutorials/combustion/fireFoam/LES/smallPoolFire2D/Allclean
+++ b/tutorials/combustion/fireFoam/LES/smallPoolFire2D/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/combustion/fireFoam/LES/smallPoolFire2D/Allrun b/tutorials/combustion/fireFoam/LES/smallPoolFire2D/Allrun
index 39af3c029d819c14b225e594f867b960f05246d3..c228888491e07cb159c3e4312d39ae710793cefd 100755
--- a/tutorials/combustion/fireFoam/LES/smallPoolFire2D/Allrun
+++ b/tutorials/combustion/fireFoam/LES/smallPoolFire2D/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication topoSet
diff --git a/tutorials/combustion/fireFoam/LES/smallPoolFire3D/Allclean b/tutorials/combustion/fireFoam/LES/smallPoolFire3D/Allclean
index b75804a65ba7061ab8ad898306b05b412f4ff74c..08eea3e9c3baa099a863db2f4a1db0578820c846 100755
--- a/tutorials/combustion/fireFoam/LES/smallPoolFire3D/Allclean
+++ b/tutorials/combustion/fireFoam/LES/smallPoolFire3D/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/combustion/fireFoam/LES/smallPoolFire3D/Allrun b/tutorials/combustion/fireFoam/LES/smallPoolFire3D/Allrun
index de0f52b40bc764fb4eaca0390db2ce80d2cdfc9b..c2edaf682d73a8ede0af2f8ac9b3f11737108308 100755
--- a/tutorials/combustion/fireFoam/LES/smallPoolFire3D/Allrun
+++ b/tutorials/combustion/fireFoam/LES/smallPoolFire3D/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication topoSet
diff --git a/tutorials/combustion/reactingFoam/RAS/DLR_A_LTS/Allclean b/tutorials/combustion/reactingFoam/RAS/DLR_A_LTS/Allclean
index c81ffab9ed93a3bc624ae31c2b65c57c63e53800..3c2c8bd235a8946d97c7baf3c724f5ec82b1551f 100755
--- a/tutorials/combustion/reactingFoam/RAS/DLR_A_LTS/Allclean
+++ b/tutorials/combustion/reactingFoam/RAS/DLR_A_LTS/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/combustion/reactingFoam/RAS/DLR_A_LTS/Allrun b/tutorials/combustion/reactingFoam/RAS/DLR_A_LTS/Allrun
index 1476376f4437f3d9c9b5ab545b213f732ef1ec59..4634f7856b336b6563e9ca1f918d9128259c7a86 100755
--- a/tutorials/combustion/reactingFoam/RAS/DLR_A_LTS/Allrun
+++ b/tutorials/combustion/reactingFoam/RAS/DLR_A_LTS/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Application name
 application=$(getApplication)
diff --git a/tutorials/combustion/reactingFoam/RAS/SandiaD_LTS/Allclean b/tutorials/combustion/reactingFoam/RAS/SandiaD_LTS/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/combustion/reactingFoam/RAS/SandiaD_LTS/Allclean
+++ b/tutorials/combustion/reactingFoam/RAS/SandiaD_LTS/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/combustion/reactingFoam/RAS/SandiaD_LTS/Allrun b/tutorials/combustion/reactingFoam/RAS/SandiaD_LTS/Allrun
index a6a6eafa12d1d4eed8977b43587ee8f437479e7f..95da925a16f4b99d2e72ae970563785e3d27b95b 100755
--- a/tutorials/combustion/reactingFoam/RAS/SandiaD_LTS/Allrun
+++ b/tutorials/combustion/reactingFoam/RAS/SandiaD_LTS/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Application name
 application=$(getApplication)
diff --git a/tutorials/combustion/reactingFoam/RAS/chokedNozzle/Allclean b/tutorials/combustion/reactingFoam/RAS/chokedNozzle/Allclean
index be7ddb068847225ad69704840909a7b0d05a5466..e8557c25549b9369ce8225c99735bdfb9731e96c 100755
--- a/tutorials/combustion/reactingFoam/RAS/chokedNozzle/Allclean
+++ b/tutorials/combustion/reactingFoam/RAS/chokedNozzle/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/combustion/reactingFoam/RAS/chokedNozzle/Allrun b/tutorials/combustion/reactingFoam/RAS/chokedNozzle/Allrun
index e7546150c9e824e58bcc4a00cc475b5f2dba2f22..8501663548c543b855438f50e5e3b9c999311157 100755
--- a/tutorials/combustion/reactingFoam/RAS/chokedNozzle/Allrun
+++ b/tutorials/combustion/reactingFoam/RAS/chokedNozzle/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication decomposePar
diff --git a/tutorials/combustion/reactingFoam/RAS/membrane/Allclean b/tutorials/combustion/reactingFoam/RAS/membrane/Allclean
index 4b318da21958f74154ce07029f12ef6d464fb24c..2660b062e118eaa6f6665eb517e23943ba27bbaa 100755
--- a/tutorials/combustion/reactingFoam/RAS/membrane/Allclean
+++ b/tutorials/combustion/reactingFoam/RAS/membrane/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/combustion/reactingFoam/RAS/membrane/Allrun b/tutorials/combustion/reactingFoam/RAS/membrane/Allrun
index 5b60d5c00ff8240ab3bf2e141cb29fa811fd1202..53ed8ae3ce288f726635fa52fa0a8bce3c37de9e 100755
--- a/tutorials/combustion/reactingFoam/RAS/membrane/Allrun
+++ b/tutorials/combustion/reactingFoam/RAS/membrane/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 cp \
     $FOAM_TUTORIALS/resources/geometry/membrane-boundaries.stl.gz \
diff --git a/tutorials/compressible/overRhoPimpleDyMFoam/twoSimpleRotors/Allclean b/tutorials/compressible/overRhoPimpleDyMFoam/twoSimpleRotors/Allclean
index aab71fa2ca4ea5faeb699a7c0497ec6841e7bce5..7a3d92a9d3b9a8627b7413c29072e777e14eb115 100755
--- a/tutorials/compressible/overRhoPimpleDyMFoam/twoSimpleRotors/Allclean
+++ b/tutorials/compressible/overRhoPimpleDyMFoam/twoSimpleRotors/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/compressible/overRhoPimpleDyMFoam/twoSimpleRotors/Allrun b/tutorials/compressible/overRhoPimpleDyMFoam/twoSimpleRotors/Allrun
index cd2da7c1423e04509786dadd2d9d68f76f1a7d48..68d65d6908a3ca8b289ca92e4d2e258d72b49b35 100755
--- a/tutorials/compressible/overRhoPimpleDyMFoam/twoSimpleRotors/Allrun
+++ b/tutorials/compressible/overRhoPimpleDyMFoam/twoSimpleRotors/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/compressible/overRhoPimpleDyMFoam/twoSimpleRotors/Allrun.pre b/tutorials/compressible/overRhoPimpleDyMFoam/twoSimpleRotors/Allrun.pre
index abccd3163c95858a729642290f99bd730f2d248b..308bbee9fd4e07a61fd4924b3256442436eab675 100755
--- a/tutorials/compressible/overRhoPimpleDyMFoam/twoSimpleRotors/Allrun.pre
+++ b/tutorials/compressible/overRhoPimpleDyMFoam/twoSimpleRotors/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/compressible/overRhoSimpleFoam/hotCylinder/Allrun b/tutorials/compressible/overRhoSimpleFoam/hotCylinder/Allrun
index a98fd76068981a93b833e87d7ff2d2fe6b540142..1f9e19cfa26e5640cba99154e18f7f4d70532e78 100755
--- a/tutorials/compressible/overRhoSimpleFoam/hotCylinder/Allrun
+++ b/tutorials/compressible/overRhoSimpleFoam/hotCylinder/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Extrude mesh around cylinder
 (cd cylinderMesh && ./Allrun.pre)
diff --git a/tutorials/compressible/overRhoSimpleFoam/hotCylinder/Allrun.pre b/tutorials/compressible/overRhoSimpleFoam/hotCylinder/Allrun.pre
index d87c892a62451ca186022496833adecbd1ae7ef7..a16bf252a5352748c2ba5f5dd883e656ff96d3ef 100755
--- a/tutorials/compressible/overRhoSimpleFoam/hotCylinder/Allrun.pre
+++ b/tutorials/compressible/overRhoSimpleFoam/hotCylinder/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Extrude mesh around cylinder
 (cd cylinderMesh && ./Allrun.pre)
diff --git a/tutorials/compressible/overRhoSimpleFoam/hotCylinder/cylinderAndBackground/Allclean b/tutorials/compressible/overRhoSimpleFoam/hotCylinder/cylinderAndBackground/Allclean
index aab71fa2ca4ea5faeb699a7c0497ec6841e7bce5..7a3d92a9d3b9a8627b7413c29072e777e14eb115 100755
--- a/tutorials/compressible/overRhoSimpleFoam/hotCylinder/cylinderAndBackground/Allclean
+++ b/tutorials/compressible/overRhoSimpleFoam/hotCylinder/cylinderAndBackground/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/compressible/overRhoSimpleFoam/hotCylinder/cylinderAndBackground/Allrun b/tutorials/compressible/overRhoSimpleFoam/hotCylinder/cylinderAndBackground/Allrun
index 675192355626c531ff90cf1dee41882714fa3ac4..b6b22e10a97e3d62fdf2f178a97290764127d3b1 100755
--- a/tutorials/compressible/overRhoSimpleFoam/hotCylinder/cylinderAndBackground/Allrun
+++ b/tutorials/compressible/overRhoSimpleFoam/hotCylinder/cylinderAndBackground/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/compressible/overRhoSimpleFoam/hotCylinder/cylinderAndBackground/Allrun.pre b/tutorials/compressible/overRhoSimpleFoam/hotCylinder/cylinderAndBackground/Allrun.pre
index fb7e1120bdf6d35eb6ad8e21168824b9d13db9d8..82380faff01b62e3b43b4af81d6883995e226802 100755
--- a/tutorials/compressible/overRhoSimpleFoam/hotCylinder/cylinderAndBackground/Allrun.pre
+++ b/tutorials/compressible/overRhoSimpleFoam/hotCylinder/cylinderAndBackground/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Create background mesh
 runApplication blockMesh
diff --git a/tutorials/compressible/overRhoSimpleFoam/hotCylinder/cylinderMesh/Allrun.pre b/tutorials/compressible/overRhoSimpleFoam/hotCylinder/cylinderMesh/Allrun.pre
index a86d9586601ab97370e670a5a868563c565ee912..020fb73544e5e42d369146470a5d4d0b99a66619 100755
--- a/tutorials/compressible/overRhoSimpleFoam/hotCylinder/cylinderMesh/Allrun.pre
+++ b/tutorials/compressible/overRhoSimpleFoam/hotCylinder/cylinderMesh/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Generate mesh from surface (in constant/triSurface)
 runApplication extrudeMesh
diff --git a/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/Allclean b/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/Allclean
index f2d7cca6654b78c6b98a88e7508f8ab445a8a4e7..98dd91e6270ee80094e5c8fb6b38cf3190db0423 100755
--- a/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/Allclean
+++ b/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 cleanSamples
diff --git a/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/Allrun b/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/Allrun
index 544ba54bad5f20703ae9980773cca56e47748666..5f74b6dd2af22b6f7c06b974005892d9fff650c2 100755
--- a/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/Allrun
+++ b/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/compressible/rhoCentralFoam/shockTube/Allclean b/tutorials/compressible/rhoCentralFoam/shockTube/Allclean
index 69fe9734a911dd273f314f1a77c9b161d1ecb164..97d23e4226c630a82fb600fae180543c15bd077d 100755
--- a/tutorials/compressible/rhoCentralFoam/shockTube/Allclean
+++ b/tutorials/compressible/rhoCentralFoam/shockTube/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 cleanSamples
diff --git a/tutorials/compressible/rhoCentralFoam/shockTube/Allrun b/tutorials/compressible/rhoCentralFoam/shockTube/Allrun
index 055484463abf8e7f90c4c8def930c4a77e758ec8..eb149a1d058bc61c9c99a054bf25ba563da7eb2d 100755
--- a/tutorials/compressible/rhoCentralFoam/shockTube/Allrun
+++ b/tutorials/compressible/rhoCentralFoam/shockTube/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 runApplication blockMesh
diff --git a/tutorials/compressible/rhoPimpleAdiabaticFoam/rutlandVortex2D/Allclean b/tutorials/compressible/rhoPimpleAdiabaticFoam/rutlandVortex2D/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/compressible/rhoPimpleAdiabaticFoam/rutlandVortex2D/Allclean
+++ b/tutorials/compressible/rhoPimpleAdiabaticFoam/rutlandVortex2D/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/compressible/rhoPimpleAdiabaticFoam/rutlandVortex2D/Allrun b/tutorials/compressible/rhoPimpleAdiabaticFoam/rutlandVortex2D/Allrun
index 528f1a0404d2c9b3c64f7c308247d32e1bbb74cc..31795aa1f863118a6d8e4a57d50e54dd77511383 100755
--- a/tutorials/compressible/rhoPimpleAdiabaticFoam/rutlandVortex2D/Allrun
+++ b/tutorials/compressible/rhoPimpleAdiabaticFoam/rutlandVortex2D/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 runApplication blockMesh
diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/aerofoilNACA0012/Allclean b/tutorials/compressible/rhoPimpleFoam/RAS/aerofoilNACA0012/Allclean
index d547ed8b57e7c97b5aea1cd2a4e84a83ef0710de..021f9a67b067fa651b18d852cb2121b58841f5b7 100755
--- a/tutorials/compressible/rhoPimpleFoam/RAS/aerofoilNACA0012/Allclean
+++ b/tutorials/compressible/rhoPimpleFoam/RAS/aerofoilNACA0012/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/aerofoilNACA0012/Allrun b/tutorials/compressible/rhoPimpleFoam/RAS/aerofoilNACA0012/Allrun
index cb5a812f5ea4e3d70cf5f17ad294f5680f5f24ff..e8072ad7336f6d52562d19eb39bc781cfc88c826 100755
--- a/tutorials/compressible/rhoPimpleFoam/RAS/aerofoilNACA0012/Allrun
+++ b/tutorials/compressible/rhoPimpleFoam/RAS/aerofoilNACA0012/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication transformPoints -scale "(1 0 1)"
diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/Allrun b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/Allrun
index 54368cee898fed93435e246ad8a5c58cca03fd25..1bc5f6f547fb957622490442eaf81b6af79c4861 100755
--- a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/Allrun
+++ b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 m4 system/blockMeshDict.m4 > system/blockMeshDict
 
diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/Allrun b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/Allrun
index 54368cee898fed93435e246ad8a5c58cca03fd25..1bc5f6f547fb957622490442eaf81b6af79c4861 100755
--- a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/Allrun
+++ b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 m4 system/blockMeshDict.m4 > system/blockMeshDict
 
diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/annularThermalMixer/Allclean b/tutorials/compressible/rhoPimpleFoam/RAS/annularThermalMixer/Allclean
index 794ee1b81e450e08eef569e83f6b4e7069c02877..028cdb25c4312a213ac31afda1fd1e081aaeefc0 100755
--- a/tutorials/compressible/rhoPimpleFoam/RAS/annularThermalMixer/Allclean
+++ b/tutorials/compressible/rhoPimpleFoam/RAS/annularThermalMixer/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/annularThermalMixer/Allrun b/tutorials/compressible/rhoPimpleFoam/RAS/annularThermalMixer/Allrun
index 2b52d36edd8d9cd23238cf0baffb8b0d89c9bfe5..c71d3379790ce7bf23f2c9de116e8210b3f70c76 100755
--- a/tutorials/compressible/rhoPimpleFoam/RAS/annularThermalMixer/Allrun
+++ b/tutorials/compressible/rhoPimpleFoam/RAS/annularThermalMixer/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication surfaceFeatureExtract
 
diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/externalCoupledSquareBendLiq/Allclean b/tutorials/compressible/rhoPimpleFoam/RAS/externalCoupledSquareBendLiq/Allclean
index 1c48979f034839911f17c2c1bb8428e9e83d8c92..098307960e446267b46d7c2b94e130f291c71578 100755
--- a/tutorials/compressible/rhoPimpleFoam/RAS/externalCoupledSquareBendLiq/Allclean
+++ b/tutorials/compressible/rhoPimpleFoam/RAS/externalCoupledSquareBendLiq/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/externalCoupledSquareBendLiq/Allrun b/tutorials/compressible/rhoPimpleFoam/RAS/externalCoupledSquareBendLiq/Allrun
index d726140ec79c940108e59440e2eeef0a027166c5..c582601af0f29ae96feee024114adb6a8b5a03b8 100755
--- a/tutorials/compressible/rhoPimpleFoam/RAS/externalCoupledSquareBendLiq/Allrun
+++ b/tutorials/compressible/rhoPimpleFoam/RAS/externalCoupledSquareBendLiq/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/externalCoupledSquareBendLiq/Allrun.pre b/tutorials/compressible/rhoPimpleFoam/RAS/externalCoupledSquareBendLiq/Allrun.pre
index 884b4cc6d5ca4f168186ed9ba24847c95eb273d2..9afe0cedc2146216d8394b746f7967afb42f968e 100755
--- a/tutorials/compressible/rhoPimpleFoam/RAS/externalCoupledSquareBendLiq/Allrun.pre
+++ b/tutorials/compressible/rhoPimpleFoam/RAS/externalCoupledSquareBendLiq/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/externalCoupledSquareBendLiq/externalSolver b/tutorials/compressible/rhoPimpleFoam/RAS/externalCoupledSquareBendLiq/externalSolver
index dc5c6bbd21b05bca79c3def89712af2bfaca264f..317fa924f23af601e3a4e13d059338e2f45db337 100755
--- a/tutorials/compressible/rhoPimpleFoam/RAS/externalCoupledSquareBendLiq/externalSolver
+++ b/tutorials/compressible/rhoPimpleFoam/RAS/externalCoupledSquareBendLiq/externalSolver
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Dummy external solver to communicate with OpenFOAM via externalCoupled
 # functionObject
diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/mixerVessel2D/Allrun b/tutorials/compressible/rhoPimpleFoam/RAS/mixerVessel2D/Allrun
index 5db0a1c8e5a022ae01d798031504740b33e1af13..b069c38b3f36d4d3752f0c2ed834b7a6a20dcb79 100755
--- a/tutorials/compressible/rhoPimpleFoam/RAS/mixerVessel2D/Allrun
+++ b/tutorials/compressible/rhoPimpleFoam/RAS/mixerVessel2D/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./makeMesh
 runApplication $(getApplication)
diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/mixerVessel2D/makeMesh b/tutorials/compressible/rhoPimpleFoam/RAS/mixerVessel2D/makeMesh
index 6f4a3fffe32ce8d115e55d8dacdf26faabf07ade..57090307eb4285c0c0eb45d54f8fb4792d8636b4 100755
--- a/tutorials/compressible/rhoPimpleFoam/RAS/mixerVessel2D/makeMesh
+++ b/tutorials/compressible/rhoPimpleFoam/RAS/mixerVessel2D/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 m4 < system/blockMeshDict.m4 > system/blockMeshDict
 runApplication blockMesh
diff --git a/tutorials/compressible/rhoPimpleFoam/laminar/helmholtzResonance/Allclean b/tutorials/compressible/rhoPimpleFoam/laminar/helmholtzResonance/Allclean
index 2b124ecf38e9277815a4b8a05a0f1c0010d0bd8a..fa8a8dfc8cfbf35af0acdbe9be735c06f595d793 100755
--- a/tutorials/compressible/rhoPimpleFoam/laminar/helmholtzResonance/Allclean
+++ b/tutorials/compressible/rhoPimpleFoam/laminar/helmholtzResonance/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/compressible/rhoPimpleFoam/laminar/helmholtzResonance/Allrun b/tutorials/compressible/rhoPimpleFoam/laminar/helmholtzResonance/Allrun
index a8473e20701753ab626fb19df92e9769f6608fc1..435dafd76992bd3e117144cbea44f34732853fad 100755
--- a/tutorials/compressible/rhoPimpleFoam/laminar/helmholtzResonance/Allrun
+++ b/tutorials/compressible/rhoPimpleFoam/laminar/helmholtzResonance/Allrun
@@ -1,7 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/RunFunctions    # Tutorial run functions
-
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Run function links the appropriate mesh files and clones the case
 run()
diff --git a/tutorials/compressible/rhoPimpleFoam/laminar/sineWaveDamping/Allclean b/tutorials/compressible/rhoPimpleFoam/laminar/sineWaveDamping/Allclean
index be7ddb068847225ad69704840909a7b0d05a5466..e8557c25549b9369ce8225c99735bdfb9731e96c 100755
--- a/tutorials/compressible/rhoPimpleFoam/laminar/sineWaveDamping/Allclean
+++ b/tutorials/compressible/rhoPimpleFoam/laminar/sineWaveDamping/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/compressible/rhoPimpleFoam/laminar/sineWaveDamping/Allrun b/tutorials/compressible/rhoPimpleFoam/laminar/sineWaveDamping/Allrun
index e0f9af4df86f647b2876b3684279d5d511b10570..088ddcd32565e1824e7e6ce4993e368fa2cc7e68 100755
--- a/tutorials/compressible/rhoPimpleFoam/laminar/sineWaveDamping/Allrun
+++ b/tutorials/compressible/rhoPimpleFoam/laminar/sineWaveDamping/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication $(getApplication)
diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/explicit/Allclean b/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/explicit/Allclean
index 0686c27498f37a8e90e1b5a68d7a28933ba0ff1e..27a68f18bd4633248a0d657f6efa72667029cc7c 100755
--- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/explicit/Allclean
+++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/explicit/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/explicit/Allrun b/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/explicit/Allrun
index 1331199845154dbb44579ed7c6bdc51a40ff4d2f..8348af0b8b626fae9ecd87f41b23c9f05ef38ca5 100755
--- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/explicit/Allrun
+++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/explicit/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 echo "Use common files for 0/, constant/ and blockMeshDict"
 \rm -rf 0 constant
diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/implicit/Allclean b/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/implicit/Allclean
index 0686c27498f37a8e90e1b5a68d7a28933ba0ff1e..27a68f18bd4633248a0d657f6efa72667029cc7c 100755
--- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/implicit/Allclean
+++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/implicit/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/implicit/Allrun b/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/implicit/Allrun
index 1331199845154dbb44579ed7c6bdc51a40ff4d2f..8348af0b8b626fae9ecd87f41b23c9f05ef38ca5 100755
--- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/implicit/Allrun
+++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/implicit/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 echo "Use common files for 0/, constant/ and blockMeshDict"
 \rm -rf 0 constant
diff --git a/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/Allclean b/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/Allclean
index d547ed8b57e7c97b5aea1cd2a4e84a83ef0710de..021f9a67b067fa651b18d852cb2121b58841f5b7 100755
--- a/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/Allclean
+++ b/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/Allrun b/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/Allrun
index cb5a812f5ea4e3d70cf5f17ad294f5680f5f24ff..e8072ad7336f6d52562d19eb39bc781cfc88c826 100755
--- a/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/Allrun
+++ b/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication transformPoints -scale "(1 0 1)"
diff --git a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/Allrun b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/Allrun
index 54368cee898fed93435e246ad8a5c58cca03fd25..1bc5f6f547fb957622490442eaf81b6af79c4861 100755
--- a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/Allrun
+++ b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 m4 system/blockMeshDict.m4 > system/blockMeshDict
 
diff --git a/tutorials/compressible/rhoSimpleFoam/gasMixing/injectorPipe/Allclean b/tutorials/compressible/rhoSimpleFoam/gasMixing/injectorPipe/Allclean
index 6eb1457dbc3fa1a25ee448afe5b03a927224a3bd..b81308ff6323e21856ce0c55b6cd7b8f37002220 100755
--- a/tutorials/compressible/rhoSimpleFoam/gasMixing/injectorPipe/Allclean
+++ b/tutorials/compressible/rhoSimpleFoam/gasMixing/injectorPipe/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/compressible/rhoSimpleFoam/gasMixing/injectorPipe/Allrun b/tutorials/compressible/rhoSimpleFoam/gasMixing/injectorPipe/Allrun
index 32e8da429da3cfcb5bdada519ab0c91c897bccd2..08d4a2aaf252bc291fb8affbde55c18d65ca27bf 100755
--- a/tutorials/compressible/rhoSimpleFoam/gasMixing/injectorPipe/Allrun
+++ b/tutorials/compressible/rhoSimpleFoam/gasMixing/injectorPipe/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.mesh
 
diff --git a/tutorials/compressible/rhoSimpleFoam/gasMixing/injectorPipe/Allrun.mesh b/tutorials/compressible/rhoSimpleFoam/gasMixing/injectorPipe/Allrun.mesh
index d72a7aecf61cce4655bbd88e81a5608273080c74..433eabf62d5ac68bfa4a6c816c5527ba4ec7a4fc 100755
--- a/tutorials/compressible/rhoSimpleFoam/gasMixing/injectorPipe/Allrun.mesh
+++ b/tutorials/compressible/rhoSimpleFoam/gasMixing/injectorPipe/Allrun.mesh
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication surfaceFeatureExtract
 
diff --git a/tutorials/compressible/sonicFoam/RAS/nacaAirfoil/Allclean b/tutorials/compressible/sonicFoam/RAS/nacaAirfoil/Allclean
index e681fce19f5f780aa6e065603284208f630df410..56711ccc188ab4a4d105c48401b6b2cd3b1ee2d3 100755
--- a/tutorials/compressible/sonicFoam/RAS/nacaAirfoil/Allclean
+++ b/tutorials/compressible/sonicFoam/RAS/nacaAirfoil/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/compressible/sonicFoam/RAS/nacaAirfoil/Allrun b/tutorials/compressible/sonicFoam/RAS/nacaAirfoil/Allrun
index 8c157c9225eff8f152985353ce8205bcc461165a..d5fb62d6893afa6490aa44c13eccc14b59a8f04c 100755
--- a/tutorials/compressible/sonicFoam/RAS/nacaAirfoil/Allrun
+++ b/tutorials/compressible/sonicFoam/RAS/nacaAirfoil/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Convert mesh from resources directory
 runApplication star4ToFoam -scale 1 \
diff --git a/tutorials/compressible/sonicFoam/laminar/shockTube/Allclean b/tutorials/compressible/sonicFoam/laminar/shockTube/Allclean
index 69fe9734a911dd273f314f1a77c9b161d1ecb164..97d23e4226c630a82fb600fae180543c15bd077d 100755
--- a/tutorials/compressible/sonicFoam/laminar/shockTube/Allclean
+++ b/tutorials/compressible/sonicFoam/laminar/shockTube/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 cleanSamples
diff --git a/tutorials/compressible/sonicFoam/laminar/shockTube/Allrun b/tutorials/compressible/sonicFoam/laminar/shockTube/Allrun
index b000d60c0fb772c9fd6535e19d1a83671ff0d0da..b9d4cf52b47ac339e8239642a96a06a2b5eb55fd 100755
--- a/tutorials/compressible/sonicFoam/laminar/shockTube/Allrun
+++ b/tutorials/compressible/sonicFoam/laminar/shockTube/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 runApplication blockMesh
diff --git a/tutorials/compressible/sonicLiquidFoam/Allclean b/tutorials/compressible/sonicLiquidFoam/Allclean
index 2067a879ff5ee323b6c728b50abe098f7866f543..c29550da8cbed25bbd2b2aff33e2e1c932671336 100755
--- a/tutorials/compressible/sonicLiquidFoam/Allclean
+++ b/tutorials/compressible/sonicLiquidFoam/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 removeCase decompressionTankFine
 foamCleanTutorials -self
diff --git a/tutorials/compressible/sonicLiquidFoam/Allrun b/tutorials/compressible/sonicLiquidFoam/Allrun
index 539103fadd8eb738714891a94d6a6a61624610ca..5783f1059218becd6386caeecee3cd35aed93302 100755
--- a/tutorials/compressible/sonicLiquidFoam/Allrun
+++ b/tutorials/compressible/sonicLiquidFoam/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 setDecompressionTankFine()
 {
diff --git a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/Allclean b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/Allclean
index 40d55b2780e1d33ea9c069b8c3fa0d17e7d89466..0ea0fe80e8a02c9b88b13ebf0f74d8c83c54a714 100755
--- a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/Allclean
+++ b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/Allrun b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/Allrun
index ffa109248bc46fe2a6cfa937c25b89e49e9bcf75..19bf00a9026c25384cc468318bb2609886294517 100755
--- a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/Allrun
+++ b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication dsmcInitialise
diff --git a/tutorials/discreteMethods/dsmcFoam/freeSpaceStream/Allclean b/tutorials/discreteMethods/dsmcFoam/freeSpaceStream/Allclean
index 40d55b2780e1d33ea9c069b8c3fa0d17e7d89466..0ea0fe80e8a02c9b88b13ebf0f74d8c83c54a714 100755
--- a/tutorials/discreteMethods/dsmcFoam/freeSpaceStream/Allclean
+++ b/tutorials/discreteMethods/dsmcFoam/freeSpaceStream/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/discreteMethods/dsmcFoam/freeSpaceStream/Allrun b/tutorials/discreteMethods/dsmcFoam/freeSpaceStream/Allrun
index ffa109248bc46fe2a6cfa937c25b89e49e9bcf75..19bf00a9026c25384cc468318bb2609886294517 100755
--- a/tutorials/discreteMethods/dsmcFoam/freeSpaceStream/Allrun
+++ b/tutorials/discreteMethods/dsmcFoam/freeSpaceStream/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication dsmcInitialise
diff --git a/tutorials/discreteMethods/dsmcFoam/supersonicCorner/Allclean b/tutorials/discreteMethods/dsmcFoam/supersonicCorner/Allclean
index 40d55b2780e1d33ea9c069b8c3fa0d17e7d89466..0ea0fe80e8a02c9b88b13ebf0f74d8c83c54a714 100755
--- a/tutorials/discreteMethods/dsmcFoam/supersonicCorner/Allclean
+++ b/tutorials/discreteMethods/dsmcFoam/supersonicCorner/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/discreteMethods/dsmcFoam/supersonicCorner/Allrun b/tutorials/discreteMethods/dsmcFoam/supersonicCorner/Allrun
index 0c110250f64d4e72af0e6430c446a4de84065b11..81fa228b7c3e116cdbbe0fbbfed7f6116a826b8b 100755
--- a/tutorials/discreteMethods/dsmcFoam/supersonicCorner/Allrun
+++ b/tutorials/discreteMethods/dsmcFoam/supersonicCorner/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication decomposePar
diff --git a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/Allclean b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/Allclean
index 40d55b2780e1d33ea9c069b8c3fa0d17e7d89466..0ea0fe80e8a02c9b88b13ebf0f74d8c83c54a714 100755
--- a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/Allclean
+++ b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/Allrun b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/Allrun
index 0c110250f64d4e72af0e6430c446a4de84065b11..81fa228b7c3e116cdbbe0fbbfed7f6116a826b8b 100755
--- a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/Allrun
+++ b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication decomposePar
diff --git a/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeArgon/Allclean b/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeArgon/Allclean
index 2b07ff650e14ce13b21d4fce16b8d80b269eea05..d339fd915d33833c2aa87db41c2a58e1c119950c 100755
--- a/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeArgon/Allclean
+++ b/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeArgon/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeArgon/Allrun b/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeArgon/Allrun
index 2ec6f7b07787b67e675e822e53b173d11be5a8b0..f429da9ee6d5c7e7bac5b0d554afe99268c3e2f9 100755
--- a/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeArgon/Allrun
+++ b/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeArgon/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication mdInitialise
diff --git a/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeWater/Allclean b/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeWater/Allclean
index ca2f48ed946d2ff786cc1cad3152a06d475edd6c..de4a6f9529bd75b9cc521288e74de4779f679647 100755
--- a/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeWater/Allclean
+++ b/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeWater/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeWater/Allrun b/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeWater/Allrun
index 2ec6f7b07787b67e675e822e53b173d11be5a8b0..f429da9ee6d5c7e7bac5b0d554afe99268c3e2f9 100755
--- a/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeWater/Allrun
+++ b/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeWater/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication mdInitialise
diff --git a/tutorials/discreteMethods/molecularDynamics/mdFoam/nanoNozzle/Allclean b/tutorials/discreteMethods/molecularDynamics/mdFoam/nanoNozzle/Allclean
index bc26045cbdaa72021233f6d9ac711e64d37c1280..94302fe36db4c72a73c0be93688bc84f67311bb8 100755
--- a/tutorials/discreteMethods/molecularDynamics/mdFoam/nanoNozzle/Allclean
+++ b/tutorials/discreteMethods/molecularDynamics/mdFoam/nanoNozzle/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 rm -rf processor[0-9]
diff --git a/tutorials/discreteMethods/molecularDynamics/mdFoam/nanoNozzle/Allrun b/tutorials/discreteMethods/molecularDynamics/mdFoam/nanoNozzle/Allrun
index cd4b14a1f9b94d4e8bb416b6f30dfdec11f5573e..ce8fbd4a6e337cb4c974fe0fd2e4b90cc30ba8cd 100755
--- a/tutorials/discreteMethods/molecularDynamics/mdFoam/nanoNozzle/Allrun
+++ b/tutorials/discreteMethods/molecularDynamics/mdFoam/nanoNozzle/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication decomposePar
diff --git a/tutorials/electromagnetics/mhdFoam/hartmann/Allclean b/tutorials/electromagnetics/mhdFoam/hartmann/Allclean
index f2d7cca6654b78c6b98a88e7508f8ab445a8a4e7..98dd91e6270ee80094e5c8fb6b38cf3190db0423 100755
--- a/tutorials/electromagnetics/mhdFoam/hartmann/Allclean
+++ b/tutorials/electromagnetics/mhdFoam/hartmann/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 cleanSamples
diff --git a/tutorials/electromagnetics/mhdFoam/hartmann/Allrun b/tutorials/electromagnetics/mhdFoam/hartmann/Allrun
index 23a6711db49b2c65bb7ee5d231411f01e82faf92..c9f32b50334601d6a6cd8a6a5ac4a71d8420f7b3 100755
--- a/tutorials/electromagnetics/mhdFoam/hartmann/Allrun
+++ b/tutorials/electromagnetics/mhdFoam/hartmann/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication $(getApplication)
diff --git a/tutorials/finiteArea/liquidFilmFoam/cylinder/Allclean b/tutorials/finiteArea/liquidFilmFoam/cylinder/Allclean
index e852bce316ab80215483776eb026b49c88d8ac85..d7d93d437a9770a35c88b6842fc6e7a7cc855bb8 100755
--- a/tutorials/finiteArea/liquidFilmFoam/cylinder/Allclean
+++ b/tutorials/finiteArea/liquidFilmFoam/cylinder/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 cleanFaMesh
diff --git a/tutorials/finiteArea/liquidFilmFoam/cylinder/Allrun b/tutorials/finiteArea/liquidFilmFoam/cylinder/Allrun
index f1511c6a4c4600a62c26590743b12a344f0f57ec..f207549b2653037c094ee80d7dd95172c8bee41e 100755
--- a/tutorials/finiteArea/liquidFilmFoam/cylinder/Allrun
+++ b/tutorials/finiteArea/liquidFilmFoam/cylinder/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/finiteArea/sphereSurfactantFoam/sphereTransport/Allclean b/tutorials/finiteArea/sphereSurfactantFoam/sphereTransport/Allclean
index b1673ba4c14beebd264413db6ade7d30bae841e6..2bc5ca855ba05a4ac47d80a58c29d018206b3550 100755
--- a/tutorials/finiteArea/sphereSurfactantFoam/sphereTransport/Allclean
+++ b/tutorials/finiteArea/sphereSurfactantFoam/sphereTransport/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanTimeDirectories
 
diff --git a/tutorials/finiteArea/sphereSurfactantFoam/sphereTransport/Allrun b/tutorials/finiteArea/sphereSurfactantFoam/sphereTransport/Allrun
index c7b66d2c6e00ef3d9bd6330a7bf3a28e45c16b1f..f85e00b1df61a7937ed54dde013fc659f6e01642 100755
--- a/tutorials/finiteArea/sphereSurfactantFoam/sphereTransport/Allrun
+++ b/tutorials/finiteArea/sphereSurfactantFoam/sphereTransport/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication makeFaMesh
 
diff --git a/tutorials/finiteArea/sphereSurfactantFoam/sphereTransport/Allrun-parallel b/tutorials/finiteArea/sphereSurfactantFoam/sphereTransport/Allrun-parallel
index 178280c9f969a2a87023c3ed6fddc4f56db49b40..8729c38a33fe4da0e321f77b9a581680c679fd99 100755
--- a/tutorials/finiteArea/sphereSurfactantFoam/sphereTransport/Allrun-parallel
+++ b/tutorials/finiteArea/sphereSurfactantFoam/sphereTransport/Allrun-parallel
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication makeFaMesh
 
diff --git a/tutorials/finiteArea/surfactantFoam/planeTransport/Allclean b/tutorials/finiteArea/surfactantFoam/planeTransport/Allclean
index e852bce316ab80215483776eb026b49c88d8ac85..d7d93d437a9770a35c88b6842fc6e7a7cc855bb8 100755
--- a/tutorials/finiteArea/surfactantFoam/planeTransport/Allclean
+++ b/tutorials/finiteArea/surfactantFoam/planeTransport/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 cleanFaMesh
diff --git a/tutorials/finiteArea/surfactantFoam/planeTransport/Allrun b/tutorials/finiteArea/surfactantFoam/planeTransport/Allrun
index f1511c6a4c4600a62c26590743b12a344f0f57ec..f207549b2653037c094ee80d7dd95172c8bee41e 100755
--- a/tutorials/finiteArea/surfactantFoam/planeTransport/Allrun
+++ b/tutorials/finiteArea/surfactantFoam/planeTransport/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/Allclean b/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/Allclean
index 01dae1a898f6a90e6513df4c3e0442276e006814..09f79e4c44cd3d76a42d3f0cf23b88ea64f602b5 100755
--- a/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/Allclean
+++ b/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 rm -f 0/T
diff --git a/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/Allrun b/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/Allrun
index f8719a73da30390fa5d245728ada1604136f7956..702f175a27e8df3eff238f2d9b36ae286fabb327 100755
--- a/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/Allrun
+++ b/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 \cp 0/T.orig 0/T
diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/Allclean b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/Allclean
index 01dae1a898f6a90e6513df4c3e0442276e006814..09f79e4c44cd3d76a42d3f0cf23b88ea64f602b5 100755
--- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/Allclean
+++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 rm -f 0/T
diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/Allrun b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/Allrun
index f8719a73da30390fa5d245728ada1604136f7956..702f175a27e8df3eff238f2d9b36ae286fabb327 100755
--- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/Allrun
+++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 \cp 0/T.orig 0/T
diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/Allrun b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/Allrun
index d0102481dad50ff2591db553dc02ed422e7319e2..d30df690ac31d50619a729e1ecc03df0a22366ee 100755
--- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/Allrun
+++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/Allclean b/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/Allclean
+++ b/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/Allrun b/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/Allrun
index 1e6177fd59488a4f085a1dbbd61f63bc559c52ca..869182a7b59be4d6df3a31b30254e510c7582ec8 100755
--- a/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/Allrun
+++ b/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/heatTransfer/buoyantPimpleFoam/thermocoupleTestCase/Allclean b/tutorials/heatTransfer/buoyantPimpleFoam/thermocoupleTestCase/Allclean
index be7ddb068847225ad69704840909a7b0d05a5466..e8557c25549b9369ce8225c99735bdfb9731e96c 100755
--- a/tutorials/heatTransfer/buoyantPimpleFoam/thermocoupleTestCase/Allclean
+++ b/tutorials/heatTransfer/buoyantPimpleFoam/thermocoupleTestCase/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/heatTransfer/buoyantPimpleFoam/thermocoupleTestCase/Allrun b/tutorials/heatTransfer/buoyantPimpleFoam/thermocoupleTestCase/Allrun
index e0f9af4df86f647b2876b3684279d5d511b10570..088ddcd32565e1824e7e6ce4993e368fa2cc7e68 100755
--- a/tutorials/heatTransfer/buoyantPimpleFoam/thermocoupleTestCase/Allrun
+++ b/tutorials/heatTransfer/buoyantPimpleFoam/thermocoupleTestCase/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication $(getApplication)
diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/Allclean b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/Allclean
index 8ad093a08cd5ec8b5cc86938986490d31c6ea84d..e719ed465cb5a09d46ab3687fa645c4fc7d6368d 100755
--- a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/Allclean
+++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 rm -f validation/*.eps
diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/Allrun b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/Allrun
index 4c6c679c3f6b015cd369329acf66cf56c7ea05b8..5b605dd4676619710c52325b4fcd3edbd46cd8ba 100755
--- a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/Allrun
+++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication $(getApplication)
diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/Allclean b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/Allclean
index 0e33c8258de7c6fc74ebecf4aecd0404c3a7a7ad..2907d2d9f7d3b2df1867794aaeab9529f542ea73 100755
--- a/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/Allclean
+++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/Allrun b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/Allrun
index 357dac9b56c4c67eac6693ff95c47790fe73ff86..d6999403aad68347ced56e4d435f49df9a3684f4 100755
--- a/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/Allrun
+++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/Allclean b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/Allclean
index be7ddb068847225ad69704840909a7b0d05a5466..e8557c25549b9369ce8225c99735bdfb9731e96c 100755
--- a/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/Allclean
+++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/Allrun b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/Allrun
index e0f9af4df86f647b2876b3684279d5d511b10570..088ddcd32565e1824e7e6ce4993e368fa2cc7e68 100755
--- a/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/Allrun
+++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication $(getApplication)
diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/Allclean b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/Allclean
index be7ddb068847225ad69704840909a7b0d05a5466..e8557c25549b9369ce8225c99735bdfb9731e96c 100755
--- a/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/Allclean
+++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/Allrun b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/Allrun
index e0f9af4df86f647b2876b3684279d5d511b10570..088ddcd32565e1824e7e6ce4993e368fa2cc7e68 100755
--- a/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/Allrun
+++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication $(getApplication)
diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/Allclean b/tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/Allclean
index 342040ed73d17a81a53f339c1b1945621db03b6e..f429ffa51890a22e92d3408e4f1dcd6f5123c4ff 100755
--- a/tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/Allclean
+++ b/tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 rm -rf constant/extendedFeatureEdgeMesh
diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/Allrun b/tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/Allrun
index 6a6927542dfca4d37b60ba373f81336ef3e5b211..584ebb4d51927d93927b460a9bdc6d193a0c6de6 100755
--- a/tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/Allrun
+++ b/tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/Allclean b/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/Allclean
index 9016f2cd4f75a6821ee22bd48c93c997bd1a1b3d..3c2e6a7a1b826475ca5a1141c32f3b55afb3b12c 100755
--- a/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/Allclean
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/Allrun b/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/Allrun
index 25b14f2bb7ce56d0986ac0f2526c653f2d10fde8..57031d0b1761ab90990242f43ccd5497164cab3e 100755
--- a/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/Allrun
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/Allrun.pre b/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/Allrun.pre
index d48a059e428ae728a0182beadda0570248820f95..4c7b942d3c6189b4a4ddc9be04f73f1514d278a4 100755
--- a/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/Allrun.pre
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication topoSet
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/externalSolver b/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/externalSolver
index 559fdd1ae3116ed694893585ef004945cbb48363..0fc3f12b3ffdf36cf6119742dc0c288c48c0cfa9 100755
--- a/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/externalSolver
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/externalSolver
@@ -1,7 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/RunFunctions    # Tutorial run functions
-
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 # Dummy external solver to communicate with OpenFOAM via externalCoupled
 # functionObject
 #
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allclean b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allclean
index 66932422e09a4d230f484d602c9b31c96301d56e..1b62f31e6c1f9ffd67595459812324efd6dec57a 100755
--- a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allclean
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 \rm allVisibleFaces.obj 2>/dev/null
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun
index afb775bd7e90d1fe4a390fc2990a30e4a8d986db..f1b440f68618e35e0de627e92972a6e940050614 100755
--- a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Setup case
 ./Allrun.pre
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun-parallel b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun-parallel
index 3415a2357493cbf1e6c7bbe23deee54ef6d6e433..a979447d868950b10f4425826a27a68709c6f112 100755
--- a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun-parallel
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun-parallel
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Setup case
 ./Allrun.pre
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun.pre b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun.pre
index e47b1602008dd4d56f0c7f59ad864ea598adfb9f..9c696a8f4ced804afd84044addd2f6ad806f01f0 100755
--- a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun.pre
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication topoSet
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/Allclean b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/Allclean
index 711e9348ef5ce23a47a7d211d44b4bf3ac2fef91..2e76195c16b9520c2e08217b0803ee1dab163615 100755
--- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/Allclean
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/Allrun b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/Allrun
index efa35f3218af2a9503d962287849d5e67a8cf5f0..dbf94315cdcf2439bda469f94638440a6dbafe25 100755
--- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/Allrun
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication ./Allrun.pre
 
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/Allrun.pre b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/Allrun.pre
index fed73443286749ce07f47e855c228ff49dcfb043..d447fa5ec05506b1dcd07c9dc215da4d00cafb0f 100755
--- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/Allrun.pre
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication topoSet
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/reverseBurner/Allclean b/tutorials/heatTransfer/chtMultiRegionFoam/reverseBurner/Allclean
index 53071c9ab44ebe7cf0a8920aa0931e09deea1b6e..949547bf1063a8b4aea7708032f79b24caae7c39 100755
--- a/tutorials/heatTransfer/chtMultiRegionFoam/reverseBurner/Allclean
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/reverseBurner/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/reverseBurner/Allrun b/tutorials/heatTransfer/chtMultiRegionFoam/reverseBurner/Allrun
index 69d93eb5439b8ba4ac38f17fafe42c1812493062..68b6e132600161a0f5b88238cc4483d96f70584c 100755
--- a/tutorials/heatTransfer/chtMultiRegionFoam/reverseBurner/Allrun
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/reverseBurner/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/Allclean b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/Allclean
index 73ee293a5c2549081237bf1f3193ec392f70e7a3..2fb31b75ece79ed3770d780978bf094ea5724077 100755
--- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/Allclean
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/Allrun-parallel b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/Allrun-parallel
index 5e3d4522758439533cf810d1877cdaf925da51d5..c74e82429e9249653e06b5821e1fea136117e0e7 100755
--- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/Allrun-parallel
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/Allrun-parallel
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 rm -rf constant/polyMesh/sets
 
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/Allrun-serial b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/Allrun-serial
index df169f31dddb98d87854c67027fa93780b0d4456..cd20166ef60382f4f62f8380b43ac9e14e357b01 100755
--- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/Allrun-serial
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/Allrun-serial
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 rm -rf constant/polyMesh/sets
 
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/Allclean b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/Allclean
index 001719f751601075824df6a26583e095536b3fc0..cd6acf86f42b0ee1c09ed678903d92153f4eae6b 100755
--- a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/Allclean
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/Allrun b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/Allrun
index 51e2df24b4fa8f5831cbebccace85216d9e599e9..79dabc1bea4c415b6a8876dae390b3776902f5c3 100755
--- a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/Allrun
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # create the underlying block mesh
 runApplication blockMesh
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/Allrun-parallel b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/Allrun-parallel
index d306f7901f6b8bcdc2fc997d9d7b34a558a4755f..5fda76fc87108e66bd963e14c46c3a24d9dc665d 100755
--- a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/Allrun-parallel
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/Allrun-parallel
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # create the underlying block mesh
 runApplication blockMesh
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/Allclean b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/Allclean
index 001719f751601075824df6a26583e095536b3fc0..cd6acf86f42b0ee1c09ed678903d92153f4eae6b 100755
--- a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/Allclean
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/Allrun b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/Allrun
index 4a206678cd0030722f1dd69879ce535e800b17c8..2a91080485c31267ffce82ef2afcef6ece5d27e9 100755
--- a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/Allrun
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/Allrun-parallel b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/Allrun-parallel
index fcee42a2020d328386cd9f4bd7f47ffbaf7876ca..6e6ce7c873caa3704d7596751383b46c2a64eb33 100755
--- a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/Allrun-parallel
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/Allrun-parallel
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/Allrun.pre b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/Allrun.pre
index 69ef3caa41954217a56e14dd349ee90cc96a6d55..ef9eb777a1738ceb27f1394a7622dec36816c2ab 100755
--- a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/Allrun.pre
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # create the underlying block mesh
 runApplication blockMesh
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/Allclean b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/Allclean
index 8421c96559b979b6532d8c2384e1b6d939e6bc8f..458716d072084c99ecb5db500446751e43262eaa 100755
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/Allclean
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/Allrun b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/Allrun
index 25b14f2bb7ce56d0986ac0f2526c653f2d10fde8..57031d0b1761ab90990242f43ccd5497164cab3e 100755
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/Allrun
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/Allrun.pre b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/Allrun.pre
index d48a059e428ae728a0182beadda0570248820f95..4c7b942d3c6189b4a4ddc9be04f73f1514d278a4 100755
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/Allrun.pre
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication topoSet
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/externalSolver b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/externalSolver
index 6123b21c006e0bb5b137db948c995f9899c75491..8f6b9f5a299074f53124d1027b994561fc747767 100755
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/externalSolver
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/externalSolver
@@ -1,7 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/RunFunctions    # Tutorial run functions
-
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 # Dummy external solver to communicate with OpenFOAM via externalCoupled
 # functionObject
 #
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/Allclean b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/Allclean
index 2d12f3a3ee482bb0104c598983ae9520658e9cf8..1ae868298400a21c6dc0b0b7db39f8b616ff78bd 100755
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/Allclean
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/Allrun b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/Allrun
index 4a206678cd0030722f1dd69879ce535e800b17c8..2a91080485c31267ffce82ef2afcef6ece5d27e9 100755
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/Allrun
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/Allrun-parallel b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/Allrun-parallel
index 2527a2edf58e2acfc12758b67dfac58ef9228507..daa14943ff33a26efce070512b6925cfec255459 100755
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/Allrun-parallel
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/Allrun-parallel
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/Allrun.pre b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/Allrun.pre
index 5e972ad1d5a4a3ea10a8a813a4a9271a8e9755a1..4b8043f2c19b1a5eefb20cd3b12facc1529a1e3c 100755
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/Allrun.pre
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Create meshes
 runApplication -s air    blockMesh -region air
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/Allclean b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/Allclean
index 6d4b7f5c83ef249c9951f7bb37d0dd66f5d6cfb0..e61516f8d0055bb3fe3de75ed094a9d4266d2c71 100755
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/Allclean
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/Allrun b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/Allrun
index b7d6fe2a4db20d66ebae6efa4fc99a9de3f95186..87973b2e385d503cf1185bf45fd392b346d64fbd 100755
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/Allrun
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/Allrun-parallel b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/Allrun-parallel
index 26499f2115259a9ad880aa4bcb57621e8ec5577d..ec197706659cde5624243d5e66749fdd26a2e354 100755
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/Allrun-parallel
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/Allrun-parallel
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/Allrun.pre b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/Allrun.pre
index 4197c7f941c38f9f5d2e3ba123a4fec4a1d2cf35..07b11abc0b7ea83edaba4304d06de29750bf4713 100755
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/Allrun.pre
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Create meshe
 runApplication -s solid blockMesh -region solid
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/Allclean b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/Allclean
index 84fbcbcc3fb4c6658cd3e81fe4aee91de3a74c8e..7c649775f27ef84250704ccf4dc5175c9207794c 100755
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/Allclean
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/Allrun b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/Allrun
index eecc8c8ce30dba7048f9bb40e55366a411496e39..5015d6719a90a382ff12e432f5c4f3684eb941de 100755
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/Allrun
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Setup case
 ./Allrun.pre
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/Allrun-parallel b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/Allrun-parallel
index 0ea963af1dfd5f60a2fb6f015ebb144c71a9812f..dcb0d0c9ad9f1b536b2900f2c51e0f900209dc48 100755
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/Allrun-parallel
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/Allrun-parallel
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Setup case
 ./Allrun.pre
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/Allrun.pre b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/Allrun.pre
index 85223fb20a661cace15eeff47bb58153ee1c457b..08a3576bd636b4e08faba7a502fcc0247b2efcff 100755
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/Allrun.pre
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication topoSet
diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/Allclean b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/Allclean
index 0aed8a228195d513f9cb0eb280552f9a803ad78d..0fc41d934fa026175d950eb15869793913790f49 100755
--- a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/Allclean
+++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/Allrun b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/Allrun
index 3f3d938956aed16660a5b98880c66b8b6797b337..2a91080485c31267ffce82ef2afcef6ece5d27e9 100755
--- a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/Allrun
+++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/Allrun
@@ -1,13 +1,10 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Source tutorial run functions
-. $WM_PROJECT_DIR/bin/tools/RunFunctions
-
-application=$(getApplication)
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
-runApplication $application
+runApplication $(getApplication)
 
 #------------------------------------------------------------------------------
diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/Allrun.pre b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/Allrun.pre
index bed1272eb3a4da0ab801f3db4a4daebf8679c60c..b22cf80d33219d067d849e9ec789eef4dd086325 100755
--- a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/Allrun.pre
+++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication topoSet
diff --git a/tutorials/heatTransfer/overBuoyantPimpleDyMFoam/movingBox/Allclean b/tutorials/heatTransfer/overBuoyantPimpleDyMFoam/movingBox/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/heatTransfer/overBuoyantPimpleDyMFoam/movingBox/Allclean
+++ b/tutorials/heatTransfer/overBuoyantPimpleDyMFoam/movingBox/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/heatTransfer/overBuoyantPimpleDyMFoam/movingBox/Allrun b/tutorials/heatTransfer/overBuoyantPimpleDyMFoam/movingBox/Allrun
index ad941f4ac5ad6d250427fa994c4f8feb0cd55786..6451e7454e83e4770ba6acab4b8759ce41978a9c 100755
--- a/tutorials/heatTransfer/overBuoyantPimpleDyMFoam/movingBox/Allrun
+++ b/tutorials/heatTransfer/overBuoyantPimpleDyMFoam/movingBox/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/heatTransfer/overBuoyantPimpleDyMFoam/movingBox/Allrun.pre b/tutorials/heatTransfer/overBuoyantPimpleDyMFoam/movingBox/Allrun.pre
index abccd3163c95858a729642290f99bd730f2d248b..308bbee9fd4e07a61fd4924b3256442436eab675 100755
--- a/tutorials/heatTransfer/overBuoyantPimpleDyMFoam/movingBox/Allrun.pre
+++ b/tutorials/heatTransfer/overBuoyantPimpleDyMFoam/movingBox/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/Allrun b/tutorials/incompressible/SRFPimpleFoam/rotor2D/Allrun
index 5db0a1c8e5a022ae01d798031504740b33e1af13..b069c38b3f36d4d3752f0c2ed834b7a6a20dcb79 100755
--- a/tutorials/incompressible/SRFPimpleFoam/rotor2D/Allrun
+++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./makeMesh
 runApplication $(getApplication)
diff --git a/tutorials/incompressible/adjointOptimisationFoam/Allrun b/tutorials/incompressible/adjointOptimisationFoam/Allrun
index 0912ec72bb2008c9e87f1dc7bd2c7498b71c3279..e83f1fe8b54c4ddab8df989fa29567651c64521c 100755
--- a/tutorials/incompressible/adjointOptimisationFoam/Allrun
+++ b/tutorials/incompressible/adjointOptimisationFoam/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 if notTest $@
 then
diff --git a/tutorials/incompressible/adjointOptimisationFoam/motorBike/Allclean b/tutorials/incompressible/adjointOptimisationFoam/motorBike/Allclean
index a0bb1b4d393264805bc967260a37c840225fc70e..3a7ec0e9ca2ab458a51a8d7b72c9fd303d9e6cd4 100755
--- a/tutorials/incompressible/adjointOptimisationFoam/motorBike/Allclean
+++ b/tutorials/incompressible/adjointOptimisationFoam/motorBike/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/incompressible/adjointOptimisationFoam/motorBike/Allrun b/tutorials/incompressible/adjointOptimisationFoam/motorBike/Allrun
index 03610ff0df920bd13625a58ae52f4e94f7a36c83..b1ce817b95d78a3c43d61cde4309d74583b1fce2 100755
--- a/tutorials/incompressible/adjointOptimisationFoam/motorBike/Allrun
+++ b/tutorials/incompressible/adjointOptimisationFoam/motorBike/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Alternative decomposeParDict name:
 decompDict="-decomposeParDict system/decomposeParDict.20"
diff --git a/tutorials/incompressible/adjointOptimisationFoam/naca0012/laminar/drag/Allclean b/tutorials/incompressible/adjointOptimisationFoam/naca0012/laminar/drag/Allclean
index 289939fbe9f20ab28316b31fe66c0c23743b7d8a..e8557c25549b9369ce8225c99735bdfb9731e96c 100755
--- a/tutorials/incompressible/adjointOptimisationFoam/naca0012/laminar/drag/Allclean
+++ b/tutorials/incompressible/adjointOptimisationFoam/naca0012/laminar/drag/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/incompressible/adjointOptimisationFoam/naca0012/laminar/drag/Allrun b/tutorials/incompressible/adjointOptimisationFoam/naca0012/laminar/drag/Allrun
index ce49e97d662a01541794ce9102920478efb327be..0b2935e1a69f0303087669eaa1328f7ed542a9b2 100755
--- a/tutorials/incompressible/adjointOptimisationFoam/naca0012/laminar/drag/Allrun
+++ b/tutorials/incompressible/adjointOptimisationFoam/naca0012/laminar/drag/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 resourcesDir=$FOAM_TUTORIALS/incompressible/adjointOptimisationFoam/resources
 
diff --git a/tutorials/incompressible/adjointOptimisationFoam/naca0012/laminar/lift/Allclean b/tutorials/incompressible/adjointOptimisationFoam/naca0012/laminar/lift/Allclean
index 289939fbe9f20ab28316b31fe66c0c23743b7d8a..e8557c25549b9369ce8225c99735bdfb9731e96c 100755
--- a/tutorials/incompressible/adjointOptimisationFoam/naca0012/laminar/lift/Allclean
+++ b/tutorials/incompressible/adjointOptimisationFoam/naca0012/laminar/lift/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/incompressible/adjointOptimisationFoam/naca0012/laminar/lift/Allrun b/tutorials/incompressible/adjointOptimisationFoam/naca0012/laminar/lift/Allrun
index ce49e97d662a01541794ce9102920478efb327be..0b2935e1a69f0303087669eaa1328f7ed542a9b2 100755
--- a/tutorials/incompressible/adjointOptimisationFoam/naca0012/laminar/lift/Allrun
+++ b/tutorials/incompressible/adjointOptimisationFoam/naca0012/laminar/lift/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 resourcesDir=$FOAM_TUTORIALS/incompressible/adjointOptimisationFoam/resources
 
diff --git a/tutorials/incompressible/adjointOptimisationFoam/naca0012/laminar/moment/Allclean b/tutorials/incompressible/adjointOptimisationFoam/naca0012/laminar/moment/Allclean
index 289939fbe9f20ab28316b31fe66c0c23743b7d8a..e8557c25549b9369ce8225c99735bdfb9731e96c 100755
--- a/tutorials/incompressible/adjointOptimisationFoam/naca0012/laminar/moment/Allclean
+++ b/tutorials/incompressible/adjointOptimisationFoam/naca0012/laminar/moment/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/incompressible/adjointOptimisationFoam/naca0012/laminar/moment/Allrun b/tutorials/incompressible/adjointOptimisationFoam/naca0012/laminar/moment/Allrun
index ce49e97d662a01541794ce9102920478efb327be..0b2935e1a69f0303087669eaa1328f7ed542a9b2 100755
--- a/tutorials/incompressible/adjointOptimisationFoam/naca0012/laminar/moment/Allrun
+++ b/tutorials/incompressible/adjointOptimisationFoam/naca0012/laminar/moment/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 resourcesDir=$FOAM_TUTORIALS/incompressible/adjointOptimisationFoam/resources
 
diff --git a/tutorials/incompressible/adjointOptimisationFoam/naca0012/turbulent/liftFullSetup/Allclean b/tutorials/incompressible/adjointOptimisationFoam/naca0012/turbulent/liftFullSetup/Allclean
index 289939fbe9f20ab28316b31fe66c0c23743b7d8a..e8557c25549b9369ce8225c99735bdfb9731e96c 100755
--- a/tutorials/incompressible/adjointOptimisationFoam/naca0012/turbulent/liftFullSetup/Allclean
+++ b/tutorials/incompressible/adjointOptimisationFoam/naca0012/turbulent/liftFullSetup/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/incompressible/adjointOptimisationFoam/naca0012/turbulent/liftFullSetup/Allrun b/tutorials/incompressible/adjointOptimisationFoam/naca0012/turbulent/liftFullSetup/Allrun
index ce49e97d662a01541794ce9102920478efb327be..0b2935e1a69f0303087669eaa1328f7ed542a9b2 100755
--- a/tutorials/incompressible/adjointOptimisationFoam/naca0012/turbulent/liftFullSetup/Allrun
+++ b/tutorials/incompressible/adjointOptimisationFoam/naca0012/turbulent/liftFullSetup/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 resourcesDir=$FOAM_TUTORIALS/incompressible/adjointOptimisationFoam/resources
 
diff --git a/tutorials/incompressible/adjointOptimisationFoam/naca0012/turbulent/liftMinimumSetup/Allclean b/tutorials/incompressible/adjointOptimisationFoam/naca0012/turbulent/liftMinimumSetup/Allclean
index 289939fbe9f20ab28316b31fe66c0c23743b7d8a..e8557c25549b9369ce8225c99735bdfb9731e96c 100755
--- a/tutorials/incompressible/adjointOptimisationFoam/naca0012/turbulent/liftMinimumSetup/Allclean
+++ b/tutorials/incompressible/adjointOptimisationFoam/naca0012/turbulent/liftMinimumSetup/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/incompressible/adjointOptimisationFoam/naca0012/turbulent/liftMinimumSetup/Allrun b/tutorials/incompressible/adjointOptimisationFoam/naca0012/turbulent/liftMinimumSetup/Allrun
index ce49e97d662a01541794ce9102920478efb327be..0b2935e1a69f0303087669eaa1328f7ed542a9b2 100755
--- a/tutorials/incompressible/adjointOptimisationFoam/naca0012/turbulent/liftMinimumSetup/Allrun
+++ b/tutorials/incompressible/adjointOptimisationFoam/naca0012/turbulent/liftMinimumSetup/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 resourcesDir=$FOAM_TUTORIALS/incompressible/adjointOptimisationFoam/resources
 
diff --git a/tutorials/incompressible/adjointOptimisationFoam/sbend/laminar/Allclean b/tutorials/incompressible/adjointOptimisationFoam/sbend/laminar/Allclean
index 289939fbe9f20ab28316b31fe66c0c23743b7d8a..e8557c25549b9369ce8225c99735bdfb9731e96c 100755
--- a/tutorials/incompressible/adjointOptimisationFoam/sbend/laminar/Allclean
+++ b/tutorials/incompressible/adjointOptimisationFoam/sbend/laminar/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/incompressible/adjointOptimisationFoam/sbend/laminar/Allrun b/tutorials/incompressible/adjointOptimisationFoam/sbend/laminar/Allrun
index 8a7f639223c626eb83112e83e0c0a975a617921b..709d51de20d53a978f02d6a03f2041d0c864fc8f 100755
--- a/tutorials/incompressible/adjointOptimisationFoam/sbend/laminar/Allrun
+++ b/tutorials/incompressible/adjointOptimisationFoam/sbend/laminar/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 resourcesDir=$FOAM_TUTORIALS/incompressible/adjointOptimisationFoam/resources
 
diff --git a/tutorials/incompressible/adjointOptimisationFoam/sbend/turbulent/highRe/Allclean b/tutorials/incompressible/adjointOptimisationFoam/sbend/turbulent/highRe/Allclean
index 289939fbe9f20ab28316b31fe66c0c23743b7d8a..e8557c25549b9369ce8225c99735bdfb9731e96c 100755
--- a/tutorials/incompressible/adjointOptimisationFoam/sbend/turbulent/highRe/Allclean
+++ b/tutorials/incompressible/adjointOptimisationFoam/sbend/turbulent/highRe/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/incompressible/adjointOptimisationFoam/sbend/turbulent/highRe/Allrun b/tutorials/incompressible/adjointOptimisationFoam/sbend/turbulent/highRe/Allrun
index 805648768fb2fe956458e7cd54c7a721e2060a6c..0e54d2da9d544f6cc9d8a3ecf931df24a18f55ac 100755
--- a/tutorials/incompressible/adjointOptimisationFoam/sbend/turbulent/highRe/Allrun
+++ b/tutorials/incompressible/adjointOptimisationFoam/sbend/turbulent/highRe/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 resourcesDir=$FOAM_TUTORIALS/incompressible/adjointOptimisationFoam/resources
 
diff --git a/tutorials/incompressible/adjointOptimisationFoam/sbend/turbulent/lowRe/multiPoint/Allrun b/tutorials/incompressible/adjointOptimisationFoam/sbend/turbulent/lowRe/multiPoint/Allrun
index 805648768fb2fe956458e7cd54c7a721e2060a6c..0e54d2da9d544f6cc9d8a3ecf931df24a18f55ac 100755
--- a/tutorials/incompressible/adjointOptimisationFoam/sbend/turbulent/lowRe/multiPoint/Allrun
+++ b/tutorials/incompressible/adjointOptimisationFoam/sbend/turbulent/lowRe/multiPoint/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 resourcesDir=$FOAM_TUTORIALS/incompressible/adjointOptimisationFoam/resources
 
diff --git a/tutorials/incompressible/adjointOptimisationFoam/sbend/turbulent/lowRe/singlePoint/Allclean b/tutorials/incompressible/adjointOptimisationFoam/sbend/turbulent/lowRe/singlePoint/Allclean
index 289939fbe9f20ab28316b31fe66c0c23743b7d8a..e8557c25549b9369ce8225c99735bdfb9731e96c 100755
--- a/tutorials/incompressible/adjointOptimisationFoam/sbend/turbulent/lowRe/singlePoint/Allclean
+++ b/tutorials/incompressible/adjointOptimisationFoam/sbend/turbulent/lowRe/singlePoint/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/incompressible/adjointOptimisationFoam/sbend/turbulent/lowRe/singlePoint/Allrun b/tutorials/incompressible/adjointOptimisationFoam/sbend/turbulent/lowRe/singlePoint/Allrun
index 805648768fb2fe956458e7cd54c7a721e2060a6c..0e54d2da9d544f6cc9d8a3ecf931df24a18f55ac 100755
--- a/tutorials/incompressible/adjointOptimisationFoam/sbend/turbulent/lowRe/singlePoint/Allrun
+++ b/tutorials/incompressible/adjointOptimisationFoam/sbend/turbulent/lowRe/singlePoint/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 resourcesDir=$FOAM_TUTORIALS/incompressible/adjointOptimisationFoam/resources
 
diff --git a/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/Allclean b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/Allclean
index 53c93d35b810e619696756eb07b4e57745f41f2d..e83c3d283ff8a73cec3c25673fbf101b54d0a8e6 100755
--- a/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/Allclean
+++ b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/Allrun b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/Allrun
index 4f1949fd4691e0a017859b1c9e8ff11c369040fb..0c3635d7b0bd928b224b0394ae98a1d0641a87a8 100755
--- a/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/Allrun
+++ b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/incompressible/icoFoam/cavity/Allclean b/tutorials/incompressible/icoFoam/cavity/Allclean
index 4431913e3bb0e94d5c7918946e9dabc33485f5fc..ccade01d5cf7a006318330bb7f590a4ea45679b0 100755
--- a/tutorials/incompressible/icoFoam/cavity/Allclean
+++ b/tutorials/incompressible/icoFoam/cavity/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 keepCases="cavity cavityGrade cavityClipped"
 loseCases="cavityFine cavityHighRe"
diff --git a/tutorials/incompressible/icoFoam/cavity/Allrun b/tutorials/incompressible/icoFoam/cavity/Allrun
index c1454a28614410fcb5949ca101e46c7b3ae55aa1..322be8f1e37711e3a1f3260f6d6734d29404fa07 100755
--- a/tutorials/incompressible/icoFoam/cavity/Allrun
+++ b/tutorials/incompressible/icoFoam/cavity/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 cavityCases="cavity cavityFine cavityGrade cavityHighRe cavityClipped"
 
diff --git a/tutorials/incompressible/icoFoam/cavityMappingTest/Allclean b/tutorials/incompressible/icoFoam/cavityMappingTest/Allclean
index 63145a3803c964a7279001a71d27d86af2705b09..314c10a431419b3cc18bea598286fecbc3186309 100755
--- a/tutorials/incompressible/icoFoam/cavityMappingTest/Allclean
+++ b/tutorials/incompressible/icoFoam/cavityMappingTest/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 rm -rf constant/coarseMesh
diff --git a/tutorials/incompressible/icoFoam/cavityMappingTest/Allrun b/tutorials/incompressible/icoFoam/cavityMappingTest/Allrun
index 7d2e3238433f143220602390c62137ba8c28d357..bcc22fee981aee981ee2fe3e4d11c5ec8f0cd3ed 100755
--- a/tutorials/incompressible/icoFoam/cavityMappingTest/Allrun
+++ b/tutorials/incompressible/icoFoam/cavityMappingTest/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication -s coarseMesh blockMesh -dict system/blockMeshDict.coarse
 
diff --git a/tutorials/incompressible/icoFoam/cavityMappingTest/Allrun-parallel b/tutorials/incompressible/icoFoam/cavityMappingTest/Allrun-parallel
index 524002c6ec5109c727f4cde7b92a8326f668793a..89785ed735fff0f2f9c72ef1a8dce2bd3ed04d18 100755
--- a/tutorials/incompressible/icoFoam/cavityMappingTest/Allrun-parallel
+++ b/tutorials/incompressible/icoFoam/cavityMappingTest/Allrun-parallel
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication -s coarseMesh blockMesh -dict system/blockMeshDict.coarse
 
diff --git a/tutorials/incompressible/icoFoam/elbow/Allclean b/tutorials/incompressible/icoFoam/elbow/Allclean
index 7238840f835de2ff0295a0c28569724328f58e7d..a3d2f17cbfacfaf5395c586231b733d2c772b90b 100755
--- a/tutorials/incompressible/icoFoam/elbow/Allclean
+++ b/tutorials/incompressible/icoFoam/elbow/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 rm -rf fluentInterface
diff --git a/tutorials/incompressible/icoFoam/elbow/Allrun b/tutorials/incompressible/icoFoam/elbow/Allrun
index a42f83926bc7e90df511ba876a78a4a095036f50..3c3bc9064577ca222c77d7893fd51aa687fb85d4 100755
--- a/tutorials/incompressible/icoFoam/elbow/Allrun
+++ b/tutorials/incompressible/icoFoam/elbow/Allrun
@@ -1,7 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/RunFunctions    # Tutorial run functions
-
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication fluentMeshToFoam elbow.msh
 runApplication $(getApplication)
diff --git a/tutorials/incompressible/lumpedPointMotion/building/Allrun b/tutorials/incompressible/lumpedPointMotion/building/Allrun
index a4568e0b0c2f9f8ca7847b04a2e01a28ebdd0948..c28467b386fb375aeb6e55dcd2a21c15adccfd04 100755
--- a/tutorials/incompressible/lumpedPointMotion/building/Allrun
+++ b/tutorials/incompressible/lumpedPointMotion/building/Allrun
@@ -1,7 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/RunFunctions    # Tutorial run functions
-
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # 1) First run steady-state to establish a good initial field.
 # 2) Copy the latest state-state results for the transient case,
diff --git a/tutorials/incompressible/lumpedPointMotion/building/Allrun.move b/tutorials/incompressible/lumpedPointMotion/building/Allrun.move
index 3f539c8c7e6fecd1ef6dadbd9024c253b8cf91e5..a11a98bb9c681846aaed3bfd2455fdfb16a6abb5 100755
--- a/tutorials/incompressible/lumpedPointMotion/building/Allrun.move
+++ b/tutorials/incompressible/lumpedPointMotion/building/Allrun.move
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # 1) Run meshing
 # 2) Reconstruct
diff --git a/tutorials/incompressible/lumpedPointMotion/building/files/Allrun.movement b/tutorials/incompressible/lumpedPointMotion/building/files/Allrun.movement
index 82baeb53be6fedf66042183e0fd17a09a89ddfb3..95d097375d784adfa885d3ef038a652f289a3512 100755
--- a/tutorials/incompressible/lumpedPointMotion/building/files/Allrun.movement
+++ b/tutorials/incompressible/lumpedPointMotion/building/files/Allrun.movement
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # The 0/ field only
 # runApplication reconstructPar -withZero -time 0
diff --git a/tutorials/incompressible/lumpedPointMotion/building/files/Allrun.transient b/tutorials/incompressible/lumpedPointMotion/building/files/Allrun.transient
index 951dd76adbe140b6b1e25bd27ddf20d0aa4db87f..294dd495561ca1cec8d924fc19d2cb8f52be3a7a 100755
--- a/tutorials/incompressible/lumpedPointMotion/building/files/Allrun.transient
+++ b/tutorials/incompressible/lumpedPointMotion/building/files/Allrun.transient
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Cleanup old junk that may prevent things from starting
 \rm -f comms/OpenFOAM.lock
diff --git a/tutorials/incompressible/lumpedPointMotion/building/steady/Allclean b/tutorials/incompressible/lumpedPointMotion/building/steady/Allclean
index a682e661d13c358b66437c679da236bd65275f3c..75a9307f3ac85eae50c4ee0347c35992259bff2a 100755
--- a/tutorials/incompressible/lumpedPointMotion/building/steady/Allclean
+++ b/tutorials/incompressible/lumpedPointMotion/building/steady/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/incompressible/lumpedPointMotion/building/steady/Allrun b/tutorials/incompressible/lumpedPointMotion/building/steady/Allrun
index fd9ff050c42bc3b5b51d1386ffa21b5caca865c1..20d8cfd6094380b893acf8a1d9e1a7431b9d5fe7 100755
--- a/tutorials/incompressible/lumpedPointMotion/building/steady/Allrun
+++ b/tutorials/incompressible/lumpedPointMotion/building/steady/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/incompressible/lumpedPointMotion/building/steady/Allrun.pre b/tutorials/incompressible/lumpedPointMotion/building/steady/Allrun.pre
index fb357cee7868a5f083c9a8bdab830f023a91e0a1..608b06635afd81c4b654da924906df22476d8a81 100755
--- a/tutorials/incompressible/lumpedPointMotion/building/steady/Allrun.pre
+++ b/tutorials/incompressible/lumpedPointMotion/building/steady/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Copy building from resources directory
 mkdir -p constant/triSurface/
diff --git a/tutorials/incompressible/overPimpleDyMFoam/cylinder/Allrun b/tutorials/incompressible/overPimpleDyMFoam/cylinder/Allrun
index 2d31897a485a9bfeaf56bc63327588e1e6d24041..b33335d4ae48f74ba91df7b56668d707440c16a2 100755
--- a/tutorials/incompressible/overPimpleDyMFoam/cylinder/Allrun
+++ b/tutorials/incompressible/overPimpleDyMFoam/cylinder/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # An extruded mesh around cylinder
 (cd cylinderMesh && ./Allrun.pre)
diff --git a/tutorials/incompressible/overPimpleDyMFoam/cylinder/Allrun.pre b/tutorials/incompressible/overPimpleDyMFoam/cylinder/Allrun.pre
index d87c892a62451ca186022496833adecbd1ae7ef7..a16bf252a5352748c2ba5f5dd883e656ff96d3ef 100755
--- a/tutorials/incompressible/overPimpleDyMFoam/cylinder/Allrun.pre
+++ b/tutorials/incompressible/overPimpleDyMFoam/cylinder/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Extrude mesh around cylinder
 (cd cylinderMesh && ./Allrun.pre)
diff --git a/tutorials/incompressible/overPimpleDyMFoam/cylinder/cylinderAndBackground/Allclean b/tutorials/incompressible/overPimpleDyMFoam/cylinder/cylinderAndBackground/Allclean
index aab71fa2ca4ea5faeb699a7c0497ec6841e7bce5..7a3d92a9d3b9a8627b7413c29072e777e14eb115 100755
--- a/tutorials/incompressible/overPimpleDyMFoam/cylinder/cylinderAndBackground/Allclean
+++ b/tutorials/incompressible/overPimpleDyMFoam/cylinder/cylinderAndBackground/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/incompressible/overPimpleDyMFoam/cylinder/cylinderAndBackground/Allrun b/tutorials/incompressible/overPimpleDyMFoam/cylinder/cylinderAndBackground/Allrun
index 675192355626c531ff90cf1dee41882714fa3ac4..b6b22e10a97e3d62fdf2f178a97290764127d3b1 100755
--- a/tutorials/incompressible/overPimpleDyMFoam/cylinder/cylinderAndBackground/Allrun
+++ b/tutorials/incompressible/overPimpleDyMFoam/cylinder/cylinderAndBackground/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/incompressible/overPimpleDyMFoam/cylinder/cylinderAndBackground/Allrun.pre b/tutorials/incompressible/overPimpleDyMFoam/cylinder/cylinderAndBackground/Allrun.pre
index fb7e1120bdf6d35eb6ad8e21168824b9d13db9d8..82380faff01b62e3b43b4af81d6883995e226802 100755
--- a/tutorials/incompressible/overPimpleDyMFoam/cylinder/cylinderAndBackground/Allrun.pre
+++ b/tutorials/incompressible/overPimpleDyMFoam/cylinder/cylinderAndBackground/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Create background mesh
 runApplication blockMesh
diff --git a/tutorials/incompressible/overPimpleDyMFoam/cylinder/cylinderMesh/Allrun.pre b/tutorials/incompressible/overPimpleDyMFoam/cylinder/cylinderMesh/Allrun.pre
index a86d9586601ab97370e670a5a868563c565ee912..020fb73544e5e42d369146470a5d4d0b99a66619 100755
--- a/tutorials/incompressible/overPimpleDyMFoam/cylinder/cylinderMesh/Allrun.pre
+++ b/tutorials/incompressible/overPimpleDyMFoam/cylinder/cylinderMesh/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Generate mesh from surface (in constant/triSurface)
 runApplication extrudeMesh
diff --git a/tutorials/incompressible/overPimpleDyMFoam/simpleRotor/Allclean b/tutorials/incompressible/overPimpleDyMFoam/simpleRotor/Allclean
index aab71fa2ca4ea5faeb699a7c0497ec6841e7bce5..7a3d92a9d3b9a8627b7413c29072e777e14eb115 100755
--- a/tutorials/incompressible/overPimpleDyMFoam/simpleRotor/Allclean
+++ b/tutorials/incompressible/overPimpleDyMFoam/simpleRotor/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/incompressible/overPimpleDyMFoam/simpleRotor/Allrun b/tutorials/incompressible/overPimpleDyMFoam/simpleRotor/Allrun
index 2ac685b863be35e06f569f72e5c886c39892268f..9b2c7c33dea58b4696783e5dbafbebdef0737670 100755
--- a/tutorials/incompressible/overPimpleDyMFoam/simpleRotor/Allrun
+++ b/tutorials/incompressible/overPimpleDyMFoam/simpleRotor/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/incompressible/overPimpleDyMFoam/simpleRotor/Allrun.pre b/tutorials/incompressible/overPimpleDyMFoam/simpleRotor/Allrun.pre
index 97b99ad7c6291b0e8ddf74dfc1a284aa49ba350d..59fa20329f5f5637e2ef4291d88dc6417c7f7488 100755
--- a/tutorials/incompressible/overPimpleDyMFoam/simpleRotor/Allrun.pre
+++ b/tutorials/incompressible/overPimpleDyMFoam/simpleRotor/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/Allclean b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/Allclean
index aab71fa2ca4ea5faeb699a7c0497ec6841e7bce5..7a3d92a9d3b9a8627b7413c29072e777e14eb115 100755
--- a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/Allclean
+++ b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/Allrun b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/Allrun
index cd2da7c1423e04509786dadd2d9d68f76f1a7d48..68d65d6908a3ca8b289ca92e4d2e258d72b49b35 100755
--- a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/Allrun
+++ b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/Allrun.pre b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/Allrun.pre
index abccd3163c95858a729642290f99bd730f2d248b..308bbee9fd4e07a61fd4924b3256442436eab675 100755
--- a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/Allrun.pre
+++ b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/incompressible/overSimpleFoam/aeroFoil/Allclean b/tutorials/incompressible/overSimpleFoam/aeroFoil/Allclean
index b7522e086ba0b9240f835a8a37cce15d6380ee10..acf84fc3f6f3864096c922f108cb79e765b918db 100755
--- a/tutorials/incompressible/overSimpleFoam/aeroFoil/Allclean
+++ b/tutorials/incompressible/overSimpleFoam/aeroFoil/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 for caseName in aeroFoil_snappyHexMesh background_snappyHexMesh
 do
diff --git a/tutorials/incompressible/overSimpleFoam/aeroFoil/Allrun b/tutorials/incompressible/overSimpleFoam/aeroFoil/Allrun
index 96bbd15dee0c33df51586074544eda5c1695336e..c8900e50a416545b8bdbac53b8bf4aed67ea31cc 100755
--- a/tutorials/incompressible/overSimpleFoam/aeroFoil/Allrun
+++ b/tutorials/incompressible/overSimpleFoam/aeroFoil/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 ( cd background_overset && ./Allrun )
diff --git a/tutorials/incompressible/overSimpleFoam/aeroFoil/Allrun.pre b/tutorials/incompressible/overSimpleFoam/aeroFoil/Allrun.pre
index e3784e5ab623bed82fd0bcd579a889800a0908f6..51d489ce750c8c1ebf200a3fcadc279db70bfa9b 100755
--- a/tutorials/incompressible/overSimpleFoam/aeroFoil/Allrun.pre
+++ b/tutorials/incompressible/overSimpleFoam/aeroFoil/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Create aeroFoil mesh using snappyHexMesh
 ( cd aeroFoil_snappyHexMesh && ./Allrun.pre )
diff --git a/tutorials/incompressible/overSimpleFoam/aeroFoil/aeroFoil_overset/Allrun.pre b/tutorials/incompressible/overSimpleFoam/aeroFoil/aeroFoil_overset/Allrun.pre
index 66379c68c14dd714aafd88120f553c4acc7f296b..4138f495083040fbdf5949bbd9b8828c689d7a35 100755
--- a/tutorials/incompressible/overSimpleFoam/aeroFoil/aeroFoil_overset/Allrun.pre
+++ b/tutorials/incompressible/overSimpleFoam/aeroFoil/aeroFoil_overset/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Make a 2D mesh by extruding a patch and solve to steady state.
 runApplication extrudeMesh
diff --git a/tutorials/incompressible/overSimpleFoam/aeroFoil/aeroFoil_snappyHexMesh/Allrun.pre b/tutorials/incompressible/overSimpleFoam/aeroFoil/aeroFoil_snappyHexMesh/Allrun.pre
index 7525ed4239fabb65cebaf6bee6fb0398e215491c..a12136770e267a95b67facbe0ddd840b75976973 100755
--- a/tutorials/incompressible/overSimpleFoam/aeroFoil/aeroFoil_snappyHexMesh/Allrun.pre
+++ b/tutorials/incompressible/overSimpleFoam/aeroFoil/aeroFoil_snappyHexMesh/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Make 3D mesh in slab of cells.
 runApplication blockMesh
diff --git a/tutorials/incompressible/overSimpleFoam/aeroFoil/background_overset/Allclean b/tutorials/incompressible/overSimpleFoam/aeroFoil/background_overset/Allclean
index aab71fa2ca4ea5faeb699a7c0497ec6841e7bce5..7a3d92a9d3b9a8627b7413c29072e777e14eb115 100755
--- a/tutorials/incompressible/overSimpleFoam/aeroFoil/background_overset/Allclean
+++ b/tutorials/incompressible/overSimpleFoam/aeroFoil/background_overset/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/incompressible/overSimpleFoam/aeroFoil/background_overset/Allrun b/tutorials/incompressible/overSimpleFoam/aeroFoil/background_overset/Allrun
index c290d0dd5ec6a8e3b0d9fefd21b8966cc1ed8baf..baf931cdc503ae270002c3330d7d8122e6fbd276 100755
--- a/tutorials/incompressible/overSimpleFoam/aeroFoil/background_overset/Allrun
+++ b/tutorials/incompressible/overSimpleFoam/aeroFoil/background_overset/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Serial
 #runApplication $(getApplication)
diff --git a/tutorials/incompressible/overSimpleFoam/aeroFoil/background_overset/Allrun.pre b/tutorials/incompressible/overSimpleFoam/aeroFoil/background_overset/Allrun.pre
index 4ce424d93f8cecc6236b7b7fdb60e6fd2d0937a3..e19a2507e7344762c01bd5dc5aedbf99099e7df4 100755
--- a/tutorials/incompressible/overSimpleFoam/aeroFoil/background_overset/Allrun.pre
+++ b/tutorials/incompressible/overSimpleFoam/aeroFoil/background_overset/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication extrudeMesh
 runApplication createPatch -overwrite
diff --git a/tutorials/incompressible/overSimpleFoam/aeroFoil/background_snappyHexMesh/Allrun.pre b/tutorials/incompressible/overSimpleFoam/aeroFoil/background_snappyHexMesh/Allrun.pre
index c221f0abd3cc10986acc08c4e69f355b3e673b7e..7a00d4bdf401649d6355d77971f61c5bbe1772ab 100755
--- a/tutorials/incompressible/overSimpleFoam/aeroFoil/background_snappyHexMesh/Allrun.pre
+++ b/tutorials/incompressible/overSimpleFoam/aeroFoil/background_snappyHexMesh/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Make 3D mesh in slab of cells.
 runApplication blockMesh
diff --git a/tutorials/incompressible/pimpleFoam/LES/channel395/Allrun b/tutorials/incompressible/pimpleFoam/LES/channel395/Allrun
index 08e91994a5c843d0a69ba137da519be071a5e2e5..b5069031bdc6e07b0bde69d776ce84560edf6713 100755
--- a/tutorials/incompressible/pimpleFoam/LES/channel395/Allrun
+++ b/tutorials/incompressible/pimpleFoam/LES/channel395/Allrun
@@ -1,7 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/RunFunctions    # Tutorial run functions
-
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/incompressible/pimpleFoam/LES/channel395DFSEM/Allrun b/tutorials/incompressible/pimpleFoam/LES/channel395DFSEM/Allrun
index d6690e27eda54fb52c9d89a131855298623c63e2..7bd764e893b379d1606e2fa7a164a99db7d0b8f0 100755
--- a/tutorials/incompressible/pimpleFoam/LES/channel395DFSEM/Allrun
+++ b/tutorials/incompressible/pimpleFoam/LES/channel395DFSEM/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/Allclean b/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/Allclean
index 55b9f196c9354011e33acea50877cd3cfef99d5b..f65bd29f74390a03aba8cae651e1fe26d3759c61 100755
--- a/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/Allclean
+++ b/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/Allrun b/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/Allrun
index c72455aaadc7fa4ed10f0c059421cf5c87ec6263..c72c26537cc61eebb0e4039f14bb4c1503253222 100755
--- a/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/Allrun
+++ b/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/Allrun b/tutorials/incompressible/pimpleFoam/LES/periodicHill/Allrun
index cc19a5cc50a3386d0ecc304f9f1a53a3373a837f..a6c04207fd3a42c475cb79972e8976539a6e17df 100755
--- a/tutorials/incompressible/pimpleFoam/LES/periodicHill/Allrun
+++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 (cd steadyState && ./Allrun)
 
diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/Allrun b/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/Allrun
index 76bc1a00885f7ea87f4ce939cc304721cb133e09..a5100b8e887b8b3bdc93fd25be6f49306894273c 100755
--- a/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/Allrun
+++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/Allclean b/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/Allclean
index be7ddb068847225ad69704840909a7b0d05a5466..e8557c25549b9369ce8225c99735bdfb9731e96c 100755
--- a/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/Allclean
+++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/Allrun b/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/Allrun
index e9f619eed0e6b3acfecbee76293142184cdbe0e7..3d10834d21e45a275d49b946b2dcb4aacdf8bc4f 100755
--- a/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/Allrun
+++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 echo "Linking processor*/ directory"
 for proc in $(\ls -d ../steadyState/processor*)
diff --git a/tutorials/incompressible/pimpleFoam/LES/surfaceMountedCube/fullCase/Allclean b/tutorials/incompressible/pimpleFoam/LES/surfaceMountedCube/fullCase/Allclean
index 68b0e3cddd93cce3931d6767a4a928972215edf5..9d014285a5074258ee600b8d1d3745aa9caf6949 100755
--- a/tutorials/incompressible/pimpleFoam/LES/surfaceMountedCube/fullCase/Allclean
+++ b/tutorials/incompressible/pimpleFoam/LES/surfaceMountedCube/fullCase/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 \rm -rf constant/boundaryData *.png
diff --git a/tutorials/incompressible/pimpleFoam/LES/surfaceMountedCube/fullCase/Allrun b/tutorials/incompressible/pimpleFoam/LES/surfaceMountedCube/fullCase/Allrun
index eeae06e87c9730e1ffd28dd745bc033c6422f767..7c710b144abc9d7804096351bdb4bae8b012e00d 100755
--- a/tutorials/incompressible/pimpleFoam/LES/surfaceMountedCube/fullCase/Allrun
+++ b/tutorials/incompressible/pimpleFoam/LES/surfaceMountedCube/fullCase/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 channelCase=../initChannel
 channelDataDir=$channelCase/postProcessing/surfaces/inlet
diff --git a/tutorials/incompressible/pimpleFoam/LES/surfaceMountedCube/initChannel/Allclean b/tutorials/incompressible/pimpleFoam/LES/surfaceMountedCube/initChannel/Allclean
index 6f39374d14d0dbe7b164746db68e65a204b9d04c..20570952aaed7f2f6fa0ef4c9eb083ad0091b85a 100755
--- a/tutorials/incompressible/pimpleFoam/LES/surfaceMountedCube/initChannel/Allclean
+++ b/tutorials/incompressible/pimpleFoam/LES/surfaceMountedCube/initChannel/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/incompressible/pimpleFoam/LES/surfaceMountedCube/initChannel/Allrun b/tutorials/incompressible/pimpleFoam/LES/surfaceMountedCube/initChannel/Allrun
index 89269cb7ebb597ad83af5410f815a70e4f50757f..562a8539d6c2a73e5545acd3ae11e685ff9a4fc6 100755
--- a/tutorials/incompressible/pimpleFoam/LES/surfaceMountedCube/initChannel/Allrun
+++ b/tutorials/incompressible/pimpleFoam/LES/surfaceMountedCube/initChannel/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication $(getApplication)
diff --git a/tutorials/incompressible/pimpleFoam/LES/vortexShed/Allclean b/tutorials/incompressible/pimpleFoam/LES/vortexShed/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/incompressible/pimpleFoam/LES/vortexShed/Allclean
+++ b/tutorials/incompressible/pimpleFoam/LES/vortexShed/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/incompressible/pimpleFoam/LES/vortexShed/Allrun b/tutorials/incompressible/pimpleFoam/LES/vortexShed/Allrun
index 5f0721f5904e85aac42330a6a912bc3ba2942452..6a8479937691178912458b9b2fdd062506e56db0 100755
--- a/tutorials/incompressible/pimpleFoam/LES/vortexShed/Allrun
+++ b/tutorials/incompressible/pimpleFoam/LES/vortexShed/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 rm -f system/blockMeshDict
 m4 system/blockMeshDict.m4 > system/blockMeshDict
diff --git a/tutorials/incompressible/pimpleFoam/RAS/TJunctionFan/Allclean b/tutorials/incompressible/pimpleFoam/RAS/TJunctionFan/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/incompressible/pimpleFoam/RAS/TJunctionFan/Allclean
+++ b/tutorials/incompressible/pimpleFoam/RAS/TJunctionFan/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/incompressible/pimpleFoam/RAS/TJunctionFan/Allrun b/tutorials/incompressible/pimpleFoam/RAS/TJunctionFan/Allrun
index 7a41c2156897ae219fc29cbdbb8514016648cb11..9f024cb1a80fbd948175921a3e6ef633bb5e51dd 100755
--- a/tutorials/incompressible/pimpleFoam/RAS/TJunctionFan/Allrun
+++ b/tutorials/incompressible/pimpleFoam/RAS/TJunctionFan/Allrun
@@ -1,7 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/RunFunctions    # Tutorial run functions
-
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/incompressible/pimpleFoam/RAS/ellipsekkLOmega/Allclean b/tutorials/incompressible/pimpleFoam/RAS/ellipsekkLOmega/Allclean
index 08f9ce2fadd8c9cfe52cadd2ce8aa7772fd55aae..0b9f2bbd480d78ff7bdd576e0d606f448e940ab9 100755
--- a/tutorials/incompressible/pimpleFoam/RAS/ellipsekkLOmega/Allclean
+++ b/tutorials/incompressible/pimpleFoam/RAS/ellipsekkLOmega/Allclean
@@ -1,10 +1,10 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
 rm -f ppGeometry.vtp 2>/dev/null
 
-
 #------------------------------------------------------------------------------
diff --git a/tutorials/incompressible/pimpleFoam/RAS/ellipsekkLOmega/Allrun b/tutorials/incompressible/pimpleFoam/RAS/ellipsekkLOmega/Allrun
index f54b7a529e9fdf958270c488bf1cb0f9b13d5cfd..56d5f6988b43b87002af6c1a65cc44c5a7b708b9 100755
--- a/tutorials/incompressible/pimpleFoam/RAS/ellipsekkLOmega/Allrun
+++ b/tutorials/incompressible/pimpleFoam/RAS/ellipsekkLOmega/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication ./Allrun.pre
 
diff --git a/tutorials/incompressible/pimpleFoam/RAS/ellipsekkLOmega/Allrun-parallel b/tutorials/incompressible/pimpleFoam/RAS/ellipsekkLOmega/Allrun-parallel
index e23148eef9d1880072762a38224abd7243bd72e0..fcd03d4c7edb4b1d48922054ea1de763ee7afb66 100755
--- a/tutorials/incompressible/pimpleFoam/RAS/ellipsekkLOmega/Allrun-parallel
+++ b/tutorials/incompressible/pimpleFoam/RAS/ellipsekkLOmega/Allrun-parallel
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication ./Allrun.pre
 
diff --git a/tutorials/incompressible/pimpleFoam/RAS/ellipsekkLOmega/Allrun.pre b/tutorials/incompressible/pimpleFoam/RAS/ellipsekkLOmega/Allrun.pre
index e56b451b786a5625052ce5106550e7a76bf84a0d..7aa84ed48245f2ee1df794478297efd3a6775b1b 100755
--- a/tutorials/incompressible/pimpleFoam/RAS/ellipsekkLOmega/Allrun.pre
+++ b/tutorials/incompressible/pimpleFoam/RAS/ellipsekkLOmega/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication transformPoints -scale '(1.6666 1 1)'
diff --git a/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/Allclean b/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/Allclean
+++ b/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/Allrun b/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/Allrun
index 4a206678cd0030722f1dd69879ce535e800b17c8..2a91080485c31267ffce82ef2afcef6ece5d27e9 100755
--- a/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/Allrun
+++ b/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/Allrun-parallel b/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/Allrun-parallel
index c9e323cdb775fc3db8410f50e44da516a826d07f..a3e09fdcc47f7cd604d6e9a5445e2a85d3f75f6f 100755
--- a/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/Allrun-parallel
+++ b/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/Allrun-parallel
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/Allrun.pre b/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/Allrun.pre
index 3d4d5ecf6fe738bd57a8995ebe17f2e77dbde468..ee206e0a7e52249088f5feb03d67b96e3e13a2f3 100755
--- a/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/Allrun.pre
+++ b/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/incompressible/pimpleFoam/RAS/propeller/Allclean b/tutorials/incompressible/pimpleFoam/RAS/propeller/Allclean
index 88ad2ecc84af62529f353d906360cde3e1fc51b3..2c68b22b703de6372ec38defa69502fe814a8b29 100755
--- a/tutorials/incompressible/pimpleFoam/RAS/propeller/Allclean
+++ b/tutorials/incompressible/pimpleFoam/RAS/propeller/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/incompressible/pimpleFoam/RAS/propeller/Allrun b/tutorials/incompressible/pimpleFoam/RAS/propeller/Allrun
index c9e323cdb775fc3db8410f50e44da516a826d07f..a3e09fdcc47f7cd604d6e9a5445e2a85d3f75f6f 100755
--- a/tutorials/incompressible/pimpleFoam/RAS/propeller/Allrun
+++ b/tutorials/incompressible/pimpleFoam/RAS/propeller/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/incompressible/pimpleFoam/RAS/propeller/Allrun.pre b/tutorials/incompressible/pimpleFoam/RAS/propeller/Allrun.pre
index 78478afc1ea8ff7a9766753c8f0c66e5fad8efdc..73f3089c1e3fb33420548a5204ba188cc7d1974f 100755
--- a/tutorials/incompressible/pimpleFoam/RAS/propeller/Allrun.pre
+++ b/tutorials/incompressible/pimpleFoam/RAS/propeller/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # copy propeller surface from resources directory
 cp $FOAM_TUTORIALS/resources/geometry/propellerTip.obj.gz constant/triSurface/
diff --git a/tutorials/incompressible/pimpleFoam/RAS/rotatingFanInRoom/Allclean b/tutorials/incompressible/pimpleFoam/RAS/rotatingFanInRoom/Allclean
index a9ed62923eff98e84d24f00e1a5c523ff7dd38e1..d6a9c54b763b152809077c2818a282121e5bd0f9 100755
--- a/tutorials/incompressible/pimpleFoam/RAS/rotatingFanInRoom/Allclean
+++ b/tutorials/incompressible/pimpleFoam/RAS/rotatingFanInRoom/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/incompressible/pimpleFoam/RAS/rotatingFanInRoom/Allrun b/tutorials/incompressible/pimpleFoam/RAS/rotatingFanInRoom/Allrun
index c9e323cdb775fc3db8410f50e44da516a826d07f..a3e09fdcc47f7cd604d6e9a5445e2a85d3f75f6f 100755
--- a/tutorials/incompressible/pimpleFoam/RAS/rotatingFanInRoom/Allrun
+++ b/tutorials/incompressible/pimpleFoam/RAS/rotatingFanInRoom/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/incompressible/pimpleFoam/RAS/rotatingFanInRoom/Allrun.pre b/tutorials/incompressible/pimpleFoam/RAS/rotatingFanInRoom/Allrun.pre
index 747230604c07ad360e6991972685deab258e3d12..14cfb9ef36f9ee1a0c5f89db54e0b464d6e2ac37 100755
--- a/tutorials/incompressible/pimpleFoam/RAS/rotatingFanInRoom/Allrun.pre
+++ b/tutorials/incompressible/pimpleFoam/RAS/rotatingFanInRoom/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # - meshing
 runApplication surfaceFeatureExtract
diff --git a/tutorials/incompressible/pimpleFoam/RAS/wingMotion/Allclean b/tutorials/incompressible/pimpleFoam/RAS/wingMotion/Allclean
index 0e00deb36cd2c505d10413e32a3fda057b895a8e..38f1b6d21e2b85ee2e12ca7ff48f72729ed158b4 100755
--- a/tutorials/incompressible/pimpleFoam/RAS/wingMotion/Allclean
+++ b/tutorials/incompressible/pimpleFoam/RAS/wingMotion/Allclean
@@ -1,11 +1,10 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 ( cd wingMotion_snappyHexMesh && cleanCase )
-
 ( cd wingMotion2D_simpleFoam && cleanCase0 )
-
 ( cd wingMotion2D_pimpleFoam && cleanCase0 )
 
 #------------------------------------------------------------------------------
diff --git a/tutorials/incompressible/pimpleFoam/RAS/wingMotion/Allrun b/tutorials/incompressible/pimpleFoam/RAS/wingMotion/Allrun
index 9b8c73288432cdbb6a9971bba8c4640670013bba..c7a4482b86c4bdcaf72f5a7a73ad409d55e2ffb8 100755
--- a/tutorials/incompressible/pimpleFoam/RAS/wingMotion/Allrun
+++ b/tutorials/incompressible/pimpleFoam/RAS/wingMotion/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Make 3D mesh in slab of cells.
 (
diff --git a/tutorials/incompressible/pimpleFoam/laminar/mixerVesselAMI2D/Allrun b/tutorials/incompressible/pimpleFoam/laminar/mixerVesselAMI2D/Allrun
index 9450e8b3f6e45b2898e02ca807630a896aa02a16..74684c8ffc7da898a3d5a06b0646685705e819f0 100755
--- a/tutorials/incompressible/pimpleFoam/laminar/mixerVesselAMI2D/Allrun
+++ b/tutorials/incompressible/pimpleFoam/laminar/mixerVesselAMI2D/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./makeMesh
 
diff --git a/tutorials/incompressible/pimpleFoam/laminar/mixerVesselAMI2D/makeMesh b/tutorials/incompressible/pimpleFoam/laminar/mixerVesselAMI2D/makeMesh
index fc56e7be3ced8dddd0d2158adb4b74e5e2d96239..6e03b018cabf8cda54d0d4a5d33efc0c1ad9b681 100755
--- a/tutorials/incompressible/pimpleFoam/laminar/mixerVesselAMI2D/makeMesh
+++ b/tutorials/incompressible/pimpleFoam/laminar/mixerVesselAMI2D/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 m4 < system/blockMeshDict.m4 > system/blockMeshDict
 
diff --git a/tutorials/incompressible/pimpleFoam/laminar/planarPoiseuille/Allclean b/tutorials/incompressible/pimpleFoam/laminar/planarPoiseuille/Allclean
index bb826d2457ae1d765942118a5ccf48f7bc6364b5..d6f99365fbfce393b1a5bf70398e9815893061eb 100755
--- a/tutorials/incompressible/pimpleFoam/laminar/planarPoiseuille/Allclean
+++ b/tutorials/incompressible/pimpleFoam/laminar/planarPoiseuille/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 rm -rf *.dat validation/*.eps
diff --git a/tutorials/incompressible/pimpleFoam/laminar/planarPoiseuille/Allrun b/tutorials/incompressible/pimpleFoam/laminar/planarPoiseuille/Allrun
index 784b7fab75cf9f672c4f0bcf2368eadb8c37ec53..0135c39b377cd8c84d1a0e8dd94d1efb92094de7 100755
--- a/tutorials/incompressible/pimpleFoam/laminar/planarPoiseuille/Allrun
+++ b/tutorials/incompressible/pimpleFoam/laminar/planarPoiseuille/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication $(getApplication)
diff --git a/tutorials/incompressible/pisoFoam/LES/motorBike/Allclean b/tutorials/incompressible/pisoFoam/LES/motorBike/Allclean
index 507327c90a4e01c8d8539b012759830472386418..873b751367937a36a84f072159120647b9a9d4f7 100755
--- a/tutorials/incompressible/pisoFoam/LES/motorBike/Allclean
+++ b/tutorials/incompressible/pisoFoam/LES/motorBike/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 (cd motorBike && ./Allclean)
 
diff --git a/tutorials/incompressible/pisoFoam/LES/motorBike/Allrun b/tutorials/incompressible/pisoFoam/LES/motorBike/Allrun
index cb72a01227bd995a6fba6c85d89a85dd2900f592..8285c7ece8063571ee3f491da13d54c66aa1d95f 100755
--- a/tutorials/incompressible/pisoFoam/LES/motorBike/Allrun
+++ b/tutorials/incompressible/pisoFoam/LES/motorBike/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Do the Spalart-Allmaras steady-state case
 (cd motorBike && foamRunTutorials)
diff --git a/tutorials/incompressible/pisoFoam/LES/motorBike/lesFiles/Allrun b/tutorials/incompressible/pisoFoam/LES/motorBike/lesFiles/Allrun
index 5bd3017bd20a3fd98217bbd60063e4f8c1eef0b4..20b46894d668468d955191cd4e1c868bfe027843 100755
--- a/tutorials/incompressible/pisoFoam/LES/motorBike/lesFiles/Allrun
+++ b/tutorials/incompressible/pisoFoam/LES/motorBike/lesFiles/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Set-up the LES case
 \cp ../lesFiles/fvS* ../lesFiles/controlDict system/
diff --git a/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/Allclean b/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/Allclean
index d4886e92271c8f3459e787ccf2c8f15754a5a880..d2b49b164f28280660c8e2072d7d929de95fd5a0 100755
--- a/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/Allclean
+++ b/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/Allrun b/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/Allrun
index 895be49887b69b3744c0d25b20490a00f2f8ba43..a08ca47dd78c1b1f8a6855735daeb8e80fd18b13 100755
--- a/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/Allrun
+++ b/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # copy motorbike surface from resources directory
 \cp $FOAM_TUTORIALS/resources/geometry/motorBike.obj.gz constant/triSurface/
diff --git a/tutorials/incompressible/pisoFoam/laminar/porousBlockage/Allrun b/tutorials/incompressible/pisoFoam/laminar/porousBlockage/Allrun
index f88fe7fd920ea9d58fe18f1f291d777b10debfef..449691045979ad92894ce651f5921973c5fe51b4 100755
--- a/tutorials/incompressible/pisoFoam/laminar/porousBlockage/Allrun
+++ b/tutorials/incompressible/pisoFoam/laminar/porousBlockage/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication topoSet
diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuct/explicit/Allclean b/tutorials/incompressible/porousSimpleFoam/angledDuct/explicit/Allclean
index 0686c27498f37a8e90e1b5a68d7a28933ba0ff1e..27a68f18bd4633248a0d657f6efa72667029cc7c 100755
--- a/tutorials/incompressible/porousSimpleFoam/angledDuct/explicit/Allclean
+++ b/tutorials/incompressible/porousSimpleFoam/angledDuct/explicit/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuct/explicit/Allrun b/tutorials/incompressible/porousSimpleFoam/angledDuct/explicit/Allrun
index 1331199845154dbb44579ed7c6bdc51a40ff4d2f..8348af0b8b626fae9ecd87f41b23c9f05ef38ca5 100755
--- a/tutorials/incompressible/porousSimpleFoam/angledDuct/explicit/Allrun
+++ b/tutorials/incompressible/porousSimpleFoam/angledDuct/explicit/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 echo "Use common files for 0/, constant/ and blockMeshDict"
 \rm -rf 0 constant
diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuct/implicit/Allclean b/tutorials/incompressible/porousSimpleFoam/angledDuct/implicit/Allclean
index 0686c27498f37a8e90e1b5a68d7a28933ba0ff1e..27a68f18bd4633248a0d657f6efa72667029cc7c 100755
--- a/tutorials/incompressible/porousSimpleFoam/angledDuct/implicit/Allclean
+++ b/tutorials/incompressible/porousSimpleFoam/angledDuct/implicit/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuct/implicit/Allrun b/tutorials/incompressible/porousSimpleFoam/angledDuct/implicit/Allrun
index 1331199845154dbb44579ed7c6bdc51a40ff4d2f..8348af0b8b626fae9ecd87f41b23c9f05ef38ca5 100755
--- a/tutorials/incompressible/porousSimpleFoam/angledDuct/implicit/Allrun
+++ b/tutorials/incompressible/porousSimpleFoam/angledDuct/implicit/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 echo "Use common files for 0/, constant/ and blockMeshDict"
 \rm -rf 0 constant
diff --git a/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/Allclean b/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/Allclean
index d6454c597fc45b377ef83966ef12037c753ebde6..0fda2348a42831d6a06695bcdce8e0f93a6bcb00 100755
--- a/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/Allclean
+++ b/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/Allrun b/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/Allrun
index 4a206678cd0030722f1dd69879ce535e800b17c8..2a91080485c31267ffce82ef2afcef6ece5d27e9 100755
--- a/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/Allrun
+++ b/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/Allrun.pre b/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/Allrun.pre
index d8dd07021445648a35a2a557f0ae2a0ec315eb8e..f29680eca455354ad7298b34389f8be93eb898cd 100755
--- a/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/Allrun.pre
+++ b/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication surfaceFeatureExtract
 
diff --git a/tutorials/incompressible/simpleFoam/T3A/Allclean b/tutorials/incompressible/simpleFoam/T3A/Allclean
index 8ad093a08cd5ec8b5cc86938986490d31c6ea84d..e719ed465cb5a09d46ab3687fa645c4fc7d6368d 100755
--- a/tutorials/incompressible/simpleFoam/T3A/Allclean
+++ b/tutorials/incompressible/simpleFoam/T3A/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 rm -f validation/*.eps
diff --git a/tutorials/incompressible/simpleFoam/T3A/Allrun b/tutorials/incompressible/simpleFoam/T3A/Allrun
index c43f998573757dbcbd07c45a6e7a4c5dac6a09d2..f3fd335e40dc498d85c80a3f32c19c76651b2904 100755
--- a/tutorials/incompressible/simpleFoam/T3A/Allrun
+++ b/tutorials/incompressible/simpleFoam/T3A/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication $(getApplication)
diff --git a/tutorials/incompressible/simpleFoam/airFoil2D/Allrun b/tutorials/incompressible/simpleFoam/airFoil2D/Allrun
index 16a6a8651d6a191fb9ae6b6f7e308f2e7bb4625e..136dcbed91b184cc77998f7bfc16855394eeab50 100755
--- a/tutorials/incompressible/simpleFoam/airFoil2D/Allrun
+++ b/tutorials/incompressible/simpleFoam/airFoil2D/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication $(getApplication)
 
diff --git a/tutorials/incompressible/simpleFoam/backwardFacingStep2D/Allclean b/tutorials/incompressible/simpleFoam/backwardFacingStep2D/Allclean
index d839638c5903351ff66c6fa199cf555c8dd9f65c..a2837014bc537ba70b8d712477d77d5dc698fce5 100755
--- a/tutorials/incompressible/simpleFoam/backwardFacingStep2D/Allclean
+++ b/tutorials/incompressible/simpleFoam/backwardFacingStep2D/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/incompressible/simpleFoam/backwardFacingStep2D/Allrun b/tutorials/incompressible/simpleFoam/backwardFacingStep2D/Allrun
index fcf73728f7ebf8440bce90dff1987cf2702c2556..611bccf948c13ee3cc6c196f5aef2c70c41b8981 100755
--- a/tutorials/incompressible/simpleFoam/backwardFacingStep2D/Allrun
+++ b/tutorials/incompressible/simpleFoam/backwardFacingStep2D/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication simpleFoam
diff --git a/tutorials/incompressible/simpleFoam/bump2D/Allclean b/tutorials/incompressible/simpleFoam/bump2D/Allclean
index 9960709f404cbc6e55851f9cb615e72ecea868c0..6fdd3e5800c99e6d4c3caca6f279a4b4eca7c3cf 100755
--- a/tutorials/incompressible/simpleFoam/bump2D/Allclean
+++ b/tutorials/incompressible/simpleFoam/bump2D/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 \rm -f *.png
diff --git a/tutorials/incompressible/simpleFoam/bump2D/Allrun b/tutorials/incompressible/simpleFoam/bump2D/Allrun
index 7013a485b16f727b31c601169cded17c60a2b934..1233420b53edc4d2e5db22d9654bd471ffb90fd0 100755
--- a/tutorials/incompressible/simpleFoam/bump2D/Allrun
+++ b/tutorials/incompressible/simpleFoam/bump2D/Allrun
@@ -1,7 +1,8 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/RunFunctions    # Tutorial run functions
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/incompressible/simpleFoam/bump2D/plot b/tutorials/incompressible/simpleFoam/bump2D/plot
index a30f46d332b3fc935771dffe11376e5c4ba1cb21..3d0444c8695a9f82c5aa6f25e8688b29e5bb021c 100755
--- a/tutorials/incompressible/simpleFoam/bump2D/plot
+++ b/tutorials/incompressible/simpleFoam/bump2D/plot
@@ -1,13 +1,14 @@
 #!/bin/sh
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
+
 # Note: CFL3D data available from:
 # https://turbmodels.larc.nasa.gov/bump_sa.html
 # The CFL3D-SpalartAllmaras datasets of Cf and Cp:
 # Cf = https://turbmodels.larc.nasa.gov/Bump/SA/cf_bump.dat
 # Cp = https://turbmodels.larc.nasa.gov/Bump/SA/cp_bump.dat
 
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/RunFunctions    # Tutorial run functions
-
 
 plotCf() {
     declare -a resultSet=("${!1}")
diff --git a/tutorials/incompressible/simpleFoam/mixerVessel2D/Allrun b/tutorials/incompressible/simpleFoam/mixerVessel2D/Allrun
index 5db0a1c8e5a022ae01d798031504740b33e1af13..b069c38b3f36d4d3752f0c2ed834b7a6a20dcb79 100755
--- a/tutorials/incompressible/simpleFoam/mixerVessel2D/Allrun
+++ b/tutorials/incompressible/simpleFoam/mixerVessel2D/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./makeMesh
 runApplication $(getApplication)
diff --git a/tutorials/incompressible/simpleFoam/mixerVessel2D/makeMesh b/tutorials/incompressible/simpleFoam/mixerVessel2D/makeMesh
index 0caafbabf9e2e6c94c2640f16d2acdf1eaf5af2a..8512eff976eca135ad0883ab1b35ddf304e367a2 100755
--- a/tutorials/incompressible/simpleFoam/mixerVessel2D/makeMesh
+++ b/tutorials/incompressible/simpleFoam/mixerVessel2D/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 m4 < system/blockMeshDict.m4 > system/blockMeshDict
 
diff --git a/tutorials/incompressible/simpleFoam/motorBike/Allclean b/tutorials/incompressible/simpleFoam/motorBike/Allclean
index a0bb1b4d393264805bc967260a37c840225fc70e..3a7ec0e9ca2ab458a51a8d7b72c9fd303d9e6cd4 100755
--- a/tutorials/incompressible/simpleFoam/motorBike/Allclean
+++ b/tutorials/incompressible/simpleFoam/motorBike/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/incompressible/simpleFoam/motorBike/Allrun b/tutorials/incompressible/simpleFoam/motorBike/Allrun
index 4654c95afe1538e2aac9e307c42edbf5ecf53ea6..db24cb629a1d387c594080511a98c5e923964364 100755
--- a/tutorials/incompressible/simpleFoam/motorBike/Allrun
+++ b/tutorials/incompressible/simpleFoam/motorBike/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Alternative decomposeParDict name:
 decompDict="-decomposeParDict system/decomposeParDict.6"
diff --git a/tutorials/incompressible/simpleFoam/pipeCyclic/Allclean b/tutorials/incompressible/simpleFoam/pipeCyclic/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/incompressible/simpleFoam/pipeCyclic/Allclean
+++ b/tutorials/incompressible/simpleFoam/pipeCyclic/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/incompressible/simpleFoam/pipeCyclic/Allrun b/tutorials/incompressible/simpleFoam/pipeCyclic/Allrun
index 9b8ed30d971e6dfe38aba17f8ce829f608b3ac91..7a1859f5b25e0250fa94e9ee942ea8fe24a30639 100755
--- a/tutorials/incompressible/simpleFoam/pipeCyclic/Allrun
+++ b/tutorials/incompressible/simpleFoam/pipeCyclic/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication topoSet
diff --git a/tutorials/incompressible/simpleFoam/rotorDisk/Allclean b/tutorials/incompressible/simpleFoam/rotorDisk/Allclean
index 09925d447d00693cdf322363baa35a0517f582b2..d01deab7068bb448a3d31fc6145a7690cfa4c0f8 100755
--- a/tutorials/incompressible/simpleFoam/rotorDisk/Allclean
+++ b/tutorials/incompressible/simpleFoam/rotorDisk/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/incompressible/simpleFoam/rotorDisk/Allrun b/tutorials/incompressible/simpleFoam/rotorDisk/Allrun
index 12d9aa38bfd1d275bb34ed5953cfa05d5fa698be..59e951d3db30d60838eeee0dd92b8819d69903f9 100755
--- a/tutorials/incompressible/simpleFoam/rotorDisk/Allrun
+++ b/tutorials/incompressible/simpleFoam/rotorDisk/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Meshing
 runApplication blockMesh
diff --git a/tutorials/incompressible/simpleFoam/simpleCar/Allrun b/tutorials/incompressible/simpleFoam/simpleCar/Allrun
index 2a7ff56032f824455b5e11c5d1812068a000f092..f09a124beb69f7891a212e033347e75a0c73fd27 100755
--- a/tutorials/incompressible/simpleFoam/simpleCar/Allrun
+++ b/tutorials/incompressible/simpleFoam/simpleCar/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication topoSet
diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/Allclean b/tutorials/incompressible/simpleFoam/turbineSiting/Allclean
index c357ba7bfe58cc39d92d6a38559ee2d2b7e645a6..233729ef415e318c6c07c9fc7c26c61c65536889 100755
--- a/tutorials/incompressible/simpleFoam/turbineSiting/Allclean
+++ b/tutorials/incompressible/simpleFoam/turbineSiting/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/Allrun b/tutorials/incompressible/simpleFoam/turbineSiting/Allrun
index ef45fe0dd57fb4e5c38fb737c7c7eca77b36ff3f..fbb23d79fce90179ec367fa373a7b40baa948e9c 100755
--- a/tutorials/incompressible/simpleFoam/turbineSiting/Allrun
+++ b/tutorials/incompressible/simpleFoam/turbineSiting/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Make dummy 0 directory
 mkdir 0
diff --git a/tutorials/incompressible/simpleFoam/turbulentFlatPlate/Allclean b/tutorials/incompressible/simpleFoam/turbulentFlatPlate/Allclean
index 447b72d0f3051c2efbaeb54a26580716f94a93f8..a3fc7adfde4254595d2b6615842d6f0dc35b669b 100755
--- a/tutorials/incompressible/simpleFoam/turbulentFlatPlate/Allclean
+++ b/tutorials/incompressible/simpleFoam/turbulentFlatPlate/Allclean
@@ -1,11 +1,11 @@
-#!/bin/bash
-#set -x
-
-cd ${0%/*} || exit 1
-
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions
+#!/bin/sh
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
 \rm -rf 0 postProcessing-*
 \rm -f *.dat *.png constant/turbulenceProperties
+
+#------------------------------------------------------------------------------
diff --git a/tutorials/incompressible/simpleFoam/turbulentFlatPlate/Allrun b/tutorials/incompressible/simpleFoam/turbulentFlatPlate/Allrun
index 0e22182d9e2263f6f015afea98bdccbf3215bf6c..c7734d84ec445761631602e7820ef47354dccc05 100755
--- a/tutorials/incompressible/simpleFoam/turbulentFlatPlate/Allrun
+++ b/tutorials/incompressible/simpleFoam/turbulentFlatPlate/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 if notTest $@
 then
diff --git a/tutorials/incompressible/simpleFoam/windAroundBuildings/Allclean b/tutorials/incompressible/simpleFoam/windAroundBuildings/Allclean
index 98ff9b6209aad26096420b5fb01d29f3c6ab7625..da26f385ba974fc504202b6305b3fcc7ca676c67 100755
--- a/tutorials/incompressible/simpleFoam/windAroundBuildings/Allclean
+++ b/tutorials/incompressible/simpleFoam/windAroundBuildings/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/incompressible/simpleFoam/windAroundBuildings/Allrun b/tutorials/incompressible/simpleFoam/windAroundBuildings/Allrun
index 30cbfe82f6fd50547446fdbd00e5cd263659d686..cae90c8fbd3261a0854c24690a3338e1df2a17a3 100755
--- a/tutorials/incompressible/simpleFoam/windAroundBuildings/Allrun
+++ b/tutorials/incompressible/simpleFoam/windAroundBuildings/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication ./Allrun.pre
 
diff --git a/tutorials/incompressible/simpleFoam/windAroundBuildings/Allrun-parallel b/tutorials/incompressible/simpleFoam/windAroundBuildings/Allrun-parallel
index 87dec4ec716faa71b1c0d2fa34e6da3d4155ed93..717b8a882e84ad8d6b0d6862685e56fb6e088db5 100755
--- a/tutorials/incompressible/simpleFoam/windAroundBuildings/Allrun-parallel
+++ b/tutorials/incompressible/simpleFoam/windAroundBuildings/Allrun-parallel
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication ./Allrun.pre
 
diff --git a/tutorials/incompressible/simpleFoam/windAroundBuildings/Allrun.pre b/tutorials/incompressible/simpleFoam/windAroundBuildings/Allrun.pre
index 1a27e138e4f9e65e999c73ed8c79ddfb0078d36c..549e7273613aecaf5240d05f2228b3f40eea7f9c 100755
--- a/tutorials/incompressible/simpleFoam/windAroundBuildings/Allrun.pre
+++ b/tutorials/incompressible/simpleFoam/windAroundBuildings/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication surfaceFeatureExtract
 
diff --git a/tutorials/lagrangian/MPPICFoam/cyclone/Allclean b/tutorials/lagrangian/MPPICFoam/cyclone/Allclean
index d4f2a95a0e36cb7f45437c4dc2c0a891ce744bdc..470bd39c79db6e4c7b5c8d4580fc99721cf321f5 100755
--- a/tutorials/lagrangian/MPPICFoam/cyclone/Allclean
+++ b/tutorials/lagrangian/MPPICFoam/cyclone/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/lagrangian/MPPICFoam/cyclone/Allrun b/tutorials/lagrangian/MPPICFoam/cyclone/Allrun
index 680e22fbc3bd979e006b8cc301d9e02c667d92c9..e278452263a41c100b76432794c4dc6ad38d9226 100755
--- a/tutorials/lagrangian/MPPICFoam/cyclone/Allrun
+++ b/tutorials/lagrangian/MPPICFoam/cyclone/Allrun
@@ -1,7 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/RunFunctions    # Tutorial run functions
-
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 cp $FOAM_TUTORIALS/resources/geometry/cyclone.stl.gz constant/triSurface
 
diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/Allrun b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/Allrun
index 61c2efb007f6b15459808b5982a1ebbb929122fe..91f8ced907c147d48f3d3f185bbee97a55037810 100755
--- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/Allrun
+++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/Allrun-parallel b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/Allrun-parallel
index da47afd7a0439662946a33ec033a7585502c4cc7..4b2b6c2a17d615fc1fc0e7435ce45a7d4d119911 100755
--- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/Allrun-parallel
+++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/Allrun-parallel
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/Allrun b/tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/Allrun
index 413155fdb032559c8edf9cec0105eb7f67fc74b8..4dc771c49423367a30bb2feddc7bd1633f06d58d 100755
--- a/tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/Allrun
+++ b/tutorials/lagrangian/icoUncoupledKinematicParcelDyMFoam/mixerVesselAMI2D/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 m4 < system/blockMeshDict.m4 > system/blockMeshDict
 
diff --git a/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/Allclean b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/Allclean
index d837e1f76092a3c2bde4816178b9a2c2edca8a6c..bef51e89ceed2d1365008629b99e65d8d129b5d7 100755
--- a/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/Allclean
+++ b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 ( cd hopperInitialState && cleanCase )
 
diff --git a/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/Allrun b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/Allrun
index 94d4202af0808e5fc0bf162ea9e121dd765826ec..b493b007af71b33f8ca2c39ae067662071aee748 100755
--- a/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/Allrun
+++ b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 (
     cd hopperInitialState || exit 1
diff --git a/tutorials/lagrangian/reactingParcelFoam/cylinder/Allclean b/tutorials/lagrangian/reactingParcelFoam/cylinder/Allclean
index 51e9ee16ca91be08f7c5e025e5e96fed73e088f3..107833d30512e0d6e8294474d9212f8924d74234 100755
--- a/tutorials/lagrangian/reactingParcelFoam/cylinder/Allclean
+++ b/tutorials/lagrangian/reactingParcelFoam/cylinder/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/lagrangian/reactingParcelFoam/cylinder/Allrun b/tutorials/lagrangian/reactingParcelFoam/cylinder/Allrun
index 4a206678cd0030722f1dd69879ce535e800b17c8..2a91080485c31267ffce82ef2afcef6ece5d27e9 100755
--- a/tutorials/lagrangian/reactingParcelFoam/cylinder/Allrun
+++ b/tutorials/lagrangian/reactingParcelFoam/cylinder/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/lagrangian/reactingParcelFoam/cylinder/Allrun.pre b/tutorials/lagrangian/reactingParcelFoam/cylinder/Allrun.pre
index 1f5781ea73a8bce33fa57eda9de43935163ab148..f384c7ed4b7472190e6fc3a441fd9cd23be4575b 100755
--- a/tutorials/lagrangian/reactingParcelFoam/cylinder/Allrun.pre
+++ b/tutorials/lagrangian/reactingParcelFoam/cylinder/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 runApplication blockMesh
diff --git a/tutorials/lagrangian/reactingParcelFoam/filter/Allclean b/tutorials/lagrangian/reactingParcelFoam/filter/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/lagrangian/reactingParcelFoam/filter/Allclean
+++ b/tutorials/lagrangian/reactingParcelFoam/filter/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/lagrangian/reactingParcelFoam/filter/Allrun b/tutorials/lagrangian/reactingParcelFoam/filter/Allrun
index 683c4a31e0ff56184145d4c128e901f9a193ffea..7145df146ed487c4566936a779de7ba355e48438 100755
--- a/tutorials/lagrangian/reactingParcelFoam/filter/Allrun
+++ b/tutorials/lagrangian/reactingParcelFoam/filter/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/lagrangian/reactingParcelFoam/filter/Allrun-parallel b/tutorials/lagrangian/reactingParcelFoam/filter/Allrun-parallel
index 268bd680fb50c3268c46415ce7263077f9f6e64b..160b6cfc33cd4680ef7005b2d782242061b55c29 100755
--- a/tutorials/lagrangian/reactingParcelFoam/filter/Allrun-parallel
+++ b/tutorials/lagrangian/reactingParcelFoam/filter/Allrun-parallel
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/lagrangian/reactingParcelFoam/hotBoxes/Allclean b/tutorials/lagrangian/reactingParcelFoam/hotBoxes/Allclean
index 9b60dae89ea8d8ef04dcce82aefeb060e030397b..167cd9815fed2b713cd772b7852b7e320f24e6bb 100755
--- a/tutorials/lagrangian/reactingParcelFoam/hotBoxes/Allclean
+++ b/tutorials/lagrangian/reactingParcelFoam/hotBoxes/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/lagrangian/reactingParcelFoam/hotBoxes/Allrun b/tutorials/lagrangian/reactingParcelFoam/hotBoxes/Allrun
index 4a206678cd0030722f1dd69879ce535e800b17c8..2a91080485c31267ffce82ef2afcef6ece5d27e9 100755
--- a/tutorials/lagrangian/reactingParcelFoam/hotBoxes/Allrun
+++ b/tutorials/lagrangian/reactingParcelFoam/hotBoxes/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/lagrangian/reactingParcelFoam/hotBoxes/Allrun-parallel b/tutorials/lagrangian/reactingParcelFoam/hotBoxes/Allrun-parallel
index 7598bf2539a741eef3863b52c73dabacbad5865f..034abb394c77f7a1a499cd42a183398ae34eeb91 100755
--- a/tutorials/lagrangian/reactingParcelFoam/hotBoxes/Allrun-parallel
+++ b/tutorials/lagrangian/reactingParcelFoam/hotBoxes/Allrun-parallel
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/lagrangian/reactingParcelFoam/hotBoxes/Allrun.pre b/tutorials/lagrangian/reactingParcelFoam/hotBoxes/Allrun.pre
index 4a6913188f2d0a8ac3c09af30cf507aff3038bab..3379bd6551184a43182a4a85017cce4a55d3692c 100755
--- a/tutorials/lagrangian/reactingParcelFoam/hotBoxes/Allrun.pre
+++ b/tutorials/lagrangian/reactingParcelFoam/hotBoxes/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/lagrangian/reactingParcelFoam/rivuletPanel/Allclean b/tutorials/lagrangian/reactingParcelFoam/rivuletPanel/Allclean
index 51e9ee16ca91be08f7c5e025e5e96fed73e088f3..107833d30512e0d6e8294474d9212f8924d74234 100755
--- a/tutorials/lagrangian/reactingParcelFoam/rivuletPanel/Allclean
+++ b/tutorials/lagrangian/reactingParcelFoam/rivuletPanel/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/lagrangian/reactingParcelFoam/rivuletPanel/Allrun b/tutorials/lagrangian/reactingParcelFoam/rivuletPanel/Allrun
index 4a206678cd0030722f1dd69879ce535e800b17c8..2a91080485c31267ffce82ef2afcef6ece5d27e9 100755
--- a/tutorials/lagrangian/reactingParcelFoam/rivuletPanel/Allrun
+++ b/tutorials/lagrangian/reactingParcelFoam/rivuletPanel/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/lagrangian/reactingParcelFoam/rivuletPanel/Allrun.pre b/tutorials/lagrangian/reactingParcelFoam/rivuletPanel/Allrun.pre
index 4002157fcf94680b1bec2a0e8bc18b8b76f5f015..21f044d531b8f300f58db88f5fb85ba39d69b5a1 100755
--- a/tutorials/lagrangian/reactingParcelFoam/rivuletPanel/Allrun.pre
+++ b/tutorials/lagrangian/reactingParcelFoam/rivuletPanel/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/lagrangian/reactingParcelFoam/splashPanel/Allclean b/tutorials/lagrangian/reactingParcelFoam/splashPanel/Allclean
index 51e9ee16ca91be08f7c5e025e5e96fed73e088f3..107833d30512e0d6e8294474d9212f8924d74234 100755
--- a/tutorials/lagrangian/reactingParcelFoam/splashPanel/Allclean
+++ b/tutorials/lagrangian/reactingParcelFoam/splashPanel/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/lagrangian/reactingParcelFoam/splashPanel/Allrun b/tutorials/lagrangian/reactingParcelFoam/splashPanel/Allrun
index 4a206678cd0030722f1dd69879ce535e800b17c8..2a91080485c31267ffce82ef2afcef6ece5d27e9 100755
--- a/tutorials/lagrangian/reactingParcelFoam/splashPanel/Allrun
+++ b/tutorials/lagrangian/reactingParcelFoam/splashPanel/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/lagrangian/reactingParcelFoam/splashPanel/Allrun.pre b/tutorials/lagrangian/reactingParcelFoam/splashPanel/Allrun.pre
index 1722219969f42269271017033e897136d125d6ef..57c00ce1faa58ac20a913fda21ff97663bd51360 100755
--- a/tutorials/lagrangian/reactingParcelFoam/splashPanel/Allrun.pre
+++ b/tutorials/lagrangian/reactingParcelFoam/splashPanel/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/lagrangian/reactingParcelFoam/verticalChannel/Allclean b/tutorials/lagrangian/reactingParcelFoam/verticalChannel/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/lagrangian/reactingParcelFoam/verticalChannel/Allclean
+++ b/tutorials/lagrangian/reactingParcelFoam/verticalChannel/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/lagrangian/reactingParcelFoam/verticalChannel/Allrun b/tutorials/lagrangian/reactingParcelFoam/verticalChannel/Allrun
index 9edda44dd8d8341c4dd91009892d95e2bb3cd4d3..bc51bb39ce7811c1749af1b2224b8e848aafe6ae 100755
--- a/tutorials/lagrangian/reactingParcelFoam/verticalChannel/Allrun
+++ b/tutorials/lagrangian/reactingParcelFoam/verticalChannel/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # create mesh
 runApplication blockMesh
diff --git a/tutorials/lagrangian/reactingParcelFoam/verticalChannelLTS/Allclean b/tutorials/lagrangian/reactingParcelFoam/verticalChannelLTS/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/lagrangian/reactingParcelFoam/verticalChannelLTS/Allclean
+++ b/tutorials/lagrangian/reactingParcelFoam/verticalChannelLTS/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/lagrangian/reactingParcelFoam/verticalChannelLTS/Allrun b/tutorials/lagrangian/reactingParcelFoam/verticalChannelLTS/Allrun
index 9edda44dd8d8341c4dd91009892d95e2bb3cd4d3..bc51bb39ce7811c1749af1b2224b8e848aafe6ae 100755
--- a/tutorials/lagrangian/reactingParcelFoam/verticalChannelLTS/Allrun
+++ b/tutorials/lagrangian/reactingParcelFoam/verticalChannelLTS/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # create mesh
 runApplication blockMesh
diff --git a/tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/Allclean b/tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/Allclean
+++ b/tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/Allrun b/tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/Allrun
index c2c258a824163408ada90a4bbb98650b128c9d36..49678d0039a36d649ad07a21973a9a5fdb16a0bf 100755
--- a/tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/Allrun
+++ b/tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/Allrun-parallel b/tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/Allrun-parallel
index b97529d442c69670605a917e27626ec54884f9ac..81abdd44435bbb25e1910e27a44ac00874ce4322 100755
--- a/tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/Allrun-parallel
+++ b/tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/Allrun-parallel
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/mesh/PDRblockMesh/box0/Allrun b/tutorials/mesh/PDRblockMesh/box0/Allrun
index dc4cece02f99480c6245dd4860d047e3f14af1b7..b5185c4818a33891adeccf36c62cdcdf71d9fa95 100755
--- a/tutorials/mesh/PDRblockMesh/box0/Allrun
+++ b/tutorials/mesh/PDRblockMesh/box0/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication PDRblockMesh
 runApplication checkMesh
diff --git a/tutorials/mesh/blockMesh/pipe/Allrun b/tutorials/mesh/blockMesh/pipe/Allrun
index a33126fcfd5174d8d9088e071a018929df0a673f..71433f95e1e3dbc93043a6cdcdee2f5a34925d3f 100755
--- a/tutorials/mesh/blockMesh/pipe/Allrun
+++ b/tutorials/mesh/blockMesh/pipe/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/mesh/blockMesh/sphere/Allrun b/tutorials/mesh/blockMesh/sphere/Allrun
index a33126fcfd5174d8d9088e071a018929df0a673f..71433f95e1e3dbc93043a6cdcdee2f5a34925d3f 100755
--- a/tutorials/mesh/blockMesh/sphere/Allrun
+++ b/tutorials/mesh/blockMesh/sphere/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/mesh/blockMesh/sphere7/Allrun b/tutorials/mesh/blockMesh/sphere7/Allrun
index a33126fcfd5174d8d9088e071a018929df0a673f..71433f95e1e3dbc93043a6cdcdee2f5a34925d3f 100755
--- a/tutorials/mesh/blockMesh/sphere7/Allrun
+++ b/tutorials/mesh/blockMesh/sphere7/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/mesh/blockMesh/sphere7ProjectedEdges/Allrun b/tutorials/mesh/blockMesh/sphere7ProjectedEdges/Allrun
index a33126fcfd5174d8d9088e071a018929df0a673f..71433f95e1e3dbc93043a6cdcdee2f5a34925d3f 100755
--- a/tutorials/mesh/blockMesh/sphere7ProjectedEdges/Allrun
+++ b/tutorials/mesh/blockMesh/sphere7ProjectedEdges/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/mesh/foamyHexMesh/Allrun b/tutorials/mesh/foamyHexMesh/Allrun
index dd1c7d2c4139742df7f00b37dd1953c0c5664edb..fda07445f3fe82dfbf8b698c087c34780bd82582 100755
--- a/tutorials/mesh/foamyHexMesh/Allrun
+++ b/tutorials/mesh/foamyHexMesh/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Any cases that are links to solver test cases and are run when the Allrun
 # scripts of those solvers are run.  This script avoids meshing these cases
diff --git a/tutorials/mesh/foamyHexMesh/blob/Allclean b/tutorials/mesh/foamyHexMesh/blob/Allclean
index 1b3fad50fc9f6095ac06e09123e2b4330da27fda..42832f4221cdb5021570c3cb14233e2b33de1d97 100755
--- a/tutorials/mesh/foamyHexMesh/blob/Allclean
+++ b/tutorials/mesh/foamyHexMesh/blob/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/mesh/foamyHexMesh/blob/Allrun b/tutorials/mesh/foamyHexMesh/blob/Allrun
index b4c8454ee3aafa0da272bee48af3c286ad289a50..e529d7522269a7577125691f716f2abce158a41c 100755
--- a/tutorials/mesh/foamyHexMesh/blob/Allrun
+++ b/tutorials/mesh/foamyHexMesh/blob/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # copy flange surface from resources directory
 cp $FOAM_TUTORIALS/resources/geometry/blob.stl.gz constant/triSurface/
diff --git a/tutorials/mesh/foamyHexMesh/blob/Allrun-parallel b/tutorials/mesh/foamyHexMesh/blob/Allrun-parallel
index 32429bd239417cf334b9129517bfc029bfc6c556..ab8ae66f81b7d5c749a1b5fa33c316ced7af91f3 100755
--- a/tutorials/mesh/foamyHexMesh/blob/Allrun-parallel
+++ b/tutorials/mesh/foamyHexMesh/blob/Allrun-parallel
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # copy flange surface from resources directory
 cp $FOAM_TUTORIALS/resources/geometry/blob.stl.gz constant/triSurface/
diff --git a/tutorials/mesh/foamyHexMesh/flange/Allclean b/tutorials/mesh/foamyHexMesh/flange/Allclean
index c4e27e7164da79f87541c63a419a0b091cbea7a6..25e1670d977f159321740761f76ea605583e0350 100755
--- a/tutorials/mesh/foamyHexMesh/flange/Allclean
+++ b/tutorials/mesh/foamyHexMesh/flange/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/mesh/foamyHexMesh/flange/Allrun b/tutorials/mesh/foamyHexMesh/flange/Allrun
index 5487824ca4ba146368b252cb88e6c3af4f254599..232e706eb6d40b878fe6a86fb54521d10ed53fa1 100755
--- a/tutorials/mesh/foamyHexMesh/flange/Allrun
+++ b/tutorials/mesh/foamyHexMesh/flange/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # copy flange surface from resources directory
 cp $FOAM_TUTORIALS/resources/geometry/flange.stl.gz constant/triSurface/
diff --git a/tutorials/mesh/foamyHexMesh/flange/Allrun-parallel b/tutorials/mesh/foamyHexMesh/flange/Allrun-parallel
index c9e154a60cf4ee03401847cffefb6b3aa0152a25..d30107e142e351f7a1fcbe2566e487b9a55aaba0 100755
--- a/tutorials/mesh/foamyHexMesh/flange/Allrun-parallel
+++ b/tutorials/mesh/foamyHexMesh/flange/Allrun-parallel
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # copy flange surface from resources directory
 cp $FOAM_TUTORIALS/resources/geometry/flange.stl.gz constant/triSurface/
diff --git a/tutorials/mesh/foamyHexMesh/mixerVessel/Allclean b/tutorials/mesh/foamyHexMesh/mixerVessel/Allclean
index 7a64d7a6b532d2170b1f9854d113f62794a5fa0d..e90832f2f3b51625654e44df89c84d89a4d9bc9c 100755
--- a/tutorials/mesh/foamyHexMesh/mixerVessel/Allclean
+++ b/tutorials/mesh/foamyHexMesh/mixerVessel/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/mesh/foamyHexMesh/mixerVessel/Allrun b/tutorials/mesh/foamyHexMesh/mixerVessel/Allrun
index 5aabd4c3eea50264ff935e48ef5b9a1c5a4cac77..21ded794f327bd942b41e946e0208b915405c53a 100755
--- a/tutorials/mesh/foamyHexMesh/mixerVessel/Allrun
+++ b/tutorials/mesh/foamyHexMesh/mixerVessel/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Generate mesh
 ./Allrun-pre
diff --git a/tutorials/mesh/foamyHexMesh/mixerVessel/Allrun-pre b/tutorials/mesh/foamyHexMesh/mixerVessel/Allrun-pre
index fa89b7f6c32480e5be26cceb09b70ce53d64662b..703e2a3efd0fccadf897b10c8ee16a02e78f8ccf 100755
--- a/tutorials/mesh/foamyHexMesh/mixerVessel/Allrun-pre
+++ b/tutorials/mesh/foamyHexMesh/mixerVessel/Allrun-pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 intersectSurfaces()
 {
diff --git a/tutorials/mesh/foamyHexMesh/mixerVessel/Allrun-simulation b/tutorials/mesh/foamyHexMesh/mixerVessel/Allrun-simulation
index a7922952e6bd1ebd260cdf5acd96be272e100aeb..2ffb97dbd5b5f49cf8dbfb4280a229decd560166 100755
--- a/tutorials/mesh/foamyHexMesh/mixerVessel/Allrun-simulation
+++ b/tutorials/mesh/foamyHexMesh/mixerVessel/Allrun-simulation
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 cp system/controlDict.flow system/controlDict
 
diff --git a/tutorials/mesh/foamyHexMesh/simpleShapes/Allclean b/tutorials/mesh/foamyHexMesh/simpleShapes/Allclean
index 42523e30e7b682f3c1c7e0915172539096db2184..88f6dd25941b39f325d14542be36c3d6ffb62ae4 100755
--- a/tutorials/mesh/foamyHexMesh/simpleShapes/Allclean
+++ b/tutorials/mesh/foamyHexMesh/simpleShapes/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/mesh/foamyHexMesh/simpleShapes/Allrun b/tutorials/mesh/foamyHexMesh/simpleShapes/Allrun
index 482564c8b5de4d9194df2a1a2212b4591e6b2ac8..5446cfebfe2076eb43e3f8a64a36382f22223472 100755
--- a/tutorials/mesh/foamyHexMesh/simpleShapes/Allrun
+++ b/tutorials/mesh/foamyHexMesh/simpleShapes/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication -s cone \
     surfaceOrient constant/triSurface/cone.stl \
diff --git a/tutorials/mesh/foamyQuadMesh/OpenCFD/Allclean b/tutorials/mesh/foamyQuadMesh/OpenCFD/Allclean
index 26eaea4667ae52bcfc3e3c35e92c25660899ed94..f3b6e87834d1828f302a3c1837252006939066cf 100755
--- a/tutorials/mesh/foamyQuadMesh/OpenCFD/Allclean
+++ b/tutorials/mesh/foamyQuadMesh/OpenCFD/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/mesh/foamyQuadMesh/OpenCFD/Allrun b/tutorials/mesh/foamyQuadMesh/OpenCFD/Allrun
index f22a5824bb5fb1ab11a1168fc7b7cc8dc34cbba9..0f1cc9fd8d520fdf7b045555afd1b64896db839b 100755
--- a/tutorials/mesh/foamyQuadMesh/OpenCFD/Allrun
+++ b/tutorials/mesh/foamyQuadMesh/OpenCFD/Allrun
@@ -1,7 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/RunFunctions    # Tutorial run functions
-
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Make sure surface is oriented properly. Since the letters
 # contain disconnected regions use
diff --git a/tutorials/mesh/foamyQuadMesh/OpenCFD/Allrun-rhoCentralFoam b/tutorials/mesh/foamyQuadMesh/OpenCFD/Allrun-rhoCentralFoam
index c4060eedef03238fe49752f748bfd9d667c581d9..5f82d66ef353291a9957adb90df4fd407fd3c585 100755
--- a/tutorials/mesh/foamyQuadMesh/OpenCFD/Allrun-rhoCentralFoam
+++ b/tutorials/mesh/foamyQuadMesh/OpenCFD/Allrun-rhoCentralFoam
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 \cp system/controlDict.rhoCentralFoam system/controlDict
 restore0Dir
diff --git a/tutorials/mesh/foamyQuadMesh/jaggedBoundary/Allclean b/tutorials/mesh/foamyQuadMesh/jaggedBoundary/Allclean
index 429017895d42d1bdd73092d90d188eb8e243f251..5806b40605bb5ca732d67f5ffbb38bfecee2c297 100755
--- a/tutorials/mesh/foamyQuadMesh/jaggedBoundary/Allclean
+++ b/tutorials/mesh/foamyQuadMesh/jaggedBoundary/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/mesh/foamyQuadMesh/jaggedBoundary/Allrun b/tutorials/mesh/foamyQuadMesh/jaggedBoundary/Allrun
index f559f8204e3fbe829809e79f1d02b981955a3056..f7e44fd471a8768b3c2026eb30bdc1983db45aee 100755
--- a/tutorials/mesh/foamyQuadMesh/jaggedBoundary/Allrun
+++ b/tutorials/mesh/foamyQuadMesh/jaggedBoundary/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication surfaceFeatureExtract
 runApplication foamyQuadMesh -overwrite
diff --git a/tutorials/mesh/foamyQuadMesh/square/Allclean b/tutorials/mesh/foamyQuadMesh/square/Allclean
index dc764a614a38d6ac908ee0b51c1064b1e8306b3c..347cb05b9b62e6b7fe4619bde6a32b3f988a6ddd 100755
--- a/tutorials/mesh/foamyQuadMesh/square/Allclean
+++ b/tutorials/mesh/foamyQuadMesh/square/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/mesh/foamyQuadMesh/square/Allrun b/tutorials/mesh/foamyQuadMesh/square/Allrun
index f72c275f01f22d5d677aba73ddd992d86d36280e..67b82efa9bddc8a5982f2999731c9a773e348aba 100755
--- a/tutorials/mesh/foamyQuadMesh/square/Allrun
+++ b/tutorials/mesh/foamyQuadMesh/square/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication surfaceFeatureExtract
 runApplication foamyQuadMesh -overwrite
diff --git a/tutorials/mesh/moveDynamicMesh/relativeMotion/Allclean b/tutorials/mesh/moveDynamicMesh/relativeMotion/Allclean
index 57317ddb1ffe80008cd1816add372cf204104217..7ed1bddaacb52e58222e521218146232304b7e87 100755
--- a/tutorials/mesh/moveDynamicMesh/relativeMotion/Allclean
+++ b/tutorials/mesh/moveDynamicMesh/relativeMotion/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 ( cd box_snappyHexMesh && cleanCase )
 
diff --git a/tutorials/mesh/moveDynamicMesh/relativeMotion/Allrun b/tutorials/mesh/moveDynamicMesh/relativeMotion/Allrun
index 785ab59cd0b8037302dce9fb995a630eac5031ea..d2ec3805d55ac862852751bb1c6d44008c0b0104 100755
--- a/tutorials/mesh/moveDynamicMesh/relativeMotion/Allrun
+++ b/tutorials/mesh/moveDynamicMesh/relativeMotion/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Make 3D mesh in slab of cells.
 (
diff --git a/tutorials/mesh/parallel/cavity/Allclean b/tutorials/mesh/parallel/cavity/Allclean
index 3bd36a4b0311885416b3bd9ab477700019d25fb4..9a688e16546799897eb860ada7a23c8aa6ea0a08 100755
--- a/tutorials/mesh/parallel/cavity/Allclean
+++ b/tutorials/mesh/parallel/cavity/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/mesh/parallel/cavity/Allrun b/tutorials/mesh/parallel/cavity/Allrun
index fdb4a734ca7322f2067a80768bcdfdf0078261cd..af6461fc945df5f9fb4566a3f4c1a378fa312ff9 100755
--- a/tutorials/mesh/parallel/cavity/Allrun
+++ b/tutorials/mesh/parallel/cavity/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/mesh/parallel/filter/Allclean b/tutorials/mesh/parallel/filter/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/mesh/parallel/filter/Allclean
+++ b/tutorials/mesh/parallel/filter/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/mesh/parallel/filter/Allrun b/tutorials/mesh/parallel/filter/Allrun
index 5ac013e09f775bef8ef6df6248ceef06b6ccee12..1fec245a4ea8122ecafb32a70bda73f2f32e6a55 100755
--- a/tutorials/mesh/parallel/filter/Allrun
+++ b/tutorials/mesh/parallel/filter/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 application=$(getApplication)
 
diff --git a/tutorials/mesh/refineMesh/refineFieldDirs/Allclean b/tutorials/mesh/refineMesh/refineFieldDirs/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/mesh/refineMesh/refineFieldDirs/Allclean
+++ b/tutorials/mesh/refineMesh/refineFieldDirs/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/mesh/refineMesh/refineFieldDirs/Allrun b/tutorials/mesh/refineMesh/refineFieldDirs/Allrun
index 5093f553b3fdfe4aa677af3fa4781a295264d679..1e654543754db8171978a7499efb621b714f30c8 100755
--- a/tutorials/mesh/refineMesh/refineFieldDirs/Allrun
+++ b/tutorials/mesh/refineMesh/refineFieldDirs/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 wmake calcRadiusField
 wclean calcRadiusField
diff --git a/tutorials/mesh/snappyHexMesh/addLayersToFaceZone/Allclean b/tutorials/mesh/snappyHexMesh/addLayersToFaceZone/Allclean
index be7ddb068847225ad69704840909a7b0d05a5466..e8557c25549b9369ce8225c99735bdfb9731e96c 100755
--- a/tutorials/mesh/snappyHexMesh/addLayersToFaceZone/Allclean
+++ b/tutorials/mesh/snappyHexMesh/addLayersToFaceZone/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/mesh/snappyHexMesh/addLayersToFaceZone/Allrun b/tutorials/mesh/snappyHexMesh/addLayersToFaceZone/Allrun
index 0ee02ee22699bca35b9bf543ab6244d072b96ac8..d201cf043390838d73e72275015fbe9922e75b09 100755
--- a/tutorials/mesh/snappyHexMesh/addLayersToFaceZone/Allrun
+++ b/tutorials/mesh/snappyHexMesh/addLayersToFaceZone/Allrun
@@ -1,7 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/RunFunctions    # Tutorial run functions
-
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/mesh/snappyHexMesh/aerofoilNACA0012_directionalRefinement/Allrun b/tutorials/mesh/snappyHexMesh/aerofoilNACA0012_directionalRefinement/Allrun
index 3921a01604d696955109e68685ccbd94a3ecc386..1768a89306d96bec283ffaec5cc1de9d58c5505b 100755
--- a/tutorials/mesh/snappyHexMesh/aerofoilNACA0012_directionalRefinement/Allrun
+++ b/tutorials/mesh/snappyHexMesh/aerofoilNACA0012_directionalRefinement/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication snappyHexMesh
diff --git a/tutorials/mesh/snappyHexMesh/distributedTriSurfaceMesh/Allclean b/tutorials/mesh/snappyHexMesh/distributedTriSurfaceMesh/Allclean
index a13b9c2ab8de5780209cdab19f8c13f5b07c87c5..3a1b7027d4ecb1eabac44960e5d8a297fd6d735d 100755
--- a/tutorials/mesh/snappyHexMesh/distributedTriSurfaceMesh/Allclean
+++ b/tutorials/mesh/snappyHexMesh/distributedTriSurfaceMesh/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/mesh/snappyHexMesh/distributedTriSurfaceMesh/Allrun b/tutorials/mesh/snappyHexMesh/distributedTriSurfaceMesh/Allrun
index f3be65de24cf8279299329cbb0c1cb909311a06f..e13f3648e5e3dcea80dab21b0fd56dd9917e6991 100755
--- a/tutorials/mesh/snappyHexMesh/distributedTriSurfaceMesh/Allrun
+++ b/tutorials/mesh/snappyHexMesh/distributedTriSurfaceMesh/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/mesh/snappyHexMesh/flange/Allclean b/tutorials/mesh/snappyHexMesh/flange/Allclean
index 69d183efe5b2bd295903a3b966ac42442fce30b4..3d53d6fc631df7994ea2691e937d5d5fb41dfae1 100755
--- a/tutorials/mesh/snappyHexMesh/flange/Allclean
+++ b/tutorials/mesh/snappyHexMesh/flange/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/mesh/snappyHexMesh/flange/Allrun b/tutorials/mesh/snappyHexMesh/flange/Allrun
index 8e2c10e1edd312a724e8d98eb9386460fa78578a..9476bfeaf726b0e45c973d9c167d032dbeab9879 100755
--- a/tutorials/mesh/snappyHexMesh/flange/Allrun
+++ b/tutorials/mesh/snappyHexMesh/flange/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # copy flange surface from resources directory
 cp $FOAM_TUTORIALS/resources/geometry/flange.stl.gz constant/triSurface/
diff --git a/tutorials/mesh/snappyHexMesh/gap_detection/Allclean b/tutorials/mesh/snappyHexMesh/gap_detection/Allclean
index be7ddb068847225ad69704840909a7b0d05a5466..e8557c25549b9369ce8225c99735bdfb9731e96c 100755
--- a/tutorials/mesh/snappyHexMesh/gap_detection/Allclean
+++ b/tutorials/mesh/snappyHexMesh/gap_detection/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/mesh/snappyHexMesh/gap_detection/Allrun b/tutorials/mesh/snappyHexMesh/gap_detection/Allrun
index afb0ddb7344dabee640d51c81faffadb1d15018b..1322aa4ec4ff23f4b22a611f72ce062a8aa4e297 100755
--- a/tutorials/mesh/snappyHexMesh/gap_detection/Allrun
+++ b/tutorials/mesh/snappyHexMesh/gap_detection/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/mesh/snappyHexMesh/iglooWithFridgesDirectionalRefinement/Allrun b/tutorials/mesh/snappyHexMesh/iglooWithFridgesDirectionalRefinement/Allrun
index 4ae5f0cec8c0e098b383cb39110a2ebdbb35883f..42bb8606cc0f80fca997289d1b91de91b4676aac 100755
--- a/tutorials/mesh/snappyHexMesh/iglooWithFridgesDirectionalRefinement/Allrun
+++ b/tutorials/mesh/snappyHexMesh/iglooWithFridgesDirectionalRefinement/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/mesh/snappyHexMesh/motorBike_leakDetection/Allclean b/tutorials/mesh/snappyHexMesh/motorBike_leakDetection/Allclean
index 663d8a70a9ed78223f89841f374ca4d7231c273d..fdeb11534646a3892606104264cc8f75f273c88a 100755
--- a/tutorials/mesh/snappyHexMesh/motorBike_leakDetection/Allclean
+++ b/tutorials/mesh/snappyHexMesh/motorBike_leakDetection/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/mesh/snappyHexMesh/motorBike_leakDetection/Allrun b/tutorials/mesh/snappyHexMesh/motorBike_leakDetection/Allrun
index 9b1a0bde55dc03a59cd6dd006fd3ed60e335bd92..149095e62c705a540b49fb420625bc9424453409 100755
--- a/tutorials/mesh/snappyHexMesh/motorBike_leakDetection/Allrun
+++ b/tutorials/mesh/snappyHexMesh/motorBike_leakDetection/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Alternative decomposeParDict name:
 decompDict="-decomposeParDict system/decomposeParDict.6"
diff --git a/tutorials/mesh/snappyHexMesh/opposite_walls/Allclean b/tutorials/mesh/snappyHexMesh/opposite_walls/Allclean
index be7ddb068847225ad69704840909a7b0d05a5466..e8557c25549b9369ce8225c99735bdfb9731e96c 100755
--- a/tutorials/mesh/snappyHexMesh/opposite_walls/Allclean
+++ b/tutorials/mesh/snappyHexMesh/opposite_walls/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/mesh/snappyHexMesh/opposite_walls/Allrun b/tutorials/mesh/snappyHexMesh/opposite_walls/Allrun
index b97b2ffde17ea7473dbabc101fecf9319a4535f1..9b412fc06839f8c2f2e5c597794f1a622c1c0ff9 100755
--- a/tutorials/mesh/snappyHexMesh/opposite_walls/Allrun
+++ b/tutorials/mesh/snappyHexMesh/opposite_walls/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/mesh/stitchMesh/simple-cube1/Allclean b/tutorials/mesh/stitchMesh/simple-cube1/Allclean
index d6d329b5ff7fc534c3227e47c1746e57f96e53f1..cf7138f2d28033dc267e856aaf9197124a5b46b0 100755
--- a/tutorials/mesh/stitchMesh/simple-cube1/Allclean
+++ b/tutorials/mesh/stitchMesh/simple-cube1/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 rmdir constant 2> /dev/null
diff --git a/tutorials/mesh/stitchMesh/simple-cube1/Allmesh b/tutorials/mesh/stitchMesh/simple-cube1/Allmesh
index 3f973d4f6b8b06628fb67c07f0162c71c4bfecd7..33f1381770ae3600aa4976001a3b3de813920026 100755
--- a/tutorials/mesh/stitchMesh/simple-cube1/Allmesh
+++ b/tutorials/mesh/stitchMesh/simple-cube1/Allmesh
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication topoSet
diff --git a/tutorials/mesh/stitchMesh/simple-cube1/Allrun b/tutorials/mesh/stitchMesh/simple-cube1/Allrun
index 9957423e6e5090599549b2b809516bc188ade853..121755665e71444413341f82c091570ae3b77f52 100755
--- a/tutorials/mesh/stitchMesh/simple-cube1/Allrun
+++ b/tutorials/mesh/stitchMesh/simple-cube1/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication ./Allmesh
 
diff --git a/tutorials/mesh/stitchMesh/simple-cube1/Allrun-args b/tutorials/mesh/stitchMesh/simple-cube1/Allrun-args
index b5397f82d3964ca6020d09238ae63390ecc5b24f..aa4eaab99cd6f9277ef10d06e21c0826f18a53be 100755
--- a/tutorials/mesh/stitchMesh/simple-cube1/Allrun-args
+++ b/tutorials/mesh/stitchMesh/simple-cube1/Allrun-args
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication ./Allmesh
 
diff --git a/tutorials/mesh/stitchMesh/simple-cube1/scripts/stitch b/tutorials/mesh/stitchMesh/simple-cube1/scripts/stitch
index fd63d6d6827e674f8b25a8e2a6f471a6c382a659..8865ad9e10de01cd579ab1f8eea27b08496ec316 100755
--- a/tutorials/mesh/stitchMesh/simple-cube1/scripts/stitch
+++ b/tutorials/mesh/stitchMesh/simple-cube1/scripts/stitch
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 [ "$#" -gt 0 ] || {
     echo "provide x, y, z or -all directions"
diff --git a/tutorials/multiphase/MPPICInterFoam/twoPhasePachuka/Allclean b/tutorials/multiphase/MPPICInterFoam/twoPhasePachuka/Allclean
index 8b16e2858e07cb043805998b19117b8d3b4e6e2f..3ed4c04a2c644f87392532a76846375e090293fa 100755
--- a/tutorials/multiphase/MPPICInterFoam/twoPhasePachuka/Allclean
+++ b/tutorials/multiphase/MPPICInterFoam/twoPhasePachuka/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/multiphase/MPPICInterFoam/twoPhasePachuka/Allrun b/tutorials/multiphase/MPPICInterFoam/twoPhasePachuka/Allrun
index b2023e2d8f46bfb931e0e7fc330e09e4368194b9..ad9fd18f015fec86d8f4eaae5b6d1099538681a5 100755
--- a/tutorials/multiphase/MPPICInterFoam/twoPhasePachuka/Allrun
+++ b/tutorials/multiphase/MPPICInterFoam/twoPhasePachuka/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # create the underlying block mesh
 m4 system/pachuka.m4 > system/blockMeshDict
diff --git a/tutorials/multiphase/cavitatingFoam/LES/throttle/Allclean b/tutorials/multiphase/cavitatingFoam/LES/throttle/Allclean
index 7e94847a483cbf4df83508a0f95a3fc916a68ee0..49b95f0bb3e86b3c1819c09cdc034bfce6c7390d 100755
--- a/tutorials/multiphase/cavitatingFoam/LES/throttle/Allclean
+++ b/tutorials/multiphase/cavitatingFoam/LES/throttle/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/multiphase/cavitatingFoam/LES/throttle/Allrun b/tutorials/multiphase/cavitatingFoam/LES/throttle/Allrun
index 1b1d5e80a04b6b22720786aee857387b41d839d0..190ea57a742d53034a54a94e31d066dfa078d704 100755
--- a/tutorials/multiphase/cavitatingFoam/LES/throttle/Allrun
+++ b/tutorials/multiphase/cavitatingFoam/LES/throttle/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 refineMeshByCellSet()
 {
diff --git a/tutorials/multiphase/cavitatingFoam/LES/throttle3D/Allclean b/tutorials/multiphase/cavitatingFoam/LES/throttle3D/Allclean
index d695acbf073c9fc611f3a021b6e81a5404db57fd..8817e7ab4bcf207c0f188c5a704f00cb5ad742de 100755
--- a/tutorials/multiphase/cavitatingFoam/LES/throttle3D/Allclean
+++ b/tutorials/multiphase/cavitatingFoam/LES/throttle3D/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/cavitatingFoam/LES/throttle3D/Allrun b/tutorials/multiphase/cavitatingFoam/LES/throttle3D/Allrun
index 15a39575b71bff31211377e3af282ed3b9a5dc3c..aa4b900b54246060919f88b3893f57ecbd9c767d 100755
--- a/tutorials/multiphase/cavitatingFoam/LES/throttle3D/Allrun
+++ b/tutorials/multiphase/cavitatingFoam/LES/throttle3D/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 refineMeshByCellSet()
 {
diff --git a/tutorials/multiphase/cavitatingFoam/RAS/throttle/Allclean b/tutorials/multiphase/cavitatingFoam/RAS/throttle/Allclean
index 7e94847a483cbf4df83508a0f95a3fc916a68ee0..49b95f0bb3e86b3c1819c09cdc034bfce6c7390d 100755
--- a/tutorials/multiphase/cavitatingFoam/RAS/throttle/Allclean
+++ b/tutorials/multiphase/cavitatingFoam/RAS/throttle/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/multiphase/cavitatingFoam/RAS/throttle/Allrun b/tutorials/multiphase/cavitatingFoam/RAS/throttle/Allrun
index 1b1d5e80a04b6b22720786aee857387b41d839d0..190ea57a742d53034a54a94e31d066dfa078d704 100755
--- a/tutorials/multiphase/cavitatingFoam/RAS/throttle/Allrun
+++ b/tutorials/multiphase/cavitatingFoam/RAS/throttle/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 refineMeshByCellSet()
 {
diff --git a/tutorials/multiphase/compressibleInterDyMFoam/laminar/sloshingTank2D/Allrun b/tutorials/multiphase/compressibleInterDyMFoam/laminar/sloshingTank2D/Allrun
index c63280a960d1163893f5f0dc1ed8a63d3e9fb275..75b0b625cf524cd7567598ffd8d910583f65a8e3 100755
--- a/tutorials/multiphase/compressibleInterDyMFoam/laminar/sloshingTank2D/Allrun
+++ b/tutorials/multiphase/compressibleInterDyMFoam/laminar/sloshingTank2D/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 m4 system/blockMeshDict.m4 > system/blockMeshDict
 runApplication blockMesh
diff --git a/tutorials/multiphase/compressibleInterDyMFoam/laminar/sphereDrop/Allclean b/tutorials/multiphase/compressibleInterDyMFoam/laminar/sphereDrop/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/compressibleInterDyMFoam/laminar/sphereDrop/Allclean
+++ b/tutorials/multiphase/compressibleInterDyMFoam/laminar/sphereDrop/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/compressibleInterDyMFoam/laminar/sphereDrop/Allrun b/tutorials/multiphase/compressibleInterDyMFoam/laminar/sphereDrop/Allrun
index 55bb318bf3053005636f20295f6c0d9903362a36..59cc4d8d97b856f269ee412fba0712214b71bd1f 100755
--- a/tutorials/multiphase/compressibleInterDyMFoam/laminar/sphereDrop/Allrun
+++ b/tutorials/multiphase/compressibleInterDyMFoam/laminar/sphereDrop/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication topoSet
diff --git a/tutorials/multiphase/compressibleInterDyMFoam/laminar/sphereDrop/Allrun-parallel b/tutorials/multiphase/compressibleInterDyMFoam/laminar/sphereDrop/Allrun-parallel
index e66ceb6b8f904e71ae7b5aa663b01c40fe1c6aed..d91fc580cde231a10bcb608b2e9067c3adf0f431 100755
--- a/tutorials/multiphase/compressibleInterDyMFoam/laminar/sphereDrop/Allrun-parallel
+++ b/tutorials/multiphase/compressibleInterDyMFoam/laminar/sphereDrop/Allrun-parallel
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication topoSet
diff --git a/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/Allclean b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/Allclean
+++ b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/Allrun b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/Allrun
index 8f11c77e3f6b4f5c4188e9eb8b6cfd169324b89d..ed2e7082b059229b6229176c24ce21660c99ba37 100755
--- a/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/Allrun
+++ b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication extrudeMesh
diff --git a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/Allclean b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/Allclean
+++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/Allrun b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/Allrun
index 423e9ec8333253c8a4b63faf7af339b443479965..e8157d67f2895a0a9851a38fb791980a9e526448 100755
--- a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/Allrun
+++ b/tutorials/multiphase/compressibleInterFoam/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 restore0Dir
diff --git a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/Allclean b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/Allclean
index 3b8c6e8e2fb2b80437330845ebe5002ef787f4b3..54c07563facd43510f2f89b52eab65e68eae831b 100755
--- a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/Allclean
+++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 rm -rf processor*
diff --git a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/Allrun b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/Allrun
index bdb96428fab4a09fe5434006ac2651a46362525a..675a6c956e36a504bbaaebe281510741a8cabc7d 100755
--- a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/Allrun
+++ b/tutorials/multiphase/compressibleInterFoam/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 restore0Dir
diff --git a/tutorials/multiphase/compressibleMultiphaseInterFoam/laminar/damBreak4phase/Allclean b/tutorials/multiphase/compressibleMultiphaseInterFoam/laminar/damBreak4phase/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/compressibleMultiphaseInterFoam/laminar/damBreak4phase/Allclean
+++ b/tutorials/multiphase/compressibleMultiphaseInterFoam/laminar/damBreak4phase/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/compressibleMultiphaseInterFoam/laminar/damBreak4phase/Allrun b/tutorials/multiphase/compressibleMultiphaseInterFoam/laminar/damBreak4phase/Allrun
index efced0038e951e3578e1e804b9642f639e2bce5e..fce061485e0e7579f73d4a4240f4487846998117 100755
--- a/tutorials/multiphase/compressibleMultiphaseInterFoam/laminar/damBreak4phase/Allrun
+++ b/tutorials/multiphase/compressibleMultiphaseInterFoam/laminar/damBreak4phase/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/multiphase/driftFluxFoam/RAS/mixerVessel2D/Allrun b/tutorials/multiphase/driftFluxFoam/RAS/mixerVessel2D/Allrun
index 6aeae15553237e47ab738d4a985454a979a3ecb5..190a9840fde8f059da240ed54dd0342eaa44c95e 100755
--- a/tutorials/multiphase/driftFluxFoam/RAS/mixerVessel2D/Allrun
+++ b/tutorials/multiphase/driftFluxFoam/RAS/mixerVessel2D/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication ./makeMesh
 runApplication $(getApplication)
diff --git a/tutorials/multiphase/driftFluxFoam/RAS/tank3D/Allrun b/tutorials/multiphase/driftFluxFoam/RAS/tank3D/Allrun
index 16a6a8651d6a191fb9ae6b6f7e308f2e7bb4625e..136dcbed91b184cc77998f7bfc16855394eeab50 100755
--- a/tutorials/multiphase/driftFluxFoam/RAS/tank3D/Allrun
+++ b/tutorials/multiphase/driftFluxFoam/RAS/tank3D/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication $(getApplication)
 
diff --git a/tutorials/multiphase/icoReactingMultiPhaseInterFoam/evaporationMultiComponent/Allclean b/tutorials/multiphase/icoReactingMultiPhaseInterFoam/evaporationMultiComponent/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/icoReactingMultiPhaseInterFoam/evaporationMultiComponent/Allclean
+++ b/tutorials/multiphase/icoReactingMultiPhaseInterFoam/evaporationMultiComponent/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/icoReactingMultiPhaseInterFoam/evaporationMultiComponent/Allrun b/tutorials/multiphase/icoReactingMultiPhaseInterFoam/evaporationMultiComponent/Allrun
index efced0038e951e3578e1e804b9642f639e2bce5e..fce061485e0e7579f73d4a4240f4487846998117 100755
--- a/tutorials/multiphase/icoReactingMultiPhaseInterFoam/evaporationMultiComponent/Allrun
+++ b/tutorials/multiphase/icoReactingMultiPhaseInterFoam/evaporationMultiComponent/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/multiphase/icoReactingMultiPhaseInterFoam/inertMultiphaseMultiComponent/Allclean b/tutorials/multiphase/icoReactingMultiPhaseInterFoam/inertMultiphaseMultiComponent/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/icoReactingMultiPhaseInterFoam/inertMultiphaseMultiComponent/Allclean
+++ b/tutorials/multiphase/icoReactingMultiPhaseInterFoam/inertMultiphaseMultiComponent/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/icoReactingMultiPhaseInterFoam/inertMultiphaseMultiComponent/Allrun b/tutorials/multiphase/icoReactingMultiPhaseInterFoam/inertMultiphaseMultiComponent/Allrun
index efced0038e951e3578e1e804b9642f639e2bce5e..fce061485e0e7579f73d4a4240f4487846998117 100755
--- a/tutorials/multiphase/icoReactingMultiPhaseInterFoam/inertMultiphaseMultiComponent/Allrun
+++ b/tutorials/multiphase/icoReactingMultiPhaseInterFoam/inertMultiphaseMultiComponent/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/Allclean b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/Allclean
index be7ddb068847225ad69704840909a7b0d05a5466..e8557c25549b9369ce8225c99735bdfb9731e96c 100755
--- a/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/Allclean
+++ b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/Allrun b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/Allrun
index 5aace967ac4c7f273caf2a3a8ac42a7b8a102d07..b17300cb715c3e9b70238a9ca82b22d63d62fd3e 100755
--- a/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/Allrun
+++ b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 application=$(getApplication)
 
diff --git a/tutorials/multiphase/interFoam/LES/nozzleFlow2D/Allclean b/tutorials/multiphase/interFoam/LES/nozzleFlow2D/Allclean
index 20ea2353bb177f42db6860107337758b9cfe4e49..34c27ce61da64d0a34eafd70d7db0745f266114e 100755
--- a/tutorials/multiphase/interFoam/LES/nozzleFlow2D/Allclean
+++ b/tutorials/multiphase/interFoam/LES/nozzleFlow2D/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 rm system/topoSetDict > /dev/null 2>&1
diff --git a/tutorials/multiphase/interFoam/LES/nozzleFlow2D/Allrun b/tutorials/multiphase/interFoam/LES/nozzleFlow2D/Allrun
index dc59cb1831bcf809955b78362151a493fba74e80..cfa8a8c9242929470ddc76cd4140b1318f23bca4 100755
--- a/tutorials/multiphase/interFoam/LES/nozzleFlow2D/Allrun
+++ b/tutorials/multiphase/interFoam/LES/nozzleFlow2D/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/multiphase/interFoam/RAS/DTCHull/Allclean b/tutorials/multiphase/interFoam/RAS/DTCHull/Allclean
index 9c855955a4ed9f41733f726e8e4fc17989d119aa..218cfbeef189f8ff1bd43f9e0259748604d7eed9 100755
--- a/tutorials/multiphase/interFoam/RAS/DTCHull/Allclean
+++ b/tutorials/multiphase/interFoam/RAS/DTCHull/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interFoam/RAS/DTCHull/Allrun b/tutorials/multiphase/interFoam/RAS/DTCHull/Allrun
index 2bd2c19a2fffdb34473d4642164182bdcd52cdd8..ac333f9ecc0910c070dc35bb48db613b4d307069 100755
--- a/tutorials/multiphase/interFoam/RAS/DTCHull/Allrun
+++ b/tutorials/multiphase/interFoam/RAS/DTCHull/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # copy DTC hull surface from resources folder
 \cp $FOAM_TUTORIALS/resources/geometry/DTC-scaled.stl.gz constant/triSurface/
diff --git a/tutorials/multiphase/interFoam/RAS/DTCHullMoving/Allclean b/tutorials/multiphase/interFoam/RAS/DTCHullMoving/Allclean
index 6149df2bfa85ab5eb74544c518b32afa9de13f91..f6e7bddddd06a48567e0ae98f6b341c43cb24d4f 100755
--- a/tutorials/multiphase/interFoam/RAS/DTCHullMoving/Allclean
+++ b/tutorials/multiphase/interFoam/RAS/DTCHullMoving/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interFoam/RAS/DTCHullMoving/Allrun b/tutorials/multiphase/interFoam/RAS/DTCHullMoving/Allrun
index 975e30d65edecb2a920a5e6c905f4e3258b75da8..199fc81ac454c26bcba3b7947cc2d564b5369b5e 100755
--- a/tutorials/multiphase/interFoam/RAS/DTCHullMoving/Allrun
+++ b/tutorials/multiphase/interFoam/RAS/DTCHullMoving/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # copy DTC hull surface from resources folder
 cp $FOAM_TUTORIALS/resources/geometry/DTC-scaled.stl.gz constant/triSurface/
diff --git a/tutorials/multiphase/interFoam/RAS/angledDuct/Allrun b/tutorials/multiphase/interFoam/RAS/angledDuct/Allrun
index 54368cee898fed93435e246ad8a5c58cca03fd25..1bc5f6f547fb957622490442eaf81b6af79c4861 100755
--- a/tutorials/multiphase/interFoam/RAS/angledDuct/Allrun
+++ b/tutorials/multiphase/interFoam/RAS/angledDuct/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 m4 system/blockMeshDict.m4 > system/blockMeshDict
 
diff --git a/tutorials/multiphase/interFoam/RAS/damBreak/Allclean b/tutorials/multiphase/interFoam/RAS/damBreak/Allclean
index a818e3ba0e87a5767608be3a4cde463239873518..7608832fc44cdbd871c7b37cf5bbe5dc30731b8a 100755
--- a/tutorials/multiphase/interFoam/RAS/damBreak/Allclean
+++ b/tutorials/multiphase/interFoam/RAS/damBreak/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 keepCases="damBreak"
 loseCases="damBreakFine"
diff --git a/tutorials/multiphase/interFoam/RAS/damBreak/Allrun b/tutorials/multiphase/interFoam/RAS/damBreak/Allrun
index 156eceb207e47389b73adb1a7c3dc5d0bbf5834f..2ba44b67769ee9a2ca5fb5986b901ae0a0696172 100755
--- a/tutorials/multiphase/interFoam/RAS/damBreak/Allrun
+++ b/tutorials/multiphase/interFoam/RAS/damBreak/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 setDamBreakFine ()
 {
diff --git a/tutorials/multiphase/interFoam/RAS/damBreak/damBreak/Allclean b/tutorials/multiphase/interFoam/RAS/damBreak/damBreak/Allclean
index f578727b2fead8d69ef30991ee5b658c29918804..f844732f6a3d0b6752995a44e34621504e932e7f 100755
--- a/tutorials/multiphase/interFoam/RAS/damBreak/damBreak/Allclean
+++ b/tutorials/multiphase/interFoam/RAS/damBreak/damBreak/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 \cp 0/alpha.water.orig 0/alpha.water
diff --git a/tutorials/multiphase/interFoam/RAS/damBreak/damBreak/Allrun b/tutorials/multiphase/interFoam/RAS/damBreak/damBreak/Allrun
index 5bd0f99f3039b9d3fa38ab804d7ac71fac5c2992..edff8a339dfa034753e787fd2245a404367535be 100755
--- a/tutorials/multiphase/interFoam/RAS/damBreak/damBreak/Allrun
+++ b/tutorials/multiphase/interFoam/RAS/damBreak/damBreak/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication setFields
diff --git a/tutorials/multiphase/interFoam/RAS/damBreakPorousBaffle/Allclean b/tutorials/multiphase/interFoam/RAS/damBreakPorousBaffle/Allclean
index f578727b2fead8d69ef30991ee5b658c29918804..f844732f6a3d0b6752995a44e34621504e932e7f 100755
--- a/tutorials/multiphase/interFoam/RAS/damBreakPorousBaffle/Allclean
+++ b/tutorials/multiphase/interFoam/RAS/damBreakPorousBaffle/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 \cp 0/alpha.water.orig 0/alpha.water
diff --git a/tutorials/multiphase/interFoam/RAS/damBreakPorousBaffle/Allrun b/tutorials/multiphase/interFoam/RAS/damBreakPorousBaffle/Allrun
index 7d16543244384e89cd334a48c5368980c379f349..a78d851364b79b10ccaff22dcee0e2f354112982 100755
--- a/tutorials/multiphase/interFoam/RAS/damBreakPorousBaffle/Allrun
+++ b/tutorials/multiphase/interFoam/RAS/damBreakPorousBaffle/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication setFields
diff --git a/tutorials/multiphase/interFoam/RAS/floatingObject/Allclean b/tutorials/multiphase/interFoam/RAS/floatingObject/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/interFoam/RAS/floatingObject/Allclean
+++ b/tutorials/multiphase/interFoam/RAS/floatingObject/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interFoam/RAS/floatingObject/Allrun b/tutorials/multiphase/interFoam/RAS/floatingObject/Allrun
index 7aede960f72d0bda4e22fb29ce417d77fcf026d5..cd227b5d5ef0858679e4649dd0525e3597179cdb 100755
--- a/tutorials/multiphase/interFoam/RAS/floatingObject/Allrun
+++ b/tutorials/multiphase/interFoam/RAS/floatingObject/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication topoSet
diff --git a/tutorials/multiphase/interFoam/RAS/mixerVesselAMI/Allclean b/tutorials/multiphase/interFoam/RAS/mixerVesselAMI/Allclean
index 9f8dfd78081276e5417cd1115413728c1215172e..11ce459dad78d555a87b92cfabc2758a09c3dc40 100755
--- a/tutorials/multiphase/interFoam/RAS/mixerVesselAMI/Allclean
+++ b/tutorials/multiphase/interFoam/RAS/mixerVesselAMI/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interFoam/RAS/mixerVesselAMI/Allrun b/tutorials/multiphase/interFoam/RAS/mixerVesselAMI/Allrun
index 62fbd9b214111811f2a27a51ff3f10b8f69b4d30..4a4de7794ebc6789bc0487e79d1abc7460f5da4a 100755
--- a/tutorials/multiphase/interFoam/RAS/mixerVesselAMI/Allrun
+++ b/tutorials/multiphase/interFoam/RAS/mixerVesselAMI/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/multiphase/interFoam/RAS/mixerVesselAMI/Allrun.pre b/tutorials/multiphase/interFoam/RAS/mixerVesselAMI/Allrun.pre
index 684bc56996100e09003ad7d1d8b3c0270fae7505..38e3dcf5e21d7518ede3b9d3d52e5b022c631cfa 100755
--- a/tutorials/multiphase/interFoam/RAS/mixerVesselAMI/Allrun.pre
+++ b/tutorials/multiphase/interFoam/RAS/mixerVesselAMI/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 \rm -rf 0
 
diff --git a/tutorials/multiphase/interFoam/RAS/motorBike/Allclean b/tutorials/multiphase/interFoam/RAS/motorBike/Allclean
index a8a5c30fc0f29e6c3b4d999538e533567eecfafc..13ecb95a644d3943c0c824ad1b7780c4c86b6b65 100755
--- a/tutorials/multiphase/interFoam/RAS/motorBike/Allclean
+++ b/tutorials/multiphase/interFoam/RAS/motorBike/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interFoam/RAS/motorBike/Allrun b/tutorials/multiphase/interFoam/RAS/motorBike/Allrun
index e2641b893488562fb8bcc07479b8bdae0065f169..b8d4678f2892823a78f9f344c61e8589e96d31cf 100755
--- a/tutorials/multiphase/interFoam/RAS/motorBike/Allrun
+++ b/tutorials/multiphase/interFoam/RAS/motorBike/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/multiphase/interFoam/RAS/motorBike/Allrun.pre b/tutorials/multiphase/interFoam/RAS/motorBike/Allrun.pre
index 030f1f8113cc24cd01fa7f5b6fff148a8df31214..49bcd93f9deb6886382f9fb5098c7a635fbcadb7 100755
--- a/tutorials/multiphase/interFoam/RAS/motorBike/Allrun.pre
+++ b/tutorials/multiphase/interFoam/RAS/motorBike/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # copy motorbike surface from resources directory
 \cp $FOAM_TUTORIALS/resources/geometry/motorBike.obj.gz constant/triSurface/
diff --git a/tutorials/multiphase/interFoam/RAS/waterChannel/Allclean b/tutorials/multiphase/interFoam/RAS/waterChannel/Allclean
index b5e3d9ce8810b71807ee3d2b6171301230ae4163..7d44818d3f095bdf1cbee37c9bd3f1e8a23e9c12 100755
--- a/tutorials/multiphase/interFoam/RAS/waterChannel/Allclean
+++ b/tutorials/multiphase/interFoam/RAS/waterChannel/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/multiphase/interFoam/RAS/waterChannel/Allmesh b/tutorials/multiphase/interFoam/RAS/waterChannel/Allmesh
index d0b3f7537812896c7c4e2082db74e37f733f321d..b72b34c84ee3669ded900143f9b58c8d671fb8df 100755
--- a/tutorials/multiphase/interFoam/RAS/waterChannel/Allmesh
+++ b/tutorials/multiphase/interFoam/RAS/waterChannel/Allmesh
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/multiphase/interFoam/RAS/waterChannel/Allrun b/tutorials/multiphase/interFoam/RAS/waterChannel/Allrun
index 072b6d2b199dd1331bf4c5bc44eda10220f01b2b..133515ae79a971a4b0719ae18927f0beffa6f9b1 100755
--- a/tutorials/multiphase/interFoam/RAS/waterChannel/Allrun
+++ b/tutorials/multiphase/interFoam/RAS/waterChannel/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allmesh
 
diff --git a/tutorials/multiphase/interFoam/RAS/weirOverflow/Allclean b/tutorials/multiphase/interFoam/RAS/weirOverflow/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/interFoam/RAS/weirOverflow/Allclean
+++ b/tutorials/multiphase/interFoam/RAS/weirOverflow/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interFoam/RAS/weirOverflow/Allrun b/tutorials/multiphase/interFoam/RAS/weirOverflow/Allrun
index c7107259267d9ec3d57107003fcfe6a9e1483ad5..0818d6f789c1eb90c0118a333f4638f4593ef860 100755
--- a/tutorials/multiphase/interFoam/RAS/weirOverflow/Allrun
+++ b/tutorials/multiphase/interFoam/RAS/weirOverflow/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/multiphase/interFoam/laminar/capillaryRise/Allrun b/tutorials/multiphase/interFoam/laminar/capillaryRise/Allrun
index 42050e1779d7533762023958cb4a380ced878d8c..12a2ede0d119214ba62b8f47bfe126dd0993eff6 100755
--- a/tutorials/multiphase/interFoam/laminar/capillaryRise/Allrun
+++ b/tutorials/multiphase/interFoam/laminar/capillaryRise/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 \cp 0/alpha.water.orig 0/alpha.water
diff --git a/tutorials/multiphase/interFoam/laminar/damBreak/Allclean b/tutorials/multiphase/interFoam/laminar/damBreak/Allclean
index a818e3ba0e87a5767608be3a4cde463239873518..7608832fc44cdbd871c7b37cf5bbe5dc30731b8a 100755
--- a/tutorials/multiphase/interFoam/laminar/damBreak/Allclean
+++ b/tutorials/multiphase/interFoam/laminar/damBreak/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 keepCases="damBreak"
 loseCases="damBreakFine"
diff --git a/tutorials/multiphase/interFoam/laminar/damBreak/Allrun b/tutorials/multiphase/interFoam/laminar/damBreak/Allrun
index 7380914b2a79dcc8f3eb7a68fd0a6306536391df..2de83a9405595b9e8ebda104dd88d8b42a2426f0 100755
--- a/tutorials/multiphase/interFoam/laminar/damBreak/Allrun
+++ b/tutorials/multiphase/interFoam/laminar/damBreak/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 setDamBreakFine ()
 {
diff --git a/tutorials/multiphase/interFoam/laminar/damBreak/damBreak/Allclean b/tutorials/multiphase/interFoam/laminar/damBreak/damBreak/Allclean
index f578727b2fead8d69ef30991ee5b658c29918804..f844732f6a3d0b6752995a44e34621504e932e7f 100755
--- a/tutorials/multiphase/interFoam/laminar/damBreak/damBreak/Allclean
+++ b/tutorials/multiphase/interFoam/laminar/damBreak/damBreak/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 \cp 0/alpha.water.orig 0/alpha.water
diff --git a/tutorials/multiphase/interFoam/laminar/damBreak/damBreak/Allrun b/tutorials/multiphase/interFoam/laminar/damBreak/damBreak/Allrun
index 5bd0f99f3039b9d3fa38ab804d7ac71fac5c2992..edff8a339dfa034753e787fd2245a404367535be 100755
--- a/tutorials/multiphase/interFoam/laminar/damBreak/damBreak/Allrun
+++ b/tutorials/multiphase/interFoam/laminar/damBreak/damBreak/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication setFields
diff --git a/tutorials/multiphase/interFoam/laminar/damBreakWithObstacle/Allclean b/tutorials/multiphase/interFoam/laminar/damBreakWithObstacle/Allclean
index dced1dda723237787258bc6840909d194eaea571..48516d0f4f05137eda7a1af4a995f6a41e604409 100755
--- a/tutorials/multiphase/interFoam/laminar/damBreakWithObstacle/Allclean
+++ b/tutorials/multiphase/interFoam/laminar/damBreakWithObstacle/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interFoam/laminar/damBreakWithObstacle/Allrun b/tutorials/multiphase/interFoam/laminar/damBreakWithObstacle/Allrun
index 4c6e367d38828ee1847f074af06109a7217f3c47..9e66b26663d0cae43d180748d133372d9cad7a2e 100755
--- a/tutorials/multiphase/interFoam/laminar/damBreakWithObstacle/Allrun
+++ b/tutorials/multiphase/interFoam/laminar/damBreakWithObstacle/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 runApplication blockMesh
diff --git a/tutorials/multiphase/interFoam/laminar/mixerVessel2D/Allrun b/tutorials/multiphase/interFoam/laminar/mixerVessel2D/Allrun
index 3aa1e7a9dd9987a2262eb748bd1c0553cf68f4a1..5f6eab94f92a7b829fc6accca38260446bed6161 100755
--- a/tutorials/multiphase/interFoam/laminar/mixerVessel2D/Allrun
+++ b/tutorials/multiphase/interFoam/laminar/mixerVessel2D/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication ./makeMesh
 \cp 0/alpha.water.orig 0/alpha.water
diff --git a/tutorials/multiphase/interFoam/laminar/sloshingCylinder/Allrun b/tutorials/multiphase/interFoam/laminar/sloshingCylinder/Allrun
index 9fa872e193fb5a401c8715850433d113d6cc200b..eff0714424af126adfc506abe904792345bbbe84 100755
--- a/tutorials/multiphase/interFoam/laminar/sloshingCylinder/Allrun
+++ b/tutorials/multiphase/interFoam/laminar/sloshingCylinder/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication snappyHexMesh -overwrite
diff --git a/tutorials/multiphase/interFoam/laminar/sloshingTank2D/Allrun b/tutorials/multiphase/interFoam/laminar/sloshingTank2D/Allrun
index ae24f74396c61015d61eaa458007ea37005d9e82..c9defa12df8138f6b3baa65d103333f81a554a7e 100755
--- a/tutorials/multiphase/interFoam/laminar/sloshingTank2D/Allrun
+++ b/tutorials/multiphase/interFoam/laminar/sloshingTank2D/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 m4 system/blockMeshDict.m4 > system/blockMeshDict
 runApplication blockMesh
diff --git a/tutorials/multiphase/interFoam/laminar/sloshingTank2D3DoF/Allrun b/tutorials/multiphase/interFoam/laminar/sloshingTank2D3DoF/Allrun
index ae24f74396c61015d61eaa458007ea37005d9e82..c9defa12df8138f6b3baa65d103333f81a554a7e 100755
--- a/tutorials/multiphase/interFoam/laminar/sloshingTank2D3DoF/Allrun
+++ b/tutorials/multiphase/interFoam/laminar/sloshingTank2D3DoF/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 m4 system/blockMeshDict.m4 > system/blockMeshDict
 runApplication blockMesh
diff --git a/tutorials/multiphase/interFoam/laminar/sloshingTank3D/Allrun b/tutorials/multiphase/interFoam/laminar/sloshingTank3D/Allrun
index ae24f74396c61015d61eaa458007ea37005d9e82..c9defa12df8138f6b3baa65d103333f81a554a7e 100755
--- a/tutorials/multiphase/interFoam/laminar/sloshingTank3D/Allrun
+++ b/tutorials/multiphase/interFoam/laminar/sloshingTank3D/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 m4 system/blockMeshDict.m4 > system/blockMeshDict
 runApplication blockMesh
diff --git a/tutorials/multiphase/interFoam/laminar/sloshingTank3D3DoF/Allrun b/tutorials/multiphase/interFoam/laminar/sloshingTank3D3DoF/Allrun
index faada17ac684327d7cfec73fd698cb7d002d0a33..00a7c77d2ee784f6ddd69afdcae3ca5d2063c6fc 100755
--- a/tutorials/multiphase/interFoam/laminar/sloshingTank3D3DoF/Allrun
+++ b/tutorials/multiphase/interFoam/laminar/sloshingTank3D3DoF/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 m4 system/blockMeshDict.m4 > system/blockMeshDict
 runApplication blockMesh
diff --git a/tutorials/multiphase/interFoam/laminar/sloshingTank3D6DoF/Allrun b/tutorials/multiphase/interFoam/laminar/sloshingTank3D6DoF/Allrun
index c63280a960d1163893f5f0dc1ed8a63d3e9fb275..75b0b625cf524cd7567598ffd8d910583f65a8e3 100755
--- a/tutorials/multiphase/interFoam/laminar/sloshingTank3D6DoF/Allrun
+++ b/tutorials/multiphase/interFoam/laminar/sloshingTank3D6DoF/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 m4 system/blockMeshDict.m4 > system/blockMeshDict
 runApplication blockMesh
diff --git a/tutorials/multiphase/interFoam/laminar/testTubeMixer/Allclean b/tutorials/multiphase/interFoam/laminar/testTubeMixer/Allclean
index e068de2b139eb5f83cab7b3da1a5010b1489443c..390a5cd3092c9bf423ffcf3e7bd252a51f1e54fa 100755
--- a/tutorials/multiphase/interFoam/laminar/testTubeMixer/Allclean
+++ b/tutorials/multiphase/interFoam/laminar/testTubeMixer/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 rm -rf 0/alpha.water
diff --git a/tutorials/multiphase/interFoam/laminar/testTubeMixer/Allrun b/tutorials/multiphase/interFoam/laminar/testTubeMixer/Allrun
index a96f714b609e72d4bb7b3fc4b4a6803241971e3e..9cd6307290c59a80b58e55768445b2db770c1fac 100755
--- a/tutorials/multiphase/interFoam/laminar/testTubeMixer/Allrun
+++ b/tutorials/multiphase/interFoam/laminar/testTubeMixer/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 cp 0/alpha.water.orig 0/alpha.water
diff --git a/tutorials/multiphase/interFoam/laminar/vofToLagrangian/Allrun b/tutorials/multiphase/interFoam/laminar/vofToLagrangian/Allrun
index 2d0315eac3561aaf5a67b5de83818f7e33630239..ff423da5a7156d354c38ee32299a871088e21e57 100755
--- a/tutorials/multiphase/interFoam/laminar/vofToLagrangian/Allrun
+++ b/tutorials/multiphase/interFoam/laminar/vofToLagrangian/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 (cd eulerianInjection && ./Allrun $*)
 
diff --git a/tutorials/multiphase/interFoam/laminar/vofToLagrangian/eulerianInjection/Allclean b/tutorials/multiphase/interFoam/laminar/vofToLagrangian/eulerianInjection/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/interFoam/laminar/vofToLagrangian/eulerianInjection/Allclean
+++ b/tutorials/multiphase/interFoam/laminar/vofToLagrangian/eulerianInjection/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interFoam/laminar/vofToLagrangian/eulerianInjection/Allrun b/tutorials/multiphase/interFoam/laminar/vofToLagrangian/eulerianInjection/Allrun
index bf653b648363a73588da076d87c4199380f5a93c..338caa0a512f2f397b47c3c351a7f79fbc0a7caf 100755
--- a/tutorials/multiphase/interFoam/laminar/vofToLagrangian/eulerianInjection/Allrun
+++ b/tutorials/multiphase/interFoam/laminar/vofToLagrangian/eulerianInjection/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication  -s createBlockage topoSet -dict system/topoSetDict.createBlockage
diff --git a/tutorials/multiphase/interFoam/laminar/vofToLagrangian/lagrangianDistributionInjection/Allclean b/tutorials/multiphase/interFoam/laminar/vofToLagrangian/lagrangianDistributionInjection/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/interFoam/laminar/vofToLagrangian/lagrangianDistributionInjection/Allclean
+++ b/tutorials/multiphase/interFoam/laminar/vofToLagrangian/lagrangianDistributionInjection/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interFoam/laminar/vofToLagrangian/lagrangianDistributionInjection/Allrun b/tutorials/multiphase/interFoam/laminar/vofToLagrangian/lagrangianDistributionInjection/Allrun
index 595da750655a7aa4ac123a09d06fae0ad0104b7e..94820b0fe37f41d70f24a18da7c1d8908af32768 100755
--- a/tutorials/multiphase/interFoam/laminar/vofToLagrangian/lagrangianDistributionInjection/Allrun
+++ b/tutorials/multiphase/interFoam/laminar/vofToLagrangian/lagrangianDistributionInjection/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 eulerianCase=../eulerianInjection
 
diff --git a/tutorials/multiphase/interFoam/laminar/vofToLagrangian/lagrangianParticleInjection/Allclean b/tutorials/multiphase/interFoam/laminar/vofToLagrangian/lagrangianParticleInjection/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/interFoam/laminar/vofToLagrangian/lagrangianParticleInjection/Allclean
+++ b/tutorials/multiphase/interFoam/laminar/vofToLagrangian/lagrangianParticleInjection/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interFoam/laminar/vofToLagrangian/lagrangianParticleInjection/Allrun b/tutorials/multiphase/interFoam/laminar/vofToLagrangian/lagrangianParticleInjection/Allrun
index 24fab8cccb6bdfbda334948a7ea180014905c820..94820b0fe37f41d70f24a18da7c1d8908af32768 100755
--- a/tutorials/multiphase/interFoam/laminar/vofToLagrangian/lagrangianParticleInjection/Allrun
+++ b/tutorials/multiphase/interFoam/laminar/vofToLagrangian/lagrangianParticleInjection/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 eulerianCase=../eulerianInjection
 
@@ -56,5 +57,4 @@ runApplication blockMesh
 
 runApplication $(getApplication)
 
-
 #------------------------------------------------------------------------------
diff --git a/tutorials/multiphase/interFoam/laminar/waves/cnoidal/Allclean b/tutorials/multiphase/interFoam/laminar/waves/cnoidal/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/interFoam/laminar/waves/cnoidal/Allclean
+++ b/tutorials/multiphase/interFoam/laminar/waves/cnoidal/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interFoam/laminar/waves/cnoidal/Allrun b/tutorials/multiphase/interFoam/laminar/waves/cnoidal/Allrun
index 28bf991e627511713c3b915ac0d9998f068ce030..76989b6f176ffbb6007fe17e509733da35546db2 100755
--- a/tutorials/multiphase/interFoam/laminar/waves/cnoidal/Allrun
+++ b/tutorials/multiphase/interFoam/laminar/waves/cnoidal/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/multiphase/interFoam/laminar/waves/irregularMultiDirection/Allclean b/tutorials/multiphase/interFoam/laminar/waves/irregularMultiDirection/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/interFoam/laminar/waves/irregularMultiDirection/Allclean
+++ b/tutorials/multiphase/interFoam/laminar/waves/irregularMultiDirection/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interFoam/laminar/waves/irregularMultiDirection/Allrun b/tutorials/multiphase/interFoam/laminar/waves/irregularMultiDirection/Allrun
index 28bf991e627511713c3b915ac0d9998f068ce030..76989b6f176ffbb6007fe17e509733da35546db2 100755
--- a/tutorials/multiphase/interFoam/laminar/waves/irregularMultiDirection/Allrun
+++ b/tutorials/multiphase/interFoam/laminar/waves/irregularMultiDirection/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/multiphase/interFoam/laminar/waves/mangroveInteraction/Allclean b/tutorials/multiphase/interFoam/laminar/waves/mangroveInteraction/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/interFoam/laminar/waves/mangroveInteraction/Allclean
+++ b/tutorials/multiphase/interFoam/laminar/waves/mangroveInteraction/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interFoam/laminar/waves/mangroveInteraction/Allrun b/tutorials/multiphase/interFoam/laminar/waves/mangroveInteraction/Allrun
index 471e2eeb5f00fa79ab2839d71e7cd1437c39c572..070006d22b0e546f4e75ad63302fc76de5ec096e 100755
--- a/tutorials/multiphase/interFoam/laminar/waves/mangroveInteraction/Allrun
+++ b/tutorials/multiphase/interFoam/laminar/waves/mangroveInteraction/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/multiphase/interFoam/laminar/waves/solitary/Allclean b/tutorials/multiphase/interFoam/laminar/waves/solitary/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/interFoam/laminar/waves/solitary/Allclean
+++ b/tutorials/multiphase/interFoam/laminar/waves/solitary/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interFoam/laminar/waves/solitary/Allrun b/tutorials/multiphase/interFoam/laminar/waves/solitary/Allrun
index 28bf991e627511713c3b915ac0d9998f068ce030..76989b6f176ffbb6007fe17e509733da35546db2 100755
--- a/tutorials/multiphase/interFoam/laminar/waves/solitary/Allrun
+++ b/tutorials/multiphase/interFoam/laminar/waves/solitary/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/multiphase/interFoam/laminar/waves/solitaryGrimshaw/Allclean b/tutorials/multiphase/interFoam/laminar/waves/solitaryGrimshaw/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/interFoam/laminar/waves/solitaryGrimshaw/Allclean
+++ b/tutorials/multiphase/interFoam/laminar/waves/solitaryGrimshaw/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interFoam/laminar/waves/solitaryGrimshaw/Allrun b/tutorials/multiphase/interFoam/laminar/waves/solitaryGrimshaw/Allrun
index 28bf991e627511713c3b915ac0d9998f068ce030..76989b6f176ffbb6007fe17e509733da35546db2 100755
--- a/tutorials/multiphase/interFoam/laminar/waves/solitaryGrimshaw/Allrun
+++ b/tutorials/multiphase/interFoam/laminar/waves/solitaryGrimshaw/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/multiphase/interFoam/laminar/waves/solitaryMcCowan/Allclean b/tutorials/multiphase/interFoam/laminar/waves/solitaryMcCowan/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/interFoam/laminar/waves/solitaryMcCowan/Allclean
+++ b/tutorials/multiphase/interFoam/laminar/waves/solitaryMcCowan/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interFoam/laminar/waves/solitaryMcCowan/Allrun b/tutorials/multiphase/interFoam/laminar/waves/solitaryMcCowan/Allrun
index 28bf991e627511713c3b915ac0d9998f068ce030..76989b6f176ffbb6007fe17e509733da35546db2 100755
--- a/tutorials/multiphase/interFoam/laminar/waves/solitaryMcCowan/Allrun
+++ b/tutorials/multiphase/interFoam/laminar/waves/solitaryMcCowan/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/multiphase/interFoam/laminar/waves/stokesI/Allclean b/tutorials/multiphase/interFoam/laminar/waves/stokesI/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/interFoam/laminar/waves/stokesI/Allclean
+++ b/tutorials/multiphase/interFoam/laminar/waves/stokesI/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interFoam/laminar/waves/stokesI/Allrun b/tutorials/multiphase/interFoam/laminar/waves/stokesI/Allrun
index 28bf991e627511713c3b915ac0d9998f068ce030..76989b6f176ffbb6007fe17e509733da35546db2 100755
--- a/tutorials/multiphase/interFoam/laminar/waves/stokesI/Allrun
+++ b/tutorials/multiphase/interFoam/laminar/waves/stokesI/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/multiphase/interFoam/laminar/waves/stokesII/Allclean b/tutorials/multiphase/interFoam/laminar/waves/stokesII/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/interFoam/laminar/waves/stokesII/Allclean
+++ b/tutorials/multiphase/interFoam/laminar/waves/stokesII/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interFoam/laminar/waves/stokesII/Allrun b/tutorials/multiphase/interFoam/laminar/waves/stokesII/Allrun
index 28bf991e627511713c3b915ac0d9998f068ce030..76989b6f176ffbb6007fe17e509733da35546db2 100755
--- a/tutorials/multiphase/interFoam/laminar/waves/stokesII/Allrun
+++ b/tutorials/multiphase/interFoam/laminar/waves/stokesII/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/multiphase/interFoam/laminar/waves/stokesV/Allclean b/tutorials/multiphase/interFoam/laminar/waves/stokesV/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/interFoam/laminar/waves/stokesV/Allclean
+++ b/tutorials/multiphase/interFoam/laminar/waves/stokesV/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interFoam/laminar/waves/stokesV/Allrun b/tutorials/multiphase/interFoam/laminar/waves/stokesV/Allrun
index 28bf991e627511713c3b915ac0d9998f068ce030..76989b6f176ffbb6007fe17e509733da35546db2 100755
--- a/tutorials/multiphase/interFoam/laminar/waves/stokesV/Allrun
+++ b/tutorials/multiphase/interFoam/laminar/waves/stokesV/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/multiphase/interFoam/laminar/waves/streamFunction/Allclean b/tutorials/multiphase/interFoam/laminar/waves/streamFunction/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/interFoam/laminar/waves/streamFunction/Allclean
+++ b/tutorials/multiphase/interFoam/laminar/waves/streamFunction/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interFoam/laminar/waves/streamFunction/Allrun b/tutorials/multiphase/interFoam/laminar/waves/streamFunction/Allrun
index 28bf991e627511713c3b915ac0d9998f068ce030..76989b6f176ffbb6007fe17e509733da35546db2 100755
--- a/tutorials/multiphase/interFoam/laminar/waves/streamFunction/Allrun
+++ b/tutorials/multiphase/interFoam/laminar/waves/streamFunction/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/multiphase/interFoam/laminar/waves/waveMakerFlap/Allclean b/tutorials/multiphase/interFoam/laminar/waves/waveMakerFlap/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/interFoam/laminar/waves/waveMakerFlap/Allclean
+++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerFlap/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interFoam/laminar/waves/waveMakerFlap/Allrun b/tutorials/multiphase/interFoam/laminar/waves/waveMakerFlap/Allrun
index 28bf991e627511713c3b915ac0d9998f068ce030..76989b6f176ffbb6007fe17e509733da35546db2 100755
--- a/tutorials/multiphase/interFoam/laminar/waves/waveMakerFlap/Allrun
+++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerFlap/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/multiphase/interFoam/laminar/waves/waveMakerPiston/Allclean b/tutorials/multiphase/interFoam/laminar/waves/waveMakerPiston/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/interFoam/laminar/waves/waveMakerPiston/Allclean
+++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerPiston/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interFoam/laminar/waves/waveMakerPiston/Allrun b/tutorials/multiphase/interFoam/laminar/waves/waveMakerPiston/Allrun
index 28bf991e627511713c3b915ac0d9998f068ce030..76989b6f176ffbb6007fe17e509733da35546db2 100755
--- a/tutorials/multiphase/interFoam/laminar/waves/waveMakerPiston/Allrun
+++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerPiston/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/multiphase/interFoam/laminar/waves/waveMakerSolitary/Allclean b/tutorials/multiphase/interFoam/laminar/waves/waveMakerSolitary/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/interFoam/laminar/waves/waveMakerSolitary/Allclean
+++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerSolitary/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interFoam/laminar/waves/waveMakerSolitary/Allrun b/tutorials/multiphase/interFoam/laminar/waves/waveMakerSolitary/Allrun
index 28bf991e627511713c3b915ac0d9998f068ce030..76989b6f176ffbb6007fe17e509733da35546db2 100755
--- a/tutorials/multiphase/interFoam/laminar/waves/waveMakerSolitary/Allrun
+++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerSolitary/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/multiphase/interIsoFoam/damBreak/Allclean b/tutorials/multiphase/interIsoFoam/damBreak/Allclean
index 40363dccf7f6d56bcac00e3d3a0b08e15de8c511..dd424f984f8d5ad4e75763008dec645d96a14971 100755
--- a/tutorials/multiphase/interIsoFoam/damBreak/Allclean
+++ b/tutorials/multiphase/interIsoFoam/damBreak/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 \rm -rf isoFaces
diff --git a/tutorials/multiphase/interIsoFoam/damBreak/Allrun b/tutorials/multiphase/interIsoFoam/damBreak/Allrun
index afce7038479ee2219416b800f2166f942669b718..3345fa8e32494add332062f06a9fa4eed2f18453 100755
--- a/tutorials/multiphase/interIsoFoam/damBreak/Allrun
+++ b/tutorials/multiphase/interIsoFoam/damBreak/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/multiphase/interIsoFoam/damBreak/Allrun-parallel b/tutorials/multiphase/interIsoFoam/damBreak/Allrun-parallel
index 2a2861b7303554bb3d0a6d722f1dfeee4c53fb15..34abec3a7ea85972d1e41d41f3e7df1d06b1159e 100755
--- a/tutorials/multiphase/interIsoFoam/damBreak/Allrun-parallel
+++ b/tutorials/multiphase/interIsoFoam/damBreak/Allrun-parallel
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/multiphase/interIsoFoam/damBreakWithObstacle/Allclean b/tutorials/multiphase/interIsoFoam/damBreakWithObstacle/Allclean
index dced1dda723237787258bc6840909d194eaea571..48516d0f4f05137eda7a1af4a995f6a41e604409 100755
--- a/tutorials/multiphase/interIsoFoam/damBreakWithObstacle/Allclean
+++ b/tutorials/multiphase/interIsoFoam/damBreakWithObstacle/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interIsoFoam/damBreakWithObstacle/Allrun b/tutorials/multiphase/interIsoFoam/damBreakWithObstacle/Allrun
index 2bc6e3a4741ea772a6f9214146923cc75d490252..75daae6cfcee36d6c8479c042800384dac0d5721 100755
--- a/tutorials/multiphase/interIsoFoam/damBreakWithObstacle/Allrun
+++ b/tutorials/multiphase/interIsoFoam/damBreakWithObstacle/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/multiphase/interIsoFoam/discInConstantFlow/Allclean b/tutorials/multiphase/interIsoFoam/discInConstantFlow/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/interIsoFoam/discInConstantFlow/Allclean
+++ b/tutorials/multiphase/interIsoFoam/discInConstantFlow/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interIsoFoam/discInConstantFlow/Allrun b/tutorials/multiphase/interIsoFoam/discInConstantFlow/Allrun
index 4abdc78d004e77ad73e64df8234c3033e88cadb5..acb7b18f2930981a774f9a7312b4620a6b1a9927 100755
--- a/tutorials/multiphase/interIsoFoam/discInConstantFlow/Allrun
+++ b/tutorials/multiphase/interIsoFoam/discInConstantFlow/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/multiphase/interIsoFoam/discInConstantFlowCyclicBCs/Allclean b/tutorials/multiphase/interIsoFoam/discInConstantFlowCyclicBCs/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/interIsoFoam/discInConstantFlowCyclicBCs/Allclean
+++ b/tutorials/multiphase/interIsoFoam/discInConstantFlowCyclicBCs/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interIsoFoam/discInConstantFlowCyclicBCs/Allrun b/tutorials/multiphase/interIsoFoam/discInConstantFlowCyclicBCs/Allrun
index 4abdc78d004e77ad73e64df8234c3033e88cadb5..acb7b18f2930981a774f9a7312b4620a6b1a9927 100755
--- a/tutorials/multiphase/interIsoFoam/discInConstantFlowCyclicBCs/Allrun
+++ b/tutorials/multiphase/interIsoFoam/discInConstantFlowCyclicBCs/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/multiphase/interIsoFoam/discInReversedVortexFlow/Allclean b/tutorials/multiphase/interIsoFoam/discInReversedVortexFlow/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/interIsoFoam/discInReversedVortexFlow/Allclean
+++ b/tutorials/multiphase/interIsoFoam/discInReversedVortexFlow/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interIsoFoam/discInReversedVortexFlow/Allrun b/tutorials/multiphase/interIsoFoam/discInReversedVortexFlow/Allrun
index 7e395e78326b16b2a928518363c77ba6bc177374..ec2df9a879d2d0cb68cbc0eeee54a3c295b7bd87 100755
--- a/tutorials/multiphase/interIsoFoam/discInReversedVortexFlow/Allrun
+++ b/tutorials/multiphase/interIsoFoam/discInReversedVortexFlow/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/multiphase/interIsoFoam/iobasin/Allclean b/tutorials/multiphase/interIsoFoam/iobasin/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/interIsoFoam/iobasin/Allclean
+++ b/tutorials/multiphase/interIsoFoam/iobasin/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interIsoFoam/iobasin/Allrun b/tutorials/multiphase/interIsoFoam/iobasin/Allrun
index c29ba121682fb86cf78d8f5e559890100d8e5df8..e773647e42d2644092e6f43055654e63b92cbd8a 100755
--- a/tutorials/multiphase/interIsoFoam/iobasin/Allrun
+++ b/tutorials/multiphase/interIsoFoam/iobasin/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 runApplication blockMesh
diff --git a/tutorials/multiphase/interIsoFoam/notchedDiscInSolidBodyRotation/Allclean b/tutorials/multiphase/interIsoFoam/notchedDiscInSolidBodyRotation/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/interIsoFoam/notchedDiscInSolidBodyRotation/Allclean
+++ b/tutorials/multiphase/interIsoFoam/notchedDiscInSolidBodyRotation/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interIsoFoam/notchedDiscInSolidBodyRotation/Allrun b/tutorials/multiphase/interIsoFoam/notchedDiscInSolidBodyRotation/Allrun
index a919ed91c4aff89cddfb6c72304fa9ddbc7d651a..1552217297ce0c1b7675af07d3a4941a014ce4ca 100755
--- a/tutorials/multiphase/interIsoFoam/notchedDiscInSolidBodyRotation/Allrun
+++ b/tutorials/multiphase/interIsoFoam/notchedDiscInSolidBodyRotation/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 application=$(getApplication)
 
diff --git a/tutorials/multiphase/interIsoFoam/sloshingTank2D/Allrun b/tutorials/multiphase/interIsoFoam/sloshingTank2D/Allrun
index ae24f74396c61015d61eaa458007ea37005d9e82..c9defa12df8138f6b3baa65d103333f81a554a7e 100755
--- a/tutorials/multiphase/interIsoFoam/sloshingTank2D/Allrun
+++ b/tutorials/multiphase/interIsoFoam/sloshingTank2D/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 m4 system/blockMeshDict.m4 > system/blockMeshDict
 runApplication blockMesh
diff --git a/tutorials/multiphase/interIsoFoam/sphereInReversedVortexFlow/Allclean b/tutorials/multiphase/interIsoFoam/sphereInReversedVortexFlow/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/interIsoFoam/sphereInReversedVortexFlow/Allclean
+++ b/tutorials/multiphase/interIsoFoam/sphereInReversedVortexFlow/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interIsoFoam/sphereInReversedVortexFlow/Allrun b/tutorials/multiphase/interIsoFoam/sphereInReversedVortexFlow/Allrun
index 1767cd6b1b386ff4f91d5c7c2fb78dd57003838b..37a8187c0f9964c701150560c0fa4ea5c4ff1ef9 100755
--- a/tutorials/multiphase/interIsoFoam/sphereInReversedVortexFlow/Allrun
+++ b/tutorials/multiphase/interIsoFoam/sphereInReversedVortexFlow/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/multiphase/interIsoFoam/standingWave/Allclean b/tutorials/multiphase/interIsoFoam/standingWave/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/interIsoFoam/standingWave/Allclean
+++ b/tutorials/multiphase/interIsoFoam/standingWave/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interIsoFoam/standingWave/Allrun b/tutorials/multiphase/interIsoFoam/standingWave/Allrun
index d00d2326e7fc81f7766fae01da3cce1292d1891c..f798264bae7c6ef4c14f2aefdb2bdb2c50198261 100755
--- a/tutorials/multiphase/interIsoFoam/standingWave/Allrun
+++ b/tutorials/multiphase/interIsoFoam/standingWave/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/multiphase/interIsoFoam/waveExampleStreamFunction/Allclean b/tutorials/multiphase/interIsoFoam/waveExampleStreamFunction/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/interIsoFoam/waveExampleStreamFunction/Allclean
+++ b/tutorials/multiphase/interIsoFoam/waveExampleStreamFunction/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interIsoFoam/waveExampleStreamFunction/Allrun b/tutorials/multiphase/interIsoFoam/waveExampleStreamFunction/Allrun
index 28bf991e627511713c3b915ac0d9998f068ce030..76989b6f176ffbb6007fe17e509733da35546db2 100755
--- a/tutorials/multiphase/interIsoFoam/waveExampleStreamFunction/Allrun
+++ b/tutorials/multiphase/interIsoFoam/waveExampleStreamFunction/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/multiphase/interIsoFoam/weirOverflow/Allclean b/tutorials/multiphase/interIsoFoam/weirOverflow/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/interIsoFoam/weirOverflow/Allclean
+++ b/tutorials/multiphase/interIsoFoam/weirOverflow/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interIsoFoam/weirOverflow/Allrun b/tutorials/multiphase/interIsoFoam/weirOverflow/Allrun
index c7107259267d9ec3d57107003fcfe6a9e1483ad5..0818d6f789c1eb90c0118a333f4638f4593ef860 100755
--- a/tutorials/multiphase/interIsoFoam/weirOverflow/Allrun
+++ b/tutorials/multiphase/interIsoFoam/weirOverflow/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/multiphase/interMixingFoam/laminar/damBreak/Allrun b/tutorials/multiphase/interMixingFoam/laminar/damBreak/Allrun
index 48c2856ca16fb7a968e51479ee9465ead8f49a8f..6910950a2accb1c519ae64a131b5247b5199dcff 100755
--- a/tutorials/multiphase/interMixingFoam/laminar/damBreak/Allrun
+++ b/tutorials/multiphase/interMixingFoam/laminar/damBreak/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 cp 0/alpha.air.orig 0/alpha.air
diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/Allclean b/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/Allclean
index d31f20c24ddf417248e051822702615987ab54ff..f8c7875f6a16cc54e284acd886935776c52fa29f 100755
--- a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/Allclean
+++ b/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/Allrun b/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/Allrun
index b44aaf01a37d6bc2134a960c47799426b6dafa6c..bda6c4a76c5f0da04b2c2c6848b46a1582940689 100755
--- a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/Allrun
+++ b/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/Allrun.pre b/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/Allrun.pre
index b39d40fad9cdfee8315f17fb5dfea1a89f51c085..3489d116c4c09b409a0f94f329cb78758e7f3430 100755
--- a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/Allrun.pre
+++ b/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # copy propeller surface from resources directory
 \cp $FOAM_TUTORIALS/resources/geometry/propellerTip.obj.gz constant/triSurface/
diff --git a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/Allclean b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/Allclean
index 24df93fd3d22844891dc5951256878568e6b4d56..db74977981604334f3daab0dbceb2e811f5717c7 100755
--- a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/Allclean
+++ b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/Allrun b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/Allrun
index dd1ff0aa9508e107cb209f859899cca1d44e5999..063511fb2c847436992115f2dca61b5d97ef431b 100755
--- a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/Allrun
+++ b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Copy bullet surface from resources directory
 cp $FOAM_TUTORIALS/resources/geometry/bullet.stl.gz constant/triSurface/
diff --git a/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/Allclean b/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/Allclean
+++ b/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/Allrun b/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/Allrun
index efced0038e951e3578e1e804b9642f639e2bce5e..fce061485e0e7579f73d4a4240f4487846998117 100755
--- a/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/Allrun
+++ b/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/multiphase/multiphaseEulerFoam/damBreak4phaseFine/Allclean b/tutorials/multiphase/multiphaseEulerFoam/damBreak4phaseFine/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/multiphaseEulerFoam/damBreak4phaseFine/Allclean
+++ b/tutorials/multiphase/multiphaseEulerFoam/damBreak4phaseFine/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/multiphaseEulerFoam/damBreak4phaseFine/Allrun b/tutorials/multiphase/multiphaseEulerFoam/damBreak4phaseFine/Allrun
index 125f3e96ba2fe5b181265f6134420d6ad6b3e244..a2c1d8661f933709414ddb0c90c6447085aca36a 100755
--- a/tutorials/multiphase/multiphaseEulerFoam/damBreak4phaseFine/Allrun
+++ b/tutorials/multiphase/multiphaseEulerFoam/damBreak4phaseFine/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/multiphase/multiphaseEulerFoam/mixerVessel2D/Allrun b/tutorials/multiphase/multiphaseEulerFoam/mixerVessel2D/Allrun
index 6aeae15553237e47ab738d4a985454a979a3ecb5..190a9840fde8f059da240ed54dd0342eaa44c95e 100755
--- a/tutorials/multiphase/multiphaseEulerFoam/mixerVessel2D/Allrun
+++ b/tutorials/multiphase/multiphaseEulerFoam/mixerVessel2D/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication ./makeMesh
 runApplication $(getApplication)
diff --git a/tutorials/multiphase/multiphaseInterDyMFoam/laminar/mixerVesselAMI2D/Allrun b/tutorials/multiphase/multiphaseInterDyMFoam/laminar/mixerVesselAMI2D/Allrun
index 3d69efdb3a2fb01caf6d63c689d3bd0985b33060..688586b18fb865d2f92ba1e569fc6bb7d9d62cbb 100755
--- a/tutorials/multiphase/multiphaseInterDyMFoam/laminar/mixerVesselAMI2D/Allrun
+++ b/tutorials/multiphase/multiphaseInterDyMFoam/laminar/mixerVesselAMI2D/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./makeMesh
 
diff --git a/tutorials/multiphase/multiphaseInterDyMFoam/laminar/mixerVesselAMI2D/makeMesh b/tutorials/multiphase/multiphaseInterDyMFoam/laminar/mixerVesselAMI2D/makeMesh
index fc56e7be3ced8dddd0d2158adb4b74e5e2d96239..6e03b018cabf8cda54d0d4a5d33efc0c1ad9b681 100755
--- a/tutorials/multiphase/multiphaseInterDyMFoam/laminar/mixerVesselAMI2D/makeMesh
+++ b/tutorials/multiphase/multiphaseInterDyMFoam/laminar/mixerVesselAMI2D/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 m4 < system/blockMeshDict.m4 > system/blockMeshDict
 
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/Allclean b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/Allclean
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/Allrun b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/Allrun
index efced0038e951e3578e1e804b9642f639e2bce5e..fce061485e0e7579f73d4a4240f4487846998117 100755
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/Allrun
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/Allclean b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/Allclean
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/Allrun b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/Allrun
index 125f3e96ba2fe5b181265f6134420d6ad6b3e244..a2c1d8661f933709414ddb0c90c6447085aca36a 100755
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/Allrun
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/mixerVessel2D/Allclean b/tutorials/multiphase/multiphaseInterFoam/laminar/mixerVessel2D/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/mixerVessel2D/Allclean
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/mixerVessel2D/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/mixerVessel2D/Allrun b/tutorials/multiphase/multiphaseInterFoam/laminar/mixerVessel2D/Allrun
index 69a4d43b4918725913e35580d1fe82ff6b25ca40..df665b2da03a1a6466578225f3735a97301f1382 100755
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/mixerVessel2D/Allrun
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/mixerVessel2D/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication ./makeMesh
 restore0Dir
diff --git a/tutorials/multiphase/overInterDyMFoam/boatAndPropeller/Allclean b/tutorials/multiphase/overInterDyMFoam/boatAndPropeller/Allclean
index aab71fa2ca4ea5faeb699a7c0497ec6841e7bce5..7a3d92a9d3b9a8627b7413c29072e777e14eb115 100755
--- a/tutorials/multiphase/overInterDyMFoam/boatAndPropeller/Allclean
+++ b/tutorials/multiphase/overInterDyMFoam/boatAndPropeller/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/overInterDyMFoam/boatAndPropeller/Allrun b/tutorials/multiphase/overInterDyMFoam/boatAndPropeller/Allrun
index e4ccbb9c325c27babcd938ebd2cc86e2770abe26..50bfcac8945c49ea89c238cddff52754fe1bdcb8 100755
--- a/tutorials/multiphase/overInterDyMFoam/boatAndPropeller/Allrun
+++ b/tutorials/multiphase/overInterDyMFoam/boatAndPropeller/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/multiphase/overInterDyMFoam/boatAndPropeller/Allrun.pre b/tutorials/multiphase/overInterDyMFoam/boatAndPropeller/Allrun.pre
index 5190fe6b9c205872dfb6e56725c822ad72b42e91..a5847cd7654c5d19adfae05ea8c11b3ae25662db 100755
--- a/tutorials/multiphase/overInterDyMFoam/boatAndPropeller/Allrun.pre
+++ b/tutorials/multiphase/overInterDyMFoam/boatAndPropeller/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/multiphase/overInterDyMFoam/floatingBody/Allclean b/tutorials/multiphase/overInterDyMFoam/floatingBody/Allclean
index 1d69dc999c3e8cedf99318d9c0a7e6bbbc59457c..97c7554280ecec0eadb7d2884b09583de98ddb80 100755
--- a/tutorials/multiphase/overInterDyMFoam/floatingBody/Allclean
+++ b/tutorials/multiphase/overInterDyMFoam/floatingBody/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-##. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+#. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 (cd background && ./Allclean)
 (cd floatingBody && ./Allclean)
diff --git a/tutorials/multiphase/overInterDyMFoam/floatingBody/Allrun b/tutorials/multiphase/overInterDyMFoam/floatingBody/Allrun
index 669972445780882fb5793ca9a24a4e7d81a1d1f1..9863c44e48d30517ed95c8c0626225e93530fd64 100755
--- a/tutorials/multiphase/overInterDyMFoam/floatingBody/Allrun
+++ b/tutorials/multiphase/overInterDyMFoam/floatingBody/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 (cd background && runApplication $(getApplication))
diff --git a/tutorials/multiphase/overInterDyMFoam/floatingBody/Allrun.pre b/tutorials/multiphase/overInterDyMFoam/floatingBody/Allrun.pre
index ef286ecbfa84214bc11a1024094bb33d044ccc10..9ee4a8f61e6c925ca6e09bea047b7b1e9d7031da 100755
--- a/tutorials/multiphase/overInterDyMFoam/floatingBody/Allrun.pre
+++ b/tutorials/multiphase/overInterDyMFoam/floatingBody/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # mesh floating body
 (cd floatingBody && ./Allrun.pre)
diff --git a/tutorials/multiphase/overInterDyMFoam/floatingBody/background/Allclean b/tutorials/multiphase/overInterDyMFoam/floatingBody/background/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/overInterDyMFoam/floatingBody/background/Allclean
+++ b/tutorials/multiphase/overInterDyMFoam/floatingBody/background/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/overInterDyMFoam/floatingBody/background/Allrun.pre b/tutorials/multiphase/overInterDyMFoam/floatingBody/background/Allrun.pre
index 9a44881018bbc6aca5b1c80d3a0616a9825acd6a..6d6ebda91e066779b042fe0a4e6034c79815f130 100755
--- a/tutorials/multiphase/overInterDyMFoam/floatingBody/background/Allrun.pre
+++ b/tutorials/multiphase/overInterDyMFoam/floatingBody/background/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Create background mesh
 runApplication blockMesh
diff --git a/tutorials/multiphase/overInterDyMFoam/floatingBody/floatingBody/Allclean b/tutorials/multiphase/overInterDyMFoam/floatingBody/floatingBody/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/overInterDyMFoam/floatingBody/floatingBody/Allclean
+++ b/tutorials/multiphase/overInterDyMFoam/floatingBody/floatingBody/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/overInterDyMFoam/floatingBody/floatingBody/Allrun.pre b/tutorials/multiphase/overInterDyMFoam/floatingBody/floatingBody/Allrun.pre
index 8142d7c389dab65e7e840c1abeebc8a7b0a18048..7f29eaf2f26f7116b74450dda34bb295d98a368e 100755
--- a/tutorials/multiphase/overInterDyMFoam/floatingBody/floatingBody/Allrun.pre
+++ b/tutorials/multiphase/overInterDyMFoam/floatingBody/floatingBody/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication topoSet
diff --git a/tutorials/multiphase/overInterDyMFoam/floatingBodyWithSpring/Allclean b/tutorials/multiphase/overInterDyMFoam/floatingBodyWithSpring/Allclean
index 1d69dc999c3e8cedf99318d9c0a7e6bbbc59457c..97c7554280ecec0eadb7d2884b09583de98ddb80 100755
--- a/tutorials/multiphase/overInterDyMFoam/floatingBodyWithSpring/Allclean
+++ b/tutorials/multiphase/overInterDyMFoam/floatingBodyWithSpring/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-##. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+#. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 (cd background && ./Allclean)
 (cd floatingBody && ./Allclean)
diff --git a/tutorials/multiphase/overInterDyMFoam/floatingBodyWithSpring/Allrun b/tutorials/multiphase/overInterDyMFoam/floatingBodyWithSpring/Allrun
index 669972445780882fb5793ca9a24a4e7d81a1d1f1..9863c44e48d30517ed95c8c0626225e93530fd64 100755
--- a/tutorials/multiphase/overInterDyMFoam/floatingBodyWithSpring/Allrun
+++ b/tutorials/multiphase/overInterDyMFoam/floatingBodyWithSpring/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 (cd background && runApplication $(getApplication))
diff --git a/tutorials/multiphase/overInterDyMFoam/floatingBodyWithSpring/Allrun.pre b/tutorials/multiphase/overInterDyMFoam/floatingBodyWithSpring/Allrun.pre
index ef286ecbfa84214bc11a1024094bb33d044ccc10..9ee4a8f61e6c925ca6e09bea047b7b1e9d7031da 100755
--- a/tutorials/multiphase/overInterDyMFoam/floatingBodyWithSpring/Allrun.pre
+++ b/tutorials/multiphase/overInterDyMFoam/floatingBodyWithSpring/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # mesh floating body
 (cd floatingBody && ./Allrun.pre)
diff --git a/tutorials/multiphase/overInterDyMFoam/floatingBodyWithSpring/background/Allclean b/tutorials/multiphase/overInterDyMFoam/floatingBodyWithSpring/background/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/overInterDyMFoam/floatingBodyWithSpring/background/Allclean
+++ b/tutorials/multiphase/overInterDyMFoam/floatingBodyWithSpring/background/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/overInterDyMFoam/floatingBodyWithSpring/background/Allrun.pre b/tutorials/multiphase/overInterDyMFoam/floatingBodyWithSpring/background/Allrun.pre
index 9a44881018bbc6aca5b1c80d3a0616a9825acd6a..6d6ebda91e066779b042fe0a4e6034c79815f130 100755
--- a/tutorials/multiphase/overInterDyMFoam/floatingBodyWithSpring/background/Allrun.pre
+++ b/tutorials/multiphase/overInterDyMFoam/floatingBodyWithSpring/background/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # Create background mesh
 runApplication blockMesh
diff --git a/tutorials/multiphase/overInterDyMFoam/floatingBodyWithSpring/floatingBody/Allclean b/tutorials/multiphase/overInterDyMFoam/floatingBodyWithSpring/floatingBody/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/overInterDyMFoam/floatingBodyWithSpring/floatingBody/Allclean
+++ b/tutorials/multiphase/overInterDyMFoam/floatingBodyWithSpring/floatingBody/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/overInterDyMFoam/floatingBodyWithSpring/floatingBody/Allrun.pre b/tutorials/multiphase/overInterDyMFoam/floatingBodyWithSpring/floatingBody/Allrun.pre
index 8142d7c389dab65e7e840c1abeebc8a7b0a18048..7f29eaf2f26f7116b74450dda34bb295d98a368e 100755
--- a/tutorials/multiphase/overInterDyMFoam/floatingBodyWithSpring/floatingBody/Allrun.pre
+++ b/tutorials/multiphase/overInterDyMFoam/floatingBodyWithSpring/floatingBody/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication topoSet
diff --git a/tutorials/multiphase/overInterDyMFoam/twoSimpleRotors/Allclean b/tutorials/multiphase/overInterDyMFoam/twoSimpleRotors/Allclean
index aab71fa2ca4ea5faeb699a7c0497ec6841e7bce5..7a3d92a9d3b9a8627b7413c29072e777e14eb115 100755
--- a/tutorials/multiphase/overInterDyMFoam/twoSimpleRotors/Allclean
+++ b/tutorials/multiphase/overInterDyMFoam/twoSimpleRotors/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/overInterDyMFoam/twoSimpleRotors/Allrun b/tutorials/multiphase/overInterDyMFoam/twoSimpleRotors/Allrun
index 10707b2f2cd6e6f7f93215994e02b164f8de426a..fa234b3f30464f84c1eec7617ffbbb9236725c03 100755
--- a/tutorials/multiphase/overInterDyMFoam/twoSimpleRotors/Allrun
+++ b/tutorials/multiphase/overInterDyMFoam/twoSimpleRotors/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 ./Allrun.pre
 
diff --git a/tutorials/multiphase/overInterDyMFoam/twoSimpleRotors/Allrun.pre b/tutorials/multiphase/overInterDyMFoam/twoSimpleRotors/Allrun.pre
index abccd3163c95858a729642290f99bd730f2d248b..308bbee9fd4e07a61fd4924b3256442436eab675 100755
--- a/tutorials/multiphase/overInterDyMFoam/twoSimpleRotors/Allrun.pre
+++ b/tutorials/multiphase/overInterDyMFoam/twoSimpleRotors/Allrun.pre
@@ -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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/Allclean b/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/Allclean
index 496dfec3c171a98ee630ccb7840e7abfd1d373dd..d989e2132d1e27b599d1b5b23c7cb510d0975435 100755
--- a/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/Allclean
+++ b/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 rm -rf poolHeight poolHeight_vs_time
diff --git a/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/Allrun b/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/Allrun
index 40555d56e14fadc79a48c19d9cb94901995fb37c..6cf23587d9fd618ecc6714f2f5862bf057348a26 100755
--- a/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/Allrun
+++ b/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 
diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/Allclean b/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/Allclean
index 496dfec3c171a98ee630ccb7840e7abfd1d373dd..d989e2132d1e27b599d1b5b23c7cb510d0975435 100755
--- a/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/Allclean
+++ b/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 rm -rf poolHeight poolHeight_vs_time
diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/Allrun b/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/Allrun
index 897dccd0bb71f7f61caa520f9db6b1d3f61ff6a2..f1d525aa643b6cf173312ceff854d2ffa3a75661 100755
--- a/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/Allrun
+++ b/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication topoSet
diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/Allclean b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/Allclean
index 84094579771dbf39255a890a29b848048389c10b..6634746c671fd068c029502375d28a21deabfc05 100755
--- a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/Allclean
+++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 cp system/controlDict.org system/controlDict
diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/Allrun b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/Allrun
index e2b33f6cea5a2e278082ebda12d066f15073a0c7..5f673d892c2f7743e382cc233c0914f8641b4383 100755
--- a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/Allrun
+++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/Allrun
@@ -1,15 +1,14 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Source tutorial run functions
-. $WM_PROJECT_DIR/bin/tools/RunFunctions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 application=$(getApplication)
 
 runApplication blockMesh
 runApplication $application
 
-if ! isTest $@
+if notTest $@
 then
     foamDictionary system/controlDict -entry endTime -set 4
     foamDictionary system/controlDict -entry startTime -set 0.5
diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/Allclean b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/Allclean
index 84094579771dbf39255a890a29b848048389c10b..6634746c671fd068c029502375d28a21deabfc05 100755
--- a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/Allclean
+++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 cp system/controlDict.org system/controlDict
diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/Allrun b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/Allrun
index e2b33f6cea5a2e278082ebda12d066f15073a0c7..5f673d892c2f7743e382cc233c0914f8641b4383 100755
--- a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/Allrun
+++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/Allrun
@@ -1,15 +1,14 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Source tutorial run functions
-. $WM_PROJECT_DIR/bin/tools/RunFunctions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 application=$(getApplication)
 
 runApplication blockMesh
 runApplication $application
 
-if ! isTest $@
+if notTest $@
 then
     foamDictionary system/controlDict -entry endTime -set 4
     foamDictionary system/controlDict -entry startTime -set 0.5
diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/Allrun b/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/Allrun
index 6aeae15553237e47ab738d4a985454a979a3ecb5..190a9840fde8f059da240ed54dd0342eaa44c95e 100755
--- a/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/Allrun
+++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication ./makeMesh
 runApplication $(getApplication)
diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/Allrun b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/Allrun
index 955b55176021afbbc911e4f5d648ebf0eed843ba..5922d2615b31e6e3a2df0d10e9d35d7765067e20 100755
--- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/Allrun
+++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnPolydisperse/Allrun
@@ -1,15 +1,11 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # run from this directory
-
-# Source tutorial run functions
-. $WM_PROJECT_DIR/bin/tools/RunFunctions
-
-# Set application name
-application=$(getApplication)
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication topoSet
 runApplication setFields
-runApplication $application
+runApplication $(getApplication)
 
 #------------------------------------------------------------------------------
diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/Allclean b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/Allclean
index ba5873a4aef4000f5bca4f7c71d1884c0bf99323..cea650d5a4dd0b49f51af99409a99cb4d03051c1 100755
--- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/Allclean
+++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 cp ./system/controlDict.org ./system/controlDict
diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/Allrun b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/Allrun
index 58bff92e2dcff32c0780917754a5e72e6b8b501c..411fec5102302e0da407b233fb8196c2112f7669 100755
--- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/Allrun
+++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication $(getApplication)
diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/Allclean b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/Allclean
index 84094579771dbf39255a890a29b848048389c10b..6634746c671fd068c029502375d28a21deabfc05 100755
--- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/Allclean
+++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 cp system/controlDict.org system/controlDict
diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/Allrun b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/Allrun
index e2b33f6cea5a2e278082ebda12d066f15073a0c7..5f673d892c2f7743e382cc233c0914f8641b4383 100755
--- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/Allrun
+++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/Allrun
@@ -1,15 +1,14 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Source tutorial run functions
-. $WM_PROJECT_DIR/bin/tools/RunFunctions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 application=$(getApplication)
 
 runApplication blockMesh
 runApplication $application
 
-if ! isTest $@
+if notTest $@
 then
     foamDictionary system/controlDict -entry endTime -set 4
     foamDictionary system/controlDict -entry startTime -set 0.5
diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/Allclean b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/Allclean
index ba5873a4aef4000f5bca4f7c71d1884c0bf99323..cea650d5a4dd0b49f51af99409a99cb4d03051c1 100755
--- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/Allclean
+++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 cp ./system/controlDict.org ./system/controlDict
diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/Allrun b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/Allrun
index 63508b91f8a6871168689148f52bc7320425b7b3..7117b0060d312b1687e258c73be261b0bf35202f 100755
--- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/Allrun
+++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication $(getApplication)
diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumn/Allrun b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumn/Allrun
index ed61ac543538db7d3679847d004086dd7fe3952f..edff8a339dfa034753e787fd2245a404367535be 100755
--- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumn/Allrun
+++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumn/Allrun
@@ -1,8 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Source tutorial run functions
-. $WM_PROJECT_DIR/bin/tools/RunFunctions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication setFields
diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/mixerVessel2D/Allrun b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/mixerVessel2D/Allrun
index 6aeae15553237e47ab738d4a985454a979a3ecb5..190a9840fde8f059da240ed54dd0342eaa44c95e 100755
--- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/mixerVessel2D/Allrun
+++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/mixerVessel2D/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication ./makeMesh
 runApplication $(getApplication)
diff --git a/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/Allclean b/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/Allclean
+++ b/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/Allrun b/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/Allrun
index efced0038e951e3578e1e804b9642f639e2bce5e..fce061485e0e7579f73d4a4240f4487846998117 100755
--- a/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/Allrun
+++ b/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 restore0Dir
 
diff --git a/tutorials/multiphase/twoPhaseEulerFoam/laminar/mixerVessel2D/Allrun b/tutorials/multiphase/twoPhaseEulerFoam/laminar/mixerVessel2D/Allrun
index 6aeae15553237e47ab738d4a985454a979a3ecb5..190a9840fde8f059da240ed54dd0342eaa44c95e 100755
--- a/tutorials/multiphase/twoPhaseEulerFoam/laminar/mixerVessel2D/Allrun
+++ b/tutorials/multiphase/twoPhaseEulerFoam/laminar/mixerVessel2D/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication ./makeMesh
 runApplication $(getApplication)
diff --git a/tutorials/preProcessing/createZeroDirectory/cavity/Allclean b/tutorials/preProcessing/createZeroDirectory/cavity/Allclean
index e2f275d9fd6e6ba843f14fec57e2987e4c8607b3..9d457171afd519ab7328986328775413b27e09ce 100755
--- a/tutorials/preProcessing/createZeroDirectory/cavity/Allclean
+++ b/tutorials/preProcessing/createZeroDirectory/cavity/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/preProcessing/createZeroDirectory/cavity/Allrun b/tutorials/preProcessing/createZeroDirectory/cavity/Allrun
index 51286c4dbdaf38231c5e983ae8676362f9dc28ef..f9ff928bea8519a9be968c9fa0c1d7e6044ef3b6 100755
--- a/tutorials/preProcessing/createZeroDirectory/cavity/Allrun
+++ b/tutorials/preProcessing/createZeroDirectory/cavity/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication createZeroDirectory
diff --git a/tutorials/preProcessing/createZeroDirectory/motorBike/Allclean b/tutorials/preProcessing/createZeroDirectory/motorBike/Allclean
index b52876b699666e4782c85ba0f987a92d4d19cd23..e6ad168f9c566a1d915968977cec26fd61a6a6cb 100755
--- a/tutorials/preProcessing/createZeroDirectory/motorBike/Allclean
+++ b/tutorials/preProcessing/createZeroDirectory/motorBike/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/preProcessing/createZeroDirectory/motorBike/Allrun b/tutorials/preProcessing/createZeroDirectory/motorBike/Allrun
index 9dce39c17323e3cebf6b71dad03542a71c015139..15e9c628a8214f3a879ba3470fc5efdb30ff7468 100755
--- a/tutorials/preProcessing/createZeroDirectory/motorBike/Allrun
+++ b/tutorials/preProcessing/createZeroDirectory/motorBike/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 # copy motorbike surface from resources folder
 cp $FOAM_TUTORIALS/resources/geometry/motorBike.obj.gz constant/triSurface/
diff --git a/tutorials/preProcessing/createZeroDirectory/snappyMultiRegionHeater/Allclean b/tutorials/preProcessing/createZeroDirectory/snappyMultiRegionHeater/Allclean
index b8032f8f34ecc23cda651f7bd10d6cec14d882b0..e8873473343666e62a7c6d905bf348f1eadac7dc 100755
--- a/tutorials/preProcessing/createZeroDirectory/snappyMultiRegionHeater/Allclean
+++ b/tutorials/preProcessing/createZeroDirectory/snappyMultiRegionHeater/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 
diff --git a/tutorials/preProcessing/createZeroDirectory/snappyMultiRegionHeater/Allrun b/tutorials/preProcessing/createZeroDirectory/snappyMultiRegionHeater/Allrun
index 15fab73b655f31f2239692e957869f98e3e37e03..f5b329971436fcb16a22dd280b7a145c1c806ff6 100755
--- a/tutorials/preProcessing/createZeroDirectory/snappyMultiRegionHeater/Allrun
+++ b/tutorials/preProcessing/createZeroDirectory/snappyMultiRegionHeater/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 rm -rf constant/polyMesh/sets
 
diff --git a/tutorials/preProcessing/decompositionConstraints/geometric/Allclean b/tutorials/preProcessing/decompositionConstraints/geometric/Allclean
index 214bd9a5ecb1d1f591bd64daf0c0c882d8aaf310..77ddfb20c026ad31a3ff60efa2cbaa4e675b7564 100755
--- a/tutorials/preProcessing/decompositionConstraints/geometric/Allclean
+++ b/tutorials/preProcessing/decompositionConstraints/geometric/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 \rm -f constant/triSurface/blob.obj
 
diff --git a/tutorials/preProcessing/decompositionConstraints/geometric/Allrun b/tutorials/preProcessing/decompositionConstraints/geometric/Allrun
index 9cb85f61361b8d3eba730c15bce000f6f8c8914d..e403886b8efdf5ba0e0bf6fe5ad05d403f99b32d 100755
--- a/tutorials/preProcessing/decompositionConstraints/geometric/Allrun
+++ b/tutorials/preProcessing/decompositionConstraints/geometric/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 mkdir -p constant/triSurface
 
diff --git a/tutorials/stressAnalysis/solidDisplacementFoam/plateHole/Allclean b/tutorials/stressAnalysis/solidDisplacementFoam/plateHole/Allclean
index be7ddb068847225ad69704840909a7b0d05a5466..e8557c25549b9369ce8225c99735bdfb9731e96c 100755
--- a/tutorials/stressAnalysis/solidDisplacementFoam/plateHole/Allclean
+++ b/tutorials/stressAnalysis/solidDisplacementFoam/plateHole/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase
 
diff --git a/tutorials/stressAnalysis/solidDisplacementFoam/plateHole/Allrun b/tutorials/stressAnalysis/solidDisplacementFoam/plateHole/Allrun
index e59dad068eeb108b0640655264b810e364bd83e0..985ede6c4b049b59c021ab1c88d191027b6eccc9 100755
--- a/tutorials/stressAnalysis/solidDisplacementFoam/plateHole/Allrun
+++ b/tutorials/stressAnalysis/solidDisplacementFoam/plateHole/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 runApplication blockMesh
 runApplication $(getApplication)
diff --git a/tutorials/verificationAndValidation/schemes/divergenceExample/Allrun b/tutorials/verificationAndValidation/schemes/divergenceExample/Allrun
index 89bd04a003a3d99e8a8742328fb418625ccb7d08..647966b2c0d6caeb72590e9cb2657b295bb651b4 100755
--- a/tutorials/verificationAndValidation/schemes/divergenceExample/Allrun
+++ b/tutorials/verificationAndValidation/schemes/divergenceExample/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 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+#------------------------------------------------------------------------------
 
 params=$@
 
diff --git a/tutorials/verificationAndValidation/turbulentInflow/Allclean b/tutorials/verificationAndValidation/turbulentInflow/Allclean
index 8f13d677ae144f07e00ffc30dc3bb171e59ffc69..67eab912aa8c818bc005039e10e5b8e700396d77 100755
--- a/tutorials/verificationAndValidation/turbulentInflow/Allclean
+++ b/tutorials/verificationAndValidation/turbulentInflow/Allclean
@@ -1,6 +1,7 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 cleanCase0
 \rm -rf constant/boundaryData/inlet 2>/dev/null
diff --git a/tutorials/verificationAndValidation/turbulentInflow/Allrun b/tutorials/verificationAndValidation/turbulentInflow/Allrun
index 5ee1231e57ed4479260abd943ae2ae7ea36a1443..867d2e922e5acee5d9a97060493dea561b3cd05c 100755
--- a/tutorials/verificationAndValidation/turbulentInflow/Allrun
+++ b/tutorials/verificationAndValidation/turbulentInflow/Allrun
@@ -1,7 +1,8 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/RunFunctions    # Tutorial run functions
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 # Test with different synthetic inflow models
 modelTypes="reducedDigitalFilter digitalFilter DFSEM"
diff --git a/tutorials/verificationAndValidation/turbulentInflow/Allrun-parallel b/tutorials/verificationAndValidation/turbulentInflow/Allrun-parallel
index a90dd6968852e6bf62f85ebf055c6453a3c53f5f..26bc6ac809585abc173c6b5af2b8beb90c7b5301 100755
--- a/tutorials/verificationAndValidation/turbulentInflow/Allrun-parallel
+++ b/tutorials/verificationAndValidation/turbulentInflow/Allrun-parallel
@@ -1,7 +1,8 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-. $WM_PROJECT_DIR/bin/tools/RunFunctions    # Tutorial run functions
-. $WM_PROJECT_DIR/bin/tools/CleanFunctions  # Tutorial clean functions
+cd ${0%/*} || exit 1                                # Run from this directory
+. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
+. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions      # Tutorial clean functions
+#------------------------------------------------------------------------------
 
 # Test with different synthetic inflow models
 modelTypes="reducedDigitalFilter digitalFilter DFSEM"
diff --git a/wmake/scripts/AllwmakeParseArguments b/wmake/scripts/AllwmakeParseArguments
index 27454e04ca5e0e57d7a696d3357958108d8a826c..80da8a5b75be06e741e96e07da02cb000577ad5a 100644
--- a/wmake/scripts/AllwmakeParseArguments
+++ b/wmake/scripts/AllwmakeParseArguments
@@ -20,7 +20,7 @@
 #
 # Usage
 #     # Parse the arguments by sourcing this script
-#     . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+#     . ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 #
 #------------------------------------------------------------------------------
 
diff --git a/wmake/scripts/cmakeFunctions b/wmake/scripts/cmakeFunctions
index 8ad6034386da2c338c74cd3c79dc1430aa667c71..b67dce2d5b8e316459eafaeb0117c67ccba62900 100644
--- a/wmake/scripts/cmakeFunctions
+++ b/wmake/scripts/cmakeFunctions
@@ -17,7 +17,7 @@
 # Description
 #     Helper functions for CMake
 #------------------------------------------------------------------------------
-. $WM_PROJECT_DIR/wmake/scripts/wmakeFunctions  # Require some wmake functions
+. ${WM_PROJECT_DIR:?}/wmake/scripts/wmakeFunctions  # Require wmake functions
 
 # Export compiler information for cmake
 export CC="$(wmake -show-c)"
diff --git a/wmake/scripts/have_adios2 b/wmake/scripts/have_adios2
index 1e904d715f606608d234dd8765768a2213b0347a..4397cd8b4116ce08e5324e39aa9ab88e34fd6462 100644
--- a/wmake/scripts/have_adios2
+++ b/wmake/scripts/have_adios2
@@ -30,7 +30,7 @@
 #     ADIOS2_LIB_DIR
 #
 #------------------------------------------------------------------------------
-. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
+. ${WM_PROJECT_DIR:?}/wmake/scripts/sysFunctions    # General system functions
 
 #------------------------------------------------------------------------------
 
diff --git a/wmake/scripts/have_boost b/wmake/scripts/have_boost
index 528b46bd1f02e10e4e3d9bac5c5765a616d679ed..aca69a63ed7463958b065041ca81aa07925c71dc 100644
--- a/wmake/scripts/have_boost
+++ b/wmake/scripts/have_boost
@@ -30,7 +30,7 @@
 #     BOOST_LIB_DIR
 #
 #------------------------------------------------------------------------------
-. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
+. ${WM_PROJECT_DIR:?}/wmake/scripts/sysFunctions    # General system functions
 
 #------------------------------------------------------------------------------
 
diff --git a/wmake/scripts/have_ccmio b/wmake/scripts/have_ccmio
index 991e314f880c405785552efd712f2de9cf4d8b79..68e2b2f71869177bf004f3f00143d53ac2418792 100644
--- a/wmake/scripts/have_ccmio
+++ b/wmake/scripts/have_ccmio
@@ -30,7 +30,7 @@
 #     CCMIO_LIB_DIR
 #
 #------------------------------------------------------------------------------
-. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
+. ${WM_PROJECT_DIR:?}/wmake/scripts/sysFunctions    # General system functions
 
 #------------------------------------------------------------------------------
 
diff --git a/wmake/scripts/have_cgal b/wmake/scripts/have_cgal
index f56341555a3dd6fb6808239ce3760b453140b142..b0a90e7ed2b1219e5ec541abf7f88f9ada0d8494 100644
--- a/wmake/scripts/have_cgal
+++ b/wmake/scripts/have_cgal
@@ -30,7 +30,7 @@
 #     CGAL_LIB_DIR
 #
 #------------------------------------------------------------------------------
-. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
+. ${WM_PROJECT_DIR:?}/wmake/scripts/sysFunctions    # General system functions
 
 #------------------------------------------------------------------------------
 
diff --git a/wmake/scripts/have_fftw b/wmake/scripts/have_fftw
index 85eb9f229d31e98bc8c1cca868d3de29a783a580..cfafa54c1e44d95dc0ae96b607f0b78c9c02832d 100644
--- a/wmake/scripts/have_fftw
+++ b/wmake/scripts/have_fftw
@@ -30,7 +30,7 @@
 #     FFTW_LIB_DIR
 #
 #------------------------------------------------------------------------------
-. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
+. ${WM_PROJECT_DIR:?}/wmake/scripts/sysFunctions    # General system functions
 
 #------------------------------------------------------------------------------
 
diff --git a/wmake/scripts/have_hypre b/wmake/scripts/have_hypre
index 7e02ebe6e828930a833e875429c0f75e79cd3c08..db9f77bbdde9779b070600e5df0ce1148f3662bd 100644
--- a/wmake/scripts/have_hypre
+++ b/wmake/scripts/have_hypre
@@ -30,7 +30,7 @@
 #     HYPRE_LIB_DIR
 #
 #------------------------------------------------------------------------------
-. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
+. ${WM_PROJECT_DIR:?}/wmake/scripts/sysFunctions    # General system functions
 
 #------------------------------------------------------------------------------
 
diff --git a/wmake/scripts/have_kahip b/wmake/scripts/have_kahip
index 47092d4c01c5f0ca2f4135068991b0b4ad46784f..e528d5c100b670207712b1ed5ad296deaa0d9f46 100644
--- a/wmake/scripts/have_kahip
+++ b/wmake/scripts/have_kahip
@@ -30,7 +30,7 @@
 #     KAHIP_LIB_DIR
 #
 #------------------------------------------------------------------------------
-. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
+. ${WM_PROJECT_DIR:?}/wmake/scripts/sysFunctions    # General system functions
 
 #------------------------------------------------------------------------------
 
@@ -60,7 +60,7 @@ have_kahip()
     local prefix header library incName libName settings warn
     warn="==> skip kahip"
 
-    #  Setup
+    # Setup
     if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/kahip)
     then
         . "$settings"
diff --git a/wmake/scripts/have_metis b/wmake/scripts/have_metis
index 5987eb1aefb53eafea49ca2ccb1b22cae2ff3d17..373f81079395870e2208e0f7f8c6a5ceb8eca5c0 100644
--- a/wmake/scripts/have_metis
+++ b/wmake/scripts/have_metis
@@ -30,7 +30,7 @@
 #     METIS_LIB_DIR
 #
 #------------------------------------------------------------------------------
-. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
+. ${WM_PROJECT_DIR:?}/wmake/scripts/sysFunctions    # General system functions
 
 #------------------------------------------------------------------------------
 
diff --git a/wmake/scripts/have_mgridgen b/wmake/scripts/have_mgridgen
index ebe66e9f31423c0b75d421a4947ed03934b61df8..4f016c72d2f9010c195ced6cf8cc1f10e857dc9f 100644
--- a/wmake/scripts/have_mgridgen
+++ b/wmake/scripts/have_mgridgen
@@ -30,7 +30,7 @@
 #     MGRIDGEN_LIB_DIR
 #
 #------------------------------------------------------------------------------
-. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
+. ${WM_PROJECT_DIR:?}/wmake/scripts/sysFunctions    # General system functions
 
 #------------------------------------------------------------------------------
 
diff --git a/wmake/scripts/have_petsc b/wmake/scripts/have_petsc
index a002d9c6c5a37cc62b4ffa5994e8d55630b76593..603584011ff61ffd556f5863fb267c8ee03accef 100644
--- a/wmake/scripts/have_petsc
+++ b/wmake/scripts/have_petsc
@@ -30,7 +30,7 @@
 #     PETSC_LIB_DIR
 #
 #------------------------------------------------------------------------------
-. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
+. ${WM_PROJECT_DIR:?}/wmake/scripts/sysFunctions    # General system functions
 
 #------------------------------------------------------------------------------
 
diff --git a/wmake/scripts/have_readline b/wmake/scripts/have_readline
index 207d4fc7e3c24de4171696074b23c91446e9d391..21a258bc0487dabaa8ee6da91ea8790b42bfffe2 100644
--- a/wmake/scripts/have_readline
+++ b/wmake/scripts/have_readline
@@ -29,7 +29,7 @@
 #     READLINE_LIB_DIR
 #
 #------------------------------------------------------------------------------
-. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
+. ${WM_PROJECT_DIR:?}/wmake/scripts/sysFunctions    # General system functions
 
 #------------------------------------------------------------------------------
 
diff --git a/wmake/scripts/have_scotch b/wmake/scripts/have_scotch
index c7043e9e06082e9967d57b9ea60c5ae438d7e765..78460c8096a8e00e35415658151a7eff999b9eb5 100644
--- a/wmake/scripts/have_scotch
+++ b/wmake/scripts/have_scotch
@@ -30,7 +30,7 @@
 #     SCOTCH_LIB_DIR
 #
 #------------------------------------------------------------------------------
-. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
+. ${WM_PROJECT_DIR:?}/wmake/scripts/sysFunctions    # General system functions
 
 #------------------------------------------------------------------------------
 
diff --git a/wmake/scripts/have_zoltan b/wmake/scripts/have_zoltan
index 213d249e280d2c024bf17904e767e1965730079e..681abd2bea2e6b10ccd96a9f9fa6c6ef3bfae689 100644
--- a/wmake/scripts/have_zoltan
+++ b/wmake/scripts/have_zoltan
@@ -30,7 +30,7 @@
 #     ZOLTAN_LIB_DIR
 #
 #------------------------------------------------------------------------------
-. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
+. ${WM_PROJECT_DIR:?}/wmake/scripts/sysFunctions    # General system functions
 
 #------------------------------------------------------------------------------
 
diff --git a/wmake/scripts/makeParser b/wmake/scripts/makeParser
index 4d15957280b33d6b857da3c1710319870086fd72..0f3ac573b8b9b1d7fb219917140ccd400bc3bd0f 100755
--- a/wmake/scripts/makeParser
+++ b/wmake/scripts/makeParser
@@ -120,10 +120,10 @@ case "$parser" in
     elif [ "$optCode" = true ]
     then
         echo "Generating lemon parser code ($extCode)$message"
-        "$WM_PROJECT_DIR/wmake/scripts/wrap-lemon" $optDebug -e"$extCode" -s "$input"
+        "${WM_PROJECT_DIR:?}/wmake/scripts/wrap-lemon" $optDebug -e"$extCode" -s "$input"
     else
         echo "Generating lemon parser header$message"
-        "$WM_PROJECT_DIR/wmake/scripts/wrap-lemon" $optDebug -header -s "$input"
+        "${WM_PROJECT_DIR:?}/wmake/scripts/wrap-lemon" $optDebug -header -s "$input"
     fi
     echo
     ;;
diff --git a/wmake/scripts/paraviewFunctions b/wmake/scripts/paraviewFunctions
index 7a2fc55f839cff5292232465cadc56c43227bd59..dffa7761028f1997a09c1c42ef53e94dd98cb70e 100644
--- a/wmake/scripts/paraviewFunctions
+++ b/wmake/scripts/paraviewFunctions
@@ -5,7 +5,7 @@
 #   \\  /    A nd           | www.openfoam.com
 #    \\/     M anipulation  |
 #------------------------------------------------------------------------------
-#     Copyright (C) 2018 OpenCFD Ltd.
+#     Copyright (C) 2018-2019 OpenCFD Ltd.
 #------------------------------------------------------------------------------
 # License
 #     This file is part of OpenFOAM, licensed under GNU General Public License
@@ -37,8 +37,8 @@
 #     paraview-major.minor encoded in its name.
 #
 #------------------------------------------------------------------------------
-. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
-. $WM_PROJECT_DIR/wmake/scripts/cmakeFunctions  # Require cmake functions
+. ${WM_PROJECT_DIR:?}/wmake/scripts/sysFunctions    # General system functions
+. ${WM_PROJECT_DIR:?}/wmake/scripts/cmakeFunctions  # Require cmake functions
 
 #------------------------------------------------------------------------------
 
@@ -63,22 +63,28 @@ echo_paraview()
 
 
 # CMake into objectsDir with VTK_DIR dependency
+# 1 - sourceDir
+# 2.. optional cmake defines
 cmakeVtk()
 {
-    cmakeVersioned "VTK_DIR=$VTK_DIR" "$1"
+    cmakeVersioned "VTK_DIR=$VTK_DIR" "$@"
 }
 
 
 # CMake into objectsDir with ParaView_DIR dependency
+# 1 - sourceDir
+# 2.. optional cmake defines
 cmakePv()
 {
-    cmakeVersioned "ParaView_DIR=$ParaView_DIR" "$1"
+    cmakeVersioned "ParaView_DIR=$ParaView_DIR" "$@"
 }
 
 # CMake into objectsDir with ParaView_DIR dependency
+# 1 - sourceDir
+# 2.. optional cmake defines
 cmakePvInstall()
 {
-    cmakeVersionedInstall "ParaView_DIR=$ParaView_DIR" "$1"
+    cmakeVersionedInstall "ParaView_DIR=$ParaView_DIR" "$@"
 }
 
 #
diff --git a/wmake/src/createCode b/wmake/src/createCode
index f98126a673a399e0cbeaedcc13c83f08674f2545..622d5cdd32f6ceccb081f645e587b246e0bf705e 100755
--- a/wmake/src/createCode
+++ b/wmake/src/createCode
@@ -1,8 +1,9 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-# Manually create ragel code
+cd ${0%/*} || exit 1                                # Run from this directory
 
-"$WM_PROJECT_DIR/wmake/scripts/makeParser" \
+# Manually create ragel scanner
+
+"${WM_PROJECT_DIR:?}/wmake/scripts/makeParser" \
     -scanner=wmkdepend.rl \
     "$@"