diff --git a/.gitignore b/.gitignore
index f4897f09beaacdd3f57439633ff7d888302da209..ebe5e91530f7e676712a5e174d59afbecb0f9a35 100644
--- a/.gitignore
+++ b/.gitignore
@@ -45,4 +45,7 @@ doc/[Dd]oxygen/man
 # ignore .timeStamp in the main directory
 /.timeStamp
 
+# ignore .ebrowse in the main directory
+/.ebrowse
+
 # end-of-file
diff --git a/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.C b/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.C
index 6a01fac5f92314b9fd2f5fb1aff34be4fb400b08..041a64de4f0989ff996f20e4a3eb95481945d97f 100644
--- a/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.C
+++ b/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.C
@@ -451,7 +451,7 @@ void doRefinement
     const labelHashSet& refCells,
     labelList& refLevel
 )
-{ 
+{
     label oldCells = mesh.nCells();
 
     // Multi-iteration, multi-direction topology modifier.
@@ -565,7 +565,7 @@ void subsetMesh
     // Update cutCells for removed cells.
     cutCells.updateMesh(morphMap());
 }
-    
+
 
 // Divide the cells according to status compared to surface. Constructs sets:
 // - cutCells : all cells cut by surface
@@ -877,7 +877,7 @@ int main(int argc, char *argv[])
 
 
         // Added cells from 2:1 refinement level restriction.
-        while 
+        while
         (
             limitRefinementLevel
             (
@@ -887,7 +887,8 @@ int main(int argc, char *argv[])
                 refLevel,
                 cutCells
             )
-        );
+        )
+        {}
 
 
         Info<< "    Current cells           : " << mesh.nCells() << nl
@@ -988,7 +989,8 @@ int main(int argc, char *argv[])
                 refLevel,
                 hanging
             )
-        );
+        )
+        {}
 
         doRefinement(mesh, refineDict, hanging, refLevel);
 
diff --git a/applications/utilities/mesh/advanced/refinementLevel/refinementLevel.C b/applications/utilities/mesh/advanced/refinementLevel/refinementLevel.C
index 263f2534e223245e408764ef8323f747ee3aac10..39f0de363a3988b913737c06ca9e838ae742afa9 100644
--- a/applications/utilities/mesh/advanced/refinementLevel/refinementLevel.C
+++ b/applications/utilities/mesh/advanced/refinementLevel/refinementLevel.C
@@ -26,12 +26,12 @@ Description
     Tries to figure out what the refinement level is on refined cartesian
     meshes. Run BEFORE snapping.
 
-    Writes 
+    Writes
     - volScalarField 'refinementLevel' with current refinement level.
     - cellSet 'refCells' which are the cells that need to be refined to satisfy
       2:1 refinement.
 
-    Works by dividing cells into volume bins. 
+    Works by dividing cells into volume bins.
 
 \*---------------------------------------------------------------------------*/
 
@@ -77,7 +77,7 @@ bool limitRefinementLevel
             }
         }
     }
-            
+
     if (refCells.size() > oldNCells)
     {
         Info<< "Added an additional " << refCells.size() - oldNCells
@@ -143,7 +143,7 @@ int main(int argc, char *argv[])
                 << lowerLimits[lowerLimits.size()-1] << " .. "
                 << upperLimits[upperLimits.size()-1] << endl;
 
-            // Create new bin.            
+            // Create new bin.
             bins.append(DynamicList<label>());
             lowerLimits.append(sortedVols[i]);
             upperLimits.append(1.1*lowerLimits[lowerLimits.size()-1]);
@@ -243,7 +243,7 @@ int main(int argc, char *argv[])
         return 1;
     }
 
-    
+
     labelIOList refLevel
     (
         IOobject
@@ -308,7 +308,7 @@ int main(int argc, char *argv[])
             bField[faceI] = postRefLevel[own];
         }
     }
-        
+
     Info<< "Determined current refinement level and writing to "
         << postRefLevel.name() << " (as volScalarField; for post processing)"
         << nl
@@ -325,7 +325,7 @@ int main(int argc, char *argv[])
     // Cells to refine
     cellSet refCells(mesh, "refCells", 100);
 
-    while 
+    while
     (
         limitRefinementLevel
         (
@@ -333,7 +333,8 @@ int main(int argc, char *argv[])
             refLevel,       // current refinement level
             refCells        // cells to refine
         )
-    );
+    )
+    {}
 
     if (refCells.size() > 0)
     {
diff --git a/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L b/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L
index ea650ad98a86811953f1c121ddf173b848126cff..1d6bc65284160f594c3275623cf4a215b584d852 100644
--- a/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L
+++ b/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L
@@ -265,7 +265,8 @@ int main(int argc, char *argv[])
     }
 
     yyFlexLexer lexer(&ansysStream);
-    while(lexer.yylex() != 0);
+    while(lexer.yylex() != 0)
+    {}
 
     Info << "Creating points" << endl;
 
diff --git a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L
index 22bbb4002b9def3a14a7f6eb123e46e4fbfffda3..75ab79ec86b2e786c1e5aeffe0af02d64bfc05bf 100644
--- a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L
+++ b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L
@@ -583,7 +583,8 @@ endOfSection               {space}")"{space}
 <readCellData>{spaceNl}{lbrac} {
         // Quickly scan to the end of the cell data block and discard
         register int c;
-        while ((c = yyinput()) != 0 && c != ')');
+        while ((c = yyinput()) != 0 && c != ')')
+        {}
     }
 
 {faceTree} {
@@ -763,7 +764,8 @@ int main(int argc, char *argv[])
 
     yyFlexLexer lexer(&fluentStream.stdStream());
 
-    while(lexer.yylex() != 0);
+    while(lexer.yylex() != 0)
+    {}
 
     Info<< "\nFINISHED LEXING\n\n";
 
diff --git a/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L b/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L
index f028ac227a09840a2391665957fadadbfba36717..a30383462355284a3dde2d3c04b02034680c595a 100644
--- a/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L
+++ b/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L
@@ -901,7 +901,8 @@ int main(int argc, char *argv[])
     }
 
     yyFlexLexer lexer(&fluentStream);
-    while(lexer.yylex() != 0);
+    while(lexer.yylex() != 0)
+    {}
 
     Info<< "\n\nFINISHED LEXING\n\n\n";
     // Lookup table giving number of vertices given a fluent cell type ID
diff --git a/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L b/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L
index 939c75658309bdab1755ecdd25ed49b07b7765f4..c906ec89eb28811a1ebeeeea84479c7a235b7048 100644
--- a/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L
+++ b/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L
@@ -665,7 +665,8 @@ int main(int argc, char *argv[])
     }
 
     yyFlexLexer lexer(&gambitStream);
-    while(lexer.yylex() != 0);
+    while(lexer.yylex() != 0)
+    {}
 
     Info << "Finished lexing" << endl;
 
diff --git a/applications/utilities/mesh/manipulation/Optional/setSet/setSet.C b/applications/utilities/mesh/manipulation/Optional/setSet/setSet.C
index 3c3f01de93fe743590fb4f17316c049be4317d4e..c4e6b21162333db17eb973a51f5a75934cfa8693 100644
--- a/applications/utilities/mesh/manipulation/Optional/setSet/setSet.C
+++ b/applications/utilities/mesh/manipulation/Optional/setSet/setSet.C
@@ -189,7 +189,7 @@ void writeVTK
         faceList setFaces(cellFaces.size());
         labelList faceValues(cellFaces.size());
         label setFaceI = 0;
-        
+
         forAllConstIter(Map<label>, cellFaces, iter)
         {
             setFaces[setFaceI] = mesh.faces()[iter.key()];
@@ -217,7 +217,7 @@ void writeVTK
             mesh,
             currentSet,
             mesh.time().path()/vtkName
-        );        
+        );
     }
     else
     {
@@ -331,7 +331,7 @@ bool doCommand
     // Get some size estimate for set.
     const globalMeshData& parData = mesh.globalData();
 
-    label typSize = 
+    label typSize =
         max
         (
             parData.nTotalCells(),
@@ -449,7 +449,7 @@ bool doCommand
                 }
             }
             else
-            {        
+            {
                 if (is >> sourceType)
                 {
                     autoPtr<topoSetSource> setSource
@@ -743,7 +743,7 @@ int main(int argc, char *argv[])
     else if (!read_history(historyFile))
     {
         Info<< "Successfully read history from " << historyFile << endl;
-    }        
+    }
 #endif
 
 
@@ -754,7 +754,7 @@ int main(int argc, char *argv[])
     FatalError.throwExceptions();
     FatalIOError.throwExceptions();
 
-    while (1)
+    do
     {
         string rawLine;
 
diff --git a/applications/utilities/parallelProcessing/reconstructParMesh/Make/options b/applications/utilities/parallelProcessing/reconstructParMesh/Make/options
index 9f27b82cb5e7d44db165e146eef9a86251ed0a3b..73f34b0f85f190348d7b3b89bc9b39acd5ce761f 100644
--- a/applications/utilities/parallelProcessing/reconstructParMesh/Make/options
+++ b/applications/utilities/parallelProcessing/reconstructParMesh/Make/options
@@ -4,5 +4,4 @@ EXE_INC = \
 
 EXE_LIBS = \
     -ldynamicMesh \
-    -lmeshTools \
-   
+    -lmeshTools
diff --git a/applications/utilities/postProcessing/dataConversion/foamDataToFluent/Make/options b/applications/utilities/postProcessing/dataConversion/foamDataToFluent/Make/options
index be7f7d631d3092c6fdffcb40349c53ba1fff4db8..fa15f124528ebfcaf279a88a73a0d7954f2e9dc1 100644
--- a/applications/utilities/postProcessing/dataConversion/foamDataToFluent/Make/options
+++ b/applications/utilities/postProcessing/dataConversion/foamDataToFluent/Make/options
@@ -2,5 +2,4 @@ EXE_INC = \
     -I$(LIB_SRC)/finiteVolume/lnInclude
 
 EXE_LIBS = \
-    -lfiniteVolume \
-   
+    -lfiniteVolume
diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/options b/applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/options
index db2e26ca8b94e9e522bd34952181e5e0aa00d780..1adeeefa12999bb91513d9e0b16a0a52a9fc15d2 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/options
+++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/options
@@ -4,5 +4,4 @@ EXE_INC = \
 
 EXE_LIBS = \
     -lfiniteVolume \
-    -llagrangian \
-   
+    -llagrangian
diff --git a/applications/utilities/postProcessing/dataConversion/foamToFieldview9/Make/options b/applications/utilities/postProcessing/dataConversion/foamToFieldview9/Make/options
index db2e26ca8b94e9e522bd34952181e5e0aa00d780..1adeeefa12999bb91513d9e0b16a0a52a9fc15d2 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToFieldview9/Make/options
+++ b/applications/utilities/postProcessing/dataConversion/foamToFieldview9/Make/options
@@ -4,5 +4,4 @@ EXE_INC = \
 
 EXE_LIBS = \
     -lfiniteVolume \
-    -llagrangian \
-   
+    -llagrangian
diff --git a/applications/utilities/postProcessing/dataConversion/foamToVTK/Make/options b/applications/utilities/postProcessing/dataConversion/foamToVTK/Make/options
index 03c890ea5ee3f1a49be2c99c4445539089d84e6d..7d09e7e83ffe6f26ca0ce8202a84231236a8bf84 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToVTK/Make/options
+++ b/applications/utilities/postProcessing/dataConversion/foamToVTK/Make/options
@@ -6,5 +6,5 @@ EXE_INC = \
 EXE_LIBS = \
     -lfiniteVolume \
     -llagrangian \
-    -lmeshTools \
-   
+    -lmeshTools
+
diff --git a/applications/utilities/postProcessing/graphics/fieldview9Reader/Make/options b/applications/utilities/postProcessing/graphics/fieldview9Reader/Make/options
index e73c6a9fc71eab8eccfb5e0cce1719271fbea12f..f5285ce39e8371795f0ee29990683684c685b68b 100644
--- a/applications/utilities/postProcessing/graphics/fieldview9Reader/Make/options
+++ b/applications/utilities/postProcessing/graphics/fieldview9Reader/Make/options
@@ -24,7 +24,7 @@
         -lgen -lnsl -lsocket -lw -lintl -ldl
 
 #elif defined(sgiN32) || defined(sgiN32Gcc)
- 
+
     FV_LIBS = \
         $(FV_HOME)/user/obj/iris/fv.o \
         $(FV_HOME)/user/obj/iris/fv2.o \
@@ -94,12 +94,9 @@ EXE_INC = \
     -I$(LIB_SRC)/finiteVolume/lnInclude \
     -I$(LIB_SRC)/meshTools/lnInclude \
     -I$(LIB_SRC)/browser/lnInclude \
-    -I$(FOAM_SRC)/lagrangian/basic/lnInclude \
-
+    -I$(FOAM_SRC)/lagrangian/basic/lnInclude
 
 EXE_LIBS = \
     $(FV_LIBS) \
     -lfiniteVolume \
-    -lmeshTools \
-   
-
+    -lmeshTools
diff --git a/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/Make/options b/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/Make/options
index ae2f65366688f2e1ffbe6f6ebf28abb0b15d15b3..f67d6a42542e5d57912090f1683f590a3aa23b1b 100644
--- a/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/Make/options
+++ b/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/Make/options
@@ -17,4 +17,3 @@ EXE_LIBS = \
     -lspecie \
     -lcompressibleTurbulenceModels \
     -lcompressibleLESmodels
-
diff --git a/applications/utilities/postProcessing/miscellaneous/postChannel/Make/options b/applications/utilities/postProcessing/miscellaneous/postChannel/Make/options
index c4734b6ca14bba74d52ae3275c873ca480848684..d38cd8b1801b429e5f42c7b0ba2ab58ba2cd1d11 100644
--- a/applications/utilities/postProcessing/miscellaneous/postChannel/Make/options
+++ b/applications/utilities/postProcessing/miscellaneous/postChannel/Make/options
@@ -4,5 +4,4 @@ EXE_INC = \
 
 EXE_LIBS = \
     -lfiniteVolume \
-    -lsampling \
-   
+    -lsampling
diff --git a/applications/utilities/postProcessing/miscellaneous/ptot/Make/options b/applications/utilities/postProcessing/miscellaneous/ptot/Make/options
index be7f7d631d3092c6fdffcb40349c53ba1fff4db8..fa15f124528ebfcaf279a88a73a0d7954f2e9dc1 100644
--- a/applications/utilities/postProcessing/miscellaneous/ptot/Make/options
+++ b/applications/utilities/postProcessing/miscellaneous/ptot/Make/options
@@ -2,5 +2,4 @@ EXE_INC = \
     -I$(LIB_SRC)/finiteVolume/lnInclude
 
 EXE_LIBS = \
-    -lfiniteVolume \
-   
+    -lfiniteVolume
diff --git a/applications/utilities/postProcessing/miscellaneous/wdot/Make/options b/applications/utilities/postProcessing/miscellaneous/wdot/Make/options
index be7f7d631d3092c6fdffcb40349c53ba1fff4db8..fa15f124528ebfcaf279a88a73a0d7954f2e9dc1 100644
--- a/applications/utilities/postProcessing/miscellaneous/wdot/Make/options
+++ b/applications/utilities/postProcessing/miscellaneous/wdot/Make/options
@@ -2,5 +2,4 @@ EXE_INC = \
     -I$(LIB_SRC)/finiteVolume/lnInclude
 
 EXE_LIBS = \
-    -lfiniteVolume \
-   
+    -lfiniteVolume
diff --git a/applications/utilities/postProcessing/sampling/probeLocations/Make/options b/applications/utilities/postProcessing/sampling/probeLocations/Make/options
index 083d04c7a6724b1099fcb35b9b8526573503c7ba..04b22c08a43668605ad1f5dab7bc06f0a962e058 100644
--- a/applications/utilities/postProcessing/sampling/probeLocations/Make/options
+++ b/applications/utilities/postProcessing/sampling/probeLocations/Make/options
@@ -3,7 +3,7 @@ EXE_INC = \
     -I$(LIB_SRC)/meshTools/lnInclude \
     -I$(LIB_SRC)/sampling/lnInclude \
     -I$(LIB_SRC)/triSurface/lnInclude \
-    -I$(LIB_SRC)/lagrangian/basic/lnInclude \
+    -I$(LIB_SRC)/lagrangian/basic/lnInclude
 
 EXE_LIBS = \
     -lfiniteVolume \
diff --git a/applications/utilities/postProcessing/sampling/sample/Make/options b/applications/utilities/postProcessing/sampling/sample/Make/options
index 083d04c7a6724b1099fcb35b9b8526573503c7ba..04b22c08a43668605ad1f5dab7bc06f0a962e058 100644
--- a/applications/utilities/postProcessing/sampling/sample/Make/options
+++ b/applications/utilities/postProcessing/sampling/sample/Make/options
@@ -3,7 +3,7 @@ EXE_INC = \
     -I$(LIB_SRC)/meshTools/lnInclude \
     -I$(LIB_SRC)/sampling/lnInclude \
     -I$(LIB_SRC)/triSurface/lnInclude \
-    -I$(LIB_SRC)/lagrangian/basic/lnInclude \
+    -I$(LIB_SRC)/lagrangian/basic/lnInclude
 
 EXE_LIBS = \
     -lfiniteVolume \
diff --git a/applications/utilities/postProcessing/scalarField/pPrime2/Make/options b/applications/utilities/postProcessing/scalarField/pPrime2/Make/options
index be7f7d631d3092c6fdffcb40349c53ba1fff4db8..fa15f124528ebfcaf279a88a73a0d7954f2e9dc1 100644
--- a/applications/utilities/postProcessing/scalarField/pPrime2/Make/options
+++ b/applications/utilities/postProcessing/scalarField/pPrime2/Make/options
@@ -2,5 +2,4 @@ EXE_INC = \
     -I$(LIB_SRC)/finiteVolume/lnInclude
 
 EXE_LIBS = \
-    -lfiniteVolume \
-   
+    -lfiniteVolume
diff --git a/applications/utilities/postProcessing/stressField/stressComponents/Make/options b/applications/utilities/postProcessing/stressField/stressComponents/Make/options
index e5b31a6ffad662a1a70b7ccee7b297e0c8b40b2d..47f63723e30021bb3c2cfa9adf327f7e0981cbc4 100644
--- a/applications/utilities/postProcessing/stressField/stressComponents/Make/options
+++ b/applications/utilities/postProcessing/stressField/stressComponents/Make/options
@@ -6,5 +6,4 @@ EXE_INC = \
 EXE_LIBS = \
     -lfiniteVolume \
     -lincompressibleTurbulenceModels \
-    -lincompressibleTransportModels \
-   
+    -lincompressibleTransportModels
diff --git a/applications/utilities/postProcessing/turbulence/R/Make/options b/applications/utilities/postProcessing/turbulence/R/Make/options
index 1d4ee22b138cb1868ad03e0046874f14b61e87c9..149b58cc98164c981b69f0421d13cf80470f24ca 100644
--- a/applications/utilities/postProcessing/turbulence/R/Make/options
+++ b/applications/utilities/postProcessing/turbulence/R/Make/options
@@ -7,5 +7,4 @@ EXE_LIBS = \
     -lfiniteVolume \
     -lincompressibleTurbulenceModels \
     -lincompressibleTransportModels \
-    -lfiniteVolume \
-   
+    -lfiniteVolume
diff --git a/applications/utilities/postProcessing/turbulence/createTurbulenceFields/Make/options b/applications/utilities/postProcessing/turbulence/createTurbulenceFields/Make/options
index 84844ed6824f5c1942aaae05829280fb323d6464..47f63723e30021bb3c2cfa9adf327f7e0981cbc4 100644
--- a/applications/utilities/postProcessing/turbulence/createTurbulenceFields/Make/options
+++ b/applications/utilities/postProcessing/turbulence/createTurbulenceFields/Make/options
@@ -6,4 +6,4 @@ EXE_INC = \
 EXE_LIBS = \
     -lfiniteVolume \
     -lincompressibleTurbulenceModels \
-    -lincompressibleTransportModels \
+    -lincompressibleTransportModels
diff --git a/applications/utilities/postProcessing/velocityField/Mach/Make/options b/applications/utilities/postProcessing/velocityField/Mach/Make/options
index fbc31ea0a353229a789b35e206e74a15eee61d5a..635142c6cca869fbcf2066cc1b3bb513592843b7 100644
--- a/applications/utilities/postProcessing/velocityField/Mach/Make/options
+++ b/applications/utilities/postProcessing/velocityField/Mach/Make/options
@@ -8,4 +8,3 @@ EXE_LIBS = \
     -lfiniteVolume \
     -lbasicThermophysicalModels \
     -lspecie
-
diff --git a/applications/utilities/postProcessing/velocityField/streamFunction/Make/options b/applications/utilities/postProcessing/velocityField/streamFunction/Make/options
index be7f7d631d3092c6fdffcb40349c53ba1fff4db8..fa15f124528ebfcaf279a88a73a0d7954f2e9dc1 100644
--- a/applications/utilities/postProcessing/velocityField/streamFunction/Make/options
+++ b/applications/utilities/postProcessing/velocityField/streamFunction/Make/options
@@ -2,5 +2,4 @@ EXE_INC = \
     -I$(LIB_SRC)/finiteVolume/lnInclude
 
 EXE_LIBS = \
-    -lfiniteVolume \
-   
+    -lfiniteVolume
diff --git a/applications/utilities/postProcessing/wall/wallGradU/Make/options b/applications/utilities/postProcessing/wall/wallGradU/Make/options
index f967261d26daf8e8faa04a6086f698c93c33e04c..b0e647e10a1e3ef1f41e11bce4758f9dbd53c759 100644
--- a/applications/utilities/postProcessing/wall/wallGradU/Make/options
+++ b/applications/utilities/postProcessing/wall/wallGradU/Make/options
@@ -6,5 +6,4 @@ EXE_INC = \
 EXE_LIBS = \
     -lincompressibleTurbulenceModels \
     -lincompressibleTransportModels \
-    -lfiniteVolume \
-   
+    -lfiniteVolume
diff --git a/applications/utilities/postProcessing/wall/wallHeatFlux/Make/options b/applications/utilities/postProcessing/wall/wallHeatFlux/Make/options
index 55c37f7066e0b88e8b7c43a3ece8cd4460dad437..49c8ba9144d9ef7e1c05dbda2192a64177342aa8 100644
--- a/applications/utilities/postProcessing/wall/wallHeatFlux/Make/options
+++ b/applications/utilities/postProcessing/wall/wallHeatFlux/Make/options
@@ -10,5 +10,4 @@ EXE_LIBS = \
     -lcombustionThermophysicalModels \
     -lfiniteVolume \
     -lspecie \
-    -lbasicThermophysicalModels \
-   
+    -lbasicThermophysicalModels
diff --git a/applications/utilities/postProcessing/wall/wallShearStress/Make/options b/applications/utilities/postProcessing/wall/wallShearStress/Make/options
index f967261d26daf8e8faa04a6086f698c93c33e04c..b0e647e10a1e3ef1f41e11bce4758f9dbd53c759 100644
--- a/applications/utilities/postProcessing/wall/wallShearStress/Make/options
+++ b/applications/utilities/postProcessing/wall/wallShearStress/Make/options
@@ -6,5 +6,4 @@ EXE_INC = \
 EXE_LIBS = \
     -lincompressibleTurbulenceModels \
     -lincompressibleTransportModels \
-    -lfiniteVolume \
-   
+    -lfiniteVolume
diff --git a/applications/utilities/postProcessing/wall/yPlusLES/Make/options b/applications/utilities/postProcessing/wall/yPlusLES/Make/options
index 1e34f1edfec7c841ad44e8ce40084622923561e4..cb15a51f9ab66a32858d61b076221ec8d8e796b5 100644
--- a/applications/utilities/postProcessing/wall/yPlusLES/Make/options
+++ b/applications/utilities/postProcessing/wall/yPlusLES/Make/options
@@ -7,5 +7,4 @@ EXE_INC = \
 EXE_LIBS = \
     -lincompressibleLESmodels \
     -lincompressibleTransportModels \
-    -lfiniteVolume \
-   
+    -lfiniteVolume
diff --git a/applications/utilities/postProcessing/wall/yPlusRAS/Make/options b/applications/utilities/postProcessing/wall/yPlusRAS/Make/options
index f967261d26daf8e8faa04a6086f698c93c33e04c..b0e647e10a1e3ef1f41e11bce4758f9dbd53c759 100644
--- a/applications/utilities/postProcessing/wall/yPlusRAS/Make/options
+++ b/applications/utilities/postProcessing/wall/yPlusRAS/Make/options
@@ -6,5 +6,4 @@ EXE_INC = \
 EXE_LIBS = \
     -lincompressibleTurbulenceModels \
     -lincompressibleTransportModels \
-    -lfiniteVolume \
-   
+    -lfiniteVolume
diff --git a/applications/utilities/surface/surfaceCoarsen/bunnylod/progmesh.C b/applications/utilities/surface/surfaceCoarsen/bunnylod/progmesh.C
index dbd92d3a86d95ae24fe0b752424467144ccb1a6f..89b81846dac124fa0ca613034169be83ac94fd25 100644
--- a/applications/utilities/surface/surfaceCoarsen/bunnylod/progmesh.C
+++ b/applications/utilities/surface/surfaceCoarsen/bunnylod/progmesh.C
@@ -7,7 +7,7 @@
  *  See the header file progmesh.h for a description of this module
  */
 
-#include <stdio.h>  
+#include <stdio.h>
 #include <math.h>
 #include <stdlib.h>
 #include <assert.h>
@@ -151,11 +151,11 @@ void Vertex::RemoveIfNonNeighbor(Vertex *n) {
 
 
 float ComputeEdgeCollapseCost(Vertex *u,Vertex *v) {
-	// if we collapse edge uv by moving u to v then how 
+	// if we collapse edge uv by moving u to v then how
 	// much different will the model change, i.e. how much "error".
 	// Texture, vertex normal, and border vertex code was removed
 	// to keep this demo as simple as possible.
-	// The method of determining cost was designed in order 
+	// The method of determining cost was designed in order
 	// to exploit small and coplanar regions for
 	// effective polygon reduction.
 	// Is is possible to add some checks here to see if "folds"
@@ -173,7 +173,7 @@ float ComputeEdgeCollapseCost(Vertex *u,Vertex *v) {
 			sides.Add(u->face[i]);
 		}
 	}
-	// use the triangle facing most away from the sides 
+	// use the triangle facing most away from the sides
 	// to determine our curvature term
 	for(i=0;i<u->face.num;i++) {
 		float mincurv=1; // curve for face i and closer side to it
@@ -184,7 +184,7 @@ float ComputeEdgeCollapseCost(Vertex *u,Vertex *v) {
 		}
 		curvature = max(curvature,mincurv);
 	}
-	// the more coplanar the lower the curvature term   
+	// the more coplanar the lower the curvature term
 	return edgelength * curvature;
 }
 
@@ -193,7 +193,7 @@ void ComputeEdgeCostAtVertex(Vertex *v) {
 	// from vertex v.  Since we are only interested in reducing
 	// the object by selecting the min cost edge at each step, we
 	// only cache the cost of the least cost edge at this vertex
-	// (in member variable collapse) as well as the value of the 
+	// (in member variable collapse) as well as the value of the
 	// cost (in member variable objdist).
 	if(v->neighbor.num==0) {
 		// v doesn't have neighbors so it costs nothing to collapse
@@ -247,7 +247,7 @@ void Collapse(Vertex *u,Vertex *v){
 	for(i=u->face.num-1;i>=0;i--) {
 		u->face[i]->ReplaceVertex(u,v);
 	}
-	delete u; 
+	delete u;
 	// recompute the edge collapse costs for neighboring vertices
 	for(i=0;i<tmp.num;i++) {
 		ComputeEdgeCostAtVertex(tmp[i]);
@@ -256,15 +256,15 @@ void Collapse(Vertex *u,Vertex *v){
 
 void AddVertex(List<Vector> &vert){
 	for(int i=0;i<vert.num;i++) {
-		Vertex *v = new Vertex(vert[i],i);
+		new Vertex(vert[i],i);
 	}
 }
 void AddFaces(List<tridata> &tri){
 	for(int i=0;i<tri.num;i++) {
-		Triangle *t=new Triangle(
-					      vertices[tri[i].v[0]],
-					      vertices[tri[i].v[1]],
-					      vertices[tri[i].v[2]] );
+		new Triangle(
+            vertices[tri[i].v[0]],
+            vertices[tri[i].v[1]],
+            vertices[tri[i].v[2]] );
 	}
 }
 
@@ -284,7 +284,7 @@ Vertex *MinimumCostEdge(){
 	return mn;
 }
 
-void ProgressiveMesh(List<Vector> &vert, List<tridata> &tri, 
+void ProgressiveMesh(List<Vector> &vert, List<tridata> &tri,
                      List<int> &map, List<int> &permutation)
 {
 	AddVertex(vert);  // put input data into our data structures
diff --git a/bin/doxyScr b/bin/doxyScr
index d9ea8168a6e4c81b1ed23013c244614bfd880e51..da9dc8c8d9e65180e4f04cc5500ec8600399ea6a 100644
--- a/bin/doxyScr
+++ b/bin/doxyScr
@@ -131,7 +131,8 @@ s/^    //
 
 /SourceFiles/,/^[ ]*$/{
 s?SourceFiles?@par Source files\
-<ul>?
+<ul>\
+  <li><a href="%filePath%">%fileName%</a></li>?
 s?^[ ]*$?</ul>\
 ?
 s? *\([a-zA-Z0-9]*\.[a-zA-Z]*\)?  <li><a href="%dirName%/\1">\1</a></li>?
diff --git a/bin/foamEbrowse b/bin/foamEbrowse
new file mode 100755
index 0000000000000000000000000000000000000000..cc831f9e8775a113d74a50463419f73edca19aa1
--- /dev/null
+++ b/bin/foamEbrowse
@@ -0,0 +1,52 @@
+#!/bin/sh
+#------------------------------------------------------------------------------
+# =========                 |
+# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+#  \\    /   O peration     |
+#   \\  /    A nd           | Copyright (C) 1991-2007 OpenCFD Ltd.
+#    \\/     M anipulation  |
+#-------------------------------------------------------------------------------
+# License
+#     This file is part of OpenFOAM.
+#
+#     OpenFOAM is free software; you can redistribute it and/or modify it
+#     under the terms of the GNU General Public License as published by the
+#     Free Software Foundation; either version 2 of the License, or (at your
+#     option) any later version.
+#
+#     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+#     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+#     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+#     for more details.
+#
+#     You should have received a copy of the GNU General Public License
+#     along with OpenFOAM; if not, write to the Free Software Foundation,
+#     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Script
+#     foamEbrowse
+#
+# Description
+#     Build the Ebrowse dadbase for all the .C and .H files
+#
+#------------------------------------------------------------------------------
+headersFile=${TMPDIR:-/tmp}/headersFile.$$
+sourcesFile=${TMPDIR:-/tmp}/sourcesFile.$$
+
+if [ $# -ne 0 ]; then
+   echo "Usage : ${0##*/}"
+   echo ""
+   echo "Build the Ebrowse dadbase for all the .C and .H files"
+   echo ""
+   exit 1
+fi
+
+cd $WM_PROJECT_DIR
+find -H . -name "*.H" | fgrep -v "lnInclude" > $headersFile
+find -H . -name "*.C" | fgrep -v "lnInclude" > $sourcesFile
+ebrowse --files=$headersFile --files=$sourcesFile --output-file=.ebrowse
+
+# Clean up on termination and on Ctrl-C
+trap 'rm -f $headersFile $sourcesFile 2>/dev/null; exit 0' EXIT TERM INT
+
+#------------------------------------------------------------------------------
diff --git a/bin/foamPackSource b/bin/foamPackSource
index 2033e400c4f2a969ef889708bd8c8ea2b278b7bd..ead7a80d98dc1c3ab008050e8c1379d2bdfae064 100755
--- a/bin/foamPackSource
+++ b/bin/foamPackSource
@@ -73,6 +73,7 @@ find -H $packDir               \
  -a ! -name "core"             \
  -a ! -name "core.[1-9]*"      \
  -a ! -name "log[0-9]*"        \
+ -a ! -name "\.ebrowse"        \
 | sed                          \
  -e "\@$packDir/.git/@d"       \
  -e "\@$packDir/lib/@d"        \
diff --git a/src/meshTools/octree/PointIndexHit.H b/src/meshTools/octree/PointIndexHit.H
index 35388eaa1b7b2f37e5dbd2d393d0e90e34193b43..4af500c8cd9345195cc010bb0345338c4faf788f 100644
--- a/src/meshTools/octree/PointIndexHit.H
+++ b/src/meshTools/octree/PointIndexHit.H
@@ -141,6 +141,11 @@ public:
             return hitPoint_;
         }
 
+        Point& rawPoint()
+        {
+            return hitPoint_;
+        }
+
         void setHit()
         {
             hit_ = true;
diff --git a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.H b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.H
index c9b435cc2b4f90d9e219863e2afddcfa2f2ea9c7..634c3c7467d328ab857eac0067aec55595cdbae6 100644
--- a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.H
+++ b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.H
@@ -81,6 +81,10 @@ public:
             scalar exponent;
 
             specieCoeffs()
+            :
+                index(-1),
+                stoichCoeff(0),
+                exponent(1)
             {}
 
             specieCoeffs(const speciesTable& species, Istream& is);
@@ -157,7 +161,7 @@ public:
         {
             const speciesTable& species_;
             const HashPtrTable<ReactionThermo>& thermoDatabase_;
-        
+
         public:
 
             iNew
@@ -257,7 +261,7 @@ public:
                 const scalar T,
                 const scalar p,
                 const scalarField& c
-            ) const;            
+            ) const;
 
             //- Reverse rate constant from the given forward rate constant
             virtual scalar kr
diff --git a/tutorials/Allclean b/tutorials/Allclean
index aefce0c6f099132e81d93bcc63052e7844cc73e7..6f62878c0a8c92efb513aa095ec4ed76a44a2346 100755
--- a/tutorials/Allclean
+++ b/tutorials/Allclean
@@ -43,23 +43,10 @@ echo ""
 
 for application in *
 do
-    if [ -d "$application" ]
+    if [ -d $application ]
     then
-        cd $application
-        if [ -f "Allclean" ] 
-        then
-            ./Allclean
-        else
-            for case in *
-            do
-                if [ -d "$case" ]
-                then
-                    cleanCase $case
-                fi
-            done
-        fi
-        cd ..
-     fi
+        (cd $application && ../cleanAll)
+    fi
 done
 
 #------------------------------------------------------------------------------
diff --git a/tutorials/Allrun b/tutorials/Allrun
index e41156e63a7774d11a9b2d4ded4809fc8f5f0a00..3e48760c4f00bd8ef67145daad97a1ccb3220065 100755
--- a/tutorials/Allrun
+++ b/tutorials/Allrun
@@ -32,94 +32,64 @@
 
 . RunFunctions
 
-applications=\
-" \
-    icoFoam \
-    turbFoam \
-    simpleFoam \
-    icoDyMFoam \
-    nonNewtonianIcoFoam \
-    boundaryFoam \
-    interFoam \
-    lesInterFoam \
-    rasInterFoam \
-    multiphaseInterFoam \
-    buoyantSimpleFoam \
-    buoyantFoam \
-    potentialFoam \
-    laplacianFoam \
-    scalarTransportFoam \
-    oodles \
-    coodles \
-    channelOodles \
-    dnsFoam \
-    mhdFoam \
-    electrostaticFoam \
-    financialFoam \
-    sonicFoam \
-    rhoSonicFoam \
-    rhopSonicFoam \
-    sonicLiquidFoam \
-    sonicTurbFoam \
-    solidDisplacementFoam \
-    solidEquilibriumDisplacementFoam \
-    XiFoam \
-    Xoodles \
-    dieselFoam \
-    engineFoam \
-    bubbleFoam \
-    twoPhaseEulerFoam \
-    settlingFoam \
-    rhoExplicitPorousSimpleFoam \
-    rhoImplicitPorousSimpleFoam \
-    rhoTurbFoam \
-    cavitatingFoam \
-    MRFSimpleFoam \
-    interDyMFoam \
-"
 
+# logReport <logfile>
+# Extracts useful info from log file.
 logReport () {
-case=`dirname $1 | sed s/"\(.*\)\.\/"/""/g`
-app=`echo $1 | sed s/"\(.*\)\."/""/g`
-appAndCase="Application $app - case $case"
+    case=`dirname $1 | sed s/"\(.*\)\.\/"/""/g`
+    app=`echo $1 | sed s/"\(.*\)\."/""/g`
+    appAndCase="Application $app - case $case"
 
-fatalError=`grep "FOAM FATAL" $1`
-UxSS=`grep -E "Ux[:| ]*solution singularity" $1`
-UySS=`grep -E "Uy[:| ]*solution singularity" $1`
-UzSS=`grep -E "Uz[:| ]*solution singularity" $1`
-completed=`grep -E "^[\t ]*[eE]nd" $1`
+    fatalError=`grep "FOAM FATAL" $1`
+    UxSS=`grep -E "Ux[:| ]*solution singularity" $1`
+    UySS=`grep -E "Uy[:| ]*solution singularity" $1`
+    UzSS=`grep -E "Uz[:| ]*solution singularity" $1`
+    completed=`grep -E "^[\t ]*[eE]nd" $1`
 
-if [ "$fatalError" ] ; then
-    echo "$appAndCase: ** FOAM FATAL ERROR **"
-    return
-elif [ "$UxSS" -a "$UySS" -a "$UzSS" ] ; then
-    echo "$appAndCase: ** Solution singularity **"
-    return
-elif [ "$completed" ] ; then
-    completionTime=`tail -10 $log | grep Execution | cut -d= -f2 | sed 's/^[ \t]*//'` 
-    if [ "$completionTime" ] ; then
-        completionTime="in $completionTime"
+    if [ "$fatalError" ] ; then
+        echo "$appAndCase: ** FOAM FATAL ERROR **"
+        return
+    elif [ "$UxSS" -a "$UySS" -a "$UzSS" ] ; then
+        echo "$appAndCase: ** Solution singularity **"
+        return
+    elif [ "$completed" ] ; then
+        completionTime=`tail -10 $log | grep Execution | cut -d= -f2 | sed 's/^[ \t]*//'` 
+        if [ "$completionTime" ] ; then
+            completionTime="in $completionTime"
+        fi
+        echo "$appAndCase: completed $completionTime"
+        return
+    else
+        echo "$appAndCase: unconfirmed completion"
     fi
-    echo "$appAndCase: completed $completionTime"
-    return
-else
-    echo "$appAndCase: unconfirmed completion"
-fi
 }
 
+
+# Recursively run all tutorials
+for application in *
+do
+    if [ -d $application ]
+    then
+        #(cd $application && ../runAll)
+        $WM_SCHEDULER "cd $PWD/$application && ../runAll"
+    fi
+done
+
+# Analyse all log files
 rm testLoopReport > /dev/null 2>&1 &
 touch testLoopReport
-for application in $applications
+for application in *
 do
-    cd $application
-    ./Allrun
-#    echo "$application application completed" >> ../testLoopReport
-    for log in `find . -name "log.*" | xargs ls -rt`
-    do
-        logReport $log >> ../testLoopReport
-    done
-    echo "" >> ../testLoopReport
-    cd ..
+    if [ -d $application ]
+    then
+        cd $application
+        for log in `find . -name "log.*" | xargs ls -rt`
+        do
+            logReport $log >> ../testLoopReport
+        done
+        echo "" >> ../testLoopReport
+        cd ..
+    fi
 done
 
 find . -name "log.*" -exec cat {} \; >> logs
diff --git a/tutorials/Alltest b/tutorials/Alltest
index 74e70dafefdcb4928a07e3f49069b29a9f9915e4..2817a861f28a6441218d9d2a894ef590bb16395e 100755
--- a/tutorials/Alltest
+++ b/tutorials/Alltest
@@ -65,7 +65,22 @@ EOF
 #
 # VARIABLE
 #
-MAIN_CONTROL_DICT=${WM_PROJECT_DIR}/${FOAM_DOT_DIR}/controlDict
+MAIN_CONTROL_DICT=
+: ${FOAM_DOT_DIR:=.$WM_PROJECT-$WM_PROJECT_VERSION}
+
+for i in \
+  $HOME/$FOAM_DOT_DIR \
+  $HOME/.$WM_PROJECT/$WM_PROJECT_VERSION \
+  $HOME/.$WM_PROJECT \
+  $WM_PROJECT_DIR/etc \
+  $WM_PROJECT_DIR/$FOAM_DOT_DIR \
+  ;
+do
+  if [ -f "$i/controlDict" ]; then
+     MAIN_CONTROL_DICT="$i/controlDict"
+     break
+  fi
+done
 TUTORIALS_DIR=.
 TEST_RUN_DIR=../tutorialsTest
 FV_SCHEMES=\
diff --git a/tutorials/CleanFunctions b/tutorials/CleanFunctions
index a5e9b7ebed4174d292d7bfc293d72b5ea236b8e5..e7895183e152ae1c65291317ad52a8b359258c08 100644
--- a/tutorials/CleanFunctions
+++ b/tutorials/CleanFunctions
@@ -38,33 +38,33 @@
 #    do
 #        if [ $T != "0" ] ; then
 #            echo "Deleting directory $T"
-#            rm -rf $1/${T} > /dev/null 2>&1
+#            rm -rf ${T} > /dev/null 2>&1
 #        fi
 #    done
-#    rm -rf $1/{log,log.*,log-*,logSummary.*,.fxLock,*.xml,ParaView*,paraFoam*,*.foam} > /dev/null 2>&1
+#    rm -rf {log,log.*,log-*,logSummary.*,.fxLock,*.xml,ParaView*,paraFoam*,*.foam} > /dev/null 2>&1
 #}
 
 cleanTimeDirectories ()
 {
-    echo "Cleaning $case case of $application application"
+    echo "Cleaning $PWD case"
     nZeros=0
     zeros=""
     while [ $nZeros -lt 8 ] ; do
         timeDir="0.${zeros}[1-9]*"
-        rm -rf $1/${timeDir} > /dev/null 2>&1
-        rm -rf $1/-${timeDir} > /dev/null 2>&1
+        rm -rf ${timeDir} > /dev/null 2>&1
+        rm -rf ./-${timeDir} > /dev/null 2>&1
         zeros=`printf %0${nZeros}d 0`
         nZeros=$(($nZeros + 1))
     done
-    rm -rf $1/{[1-9]*,-[1-9]*,log,log.*,log-*,logSummary.*,.fxLock,*.xml,ParaView*,paraFoam*,*.foam} > /dev/null 2>&1
+    rm -rf ./{[1-9]*,-[1-9]*,log,log.*,log-*,logSummary.*,.fxLock,*.xml,ParaView*,paraFoam*,*.foam} > /dev/null 2>&1
 }
 
 cleanCase ()
 {
-    cleanTimeDirectories $1
+    cleanTimeDirectories
 
-    rm -rf $1/constant/polyMesh/{allOwner*,cell*,face*,meshModifiers*} \
-           $1/constant/polyMesh/{owner*,neighbour*,point*,edge*} \ 
+    rm -rf constant/polyMesh/{allOwner*,cell*,face*,meshModifiers*} \
+           constant/polyMesh/{owner*,neighbour*,point*,edge*} \ 
            > /dev/null 2>&1
 
     for f in `find . -name "*Dict"`
@@ -76,25 +76,25 @@ cleanCase ()
 
 cleanParallelCase ()
 {
-    cleanCase $1
+    cleanCase
 
-    rm -rf $1/processor* > /dev/null 2>&1
+    rm -rf processor* > /dev/null 2>&1
 }
 
 removeCase ()
 {
-    echo "Removing $case case of $application application"
+    echo "Removing $case case"
     rm -rf $1
 }
 
 cleanSamples ()
 {
-    rm -rf $1/{samples,sampleSurfaces} > /dev/null 2>&1
+    rm -rf {samples,sampleSurfaces} > /dev/null 2>&1
 }
 
 cleanUcomponents ()
 {
-    rm -rf $1/0/{Ux,Uy,Uz} > /dev/null 2>&1
+    rm -rf 0/{Ux,Uy,Uz} > /dev/null 2>&1
 }
 
 #------------------------------------------------------------------------------
diff --git a/tutorials/MRFSimpleFoam/mixerVessel2D/Allclean b/tutorials/MRFSimpleFoam/mixerVessel2D/Allclean
new file mode 100755
index 0000000000000000000000000000000000000000..dd032d23aaca4780f53e79f320a2c93956caabd4
--- /dev/null
+++ b/tutorials/MRFSimpleFoam/mixerVessel2D/Allclean
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# Get application name from directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/CleanFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/CleanFunctions
+
+
+cleanCase
+wclean ../MRFSimpleFoam
diff --git a/tutorials/MRFSimpleFoam/mixerVessel2D/Allrun b/tutorials/MRFSimpleFoam/mixerVessel2D/Allrun
new file mode 100755
index 0000000000000000000000000000000000000000..8e10ba55a1330f5041b314adcd5096af345b32cc
--- /dev/null
+++ b/tutorials/MRFSimpleFoam/mixerVessel2D/Allrun
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# Get application name from directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/RunFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/RunFunctions
+
+
+compileApplication ../MRFSimpleFoam
+runApplication makeMesh
+runApplication $application
+
diff --git a/tutorials/README.txt b/tutorials/README.txt
new file mode 100644
index 0000000000000000000000000000000000000000..a98300a74fd61263dc20821c83662633549018fe
--- /dev/null
+++ b/tutorials/README.txt
@@ -0,0 +1,129 @@
+To run all               : Allrun
+To run all one iteration : Alltest
+To clean all             : Allclean
+
+The structure now is that a case that only requires blockMesh
+and application does not need an Allrun or Allclean script.
+Only if running is special it requires an Allrun. Similarly
+if cleaning is non-standard.
+
+
+                                run clean
+boundaryFoam
+    boundaryLaunderSharma       ok
+    boundaryWallFunctions       ok
+bubbleFoam
+    bubbleColumn                ok
+buoyantFoam
+    hotRoom                     ok
+buoyantSimpleFoam
+    hotRoom                     ok
+buoyantSimpleRadiationFoam
+    hotRadiationRoom            ok
+cavitatingFoam
+    nozzle2D                    No cavitatingFoam solver.
+channelOodles
+    channel395                  ok
+coodles
+    pitzDaily                   ok
+dieselFoam
+    aachenBomb
+dnsFoam
+    boxTurb16
+electrostaticFoam
+    chargedWire                 ok
+engineFoam
+    kivaTest
+financialFoam
+    europeanCall                ok
+icoDyMFoam
+    movingCone                  ok  ok
+icoFoam
+    cavity                      ok  ok
+    cavityFine                  ok  ok
+    cavityGrade                 ok  ok
+    cavityHighRe                ok  ok
+    cavityClipped               ok  ok
+    elbow                       ok  ok
+interDyMFoam
+    damBreakWithObstacle        ok  ok
+interFoam
+    damBreak                    ok  ok
+    damBreakFine                ok  ok
+laplacianFoam
+    flange                      ok  ok
+lesInterFoam
+    nozzleFlow2D
+mdEquilibrationFoam
+    periodicCube
+mhdFoam                         ok
+    hartmann
+MRFSimpleFoam
+    mixerVessel2D
+multiphaseInterFoam
+    damBreak4phase
+    damBreak4phaseFine
+nonNewtonianIcoFoam
+    offsetCylinder
+oodles
+    pitzDaily
+    pitzDailyDirectMapped
+potentialFoam
+    cylinder
+    pitzDaily
+rasInterFoam
+    damBreak
+    damBreakFine
+rhoPimpleFoam
+    angledDuct
+rhoPorousSimpleFoam
+    angledDuctExplicit
+    angledDuctImplicit
+rhopSonicFoam
+    shockTube
+    wedge15Ma5
+rhoSonicFoam
+    forwardStep
+    shockTube               No setShock application
+rhoTurbFoam
+    cavity
+rhoTurbTwinParcelFoam
+    simplifiedSiwek
+scalarTransportFoam
+    pitzDaily
+settlingFoam
+    dahl
+    tank3D
+simpleFoam
+    pitzDaily
+    pitzDaily3Blocks
+    pitzDailyExptInlet
+simpleSRFFoam
+    mixer
+    simpleSRFFoam
+solidDisplacementFoam
+    plateHole
+solidEquilibriumDisplacementFoam
+    beamEndLoad
+sonicFoam
+    forwardStep
+    shockTube
+sonicLiquidFoam
+    decompressionTank
+    decompressionTankFine
+sonicTurbFoam
+    nacaAirfoil
+    prism
+turbFoam
+    cavity
+twoPhaseEulerFoam
+    bed
+    bed2
+    bubbleColumn
+XiFoam
+    moriyoshiHomogeneous
+    moriyoshiHomogeneousPart2
+Xoodles
+    pitzDaily
+    pitzDaily3D
+
diff --git a/tutorials/RunFunctions b/tutorials/RunFunctions
index 910a01c0a6d546942eebfd2dcfceaa84247e6730..64cc1ae4e59c910c49708499b117a6fb81fd5546 100644
--- a/tutorials/RunFunctions
+++ b/tutorials/RunFunctions
@@ -33,31 +33,29 @@
 runApplication ()
 {
     APP_RUN=$1; shift
-    dir=$1; shift
 
-    if [ -f $dir/log.$APP_RUN ] ; then
-        echo "$APP_RUN already run on $dir: remove log file to run"
+    if [ -f log.$APP_RUN ] ; then
+        echo "$APP_RUN already run on $PWD: remove log file to run"
     else
-        echo "Running $APP_RUN on $dir"
-        ( cd $dir && $APP_RUN $* > log.$APP_RUN 2>&1 )
+        echo "Running $APP_RUN on $PWD"
+        $APP_RUN $* > log.$APP_RUN 2>&1
     fi
 }
 
 runParallel ()
 {
     APP_RUN=$1; shift
-    dir=$2; shift
 
-    if [ -f $dir/log.$APP_RUN ] ; then
-        echo "$APP_RUN already run on $dir: remove log file to run"
+    if [ -f $log.$APP_RUN ] ; then
+        echo "$APP_RUN already run on $PWD: remove log file to run"
     else
         if [ "$WM_MPLIB" = LAM ]
         then
             echo "Starting LAM using $2 machines file"
             lamboot -v $2
         fi
-        echo "Running $APP_RUN in parallel on $dir using $1 processes"
-        ( cd $dir && mpirun -np $1 $APP_RUN -parallel < /dev/null > log.$APP_RUN 2>&1 )
+        echo "Running $APP_RUN in parallel on $PWD using $1 processes"
+        ( mpirun -np $1 $APP_RUN -parallel < /dev/null > log.$APP_RUN 2>&1 )
         if [ "$WM_MPLIB" = LAM ]
         then
             echo "Stopping LAM"
@@ -68,8 +66,8 @@ runParallel ()
 
 compileApplication ()
 {
-    echo "Compiling $1/$2 application"
-    wmake $1/$2
+    echo "Compiling $1 application"
+    wmake $1
 }
 
 cloneCase ()
diff --git a/tutorials/XiFoam/Allclean b/tutorials/XiFoam/Allclean
index e7edc11dc64b6038d5095c06ac20e60e2f50d91b..38c9de21bc41a3c5ed7a2938a9ea1f57096e848d 100755
--- a/tutorials/XiFoam/Allclean
+++ b/tutorials/XiFoam/Allclean
@@ -1,16 +1,26 @@
 #!/bin/sh
 
-currDir=`pwd`
-application=`basename $currDir`
+# Get application name from directory
+application=`basename $PWD`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/CleanFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/CleanFunctions
+
+
+
+
 keepCases="moriyoshiHomogeneous"
 loseCases="moriyoshiHomogeneousPart2"
 
-tutorialPath=`dirname $0`/..
-. $tutorialPath/CleanFunctions
 
 for case in $keepCases
 do
-    cleanCase $case
+    (cd $case && $tutorialsDir/cleanAll)
 done
 
 for case in $loseCases
diff --git a/tutorials/XiFoam/Allrun b/tutorials/XiFoam/Allrun
index 78eac11c897ef71d9cd68311136694f9cf6603bc..2cb966a848dfb57836cab946dcf92b10e0fcced3 100755
--- a/tutorials/XiFoam/Allrun
+++ b/tutorials/XiFoam/Allrun
@@ -1,14 +1,20 @@
 #!/bin/sh
 
-currDir=`pwd`
-application=`basename $currDir`
-cases="moriyoshiHomogeneous moriyoshiHomogeneousPart2"
+# Get application name from directory
+application=`basename $PWD`
 
-tutorialPath=`dirname $0`/..
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/RunFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
 . $tutorialPath/RunFunctions
 
+
+
 setControlDict () {
-    controlDict="$case/system/controlDict"
+    controlDict="system/controlDict"
     sed \
     -e s/"\(deltaT[ \t]*\) 5e-06;"/"\1 1e-05;"/g \
     -e s/"\(endTime[ \t]*\) 0.005;"/"\1 0.015;"/g \
@@ -17,14 +23,17 @@ setControlDict () {
     mv temp.$$ $controlDict    
 }
 
-for case in $cases
-do
-    if [ "$case" = "moriyoshiHomogeneousPart2" ] ; then
-        cloneCase moriyoshiHomogeneous $case
-        cp -r moriyoshiHomogeneous/0.005 $case
-        setControlDict
-    else
-        runApplication blockMesh $case
-    fi
-    runApplication $application $case
-done
+
+
+# Do moriyoshiHomogeneous
+(cd moriyoshiHomogeneous && $tutorialPath/runAll)
+
+# Clone case
+cloneCase moriyoshiHomogeneous moriyoshiHomogeneousPart2
+# Modify and execute
+cd moriyoshiHomogeneousPart2
+    cp -r ../moriyoshiHomogeneous/0.005 .
+    setControlDict
+    runApplication $application
+cd ..
+
diff --git a/tutorials/buoyantFoam/hotRoom/Allclean b/tutorials/buoyantFoam/hotRoom/Allclean
new file mode 100755
index 0000000000000000000000000000000000000000..26ee1b2ae126de9c32eb7068a1525ac1e133f804
--- /dev/null
+++ b/tutorials/buoyantFoam/hotRoom/Allclean
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# Get application name from directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/CleanFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/CleanFunctions
+
+
+
+cleanCase
+cp 0/T.org 0/T
+wclean setHotRoom    
diff --git a/tutorials/buoyantFoam/hotRoom/Allrun b/tutorials/buoyantFoam/hotRoom/Allrun
new file mode 100755
index 0000000000000000000000000000000000000000..5007687033040e1143b37f67a2eae5543a48c5f6
--- /dev/null
+++ b/tutorials/buoyantFoam/hotRoom/Allrun
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# Get application name from directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/RunFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/RunFunctions
+
+
+compileApplication setHotRoom
+runApplication blockMesh
+runApplication setHotRoom
+runApplication $application
diff --git a/tutorials/buoyantFoam/hotRoom/system/controlDict b/tutorials/buoyantFoam/hotRoom/system/controlDict
index 8f889c994198d3e34618c1ec6c80704e75bfd318..655a98b4d4d191a3e9069e2215189d4ea6fa9bc4 100644
--- a/tutorials/buoyantFoam/hotRoom/system/controlDict
+++ b/tutorials/buoyantFoam/hotRoom/system/controlDict
@@ -24,7 +24,7 @@ FoamFile
 
 application buoyantFoam;
 
-startFrom       latestTime;
+startFrom       startTime;
 
 startTime       0;
 
diff --git a/tutorials/buoyantFoam/hotRoom/system/fvSolution b/tutorials/buoyantFoam/hotRoom/system/fvSolution
index 399464b4e4a1f1bcc12f7f9cf3c915e9c25d82c0..c04ea071339394f73d8a40aec661f9b757bedb77 100644
--- a/tutorials/buoyantFoam/hotRoom/system/fvSolution
+++ b/tutorials/buoyantFoam/hotRoom/system/fvSolution
@@ -31,6 +31,12 @@ solvers
         relTol           0;
     };
     pd PCG
+    {
+        preconditioner   DIC;
+        tolerance        1e-06;
+        relTol           0.1;
+    };
+    pdFinal PCG
     {
         preconditioner   DIC;
         tolerance        1e-06;
diff --git a/tutorials/buoyantSimpleFoam/hotRoom/Allclean b/tutorials/buoyantSimpleFoam/hotRoom/Allclean
new file mode 100755
index 0000000000000000000000000000000000000000..e8e689b4577472655da557cb6d9b2a84b675b1cc
--- /dev/null
+++ b/tutorials/buoyantSimpleFoam/hotRoom/Allclean
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# Get application name from directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/CleanFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/CleanFunctions
+
+
+cleanCase
+cp 0/T.org 0/T
+wclean ../../buoyantFoam/hotRoom/setHotRoom
diff --git a/tutorials/buoyantSimpleFoam/hotRoom/Allrun b/tutorials/buoyantSimpleFoam/hotRoom/Allrun
new file mode 100755
index 0000000000000000000000000000000000000000..9ebb5a17cf2f7538c8f6c768b740f3d9bedcf532
--- /dev/null
+++ b/tutorials/buoyantSimpleFoam/hotRoom/Allrun
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# Get application directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/RunFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/RunFunctions
+
+
+
+compileApplication ../../buoyantFoam/hotRoom/setHotRoom
+runApplication blockMesh
+runApplication setHotRoom
+runApplication $application
diff --git a/tutorials/channelOodles/channel395/Allrun b/tutorials/channelOodles/channel395/Allrun
new file mode 100755
index 0000000000000000000000000000000000000000..c6d6ce7d73bd2a45a115f78055dbfdd52a13dae7
--- /dev/null
+++ b/tutorials/channelOodles/channel395/Allrun
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# Get application directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/RunFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/RunFunctions
+
+
+
+runApplication blockMesh
+runApplication $application
+runApplication postChannel
+
diff --git a/tutorials/cleanAll b/tutorials/cleanAll
new file mode 100755
index 0000000000000000000000000000000000000000..d88c49c5d766232a9e55ac5f16c28ce48c9dac64
--- /dev/null
+++ b/tutorials/cleanAll
@@ -0,0 +1,67 @@
+#!/bin/sh
+#------------------------------------------------------------------------------
+# =========                 |
+# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+#  \\    /   O peration     |
+#   \\  /    A nd           | Copyright (C) 1991-2007 OpenCFD Ltd.
+#    \\/     M anipulation  |
+#------------------------------------------------------------------------------
+# License
+#     This file is part of OpenFOAM.
+#
+#     OpenFOAM is free software; you can redistribute it and/or modify it
+#     under the terms of the GNU General Public License as published by the
+#     Free Software Foundation; either version 2 of the License, or (at your
+#     option) any later version.
+#
+#     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+#     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+#     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+#     for more details.
+#
+#     You should have received a copy of the GNU General Public License
+#     along with OpenFOAM; if not, write to the Free Software Foundation,
+#     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Script
+#     cleanAll
+#
+# Description
+#       Run either Allclean or default cleanCase in current directory
+#       and all its subdirectories.
+#
+#------------------------------------------------------------------------------
+
+tutorialsDir=$PWD
+while [ ! -f $tutorialsDir/CleanFunctions ]
+do
+    tutorialsDir="$tutorialsDir/.."
+done
+. $tutorialsDir/CleanFunctions
+
+thisScript=$0
+if [ "/${thisScript#/}" != "$thisScript" ]
+then
+    thisScript="$PWD/$thisScript"
+fi
+
+if [ -f "./Allclean" ] 
+then
+    # Specialised script.
+    ./Allclean
+elif [ -d "./system" ]
+then
+    # Normal case. 
+    cleanCase
+else
+    # Recurse to subdirectories
+    for case in *
+    do
+        if [ -d $case ]
+        then
+            (cd $case && $thisScript)
+        fi
+    done
+fi
+
+#------------------------------------------------------------------------------
diff --git a/tutorials/dnsFoam/boxTurb16/Allclean b/tutorials/dnsFoam/boxTurb16/Allclean
new file mode 100755
index 0000000000000000000000000000000000000000..a73d9b8d55ae49c9c4f10aff2d73a3344e35d590
--- /dev/null
+++ b/tutorials/dnsFoam/boxTurb16/Allclean
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# Get application name from directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/CleanFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/CleanFunctions
+
+
+cleanCase
+rm -rf 0
+cp -r 0.org 0
diff --git a/tutorials/dnsFoam/boxTurb16/Allrun b/tutorials/dnsFoam/boxTurb16/Allrun
new file mode 100755
index 0000000000000000000000000000000000000000..c2effc61b731dc6b8dd753431fb0ac9a2c3cfab7
--- /dev/null
+++ b/tutorials/dnsFoam/boxTurb16/Allrun
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# Get application directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/RunFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/RunFunctions
+
+
+runApplication blockMesh
+runApplication boxTurb
+runApplication $application
+runApplication enstrophy
diff --git a/tutorials/engineFoam/kivaTest/Allclean b/tutorials/engineFoam/kivaTest/Allclean
new file mode 100755
index 0000000000000000000000000000000000000000..5b26a4fd0bc409ab1f0fcb94378915aed7d21aec
--- /dev/null
+++ b/tutorials/engineFoam/kivaTest/Allclean
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+# Get application name from directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/CleanFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/CleanFunctions
+
+
+
+mv ./-180 temp180
+rm -rf 0
+cp system/controlDict.1st system/controlDict
+cleanCase
+mv temp180 ./-180
diff --git a/tutorials/engineFoam/kivaTest/Allrun b/tutorials/engineFoam/kivaTest/Allrun
new file mode 100755
index 0000000000000000000000000000000000000000..5193519075044107724d1a0f673a56264890543d
--- /dev/null
+++ b/tutorials/engineFoam/kivaTest/Allrun
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+# Get application name from directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/RunFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/RunFunctions
+
+
+
+runKivaToFoam ()
+{
+    if [ -f log.kivaToFoam ] ; then
+        echo "kivaToFoam already run on $PWD: remove log file to run"
+    else
+        echo "kivaToFoam: converting kiva file"
+        kivaToFoam -file $1 > log.kivaToFoam 2>&1
+    fi
+}
+
+restartApplication ()
+{
+    if [ -f log-2.$1 ] ; then
+        echo "$1 already run on $PWD: remove log file to run"
+    else
+        echo "Running $1 on $PWD"
+        $1 > log-2.$1 2>&1
+    fi
+}
+
+
+
+runKivaToFoam . $case/otape17
+cp system/controlDict.1st system/controlDict
+runApplication $application
+cp system/controlDict.2nd system/controlDict
+restartApplication $application
diff --git a/tutorials/icoFoam/Allclean b/tutorials/icoFoam/Allclean
index dd254664cdb3d36fb061a14621aa23fcbd5e3470..5aa80a4f3f1c6939db5ad7349552666978ca6fc4 100755
--- a/tutorials/icoFoam/Allclean
+++ b/tutorials/icoFoam/Allclean
@@ -2,15 +2,24 @@
 
 currDir=`pwd`
 application=`basename $currDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/CleanFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/CleanFunctions
+
+
 keepCases="cavity cavityGrade cavityClipped elbow"
 loseCases="cavityFine cavityHighRe"
 
-tutorialPath=`dirname $0`/..
-. $tutorialPath/CleanFunctions
 
 for case in $keepCases
 do
-    cleanCase $case
+    (cd $case && $tutorialPath/cleanAll)
+
     if [ "$case" = "elbow" ]
     then
         rm -rf $case/fluentInterface
diff --git a/tutorials/icoFoam/Allrun b/tutorials/icoFoam/Allrun
index 8588970cb771a53bdb866923319befde40893b09..dbadedb88e940cb22fd23a2138964935b5cfac57 100755
--- a/tutorials/icoFoam/Allrun
+++ b/tutorials/icoFoam/Allrun
@@ -10,19 +10,19 @@ tutorialPath=`dirname $0`/..
 runMapFields ()
 {
     echo "Running mapFields from $1 to $2"
-    mapFields . $1 . $2 > $2/log.mapFields 2>&1
+    mapFields -source $1 -case $2 -sourceTime latestTime > $2/log.mapFields 2>&1
 }
 
 runMapFieldsConsistent ()
 {
     echo "Running mapFields from $1 to $2"
-    mapFields . $1 . $2 -consistent > $2/log.mapFields 2>&1
+    mapFields -source $1 -case $2 -sourceTime latestTime -consistent > $2/log.mapFields 2>&1
 }
 
 runFluentMeshToFoam ()
 {
     echo "fluentMeshToFoam: converting mesh $2"
-    fluentMeshToFoam . $1 $2 > $1/log.fluentMeshToFoam 2>&1
+    fluentMeshToFoam $2 -case $1 > $1/log.fluentMeshToFoam 2>&1
 }
 
 copySolutionDirs ()
@@ -34,7 +34,7 @@ copySolutionDirs ()
 setCavityFine ()
 {
     blockMeshDict="$case/constant/polyMesh/blockMeshDict"
-    controlDict="$case/system/controlDict"        
+    controlDict="$case/system/controlDict"
     sed s/"20 20 1"/"41 41 1"/g $blockMeshDict > temp.$$
     mv temp.$$ $blockMeshDict
     sed \
@@ -44,13 +44,13 @@ setCavityFine ()
     -e s/"\(writeControl[ \t]*\) timeStep;"/"\1 runTime;"/g \
     -e s/"\(writeInterval[ \t]*\) 20;"/"\1 0.1;"/g \
     $controlDict > temp.$$
-    mv temp.$$ $controlDict    
+    mv temp.$$ $controlDict
 }
 
 setCavityHighRe ()
 {
     echo "Setting cavityHighRe to generate a secondary vortex"
-    controlDict="$case/system/controlDict"        
+    controlDict="$case/system/controlDict"
     transportProperties="$case/constant/transportProperties"
     sed \
     -e s/"\(startFrom[ \t]*\) startTime;"/"\1 latestTime;"/g \
@@ -63,27 +63,27 @@ setCavityHighRe ()
 
 for case in $cavityCases
 do
-    if [ "$case" = "cavityFine" ] 
+    if [ "$case" = "cavityFine" ]
     then
-        cloneCase cavity $case 
+        cloneCase cavity $case
         setCavityFine
     fi
 
-    if [ "$case" = "cavityHighRe" ] 
+    if [ "$case" = "cavityHighRe" ]
     then
-        cloneCase cavity $case 
+        cloneCase cavity $case
         setCavityHighRe
         copySolutionDirs $case cavity
     fi
 
-    runApplication blockMesh $case
+    (cd $case && runApplication blockMesh)
 #
-    if [ "$case" = "cavityFine" -o "$case" = "cavityGrade" ] 
+    if [ "$case" = "cavityFine" -o "$case" = "cavityGrade" ]
     then
         runMapFieldsConsistent $previousCase $case
     fi
 
-    if [ "$case" = "cavityClipped" ] 
+    if [ "$case" = "cavityClipped" ]
     then
         cp -r $case/0 $case/0.5
         runMapFields cavity $case
@@ -96,13 +96,13 @@ do
 #
     previousCase="$case"
 #
-    runApplication $application $case
-done 
+    (cd $case && runApplication $application)
+done
 
 # elbow case for testing Fluent-FOAM conversion tools
 
 runFluentMeshToFoam elbow elbow/elbow.msh
-runApplication icoFoam elbow
-runApplication foamMeshToFluent elbow
-runApplication foamDataToFluent elbow
+(cd elbow && runApplication $application)
+(cd elbow && runApplication foamMeshToFluent)
+(cd elbow && runApplication foamDataToFluent)
 
diff --git a/tutorials/interDyMFoam/damBreakWithObstacle/Allrun b/tutorials/interDyMFoam/damBreakWithObstacle/Allrun
new file mode 100755
index 0000000000000000000000000000000000000000..a04fee0ed7b04bcc03251253c54fc3f0ec897858
--- /dev/null
+++ b/tutorials/interDyMFoam/damBreakWithObstacle/Allrun
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# Get application directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/RunFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/RunFunctions
+
+
+runApplication blockMesh
+runApplication setSet -batch createObstacle.setSet
+runApplication subsetMesh c0 -patch walls
+runApplication setFields -latestTime
+runApplication $application
diff --git a/tutorials/interFoam/Allclean b/tutorials/interFoam/Allclean
index 0fb4e14285f359d555a2b4f9c0f807fee5f4dde1..2d4ceec108ab7245d24530ce68bccfff37fc1729 100755
--- a/tutorials/interFoam/Allclean
+++ b/tutorials/interFoam/Allclean
@@ -1,16 +1,26 @@
 #!/bin/sh
 
-currDir=`pwd`
-application=`basename $currDir`
+# Get application name from directory
+application=`basename $PWD`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/CleanFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/CleanFunctions
+
+
+
 keepCases="damBreak"
 loseCases="damBreakFine"
 
-tutorialPath=`dirname $0`/..
-. $tutorialPath/CleanFunctions
 
 for case in $keepCases
 do
-    cleanCase $case
+    (cd $case && $tutorialPath/cleanAll)
+
     if [ "$case" = "damBreak" ] 
     then 
         cp $case/0/gamma.org $case/0/gamma
diff --git a/tutorials/interFoam/Allrun b/tutorials/interFoam/Allrun
index 7241d04e6913cd632bc83c66325cfafe611de50e..6a48764bfebabfa29a5fe6285653758ed3cd2874 100755
--- a/tutorials/interFoam/Allrun
+++ b/tutorials/interFoam/Allrun
@@ -1,16 +1,21 @@
 #!/bin/sh
 
-currDir=`pwd`
-application=`basename $currDir`
-cases="damBreak damBreakFine"
+# Get application name from directory
+application=`basename $PWD`
 
-tutorialPath=`dirname $0`/..
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/RunFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
 . $tutorialPath/RunFunctions
 
+
 setDamBreakFine ()
 {
-    blockMeshDict="$case/constant/polyMesh/blockMeshDict"
-    controlDict="$case/system/controlDict"        
+    blockMeshDict="constant/polyMesh/blockMeshDict"
+    controlDict="system/controlDict"        
     sed \
     -e s/"23 8"/"46 10"/g \
     -e s/"19 8"/"40 10"/g \
@@ -26,24 +31,23 @@ setDamBreakFine ()
     mv temp.$$ $controlDict    
 }
 
-for case in $cases
-do
-    if [ "$case" = "damBreakFine" ] 
-    then
-        cloneCase damBreak $case
-        setDamBreakFine
-        cp damBreak/0/gamma.org $case/0/gamma
-    fi
-
-    runApplication blockMesh $case
-    runApplication setFields $case
-    if [ "$case" = "damBreakFine" ]
-    then
-        runApplication decomposePar $case
-        hostname > $case/system/machines
-        runParallel $application $case 4 $case/system/machines
-        runApplication reconstructPar $case
-    else
-        runApplication $application $case
-    fi
-done
+
+
+# Do damBreak
+(cd damBreak && $tutorialPath/runAll)
+
+# Clone case
+cloneCase damBreak damBreakFine
+
+cd damBreakFine
+    # Modify case
+    setDamBreakFine
+    cp ../damBreak/0/gamma.org 0/gamma
+    # And execute
+    runApplication blockMesh
+    runApplication setFields
+    runApplication decomposePar
+    hostname > system/machines
+    runParallel $application 4 system/machines
+    runApplication reconstructPar
+cd ..
diff --git a/tutorials/laplacianFoam/flange/Allclean b/tutorials/laplacianFoam/flange/Allclean
new file mode 100755
index 0000000000000000000000000000000000000000..798298762a17e63a4143e42763b9b4f38dd9acd1
--- /dev/null
+++ b/tutorials/laplacianFoam/flange/Allclean
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# Get application name from directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/CleanFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/CleanFunctions
+
+
+cleanCase
+rm -rf Fieldview > /dev/null 2>&1
+rm -rf EnSight > /dev/null 2>&1
+
diff --git a/tutorials/laplacianFoam/flange/Allrun b/tutorials/laplacianFoam/flange/Allrun
new file mode 100755
index 0000000000000000000000000000000000000000..2bb1213785ad3ac5a2a79ac64dca6df647709c71
--- /dev/null
+++ b/tutorials/laplacianFoam/flange/Allrun
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# Get application directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/RunFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/RunFunctions
+
+
+
+runIdeasToFoam ()
+{
+    if [ -f log.ideasToFoam ] ; then
+        echo "ansysToFoam already run on $PWD: remove log file to run"
+    else
+        echo "ansysToFoam: converting mesh $1"
+        ansysToFoam $1 -scale $2 > log.ansysToFoam 2>&1
+    fi
+}
+
+runIdeasToFoam flange.ans 0.001
+runApplication $application
+runApplication foamToFieldview
+runApplication foamToEnsight
diff --git a/tutorials/lesInterFoam/nozzleFlow2D/Allclean b/tutorials/lesInterFoam/nozzleFlow2D/Allclean
new file mode 100755
index 0000000000000000000000000000000000000000..26e6f5985fa43fdf9ab6f84d15bfa1294c309e46
--- /dev/null
+++ b/tutorials/lesInterFoam/nozzleFlow2D/Allclean
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# Get application name from directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/CleanFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/CleanFunctions
+
+
+
+cleanCase
+cp constant/polyMesh/boundary.org constant/polyMesh/boundary
diff --git a/tutorials/lesInterFoam/nozzleFlow2D/Allrun b/tutorials/lesInterFoam/nozzleFlow2D/Allrun
new file mode 100755
index 0000000000000000000000000000000000000000..ebeb94443d3566ea202fa0d484239406b8551402
--- /dev/null
+++ b/tutorials/lesInterFoam/nozzleFlow2D/Allrun
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+# Get application name from directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/RunFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/RunFunctions
+
+
+
+runRefineMesh ()
+{
+    echo "Running refineMesh on $PWD"
+    refineMesh -dict > log.refineMesh 2>&1
+}
+
+runApplication blockMesh
+
+i=1
+if [ -f log.cellSet ] ; then
+   i=3
+fi
+while [ "$i" -lt 3 ] ; do
+    if [ -f log.cellSet ] ; then
+        mv log.cellSet log.cellSet.1
+    fi
+    cp system/cellSetDict.${i} system/cellSetDict
+    runApplication cellSet
+    runRefineMesh
+    cp -r 1e-08/polyMesh/* constant/polyMesh
+    rm -rf 1e-08
+    i=`expr $i + 1`
+done
+cp constant/polyMesh/boundary.org constant/polyMesh/boundary
+
+runApplication $application
diff --git a/tutorials/mdEquilibrationFoam/periodicCube/Allrun b/tutorials/mdEquilibrationFoam/periodicCube/Allrun
new file mode 100755
index 0000000000000000000000000000000000000000..5ce9785b9db8af0e59f8f3fda65c013259932fbb
--- /dev/null
+++ b/tutorials/mdEquilibrationFoam/periodicCube/Allrun
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# Get application name from directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/RunFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/RunFunctions
+
+
+runApplication blockMesh
+runApplication molConfig
+runApplication $application
diff --git a/tutorials/mhdFoam/hartmann/Allclean b/tutorials/mhdFoam/hartmann/Allclean
new file mode 100755
index 0000000000000000000000000000000000000000..f38a025731d6597b3409b38bd2e75d103842b242
--- /dev/null
+++ b/tutorials/mhdFoam/hartmann/Allclean
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# Get application name from directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/CleanFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/CleanFunctions
+
+
+cleanCase
+cleanSamples
+
diff --git a/tutorials/mhdFoam/hartmann/Allrun b/tutorials/mhdFoam/hartmann/Allrun
new file mode 100755
index 0000000000000000000000000000000000000000..2a26afc937b200a85f74bb0b502ab4c551e2ba46
--- /dev/null
+++ b/tutorials/mhdFoam/hartmann/Allrun
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# Get application name from directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/RunFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/RunFunctions
+
+
+
+runApplication blockMesh
+runApplication $application
+runApplication sample
diff --git a/tutorials/oodles/pitzDailyDirectMapped/Allrun b/tutorials/oodles/pitzDailyDirectMapped/Allrun
new file mode 100755
index 0000000000000000000000000000000000000000..23d7ad3f33dc17aa68442dcd026c47ee1fa4de9a
--- /dev/null
+++ b/tutorials/oodles/pitzDailyDirectMapped/Allrun
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# Get application name from directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/RunFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/RunFunctions
+
+
+runApplication blockMesh
+runApplication changeDictionary
+runApplication $application
diff --git a/tutorials/potentialFoam/Allclean b/tutorials/potentialFoam/Allclean
index f27b164c010cf8a471bb1c4de12e279f3f022b29..4884a02756c82e540ac7d37f8313ed9295d2d814 100755
--- a/tutorials/potentialFoam/Allclean
+++ b/tutorials/potentialFoam/Allclean
@@ -1,23 +1,29 @@
 #!/bin/sh
 
-currDir=`pwd`
-application=`basename $currDir`
-cases="cylinder pitzDaily"
-utility=analyticalCylinder
+# Get application name from directory
+application=`basename $PWD`
 
-tutorialPath=`dirname $0`/..
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/CleanFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
 . $tutorialPath/CleanFunctions
 
-for case in $cases
-do
-    cleanCase $case
-    rm -rf $case/0 > /dev/null 2>&1
-    cp -r $case/0.org $case/0
 
-    if [ "$case" = "cylinder" ] 
-    then
-        wclean $case/$utility
-    fi
-done 
 
 
+cd cylinder
+    cleanCase
+    rm -rf 0 > /dev/null 2>&1
+    cp -r 0.org 0
+    wclean analyticalCylinder
+cd ..
+
+cd pitzDaily
+    cleanCase
+    rm -rf 0 > /dev/null 2>&1
+    cp -r 0.org 0
+cd ..
+
diff --git a/tutorials/potentialFoam/cylinder/Allrun b/tutorials/potentialFoam/cylinder/Allrun
new file mode 100755
index 0000000000000000000000000000000000000000..8a5b56e9f742f8cd446526914a33a2279f8c9f14
--- /dev/null
+++ b/tutorials/potentialFoam/cylinder/Allrun
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# Get application name from directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/RunFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/RunFunctions
+
+
+runApplication blockMesh
+runApplication $application
+compileApplication analyticalCylinder
+runApplication analyticalCylinder
+runApplication streamFunction
diff --git a/tutorials/potentialFoam/pitzDaily/Allrun b/tutorials/potentialFoam/pitzDaily/Allrun
new file mode 100755
index 0000000000000000000000000000000000000000..e3c90d9c8a7a86ba36cc6b8f1ce9e4feb67677bd
--- /dev/null
+++ b/tutorials/potentialFoam/pitzDaily/Allrun
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# Get application name from directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath='.'
+while [ ! -f $tutorialPath/RunFunctions ]
+do
+    tutorialPath="../$tutorialPath"
+done
+. $tutorialPath/RunFunctions
+
+
+runApplication blockMesh
+runApplication $application
+runApplication streamFunction
diff --git a/tutorials/rasInterFoam/Allclean b/tutorials/rasInterFoam/Allclean
index 0fb4e14285f359d555a2b4f9c0f807fee5f4dde1..1927e695d5363b99cbf83bad22dfacc5169f0316 100755
--- a/tutorials/rasInterFoam/Allclean
+++ b/tutorials/rasInterFoam/Allclean
@@ -1,16 +1,25 @@
 #!/bin/sh
 
-currDir=`pwd`
-application=`basename $currDir`
-keepCases="damBreak"
-loseCases="damBreakFine"
+# Get application name from directory
+application=`basename $PWD`
 
-tutorialPath=`dirname $0`/..
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/CleanFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
 . $tutorialPath/CleanFunctions
 
+
+
+keepCases="damBreak"
+loseCases="damBreakFine"
+
 for case in $keepCases
 do
-    cleanCase $case
+    (cd $case && $tutorialPath/cleanAll)
+
     if [ "$case" = "damBreak" ] 
     then 
         cp $case/0/gamma.org $case/0/gamma
diff --git a/tutorials/rasInterFoam/Allrun b/tutorials/rasInterFoam/Allrun
index 7241d04e6913cd632bc83c66325cfafe611de50e..e189c4ee951458417f34872f87e42f4be1c0376a 100755
--- a/tutorials/rasInterFoam/Allrun
+++ b/tutorials/rasInterFoam/Allrun
@@ -1,16 +1,22 @@
 #!/bin/sh
 
-currDir=`pwd`
-application=`basename $currDir`
-cases="damBreak damBreakFine"
+# Get application name from directory
+application=`basename $PWD`
 
-tutorialPath=`dirname $0`/..
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/RunFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
 . $tutorialPath/RunFunctions
 
+
+
 setDamBreakFine ()
 {
-    blockMeshDict="$case/constant/polyMesh/blockMeshDict"
-    controlDict="$case/system/controlDict"        
+    blockMeshDict="constant/polyMesh/blockMeshDict"
+    controlDict="system/controlDict"        
     sed \
     -e s/"23 8"/"46 10"/g \
     -e s/"19 8"/"40 10"/g \
@@ -26,24 +32,22 @@ setDamBreakFine ()
     mv temp.$$ $controlDict    
 }
 
-for case in $cases
-do
-    if [ "$case" = "damBreakFine" ] 
-    then
-        cloneCase damBreak $case
-        setDamBreakFine
-        cp damBreak/0/gamma.org $case/0/gamma
-    fi
-
-    runApplication blockMesh $case
-    runApplication setFields $case
-    if [ "$case" = "damBreakFine" ]
-    then
-        runApplication decomposePar $case
-        hostname > $case/system/machines
-        runParallel $application $case 4 $case/system/machines
-        runApplication reconstructPar $case
-    else
-        runApplication $application $case
-    fi
-done
+
+# Do damBreak
+(cd damBreak && $tutorialPath/runAll)
+
+# Clone case
+cloneCase damBreak damBreakFine
+
+cd damBreakFine
+    # Modify case
+    setDamBreakFine
+    cp ../damBreak/0/gamma.org 0/gamma
+    # And execute
+    runApplication blockMesh
+    runApplication setFields
+    runApplication decomposePar
+    hostname > system/machines
+    runParallel $application 4 system/machines
+    runApplication reconstructPar
+cd ..
diff --git a/tutorials/rasInterFoam/damBreak/Allrun b/tutorials/rasInterFoam/damBreak/Allrun
new file mode 100755
index 0000000000000000000000000000000000000000..a4037c0c44951ee81cf52c9bebc86640127c818a
--- /dev/null
+++ b/tutorials/rasInterFoam/damBreak/Allrun
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+
+# Get application name from directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/RunFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/RunFunctions
+
+
+runApplication blockMesh
+runApplication setFields
+runApplication $application
diff --git a/tutorials/rhoSonicFoam/shockTube/Allclean b/tutorials/rhoSonicFoam/shockTube/Allclean
new file mode 100755
index 0000000000000000000000000000000000000000..f9a35ccec831111dc417da1b28939bd6aa705cbd
--- /dev/null
+++ b/tutorials/rhoSonicFoam/shockTube/Allclean
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# Get application name from directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/CleanFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/CleanFunctions
+
+
+
+cleanCase
+rm -rf 0
+cp -r 0.org 0
+cleanSamples
diff --git a/tutorials/rhoSonicFoam/shockTube/Allrun b/tutorials/rhoSonicFoam/shockTube/Allrun
new file mode 100755
index 0000000000000000000000000000000000000000..ce36bd5e82c961d8983b3b76feaf0bb71deb2817
--- /dev/null
+++ b/tutorials/rhoSonicFoam/shockTube/Allrun
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# Get application name from directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/RunFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/RunFunctions
+
+
+
+runApplication blockMesh
+compileApplication setShock
+runApplication setShock
+runApplication $application
+runApplication magU
+runApplication sample
+
diff --git a/tutorials/rhoTurbTwinParcelFoam/Allclean b/tutorials/rhoTurbTwinParcelFoam/Allclean
index ad62b421fbaa6db3ae7f2e82a016facdb4fe5cfe..aa903859fb3af8fbbe665d4117d3e143df3db658 100755
--- a/tutorials/rhoTurbTwinParcelFoam/Allclean
+++ b/tutorials/rhoTurbTwinParcelFoam/Allclean
@@ -1,16 +1,26 @@
 #!/bin/sh
 
-currDir=`pwd`
-application=`basename $currDir`
-cases="simplifiedSiwek"
+# Get application name from directory
+application=`basename $PWD`
 
-tutorialPath=`dirname $0`/..
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/CleanFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
 . $tutorialPath/CleanFunctions
 
-wclean $application
 
-for case in $cases
+
+
+wclean rhoTurbTwinParcelFoam
+
+for case in *
 do
-    cleanCase $case
+    if [ -d $case ]
+    then
+        (cd $case && $tutorialPath/cleanAll)
+    fi
 done
 
diff --git a/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/Allrun b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/Allrun
new file mode 100755
index 0000000000000000000000000000000000000000..3e93e90da67164fbbf08a8b0d228ec739cee18d1
--- /dev/null
+++ b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/Allrun
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# Get application name from directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/RunFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/RunFunctions
+
+
+
+compileApplication $application
+runApplication blockMesh
+runApplication $application
diff --git a/tutorials/rhopSonicFoam/shockTube/Allclean b/tutorials/rhopSonicFoam/shockTube/Allclean
new file mode 100755
index 0000000000000000000000000000000000000000..38b06c9effc6cefc8d60af43b4cf5db73387e02a
--- /dev/null
+++ b/tutorials/rhopSonicFoam/shockTube/Allclean
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# Get application name from directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/CleanFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/CleanFunctions
+
+
+
+rm -rf 0
+cp -r 0.org 0
+cleanCase
diff --git a/tutorials/rhopSonicFoam/shockTube/Allrun b/tutorials/rhopSonicFoam/shockTube/Allrun
new file mode 100755
index 0000000000000000000000000000000000000000..fd85554d6cd93757353619694226c4dc0fc02a88
--- /dev/null
+++ b/tutorials/rhopSonicFoam/shockTube/Allrun
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# Get application name from directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/RunFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/RunFunctions
+
+
+
+runApplication blockMesh
+runApplication setFields
+runApplication $application
diff --git a/tutorials/runAll b/tutorials/runAll
new file mode 100755
index 0000000000000000000000000000000000000000..8f0ad6034428a24d3c53cdab4a6267749b28126c
--- /dev/null
+++ b/tutorials/runAll
@@ -0,0 +1,73 @@
+#!/bin/sh
+#------------------------------------------------------------------------------
+# =========                 |
+# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+#  \\    /   O peration     |
+#   \\  /    A nd           | Copyright (C) 1991-2007 OpenCFD Ltd.
+#    \\/     M anipulation  |
+#------------------------------------------------------------------------------
+# License
+#     This file is part of OpenFOAM.
+#
+#     OpenFOAM is free software; you can redistribute it and/or modify it
+#     under the terms of the GNU General Public License as published by the
+#     Free Software Foundation; either version 2 of the License, or (at your
+#     option) any later version.
+#
+#     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+#     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+#     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+#     for more details.
+#
+#     You should have received a copy of the GNU General Public License
+#     along with OpenFOAM; if not, write to the Free Software Foundation,
+#     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Script
+#     runAll
+#
+# Description
+#       Run either Allrun or blockMesh/application in current directory
+#       and all its subdirectories.
+#
+#------------------------------------------------------------------------------
+
+unset WM_COLOURS
+
+tutorialsDir=$PWD
+while [ ! -f $tutorialsDir/RunFunctions ]
+do
+    tutorialsDir="$tutorialsDir/.."
+done
+. $tutorialsDir/RunFunctions
+
+thisScript=$0
+if [ "/${thisScript#/}" != "$thisScript" ]
+then
+    thisScript="$PWD/$thisScript"
+fi
+
+if [ -f "./Allrun" ] 
+then
+    # Specialised script.
+    ./Allrun
+elif [ -d "./system" ]
+then
+    # Normal case. 
+    parentDir=`dirname $PWD`
+    application=`basename $parentDir`
+    runApplication blockMesh
+    runApplication $application
+else
+    # Recurse to subdirectories
+    for case in *
+    do
+        if [ -d $case ]
+        then
+            #(cd $case && $thisScript)
+            $WM_SCHEDULER "cd $PWD/$case && $thisScript"
+        fi
+    done
+fi
+
+#------------------------------------------------------------------------------
diff --git a/tutorials/settlingFoam/tank3D/Allclean b/tutorials/settlingFoam/tank3D/Allclean
new file mode 100755
index 0000000000000000000000000000000000000000..dfabea30d28736ed978c9d4520e2cad4f5457532
--- /dev/null
+++ b/tutorials/settlingFoam/tank3D/Allclean
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+# Get application name from directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/CleanFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/CleanFunctions
+
+
+cleanTimeDirectories
diff --git a/tutorials/settlingFoam/tank3D/Allrun b/tutorials/settlingFoam/tank3D/Allrun
new file mode 100755
index 0000000000000000000000000000000000000000..016a846a2c9093a91c9d6e959e3ee53c4ce31f73
--- /dev/null
+++ b/tutorials/settlingFoam/tank3D/Allrun
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# Get application name from directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/RunFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/RunFunctions
+
+
+runApplication $application
+
diff --git a/tutorials/simpleSRFFoam/mixer/Allclean b/tutorials/simpleSRFFoam/mixer/Allclean
new file mode 100755
index 0000000000000000000000000000000000000000..d7759c2a93d1c2d84082190f4ded2900133c200e
--- /dev/null
+++ b/tutorials/simpleSRFFoam/mixer/Allclean
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# Get application name from directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/CleanFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/CleanFunctions
+
+
+cleanCase
+wclean ../simpleSRFFoam
diff --git a/tutorials/simpleSRFFoam/mixer/Allrun b/tutorials/simpleSRFFoam/mixer/Allrun
new file mode 100755
index 0000000000000000000000000000000000000000..746283994f11636da19405e5c193db7da8ba4e7e
--- /dev/null
+++ b/tutorials/simpleSRFFoam/mixer/Allrun
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+
+# Get application name from directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/RunFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/RunFunctions
+
+
+compileApplication ../simpleSRFFoam
+runApplication blockMesh
+runApplication $application
diff --git a/tutorials/solidDisplacementFoam/plateHole/Allclean b/tutorials/solidDisplacementFoam/plateHole/Allclean
new file mode 100755
index 0000000000000000000000000000000000000000..e70bdb2126c8f4a41c0d6b5ced75067a641bd073
--- /dev/null
+++ b/tutorials/solidDisplacementFoam/plateHole/Allclean
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# Get application name from directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/CleanFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/CleanFunctions
+
+
+cleanCase
+cleanSamples
diff --git a/tutorials/solidDisplacementFoam/plateHole/Allrun b/tutorials/solidDisplacementFoam/plateHole/Allrun
new file mode 100755
index 0000000000000000000000000000000000000000..332f4910967ff22199a393c92611504ea3bebf4c
--- /dev/null
+++ b/tutorials/solidDisplacementFoam/plateHole/Allrun
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# Get application name from directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/RunFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/RunFunctions
+
+
+runApplication blockMesh
+runApplication $application
+runApplication sample
diff --git a/tutorials/sonicFoam/shockTube/Allclean b/tutorials/sonicFoam/shockTube/Allclean
new file mode 100755
index 0000000000000000000000000000000000000000..f9a35ccec831111dc417da1b28939bd6aa705cbd
--- /dev/null
+++ b/tutorials/sonicFoam/shockTube/Allclean
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# Get application name from directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/CleanFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/CleanFunctions
+
+
+
+cleanCase
+rm -rf 0
+cp -r 0.org 0
+cleanSamples
diff --git a/tutorials/sonicFoam/shockTube/Allrun b/tutorials/sonicFoam/shockTube/Allrun
new file mode 100755
index 0000000000000000000000000000000000000000..ab1cf6caa958dfca35944bd273bca945b52bc1ac
--- /dev/null
+++ b/tutorials/sonicFoam/shockTube/Allrun
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+# Get application name from directory
+parentDir=`dirname $PWD`
+application=`basename $parentDir`
+
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/RunFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
+. $tutorialPath/RunFunctions
+
+
+runApplication blockMesh
+runApplication setFields
+runApplication $application
+runApplication magU
+runApplication sample
+
diff --git a/tutorials/sonicLiquidFoam/Allclean b/tutorials/sonicLiquidFoam/Allclean
index e7cfa0dd6d1588e7bde8527fe0dda7a4b54661d2..0be16088f0a7877ff7a75ff6c558802006c2083c 100755
--- a/tutorials/sonicLiquidFoam/Allclean
+++ b/tutorials/sonicLiquidFoam/Allclean
@@ -1,19 +1,24 @@
 #!/bin/sh
 
-currDir=`pwd`
-application=`basename $currDir`
-keepCases="decompressionTank"
-loseCases="decompressionTankFine"
+# Get application name from directory
+application=`basename $PWD`
 
-tutorialPath=`dirname $0`/..
-. $tutorialPath/CleanFunctions
-
-for case in $keepCases
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/CleanFunctions ]
 do
-    cleanCase $case
+    tutorialPath="$tutorialPath/.."
 done
+. $tutorialPath/CleanFunctions
+
+
+
+removeCase decompressionTankFine
 
-for case in $loseCases
+for case in *
 do
-    removeCase $case
+    if [ -d $case ]
+    then
+        (cd $case && $tutorialsDir/cleanAll)
+    fi
 done
diff --git a/tutorials/sonicLiquidFoam/Allrun b/tutorials/sonicLiquidFoam/Allrun
index 69c414f2676500ee2000eab1cd0340dec14b1140..949590a0f848ae5d05ef9047d2c5f945d5a355d8 100755
--- a/tutorials/sonicLiquidFoam/Allrun
+++ b/tutorials/sonicLiquidFoam/Allrun
@@ -1,12 +1,18 @@
 #!/bin/sh
 
-currDir=`pwd`
-application=`basename $currDir`
-cases="decompressionTank decompressionTankFine"
+# Get application name from directory
+application=`basename $PWD`
 
-tutorialPath=`dirname $0`/..
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/RunFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
 . $tutorialPath/RunFunctions
 
+
+
 setDecompressionTankFine ()
 {
     blockMeshDict="$case/constant/polyMesh/blockMeshDict"
@@ -25,14 +31,16 @@ setDecompressionTankFine ()
     mv temp.$$ $controlDict    
 }
 
-for case in $cases
-do
-    if [ "$case" = "decompressionTankFine" ] 
-    then
-        cloneCase decompressionTank $case
-        setDecompressionTankFine
-    fi
-#
-    runApplication blockMesh $case
-    runApplication $application $case
-done 
+# Do decompressionTank
+(cd decompressionTank && $tutorialPath/runAll)
+
+# Clone case
+cloneCase decompressionTank decompressionTankFine
+
+cd decompressionTankFine
+    # Modify case
+    setDecompressionTankFine
+    # And execute
+    runApplication blockMesh
+    runApplication $application
+cd ..
diff --git a/tutorials/sonicTurbFoam/Allrun b/tutorials/sonicTurbFoam/Allrun
index ac75c53afe2739d243a0cf6089c611353cc8f0c4..8926a4812dfe1a79b1bf302395fecff6e003ee26 100755
--- a/tutorials/sonicTurbFoam/Allrun
+++ b/tutorials/sonicTurbFoam/Allrun
@@ -1,33 +1,38 @@
 #!/bin/sh
 
-currDir=`pwd`
-application=`basename $currDir`
-cases="prism nacaAirfoil"
+# Get application name from directory
+application=`basename $PWD`
 
-tutorialPath=`dirname $0`/..
+# Find and source additional functions
+tutorialPath=$PWD
+while [ ! -f $tutorialPath/RunFunctions ]
+do
+    tutorialPath="$tutorialPath/.."
+done
 . $tutorialPath/RunFunctions
 
+
 runStarToFoam ()
 {
-    if [ -f $1/log.starToFoam ] ; then
-        echo "starToFoam already run on $1: remove log file to run"
+    if [ -f log.starToFoam ] ; then
+        echo "starToFoam already run on $PWD: remove log file to run"
     else
-        echo "starToFoam: converting mesh $2"
-        starToFoam . $1 $2 > $1/log.starToFoam 2>&1
+        echo "starToFoam: converting mesh $1"
+        starToFoam $1 > log.starToFoam 2>&1
     fi
 }
 
-for case in $cases
-do
-    if [ "$case" = "nacaAirfoil" ] ; then
-        runStarToFoam $case ${case}/prostar/${case}
-        mv ${case}/constant/polyMesh/boundary temp
-        sed -e s/"\([\t ]*type[\t ]*\)symmetryPlane"/"\1empty"/g \
-            temp > ${case}/constant/polyMesh/boundary
-        rm temp
-    else
-        runApplication blockMesh $case
-    fi
-    runApplication $application $case
-#    runApplication Mach $case
-done 
+
+
+# Do prism
+(cd prism && $tutorialPath/runAll)
+
+# Special handling for nacaAirFoil
+cd nacaAirFoil
+    runStarToFoam prostar/nacaAirFoil
+    mv constant/polyMesh/boundary temp
+    sed -e s/"\([\t ]*type[\t ]*\)symmetryPlane"/"\1empty"/g \
+        temp > constant/polyMesh/boundary
+    rm temp
+    runApplication $application
+cd ..