diff --git a/.gitignore b/.gitignore
index a897b8121d8ad41b4c57c3f52467b96d427965ab..92f3a658f91e8d9ee8aced6f59b8344dc96e8ca2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -75,9 +75,10 @@ doc/Doxygen/DTAGS
 # Ignore .tags in the main directory
 /.tags
 
-# Ignore eclipse project files in the main directory
+# Ignore project files in the main directory
 /.cproject
 /.project
+/.dir-locals.el
 
 # Ignore the test directory
 /tutorialsTest
diff --git a/applications/Allwmake b/applications/Allwmake
index 14ba388bf1779a1be6a3decedd9dce8ce17df86b..d851254b23a2f237fc5d08e17369e5b2bd25365c 100755
--- a/applications/Allwmake
+++ b/applications/Allwmake
@@ -17,10 +17,7 @@ wmakeCheckPwd "$WM_PROJECT_DIR/applications" || {
     exit 1
 }
 
-set -x
-
 wmake -all $targetType solvers
 wmake -all $targetType utilities
 
-
 #------------------------------------------------------------------------------
diff --git a/applications/solvers/combustion/chemFoam/createFields.H b/applications/solvers/combustion/chemFoam/createFields.H
index 62be3ce0ddf13e00b6104391368d124c519663de..8b35089fc88784cefdb6a8a650799c3024f2ac25 100644
--- a/applications/solvers/combustion/chemFoam/createFields.H
+++ b/applications/solvers/combustion/chemFoam/createFields.H
@@ -12,7 +12,7 @@
         (
             "initialConditions",
             runTime.constant(),
-            runTime,
+            mesh,
             IOobject::MUST_READ_IF_MODIFIED,
             IOobject::NO_WRITE
         )
@@ -37,7 +37,7 @@
         (
             "rho",
             runTime.timeName(),
-            runTime,
+            mesh,
             IOobject::NO_READ,
             IOobject::AUTO_WRITE
         ),
@@ -50,7 +50,7 @@
         (
             "Rspecific",
             runTime.timeName(),
-            runTime,
+            mesh,
             IOobject::NO_READ,
             IOobject::AUTO_WRITE
         ),
@@ -69,7 +69,7 @@
         (
             "U",
             runTime.timeName(),
-            runTime,
+            mesh,
             IOobject::NO_READ,
             IOobject::NO_WRITE
         ),
diff --git a/applications/solvers/compressible/rhoCentralFoam/Allwclean b/applications/solvers/compressible/rhoCentralFoam/Allwclean
index 34bab5c4498a8525b4ae9551bdffa8b793cb34fc..787221b83c1eb5d42523103885dd9821afa25aee 100755
--- a/applications/solvers/compressible/rhoCentralFoam/Allwclean
+++ b/applications/solvers/compressible/rhoCentralFoam/Allwclean
@@ -1,6 +1,5 @@
 #!/bin/sh
 cd ${0%/*} || exit 1    # Run from this directory
-set -x
 
 wclean libso BCs
 wclean
diff --git a/applications/solvers/compressible/rhoCentralFoam/Allwmake b/applications/solvers/compressible/rhoCentralFoam/Allwmake
index 8595a53d01fe6a28350a2f4c2cdf466488c0b516..5dee7d1a882f825e838a139e7fd3f970bbf67cac 100755
--- a/applications/solvers/compressible/rhoCentralFoam/Allwmake
+++ b/applications/solvers/compressible/rhoCentralFoam/Allwmake
@@ -3,7 +3,6 @@ cd ${0%/*} || exit 1    # Run from this directory
 
 # Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-set -x
 
 (wmake $targetType BCs && wmake $targetType && wmake $targetType rhoCentralDyMFoam)
 
diff --git a/applications/solvers/lagrangian/DPMFoam/Allwclean b/applications/solvers/lagrangian/DPMFoam/Allwclean
index 6d736b2373f46bf526fca58e8f5bac0aaabd9c05..158a56c8f3421faa57b45786ed47fd4678709e16 100755
--- a/applications/solvers/lagrangian/DPMFoam/Allwclean
+++ b/applications/solvers/lagrangian/DPMFoam/Allwclean
@@ -1,7 +1,6 @@
 #!/bin/sh
 
 cd ${0%/*} || exit 1
-set -x
 
 wclean libso DPMTurbulenceModels
 wclean
diff --git a/applications/solvers/lagrangian/DPMFoam/Allwmake b/applications/solvers/lagrangian/DPMFoam/Allwmake
index 9f702db886d2722edcd774b14ba19ecf2cb02092..1f021bfc2fdfa6d7ccf3eff7f87dd5d08b7901d8 100755
--- a/applications/solvers/lagrangian/DPMFoam/Allwmake
+++ b/applications/solvers/lagrangian/DPMFoam/Allwmake
@@ -3,7 +3,6 @@ cd ${0%/*} || exit 1
 
 # Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-set -x
 
 wmake $targetType DPMTurbulenceModels
 
diff --git a/applications/solvers/multiphase/compressibleInterFoam/Allwclean b/applications/solvers/multiphase/compressibleInterFoam/Allwclean
index 0e26512420818bed32fa20e58fcc7ed85a3775a4..deb5e2378ba964821faf55e012c1ea79efafeb16 100755
--- a/applications/solvers/multiphase/compressibleInterFoam/Allwclean
+++ b/applications/solvers/multiphase/compressibleInterFoam/Allwclean
@@ -1,6 +1,5 @@
 #!/bin/sh
 cd ${0%/*} || exit 1    # Run from this directory
-set -x
 
 wclean libso twoPhaseMixtureThermo
 wclean
diff --git a/applications/solvers/multiphase/compressibleInterFoam/Allwmake b/applications/solvers/multiphase/compressibleInterFoam/Allwmake
index 6542a62356dd345befc417be752d915bb17e32c7..20da00c472977322985e8067f4a32b45ea37d735 100755
--- a/applications/solvers/multiphase/compressibleInterFoam/Allwmake
+++ b/applications/solvers/multiphase/compressibleInterFoam/Allwmake
@@ -3,7 +3,6 @@ cd ${0%/*} || exit 1    # Run from this directory
 
 # Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-set -x
 
 wmake $targetType twoPhaseMixtureThermo
 
diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwclean b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwclean
index 628a70b516616c245038aaf08537be8e178d901e..657fd9d2423e2fa47ae14e542a121de38fcab4fe 100755
--- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwclean
+++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwclean
@@ -1,6 +1,5 @@
 #!/bin/sh
 cd ${0%/*} || exit 1    # Run from this directory
-set -x
 
 wclean libso multiphaseMixtureThermo
 wclean
diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwmake b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwmake
index 2a3c534c307ff0be1c1668187d7b4dd7e2d3e754..b92d87aef4ecf78c9f44705ed51d4727674320f4 100755
--- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwmake
+++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwmake
@@ -3,7 +3,6 @@ cd ${0%/*} || exit 1    # Run from this directory
 
 # Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-set -x
 
 wmake $targetType multiphaseMixtureThermo
 wmake $targetType
diff --git a/applications/solvers/multiphase/driftFluxFoam/Allwclean b/applications/solvers/multiphase/driftFluxFoam/Allwclean
index dcdca8527ffc62ff535b632f4c8077d01bf527bd..e3d46596bef94c55a3a77b7a57fe462f798d02a5 100755
--- a/applications/solvers/multiphase/driftFluxFoam/Allwclean
+++ b/applications/solvers/multiphase/driftFluxFoam/Allwclean
@@ -1,6 +1,5 @@
 #!/bin/sh
 cd ${0%/*} || exit 1    # Run from this directory
-set -x
 
 wclean libso mixtureViscosityModels
 wclean libso relativeVelocityModels
diff --git a/applications/solvers/multiphase/driftFluxFoam/Allwmake b/applications/solvers/multiphase/driftFluxFoam/Allwmake
index e4af29196aa1b93aed70b4cf932522a34344b6bd..069235819e980122ae73c100e7d63a46045dfd6d 100755
--- a/applications/solvers/multiphase/driftFluxFoam/Allwmake
+++ b/applications/solvers/multiphase/driftFluxFoam/Allwmake
@@ -3,7 +3,6 @@ cd ${0%/*} || exit 1    # Run from this directory
 
 # Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-set -x
 
 wmake $targetType mixtureViscosityModels
 wmake $targetType relativeVelocityModels
diff --git a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C
index c8e3bb3721ff7a2142bbef76108e9169a860f5ca..b6e7fbae004aae0ab796408d9ec34b4e739eab8e 100644
--- a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C
+++ b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C
@@ -24,6 +24,9 @@ License
 \*---------------------------------------------------------------------------*/
 
 #include "relativeVelocityModel.H"
+#include "fixedValueFvPatchFields.H"
+#include "slipFvPatchFields.H"
+#include "partialSlipFvPatchFields.H"
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
@@ -33,6 +36,34 @@ namespace Foam
     defineRunTimeSelectionTable(relativeVelocityModel, dictionary);
 }
 
+// * * * * * * * * * * * * * Private Member Functions   * * * * * * * * * * * //
+
+Foam::wordList Foam::relativeVelocityModel::UdmPatchFieldTypes() const
+{
+    const volVectorField& U = mixture_.U();
+
+    wordList UdmTypes
+    (
+        U.boundaryField().size(),
+        calculatedFvPatchScalarField::typeName
+    );
+
+    forAll(U.boundaryField(), i)
+    {
+        if
+        (
+            isA<fixedValueFvPatchVectorField>(U.boundaryField()[i])
+         || isA<slipFvPatchVectorField>(U.boundaryField()[i])
+         || isA<partialSlipFvPatchVectorField>(U.boundaryField()[i])
+        )
+        {
+            UdmTypes[i] = fixedValueFvPatchVectorField::typeName;
+        }
+    }
+
+    return UdmTypes;
+}
+
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
@@ -55,11 +86,12 @@ Foam::relativeVelocityModel::relativeVelocityModel
             "Udm",
             alphac_.time().timeName(),
             alphac_.mesh(),
-            IOobject::NO_READ,
+            IOobject::READ_IF_PRESENT,
             IOobject::AUTO_WRITE
         ),
         alphac_.mesh(),
-        dimensionedVector("Udm", dimVelocity, Zero)
+        dimensionedVector("Udm", dimVelocity, Zero),
+        UdmPatchFieldTypes()
     )
 {}
 
diff --git a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.H b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.H
index 475c87704ef519a03d4b6ad0cc79a3ab02b87fc6..420a7c3e8ae5e85e095fd6e8f2d031bfe2d0dd4f 100644
--- a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.H
+++ b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2014 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2014-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -52,12 +52,16 @@ class relativeVelocityModel
 {
     // Private Member Functions
 
+        //- Return the list of patchFieldTypes for Udm derived from U
+        wordList UdmPatchFieldTypes() const;
+
         //- Disallow default bitwise copy construct
         relativeVelocityModel(const relativeVelocityModel&);
 
         //- Disallow default bitwise assignment
         void operator=(const relativeVelocityModel&);
 
+
 protected:
 
     // Protected data
diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/Allwclean b/applications/solvers/multiphase/interCondensingEvaporatingFoam/Allwclean
index 8717ef89533bc2aeb09e59273c62a296f7d210b2..eaec8f77a11e453b0eb9dfab150491bc472da049 100755
--- a/applications/solvers/multiphase/interCondensingEvaporatingFoam/Allwclean
+++ b/applications/solvers/multiphase/interCondensingEvaporatingFoam/Allwclean
@@ -1,6 +1,5 @@
 #!/bin/sh
 cd ${0%/*} || exit 1    # Run from this directory
-set -x
 
 wclean libso temperaturePhaseChangeTwoPhaseMixtures
 wclean
diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/Allwclean b/applications/solvers/multiphase/interPhaseChangeFoam/Allwclean
index bc351e27d8076a8f66a16f82230c06fed45fbf78..573e235fdc450d62c560e79c92c632788bc87419 100755
--- a/applications/solvers/multiphase/interPhaseChangeFoam/Allwclean
+++ b/applications/solvers/multiphase/interPhaseChangeFoam/Allwclean
@@ -1,6 +1,5 @@
 #!/bin/sh
 cd ${0%/*} || exit 1    # Run from this directory
-set -x
 
 wclean libso phaseChangeTwoPhaseMixtures
 wclean
diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/Allwmake b/applications/solvers/multiphase/interPhaseChangeFoam/Allwmake
index c0ac039a551e308e0d72e46c43de161dd8868503..dfcde284ea58f76076c3a8d09c21cdf39e6577df 100755
--- a/applications/solvers/multiphase/interPhaseChangeFoam/Allwmake
+++ b/applications/solvers/multiphase/interPhaseChangeFoam/Allwmake
@@ -3,7 +3,6 @@ cd ${0%/*} || exit 1    # Run from this directory
 
 # Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-set -x
 
 wmake $targetType phaseChangeTwoPhaseMixtures
 wmake $targetType
diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/Allwclean b/applications/solvers/multiphase/multiphaseEulerFoam/Allwclean
index 6d174c19d92041d44b720d8bd05fb080cdccaf8d..727191ec35af72ff5f2b9937f87fb51774d61409 100755
--- a/applications/solvers/multiphase/multiphaseEulerFoam/Allwclean
+++ b/applications/solvers/multiphase/multiphaseEulerFoam/Allwclean
@@ -1,6 +1,5 @@
 #!/bin/sh
 cd ${0%/*} || exit 1    # Run from this directory
-set -x
 
 wclean libso multiphaseSystem
 wclean libso interfacialModels
diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake b/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake
index d81a6d71a873bb75f7b2f5c5c87006356d694527..d38522312d4d9a5c2889ef557cf6edf54347f8a4 100755
--- a/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake
+++ b/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake
@@ -3,7 +3,6 @@ cd ${0%/*} || exit 1    # Run from this directory
 
 # Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-set -x
 
 wmakeLnInclude interfacialModels
 wmake $targetType multiphaseSystem
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/Allwclean b/applications/solvers/multiphase/multiphaseInterFoam/Allwclean
index 75d8939d310ec324e1d12d3f439918e4afff891c..9b5595f2a07c9c64dec5a83d44c3664d3384f114 100755
--- a/applications/solvers/multiphase/multiphaseInterFoam/Allwclean
+++ b/applications/solvers/multiphase/multiphaseInterFoam/Allwclean
@@ -1,6 +1,5 @@
 #!/bin/sh
 cd ${0%/*} || exit 1    # Run from this directory
-set -x
 
 wclean libso multiphaseMixture
 wclean
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/Allwmake b/applications/solvers/multiphase/multiphaseInterFoam/Allwmake
index 000e9f77432793bb6ad26e6596569a4fd07f3536..50f78a705cd4124a619c8d7af8143bc852ea1e5e 100755
--- a/applications/solvers/multiphase/multiphaseInterFoam/Allwmake
+++ b/applications/solvers/multiphase/multiphaseInterFoam/Allwmake
@@ -3,7 +3,6 @@ cd ${0%/*} || exit 1    # Run from this directory
 
 # Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-set -x
 
 wmake $targetType multiphaseMixture
 wmake $targetType
diff --git a/applications/solvers/multiphase/reactingEulerFoam/Allwclean b/applications/solvers/multiphase/reactingEulerFoam/Allwclean
index 5474c3349ab8cc606d3930dbc620b852c6ece9f5..ad8f3f8fafb54efe8b51f2bac0a2423e8ff751b8 100755
--- a/applications/solvers/multiphase/reactingEulerFoam/Allwclean
+++ b/applications/solvers/multiphase/reactingEulerFoam/Allwclean
@@ -1,6 +1,5 @@
 #!/bin/sh
 cd ${0%/*} || exit 1    # Run from this directory
-set -x
 
 wclean libso phaseSystems
 wclean libso interfacialModels
diff --git a/applications/solvers/multiphase/reactingEulerFoam/Allwmake b/applications/solvers/multiphase/reactingEulerFoam/Allwmake
index f67d35aa292e86e819b9ae7266909b67ae053083..87e6a81e3f0bfc6b1c0aa2ad7ccb3572126ab3d2 100755
--- a/applications/solvers/multiphase/reactingEulerFoam/Allwmake
+++ b/applications/solvers/multiphase/reactingEulerFoam/Allwmake
@@ -3,7 +3,6 @@ cd ${0%/*} || exit 1    # Run from this directory
 
 # Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-set -x
 
 wmakeLnInclude interfacialModels
 wmakeLnInclude interfacialCompositionModels
diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.C
index 6ca75c6ed49838560e37e30cdb4daa8ff72e3688..b5dd4ab37a0e8185fe1b76179a79d15df3d4b247 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.C
+++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.C
@@ -77,11 +77,39 @@ void Foam::AnisothermalPhaseModel<BasePhaseModel>::correctThermo()
 }
 
 
+template<class BasePhaseModel>
+Foam::tmp<Foam::volScalarField>
+Foam::AnisothermalPhaseModel<BasePhaseModel>::filterPressureWork
+(
+    const tmp<volScalarField>& pressureWork
+) const
+{
+    const volScalarField& alpha = *this;
+
+    scalar pressureWorkAlphaLimit =
+        this->thermo_->lookupOrDefault("pressureWorkAlphaLimit", 0.0);
+
+    if (pressureWorkAlphaLimit > 0)
+    {
+        return
+        (
+            max(alpha - pressureWorkAlphaLimit, scalar(0))
+           /max(alpha - pressureWorkAlphaLimit, pressureWorkAlphaLimit)
+        )*pressureWork;
+    }
+    else
+    {
+        return pressureWork;
+    }
+}
+
+
 template<class BasePhaseModel>
 Foam::tmp<Foam::fvScalarMatrix>
 Foam::AnisothermalPhaseModel<BasePhaseModel>::heEqn()
 {
     const volScalarField& alpha = *this;
+    const volVectorField& U = this->U();
     const surfaceScalarField& alphaPhi = this->alphaPhi();
     const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi();
 
@@ -93,7 +121,8 @@ Foam::AnisothermalPhaseModel<BasePhaseModel>::heEqn()
 
     tmp<fvScalarMatrix> tEEqn
     (
-        fvm::ddt(alpha, this->rho(), he) + fvm::div(alphaRhoPhi, he)
+        fvm::ddt(alpha, this->rho(), he)
+      + fvm::div(alphaRhoPhi, he)
       - fvm::Sp(contErr, he)
 
       + fvc::ddt(alpha, this->rho(), K_) + fvc::div(alphaRhoPhi, K_)
@@ -112,13 +141,15 @@ Foam::AnisothermalPhaseModel<BasePhaseModel>::heEqn()
     // Add the appropriate pressure-work term
     if (he.name() == this->thermo_->phasePropertyName("e"))
     {
-        tEEqn.ref() +=
-            fvc::ddt(alpha)*this->thermo().p()
-          + fvc::div(alphaPhi, this->thermo().p());
+        tEEqn.ref() += filterPressureWork
+        (
+            fvc::div(fvc::absolute(alphaPhi, alpha, U), this->thermo().p())
+          + this->thermo().p()*fvc::ddt(alpha)
+        );
     }
     else if (this->thermo_->dpdt())
     {
-        tEEqn.ref() -= alpha*this->fluid().dpdt();
+        tEEqn.ref() -= filterPressureWork(alpha*this->fluid().dpdt());
     }
 
     return tEEqn;
diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.H
index 7a9cbd51bfb1a0b3f1a887a6eb6c1215afe284e4..86edbcd1f8bbeefe95672688d60a5ead43c2885b 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.H
+++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.H
@@ -58,6 +58,15 @@ class AnisothermalPhaseModel
         volScalarField K_;
 
 
+    // Private member functions
+
+        //- Optionally filter the pressure work term as the phase-fraction -> 0
+        tmp<volScalarField> filterPressureWork
+        (
+            const tmp<volScalarField>& pressureWork
+        ) const;
+
+
 public:
 
     // Constructors
diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ReactingPhaseModel/ReactingPhaseModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ReactingPhaseModel/ReactingPhaseModel.C
index 96a76de1698c4eeaf61e944ee599c89978fe7a22..b15f2898b549331d5ff2e2858ff121cb9c4b4f81 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ReactingPhaseModel/ReactingPhaseModel.C
+++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ReactingPhaseModel/ReactingPhaseModel.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2015-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -40,7 +40,12 @@ Foam::ReactingPhaseModel<BasePhaseModel, ReactionType>::ReactingPhaseModel
     BasePhaseModel(fluid, phaseName, index, false),
     reaction_
     (
-        ReactionType::New(fluid.mesh(), this->name())
+        ReactionType::New
+        (
+            fluid.mesh(),
+            combustionModel::combustionPropertiesName,
+            this->name()
+        )
     )
 {
     this->thermo_ = &reaction_->thermo();
diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwclean b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwclean
index 983c20bdc16eb3af101b8d91242d7f8c6b90f31c..451b6672a98fb0bb3bb2053be0e67fcd92609d0b 100755
--- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwclean
+++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwclean
@@ -1,6 +1,5 @@
 #!/bin/sh
 cd ${0%/*} || exit 1    # Run from this directory
-set -x
 
 wclean libso multiphaseSystem
 wclean libso multiphaseCompressibleTurbulenceModels
diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwmake b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwmake
index ea7fab7a82614eab2900c064f59311040595211b..05211a00395fb18974f08f5bf40fa3f4bff93ac2 100755
--- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwmake
+++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwmake
@@ -3,7 +3,6 @@ cd ${0%/*} || exit 1    # Run from this directory
 
 # Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-set -x
 
 wmake $targetType multiphaseSystem
 wmake $targetType multiphaseCompressibleTurbulenceModels
diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/EEqns.H b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/EEqns.H
index 0130a872c905f8c2eef12af71d4b8e83aeb8081d..e4689efee6187e7c96e540a4c9ddacd5064a7eca 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/EEqns.H
+++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/EEqns.H
@@ -35,6 +35,7 @@ for (int Ecorr=0; Ecorr<nEnergyCorrectors; Ecorr++)
     }
 
     fluid.correctThermo();
+    fluid.correct();
 }
 
 
diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pU/pEqn.H b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pU/pEqn.H
index 7e43e677492b10b5c07b9deb98fbe4732edef485..5e916dce2fdcb9f945c7f86dfe5e2a323c3b66c9 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pU/pEqn.H
+++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pU/pEqn.H
@@ -89,9 +89,6 @@ PtrList<surfaceScalarField> phiFs(phases.size());
 // --- Pressure corrector loop
 while (pimple.correct())
 {
-    // Update continuity errors due to temperature changes
-    fluid.correct();
-
     volScalarField rho("rho", fluid.rho());
 
     // Correct p_rgh for consistency with p and the updated densities
diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/reactingMultiphaseEulerFoam.C b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/reactingMultiphaseEulerFoam.C
index 9807a0ae207153a943c14543d1403fcdf7348aa1..55b677386245c5ed9daec224cb0011cf58ca76f2 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/reactingMultiphaseEulerFoam.C
+++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/reactingMultiphaseEulerFoam.C
@@ -77,11 +77,6 @@ int main(int argc, char *argv[])
 
     //#include "pUf/createDDtU.H"
 
-    int nEnergyCorrectors
-    (
-        pimple.dict().lookupOrDefault<int>("nEnergyCorrectors", 1)
-    );
-
     // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
     Info<< "\nStarting time loop\n" << endl;
@@ -90,6 +85,11 @@ int main(int argc, char *argv[])
     {
         #include "readTimeControls.H"
 
+        int nEnergyCorrectors
+        (
+            pimple.dict().lookupOrDefault<int>("nEnergyCorrectors", 1)
+        );
+
         if (LTS)
         {
             #include "setRDeltaT.H"
diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwclean b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwclean
index 59ec72ff10e339df685c8166026c1fcc35690343..2d0f2fde9e7a254d7b7e5eda3cb599fea8e5243e 100755
--- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwclean
+++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwclean
@@ -1,6 +1,5 @@
 #!/bin/sh
 cd ${0%/*} || exit 1    # Run from this directory
-set -x
 
 wclean libso twoPhaseSystem
 wclean libso twoPhaseCompressibleTurbulenceModels
diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwmake b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwmake
index d151b361df17e4ba1cf1a76e548d9ac6bbf8c88d..49c983288e0cac523f1dab93c12e8649f079a3b8 100755
--- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwmake
+++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwmake
@@ -3,7 +3,6 @@ cd ${0%/*} || exit 1    # Run from this directory
 
 # Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-set -x
 
 wmake $targetType twoPhaseSystem
 wmake $targetType twoPhaseCompressibleTurbulenceModels
diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/EEqns.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/EEqns.H
index 0cdbfba8b92e6caffadc20309eb4de9967071571..d9f1e85e6fd2d3fdf6695f2564060c95c01e8aeb 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/EEqns.H
+++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/EEqns.H
@@ -29,36 +29,25 @@ for (int Ecorr=0; Ecorr<nEnergyCorrectors; Ecorr++)
     }
 
     {
-        tmp<fvScalarMatrix> E2eqn(phase2.heEqn());
+        tmp<fvScalarMatrix> E2Eqn(phase2.heEqn());
 
-        if (E2eqn.valid())
+        if (E2Eqn.valid())
         {
-            E2eqn =
+            E2Eqn =
             (
-                E2eqn
+                E2Eqn
              ==
                *heatTransfer[phase2.name()]
               + alpha2*rho2*(U2&g)
               + fvOptions(alpha2, rho2, phase2.thermo().he())
             );
 
-            E2eqn->relax();
-            fvOptions.constrain(E2eqn.ref());
-            E2eqn->solve();
+            E2Eqn->relax();
+            fvOptions.constrain(E2Eqn.ref());
+            E2Eqn->solve();
         }
     }
 
     fluid.correctThermo();
+    fluid.correct();
 }
-
-Info<< phase1.name() << " min/max T "
-    << min(phase1.thermo().T()).value()
-    << " - "
-    << max(phase1.thermo().T()).value()
-    << endl;
-
-Info<< phase2.name() << " min/max T "
-    << min(phase2.thermo().T()).value()
-    << " - "
-    << max(phase2.thermo().T()).value()
-    << endl;
diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/createRDeltaTf.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/createRDeltaTf.H
new file mode 100644
index 0000000000000000000000000000000000000000..5a4c77eacf54c48264a29a876c673d2a7c6c6747
--- /dev/null
+++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/createRDeltaTf.H
@@ -0,0 +1,21 @@
+tmp<surfaceScalarField> trDeltaTf;
+
+if (LTS && faceMomentum)
+{
+    trDeltaTf = tmp<surfaceScalarField>
+    (
+        new surfaceScalarField
+        (
+            IOobject
+            (
+                fv::localEulerDdt::rDeltaTfName,
+                runTime.timeName(),
+                mesh,
+                IOobject::READ_IF_PRESENT,
+                IOobject::AUTO_WRITE
+            ),
+            mesh,
+            dimensionedScalar("one", dimless/dimTime, 1)
+        )
+    );
+}
diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pU/pEqn.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pU/pEqn.H
index 9020cd6d5de4cc7c3a1f3bf14b4034bd9cf02fcc..3b225202e917f8839dd4d821cc15c2cc47bbd6d2 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pU/pEqn.H
+++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pU/pEqn.H
@@ -83,9 +83,6 @@ tmp<surfaceScalarField> phiF2;
 // --- Pressure corrector loop
 while (pimple.correct())
 {
-    // Update continuity errors due to temperature changes
-    fluid.correct();
-
     volScalarField rho("rho", fluid.rho());
 
     // Correct p_rgh for consistency with p and the updated densities
diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/DDtU.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/DDtU.H
index 63b61cd61a73ad944fafeeced01737665c90b1ed..c7bccf66eac5e0a56750e2837027e16394903c56 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/DDtU.H
+++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/DDtU.H
@@ -1,9 +1,2 @@
-    ddtPhi1 =
-    (
-        (phi1 - phi1.oldTime())/runTime.deltaT()
-    );
-
-    ddtPhi2 =
-    (
-        (phi2 - phi2.oldTime())/runTime.deltaT()
-    );
+ddtPhi1 = fvc::ddt(phi1);
+ddtPhi2 = fvc::ddt(phi2);
diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/createDDtU.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/createDDtU.H
index 7445d4af23f5d5c63485052c0a7217e668c65717..14e66e47a833f9cbf06eba9d03904b3c675599ba 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/createDDtU.H
+++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/createDDtU.H
@@ -1,9 +1,2 @@
-    surfaceScalarField ddtPhi1
-    (
-        (phi1 - phi1.oldTime())/runTime.deltaT()
-    );
-
-    surfaceScalarField ddtPhi2
-    (
-        (phi2 - phi2.oldTime())/runTime.deltaT()
-    );
+surfaceScalarField ddtPhi1(fvc::ddt(phi1));
+surfaceScalarField ddtPhi2(fvc::ddt(phi2));
diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/pEqn.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/pEqn.H
index b27c9f4646fdec6beb7d7c731def2287e866d43c..7950d76b94470df97aaeebb600a3898177dee675 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/pEqn.H
+++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/pEqn.H
@@ -32,10 +32,10 @@ surfaceScalarField rAUf1
     IOobject::groupName("rAUf", phase1.name()),
     1.0
    /(
-        (alphaRhof10 + Vmf)/runTime.deltaT()
+        byDt(alphaRhof10 + Vmf)
       + fvc::interpolate(U1Eqn.A())
       + Kdf
-   )
+    )
 );
 
 surfaceScalarField rAUf2
@@ -43,10 +43,10 @@ surfaceScalarField rAUf2
     IOobject::groupName("rAUf", phase2.name()),
     1.0
    /(
-        (alphaRhof20 + Vmf)/runTime.deltaT()
+        byDt(alphaRhof20 + Vmf)
       + fvc::interpolate(U2Eqn.A())
       + Kdf
-   )
+    )
 );
 
 
@@ -93,9 +93,6 @@ tmp<surfaceScalarField> Ff2;
 
 while (pimple.correct())
 {
-    // Update continuity errors due to temperature changes
-    fluid.correct();
-
     volScalarField rho("rho", fluid.rho());
 
     // Correct p_rgh for consistency with p and the updated densities
@@ -160,7 +157,7 @@ while (pimple.correct())
         rAUf1
        *(
             (alphaRhof10 + Vmf)
-           *MRF.absolute(phi1.oldTime())/runTime.deltaT()
+           *byDt(MRF.absolute(phi1.oldTime()))
           + fvc::flux(U1Eqn.H())
           + Vmf*ddtPhi2
           + Kdf*MRF.absolute(phi2)
@@ -178,7 +175,7 @@ while (pimple.correct())
         rAUf2
        *(
             (alphaRhof20 + Vmf)
-           *MRF.absolute(phi2.oldTime())/runTime.deltaT()
+           *byDt(MRF.absolute(phi2.oldTime()))
           + fvc::flux(U2Eqn.H())
           + Vmf*ddtPhi1
           + Kdf*MRF.absolute(phi1)
diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/reactingTwoPhaseEulerFoam.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/reactingTwoPhaseEulerFoam.C
index 40bcc365a03861664193d6db66a63ad54db67195..f180257e9c01496849486f9ddf60904706de4935 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/reactingTwoPhaseEulerFoam.C
+++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/reactingTwoPhaseEulerFoam.C
@@ -43,6 +43,22 @@ Description
 #include "localEulerDdtScheme.H"
 #include "fvcSmooth.H"
 
+namespace Foam
+{
+    tmp<surfaceScalarField> byDt(const surfaceScalarField& sf)
+    {
+        if (fv::localEulerDdt::enabled(sf.mesh()))
+        {
+            return fv::localEulerDdt::localRDeltaTf(sf.mesh())*sf;
+        }
+        else
+        {
+            return sf/sf.mesh().time().deltaT();
+        }
+    }
+}
+
+
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 int main(int argc, char *argv[])
@@ -76,13 +92,9 @@ int main(int argc, char *argv[])
         )
     );
 
+    #include "createRDeltaTf.H"
     #include "pUf/createDDtU.H"
 
-    int nEnergyCorrectors
-    (
-        pimple.dict().lookupOrDefault<int>("nEnergyCorrectors", 1)
-    );
-
     // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
     Info<< "\nStarting time loop\n" << endl;
@@ -91,9 +103,18 @@ int main(int argc, char *argv[])
     {
         #include "readTimeControls.H"
 
+        int nEnergyCorrectors
+        (
+            pimple.dict().lookupOrDefault<int>("nEnergyCorrectors", 1)
+        );
+
         if (LTS)
         {
             #include "setRDeltaT.H"
+            if (faceMomentum)
+            {
+                #include "setRDeltaTf.H"
+            }
         }
         else
         {
diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/setRDeltaTf.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/setRDeltaTf.H
new file mode 100644
index 0000000000000000000000000000000000000000..1c0366dc3b1caf64386aeab810bec5e12f702c33
--- /dev/null
+++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/setRDeltaTf.H
@@ -0,0 +1 @@
+trDeltaTf.ref() = fvc::interpolate(fv::localEulerDdt::localRDeltaT(mesh));
diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H
old mode 100755
new mode 100644
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/Allwclean b/applications/solvers/multiphase/twoPhaseEulerFoam/Allwclean
index aec98738818d2b95a622ca04fe17923087c5e896..056bc90a3d60a2527d7c3b629986889114f117c7 100755
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/Allwclean
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/Allwclean
@@ -1,6 +1,5 @@
 #!/bin/sh
 cd ${0%/*} || exit 1    # Run from this directory
-set -x
 
 wclean libso twoPhaseSystem
 wclean libso interfacialModels
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/Allwmake b/applications/solvers/multiphase/twoPhaseEulerFoam/Allwmake
index a73a5ce4169e67fe95ad52f8af785c1b49d2b0da..9eb3ae37c4c37f266747f062116a79bf8383d045 100755
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/Allwmake
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/Allwmake
@@ -3,7 +3,6 @@ cd ${0%/*} || exit 1    # Run from this directory
 
 # Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-set -x
 
 wmakeLnInclude interfacialModels
 wmake $targetType twoPhaseSystem
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/EEqns.H b/applications/solvers/multiphase/twoPhaseEulerFoam/EEqns.H
index 25b97c17a13c32951d2802b550b0271add290af8..308e7589f9357932a83dcdc22cabe44ec62e75c2 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/EEqns.H
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/EEqns.H
@@ -16,7 +16,8 @@
       - contErr1*K1
       + (
             he1.name() == thermo1.phasePropertyName("e")
-          ? fvc::ddt(alpha1)*p + fvc::div(alphaPhi1, p)
+          ? fvc::div(fvc::absolute(alphaPhi1, alpha1, U1), p)
+          + p*fvc::ddt(alpha1)
           : -alpha1*dpdt
         )
 
@@ -48,7 +49,8 @@
       - contErr2*K2
       + (
             he2.name() == thermo2.phasePropertyName("e")
-          ? fvc::ddt(alpha2)*p + fvc::div(alphaPhi2, p)
+          ? fvc::div(fvc::absolute(alphaPhi2, alpha2, U2), p)
+          + p*fvc::ddt(alpha1)
           : -alpha2*dpdt
         )
 
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C
index eedb89cc551e7555689f8f209f3c26d6e6405d65..f5522c7509e5cebafa73861e42129c0ec2259869 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C
@@ -248,4 +248,30 @@ bool Foam::phaseModel::read(const dictionary& phaseProperties)
 }
 
 
+void Foam::phaseModel::correctInflowFlux(surfaceScalarField& alphaPhi) const
+{
+    surfaceScalarField::Boundary& alphaPhiBf = alphaPhi.boundaryFieldRef();
+
+    // Ensure that the flux at inflow BCs is preserved
+    forAll(alphaPhiBf, patchi)
+    {
+        fvsPatchScalarField& alphaPhip = alphaPhiBf[patchi];
+
+        if (!alphaPhip.coupled())
+        {
+            const scalarField& phip = phi().boundaryField()[patchi];
+            const scalarField& alphap = boundaryField()[patchi];
+
+            forAll(alphaPhip, facei)
+            {
+                if (phip[facei] < SMALL)
+                {
+                    alphaPhip[facei] = alphap[facei]*phip[facei];
+                }
+            }
+        }
+    }
+}
+
+
 // ************************************************************************* //
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H
index 5fb0245513d3978d28622399612f2de3ba0cbddc..a5ae107c909d49351ce384fac4914edafeccb068 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H
@@ -319,6 +319,9 @@ public:
             return alphaRhoPhi_;
         }
 
+        //- Ensure that the flux at inflow BCs is preserved
+        void correctInflowFlux(surfaceScalarField& alphaPhi) const;
+
         //- Correct the phase properties
         //  other than the thermodynamics and turbulence
         //  which have special treatment
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C
index 7c2323a03055c421a1b4a348be04c171f5fd39f4..808fe255f9e7afa0c8f71203625e649a5fb049d8 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C
@@ -444,28 +444,7 @@ void Foam::twoPhaseSystem::solve()
             )
         );
 
-        surfaceScalarField::Boundary& alphaPhic1Bf =
-            alphaPhic1.boundaryFieldRef();
-
-        // Ensure that the flux at inflow BCs is preserved
-        forAll(alphaPhic1Bf, patchi)
-        {
-            fvsPatchScalarField& alphaPhic1p = alphaPhic1Bf[patchi];
-
-            if (!alphaPhic1p.coupled())
-            {
-                const scalarField& phi1p = phi1.boundaryField()[patchi];
-                const scalarField& alpha1p = alpha1.boundaryField()[patchi];
-
-                forAll(alphaPhic1p, facei)
-                {
-                    if (phi1p[facei] < 0)
-                    {
-                        alphaPhic1p[facei] = alpha1p[facei]*phi1p[facei];
-                    }
-                }
-            }
-        }
+        phase1_.correctInflowFlux(alphaPhic1);
 
         if (nAlphaSubCycles > 1)
         {
@@ -537,6 +516,7 @@ void Foam::twoPhaseSystem::solve()
 
         phase2_.alphaPhi() = phi_ - phase1_.alphaPhi();
         alpha2 = scalar(1) - alpha1;
+        phase2_.correctInflowFlux(phase2_.alphaPhi());
         phase2_.alphaRhoPhi() =
             fvc::interpolate(phase2_.rho())*phase2_.alphaPhi();
 
diff --git a/applications/utilities/mesh/conversion/Optional/Allwmake b/applications/utilities/mesh/conversion/Optional/Allwmake
index a7a614f5cad3ab3c3253a0a6a5a0bc04433708fe..6e64d2c83485fb505552f8f6c94a6e565d26f842 100755
--- a/applications/utilities/mesh/conversion/Optional/Allwmake
+++ b/applications/utilities/mesh/conversion/Optional/Allwmake
@@ -11,7 +11,6 @@ cd ${0%/*} || exit 1    # Run from this directory
 . $WM_PROJECT_DIR/etc/config.sh/functions
 _foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ccmio)
 
-set -x
 
 # Build libccmio (.a|.so)
 $WM_THIRD_PARTY_DIR/makeCCMIO lib # libso
diff --git a/applications/utilities/mesh/generation/extrude2DMesh/Allwclean b/applications/utilities/mesh/generation/extrude2DMesh/Allwclean
index 48a8fb0d129e6177cb7c86595e6d4b99425baeba..71e45051eec76508e8c01b63d028ba2611500108 100755
--- a/applications/utilities/mesh/generation/extrude2DMesh/Allwclean
+++ b/applications/utilities/mesh/generation/extrude2DMesh/Allwclean
@@ -1,6 +1,5 @@
 #!/bin/sh
 cd ${0%/*} || exit 1    # Run from this directory
-set -x
 
 wclean libso extrude2DMesh
 wclean
diff --git a/applications/utilities/mesh/generation/extrude2DMesh/Allwmake b/applications/utilities/mesh/generation/extrude2DMesh/Allwmake
index 37a2358c583ce6a91084a83fbcfd825e8668cc3b..f8637ab7e53aa13a132944b31289c71a52025350 100755
--- a/applications/utilities/mesh/generation/extrude2DMesh/Allwmake
+++ b/applications/utilities/mesh/generation/extrude2DMesh/Allwmake
@@ -3,7 +3,6 @@ cd ${0%/*} || exit 1    # Run from this directory
 
 # Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-set -x
 
 wmake $targetType extrude2DMesh
 wmake $targetType
diff --git a/applications/utilities/mesh/generation/foamyMesh/Allwclean b/applications/utilities/mesh/generation/foamyMesh/Allwclean
index 8fbad7478485039d9fc92137125bd1504e6ea484..725d20869ddcccc6f1b1e30705af989404d35efc 100755
--- a/applications/utilities/mesh/generation/foamyMesh/Allwclean
+++ b/applications/utilities/mesh/generation/foamyMesh/Allwclean
@@ -1,6 +1,5 @@
 #!/bin/sh
 cd ${0%/*} || exit 1    # Run from this directory
-set -x
 
 wclean conformalVoronoiMesh
 wclean conformalVoronoi2DMesh
diff --git a/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshSurfaceSimplify/Allwmake b/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshSurfaceSimplify/Allwmake
index 280efe9bdf96970a51bde85b283fdb5f472148ef..c3f900341ec642c9c1d12cb4d9bbf0c8e5b0f465 100755
--- a/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshSurfaceSimplify/Allwmake
+++ b/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshSurfaceSimplify/Allwmake
@@ -3,7 +3,6 @@ cd ${0%/*} || exit 1    # Run from this directory
 
 # Parse arguments for compilation (at least for error catching)
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-set -x
 
 if [ -d "${FASTDUALOCTREE_SRC_PATH}" ]
 then
diff --git a/applications/utilities/mesh/manipulation/setSet/Allwmake b/applications/utilities/mesh/manipulation/setSet/Allwmake
index ce9bef7333f3d44613079703727885ee1916b634..49aaea637e3703769d9beb60d1e951b8471ceedc 100755
--- a/applications/utilities/mesh/manipulation/setSet/Allwmake
+++ b/applications/utilities/mesh/manipulation/setSet/Allwmake
@@ -11,7 +11,7 @@ unset COMP_FLAGS LINK_FLAGS
 #
 if [ -f /usr/include/readline/readline.h ]
 then
-    echo "Found <readline/readline.h>  --  enabling readline support."
+    echo "    found <readline/readline.h>  --  enabling readline support."
     export COMP_FLAGS="-DHAS_READLINE"
     export LINK_FLAGS="-lreadline"
 fi
diff --git a/applications/utilities/mesh/manipulation/topoSet/topoSet.C b/applications/utilities/mesh/manipulation/topoSet/topoSet.C
index d5e5358bf55450000ee441cc8cf621ffcc218c00..eb03d855f1682c2e4fb7a311fb45ea845a9f8cce 100644
--- a/applications/utilities/mesh/manipulation/topoSet/topoSet.C
+++ b/applications/utilities/mesh/manipulation/topoSet/topoSet.C
@@ -36,9 +36,6 @@ Description
 #include "Time.H"
 #include "polyMesh.H"
 #include "topoSetSource.H"
-#include "cellSet.H"
-#include "faceSet.H"
-#include "pointSet.H"
 #include "globalMeshData.H"
 #include "timeSelector.H"
 #include "IOobjectList.H"
diff --git a/applications/utilities/mesh/manipulation/topoSet/topoSetDict b/applications/utilities/mesh/manipulation/topoSet/topoSetDict
index e5b372e0c9066f0932aea06038e9ef447ceb8371..d4ea1bd2a38950cc2a717f64c031019764538c45 100644
--- a/applications/utilities/mesh/manipulation/topoSet/topoSetDict
+++ b/applications/utilities/mesh/manipulation/topoSet/topoSetDict
@@ -342,8 +342,12 @@ FoamFile
 //
 // cellZoneSet
 // ~~~~~~~~~~~
-// (mirrors operations on a cellSet into a cellZone)
+// Manipulates a cellZone (as well as a cellSet)
+// Takes any cellSet source. The difference with a cellSet is
+// - reads the cells from the cellZone, not the cellSet
+// - write to the cellZone as well as the cellSet
 //
+// For backwards compatibility:
 //    // Select based on cellSet
 //    source setToCellZone;
 //    sourceInfo
@@ -355,6 +359,9 @@ FoamFile
 //
 // faceZoneSet
 // ~~~~~~~~~~~
+// Manipulates a faceZone (as well as a faceSet). It can only be used
+// with two special sources:
+//
 //    // Select based on faceSet without orientation
 //    source setToFaceZone;
 //    sourceInfo
@@ -394,17 +401,19 @@ FoamFile
 //
 // pointZoneSet
 // ~~~~~~~~~~~~
-// (mirrors operations on a pointSet into a pointZone)
+// Manipulates a pointZone (as well as a pointSet)
+// Takes any pointSet source. The difference with a pointSet is
+// - reads the cells from the pointZone, not the pointSet
+// - write to the pointZone as well as the pointSet
 //
+// For backwards compatibility:
 //    // Select based on pointSet
 //    source setToPointZone;
 //    sourceInfo
 //    {
 //        set p0;           // name of pointSet
 //    }
-//
-//
-//
+
 
 actions
 (
@@ -465,6 +474,19 @@ actions
             option  all;
         }
     }
+
+
+    // Example: create cellZone from geometric region
+    {
+        name    c0;
+        type    cellZoneSet;
+        action  new;
+        source  boxToCell;
+        sourceInfo
+        {
+            box   (0.04 0 0)(0.06 100 100);
+        }
+    }
 );
 
 // ************************************************************************* //
diff --git a/applications/utilities/miscellaneous/foamDictionary/foamDictionary.C b/applications/utilities/miscellaneous/foamDictionary/foamDictionary.C
index 7cd62abbdcad8f1c456d935108a88d31bda40c0d..2528355e11756e689128d73b21d715a030d94e13 100644
--- a/applications/utilities/miscellaneous/foamDictionary/foamDictionary.C
+++ b/applications/utilities/miscellaneous/foamDictionary/foamDictionary.C
@@ -57,6 +57,9 @@ Usage
       - \par -includes
         List the \c #include and \c #includeIfPresent files to standard output
 
+      - \par -disableFunctionEntries
+        Do not expand macros or directives (#include etc)
+
     Example usage:
       - Change simulation to run for one timestep only:
         \verbatim
@@ -97,6 +100,15 @@ Usage
             -entry boundaryField
         \endverbatim
 
+      - Change patch type:
+        \verbatim
+          foamDictionary constant/polyMesh/boundary \
+            -entry entry0.fixedWalls.type -set patch
+        \endverbatim
+        This uses special parsing of Lists which stores these in the
+        dictionary with keyword 'entryDDD' where DDD is the position
+        in the dictionary (after ignoring the FoamFile entry).
+
 \*---------------------------------------------------------------------------*/
 
 #include "argList.H"
@@ -271,6 +283,11 @@ int main(int argc, char *argv[])
         "Read the specified dictionary file, expand the macros etc. and write "
         "the resulting dictionary to standard output"
     );
+    argList::addBoolOption
+    (
+        "disableFunctionEntries",
+        "Disable expansion of dictionary directives - #include, #codeStream etc"
+    );
 
     argList args(argc, argv);
 
@@ -281,6 +298,15 @@ int main(int argc, char *argv[])
         Foam::functionEntries::includeEntry::log = true;
     }
 
+    const bool disableEntries = args.optionFound("disableFunctionEntries");
+    if (disableEntries)
+    {
+        Info<< "Not expanding variables or dictionary directives"
+            << endl;
+        entry::disableFunctionEntries = true;
+    }
+
+
     fileName dictFileName(args[1]);
 
     autoPtr<IFstream> dictFile(new IFstream(dictFileName));
@@ -460,7 +486,7 @@ int main(int argc, char *argv[])
             {
                 FatalIOErrorInFunction(dictFile)
                     << "Cannot find entry " << entryName
-                    << exit(FatalError, 2);
+                    << exit(FatalIOError, 2);
             }
         }
     }
diff --git a/applications/utilities/miscellaneous/foamHelp/Allwmake b/applications/utilities/miscellaneous/foamHelp/Allwmake
index 87d2293c26cdda0bec79d616720da31c23dc0194..c00e52a8980ad58c92d7ea61a7ea3bef2a87d584 100755
--- a/applications/utilities/miscellaneous/foamHelp/Allwmake
+++ b/applications/utilities/miscellaneous/foamHelp/Allwmake
@@ -3,7 +3,6 @@ cd ${0%/*} || exit 1    # Run from this directory
 
 # Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-set -x
 
 wmake $targetType helpTypes
 wmake $targetType
diff --git a/applications/utilities/postProcessing/dataConversion/foamToVTK/Allwmake b/applications/utilities/postProcessing/dataConversion/foamToVTK/Allwmake
index 150ac3019a1694c64b273db6f3595ae754d8a2f6..81e0196f99b5ec655b542da25f8471c882e135fd 100755
--- a/applications/utilities/postProcessing/dataConversion/foamToVTK/Allwmake
+++ b/applications/utilities/postProcessing/dataConversion/foamToVTK/Allwmake
@@ -3,7 +3,6 @@ cd ${0%/*} || exit 1    # Run from this directory
 
 # Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-set -x
 
 wmake $targetType foamToVTK
 wmake $targetType
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/CMakeLists.txt
index 7fb8a8170e7215f253058491a248bf4958f63413..49e64bf76ca0ed0959aa7fb07dfe7d97c998acaa 100644
--- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/CMakeLists.txt
+++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/CMakeLists.txt
@@ -78,9 +78,9 @@ ENDIF()
 TARGET_LINK_LIBRARIES(
     PVFoamReader_SM
     LINK_PUBLIC
-    OpenFOAM
-    finiteVolume
     vtkPVFoam
+    finiteVolume
+    OpenFOAM
 )
 
 #-----------------------------------------------------------------------------
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/pqPVFoamReaderPanel.h b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/pqPVFoamReaderPanel.h
index 2bdeaa6028b6c3a919309bffdea030b5dd3c8990..6ca0f3f7a5adbc8f80cfa1ba19a9752150491f86 100644
--- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/pqPVFoamReaderPanel.h
+++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/pqPVFoamReaderPanel.h
@@ -106,10 +106,6 @@ public:
 
         //- Construct from components
         pqPVFoamReaderPanel(pqProxy*, QWidget*);
-
-
-    //- Destructor
-    // virtual ~pqPVFoamReaderPanel();
 };
 
 
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/CMakeLists.txt
index aa15cc40551b587f23fffce3c78c6aa0434f9a8f..34c9353fe93d4a113802374e0db59d5be0d60344 100644
--- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/CMakeLists.txt
+++ b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/CMakeLists.txt
@@ -79,9 +79,9 @@ ENDIF()
 TARGET_LINK_LIBRARIES(
     PVblockMeshReader_SM
     LINK_PUBLIC
-    OpenFOAM
-    blockMesh
     vtkPVblockMesh
+    blockMesh
+    OpenFOAM
 )
 
 #-----------------------------------------------------------------------------
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/PVblockMeshReader_SM.xml b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/PVblockMeshReader_SM.xml
index 3a80fe5136d5529bd50aa54fe7d5fe86cc0373cd..28df8ae78bec86b37d6bf9bc5107c9bac2545227 100644
--- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/PVblockMeshReader_SM.xml
+++ b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/PVblockMeshReader_SM.xml
@@ -30,16 +30,17 @@
       </Documentation>
     </IntVectorProperty>
 
-    <!-- Update GUI check box -->
+    <!-- Refresh button -->
     <IntVectorProperty
-      name="UpdateGUI"
-      command="SetUpdateGUI"
+      name="UiRefresh"
+      command="SetRefresh"
       number_of_elements="1"
+      is_internal="0"
       default_values="0"
       animateable="0">
       <BooleanDomain name="bool"/>
       <Documentation>
-        A simple way to cause a reader GUI modification.
+        Rescan for updated blockMeshDict.
       </Documentation>
     </IntVectorProperty>
 
@@ -102,6 +103,7 @@
 
   <Hints>
     <Property name="FileName" show="0"/>
+    <Property name="UiRefresh" show="0"/>
     <Property name="UiShowPointNumbers" show="0"/>
     <ReaderFactory extensions="blockMesh"
                    file_description="OpenFOAM blockMesh"/>
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/pqPVblockMeshReaderPanel.cxx b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/pqPVblockMeshReaderPanel.cxx
index 70b1489dd049dca2c49f741fcc09143edbd47fa7..06f0db328d7ed755a3f4d1fc563b673b01db7053 100644
--- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/pqPVblockMeshReaderPanel.cxx
+++ b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/pqPVblockMeshReaderPanel.cxx
@@ -58,12 +58,30 @@ pqPVblockMeshReaderPanel::pqPVblockMeshReaderPanel
 :
     pqAutoGeneratedObjectPanel(proxy, p)
 {
-    // create first sublayout (at top of the panel)
+    // Create first sublayout (at top of the panel)
     QGridLayout *form = new QGridLayout();
     this->PanelLayout->addLayout(form, 0, 0, 1, -1);
 
     vtkSMProperty* prop = 0;
-    // checkbox for showing point numbers
+
+    // Refresh button for updating blocks
+    if ((prop = this->proxy()->GetProperty("UiRefresh")) != 0)
+    {
+        prop->SetImmediateUpdate(1);
+        QPushButton* refresh = new QPushButton("Refresh");
+        refresh->setToolTip("Rescan for updated blockMeshDict.");
+
+        form->addWidget(refresh, 0, 0, Qt::AlignLeft);
+        QObject::connect
+        (
+            refresh,
+            SIGNAL(clicked()),
+            this,
+            SLOT(RefreshPressed())
+        );
+    }
+
+    // Checkbox for showing point numbers
     if ((prop = this->proxy()->GetProperty("UiShowPointNumbers")) != 0)
     {
         prop->SetImmediateUpdate(true);
@@ -97,7 +115,7 @@ void pqPVblockMeshReaderPanel::ShowPointNumbersToggled()
         this->proxy()->GetProperty("UiShowPointNumbers")
     )->SetElement(0, ShowPointNumbers_->isChecked());
 
-    // update the active view
+    // Update the active view
     if (this->view())
     {
         this->view()->render();
@@ -107,4 +125,19 @@ void pqPVblockMeshReaderPanel::ShowPointNumbersToggled()
 }
 
 
+void pqPVblockMeshReaderPanel::RefreshPressed()
+{
+    // Update everything
+    vtkSMIntVectorProperty::SafeDownCast
+    (
+        this->proxy()->GetProperty("UiRefresh")
+    )->Modified();
+
+    vtkSMSourceProxy::SafeDownCast(this->proxy())->UpdatePipeline();
+
+    // Render all views
+    pqApplicationCore::instance()->render();
+}
+
+
 // ************************************************************************* //
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/pqPVblockMeshReaderPanel.h b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/pqPVblockMeshReaderPanel.h
index f6a8acf247ac1f37be59052b0edf5cd2d92438a9..4c15bc374ea999c3c141cf694ec61de37e806bac 100644
--- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/pqPVblockMeshReaderPanel.h
+++ b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/pqPVblockMeshReaderPanel.h
@@ -67,6 +67,7 @@ class pqPVblockMeshReaderPanel
 protected slots:
 
     void ShowPointNumbersToggled();
+    void RefreshPressed();
 
 
 public:
@@ -75,10 +76,6 @@ public:
 
         //- Construct from components
         pqPVblockMeshReaderPanel(pqProxy*, QWidget*);
-
-
-    //- Destructor
-    // virtual ~pqPVblockMeshReaderPanel();
 };
 
 
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.cxx b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.cxx
index ce5b4a309afd6def23f532ff42b36be0391db6c9..6d559e7a3379b175bb22705be8db2c7610807746 100644
--- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.cxx
+++ b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.cxx
@@ -60,7 +60,6 @@ vtkPVblockMeshReader::vtkPVblockMeshReader()
     foamData_ = nullptr;
 
     ShowPointNumbers = 1;
-    UpdateGUI = 0;
 
     BlockSelection = vtkDataArraySelection::New();
     CurvedEdgesSelection = vtkDataArraySelection::New();
@@ -97,7 +96,7 @@ vtkPVblockMeshReader::~vtkPVblockMeshReader()
 
     if (foamData_)
     {
-        // remove point numbers
+        // Remove point numbers
         updatePointNumbersView(false);
         delete foamData_;
     }
@@ -117,7 +116,6 @@ vtkPVblockMeshReader::~vtkPVblockMeshReader()
 
 // * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * * //
 
-// Do everything except set the output info
 int vtkPVblockMeshReader::RequestInformation
 (
     vtkInformation* vtkNotUsed(request),
@@ -158,23 +156,10 @@ int vtkPVblockMeshReader::RequestInformation
         foamData_->updateInfo();
     }
 
-    // might need some other type of error handling
-
-//    {
-//        vtkErrorMacro("could not find valid OpenFOAM blockMesh");
-//
-//        // delete foamData and flag it as fatal error
-//        delete foamData_;
-//        foamData_ = nullptr;
-//        return 0;
-//    }
-
-
     return 1;
 }
 
 
-// Set the output info
 int vtkPVblockMeshReader::RequestData
 (
     vtkInformation* vtkNotUsed(request),
@@ -190,7 +175,7 @@ int vtkPVblockMeshReader::RequestData
         return 0;
     }
 
-    // catch previous error
+    // Catch previous error
     if (!foamData_)
     {
         vtkErrorMacro("Reader failed - perhaps no mesh?");
@@ -233,6 +218,19 @@ int vtkPVblockMeshReader::RequestData
 }
 
 
+void vtkPVblockMeshReader::SetRefresh(int val)
+{
+    // Delete the current blockMesh to force re-read and update
+    if (foamData_)
+    {
+        updatePointNumbersView(false);
+        delete foamData_;
+        foamData_ = 0;
+    }
+
+    Modified();
+}
+
 
 void vtkPVblockMeshReader::SetShowPointNumbers(const int val)
 {
@@ -248,7 +246,7 @@ void vtkPVblockMeshReader::updatePointNumbersView(const bool show)
 {
     pqApplicationCore* appCore = pqApplicationCore::instance();
 
-    // need to check this, since our destructor calls this
+    // Need to check this, since our destructor calls this
     if (!appCore)
     {
         return;
@@ -273,7 +271,7 @@ void vtkPVblockMeshReader::updatePointNumbersView(const bool show)
         );
     }
 
-    // use refresh here?
+    // Use refresh here?
 }
 
 
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.h b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.h
index a08c85acb46ed248a4401df1535828ccedd6caad..b160b7c035f5e76eaec2749e0711c1d36205920e 100644
--- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.h
+++ b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.h
@@ -77,10 +77,8 @@ public:
     vtkGetMacro(ShowPointNumbers, int);
 
     // Description:
-    // GUI update control
-    vtkSetMacro(UpdateGUI, int);
-    vtkGetMacro(UpdateGUI, int);
-
+    // Refresh blockMesh from changes to blockMeshDict
+    virtual void SetRefresh(int);
 
     // Description:
     // Blocks selection list control
@@ -158,9 +156,6 @@ private:
     //- Show Point Numbers
     int ShowPointNumbers;
 
-    //- Dummy variable/switch to invoke a reader update
-    int UpdateGUI;
-
     vtkDataArraySelection* BlockSelection;
 
     vtkDataArraySelection* CurvedEdgesSelection;
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/vtkPVblockMesh.C b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/vtkPVblockMesh.C
index a9932ffcc9aaba492b4f1c12a9caed3e2061f017..dd40c8e359459f850f56ca0f0fcc89db47b557b2 100644
--- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/vtkPVblockMesh.C
+++ b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/vtkPVblockMesh.C
@@ -72,12 +72,17 @@ void Foam::vtkPVblockMesh::updateInfoBlocks
     arrayRangeBlocks_.reset( arraySelection->GetNumberOfArrays() );
 
     const blockMesh& blkMesh = *meshPtr_;
+
     const int nBlocks = blkMesh.size();
     for (int blockI = 0; blockI < nBlocks; ++blockI)
     {
         const blockDescriptor& blockDef = blkMesh[blockI];
 
-        word partName = Foam::name(blockI);
+        // Display either blockI as a number or with its name
+        // (looked up from blockMeshDict)
+        OStringStream os;
+        blockDescriptor::write(os, blockI, blkMesh.meshDict());
+        word partName(os.str());
 
         // append the (optional) zone name
         if (!blockDef.zoneName().empty())
@@ -121,9 +126,10 @@ void Foam::vtkPVblockMesh::updateInfoEdges
     forAll(edges, edgeI)
     {
         OStringStream ostr;
-
-        ostr<< edges[edgeI].start() << ":" << edges[edgeI].end() << " - "
-            << edges[edgeI].type();
+        blockVertex::write(ostr, edges[edgeI].start(), blkMesh.meshDict());
+        ostr<< ":";
+        blockVertex::write(ostr, edges[edgeI].end(), blkMesh.meshDict());
+        ostr << " - " << edges[edgeI].type();
 
         // Add "beg:end - type" to GUI list
         arraySelection->AddArray(ostr.str().c_str());
@@ -352,7 +358,9 @@ void Foam::vtkPVblockMesh::updateFoamMesh()
             dictPath = dbPtr_().constant()/polyMesh::meshSubDir/dictName;
         }
 
-        IOdictionary meshDict
+        // Store dictionary since is used as database inside blockMesh class
+        // for names of vertices and blocks
+        IOdictionary* meshDictPtr = new IOdictionary
         (
             IOobject
             (
@@ -360,11 +368,12 @@ void Foam::vtkPVblockMesh::updateFoamMesh()
                 dbPtr_(),
                 IOobject::MUST_READ_IF_MODIFIED,
                 IOobject::NO_WRITE,
-                false
+                true
             )
         );
+        meshDictPtr->store();
 
-        meshPtr_ = new blockMesh(meshDict, meshRegion_);
+        meshPtr_ = new blockMesh(*meshDictPtr, meshRegion_);
     }
 
 
@@ -429,15 +438,22 @@ void Foam::vtkPVblockMesh::renderPointNumbers
 
     if (show && meshPtr_)
     {
-        const pointField& cornerPts = meshPtr_->vertices();
-        const scalar scaleFactor = meshPtr_->scaleFactor();
+        const blockMesh& blkMesh = *meshPtr_;
+        const pointField& cornerPts = blkMesh.vertices();
+        const scalar scaleFactor = blkMesh.scaleFactor();
 
         pointNumberTextActorsPtrs_.setSize(cornerPts.size());
         forAll(cornerPts, pointi)
         {
             vtkTextActor* txt = vtkTextActor::New();
 
-            txt->SetInput(Foam::name(pointi).c_str());
+            // Display either pointi as a number or with its name
+            // (looked up from blockMeshDict)
+            {
+                OStringStream os;
+                blockVertex::write(os, pointi, blkMesh.meshDict());
+                txt->SetInput(os.str().c_str());
+            }
 
             // Set text properties
             vtkTextProperty* tprop = txt->GetTextProperty();
diff --git a/applications/utilities/preProcessing/setFields/setFields.C b/applications/utilities/preProcessing/setFields/setFields.C
index e30d26d0ed47bbd1cfc4561ce9e3ac5ef76bfe8a..0510d50bb9066a93178704aa95ea71806d67d73c 100644
--- a/applications/utilities/preProcessing/setFields/setFields.C
+++ b/applications/utilities/preProcessing/setFields/setFields.C
@@ -384,24 +384,18 @@ public:
 
 int main(int argc, char *argv[])
 {
+    #include "addDictOption.H"
     #include "addRegionOption.H"
     #include "setRootCase.H"
     #include "createTime.H"
     #include "createNamedMesh.H"
 
-    Info<< "Reading setFieldsDict\n" << endl;
+    const word dictName("setFieldsDict");
+    #include "setSystemMeshDictionaryIO.H"
 
-    IOdictionary setFieldsDict
-    (
-        IOobject
-        (
-            "setFieldsDict",
-            runTime.system(),
-            mesh,
-            IOobject::MUST_READ_IF_MODIFIED,
-            IOobject::NO_WRITE
-        )
-    );
+    Info<< "Reading " << dictName << "\n" << endl;
+
+    IOdictionary setFieldsDict(dictIO);
 
     if (setFieldsDict.found("defaultFieldValues"))
     {
diff --git a/applications/utilities/preProcessing/wallFunctionTable/Allwmake b/applications/utilities/preProcessing/wallFunctionTable/Allwmake
index 2aa17958a9516b17caef9b12382e3682eff7724e..06612a9c67435428e96cbee217ea6cb2cf385606 100755
--- a/applications/utilities/preProcessing/wallFunctionTable/Allwmake
+++ b/applications/utilities/preProcessing/wallFunctionTable/Allwmake
@@ -3,7 +3,6 @@ cd ${0%/*} || exit 1    # Run from this directory
 
 # Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-set -x
 
 wmake $targetType tabulatedWallFunction
 wmake $targetType
diff --git a/bin/foamTags b/bin/foamTags
index aca6e45bc3d1601b6b11fae1da5cc3f3f37db312..ec881c5eb5c4d4b7d3f96cddf4d2326ac820a9e7 100755
--- a/bin/foamTags
+++ b/bin/foamTags
@@ -3,7 +3,7 @@
 # =========                 |
 # \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
 #  \\    /   O peration     |
-#   \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
+#   \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
 #    \\/     M anipulation  |
 #-------------------------------------------------------------------------------
 # License
@@ -46,8 +46,7 @@ then
     exit 1
 fi
 
-
-for cmd in etags ectags
+for cmd in etags ctags-exuberant
 do
     type $cmd >/dev/null 2>&1 || {
         echo "${0##*/} cannot build tag files: '$cmd' command not found"
@@ -55,29 +54,16 @@ do
     }
 done
 
-
 cd $WM_PROJECT_DIR || exit 1
 mkdir .tags 2>/dev/null
 
-
-etagsCmd="etags --declarations -l c++ -o .tags/etags -"
-#etagsDefCmd="etags -l c++ -o .tags/etagsDef -"
-#etagsDecCmd="etags --declarations -l c++ -o .tags/etagsDec -"
-
-etagsCmd="ectags -e --extra=+fq --file-scope=no --c-kinds=+p -o .tags/etags -L -"
-etagsDefCmd="ectags -e --extra=+fq --file-scope=no -o .tags/etagsDef -L -"
-etagsDecCmd="ectags -e --extra=+fq --file-scope=no --c-kinds=+p -o .tags/etagsDec -L -"
-
-ectagsDecCmd="ectags -o .tags/ectagsDec --file-scope=no --c-kinds=+p --excmd=n --extra=+fq --fields=+afiKmnsSzt -L -"
+#etagsCmd="etags --declarations -l c++ -o .tags/etags -"
+etagsCmd="ctags-exuberant -e --extra=+fq --file-scope=no --c-kinds=+p -o .tags/etags -L -"
 
 find -H $WM_PROJECT_DIR \( -name "*.[HC]" -o -name lnInclude -prune -o -name Doxygen -prune \) | $etagsCmd
-find -H $WM_PROJECT_DIR \( -name "*.[HC]" -o -name lnInclude -prune -o -name Doxygen -prune \) | $etagsDefCmd
-find -H $WM_PROJECT_DIR \( -name "*.H" -o -name lnInclude -prune -o -name Doxygen -prune \) | $etagsDecCmd
-find -H $WM_PROJECT_DIR \( -name "*.H" -o -name lnInclude -prune -o -name Doxygen -prune \) | $ectagsDecCmd
-
-gtags -i --gtagsconf bin/tools/gtagsrc .tags
 
-foamEbrowse
+#gtags -i --gtagsconf bin/tools/gtagsrc .tags
 
+#foamEbrowse
 
 #------------------------------------------------------------------------------
diff --git a/bin/tools/MakefileDirs b/bin/tools/MakefileDirs
index 1a0c45ba2d9985cdc78c2b1f7fd90d76b8da41f8..183c424bc4694a1aa1b3d0454dd8d4b768897fdb 100644
--- a/bin/tools/MakefileDirs
+++ b/bin/tools/MakefileDirs
@@ -1,8 +1,8 @@
-#-------------------------------*- makefile -*---------------------------------
+#----------------------------*- makefile-gmake -*------------------------------
 # =========                 |
 # \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
 #  \\    /   O peration     |
-#   \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+#   \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
 #    \\/     M anipulation  |
 #------------------------------------------------------------------------------
 # License
diff --git a/bin/tools/foamLog.db b/bin/tools/foamLog.db
index 08077630c89fbcc62a080e0d5779a30200c292b4..ed9f55c5abbab16b57c382b59cff72a3202b8719 100644
--- a/bin/tools/foamLog.db
+++ b/bin/tools/foamLog.db
@@ -36,8 +36,9 @@ contCumulative/time step continuity errors :/cumulative =
 minFu/min\(fu\) = /min(fu) = 
 minFt/min\(ft\) = /min(ft) = 
 
-#- Execution time:
+#- Timing:
 executionTime/ExecutionTime = /ExecutionTime = 
+clockTime/ClockTime = /ClockTime =
 
 #- Interface Courant no:
 IntCourantMax/Interface Courant Number /max: 
diff --git a/doc/Allwmake b/doc/Allwmake
index ba28b7955fcc22fcb22b32bd8cc44555c0d388d4..f6684e337c50d0946ec6e957bddbd74d3c57bd00 100755
--- a/doc/Allwmake
+++ b/doc/Allwmake
@@ -1,6 +1,5 @@
 #!/bin/sh
 cd ${0%/*} || exit 1    # Run from this directory
-set -x
 
 # fix permissions (NB: '+X' and not '+x'!)
 chmod a+rX $WM_PROJECT_DIR $WM_PROJECT_DIR/doc Doxygen
diff --git a/doc/Doxygen/Allwmake b/doc/Doxygen/Allwmake
index c065d2a9258c18d44a8cf332f4fbd18d0a941410..8ca2ed256d326b4115cdb17b208039a72bfc71de 100755
--- a/doc/Doxygen/Allwmake
+++ b/doc/Doxygen/Allwmake
@@ -2,9 +2,9 @@
 cd ${0%/*} || exit 1    # Run from this directory
 
 [ -d "$WM_PROJECT_DIR" ] || {
-    echo "Error: WM_PROJECT_DIR directory does not exist"
-    echo "    Check the OpenFOAM entries in your dot-files and source them."
-    echo "    WM_PROJECT_DIR=$WM_PROJECT_DIR"
+    echo "    Error: WM_PROJECT_DIR directory does not exist"
+    echo "        Check the OpenFOAM entries in your dot-files and source them."
+    echo "        WM_PROJECT_DIR=$WM_PROJECT_DIR"
     exit 1
 }
 
@@ -58,7 +58,6 @@ do
 done
 
 #------------------------------------------------------------------------------
-set -x
 
 rm -rf latex man
 
diff --git a/doc/tools/find-its b/doc/tools/find-its
deleted file mode 100755
index 44c85130fbf5bfe768275105b99a0a86361b2ce0..0000000000000000000000000000000000000000
--- a/doc/tools/find-its
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-#------------------------------------------------------------------------------
-# Script
-#     find-its
-#
-# Description
-#     Search for files with "it's"
-#     This contraction (== "it is") looks too much like "its" (possesive)
-#     and confuses non-native (and some native) English speakers.
-#
-#------------------------------------------------------------------------------
-set -x
-cd $WM_PROJECT_DIR || exit 1
-
-git grep -e "it's"
-
-#------------------------------------------------------------------------------
diff --git a/doc/tools/find-trailingspace b/doc/tools/find-trailingspace
index a7bf8390f20a989f494130a157e55d6390e0b56a..1dfcf1ed3ebf38a6478693dcccc86b3d819a5b46 100755
--- a/doc/tools/find-trailingspace
+++ b/doc/tools/find-trailingspace
@@ -7,7 +7,6 @@
 #     Search for files with trailing whitesapce
 #
 #------------------------------------------------------------------------------
-set -x
 cd $WM_PROJECT_DIR || exit 1
 
 tab=$'\t'
diff --git a/etc/bashrc b/etc/bashrc
index c4fc2e21dfb5afa25921fe251894b611a1997281..dd9b7807e2f0831df6a970ee5d18f77e320ad84b 100644
--- a/etc/bashrc
+++ b/etc/bashrc
@@ -61,7 +61,7 @@ export FOAM_INST_DIR
 export WM_COMPILER_TYPE=system
 
 #- Compiler:
-#    WM_COMPILER = Gcc | Gcc4[5-9] | Gcc5[1-4] | Gcc61 | Clang | Icc
+#    WM_COMPILER = Gcc | Gcc4[8-9] | Gcc5[1-4] | Gcc6[1-2] | Clang | Icc
 export WM_COMPILER=Gcc
 unset WM_COMPILER_ARCH WM_COMPILER_LIB_ARCH
 
@@ -85,7 +85,7 @@ export WM_COMPILE_OPTION=Opt
 
 #- MPI implementation:
 #    WM_MPLIB = SYSTEMOPENMPI | OPENMPI | SYSTEMMPI | MPICH | MPICH-GM | HPMPI
-#               | MPI | QSMPI | SGIMPI
+#               | MPI | FJMPI | QSMPI | SGIMPI | INTELMPI
 export WM_MPLIB=SYSTEMOPENMPI
 
 #- Operating System:
diff --git a/etc/caseDicts/postProcessing/fields/add b/etc/caseDicts/postProcessing/fields/add
new file mode 100644
index 0000000000000000000000000000000000000000..3eea74aff96977d5254964f4b945fb3253f634ed
--- /dev/null
+++ b/etc/caseDicts/postProcessing/fields/add
@@ -0,0 +1,21 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Web:      www.OpenFOAM.org
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+Description
+    Add a list of fields.
+
+\*---------------------------------------------------------------------------*/
+
+type            add;
+libs            ("libfieldFunctionObjects.so");
+
+fields          (<field names>);
+
+executeControl  writeTime;
+writeControl    writeTime;
+
+// ************************************************************************* //
diff --git a/etc/caseDicts/postProcessing/fields/subtract b/etc/caseDicts/postProcessing/fields/subtract
new file mode 100644
index 0000000000000000000000000000000000000000..6f9126cd7de5ef78e2dd2351c25aee7fda481dd5
--- /dev/null
+++ b/etc/caseDicts/postProcessing/fields/subtract
@@ -0,0 +1,21 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Web:      www.OpenFOAM.org
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+Description
+    From the first field subtract the remaining fields in the list.
+
+\*---------------------------------------------------------------------------*/
+
+type            subtract;
+libs            ("libfieldFunctionObjects.so");
+
+fields          (<field names>);
+
+executeControl  writeTime;
+writeControl    writeTime;
+
+// ************************************************************************* //
diff --git a/etc/config.csh/paraview b/etc/config.csh/paraview
index d768864f30a27007d2e994bb0b7347e290ed6dc3..1f017c8e7df7f4325a8a65bc10154a1c8dd26d16 100644
--- a/etc/config.csh/paraview
+++ b/etc/config.csh/paraview
@@ -58,6 +58,8 @@ set cmake_version=cmake-system
 
 #------------------------------------------------------------------------------
 
+if ( ! $?ParaView_DIR ) setenv ParaView_DIR
+
 # Clean the PATH
 if ( ! $?ParaView_DIR ) setenv ParaView_DIR
 set cleaned=`$WM_PROJECT_DIR/bin/foamCleanPath "$PATH" "$ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/cmake- $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-"`
diff --git a/etc/config.sh/compiler b/etc/config.sh/compiler
index f49f2857460a5f52835421a3ccfe98ac4f0c0a34..5777a1fa8044843e5395460e9f0bfa7283ae916d 100644
--- a/etc/config.sh/compiler
+++ b/etc/config.sh/compiler
@@ -41,9 +41,6 @@ ThirdParty)
     Gcc | Gcc48)
         gcc_version=gcc-4.8.5
         ;;
-    Gcc47)
-        gcc_version=gcc-4.7.4
-        ;;
     Gcc49)
         gcc_version=gcc-4.9.3
         ;;
diff --git a/etc/controlDict b/etc/controlDict
index 1334cc1bb1e1e6128f998ecff0a75bb1f92797c1..26657f8745866428e850d64ecd3ba13766c7481a 100644
--- a/etc/controlDict
+++ b/etc/controlDict
@@ -888,7 +888,6 @@ DebugSwitches
     wallHeatTransfer    0;
     wallLayerCells      0;
     wallModel           0;
-    warnUnboundedGauss  1;
     waveTransmissive    0;
     wedge               0;
     weighted            0;
diff --git a/etc/cshrc b/etc/cshrc
index 759413c0c856cd8561c42577a113df31ef10b3cd..3d52b585a4bfedf30280a128aa8f5f907dadf114 100644
--- a/etc/cshrc
+++ b/etc/cshrc
@@ -61,7 +61,7 @@ echo $FOAM_INST_DIR
 setenv WM_COMPILER_TYPE system
 
 #- Compiler:
-#    WM_COMPILER = Gcc | Gcc4[5-9] | Gcc5[1-4] | Gcc61 | Clang | Icc
+#    WM_COMPILER = Gcc | Gcc4[8-9] | Gcc5[1-4] | Gcc6[1-2] | Clang | Icc
 setenv WM_COMPILER Gcc
 setenv WM_COMPILER_ARCH # defined but empty
 unsetenv WM_COMPILER_LIB_ARCH
@@ -86,7 +86,7 @@ setenv WM_COMPILE_OPTION Opt
 
 #- MPI implementation:
 #    WM_MPLIB = SYSTEMOPENMPI | OPENMPI | SYSTEMMPI | MPICH | MPICH-GM | HPMPI
-#               | MPI | QSMPI | SGIMPI
+#               | MPI | FJMPI | QSMPI | SGIMPI | INTELMPI
 setenv WM_MPLIB SYSTEMOPENMPI
 
 #- Operating System:
diff --git a/src/Allwmake b/src/Allwmake
index 511c735a7e5a4174a4442b5e2d4874f5ac0e0f0d..96b82df71a96cc16414f27ef33110ac760bf5d4f 100755
--- a/src/Allwmake
+++ b/src/Allwmake
@@ -17,8 +17,6 @@ wmakeCheckPwd "$WM_PROJECT_DIR/src" || {
     exit 1
 }
 
-set -x
-
 # Update OpenFOAM version strings if required
 wmakePrintBuild -check || wrmo OpenFOAM/global/global.o 2>/dev/null
 
diff --git a/src/ODE/ODESolvers/ODESolver/ODESolver.C b/src/ODE/ODESolvers/ODESolver/ODESolver.C
index 3dce5378e3982b514f9ff2cd7586656afff8288a..69d8b5879c568e633c3e89f24ead68118f9eb16e 100644
--- a/src/ODE/ODESolvers/ODESolver/ODESolver.C
+++ b/src/ODE/ODESolvers/ODESolver/ODESolver.C
@@ -34,7 +34,7 @@ namespace Foam
 }
 
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 Foam::scalar Foam::ODESolver::normalizeError
 (
diff --git a/src/OSspecific/POSIX/Allwmake b/src/OSspecific/POSIX/Allwmake
index bd5b6259b99029ca91e05abbd70aec45e33b8dc2..d932523c9221dfd1ea7bc6400db0c0c6d3b4fa8f 100755
--- a/src/OSspecific/POSIX/Allwmake
+++ b/src/OSspecific/POSIX/Allwmake
@@ -12,7 +12,7 @@ unset COMP_FLAGS LINK_FLAGS
 #
 if [ -f /usr/include/sys/inotify.h ]
 then
-    echo "Found <sys/inotify.h>  --  enabling inotify for file monitoring."
+    echo "    found <sys/inotify.h>  --  enabling inotify for file monitoring."
     export COMP_FLAGS="-DFOAM_USE_INOTIFY"
 else
     unset COMP_FLAGS
diff --git a/src/OSspecific/POSIX/POSIX.C b/src/OSspecific/POSIX/POSIX.C
index 5548e5f54f38f8368d5da827eb6607164c5c0d97..790170941b9dd8029156ba8e47b1908338e7d471 100644
--- a/src/OSspecific/POSIX/POSIX.C
+++ b/src/OSspecific/POSIX/POSIX.C
@@ -542,6 +542,22 @@ time_t Foam::lastModified(const fileName& name, const bool followLink)
 }
 
 
+double Foam::highResLastModified(const fileName& name)
+{
+    fileStat fileStatus(name);
+    if (fileStatus.isValid())
+    {
+        return
+            fileStatus.status().st_mtime
+          + 1e-9*fileStatus.status().st_atim.tv_nsec;
+    }
+    else
+    {
+        return 0;
+    }
+}
+
+
 Foam::fileNameList Foam::readDir
 (
     const fileName& directory,
diff --git a/src/OSspecific/POSIX/fileMonitor.C b/src/OSspecific/POSIX/fileMonitor.C
index d3f010f0939ea645402d4248b6b3f51ba520d282..ff7deb7538a1f9f7c307c4f2212b7590c46146ae 100644
--- a/src/OSspecific/POSIX/fileMonitor.C
+++ b/src/OSspecific/POSIX/fileMonitor.C
@@ -126,7 +126,7 @@ namespace Foam
         // For stat
 
             //- From watch descriptor to modified time
-            DynamicList<time_t> lastMod_;
+            DynamicList<double> lastMod_;
 
 
 
@@ -261,7 +261,7 @@ namespace Foam
                         << abort(FatalError);
                 }
 
-                lastMod_(watchFd) = lastModified(fName);
+                lastMod_(watchFd) = highResLastModified(fName);
             }
 
             return true;
@@ -395,12 +395,12 @@ void Foam::fileMonitor::checkFiles() const
     {
         forAll(watcher_->lastMod_, watchFd)
         {
-            time_t oldTime = watcher_->lastMod_[watchFd];
+            double oldTime = watcher_->lastMod_[watchFd];
 
             if (oldTime != 0)
             {
                 const fileName& fName = watchFile_[watchFd];
-                time_t newTime = lastModified(fName);
+                double newTime = highResLastModified(fName);
 
                 if (newTime == 0)
                 {
@@ -615,7 +615,7 @@ void Foam::fileMonitor::setUnmodified(const label watchFd)
 
     if (!useInotify_)
     {
-        watcher_->lastMod_[watchFd] = lastModified(watchFile_[watchFd]);
+        watcher_->lastMod_[watchFd] = highResLastModified(watchFile_[watchFd]);
     }
 }
 
diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files
index 7b9f07486b3447b786999e68d3e1f9a80b8fe6b1..b5c58d172911885e4d4dc045ecf78142ca04dc29 100644
--- a/src/OpenFOAM/Make/files
+++ b/src/OpenFOAM/Make/files
@@ -39,6 +39,7 @@ $(ints)/lists/labelListIOList.C
 primitives/Scalar/doubleScalar/doubleScalar.C
 primitives/Scalar/floatScalar/floatScalar.C
 primitives/Scalar/scalar/scalar.C
+primitives/Scalar/scalar/invIncGamma.C
 primitives/Scalar/lists/scalarList.C
 primitives/Scalar/lists/scalarIOList.C
 primitives/Scalar/lists/scalarListIOList.C
@@ -187,6 +188,10 @@ dictionaryEntry = $(dictionary)/dictionaryEntry
 $(dictionaryEntry)/dictionaryEntry.C
 $(dictionaryEntry)/dictionaryEntryIO.C
 
+dictionaryListEntry = $(dictionary)/dictionaryListEntry
+$(dictionaryListEntry)/dictionaryListEntry.C
+$(dictionaryListEntry)/dictionaryListEntryIO.C
+
 functionEntries = $(dictionary)/functionEntries
 $(functionEntries)/calcEntry/calcEntry.C
 $(functionEntries)/codeStream/codeStream.C
diff --git a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.H b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.H
index 0fb024f2d182688ce4ffab7c6e3b8d23e9e4a2a1..1d4c7d844f46b7079f4b64b724865749ce1448f7 100644
--- a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.H
+++ b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.H
@@ -119,7 +119,7 @@ private:
 
     // Static data
 
-        //- Relative peturbation tolerance. Determines when point is
+        //- Relative perturbation tolerance. Determines when point is
         //  considered to be close to face/edge of bb of node.
         //  The tolerance is relative to the bounding box of the smallest
         //  node.
diff --git a/src/OpenFOAM/containers/Dictionaries/DictionaryBase/DictionaryBase.C b/src/OpenFOAM/containers/Dictionaries/DictionaryBase/DictionaryBase.C
index d54b7fb3900499d2b47a6a6d48cce1038ec1a8cb..60b390223c2651a0d3e4d126582939ea16d382a5 100644
--- a/src/OpenFOAM/containers/Dictionaries/DictionaryBase/DictionaryBase.C
+++ b/src/OpenFOAM/containers/Dictionaries/DictionaryBase/DictionaryBase.C
@@ -25,7 +25,7 @@ License
 
 #include "DictionaryBase.H"
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 template<class IDLListType, class T>
 void Foam::DictionaryBase<IDLListType, T>::addEntries()
diff --git a/src/OpenFOAM/containers/Dictionaries/DictionaryBase/DictionaryBaseIO.C b/src/OpenFOAM/containers/Dictionaries/DictionaryBase/DictionaryBaseIO.C
index 24027496c7e96ba3b1050d1b69173a1713e32bec..1970653b5bc26ff33828c43b324bdf271ac83380 100644
--- a/src/OpenFOAM/containers/Dictionaries/DictionaryBase/DictionaryBaseIO.C
+++ b/src/OpenFOAM/containers/Dictionaries/DictionaryBase/DictionaryBaseIO.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -62,6 +62,4 @@ Foam::Ostream& Foam::operator<<
 }
 
 
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
 // ************************************************************************* //
diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H
index 609155d492618139b54d6848a4e2678d0a09bb07..5ecf80de6319b8caafca2394910665c50029014a 100644
--- a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H
+++ b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H
@@ -238,6 +238,7 @@ private:
             const label index
         );
 
+
 protected:
 
     // Protected data
diff --git a/src/OpenFOAM/db/Time/Time.C b/src/OpenFOAM/db/Time/Time.C
index 5ddb36617b4d29204362a557716550caa99ecb28..6aa26c2f7bc74f8f2795903b80fd09503924dca8 100644
--- a/src/OpenFOAM/db/Time/Time.C
+++ b/src/OpenFOAM/db/Time/Time.C
@@ -80,7 +80,7 @@ const int Foam::Time::maxPrecision_(3 - log10(SMALL));
 Foam::word Foam::Time::controlDictName("controlDict");
 
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 void Foam::Time::adjustDeltaT()
 {
diff --git a/src/OpenFOAM/db/Time/Time.H b/src/OpenFOAM/db/Time/Time.H
index 027288b193ce2d763429de7322ffb527764b5898..d6869a208f0233c5b05fbec9046d9ed95e721bbc 100644
--- a/src/OpenFOAM/db/Time/Time.H
+++ b/src/OpenFOAM/db/Time/Time.H
@@ -59,6 +59,7 @@ SourceFiles
 
 namespace Foam
 {
+
 // Forward declaration of classes
 class argList;
 
@@ -86,6 +87,7 @@ class Time
         //- The controlDict
         unwatchedIOdictionary controlDict_;
 
+
 public:
 
         //- Write control options
diff --git a/src/OpenFOAM/db/dictionary/dictionary.C b/src/OpenFOAM/db/dictionary/dictionary.C
index fcd2255caf3618d723630c8f2125e082cb064242..ea449f50e6dc5911a018b6e8df161300cbc45303 100644
--- a/src/OpenFOAM/db/dictionary/dictionary.C
+++ b/src/OpenFOAM/db/dictionary/dictionary.C
@@ -46,6 +46,131 @@ namespace Foam
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
 
+const Foam::entry* Foam::dictionary::lookupScopedSubEntryPtr
+(
+    const word& keyword,
+    bool recursive,
+    bool patternMatch
+) const
+{
+    string::size_type dotPos = keyword.find('.');
+
+    if (dotPos == string::npos)
+    {
+        // Non-scoped lookup
+        return lookupEntryPtr(keyword, recursive, patternMatch);
+    }
+    else
+    {
+        if (dotPos == 0)
+        {
+            // Starting with a '.'. Go up for every 2nd '.' found
+
+            const dictionary* dictPtr = this;
+
+            string::size_type begVar = dotPos + 1;
+            string::const_iterator iter = keyword.begin() + begVar;
+            string::size_type endVar = begVar;
+            while (iter != keyword.end() && *iter == '.')
+            {
+                ++iter;
+                ++endVar;
+
+                // Go to parent
+                if (&dictPtr->parent_ == &dictionary::null)
+                {
+                    FatalIOErrorInFunction
+                    (
+                        *this
+                    )   << "No parent of current dictionary"
+                        << " when searching for "
+                        << keyword.substr(begVar, keyword.size()-begVar)
+                        << exit(FatalIOError);
+                }
+                dictPtr = &dictPtr->parent_;
+            }
+
+            return dictPtr->lookupScopedSubEntryPtr
+            (
+                keyword.substr(endVar),
+                false,
+                patternMatch
+            );
+        }
+        else
+        {
+            // Extract the first word
+            word firstWord = keyword.substr(0, dotPos);
+
+            const entry* entPtr = lookupScopedSubEntryPtr
+            (
+                firstWord,
+                false,          //recursive
+                patternMatch
+            );
+
+            if (!entPtr)
+            {
+                // Fall back to finding key with '.' so e.g. if keyword is
+                // a.b.c.d it would try
+                // a.b, a.b.c, a.b.c.d
+
+                string::size_type nextDotPos = keyword.find
+                (
+                    '.',
+                    dotPos+1
+                );
+
+                while (true)
+                {
+                    const entry* subEntPtr = lookupEntryPtr
+                    (
+                        keyword.substr(0, nextDotPos),
+                        false,  //recursive,
+                        patternMatch
+                    );
+                    if (nextDotPos == string::npos)
+                    {
+                        // Parsed the whole word. Return entry or null.
+                        return subEntPtr;
+                    }
+
+                    if (subEntPtr && subEntPtr->isDict())
+                    {
+                        return subEntPtr->dict().lookupScopedSubEntryPtr
+                        (
+                            keyword.substr
+                            (
+                                nextDotPos,
+                                keyword.size()-nextDotPos
+                            ),
+                            false,
+                            patternMatch
+                        );
+                    }
+
+                    nextDotPos = keyword.find('.', nextDotPos+1);
+                }
+            }
+
+            if (entPtr->isDict())
+            {
+                return entPtr->dict().lookupScopedSubEntryPtr
+                (
+                    keyword.substr(dotPos, keyword.size()-dotPos),
+                    false,
+                    patternMatch
+                );
+            }
+            else
+            {
+                return nullptr;
+            }
+        }
+    }
+}
+
+
 bool Foam::dictionary::findInPatterns
 (
     const bool patternMatch,
@@ -473,7 +598,7 @@ const Foam::entry* Foam::dictionary::lookupScopedEntryPtr
         }
 
         // At top. Recurse to find entries
-        return dictPtr->lookupScopedEntryPtr
+        return dictPtr->lookupScopedSubEntryPtr
         (
             keyword.substr(1, keyword.size()-1),
             false,
@@ -482,93 +607,12 @@ const Foam::entry* Foam::dictionary::lookupScopedEntryPtr
     }
     else
     {
-        string::size_type dotPos = keyword.find('.');
-
-        if (dotPos == string::npos)
-        {
-            // Non-scoped lookup
-            return lookupEntryPtr(keyword, recursive, patternMatch);
-        }
-        else
-        {
-            if (dotPos == 0)
-            {
-                // Starting with a '.'. Go up for every 2nd '.' found
-
-                const dictionary* dictPtr = this;
-
-                string::size_type begVar = dotPos + 1;
-                string::const_iterator iter = keyword.begin() + begVar;
-                string::size_type endVar = begVar;
-                while
-                (
-                    iter != keyword.end()
-                 && *iter == '.'
-                )
-                {
-                    ++iter;
-                    ++endVar;
-
-                    // Go to parent
-                    if (&dictPtr->parent_ == &dictionary::null)
-                    {
-                        FatalIOErrorInFunction
-                        (
-                            *this
-                        )   << "No parent of current dictionary"
-                            << " when searching for "
-                            << keyword.substr(begVar, keyword.size()-begVar)
-                            << exit(FatalIOError);
-                    }
-                    dictPtr = &dictPtr->parent_;
-                }
-
-                return dictPtr->lookupScopedEntryPtr
-                (
-                    keyword.substr(endVar),
-                    false,
-                    patternMatch
-                );
-            }
-            else
-            {
-                // Extract the first word
-                word firstWord = keyword.substr(0, dotPos);
-
-                const entry* entPtr = lookupScopedEntryPtr
-                (
-                    firstWord,
-                    false,          //recursive
-                    patternMatch
-                );
-
-                if (!entPtr)
-                {
-                    FatalIOErrorInFunction
-                    (
-                        *this
-                    )   << "keyword " << firstWord
-                        << " is undefined in dictionary "
-                        << name() << endl
-                        << "Valid keywords are " << keys()
-                        << exit(FatalIOError);
-                }
-
-                if (entPtr->isDict())
-                {
-                    return entPtr->dict().lookupScopedEntryPtr
-                    (
-                        keyword.substr(dotPos, keyword.size()-dotPos),
-                        false,
-                        patternMatch
-                    );
-                }
-                else
-                {
-                    return nullptr;
-                }
-            }
-        }
+        return lookupScopedSubEntryPtr
+        (
+            keyword,
+            recursive,
+            patternMatch
+        );
     }
 }
 
@@ -628,6 +672,21 @@ const Foam::dictionary* Foam::dictionary::subDictPtr(const word& keyword) const
 }
 
 
+Foam::dictionary* Foam::dictionary::subDictPtr(const word& keyword)
+{
+    entry* entryPtr = lookupEntryPtr(keyword, false, true);
+
+    if (entryPtr)
+    {
+        return &entryPtr->dict();
+    }
+    else
+    {
+        return nullptr;
+    }
+}
+
+
 const Foam::dictionary& Foam::dictionary::subDict(const word& keyword) const
 {
     const entry* entryPtr = lookupEntryPtr(keyword, false, true);
diff --git a/src/OpenFOAM/db/dictionary/dictionary.H b/src/OpenFOAM/db/dictionary/dictionary.H
index 4a7c72843715d93358aac1d92195376a9453250e..6f03c6babcaf9152fc7b5db5ebfc3043ea28a2b0 100644
--- a/src/OpenFOAM/db/dictionary/dictionary.H
+++ b/src/OpenFOAM/db/dictionary/dictionary.H
@@ -161,6 +161,15 @@ class dictionary
 
    // Private Member Functions
 
+        //- Find and return an entry data stream pointer if present
+        //  otherwise return nullptr. Allows scoping using '.'
+        const entry* lookupScopedSubEntryPtr
+        (
+            const word&,
+            bool recursive,
+            bool patternMatch
+        ) const;
+
         //- Search patterns table for exact match or regular expression match
         bool findInPatterns
         (
@@ -364,7 +373,8 @@ public:
             ) const;
 
             //- Find and return an entry data stream pointer if present
-            //  otherwise return nullptr. Allows scoping using '.'
+            //  otherwise return nullptr. Allows scoping using '.'.
+            //  Special handling for ':' at start of keyword and '..'.
             const entry* lookupScopedEntryPtr
             (
                 const word&,
@@ -379,6 +389,10 @@ public:
             //  otherwise return nullptr.
             const dictionary* subDictPtr(const word&) const;
 
+            //- Find and return a sub-dictionary pointer if present
+            //  otherwise return nullptr.
+            dictionary* subDictPtr(const word&);
+
             //- Find and return a sub-dictionary
             const dictionary& subDict(const word&) const;
 
diff --git a/src/mesh/blockMesh/block/block.C b/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntry.C
similarity index 63%
rename from src/mesh/blockMesh/block/block.C
rename to src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntry.C
index 1722b0095ee0f51b8df67362ea10459fff768e9a..055a55b59de65fa61790c626cc5ac8d006d60d68 100644
--- a/src/mesh/blockMesh/block/block.C
+++ b/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntry.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -23,44 +23,18 @@ License
 
 \*---------------------------------------------------------------------------*/
 
-#include "block.H"
+#include "dictionaryListEntry.H"
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
-Foam::block::block
+Foam::dictionaryListEntry::dictionaryListEntry
 (
-    const pointField& vertices,
-    const blockEdgeList& edges,
-    const blockFaceList& faces,
-    Istream& is
+    const dictionary& parentDict,
+    const dictionaryListEntry& dictEnt
 )
 :
-    blockDescriptor(vertices, edges, faces, is)
-{
-    createPoints();
-    createBoundary();
-}
-
-
-Foam::block::block(const blockDescriptor& blockDesc)
-:
-    blockDescriptor(blockDesc)
-{
-    createPoints();
-    createBoundary();
-}
-
-
-// * * * * * * * * * * * * * * * IOstream Operators  * * * * * * * * * * * * //
-
-Foam::Ostream& Foam::operator<<(Ostream& os, const block& b)
-{
-    os << b.points() << nl
-       << b.cells() << nl
-       << b.boundaryPatches() << endl;
-
-    return os;
-}
+    dictionaryEntry(parentDict, dictEnt)
+{}
 
 
 // ************************************************************************* //
diff --git a/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntry.H b/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntry.H
new file mode 100644
index 0000000000000000000000000000000000000000..762bfaad9be35336718c98b676258f048425acab
--- /dev/null
+++ b/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntry.H
@@ -0,0 +1,127 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+Class
+    Foam::dictionaryListEntry
+
+Description
+    Read/write List of dictionaries.
+
+    The List entries get stored in a
+    dictionary which itself is stored in the parent dictionary with
+    keyword 'entryDDD' where DDD is the position in the parent dictionary.
+    The printing is again in List format - the keyword is only printed as
+    comment. Can be used to e.g. manipulate polyMesh/boundary files.
+
+SourceFiles
+    dictionaryListEntry.C
+    dictionaryListEntryIO.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef dictionaryListEntry_H
+#define dictionaryListEntry_H
+
+#include "dictionaryEntry.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// Forward declaration of friend functions and operators
+
+class dictionaryListEntry;
+
+Ostream& operator<<(Ostream&, const dictionaryListEntry&);
+
+
+/*---------------------------------------------------------------------------*\
+                     Class dictionaryListEntry Declaration
+\*---------------------------------------------------------------------------*/
+
+class dictionaryListEntry
+:
+    public dictionaryEntry
+{
+    // Private Member Functions
+
+        //- Returns size of dictionary without FoamFile
+        static label realSize(const dictionary&);
+
+        //- Dissallow bitwise copy
+        dictionaryListEntry(const dictionary&);
+
+
+public:
+
+    // Constructors
+
+        //- Construct from the parent dictionary and Istream
+        dictionaryListEntry(const dictionary& parentDict, Istream&);
+
+        //- Construct as copy for the given parent dictionary
+        dictionaryListEntry
+        (
+            const dictionary& parentDict,
+            const dictionaryListEntry&
+        );
+
+        autoPtr<entry> clone(const dictionary& parentDict) const
+        {
+            return autoPtr<entry>(new dictionaryListEntry(parentDict, *this));
+        }
+
+
+    // Member functions
+
+        //- Write
+        virtual void write(Ostream&) const;
+
+        //- Return info proxy.
+        //  Used to print token information to a stream
+        InfoProxy<dictionaryListEntry> info() const
+        {
+            return *this;
+        }
+
+
+    // Ostream operator
+
+        friend Ostream& operator<<(Ostream&, const dictionaryListEntry&);
+};
+
+
+template<>
+Ostream& operator<<(Ostream&, const InfoProxy<dictionaryListEntry>&);
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntryIO.C b/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntryIO.C
new file mode 100644
index 0000000000000000000000000000000000000000..7d31932e9a106fbd4aa04bc958a44aa4c03dd64d
--- /dev/null
+++ b/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntryIO.C
@@ -0,0 +1,147 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+\*---------------------------------------------------------------------------*/
+
+#include "dictionaryListEntry.H"
+#include "keyType.H"
+#include "IOstreams.H"
+
+// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+
+Foam::label Foam::dictionaryListEntry::realSize(const dictionary& dict)
+{
+    if (dict.size() < 1 || dict.first()->keyword() != "FoamFile")
+    {
+        return dict.size();
+    }
+    else
+    {
+        return dict.size() - 1;
+    }
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
+
+Foam::dictionaryListEntry::dictionaryListEntry
+(
+    const dictionary& parentDict,
+    Istream& is
+)
+:
+    dictionaryEntry
+    (
+        word("entry" + Foam::name(realSize(parentDict))),
+        parentDict,
+        dictionary::null
+    )
+{
+    token firstToken(is);
+    if (firstToken.isLabel())
+    {
+        label s = firstToken.labelToken();
+
+        is.readBeginList("List");
+
+        for (label i=0; i<s; i++)
+        {
+            entry::New(*this, is);
+        }
+        is.readEndList("List");
+    }
+    else if
+    (
+        firstToken.isPunctuation()
+     && firstToken.pToken() == token::BEGIN_LIST
+    )
+    {
+        while (true)
+        {
+            token nextToken(is);
+            if
+            (
+                nextToken.isPunctuation()
+             && nextToken.pToken() == token::END_LIST
+            )
+            {
+                break;
+            }
+            is.putBack(nextToken);
+            entry::New(*this, is);
+        }
+    }
+    else
+    {
+        FatalIOErrorInFunction(is)
+            << "incorrect first token, expected <int> or '(', found "
+            << firstToken.info()
+            << exit(FatalIOError);
+    }
+}
+
+
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
+
+void Foam::dictionaryListEntry::write(Ostream& os) const
+{
+    os  << nl << indent << size()
+        << token::SPACE << "// " << keyword() << nl
+        << indent << token::BEGIN_LIST << incrIndent << nl;
+
+    // Write contents
+    dictionary::write(os, false);
+
+    // Write end delimiter
+    os << decrIndent << indent << token::END_LIST << nl;
+
+    // Check state of IOstream
+    os.check("Ostream& operator<<(Ostream&, const dictionaryListEntry&)");
+}
+
+
+// * * * * * * * * * * * * * * Ostream operator  * * * * * * * * * * * * * * //
+
+Foam::Ostream& Foam::operator<<(Ostream& os, const dictionaryListEntry& de)
+{
+    de.write(os);
+    return os;
+}
+
+
+template<>
+Foam::Ostream& Foam::operator<<
+(
+    Ostream& os,
+    const InfoProxy<dictionaryListEntry>& ip
+)
+{
+    const dictionaryListEntry& e = ip.t_;
+
+    os  << "    dictionaryListEntry '" << e.keyword() << "'" << endl;
+
+    return os;
+}
+
+
+// ************************************************************************* //
diff --git a/src/OpenFOAM/db/dictionary/entry/entry.H b/src/OpenFOAM/db/dictionary/entry/entry.H
index 00373cb8da4890e63d4df6a12ecf80c6a3bfdc07..c37809927a6509034f4ecc3cda14958441bf20b5 100644
--- a/src/OpenFOAM/db/dictionary/entry/entry.H
+++ b/src/OpenFOAM/db/dictionary/entry/entry.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -75,6 +75,9 @@ class entry
 
     // Private Member Functions
 
+        //- Get the next valid keyword. Return true if is valid keyType.
+        static bool getKeyword(keyType&, token&, Istream&);
+
         //- Get the next valid keyword otherwise return false
         static bool getKeyword(keyType&, Istream&);
 
diff --git a/src/OpenFOAM/db/dictionary/entry/entryIO.C b/src/OpenFOAM/db/dictionary/entry/entryIO.C
index 48b539588be249c97711670afaeb89b79f544078..2a10aee4b89c73a6154fbc4483ccb83b9322bbbb 100644
--- a/src/OpenFOAM/db/dictionary/entry/entryIO.C
+++ b/src/OpenFOAM/db/dictionary/entry/entryIO.C
@@ -23,21 +23,19 @@ License
 
 \*---------------------------------------------------------------------------*/
 
+#include "entry.H"
 #include "primitiveEntry.H"
 #include "dictionaryEntry.H"
 #include "functionEntry.H"
 #include "includeEntry.H"
 #include "inputModeEntry.H"
 #include "stringOps.H"
+#include "dictionaryListEntry.H"
 
-#include "IOstreams.H"
+// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
 
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-bool Foam::entry::getKeyword(keyType& keyword, Istream& is)
+bool Foam::entry::getKeyword(keyType& keyword, token& keywordToken, Istream& is)
 {
-    token keywordToken;
-
     // Read the next valid token discarding spurious ';'s
     do
     {
@@ -65,25 +63,43 @@ bool Foam::entry::getKeyword(keyType& keyword, Istream& is)
         keyword = keywordToken.stringToken();
         return true;
     }
-    // If it is the end of the dictionary or file return false...
-    else if (keywordToken == token::END_BLOCK || is.eof())
+    else
     {
         return false;
     }
-    // Otherwise the token is invalid
+}
+
+
+bool Foam::entry::getKeyword(keyType& keyword, Istream& is)
+{
+    token keywordToken;
+    bool ok = getKeyword(keyword, keywordToken, is);
+
+    if (ok)
+    {
+        return true;
+    }
     else
     {
-        cerr<< "--> FOAM Warning : " << std::endl
-            << "    From function "
-            << "entry::getKeyword(keyType&, Istream&)" << std::endl
-            << "    in file " << __FILE__
-            << " at line " << __LINE__ << std::endl
-            << "    Reading " << is.name().c_str() << std::endl
-            << "    found " << keywordToken << std::endl
-            << "    expected either " << token::END_BLOCK << " or EOF"
-            << std::endl;
-
-        return false;
+        // Do some more checking
+        if (keywordToken == token::END_BLOCK || is.eof())
+        {
+            return false;
+        }
+        else
+        {
+            // Otherwise the token is invalid
+            cerr<< "--> FOAM Warning : " << std::endl
+                << "    From function "
+                << "entry::getKeyword(keyType&, Istream&)" << std::endl
+                << "    in file " << __FILE__
+                << " at line " << __LINE__ << std::endl
+                << "    Reading " << is.name().c_str() << std::endl
+                << "    found " << keywordToken << std::endl
+                << "    expected either " << token::END_BLOCK << " or EOF"
+                << std::endl;
+            return false;
+        }
     }
 }
 
@@ -93,22 +109,68 @@ bool Foam::entry::New(dictionary& parentDict, Istream& is)
     is.fatalCheck("entry::New(const dictionary& parentDict, Istream&)");
 
     keyType keyword;
+    token keyToken;
 
-    // Get the next keyword and if invalid return false
-    if (!getKeyword(keyword, is))
+    // Get the next keyword and if a valid keyword return true
+    bool valid = getKeyword(keyword, keyToken, is);
+
+    if (!valid)
     {
-        return false;
+        // Do some more checking
+        if (keyToken == token::END_BLOCK || is.eof())
+        {
+            return false;
+        }
+        else if
+        (
+            keyToken.isLabel()
+         || (keyToken.isPunctuation() && keyToken.pToken() == token::BEGIN_LIST)
+        )
+        {
+            is.putBack(keyToken);
+            return parentDict.add
+            (
+                new dictionaryListEntry(parentDict, is),
+                false
+            );
+        }
+        else
+        {
+            // Otherwise the token is invalid
+            cerr<< "--> FOAM Warning : " << std::endl
+                << "    From function "
+                << "entry::getKeyword(keyType&, Istream&)" << std::endl
+                << "    in file " << __FILE__
+                << " at line " << __LINE__ << std::endl
+                << "    Reading " << is.name().c_str() << std::endl
+                << "    found " << keyToken << std::endl
+                << "    expected either " << token::END_BLOCK << " or EOF"
+                << std::endl;
+            return false;
+        }
     }
     else  // Keyword starts entry ...
     {
-        if
-        (
-           !disableFunctionEntries
-         && keyword[0] == '#'
-        )                           // ... Function entry
+        if (keyword[0] == '#')      // ... Function entry
         {
             word functionName = keyword(1, keyword.size()-1);
-            return functionEntry::execute(functionName, parentDict, is);
+            if (disableFunctionEntries)
+            {
+                return parentDict.add
+                (
+                    new functionEntry
+                    (
+                        keyword,
+                        parentDict,
+                        is
+                    ),
+                    false
+                );
+            }
+            else
+            {
+                return functionEntry::execute(functionName, parentDict, is);
+            }
         }
         else if
         (
diff --git a/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C
index a758de39a4ce4ef614bfb3eacdfd9df41ce2e5df..5837bd5773133b5f82e009fdbe3f5e5623cc10a5 100644
--- a/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C
+++ b/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -24,6 +24,8 @@ License
 \*---------------------------------------------------------------------------*/
 
 #include "functionEntry.H"
+#include "IOstreams.H"
+#include "ISstream.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -45,6 +47,34 @@ namespace Foam
 }
 
 
+// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+
+Foam::token Foam::functionEntry::readLine(const word& key, Istream& is)
+{
+    string s;
+    dynamic_cast<ISstream&>(is).getLine(s);
+
+    return token(string(key+s), is.lineNumber());
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
+
+Foam::functionEntry::functionEntry
+(
+    const word& key,
+    const dictionary& dict,
+    Istream& is
+)
+:
+    primitiveEntry
+    (
+        word(key+dict.name()+Foam::name(is.lineNumber())),
+        readLine(key, is)
+    )
+{}
+
+
 // * * * * * * * * * * * * Member Function Selectors * * * * * * * * * * * * //
 
 bool Foam::functionEntry::execute
@@ -132,4 +162,17 @@ bool Foam::functionEntry::execute
 }
 
 
+void Foam::functionEntry::write(Ostream& os) const
+{
+    // Contents should be single string token
+    const token& t = operator[](0);
+    const string& s = t.stringToken();
+
+    for (size_t i = 0; i < s.size(); i++)
+    {
+        os.write(s[i]);
+    }
+}
+
+
 // ************************************************************************* //
diff --git a/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.H b/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.H
index 8c67c5440338b7b6c691bedc643547491186e8ed..0c9bd6604e5ebc18b23cd365215ba335da1fb025 100644
--- a/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.H
+++ b/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.H
@@ -48,13 +48,13 @@ SourceFiles
 
 #include "word.H"
 #include "memberFunctionSelectionTables.H"
+#include "primitiveEntry.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 namespace Foam
 {
 
-class primitiveEntry;
 class dictionary;
 
 /*---------------------------------------------------------------------------*\
@@ -62,9 +62,14 @@ class dictionary;
 \*---------------------------------------------------------------------------*/
 
 class functionEntry
+:
+    public primitiveEntry
 {
     // Private Member Functions
 
+        //- Read line as string token
+        static token readLine(const word& key, Istream& is);
+
         //- Disallow default bitwise copy construct
         functionEntry(const functionEntry&);
 
@@ -74,6 +79,12 @@ class functionEntry
 
 public:
 
+    // Constructors
+
+        //- Construct from keyword, parent dictionary and Istream
+        functionEntry(const word&, const dictionary&, Istream&);
+
+
     // Member Function Selectors
 
         declareMemberFunctionSelectionTable
@@ -119,6 +130,9 @@ public:
             primitiveEntry&,
             Istream&
         );
+
+        //- Write
+        virtual void write(Ostream&) const;
 };
 
 
diff --git a/src/OpenFOAM/db/dynamicLibrary/codedBase/codedBase.C b/src/OpenFOAM/db/dynamicLibrary/codedBase/codedBase.C
index 5fcaf92d352db8d947a8ebb07df877c8d7c4c1bc..448a4f1dc73b973b5de2e82c7c923af929aa7b69 100644
--- a/src/OpenFOAM/db/dynamicLibrary/codedBase/codedBase.C
+++ b/src/OpenFOAM/db/dynamicLibrary/codedBase/codedBase.C
@@ -316,6 +316,8 @@ void Foam::codedBase::createLibrary
 }
 
 
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
+
 void Foam::codedBase::updateLibrary
 (
     const word& name
@@ -388,7 +390,4 @@ Foam::codedBase::~codedBase()
 {}
 
 
-// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
-
-
 // ************************************************************************* //
diff --git a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H
index 97d94cadfd10d5145cbc2b9a77ffaa2e1d0f3b17..1cf46f877eb192c361bbd8c920e09f95300b991e 100644
--- a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H
+++ b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H
@@ -64,23 +64,24 @@ Description
         libs     | Libraries containing implementation   | yes      |
         region   | Name of region for multi-region cases | no       |
         enabled  | On/off switch                         | no       | yes
+        log      | Log information to standard output    | no       | yes
         timeStart| Start time                            | no       |
         timeEnd  | End time                              | no       |
-        evaluateControl  | See time controls below       | no       | timeStep
-        evaluateInterval | Steps between output          | no       |
-        writeControl     | See time controls below       | no       | timeStep
-        writeInterval    | Steps between output          | no       |
+        executeControl  | See time controls below        | no       | timeStep
+        executeInterval | Steps between each execute phase | no     |
+        writeControl    | See time controls below        | no       | timeStep
+        writeInterval   | Steps between each write phase | no       |
     \endtable
 
     Time controls:
     \table
         Option            | Description
-        timeStep          | Execute/write every 'writeInterval' time-steps
-        writeTime         | Execute/write every 'writeInterval' output times
-        adjustableRunTime | Execute/write every 'writeInterval' run time period
-        runTime           | Execute/write every 'writeInterval' run time period
-        clockTime        | Execute/write every 'writeInterval' clock time period
-        cpuTime           | Execute/write every 'writeInterval' CPU time period
+        timeStep          | Execute/write every 'Interval' time-steps
+        writeTime         | Execute/write every 'Interval' output times
+        adjustableRunTime | Execute/write every 'Interval' run time period
+        runTime           | Execute/write every 'Interval' run time period
+        clockTime         | Execute/write every 'Interval' clock time period
+        cpuTime           | Execute/write every 'Interval' CPU time period
         none              | Execute/write every time-step
     \endtable
 
@@ -91,6 +92,14 @@ Description
     libraries and the \c libs entry is used to specify which library should be
     loaded.
 
+    Each function object has two separate run phases:
+
+      - The \c execute phase is meant to be used for updating calculations
+        or for management tasks.
+      - The \c write phase is meant for writing the calculated data to disk.
+
+    For each phase the respective time controls are provided, as listed above.
+
 Class
     Foam::functionObject
 
diff --git a/src/OpenFOAM/db/functionObjects/regionFunctionObject/regionFunctionObjectTemplates.C b/src/OpenFOAM/db/functionObjects/regionFunctionObject/regionFunctionObjectTemplates.C
index 5c803a73df2089628b03d1b24e36fb790d12c76e..0cddd5cc569b5a4cbd2e29f4447f3740989953bc 100644
--- a/src/OpenFOAM/db/functionObjects/regionFunctionObject/regionFunctionObjectTemplates.C
+++ b/src/OpenFOAM/db/functionObjects/regionFunctionObject/regionFunctionObjectTemplates.C
@@ -59,7 +59,7 @@ bool Foam::functionObjects::regionFunctionObject::store
     if (cacheable && fieldName == tfield().name())
     {
         WarningInFunction
-            << "Cannot store cache-able field with the named used in the cache."
+            << "Cannot store cache-able field with the name used in the cache."
             << nl
             << "    Either choose a different name or cache the field"
             << "    and use the 'writeObjects' functionObject."
diff --git a/src/OpenFOAM/db/regIOobject/regIOobject.C b/src/OpenFOAM/db/regIOobject/regIOobject.C
index 724e1ef1dac345bbcfdefa3f02dea73b36cb4218..5a6177c3914bc9a1f8ead582f840cfa6d6a6ed15 100644
--- a/src/OpenFOAM/db/regIOobject/regIOobject.C
+++ b/src/OpenFOAM/db/regIOobject/regIOobject.C
@@ -35,14 +35,14 @@ namespace Foam
     defineTypeNameAndDebug(regIOobject, 0);
 }
 
-int Foam::regIOobject::fileModificationSkew
+float Foam::regIOobject::fileModificationSkew
 (
-    Foam::debug::optimisationSwitch("fileModificationSkew", 30)
+    Foam::debug::floatOptimisationSwitch("fileModificationSkew", 30)
 );
 registerOptSwitch
 (
     "fileModificationSkew",
-    int,
+    float,
     Foam::regIOobject::fileModificationSkew
 );
 
diff --git a/src/OpenFOAM/db/regIOobject/regIOobject.H b/src/OpenFOAM/db/regIOobject/regIOobject.H
index 718dd432d1905a8cfcf06de8d4ce1cbc2861ed34..d345dc860244163eaa648ca14a7f7a58b0db66ee 100644
--- a/src/OpenFOAM/db/regIOobject/regIOobject.H
+++ b/src/OpenFOAM/db/regIOobject/regIOobject.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -130,7 +130,7 @@ public:
         //- Runtime type information
         TypeName("regIOobject");
 
-        static int fileModificationSkew;
+        static float fileModificationSkew;
 
 
     // Constructors
diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointConstraint/pointConstraint.H b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointConstraint/pointConstraint.H
index 9696efeed2d6cda72d9e3ae8ce914fb88c41068d..ae8235eec33e27c4163a445a61923b89e24bfb36 100644
--- a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointConstraint/pointConstraint.H
+++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointConstraint/pointConstraint.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -87,6 +87,9 @@ public:
         //- Return the accumulated unconstrained directions. Directions
         //  coded as first n rows of tensor.
         inline void unconstrainedDirections(label& n, tensor& vecs) const;
+
+        //- Constrain a displacement
+        inline vector constrainDisplacement(const vector& disp) const;
 };
 
 
@@ -103,7 +106,7 @@ inline pointConstraint transform(const tensor& tt, const pointConstraint& v);
 //- contiguous
 template<class T> bool contiguous();
 template<>
-inline bool contiguous<pointConstraint>()                {return true;}
+inline bool contiguous<pointConstraint>() {return true;}
 
 
 
diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointConstraint/pointConstraintI.H b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointConstraint/pointConstraintI.H
index 27aa1debf411b77b5cfe902d57fd0123fad0d57e..0a3d14d2ddfd1d38ab1a2a70058e15462e8faf05 100644
--- a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointConstraint/pointConstraintI.H
+++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointConstraint/pointConstraintI.H
@@ -45,7 +45,7 @@ inline Foam::pointConstraint::pointConstraint(Istream& is)
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
-void Foam::pointConstraint::applyConstraint(const vector& cd)
+inline void Foam::pointConstraint::applyConstraint(const vector& cd)
 {
     if (first() == 0)
     {
@@ -74,7 +74,7 @@ void Foam::pointConstraint::applyConstraint(const vector& cd)
 }
 
 
-void Foam::pointConstraint::combine(const pointConstraint& pc)
+inline void Foam::pointConstraint::combine(const pointConstraint& pc)
 {
     if (first() == 0)
     {
@@ -115,7 +115,7 @@ void Foam::pointConstraint::combine(const pointConstraint& pc)
 }
 
 
-Foam::tensor Foam::pointConstraint::constraintTransformation() const
+inline Foam::tensor Foam::pointConstraint::constraintTransformation() const
 {
     if (first() == 0)
     {
@@ -136,8 +136,11 @@ Foam::tensor Foam::pointConstraint::constraintTransformation() const
 }
 
 
-void Foam::pointConstraint::unconstrainedDirections(label& n, tensor& tt)
-const
+inline void Foam::pointConstraint::unconstrainedDirections
+(
+    label& n,
+    tensor& tt
+) const
 {
     n = 3-first();
 
@@ -179,7 +182,36 @@ const
 }
 
 
-void Foam::combineConstraintsEqOp::operator()
+inline Foam::vector Foam::pointConstraint::constrainDisplacement
+(
+    const vector& d
+) const
+{
+    vector cd;
+
+    if (first() == 0)
+    {
+        cd = d;
+    }
+    else if (first() == 1)
+    {
+        // Remove plane normal
+        cd = d-(d&second())*second();
+    }
+    else if (first() == 2)
+    {
+        // Keep line direction only
+        cd = (d&second())*second();
+    }
+    else
+    {
+        cd = Zero;
+    }
+    return cd;
+}
+
+
+inline void Foam::combineConstraintsEqOp::operator()
 (
     pointConstraint& x,
     const pointConstraint& y
@@ -189,7 +221,7 @@ void Foam::combineConstraintsEqOp::operator()
 }
 
 
-Foam::pointConstraint Foam::transform
+inline Foam::pointConstraint Foam::transform
 (
     const tensor& tt,
     const pointConstraint& v
diff --git a/src/OpenFOAM/global/argList/argList.C b/src/OpenFOAM/global/argList/argList.C
index 5ab933097287d48961903fff47257b4d2290cac8..f645a7ef352a8b9c17b78a89f9dfc9024d221dc1 100644
--- a/src/OpenFOAM/global/argList/argList.C
+++ b/src/OpenFOAM/global/argList/argList.C
@@ -909,8 +909,23 @@ void Foam::argList::parse
                 << regIOobject::fileCheckTypesNames
                     [
                         regIOobject::fileModificationChecking
-                    ]
-                << endl;
+                    ];
+            if
+            (
+                (
+                    regIOobject::fileModificationChecking
+                 == regIOobject::timeStamp
+                )
+             || (
+                    regIOobject::fileModificationChecking
+                 == regIOobject::timeStampMaster
+                )
+            )
+            {
+                Info<< " (fileModificationSkew "
+                    << regIOobject::fileModificationSkew << ")";
+            }
+            Info<< endl;
 
             Info<< "allowSystemOperations : ";
             if (dynamicCode::allowSystemOperations)
diff --git a/src/OpenFOAM/global/constants/mathematical/mathematicalConstants.H b/src/OpenFOAM/global/constants/mathematical/mathematicalConstants.H
index d286493919b2769958a6d878055648b94c24eaa2..fa4850fb5a98ec9728bfcb70087bb22272ed1f5f 100644
--- a/src/OpenFOAM/global/constants/mathematical/mathematicalConstants.H
+++ b/src/OpenFOAM/global/constants/mathematical/mathematicalConstants.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -52,6 +52,9 @@ namespace mathematical
     const scalar twoPi(2*pi);
     const scalar piByTwo(0.5*pi);
 
+    //- Euler's constant
+    const scalar Eu(0.57721566490153286060651209);
+
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 } // End namespace mathematical
diff --git a/src/OpenFOAM/global/debug/debug.C b/src/OpenFOAM/global/debug/debug.C
index 279be7409036dbd379aea47946ebb8fe8dbde3bb..bdf1698d07c08da045afec641a24c8dd81af8b15 100644
--- a/src/OpenFOAM/global/debug/debug.C
+++ b/src/OpenFOAM/global/debug/debug.C
@@ -190,6 +190,19 @@ int Foam::debug::optimisationSwitch(const char* name, const int defaultValue)
 }
 
 
+float Foam::debug::floatOptimisationSwitch
+(
+    const char* name,
+    const float defaultValue
+)
+{
+    return optimisationSwitches().lookupOrAddDefault
+    (
+        name, defaultValue, false, false
+    );
+}
+
+
 void Foam::debug::addDebugObject(const char* name, simpleRegIOobject* obj)
 {
     simpleObjectRegistryEntry* ptr = debugObjects().lookupPtr(name);
diff --git a/src/OpenFOAM/global/debug/debug.H b/src/OpenFOAM/global/debug/debug.H
index 4eeb8cbb534fdce73c32d73f109cf145571c661d..190f73be3029b485e9947a1dc9615edd89134328 100644
--- a/src/OpenFOAM/global/debug/debug.H
+++ b/src/OpenFOAM/global/debug/debug.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -74,6 +74,13 @@ namespace debug
     //- Lookup optimisation switch or add default value.
     int optimisationSwitch(const char* name, const int defaultValue=0);
 
+    //- Lookup optimisation switch or add default value.
+    float floatOptimisationSwitch
+    (
+        const char* name,
+        const float defaultValue=0
+    );
+
     //- Internal function to lookup a sub-dictionary from controlDict.
     dictionary& switchSet(const char* subDictName, dictionary*& subDictPtr);
 
diff --git a/src/OpenFOAM/include/OSspecific.H b/src/OpenFOAM/include/OSspecific.H
index 8cf277cd70eb3fb1ce35e34d0f5527baab6964a2..4b47e344258060a68671a6b0f347d503de972b1a 100644
--- a/src/OpenFOAM/include/OSspecific.H
+++ b/src/OpenFOAM/include/OSspecific.H
@@ -133,6 +133,9 @@ off_t fileSize(const fileName&, const bool followLink=true);
 //- Return time of last file modification
 time_t lastModified(const fileName&, const bool followLink=true);
 
+//- Return time of last file modification
+double highResLastModified(const fileName&);
+
 //- Read a directory and return the entries as a string list
 fileNameList readDir
 (
diff --git a/src/OpenFOAM/matrices/Matrix/Matrix.H b/src/OpenFOAM/matrices/Matrix/Matrix.H
index 884979f3d85103ae72ad45b91bec9df254a3e180..cad1c85aa967a2a058b11f470f504b64497f3307 100644
--- a/src/OpenFOAM/matrices/Matrix/Matrix.H
+++ b/src/OpenFOAM/matrices/Matrix/Matrix.H
@@ -298,7 +298,7 @@ public:
             mType&
         );
 
-        // Write Matrix to Ostream.
+        //- Write Matrix to Ostream.
         friend Ostream& operator<< <Form, Type>
         (
             Ostream&,
diff --git a/src/OpenFOAM/matrices/Matrix/MatrixIO.C b/src/OpenFOAM/matrices/Matrix/MatrixIO.C
index b965bb37d75c71ec1b99a94ea671e8160a63e2cc..fc315f4ca46ed33c11456c0801520cbbc313bd02 100644
--- a/src/OpenFOAM/matrices/Matrix/MatrixIO.C
+++ b/src/OpenFOAM/matrices/Matrix/MatrixIO.C
@@ -29,7 +29,7 @@ License
 #include "token.H"
 #include "contiguous.H"
 
-// * * * * * * * * * * * * * * * Ostream Operator *  * * * * * * * * * * * * //
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 template<class Form, class Type>
 Foam::Matrix<Form, Type>::Matrix(Istream& is)
diff --git a/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrix.H b/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrix.H
index 543d16b8482fe16846cd03a2e3dc12278a1ec367..6da53ea3efae262b2379bc9f971f21e7bd4de070 100644
--- a/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrix.H
+++ b/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrix.H
@@ -108,7 +108,7 @@ Type det(const SymmetricSquareMatrix<Type>&);
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-    #include "SymmetricSquareMatrixI.H"
+#include "SymmetricSquareMatrixI.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C
index 65898e9c1344f2a3d953123f3b173b2469e4b5de..21520669da5467b972f404b4e547b2233bcf0825 100644
--- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C
+++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C
@@ -43,7 +43,7 @@ namespace Foam
 }
 
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 void Foam::GAMGAgglomeration::compactLevels(const label nCreatedLevels)
 {
diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/PBiCGStab/PBiCGStab.C b/src/OpenFOAM/matrices/lduMatrix/solvers/PBiCGStab/PBiCGStab.C
index ff7c0cddd595ca97ad60cb23bb2967c561ba6222..f73bf0fbb6a46ae5ae48f192c1f46cb4afb8b08f 100644
--- a/src/OpenFOAM/matrices/lduMatrix/solvers/PBiCGStab/PBiCGStab.C
+++ b/src/OpenFOAM/matrices/lduMatrix/solvers/PBiCGStab/PBiCGStab.C
@@ -223,7 +223,7 @@ Foam::solverPerformance Foam::PBiCGStab::solve
 
             // --- Calculate omega from tA and sA
             //     (cheaper than using zA with preconditioned tA)
-            omega = gSumProd(tA, sA)/tAtA;
+            omega = gSumProd(tA, sA, matrix().mesh().comm())/tAtA;
 
             // --- Update solution and residual
             for (label cell=0; cell<nCells; cell++)
diff --git a/src/OpenFOAM/memory/tmp/tmpI.H b/src/OpenFOAM/memory/tmp/tmpI.H
index 70a4dc2b7f02ab75f2f71632e5e76b1052851756..7e5800dcbbf30a5110b1d726fdfbc4996d982b23 100644
--- a/src/OpenFOAM/memory/tmp/tmpI.H
+++ b/src/OpenFOAM/memory/tmp/tmpI.H
@@ -384,20 +384,4 @@ inline void Foam::tmp<T>::operator=(const tmp<T>& t)
 }
 
 
-//- Return the const reference of the non-const reference argument
-template<class T>
-inline const T& Const(T& t)
-{
-    return t;
-}
-
-
-//- Return the const reference of the non-const rvalue reference argument
-template<class T>
-inline const T& Const(T&& t)
-{
-    return t;
-}
-
-
 // ************************************************************************* //
diff --git a/src/OpenFOAM/memory/tmpNrc/tmpNrcI.H b/src/OpenFOAM/memory/tmpNrc/tmpNrcI.H
index 75f66f44e8a5dd109e0f4ea1736c9ec29fe0170f..00af03f8528c938dec7c11f261406a4cba3f2080 100644
--- a/src/OpenFOAM/memory/tmpNrc/tmpNrcI.H
+++ b/src/OpenFOAM/memory/tmpNrc/tmpNrcI.H
@@ -301,20 +301,4 @@ inline void Foam::tmpNrc<T>::operator=(const tmpNrc<T>& t)
 }
 
 
-//- Return the const reference of the non-const reference argument
-template<class T>
-inline const T& Const(T& t)
-{
-    return t;
-}
-
-
-//- Return the const reference of the non-const rvalue reference argument
-template<class T>
-inline const T& Const(T&& t)
-{
-    return t;
-}
-
-
 // ************************************************************************* //
diff --git a/src/OpenFOAM/meshes/meshShapes/cellShape/cellShape.H b/src/OpenFOAM/meshes/meshShapes/cellShape/cellShape.H
index 371d95a0632d1a0de12d9b91109eef9de8eb9c4d..653da9c46d48e8f4a6937d1f9251ec56681d37bb 100644
--- a/src/OpenFOAM/meshes/meshShapes/cellShape/cellShape.H
+++ b/src/OpenFOAM/meshes/meshShapes/cellShape/cellShape.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -92,6 +92,14 @@ public:
             const bool doCollapse = false
         );
 
+        //- Construct from components
+        inline cellShape
+        (
+            const word& model,
+            const labelList&,
+            const bool doCollapse = false
+        );
+
         //- Construct from Istream
         inline cellShape(Istream& is);
 
diff --git a/src/OpenFOAM/meshes/meshShapes/cellShape/cellShapeI.H b/src/OpenFOAM/meshes/meshShapes/cellShape/cellShapeI.H
index 5120cd4dfa51234fc24eee1dc019a24430b90ad2..42055e04c9229190799ceb06d9b0149972ee7e26 100644
--- a/src/OpenFOAM/meshes/meshShapes/cellShape/cellShapeI.H
+++ b/src/OpenFOAM/meshes/meshShapes/cellShape/cellShapeI.H
@@ -25,6 +25,7 @@ License
 
 #include "Istream.H"
 #include "cell.H"
+#include "cellModeller.H"
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
@@ -51,6 +52,23 @@ inline Foam::cellShape::cellShape
 }
 
 
+inline Foam::cellShape::cellShape
+(
+    const word& model,
+    const labelList& l,
+    const bool doCollapse
+)
+:
+    labelList(l),
+    m(cellModeller::lookup(model))
+{
+    if (doCollapse)
+    {
+        collapse();
+    }
+}
+
+
 inline Foam::cellShape::cellShape(Istream& is)
 {
     is >> *this;
diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeBase.C b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeBase.C
index a3f7b4689702c7be3b5c8d968d292d799a590167..8f4866269d05f88169e11b37f5c01fdf3ffc2690 100644
--- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeBase.C
+++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeBase.C
@@ -33,11 +33,11 @@ License
 
 namespace Foam
 {
-defineTypeNameAndDebug(mapDistributeBase, 0);
+    defineTypeNameAndDebug(mapDistributeBase, 0);
 }
 
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 Foam::List<Foam::labelPair> Foam::mapDistributeBase::schedule
 (
diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C
index 3c8819d6429ab96d7d7971aa5d4c6fb45faa53af..343461da4230dd7193b5024db39e522162eed0d5 100644
--- a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C
+++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C
@@ -51,7 +51,7 @@ namespace Foam
 }
 
 
-// * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 void Foam::coupledPolyPatch::writeOBJ(Ostream& os, const point& pt)
 {
diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C
index e59c5220be8e7580a7899a2c9cc251de09fb2a05..5e5821b4a7fe2040064797c41082c9c856e158e9 100644
--- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C
+++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C
@@ -38,7 +38,8 @@ namespace Foam
     addToRunTimeSelectionTable(polyPatch, wedgePolyPatch, dictionary);
 }
 
-// * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * * //
+
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 void Foam::wedgePolyPatch::calcGeometry(PstreamBuffers&)
 {
diff --git a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C
index 7e557268a6e240441f334fef53e415567807dbaa..9a6238c73354bc891e2683adcd61a8625bfb6f5a 100644
--- a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C
+++ b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C
@@ -43,7 +43,8 @@ namespace Foam
 
 const char* const Foam::faceZone::labelsName = "faceLabels";
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 void Foam::faceZone::calcFaceZonePatch() const
 {
diff --git a/src/OpenFOAM/meshes/polyMesh/zones/zone/zone.H b/src/OpenFOAM/meshes/polyMesh/zones/zone/zone.H
index 27db3cc56d87dacdc2484d4995650299a040e083..924a97db55d8c5a75d341a35bb55b25ab7a6090c 100644
--- a/src/OpenFOAM/meshes/polyMesh/zones/zone/zone.H
+++ b/src/OpenFOAM/meshes/polyMesh/zones/zone/zone.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -79,9 +79,6 @@ protected:
 
     // Protected Member Functions
 
-        //- Return a reference to the look-up map
-        const Map<label>& lookupMap() const;
-
         //- Construct the look-up map
         void calcLookupMap() const;
 
@@ -164,6 +161,9 @@ public:
             return index_;
         }
 
+        //- Return a reference to the look-up map
+        const Map<label>& lookupMap() const;
+
         //- Clear addressing
         virtual void clearAddressing();
 
diff --git a/src/OpenFOAM/meshes/primitiveShapes/plane/plane.H b/src/OpenFOAM/meshes/primitiveShapes/plane/plane.H
index ca4d7ef0f16c605cd845aeda1f772161c8471cc6..958d17d32d3fa6ea7e8b7af383cc8057cfad3330 100644
--- a/src/OpenFOAM/meshes/primitiveShapes/plane/plane.H
+++ b/src/OpenFOAM/meshes/primitiveShapes/plane/plane.H
@@ -137,7 +137,7 @@ public:
         );
 
         //- Construct from three points in plane
-        explicit plane
+        plane
         (
             const point& point1,
             const point& point2,
diff --git a/src/OpenFOAM/primitives/Scalar/Scalar.H b/src/OpenFOAM/primitives/Scalar/Scalar.H
index 6b2213fa6ac7730c3c8481f778d18e4eef88a889..0641bc1257ef80724f8f6424e4f3c3655d9cdd32 100644
--- a/src/OpenFOAM/primitives/Scalar/Scalar.H
+++ b/src/OpenFOAM/primitives/Scalar/Scalar.H
@@ -144,6 +144,7 @@ transFunc(atanh)
 transFunc(erf)
 transFunc(erfc)
 transFunc(lgamma)
+transFunc(tgamma)
 
 transFunc(j0)
 transFunc(j1)
@@ -312,11 +313,18 @@ inline Scalar cmptAv(const Scalar s)
 }
 
 
+inline Scalar cmptSqr(const Scalar s)
+{
+    return sqr(s);
+}
+
+
 inline Scalar cmptMag(const Scalar s)
 {
     return mag(s);
 }
 
+
 inline Scalar sqrtSumSqr(const Scalar a, const Scalar b)
 {
     Scalar maga = mag(a);
@@ -333,7 +341,7 @@ inline Scalar sqrtSumSqr(const Scalar a, const Scalar b)
 }
 
 
-// Stabilisation around zero for division
+//- Stabilisation around zero for division
 inline Scalar stabilise(const Scalar s, const Scalar small)
 {
     if (s >= 0)
diff --git a/src/OpenFOAM/primitives/Scalar/scalar/invIncGamma.C b/src/OpenFOAM/primitives/Scalar/scalar/invIncGamma.C
new file mode 100644
index 0000000000000000000000000000000000000000..aa44c195df20212f13f610895ada934b2f46316b
--- /dev/null
+++ b/src/OpenFOAM/primitives/Scalar/scalar/invIncGamma.C
@@ -0,0 +1,316 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+Global
+    Foam::invIncGamma
+
+Description
+    Function to calculate the inverse of the
+    normalized incomplete gamma function.
+
+    The algorithm is described in detain in reference:
+    \verbatim
+        DiDonato, A. R., & Morris Jr, A. H. (1986).
+        Computation of the incomplete gamma function ratios and their inverse.
+        ACM Transactions on Mathematical Software (TOMS), 12(4), 377-393.
+    \endverbatim
+
+    All equation numbers in the following code refer to the above text and
+    the algorithm in the function 'invIncGamma' is described in section 4.
+
+\*---------------------------------------------------------------------------*/
+
+#include "mathematicalConstants.H"
+using namespace Foam::constant::mathematical;
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+static scalar minimaxs(const scalar P)
+{
+    // Eqn. 32
+
+    static const scalar a[] =
+    {
+        3.31125922108741,
+        11.6616720288968,
+        4.28342155967104,
+        0.213623493715853
+    };
+
+    static const scalar b[] =
+    {
+        6.61053765625462,
+        6.40691597760039,
+        1.27364489782223,
+        0.03611708101884203
+    };
+
+    const scalar t = P < 0.5 ? sqrt(-2*log(P)) : sqrt(-2*log(1 - P));
+
+    const scalar s =
+        t
+      - (a[0] + t*(a[1] + t*(a[2] + t*a[3])))
+       /(1 + t*(b[0] + t*(b[1] + t*(b[2] + t*b[3]))));
+
+    return P < 0.5 ? -s : s;
+}
+
+
+static scalar Sn(const scalar a, const scalar x)
+{
+    //- Eqn. 34
+
+    scalar Sn = 1;
+    scalar Si = 1;
+
+    for (int i=1; i<100; i++)
+    {
+        Si *= x/(a + i);
+        Sn += Si;
+
+        if (Si < 1e-4) break;
+    }
+
+    return Sn;
+}
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+//- Inverse normalized incomplete gamma function
+Foam::scalar Foam::invIncGamma(const scalar a, const scalar P)
+{
+    const scalar Q = 1 - P;
+
+    if (a == 1)
+    {
+        return -log(Q);
+    }
+    else if (a < 1)
+    {
+        const scalar Ga = tgamma(a);
+        const scalar B = Q*Ga;
+
+        if (B > 0.6 || (B >= 0.45 && a >= 0.3))
+        {
+            // Eqn. 21
+            const scalar u =
+                (B*Q > 1e-8) ? pow(P*Ga*a, 1/a) : exp((-Q/a) - Eu);
+
+            return u/(1 - (u/(a + 1)));
+        }
+        else if (a < 0.3 && B >= 0.35)
+        {
+            // Eqn. 22
+            const scalar t = exp(-Eu - B);
+            const scalar u = t*exp(t);
+
+            return t*exp(u);
+        }
+        else if (B > 0.15 || a >= 0.3)
+        {
+            // Eqn. 23
+            const scalar y = -log(B);
+            const scalar u = y - (1 - a)*log(y);
+
+            return y - (1 - a)*log(u) - log(1 + (1 - a)/(1 + u));
+        }
+        else if (B > 0.1)
+        {
+            // Eqn. 24
+            const scalar y = -log(B);
+            const scalar u = y - (1 - a)*log(y);
+
+            return y
+              - (1 - a)*log(u)
+              - log
+                (
+                    (sqr(u) + 2*(3 - a)*u + (2 - a)*(3 - a))
+                   /(sqr(u) + (5 - a)*u + 2)
+                );
+        }
+        else
+        {
+            // Eqn. 25:
+            const scalar y = -log(B);
+            const scalar c1 = (a - 1)*log(y);
+            const scalar c12 = c1*c1;
+            const scalar c13 = c12*c1;
+            const scalar c14 = c12*c12;
+            const scalar a2 = a*a;
+            const scalar a3 = a2*a;
+            const scalar c2 = (a - 1)*(1 + c1);
+            const scalar c3 = (a - 1)*(-(c12/2) + (a - 2)*c1 + (3*a - 5)/2);
+            const scalar c4 =
+                (a - 1)
+               *(
+                    (c13/3)
+                  - (3*a - 5)*c12/2
+                  + (a2 - 6*a + 7)*c1
+                  + (11*a2 - 46*a + 47)/6
+                );
+            const scalar c5 =
+                (a - 1)*(-(c14/4)
+              + (11*a - 17)*c13/6
+              + (-3*a2 + 13*a - 13)*c12
+              + (2*a3 - 25*a2 + 72*a - 61)*c1/2
+              + (25*a3 - 195*a2 + 477*a - 379)/12);
+            const scalar y2 = y*y;
+            const scalar y3 = y2*y;
+            const scalar y4 = y2*y2;
+
+            return y + c1 + (c2/y) + (c3/y2) + (c4/y3) + (c5/y4);
+        }
+    }
+    else
+    {
+        // Eqn. 31:
+        scalar s = minimaxs(P);
+
+        const scalar s2 = sqr(s);
+        const scalar s3 = s*s2;
+        const scalar s4 = s2*s2;
+        const scalar s5 = s*s4;
+        const scalar sqrta = sqrt(a);
+
+        const scalar w =
+            a + s*sqrta + (s2 - 1)/3
+          + (s3 - 7*s)/(36*sqrta)
+          - (3*s4 + 7*s2 - 16)/(810*a)
+          + (9*s5 + 256*s3 - 433*s)/(38880*a*sqrta);
+
+        if (a >= 500 && mag(1 - w/a) < 1e-6)
+        {
+            return w;
+        }
+        else if (P > 0.5)
+        {
+            if (w < 3*a)
+            {
+                return w;
+            }
+            else
+            {
+                const scalar D = max(scalar(2), scalar(a*(a - 1)));
+                const scalar lnGa = lgamma(a);
+                const scalar lnB = log(Q) + lnGa;
+
+                if (lnB < -2.3*D)
+                {
+                    // Eqn. 25:
+                    const scalar y = -lnB;
+                    const scalar c1 = (a - 1)*log(y);
+                    const scalar c12 = c1*c1;
+                    const scalar c13 = c12*c1;
+                    const scalar c14 = c12*c12;
+                    const scalar a2 = a*a;
+                    const scalar a3 = a2*a;
+
+                    const scalar c2 = (a - 1)*(1 + c1);
+                    const scalar c3 =
+                        (a - 1)
+                       *(
+                          - (c12/2)
+                          + (a - 2)*c1
+                          + (3*a - 5)/2
+                        );
+                    const scalar c4 =
+                        (a - 1)
+                       *(
+                            (c13/3)
+                          - (3*a - 5)*c12/2
+                          + (a2 - 6*a + 7)*c1
+                          + (11*a2 - 46*a + 47)/6
+                        );
+                    const scalar c5 =
+                        (a - 1)
+                       *(
+                          - (c14/4)
+                          + (11*a - 17)*c13/6
+                          + (-3*a2 + 13*a - 13)*c12
+                          + (2*a3 - 25*a2 + 72*a - 61)*c1/2
+                          + (25*a3 - 195*a2 + 477*a - 379)/12
+                        );
+
+                    const scalar y2 = y*y;
+                    const scalar y3 = y2*y;
+                    const scalar y4 = y2*y2;
+
+                    return y + c1 + (c2/y) + (c3/y2) + (c4/y3) + (c5/y4);
+                }
+                else
+                {
+                    // Eqn. 33
+                    const scalar u =
+                        -lnB + (a - 1)*log(w) - log(1 + (1 - a)/(1 + w));
+
+                    return -lnB + (a - 1)*log(u) - log(1 + (1 - a)/(1 + u));
+                }
+            }
+        }
+        else
+        {
+            scalar z = w;
+            const scalar ap1 = a + 1;
+
+            if (w < 0.15*ap1)
+            {
+                // Eqn. 35
+                const scalar ap2 = a + 2;
+                const scalar v = log(P) + lgamma(ap1);
+                z = exp((v + w)/a);
+                s = log1p(z/ap1*(1 + z/ap2));
+                z = exp((v + z - s)/a);
+                s = log1p(z/ap1*(1 + z/ap2));
+                z = exp((v + z - s)/a);
+                s = log1p(z/ap1*(1 + z/ap2*(1 + z/(a + 3))));
+                z = exp((v + z - s)/a);
+            }
+
+            if (z <= 0.01*ap1 || z > 0.7*ap1)
+            {
+                return z;
+            }
+            else
+            {
+                // Eqn. 36
+                const scalar lnSn = log(Sn(a, z));
+                const scalar v = log(P) + lgamma(ap1);
+                z = exp((v + z - lnSn)/a);
+
+                return z*(1 - (a*log(z) - z - v + lnSn)/(a - z));
+            }
+        }
+    }
+}
+
+
+// ************************************************************************* //
diff --git a/src/OpenFOAM/primitives/Scalar/scalar/scalar.H b/src/OpenFOAM/primitives/Scalar/scalar/scalar.H
index f4a4a0f63ba27fc969d3c6e09dcf4ed85d8db4d7..7c7c00cefc268c6a606c3f3c2d349744217bbe3e 100644
--- a/src/OpenFOAM/primitives/Scalar/scalar/scalar.H
+++ b/src/OpenFOAM/primitives/Scalar/scalar/scalar.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -81,6 +81,14 @@ namespace Foam
 
 #endif
 
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+// Additional transcendental functions
+
+namespace Foam
+{
+    //- Inverse normalized incomplete gamma function
+    scalar invIncGamma(const scalar a, const scalar P);
+}
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/primitives/VectorSpace/VectorSpaceI.H b/src/OpenFOAM/primitives/VectorSpace/VectorSpaceI.H
index 9fb6f3f1dcea6cfeeaf5df9dd468d690cae4c750..c83ca715b24f80e49ee381dfa451611bce705852 100644
--- a/src/OpenFOAM/primitives/VectorSpace/VectorSpaceI.H
+++ b/src/OpenFOAM/primitives/VectorSpace/VectorSpaceI.H
@@ -106,7 +106,7 @@ inline const Cmpt& VectorSpace<Form, Cmpt, Ncmpts>::component
     if (d >= Ncmpts)
     {
         FatalErrorInFunction
-            << "index " << d << " out of range"
+            << "index out of range"
             << abort(FatalError);
     }
     #endif
@@ -125,7 +125,7 @@ inline Cmpt& VectorSpace<Form, Cmpt, Ncmpts>::component
     if (d >= Ncmpts)
     {
         FatalErrorInFunction
-            << "index " << d << "out of range"
+            << "index out of range"
             << abort(FatalError);
     }
     #endif
@@ -145,7 +145,7 @@ inline void VectorSpace<Form, Cmpt, Ncmpts>::component
     if (d >= Ncmpts)
     {
         FatalErrorInFunction
-            << "index " << d << " out of range"
+            << "index out of range"
             << abort(FatalError);
     }
     #endif
@@ -165,7 +165,7 @@ inline void VectorSpace<Form, Cmpt, Ncmpts>::replace
     if (d >= Ncmpts)
     {
         FatalErrorInFunction
-            << "index " << d << " out of range"
+            << "index out of range"
             << abort(FatalError);
     }
     #endif
@@ -205,7 +205,7 @@ inline const Cmpt& VectorSpace<Form, Cmpt, Ncmpts>::operator[]
     if (d >= Ncmpts)
     {
         FatalErrorInFunction
-            << "index " << d << " out of range"
+            << "index out of range"
             << abort(FatalError);
     }
     #endif
@@ -224,7 +224,7 @@ inline Cmpt& VectorSpace<Form, Cmpt, Ncmpts>::operator[]
     if (d >= Ncmpts)
     {
         FatalErrorInFunction
-            << "index " << d << " out of range"
+            << "index out of range"
             << abort(FatalError);
     }
     #endif
@@ -246,7 +246,7 @@ ConstBlock<SubVector, BStart>::operator[]
     if (d >= Ncmpts)
     {
         FatalErrorInFunction
-            << "index " << d << " out of range"
+            << "index out of range"
             << abort(FatalError);
     }
     #endif
@@ -276,7 +276,7 @@ ConstBlock<SubVector, BStart>::operator()
     if (j != 0)
     {
         FatalErrorInFunction
-            << "j != 0"
+            << "index " << j << " != 0"
             << abort(FatalError);
     }
     #endif
@@ -537,6 +537,18 @@ inline Cmpt cmptProduct
 }
 
 
+template<class Form, class Cmpt, direction Ncmpts>
+inline Form cmptSqr
+(
+    const VectorSpace<Form, Cmpt, Ncmpts>& vs
+)
+{
+    Form v;
+    VectorSpaceOps<Ncmpts,0>::eqOp(v, vs, eqSqrOp<Cmpt>());
+    return v;
+}
+
+
 template<class Form, class Cmpt, direction Ncmpts>
 inline Form cmptMag
 (
diff --git a/src/OpenFOAM/primitives/functions/Function1/Table/TableBase.C b/src/OpenFOAM/primitives/functions/Function1/Table/TableBase.C
index a4f83a039c782b6ac1f6242a9e96c9c6ba848d8b..95a5fce3e449af529ffb6c00b85f4128c6f04702 100644
--- a/src/OpenFOAM/primitives/functions/Function1/Table/TableBase.C
+++ b/src/OpenFOAM/primitives/functions/Function1/Table/TableBase.C
@@ -27,7 +27,7 @@ License
 #include "Time.H"
 #include "interpolationWeights.H"
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 template<class Type>
 const Foam::interpolationWeights&
diff --git a/src/OpenFOAM/primitives/functions/Function1/Table/TableBase.H b/src/OpenFOAM/primitives/functions/Function1/Table/TableBase.H
index 1c2eef7f3a1ae182df27bd6dc75167a566ff90bb..95c610902671d4ced217694f7233c8ddb00c5a18 100644
--- a/src/OpenFOAM/primitives/functions/Function1/Table/TableBase.H
+++ b/src/OpenFOAM/primitives/functions/Function1/Table/TableBase.H
@@ -104,6 +104,9 @@ protected:
         //- Return (demand driven) interpolator
         const interpolationWeights& interpolator() const;
 
+
+private:
+
         //- Disallow default bitwise assignment
         void operator=(const TableBase<Type>&);
 
diff --git a/src/OpenFOAM/primitives/ops/ops.H b/src/OpenFOAM/primitives/ops/ops.H
index 0db26d0026109fe49f2e008d85aa96de1c3c88a8..664947870ec9efdaa9244734ac9d440c5cec2e7f 100644
--- a/src/OpenFOAM/primitives/ops/ops.H
+++ b/src/OpenFOAM/primitives/ops/ops.H
@@ -72,6 +72,7 @@ EqOp(plusEq, x += y)
 EqOp(minusEq, x -= y)
 EqOp(multiplyEq, x *= y)
 EqOp(divideEq, x /= y)
+EqOp(eqSqr, x = sqr(y))
 EqOp(eqMag, x = mag(y))
 EqOp(plusEqMagSqr, x += magSqr(y))
 EqOp(maxEq, x = max(x, y))
diff --git a/src/Pstream/Allwclean b/src/Pstream/Allwclean
index df3ca316d4b3dcc8c6ee910bd22bf1e4edea9790..2650e4e38a912031c1ddf8c8e6afcdbf584787a5 100755
--- a/src/Pstream/Allwclean
+++ b/src/Pstream/Allwclean
@@ -5,7 +5,6 @@ cd ${0%/*} || exit 1    # Run from this directory
 # clean the qualified directory
 wcleanMpiLib()
 {
-    set +x
     for libName
     do
     (
@@ -13,15 +12,12 @@ wcleanMpiLib()
         wclean $libName
     )
     done
-    set -x
 }
 
-set -x
 wclean dummy
 
 case "$WM_MPLIB" in
 *MPI*)
-    set +x
     wcleanMpiLib mpi
     ;;
 esac
diff --git a/src/TurbulenceModels/Allwmake b/src/TurbulenceModels/Allwmake
index a0ab46241fe8b7337e1aedd902af1a6679d58feb..ddd0bb1ca57786032fb0de15c78c7046776d4a31 100755
--- a/src/TurbulenceModels/Allwmake
+++ b/src/TurbulenceModels/Allwmake
@@ -3,7 +3,6 @@ cd ${0%/*} || exit 1    # Run from this directory
 
 # Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-set -x
 
 wmake $targetType turbulenceModels
 wmake $targetType incompressible
diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C
index bf6be9f3b5de0b5e25fdee29e5f493f5e197106b..ab1abe4657f9a378dd3bc4869e3ee490e1cc077d 100644
--- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C
+++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C
@@ -27,7 +27,6 @@ License
 #include "addToRunTimeSelectionTable.H"
 #include "fvPatchFieldMapper.H"
 #include "volFields.H"
-#include "mappedPatchBase.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C
index afbad9981437e7426d31d1f24bb1c207069610c7..71c695e80de410e9e1d6ef6a9405a6f7040ae6e8 100644
--- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C
+++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C
@@ -25,7 +25,6 @@ License
 
 #include "volFields.H"
 #include "surfaceFields.H"
-#include "mappedPatchBase.H"
 #include "turbulentFluidThermoModel.H"
 #include "mapDistribute.H"
 
@@ -298,6 +297,8 @@ void thermalBaffle1DFvPatchScalarField<solidType>::autoMap
     const fvPatchFieldMapper& m
 )
 {
+    mappedPatchBase::clearOut();
+
     mixedFvPatchScalarField::autoMap(m);
 
     if (this->owner())
diff --git a/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/kkLOmega/kkLOmega.H b/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/kkLOmega/kkLOmega.H
index 4080ecbcdc5427d479653ad356d5b7cb34aea917..f17734962a9c930c2aedba9dfabbf11d9fd80003 100644
--- a/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/kkLOmega/kkLOmega.H
+++ b/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/kkLOmega/kkLOmega.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -112,7 +112,7 @@ class kkLOmega
 :
     public eddyViscosity<incompressible::RASModel>
 {
-    // Private memmber functions
+    // Private member functions
 
         tmp<volScalarField> fv(const volScalarField& Ret) const;
 
diff --git a/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/qZeta/qZeta.C b/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/qZeta/qZeta.C
index f5b587385af6dea8538da3d51b5ba044d7bc7895..a55f8d78e5559e6af3f77ae9563d5f8a57efe6ac 100644
--- a/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/qZeta/qZeta.C
+++ b/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/qZeta/qZeta.C
@@ -41,7 +41,7 @@ namespace RASModels
 defineTypeNameAndDebug(qZeta, 0);
 addToRunTimeSelectionTable(RASModel, qZeta, dictionary);
 
-// * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * * //
+// * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * * //
 
 tmp<volScalarField> qZeta::fMu() const
 {
diff --git a/src/TurbulenceModels/turbulenceModels/Base/kOmegaSST/kOmegaSSTBase.C b/src/TurbulenceModels/turbulenceModels/Base/kOmegaSST/kOmegaSSTBase.C
index da70b0cc1805d19f9556962e59864fd79d15791a..3694be51a512044d127d2d9446da777f516b03ea 100644
--- a/src/TurbulenceModels/turbulenceModels/Base/kOmegaSST/kOmegaSSTBase.C
+++ b/src/TurbulenceModels/turbulenceModels/Base/kOmegaSST/kOmegaSSTBase.C
@@ -32,7 +32,7 @@ License
 namespace Foam
 {
 
-// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * * //
 
 template<class BasicEddyViscosityModel>
 tmp<volScalarField> kOmegaSSTBase<BasicEddyViscosityModel>::F1
diff --git a/src/TurbulenceModels/turbulenceModels/DES/SpalartAllmarasIDDES/SpalartAllmarasIDDES.C b/src/TurbulenceModels/turbulenceModels/DES/SpalartAllmarasIDDES/SpalartAllmarasIDDES.C
index 99a884e2f9601b387ede1bf5eaf15c232efdf59c..06208c288e11689c898854191427ec4845793b60 100644
--- a/src/TurbulenceModels/turbulenceModels/DES/SpalartAllmarasIDDES/SpalartAllmarasIDDES.C
+++ b/src/TurbulenceModels/turbulenceModels/DES/SpalartAllmarasIDDES/SpalartAllmarasIDDES.C
@@ -104,8 +104,6 @@ tmp<volScalarField> SpalartAllmarasIDDES<BasicTurbulenceModel>::rd
 }
 
 
-// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
-
 template<class BasicTurbulenceModel>
 tmp<volScalarField> SpalartAllmarasIDDES<BasicTurbulenceModel>::fdt
 (
@@ -116,6 +114,8 @@ tmp<volScalarField> SpalartAllmarasIDDES<BasicTurbulenceModel>::fdt
 }
 
 
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
+
 template<class BasicTurbulenceModel>
 tmp<volScalarField> SpalartAllmarasIDDES<BasicTurbulenceModel>::dTilda
 (
diff --git a/src/TurbulenceModels/turbulenceModels/LES/dynamicKEqn/dynamicKEqn.C b/src/TurbulenceModels/turbulenceModels/LES/dynamicKEqn/dynamicKEqn.C
index f4be29d738effa28d84f238f58663cc7add10ef9..dae06399ba2c9e3811afea709ec9f152d6bad3ea 100644
--- a/src/TurbulenceModels/turbulenceModels/LES/dynamicKEqn/dynamicKEqn.C
+++ b/src/TurbulenceModels/turbulenceModels/LES/dynamicKEqn/dynamicKEqn.C
@@ -33,7 +33,7 @@ namespace Foam
 namespace LESModels
 {
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 template<class BasicTurbulenceModel>
 volScalarField dynamicKEqn<BasicTurbulenceModel>::Ck
diff --git a/src/TurbulenceModels/turbulenceModels/LES/dynamicLagrangian/dynamicLagrangian.C b/src/TurbulenceModels/turbulenceModels/LES/dynamicLagrangian/dynamicLagrangian.C
index 8e9cc672800730b210db7fefa47be6a8e21d7622..9a4e218d07b8e2cbb70f6e5738783e0b830c1492 100644
--- a/src/TurbulenceModels/turbulenceModels/LES/dynamicLagrangian/dynamicLagrangian.C
+++ b/src/TurbulenceModels/turbulenceModels/LES/dynamicLagrangian/dynamicLagrangian.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -33,7 +33,7 @@ namespace Foam
 namespace LESModels
 {
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 template<class BasicTurbulenceModel>
 void dynamicLagrangian<BasicTurbulenceModel>::correctNut
diff --git a/src/TurbulenceModels/turbulenceModels/RAS/realizableKE/realizableKE.C b/src/TurbulenceModels/turbulenceModels/RAS/realizableKE/realizableKE.C
index e1f6790583baefcb205f1d9912d0b9ee965b6dbf..77d01435f645ef11e125948051fe799b47945ea0 100644
--- a/src/TurbulenceModels/turbulenceModels/RAS/realizableKE/realizableKE.C
+++ b/src/TurbulenceModels/turbulenceModels/RAS/realizableKE/realizableKE.C
@@ -34,7 +34,7 @@ namespace Foam
 namespace RASModels
 {
 
-// * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * * //
+// * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * * //
 
 template<class BasicTurbulenceModel>
 tmp<volScalarField> realizableKE<BasicTurbulenceModel>::rCmu
diff --git a/src/TurbulenceModels/turbulenceModels/RAS/v2f/v2f.C b/src/TurbulenceModels/turbulenceModels/RAS/v2f/v2f.C
index 3ce9875ba688a4d7f4a5df889d5e4ef6d2365950..65330eee0505e8ef8078e26dd6059896825f19fa 100644
--- a/src/TurbulenceModels/turbulenceModels/RAS/v2f/v2f.C
+++ b/src/TurbulenceModels/turbulenceModels/RAS/v2f/v2f.C
@@ -34,7 +34,7 @@ namespace Foam
 namespace RASModels
 {
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 template<class BasicTurbulenceModel>
 tmp<volScalarField> v2f<BasicTurbulenceModel>::Ts() const
diff --git a/src/TurbulenceModels/turbulenceModels/ReynoldsStress/ReynoldsStress.C b/src/TurbulenceModels/turbulenceModels/ReynoldsStress/ReynoldsStress.C
index ab0830a20323790b72bba12f4bc82988bb8a2cef..b9f91bd1807a6ea47055a17ed475946931a47476 100644
--- a/src/TurbulenceModels/turbulenceModels/ReynoldsStress/ReynoldsStress.C
+++ b/src/TurbulenceModels/turbulenceModels/ReynoldsStress/ReynoldsStress.C
@@ -89,16 +89,13 @@ void Foam::ReynoldsStress<BasicTurbulenceModel>::correctWallShearStress
             forAll(curPatch, facei)
             {
                 // Calculate near-wall velocity gradient
-                tensor gradUw
+                const tensor gradUw
                     = (faceAreas[facei]/magFaceAreas[facei])*snGradU[facei];
 
-                // Calculate near-wall shear-stress tensor
-                tensor tauw = -nutw[facei]*2*dev(symm(gradUw));
-
-                // Reset the shear components of the stress tensor
-                Rw[facei].xy() = tauw.xy();
-                Rw[facei].xz() = tauw.xz();
-                Rw[facei].yz() = tauw.yz();
+                // Set the wall Reynolds-stress to the near-wall shear-stress
+                // Note: the spherical part of the normal stress is included in
+                // the pressure
+                Rw[facei] = -nutw[facei]*2*dev(symm(gradUw));
             }
         }
     }
@@ -230,9 +227,11 @@ Foam::ReynoldsStress<BasicTurbulenceModel>::devRhoReff() const
 
 
 template<class BasicTurbulenceModel>
+template<class RhoFieldType>
 Foam::tmp<Foam::fvVectorMatrix>
-Foam::ReynoldsStress<BasicTurbulenceModel>::divDevRhoReff
+Foam::ReynoldsStress<BasicTurbulenceModel>::DivDevRhoReff
 (
+    const RhoFieldType& rho,
     volVectorField& U
 ) const
 {
@@ -242,19 +241,19 @@ Foam::ReynoldsStress<BasicTurbulenceModel>::divDevRhoReff
         (
             fvc::laplacian
             (
-                (1.0 - couplingFactor_)*this->alpha_*this->rho_*this->nut(),
+                (1.0 - couplingFactor_)*this->alpha_*rho*this->nut(),
                 U,
                 "laplacian(nuEff,U)"
             )
           + fvc::div
             (
-                this->alpha_*this->rho_*R_
+                this->alpha_*rho*R_
               + couplingFactor_
-               *this->alpha_*this->rho_*this->nut()*fvc::grad(U),
+               *this->alpha_*rho*this->nut()*fvc::grad(U),
                 "div(devRhoReff)"
             )
-          - fvc::div(this->alpha_*this->rho_*this->nu()*dev2(T(fvc::grad(U))))
-          - fvm::laplacian(this->alpha_*this->rho_*this->nuEff(), U)
+          - fvc::div(this->alpha_*rho*this->nu()*dev2(T(fvc::grad(U))))
+          - fvm::laplacian(this->alpha_*rho*this->nuEff(), U)
         );
     }
     else
@@ -263,21 +262,26 @@ Foam::ReynoldsStress<BasicTurbulenceModel>::divDevRhoReff
         (
             fvc::laplacian
             (
-                this->alpha_*this->rho_*this->nut(),
+                this->alpha_*rho*this->nut(),
                 U,
                 "laplacian(nuEff,U)"
             )
-          + fvc::div(this->alpha_*this->rho_*R_)
-          - fvc::div(this->alpha_*this->rho_*this->nu()*dev2(T(fvc::grad(U))))
-          - fvm::laplacian(this->alpha_*this->rho_*this->nuEff(), U)
+          + fvc::div(this->alpha_*rho*R_)
+          - fvc::div(this->alpha_*rho*this->nu()*dev2(T(fvc::grad(U))))
+          - fvm::laplacian(this->alpha_*rho*this->nuEff(), U)
         );
     }
+}
 
-    return
-    (
-      - fvc::div((this->alpha_*this->rho_*this->nuEff())*dev2(T(fvc::grad(U))))
-      - fvm::laplacian(this->alpha_*this->rho_*this->nuEff(), U)
-    );
+
+template<class BasicTurbulenceModel>
+Foam::tmp<Foam::fvVectorMatrix>
+Foam::ReynoldsStress<BasicTurbulenceModel>::divDevRhoReff
+(
+    volVectorField& U
+) const
+{
+    return DivDevRhoReff(this->rho_, U);
 }
 
 
@@ -289,11 +293,7 @@ Foam::ReynoldsStress<BasicTurbulenceModel>::divDevRhoReff
     volVectorField& U
 ) const
 {
-    return
-    (
-      - fvc::div((this->alpha_*rho*this->nuEff())*dev2(T(fvc::grad(U))))
-      - fvm::laplacian(this->alpha_*rho*this->nuEff(), U)
-    );
+    return DivDevRhoReff(rho, U);
 }
 
 
diff --git a/src/TurbulenceModels/turbulenceModels/ReynoldsStress/ReynoldsStress.H b/src/TurbulenceModels/turbulenceModels/ReynoldsStress/ReynoldsStress.H
index e29c447459f1a87793414bc840ff043523968cd0..084830b0d6d3d7192d985bc574b587c75a0d4f9e 100644
--- a/src/TurbulenceModels/turbulenceModels/ReynoldsStress/ReynoldsStress.H
+++ b/src/TurbulenceModels/turbulenceModels/ReynoldsStress/ReynoldsStress.H
@@ -75,6 +75,14 @@ protected:
         //- Update the eddy-viscosity
         virtual void correctNut() = 0;
 
+        //- Return the source term for the momentum equation
+        template<class RhoFieldType>
+        tmp<fvVectorMatrix> DivDevRhoReff
+        (
+            const RhoFieldType& rho,
+            volVectorField& U
+        ) const;
+
 
 public:
 
diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C
index 03db4555a91a87f603d64978bfed2b62469d7fea..11873820e05d08bd3e884fec76cfc4ac5710c2d8 100644
--- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C
+++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C
@@ -35,7 +35,7 @@ License
 namespace Foam
 {
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 void kLowReWallFunctionFvPatchScalarField::checkType()
 {
@@ -51,8 +51,6 @@ void kLowReWallFunctionFvPatchScalarField::checkType()
 }
 
 
-// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
-
 scalar kLowReWallFunctionFvPatchScalarField::yPlusLam
 (
     const scalar kappa,
diff --git a/src/combustionModels/FSD/FSD.C b/src/combustionModels/FSD/FSD.C
index dd275c4e6738753f9fa86d17b4f1e7ba17de7351..25ed498fce6ed287f19093bde285c5ac5f998d02 100644
--- a/src/combustionModels/FSD/FSD.C
+++ b/src/combustionModels/FSD/FSD.C
@@ -41,6 +41,7 @@ FSD<CombThermoType, ThermoType>::FSD
 (
     const word& modelType,
     const fvMesh& mesh,
+    const word& combustionProperties,
     const word& phaseName
 )
 :
@@ -48,6 +49,7 @@ FSD<CombThermoType, ThermoType>::FSD
     (
         modelType,
         mesh,
+        combustionProperties,
         phaseName
     ),
     reactionRateFlameArea_
diff --git a/src/combustionModels/FSD/FSD.H b/src/combustionModels/FSD/FSD.H
index 2d4e17b63725c8a3a684c92679834346aff689cf..590c9ae91c621419f14c051ded40c4f6b50b32a6 100644
--- a/src/combustionModels/FSD/FSD.H
+++ b/src/combustionModels/FSD/FSD.H
@@ -139,21 +139,24 @@ public:
     // Constructors
 
         //- Construct from components
-        FSD(const word& modelType, const fvMesh& mesh, const word& phaseName);
+        FSD
+        (
+            const word& modelType,
+            const fvMesh& mesh,
+            const word& combustionProperties,
+            const word& phaseName
+        );
 
 
-    // Destructor
-        virtual ~FSD();
+    //- Destructor
+    virtual ~FSD();
 
 
-    // Evolution
+    // Member Functions
 
         //- Correct combustion rate
         virtual void correct();
 
-
-    // IO
-
         //- Update properties
         virtual bool read();
 };
diff --git a/src/combustionModels/Make/files b/src/combustionModels/Make/files
index e04239c47b13faa16915f251a336fe16277c9f6a..09844f061e9966cbbe7b044f8120f051d1f3823b 100644
--- a/src/combustionModels/Make/files
+++ b/src/combustionModels/Make/files
@@ -29,6 +29,8 @@ FSD/FSDs.C
 
 diffusionMulticomponent/diffusionMulticomponents.C
 
+zoneCombustion/zoneCombustions.C
+
 noCombustion/noCombustions.C
 
 LIB = $(FOAM_LIBBIN)/libcombustionModels
diff --git a/src/combustionModels/PaSR/PaSR.C b/src/combustionModels/PaSR/PaSR.C
index 581e1556719aacdde5d25556dbb32dc4b638c487..5fd8fdf1044f81a3bd5e287968fab1aed88600c5 100644
--- a/src/combustionModels/PaSR/PaSR.C
+++ b/src/combustionModels/PaSR/PaSR.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -33,10 +33,11 @@ Foam::combustionModels::PaSR<Type>::PaSR
 (
     const word& modelType,
     const fvMesh& mesh,
+    const word& combustionProperties,
     const word& phaseName
 )
 :
-    laminar<Type>(modelType, mesh, phaseName),
+    laminar<Type>(modelType, mesh, combustionProperties, phaseName),
     Cmix_(readScalar(this->coeffs().lookup("Cmix"))),
     turbulentReaction_(this->coeffs().lookup("turbulentReaction")),
     kappa_
diff --git a/src/combustionModels/PaSR/PaSR.H b/src/combustionModels/PaSR/PaSR.H
index cbcb37bc835f81e8f39d7fa86771bae3ed58fd95..085d7245ee606011f5682b42d6e30bfcd7802a73 100644
--- a/src/combustionModels/PaSR/PaSR.H
+++ b/src/combustionModels/PaSR/PaSR.H
@@ -89,7 +89,13 @@ public:
     // Constructors
 
         //- Construct from components
-        PaSR(const word& modelType, const fvMesh& mesh, const word& phaseName);
+        PaSR
+        (
+            const word& modelType,
+            const fvMesh& mesh,
+            const word& combustionProperties,
+            const word& phaseName
+        );
 
 
     //- Destructor
@@ -98,25 +104,20 @@ public:
 
     // Member Functions
 
-        // Evolution
+        //- Correct combustion rate
+        virtual void correct();
 
-            //- Correct combustion rate
-            virtual void correct();
+        //- Fuel consumption rate matrix.
+        virtual tmp<fvScalarMatrix> R(volScalarField& Y) const;
 
-            //- Fuel consumption rate matrix.
-            virtual tmp<fvScalarMatrix> R(volScalarField& Y) const;
+        //- Heat release rate calculated from fuel consumption rate matrix
+        virtual tmp<volScalarField> dQ() const;
 
-            //- Heat release rate calculated from fuel consumption rate matrix
-            virtual tmp<volScalarField> dQ() const;
+        //-  Return source for enthalpy equation [kg/m/s3]
+        virtual tmp<volScalarField> Sh() const;
 
-            //-  Return source for enthalpy equation [kg/m/s3]
-            virtual tmp<volScalarField> Sh() const;
-
-
-    // IO
-
-            //- Update properties from given dictionary
-            virtual bool read();
+        //- Update properties from given dictionary
+        virtual bool read();
 };
 
 
diff --git a/src/combustionModels/combustionModel/combustionModel.C b/src/combustionModels/combustionModel/combustionModel.C
index 21e81beb912794593b4db9c3f67e4139a93e2a71..b27a5f232001ed7d24f1404f7b00aa7f6535ccea 100644
--- a/src/combustionModels/combustionModel/combustionModel.C
+++ b/src/combustionModels/combustionModel/combustionModel.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -32,12 +32,19 @@ namespace Foam
     defineTypeNameAndDebug(combustionModel, 0);
 }
 
+const Foam::word Foam::combustionModel::combustionPropertiesName
+(
+    "combustionProperties"
+);
+
+
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
 Foam::combustionModel::combustionModel
 (
     const word& modelType,
     const fvMesh& mesh,
+    const word& combustionProperties,
     const word& phaseName
 )
 :
@@ -45,7 +52,7 @@ Foam::combustionModel::combustionModel
     (
         IOobject
         (
-            IOobject::groupName("combustionProperties", phaseName),
+            IOobject::groupName(combustionProperties, phaseName),
             mesh.time().constant(),
             mesh,
             IOobject::MUST_READ_IF_MODIFIED,
diff --git a/src/combustionModels/combustionModel/combustionModel.H b/src/combustionModels/combustionModel/combustionModel.H
index 8a0d0cd68ab6ed70a1a91d4fc32fb03d21741069..d428e27a78b00a883c03ddac656f28d114d9697e 100644
--- a/src/combustionModels/combustionModel/combustionModel.H
+++ b/src/combustionModels/combustionModel/combustionModel.H
@@ -91,6 +91,9 @@ public:
     //- Runtime type information
     TypeName("combustionModel");
 
+    //- Default combustionProperties dictionary name
+    static const word combustionPropertiesName;
+
 
     // Constructors
 
@@ -99,6 +102,7 @@ public:
         (
             const word& modelType,
             const fvMesh& mesh,
+            const word& combustionProperties=combustionPropertiesName,
             const word& phaseName=word::null
         );
 
@@ -109,31 +113,26 @@ public:
 
     // Member Functions
 
-        // Access
-
-            //- Return const access to the mesh database
-            inline const fvMesh& mesh() const;
-
-            //- Set turbulence
-            inline void setTurbulence(compressibleTurbulenceModel& turbModel);
+        //- Return const access to the mesh database
+        inline const fvMesh& mesh() const;
 
-            //- Return access to turbulence
-            inline const compressibleTurbulenceModel& turbulence() const;
+        //- Set turbulence
+        inline void setTurbulence(compressibleTurbulenceModel& turbModel);
 
-            //- Return const access to rho
-            inline const volScalarField& rho() const;
+        //- Return access to turbulence
+        inline const compressibleTurbulenceModel& turbulence() const;
 
-            //- Return const access to phi
-            inline tmp<surfaceScalarField> phi() const;
+        //- Return const access to rho
+        inline const volScalarField& rho() const;
 
-            //- Is combustion active?
-            inline const Switch& active() const;
+        //- Return const access to phi
+        inline tmp<surfaceScalarField> phi() const;
 
-            //- Return const dictionary of the model
-            inline const dictionary& coeffs() const;
+        //- Is combustion active?
+        inline const Switch& active() const;
 
-
-    // Evolution
+        //- Return const dictionary of the model
+        inline const dictionary& coeffs() const;
 
         //- Correct combustion rate
         virtual void correct() = 0;
@@ -147,9 +146,6 @@ public:
         //-  Return source for enthalpy equation [kg/m/s3]
         virtual tmp<volScalarField> Sh() const;
 
-
-    // IO
-
         //- Update properties from given dictionary
         virtual bool read();
 };
diff --git a/src/combustionModels/diffusion/diffusion.C b/src/combustionModels/diffusion/diffusion.C
index f78194cc494d63b229e93c6f8a8c54d7881f26d7..ca6f896067d835ca6c45d8ca627fbb4441c837bd 100644
--- a/src/combustionModels/diffusion/diffusion.C
+++ b/src/combustionModels/diffusion/diffusion.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2012-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2012-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -38,6 +38,7 @@ diffusion<CombThermoType, ThermoType>::diffusion
 (
     const word& modelType,
     const fvMesh& mesh,
+    const word& combustionProperties,
     const word& phaseName
 )
 :
@@ -45,6 +46,7 @@ diffusion<CombThermoType, ThermoType>::diffusion
     (
         modelType,
         mesh,
+        combustionProperties,
         phaseName
     ),
     C_(readScalar(this->coeffs().lookup("C"))),
diff --git a/src/combustionModels/diffusion/diffusion.H b/src/combustionModels/diffusion/diffusion.H
index 59b6ecda4d24eef701436f84cff98c36e91e4e8f..2a01905b0c1e18188f7bc698495b92c15990c795 100644
--- a/src/combustionModels/diffusion/diffusion.H
+++ b/src/combustionModels/diffusion/diffusion.H
@@ -89,6 +89,7 @@ public:
         (
             const word& modelType,
             const fvMesh& mesh,
+            const word& combustionProperties,
             const word& phaseName
         );
 
@@ -99,16 +100,11 @@ public:
 
     // Member Functions
 
-        // Evolution
+        //- Correct combustion rate
+        virtual void correct();
 
-            //- Correct combustion rate
-            virtual void correct();
-
-
-        // IO
-
-            //- Update properties
-            virtual bool read();
+        //- Update properties
+        virtual bool read();
 };
 
 
diff --git a/src/combustionModels/diffusion/diffusions.C b/src/combustionModels/diffusion/diffusions.C
index e358c96d34d96666711f0c51f523e87dac734de9..68ec7b73ae4a7e106ad8964bd77128560d35f4ce 100644
--- a/src/combustionModels/diffusion/diffusions.C
+++ b/src/combustionModels/diffusion/diffusions.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2012-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2012-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -65,7 +65,8 @@ makeCombustionTypesThermo
     rhoCombustionModel
 );
 
- // Combustion models based on sensibleInternalEnergy
+
+// Combustion models based on sensibleInternalEnergy
 
 makeCombustionTypesThermo
 (
diff --git a/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C b/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C
index 62626826188e7a5a0d0bc4aee6b078981bd38cd4..49c0d60e353a57171d5e03be10cd06e715ba07eb 100644
--- a/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C
+++ b/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -37,6 +37,7 @@ infinitelyFastChemistry<CombThermoType, ThermoType>::infinitelyFastChemistry
 (
     const word& modelType,
     const fvMesh& mesh,
+    const word& combustionProperties,
     const word& phaseName
 )
 :
@@ -44,6 +45,7 @@ infinitelyFastChemistry<CombThermoType, ThermoType>::infinitelyFastChemistry
     (
         modelType,
         mesh,
+        combustionProperties,
         phaseName
     ),
     C_(readScalar(this->coeffs().lookup("C")))
diff --git a/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.H b/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.H
index 16a89b9cee7c602f11833c3a958316c01d506cb1..8c899b76d5b3234922a506f8fa6f70680a0d4388 100644
--- a/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.H
+++ b/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.H
@@ -86,6 +86,7 @@ public:
         (
             const word& modelType,
             const fvMesh& mesh,
+            const word& combustionProperties,
             const word& phaseName
         );
 
@@ -96,16 +97,11 @@ public:
 
     // Member Functions
 
-        // Evolution
+        //- Correct combustion rate
+        virtual void correct();
 
-            //- Correct combustion rate
-            virtual void correct();
-
-
-        // IO
-
-            //- Update properties
-            virtual bool read();
+        //- Update properties
+        virtual bool read();
 };
 
 
diff --git a/src/combustionModels/laminar/laminar.C b/src/combustionModels/laminar/laminar.C
index 155c8bf01e3d43d0bf905b84c30687ceef089bdb..dcf9c6450c46fe2adb8f44e769536b23bb7436b8 100644
--- a/src/combustionModels/laminar/laminar.C
+++ b/src/combustionModels/laminar/laminar.C
@@ -34,10 +34,11 @@ Foam::combustionModels::laminar<Type>::laminar
 (
     const word& modelType,
     const fvMesh& mesh,
+    const word& combustionProperties,
     const word& phaseName
 )
 :
-    Type(modelType, mesh, phaseName),
+    Type(modelType, mesh, combustionProperties, phaseName),
     integrateReactionRate_
     (
         this->coeffs().lookupOrDefault("integrateReactionRate", true)
diff --git a/src/combustionModels/laminar/laminar.H b/src/combustionModels/laminar/laminar.H
index 605850bef793831b47e65e6db07bee053762516b..7c882c8bbbb92c8d2d231cb782e3c1d41cbbaed0 100644
--- a/src/combustionModels/laminar/laminar.H
+++ b/src/combustionModels/laminar/laminar.H
@@ -91,6 +91,7 @@ public:
         (
             const word& modelType,
             const fvMesh& mesh,
+            const word& combustionProperties,
             const word& phaseName
         );
 
@@ -101,25 +102,20 @@ public:
 
     // Member Functions
 
-        // Evolution
+        //- Correct combustion rate
+        virtual void correct();
 
-            //- Correct combustion rate
-            virtual void correct();
+        //- Fuel consumption rate matrix.
+        virtual tmp<fvScalarMatrix> R(volScalarField& Y) const;
 
-            //- Fuel consumption rate matrix.
-            virtual tmp<fvScalarMatrix> R(volScalarField& Y) const;
+        //- Heat release rate calculated from fuel consumption rate matrix
+        virtual tmp<volScalarField> dQ() const;
 
-            //- Heat release rate calculated from fuel consumption rate matrix
-            virtual tmp<volScalarField> dQ() const;
+        //-  Return source for enthalpy equation [kg/m/s3]
+        virtual tmp<volScalarField> Sh() const;
 
-            //-  Return source for enthalpy equation [kg/m/s3]
-            virtual tmp<volScalarField> Sh() const;
-
-
-    // IO
-
-            //- Update properties from given dictionary
-            virtual bool read();
+        //- Update properties from given dictionary
+        virtual bool read();
 };
 
 
diff --git a/src/combustionModels/noCombustion/noCombustion.C b/src/combustionModels/noCombustion/noCombustion.C
index f5947759179dc5aa8bd4682f33e0bb986b0c7721..7caeac0fe4bb3af5ca249c9c5f1fa27ec10ae6d6 100644
--- a/src/combustionModels/noCombustion/noCombustion.C
+++ b/src/combustionModels/noCombustion/noCombustion.C
@@ -33,6 +33,7 @@ Foam::combustionModels::noCombustion<CombThermoType>::noCombustion
 (
     const word& modelType,
     const fvMesh& mesh,
+    const word& combustionProperties,
     const word& phaseName
 )
 :
diff --git a/src/combustionModels/noCombustion/noCombustion.H b/src/combustionModels/noCombustion/noCombustion.H
index 641970fd6ff0840bea6d0506e4e4e6b2e48c9229..74711d613ca70e3b41536114f7ab4c737896cdd7 100644
--- a/src/combustionModels/noCombustion/noCombustion.H
+++ b/src/combustionModels/noCombustion/noCombustion.H
@@ -75,6 +75,7 @@ public:
         (
             const word& modelType,
             const fvMesh& mesh,
+            const word& combustionProperties,
             const word& phaseName
         );
 
@@ -85,24 +86,20 @@ public:
 
     // Member Functions
 
-        // Evolution
+        //- Correct combustion rate
+        virtual void correct();
 
-            //- Correct combustion rate
-            virtual void correct();
+        //- Fuel consumption rate matrix
+        virtual tmp<fvScalarMatrix> R(volScalarField& Y) const;
 
-            //- Fuel consumption rate matrix
-            virtual tmp<fvScalarMatrix> R(volScalarField& Y) const;
+        //- Heat release rate calculated from fuel consumption rate matrix
+        virtual tmp<volScalarField> dQ() const;
 
-            //- Heat release rate calculated from fuel consumption rate matrix
-            virtual tmp<volScalarField> dQ() const;
+        //-  Return source for enthalpy equation [kg/m/s3]
+        virtual tmp<volScalarField> Sh() const;
 
-            //-  Return source for enthalpy equation [kg/m/s3]
-            virtual tmp<volScalarField> Sh() const;
-
-    // IO
-
-            //- Update properties from given dictionary
-            virtual bool read();
+        //- Update properties from given dictionary
+        virtual bool read();
 };
 
 
diff --git a/src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.C b/src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.C
index b28116706e30ce5ab3916d0b998a64b3a3dbd3ea..032a0632354326049633ac1eb0dd9dab0ed1fadf 100644
--- a/src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.C
+++ b/src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.C
@@ -31,10 +31,11 @@ Foam::combustionModels::psiChemistryCombustion::psiChemistryCombustion
 (
     const word& modelType,
     const fvMesh& mesh,
+    const word& combustionProperties,
     const word& phaseName
 )
 :
-    psiCombustionModel(modelType, mesh, phaseName),
+    psiCombustionModel(modelType, mesh, combustionProperties, phaseName),
     chemistryPtr_(psiChemistryModel::New(mesh, phaseName))
 {}
 
diff --git a/src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.H b/src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.H
index 5c16c8ad8e778d011b9232c65359a08eb2b0c223..6da4496659782889ee6b9fcb0aed18653d15aa1e 100644
--- a/src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.H
+++ b/src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.H
@@ -80,6 +80,7 @@ public:
         (
             const word& modelType,
             const fvMesh& mesh,
+            const word& combustionProperties,
             const word& phaseName
         );
 
diff --git a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.C b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.C
index 1ecc201dd310879282bb8d727819fa5e2317bf0e..36d78166b792b86198d475e8b58de23e7273eebc 100644
--- a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.C
+++ b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -42,10 +42,11 @@ Foam::combustionModels::psiCombustionModel::psiCombustionModel
 (
     const word& modelType,
     const fvMesh& mesh,
+    const word& combustionProperties,
     const word& phaseName
 )
 :
-    combustionModel(modelType, mesh, phaseName)
+    combustionModel(modelType, mesh, combustionProperties, phaseName)
 {}
 
 
diff --git a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.H b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.H
index 36bd824f416151dd54125a55a2f314400b9eae32..ae4a75c41b6d1cebeabeb604906ecf29e880f67d 100644
--- a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.H
+++ b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.H
@@ -57,7 +57,6 @@ class psiCombustionModel
 :
     public combustionModel
 {
-
     // Private Member Functions
 
         //- Construct as copy (not implemented)
@@ -69,6 +68,9 @@ class psiCombustionModel
 
 public:
 
+    typedef psiReactionThermo ReactionThermo;
+
+
     //- Runtime type information
     TypeName("psiCombustionModel");
 
@@ -82,9 +84,10 @@ public:
         (
             const word& modelType,
             const fvMesh& mesh,
+            const word& combustionProperties,
             const word& phaseName
         ),
-        (modelType, mesh, phaseName)
+        (modelType, mesh, combustionProperties, phaseName)
     );
 
 
@@ -95,17 +98,18 @@ public:
         (
             const word& modelType,
             const fvMesh& mesh,
+            const word& combustionProperties,
             const word& phaseName
         );
 
 
-
-    //- Selector
-    static autoPtr<psiCombustionModel> New
-    (
-        const fvMesh& mesh,
-        const word& phaseName=word::null
-    );
+        //- Selector
+        static autoPtr<psiCombustionModel> New
+        (
+            const fvMesh& mesh,
+            const word& combustionProperties=combustionPropertiesName,
+            const word& phaseName=word::null
+        );
 
 
     //- Destructor
diff --git a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C
index 59789b48410b5af1a27aa1c57dc46961668c0f11..6c06cf881d958a73a874b5ce302483fc23bba3ad 100644
--- a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C
+++ b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -31,6 +31,7 @@ Foam::autoPtr<Foam::combustionModels::psiCombustionModel>
 Foam::combustionModels::psiCombustionModel::New
 (
     const fvMesh& mesh,
+    const word& combustionProperties,
     const word& phaseName
 )
 {
@@ -40,7 +41,7 @@ Foam::combustionModels::psiCombustionModel::New
         (
             IOobject
             (
-                IOobject::groupName("combustionProperties", phaseName),
+                IOobject::groupName(combustionProperties, phaseName),
                 mesh.time().constant(),
                 mesh,
                 IOobject::MUST_READ,
@@ -65,11 +66,12 @@ Foam::combustionModels::psiCombustionModel::New
             << exit(FatalError);
     }
 
-    const label tempOpen = combModelName.find('<');
+    const word className = combModelName(0, combModelName.find('<'));
 
-    const word className = combModelName(0, tempOpen);
-
-    return autoPtr<psiCombustionModel>(cstrIter()(className, mesh, phaseName));
+    return autoPtr<psiCombustionModel>
+    (
+        cstrIter()(className, mesh, combustionProperties, phaseName)
+    );
 }
 
 
diff --git a/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.C b/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.C
index 25450e2473f49753fcccba7816b792994f3dbbf0..e2b2440b5a4176cab0a1767fd3895f05e93c5991 100644
--- a/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.C
+++ b/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.C
@@ -34,7 +34,7 @@ Foam::combustionModels::psiThermoCombustion::psiThermoCombustion
     const word& phaseName
 )
 :
-    psiCombustionModel(modelType, mesh, phaseName),
+    psiCombustionModel(modelType, mesh, combustionPropertiesName, phaseName),
     thermoPtr_(psiReactionThermo::New(mesh, phaseName))
 {}
 
diff --git a/src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.C b/src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.C
index b6d1ac1172348089d68a7863318288404342a8d7..4d977c7fd51e621f8a3b2442d2e8fd2a8fcb3358 100644
--- a/src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.C
+++ b/src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.C
@@ -31,10 +31,11 @@ Foam::combustionModels::rhoChemistryCombustion::rhoChemistryCombustion
 (
     const word& modelType,
     const fvMesh& mesh,
+    const word& combustionProperties,
     const word& phaseName
 )
 :
-    rhoCombustionModel(modelType, mesh, phaseName),
+    rhoCombustionModel(modelType, mesh, combustionProperties, phaseName),
     chemistryPtr_(rhoChemistryModel::New(mesh, phaseName))
 {}
 
diff --git a/src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.H b/src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.H
index c8389c0ea534a9388a14e8f9da61cef218172d67..93d4731026c620ece08f80140c3ed39b255649e3 100644
--- a/src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.H
+++ b/src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.H
@@ -80,6 +80,7 @@ public:
         (
             const word& modelType,
             const fvMesh& mesh,
+            const word& combustionProperties,
             const word& phaseName
         );
 
diff --git a/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.C b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.C
index 531b169d7d46fbe4d5b904097fa59e08df566291..bcc0b18c3ffc21e327fe2ede2bbaa2932fe76386 100644
--- a/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.C
+++ b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -42,10 +42,11 @@ Foam::combustionModels::rhoCombustionModel::rhoCombustionModel
 (
     const word& modelType,
     const fvMesh& mesh,
+    const word& combustionProperties,
     const word& phaseName
 )
 :
-    combustionModel(modelType, mesh, phaseName)
+    combustionModel(modelType, mesh, combustionProperties, phaseName)
 {}
 
 
diff --git a/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.H b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.H
index 0266c74b3e05f8c3deb89ff30b24845874c59b20..2e261a5b98c0f3ca708f713fbf25c31029c27c3f 100644
--- a/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.H
+++ b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.H
@@ -69,6 +69,9 @@ class rhoCombustionModel
 
 public:
 
+    typedef rhoReactionThermo ReactionThermo;
+
+
     //- Runtime type information
     TypeName("rhoCombustionModel");
 
@@ -82,9 +85,10 @@ public:
         (
             const word& modelType,
             const fvMesh& mesh,
+            const word& combustionProperties,
             const word& phaseName
         ),
-        (modelType, mesh, phaseName)
+        (modelType, mesh, combustionProperties, phaseName)
     );
 
 
@@ -96,6 +100,7 @@ public:
         (
             const word& modelType,
             const fvMesh& mesh,
+            const word& combustionProperties,
             const word& phaseName
         );
 
@@ -105,6 +110,7 @@ public:
     static autoPtr<rhoCombustionModel> New
     (
         const fvMesh& mesh,
+        const word& combustionProperties=combustionPropertiesName,
         const word& phaseName=word::null
     );
 
diff --git a/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C
index 4a23b500d5e9044b7070e54f0d7b97a8de71459b..e179f04141b59b6e3f2fb6725a22a9a9eae643e2 100644
--- a/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C
+++ b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -31,6 +31,7 @@ Foam::autoPtr<Foam::combustionModels::rhoCombustionModel>
 Foam::combustionModels::rhoCombustionModel::New
 (
     const fvMesh& mesh,
+    const word& combustionProperties,
     const word& phaseName
 )
 {
@@ -40,7 +41,7 @@ Foam::combustionModels::rhoCombustionModel::New
         (
             IOobject
             (
-                IOobject::groupName("combustionProperties", phaseName),
+                IOobject::groupName(combustionProperties, phaseName),
                 mesh.time().constant(),
                 mesh,
                 IOobject::MUST_READ,
@@ -69,7 +70,10 @@ Foam::combustionModels::rhoCombustionModel::New
 
     const word className = combTypeName(0, tempOpen);
 
-    return autoPtr<rhoCombustionModel> (cstrIter()(className, mesh, phaseName));
+    return autoPtr<rhoCombustionModel>
+    (
+        cstrIter()(className, mesh, combustionProperties, phaseName)
+    );
 }
 
 
diff --git a/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.C b/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.C
index aa645f0898acd048d59c51cc9f0c9b4cf8db02fb..a4a5be12c5a1100ad94e6e3efacafd9a310ea059 100644
--- a/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.C
+++ b/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.C
@@ -34,7 +34,7 @@ Foam::combustionModels::rhoThermoCombustion::rhoThermoCombustion
     const word& phaseName
 )
 :
-    rhoCombustionModel(modelType, mesh, phaseName),
+    rhoCombustionModel(modelType, mesh, combustionPropertiesName, phaseName),
     thermoPtr_(rhoReactionThermo::New(mesh, phaseName))
 {}
 
diff --git a/src/combustionModels/singleStepCombustion/singleStepCombustion.C b/src/combustionModels/singleStepCombustion/singleStepCombustion.C
index a8296fffb3541c8229c5e6c5dae39693d806350a..c2a243747bb4ebe11b11ff6f18568ddd1031343f 100644
--- a/src/combustionModels/singleStepCombustion/singleStepCombustion.C
+++ b/src/combustionModels/singleStepCombustion/singleStepCombustion.C
@@ -38,6 +38,7 @@ singleStepCombustion<CombThermoType, ThermoType>::singleStepCombustion
 (
     const word& modelType,
     const fvMesh& mesh,
+    const word& combustionProperties,
     const word& phaseName
 )
 :
diff --git a/src/combustionModels/singleStepCombustion/singleStepCombustion.H b/src/combustionModels/singleStepCombustion/singleStepCombustion.H
index 4a17add9f13a0f4cde35c48af247d07e92750838..bb31657cf8687261f6de27124ae3accecd7277fd 100644
--- a/src/combustionModels/singleStepCombustion/singleStepCombustion.H
+++ b/src/combustionModels/singleStepCombustion/singleStepCombustion.H
@@ -88,6 +88,7 @@ public:
         (
             const word& modelType,
             const fvMesh& mesh,
+            const word& combustionProperties,
             const word& phaseName
         );
 
@@ -98,22 +99,17 @@ public:
 
     // Member Functions
 
-        // Evolution
+        //- Fuel consumption rate matrix
+        virtual tmp<fvScalarMatrix> R(volScalarField& Y) const;
 
-            //- Fuel consumption rate matrix
-            virtual tmp<fvScalarMatrix> R(volScalarField& Y) const;
+        //- Heat release rate calculated from fuel consumption rate matrix
+        virtual tmp<volScalarField> dQ() const;
 
-            //- Heat release rate calculated from fuel consumption rate matrix
-            virtual tmp<volScalarField> dQ() const;
+        //- Sensible enthalpy source term
+        virtual tmp<volScalarField> Sh() const;
 
-            //- Sensible enthalpy source term
-            virtual tmp<volScalarField> Sh() const;
-
-
-        // IO
-
-            //- Update properties from given dictionary
-            virtual bool read();
+        //- Update properties from given dictionary
+        virtual bool read();
 };
 
 
diff --git a/src/combustionModels/zoneCombustion/zoneCombustion.C b/src/combustionModels/zoneCombustion/zoneCombustion.C
new file mode 100644
index 0000000000000000000000000000000000000000..3cec4e1197a0fa50b4e668fafc718d9ea7899b79
--- /dev/null
+++ b/src/combustionModels/zoneCombustion/zoneCombustion.C
@@ -0,0 +1,197 @@
+/*---------------------------------------------------------------------------* \
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+\*---------------------------------------------------------------------------*/
+
+#include "zoneCombustion.H"
+
+// * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * * //
+
+template<class Type>
+Foam::tmp<Foam::fvScalarMatrix>
+Foam::combustionModels::zoneCombustion<Type>::filter
+(
+    const tmp<fvScalarMatrix>& tR
+) const
+{
+    fvScalarMatrix& R = tR.ref();
+    scalarField& Su = R.source();
+    scalarField filteredField(Su.size(), 0);
+
+    forAll(zoneNames_, zonei)
+    {
+        const labelList& cells = this->mesh().cellZones()[zoneNames_[zonei]];
+
+        forAll(cells, i)
+        {
+            filteredField[cells[i]] = Su[cells[i]];
+        }
+    }
+
+    Su = filteredField;
+
+    if (R.hasDiag())
+    {
+        scalarField& Sp = R.diag();
+
+        forAll(zoneNames_, zonei)
+        {
+            const labelList& cells =
+                this->mesh().cellZones()[zoneNames_[zonei]];
+
+            forAll(cells, i)
+            {
+                filteredField[cells[i]] = Sp[cells[i]];
+            }
+        }
+
+        Sp = filteredField;
+    }
+
+    return tR;
+}
+
+
+template<class Type>
+Foam::tmp<Foam::volScalarField>
+Foam::combustionModels::zoneCombustion<Type>::filter
+(
+    const tmp<volScalarField>& tS
+) const
+{
+    scalarField& S = tS.ref();
+    scalarField filteredField(S.size(), 0);
+
+    forAll(zoneNames_, zonei)
+    {
+        const labelList& cells = this->mesh().cellZones()[zoneNames_[zonei]];
+
+        forAll(cells, i)
+        {
+            filteredField[cells[i]] = S[cells[i]];
+        }
+    }
+
+    S = filteredField;
+
+    return tS;
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
+
+template<class Type>
+Foam::combustionModels::zoneCombustion<Type>::zoneCombustion
+(
+    const word& modelType,
+    const fvMesh& mesh,
+    const word& combustionProperties,
+    const word& phaseName
+)
+:
+    Type(modelType, mesh, combustionProperties, phaseName),
+    combustionModelPtr_
+    (
+        Type::New
+        (
+            mesh,
+            "zoneCombustionProperties",
+            phaseName
+        )
+    ),
+    zoneNames_(this->coeffs().lookup("zones"))
+{}
+
+
+// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
+
+template<class Type>
+Foam::combustionModels::zoneCombustion<Type>::~zoneCombustion()
+{}
+
+
+// * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * * //
+
+template<class Type>
+typename Type::ReactionThermo&
+Foam::combustionModels::zoneCombustion<Type>::thermo()
+{
+    return combustionModelPtr_->thermo();
+}
+
+
+template<class Type>
+const typename Type::ReactionThermo&
+Foam::combustionModels::zoneCombustion<Type>::thermo() const
+{
+    return combustionModelPtr_->thermo();
+}
+
+
+template<class Type>
+void Foam::combustionModels::zoneCombustion<Type>::correct()
+{
+    combustionModelPtr_->correct();
+}
+
+
+template<class Type>
+Foam::tmp<Foam::fvScalarMatrix>
+Foam::combustionModels::zoneCombustion<Type>::R(volScalarField& Y) const
+{
+    return filter(combustionModelPtr_->R(Y));
+}
+
+
+template<class Type>
+Foam::tmp<Foam::volScalarField>
+Foam::combustionModels::zoneCombustion<Type>::dQ() const
+{
+    return filter(combustionModelPtr_->dQ());
+}
+
+
+template<class Type>
+Foam::tmp<Foam::volScalarField>
+Foam::combustionModels::zoneCombustion<Type>::Sh() const
+{
+    return filter(combustionModelPtr_->Sh());
+}
+
+
+template<class Type>
+bool Foam::combustionModels::zoneCombustion<Type>::read()
+{
+    if (Type::read())
+    {
+        combustionModelPtr_->read();
+        return true;
+    }
+    else
+    {
+        return false;
+    }
+}
+
+
+// ************************************************************************* //
diff --git a/src/combustionModels/zoneCombustion/zoneCombustion.H b/src/combustionModels/zoneCombustion/zoneCombustion.H
new file mode 100644
index 0000000000000000000000000000000000000000..ca014f98dd5f56c55fc1ef0cc2b277f12bb01882
--- /dev/null
+++ b/src/combustionModels/zoneCombustion/zoneCombustion.H
@@ -0,0 +1,143 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+Class
+    Foam::combustionModels::zoneCombustion
+
+Description
+    Zone-filtered combustion model.
+
+    Enable the reactions within the specified list of cell-zones and set
+    to zero elsewhere.
+
+SourceFiles
+    zoneCombustion.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef zoneCombustion_H
+#define zoneCombustion_H
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace combustionModels
+{
+
+/*---------------------------------------------------------------------------*\
+                            Class zoneCombustion Declaration
+\*---------------------------------------------------------------------------*/
+
+template<class Type>
+class zoneCombustion
+:
+    public Type
+{
+    // Private data
+
+        //- The combustion model to be zone-filtered
+        autoPtr<Type> combustionModelPtr_;
+
+        //- List of zone names in which the reactions are active
+        wordList zoneNames_;
+
+
+    // Private Member Functions
+
+        //- Filter the reaction-rate matrix on the cellZones
+        tmp<fvScalarMatrix> filter(const tmp<fvScalarMatrix>& tR) const;
+
+        //- Filter the given field on the cellZones
+        tmp<volScalarField> filter(const tmp<volScalarField>& tS) const;
+
+        //- Disallow copy construct
+        zoneCombustion(const zoneCombustion&);
+
+        //- Disallow default bitwise assignment
+        void operator=(const zoneCombustion&);
+
+
+public:
+
+    //- Runtime type information
+    TypeName("zoneCombustion");
+
+
+    // Constructors
+
+        //- Construct from components
+        zoneCombustion
+        (
+            const word& modelType,
+            const fvMesh& mesh,
+            const word& combustionProperties,
+            const word& phaseName
+        );
+
+
+    //- Destructor
+    virtual ~zoneCombustion();
+
+
+    // Member Functions
+
+        //- Return access to the thermo package
+        virtual typename Type::ReactionThermo& thermo();
+
+        //- Return const access to the thermo package
+        virtual const typename Type::ReactionThermo& thermo() const;
+
+        //- Correct combustion rate
+        virtual void correct();
+
+        //- Fuel consumption rate matrix.
+        virtual tmp<fvScalarMatrix> R(volScalarField& Y) const;
+
+        //- Heat release rate calculated from fuel consumption rate matrix
+        virtual tmp<volScalarField> dQ() const;
+
+        //-  Return source for enthalpy equation [kg/m/s3]
+        virtual tmp<volScalarField> Sh() const;
+
+        //- Update properties from given dictionary
+        virtual bool read();
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace combustionModels
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#ifdef NoRepository
+    #include "zoneCombustion.C"
+#endif
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/combustionModels/zoneCombustion/zoneCombustions.C b/src/combustionModels/zoneCombustion/zoneCombustions.C
new file mode 100644
index 0000000000000000000000000000000000000000..9c0c9279f7e9c5acabc0613083c052b72b4fe6f8
--- /dev/null
+++ b/src/combustionModels/zoneCombustion/zoneCombustions.C
@@ -0,0 +1,37 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+\*---------------------------------------------------------------------------*/
+
+#include "makeCombustionTypes.H"
+
+#include "psiCombustionModel.H"
+#include "rhoCombustionModel.H"
+#include "zoneCombustion.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+makeCombustionTypes(zoneCombustion, psiCombustionModel, psiCombustionModel);
+makeCombustionTypes(zoneCombustion, rhoCombustionModel, rhoCombustionModel);
+
+// ************************************************************************* //
diff --git a/src/conversion/Allwmake b/src/conversion/Allwmake
index 3187320a6796462cce366fa3845a669791b2042c..568603325386866b7dfb104d55ed9ba305a5b421 100755
--- a/src/conversion/Allwmake
+++ b/src/conversion/Allwmake
@@ -4,7 +4,6 @@ cd ${0%/*} || exit 1    # Run from this directory
 # Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
 
-set -x
 
 wmake $targetType
 
diff --git a/src/conversion/common/reader/meshReader.H b/src/conversion/common/reader/meshReader.H
index b53d0c1e4dfbcdd93da2f09f35b3e47f1b177a7c..623a3f4110116c040fbdca0ce7047818e88f7bfa 100644
--- a/src/conversion/common/reader/meshReader.H
+++ b/src/conversion/common/reader/meshReader.H
@@ -202,7 +202,7 @@ private:
 
 protected:
 
-    // Protected data
+    // Protected member data
 
         //- Pointers to cell shape models
         static const cellModel* unknownModel;
@@ -259,11 +259,12 @@ protected:
         cellTable cellTable_;
 
 
-    // Member Functions
+    // Protected member functions
 
         //- Subclasses are required to supply this information
         virtual bool readGeometry(const scalar scaleFactor = 1.0) = 0;
 
+
 public:
 
     // Static Members
diff --git a/src/dummyThirdParty/Allwmake b/src/dummyThirdParty/Allwmake
index e67e3de741f7c98aed7bf43e297dee3fd7bcba59..3dac95f4106ee4aa1fdb1c3f869f769b1b5a99b9 100755
--- a/src/dummyThirdParty/Allwmake
+++ b/src/dummyThirdParty/Allwmake
@@ -3,12 +3,10 @@ cd ${0%/*} || exit 1    # Run from this directory
 
 # Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-set -x
 
 wmake $targetType scotchDecomp
 wmake $targetType ptscotchDecomp
 wmake $targetType metisDecomp
 wmake $targetType MGridGen
 
-
 #------------------------------------------------------------------------------
diff --git a/src/dynamicFvMesh/Make/files b/src/dynamicFvMesh/Make/files
index 0403ea42edff6119dd4e0982c708a6ef2a9cb901..9f5609fddd1a0e8252363c4afe72603e9f16c485 100644
--- a/src/dynamicFvMesh/Make/files
+++ b/src/dynamicFvMesh/Make/files
@@ -4,20 +4,6 @@ staticFvMesh/staticFvMesh.C
 dynamicMotionSolverFvMesh/dynamicMotionSolverFvMesh.C
 dynamicInkJetFvMesh/dynamicInkJetFvMesh.C
 dynamicRefineFvMesh/dynamicRefineFvMesh.C
-
-solidBodyMotionFvMesh/solidBodyMotionFvMesh.C
-solidBodyMotionFvMesh/multiSolidBodyMotionFvMesh.C
-solidBodyMotionFunctions = solidBodyMotionFvMesh/solidBodyMotionFunctions
-$(solidBodyMotionFunctions)/solidBodyMotionFunction/solidBodyMotionFunction.C
-$(solidBodyMotionFunctions)/solidBodyMotionFunction/solidBodyMotionFunctionNew.C
-$(solidBodyMotionFunctions)/SDA/SDA.C
-$(solidBodyMotionFunctions)/tabulated6DoFMotion/tabulated6DoFMotion.C
-$(solidBodyMotionFunctions)/linearMotion/linearMotion.C
-$(solidBodyMotionFunctions)/rotatingMotion/rotatingMotion.C
-$(solidBodyMotionFunctions)/axisRotationMotion/axisRotationMotion.C
-$(solidBodyMotionFunctions)/multiMotion/multiMotion.C
-$(solidBodyMotionFunctions)/oscillatingLinearMotion/oscillatingLinearMotion.C
-$(solidBodyMotionFunctions)/oscillatingRotatingMotion/oscillatingRotatingMotion.C
-solidBodyMotionFvMesh/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.C
+dynamicMotionSolverListFvMesh/dynamicMotionSolverListFvMesh.C
 
 LIB = $(FOAM_LIBBIN)/libdynamicFvMesh
diff --git a/src/dynamicFvMesh/dynamicMotionSolverListFvMesh/dynamicMotionSolverListFvMesh.C b/src/dynamicFvMesh/dynamicMotionSolverListFvMesh/dynamicMotionSolverListFvMesh.C
new file mode 100644
index 0000000000000000000000000000000000000000..2b75caa5fce6edc6d4cbb3288c62208151f1e3ee
--- /dev/null
+++ b/src/dynamicFvMesh/dynamicMotionSolverListFvMesh/dynamicMotionSolverListFvMesh.C
@@ -0,0 +1,105 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+\*---------------------------------------------------------------------------*/
+
+#include "dynamicMotionSolverListFvMesh.H"
+#include "addToRunTimeSelectionTable.H"
+#include "motionSolver.H"
+#include "pointMesh.H"
+#include "volFields.H"
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+namespace Foam
+{
+    defineTypeNameAndDebug(dynamicMotionSolverListFvMesh, 0);
+    addToRunTimeSelectionTable
+    (
+        dynamicFvMesh,
+        dynamicMotionSolverListFvMesh,
+        IOobject
+    );
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
+
+Foam::dynamicMotionSolverListFvMesh::dynamicMotionSolverListFvMesh
+(
+    const IOobject& io
+)
+:
+    dynamicFvMesh(io),
+    motionSolvers_
+    (
+        IOdictionary
+        (
+            IOobject
+            (
+                "dynamicMeshDict",
+                time().constant(),
+                *this,
+                IOobject::MUST_READ_IF_MODIFIED,
+                IOobject::AUTO_WRITE
+            )
+        ).lookup("solvers"),
+        motionSolver::iNew(*this)
+    )
+{}
+
+
+// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
+
+Foam::dynamicMotionSolverListFvMesh::~dynamicMotionSolverListFvMesh()
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
+
+bool Foam::dynamicMotionSolverListFvMesh::update()
+{
+    if (motionSolvers_.size())
+    {
+        // Accumulated displacement
+        pointField disp(motionSolvers_[0].newPoints() - fvMesh::points());
+
+        for (label i = 1; i < motionSolvers_.size(); i++)
+        {
+            disp += motionSolvers_[i].newPoints() - fvMesh::points();
+        }
+
+        fvMesh::movePoints(points() + disp);
+
+        if (foundObject<volVectorField>("U"))
+        {
+            const_cast<volVectorField&>(lookupObject<volVectorField>("U"))
+            .correctBoundaryConditions();
+        }
+    }
+
+    return true;
+}
+
+
+// ************************************************************************* //
diff --git a/src/dynamicFvMesh/dynamicMotionSolverListFvMesh/dynamicMotionSolverListFvMesh.H b/src/dynamicFvMesh/dynamicMotionSolverListFvMesh/dynamicMotionSolverListFvMesh.H
new file mode 100644
index 0000000000000000000000000000000000000000..e638bf63b4e52848a2ef2c38ccd551f6405f0ae0
--- /dev/null
+++ b/src/dynamicFvMesh/dynamicMotionSolverListFvMesh/dynamicMotionSolverListFvMesh.H
@@ -0,0 +1,100 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+Class
+    Foam::dynamicMotionSolverListFvMesh
+
+Description
+    Foam::dynamicMotionSolverListFvMesh
+
+SourceFiles
+    dynamicMotionSolverListFvMesh.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef dynamicMotionSolverListFvMesh_H
+#define dynamicMotionSolverListFvMesh_H
+
+#include "dynamicFvMesh.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+class motionSolver;
+
+/*---------------------------------------------------------------------------*\
+                           Class dynamicMotionSolverListFvMesh Declaration
+\*---------------------------------------------------------------------------*/
+
+class dynamicMotionSolverListFvMesh
+:
+    public dynamicFvMesh
+{
+    // Private data
+
+        PtrList<motionSolver> motionSolvers_;
+
+
+    // Private Member Functions
+
+        //- Disallow default bitwise copy construct
+        dynamicMotionSolverListFvMesh(const dynamicMotionSolverListFvMesh&);
+
+        //- Disallow default bitwise assignment
+        void operator=(const dynamicMotionSolverListFvMesh&);
+
+
+public:
+
+    //- Runtime type information
+    TypeName("dynamicMotionSolverListFvMesh");
+
+
+    // Constructors
+
+        //- Construct from IOobject
+        dynamicMotionSolverListFvMesh(const IOobject& io);
+
+
+    //- Destructor
+    ~dynamicMotionSolverListFvMesh();
+
+
+    // Member Functions
+
+        //- Dummy update function which does not change the mesh
+        virtual bool update();
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C b/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C
index fa1b100678a921e3ed35b358e1c0c03478c2f933..6ef49e4951f06db6817eaa1c008d10688d85ac2b 100644
--- a/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C
+++ b/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C
@@ -42,10 +42,8 @@ namespace Foam
     addToRunTimeSelectionTable(dynamicFvMesh, dynamicRefineFvMesh, IOobject);
 }
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
-// the PackedBoolList::count method would probably be faster
-// since we are only checking for 'true' anyhow
 Foam::label Foam::dynamicRefineFvMesh::count
 (
     const PackedBoolList& l,
@@ -250,10 +248,10 @@ Foam::dynamicRefineFvMesh::refine
         }
     }
 
-//    // Remove the stored tet base points
-//    tetBasePtIsPtr_.clear();
-//    // Remove the cell tree
-//    cellTreePtr_.clear();
+    //    // Remove the stored tet base points
+    //    tetBasePtIsPtr_.clear();
+    //    // Remove the cell tree
+    //    cellTreePtr_.clear();
 
     // Update fields
     updateMesh(map);
@@ -463,8 +461,6 @@ Foam::dynamicRefineFvMesh::refine
 }
 
 
-// Combines previously split cells, maps fields and recalculates
-// (an approximate) flux
 Foam::autoPtr<Foam::mapPolyMesh>
 Foam::dynamicRefineFvMesh::unrefine
 (
@@ -646,7 +642,6 @@ Foam::dynamicRefineFvMesh::unrefine
 }
 
 
-// Get max of connected point
 Foam::scalarField
 Foam::dynamicRefineFvMesh::maxPointField(const scalarField& pFld) const
 {
@@ -665,7 +660,6 @@ Foam::dynamicRefineFvMesh::maxPointField(const scalarField& pFld) const
 }
 
 
-// Get max of connected cell
 Foam::scalarField
 Foam::dynamicRefineFvMesh::maxCellField(const volScalarField& vFld) const
 {
@@ -684,7 +678,6 @@ Foam::dynamicRefineFvMesh::maxCellField(const volScalarField& vFld) const
 }
 
 
-// Simple (non-parallel) interpolation by averaging.
 Foam::scalarField
 Foam::dynamicRefineFvMesh::cellToPoint(const scalarField& vFld) const
 {
@@ -705,7 +698,6 @@ Foam::dynamicRefineFvMesh::cellToPoint(const scalarField& vFld) const
 }
 
 
-// Calculate error. Is < 0 or distance to minLevel, maxLevel
 Foam::scalarField Foam::dynamicRefineFvMesh::error
 (
     const scalarField& fld,
diff --git a/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.H b/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.H
index fc4db3bf70272b79bd6fd7ad50044aad87ff45e0..1700732d530456f8ab47f63af1f64418019146a3 100644
--- a/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.H
+++ b/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2014 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -104,7 +104,7 @@ protected:
         PackedBoolList protectedCell_;
 
 
-    // Private Member Functions
+    // Protected Member Functions
 
         //- Count set/unset elements in packedlist.
         static label count(const PackedBoolList&, const unsigned int);
diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/multiSolidBodyMotionFvMesh.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/multiSolidBodyMotionFvMesh.C
deleted file mode 100644
index f2a06887f90e981bca031cc6e1d7f7897bd9b13e..0000000000000000000000000000000000000000
--- a/src/dynamicFvMesh/solidBodyMotionFvMesh/multiSolidBodyMotionFvMesh.C
+++ /dev/null
@@ -1,215 +0,0 @@
-/*---------------------------------------------------------------------------*\
-  =========                 |
-  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-   \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
-     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
-
-\*---------------------------------------------------------------------------*/
-
-#include "multiSolidBodyMotionFvMesh.H"
-#include "addToRunTimeSelectionTable.H"
-#include "volFields.H"
-#include "transformField.H"
-#include "cellZoneMesh.H"
-#include "boolList.H"
-#include "syncTools.H"
-
-// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
-
-namespace Foam
-{
-    defineTypeNameAndDebug(multiSolidBodyMotionFvMesh, 0);
-    addToRunTimeSelectionTable
-    (
-        dynamicFvMesh,
-        multiSolidBodyMotionFvMesh,
-        IOobject
-    );
-}
-
-
-// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
-
-Foam::multiSolidBodyMotionFvMesh::multiSolidBodyMotionFvMesh(const IOobject& io)
-:
-    dynamicFvMesh(io),
-    dynamicMeshCoeffs_
-    (
-        IOdictionary
-        (
-            IOobject
-            (
-                "dynamicMeshDict",
-                io.time().constant(),
-                *this,
-                IOobject::MUST_READ_IF_MODIFIED,
-                IOobject::NO_WRITE,
-                false
-            )
-        ).subDict(typeName + "Coeffs")
-    ),
-    undisplacedPoints_
-    (
-        IOobject
-        (
-            "points",
-            io.time().constant(),
-            meshSubDir,
-            *this,
-            IOobject::MUST_READ,
-            IOobject::NO_WRITE,
-            false
-        )
-    )
-{
-    if (undisplacedPoints_.size() != nPoints())
-    {
-        FatalIOErrorInFunction
-        (
-            dynamicMeshCoeffs_
-        )   << "Read " << undisplacedPoints_.size()
-            << " undisplaced points from " << undisplacedPoints_.objectPath()
-            << " but the current mesh has " << nPoints()
-            << exit(FatalIOError);
-    }
-
-
-    zoneIDs_.setSize(dynamicMeshCoeffs_.size());
-    SBMFs_.setSize(dynamicMeshCoeffs_.size());
-    pointIDs_.setSize(dynamicMeshCoeffs_.size());
-    label zoneI = 0;
-
-    forAllConstIter(dictionary, dynamicMeshCoeffs_, iter)
-    {
-        if (iter().isDict())
-        {
-            zoneIDs_[zoneI] = cellZones().findZoneID(iter().keyword());
-
-            if (zoneIDs_[zoneI] == -1)
-            {
-                FatalIOErrorInFunction
-                (
-                    dynamicMeshCoeffs_
-                )   << "Cannot find cellZone named " << iter().keyword()
-                    << ". Valid zones are " << cellZones().names()
-                    << exit(FatalIOError);
-            }
-
-            const dictionary& subDict = iter().dict();
-
-            SBMFs_.set
-            (
-                zoneI,
-                solidBodyMotionFunction::New(subDict, io.time())
-            );
-
-            // Collect points of cell zone.
-            const cellZone& cz = cellZones()[zoneIDs_[zoneI]];
-
-            boolList movePts(nPoints(), false);
-
-            forAll(cz, i)
-            {
-                label celli = cz[i];
-                const cell& c = cells()[celli];
-                forAll(c, j)
-                {
-                    const face& f = faces()[c[j]];
-                    forAll(f, k)
-                    {
-                        label pointi = f[k];
-                        movePts[pointi] = true;
-                    }
-                }
-            }
-
-            syncTools::syncPointList(*this, movePts, orEqOp<bool>(), false);
-
-            DynamicList<label> ptIDs(nPoints());
-            forAll(movePts, i)
-            {
-                if (movePts[i])
-                {
-                    ptIDs.append(i);
-                }
-            }
-
-            pointIDs_[zoneI].transfer(ptIDs);
-
-            Info<< "Applying solid body motion " << SBMFs_[zoneI].type()
-                << " to " << pointIDs_[zoneI].size() << " points of cellZone "
-                << iter().keyword() << endl;
-
-            zoneI++;
-        }
-    }
-    zoneIDs_.setSize(zoneI);
-    SBMFs_.setSize(zoneI);
-    pointIDs_.setSize(zoneI);
-}
-
-
-// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
-
-Foam::multiSolidBodyMotionFvMesh::~multiSolidBodyMotionFvMesh()
-{}
-
-
-// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
-
-bool Foam::multiSolidBodyMotionFvMesh::update()
-{
-    static bool hasWarned = false;
-
-    pointField transformedPts(undisplacedPoints_);
-
-    forAll(zoneIDs_, i)
-    {
-        const labelList& zonePoints = pointIDs_[i];
-
-        UIndirectList<point>(transformedPts, zonePoints) =
-            transformPoints
-            (
-                SBMFs_[i].transformation(),
-                pointField(transformedPts, zonePoints)
-            );
-    }
-
-    fvMesh::movePoints(transformedPts);
-
-    if (foundObject<volVectorField>("U"))
-    {
-        const_cast<volVectorField&>(lookupObject<volVectorField>("U"))
-            .correctBoundaryConditions();
-    }
-    else if (!hasWarned)
-    {
-        hasWarned = true;
-
-        WarningInFunction
-            << "Did not find volVectorField U."
-            << " Not updating U boundary conditions." << endl;
-    }
-
-    return true;
-}
-
-
-// ************************************************************************* //
diff --git a/src/dynamicMesh/Make/files b/src/dynamicMesh/Make/files
index de8f61296cd77d4c7d1a774f90da81716deffefc..c1de4266ad1d0126ff242365d8cd338e566b7a58 100644
--- a/src/dynamicMesh/Make/files
+++ b/src/dynamicMesh/Make/files
@@ -100,12 +100,32 @@ motionSmoother/polyMeshGeometry/polyMeshGeometry.C
 motionSmoother/badQualityToCell/badQualityToCell.C
 motionSmoother/badQualityToFace/badQualityToFace.C
 
-motionSolver/motionSolver/motionSolver.C
-motionSolver/displacement/displacementMotionSolver.C
-motionSolver/componentDisplacement/componentDisplacementMotionSolver.C
-motionSolver/velocity/velocityMotionSolver.C
-motionSolver/velocityDisplacement/velocityDisplacementMotionSolver.C
-motionSolver/componentVelocity/componentVelocityMotionSolver.C
+motionSolvers/motionSolver/motionSolver.C
+motionSolvers/displacement/points0/points0MotionSolver.C
+motionSolvers/displacement/displacement/displacementMotionSolver.C
+motionSolvers/displacement/interpolation/displacementInterpolationMotionSolver.C
+motionSolvers/displacement/layeredSolver/displacementLayeredMotionMotionSolver.C
+motionSolvers/displacement/layeredSolver/pointEdgeStructuredWalk.C
+motionSolvers/componentDisplacement/componentDisplacementMotionSolver.C
+motionSolvers/velocity/velocityMotionSolver.C
+motionSolvers/velocity/velocityDisplacement/velocityDisplacementMotionSolver.C
+motionSolvers/componentVelocity/componentVelocityMotionSolver.C
+motionSolvers/displacement/solidBody/solidBodyMotionSolver.C
+motionSolvers/displacement/solidBody/multiSolidBodyMotionSolver.C
+
+solidBodyMotionFunctions = motionSolvers/displacement/solidBody/solidBodyMotionFunctions
+$(solidBodyMotionFunctions)/solidBodyMotionFunction/solidBodyMotionFunction.C
+$(solidBodyMotionFunctions)/solidBodyMotionFunction/solidBodyMotionFunctionNew.C
+$(solidBodyMotionFunctions)/SDA/SDA.C
+$(solidBodyMotionFunctions)/tabulated6DoFMotion/tabulated6DoFMotion.C
+$(solidBodyMotionFunctions)/linearMotion/linearMotion.C
+$(solidBodyMotionFunctions)/rotatingMotion/rotatingMotion.C
+$(solidBodyMotionFunctions)/axisRotationMotion/axisRotationMotion.C
+$(solidBodyMotionFunctions)/multiMotion/multiMotion.C
+$(solidBodyMotionFunctions)/oscillatingLinearMotion/oscillatingLinearMotion.C
+$(solidBodyMotionFunctions)/oscillatingRotatingMotion/oscillatingRotatingMotion.C
+
+motionSolvers/displacement/solidBody/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.C
 
 createShellMesh/createShellMesh.C
 
diff --git a/src/dynamicMesh/boundaryMesh/boundaryMesh.H b/src/dynamicMesh/boundaryMesh/boundaryMesh.H
index d63de47cb14ad7e7463286eee42cb5d9f1b507a5..4e07939dd20bc05c6f1189e6e12d5a464d43de5f 100644
--- a/src/dynamicMesh/boundaryMesh/boundaryMesh.H
+++ b/src/dynamicMesh/boundaryMesh/boundaryMesh.H
@@ -70,6 +70,7 @@ class boundaryMesh
         //  the largest distance from face centre to one of its vertices.
         static const scalar distanceTol_;
 
+
     // Private data
 
         //- All boundary mesh data. Reconstructed every time faces are repatched
diff --git a/src/dynamicMesh/meshCut/cellLooper/cellLooper.C b/src/dynamicMesh/meshCut/cellLooper/cellLooper.C
index 26353dafb2e0dbb2708f4ca1c4653a4c518c7c47..cf34d6eb70c76a9fbd49b57d71bb8b2f9b12f0a1 100644
--- a/src/dynamicMesh/meshCut/cellLooper/cellLooper.C
+++ b/src/dynamicMesh/meshCut/cellLooper/cellLooper.C
@@ -62,9 +62,8 @@ Foam::autoPtr<Foam::cellLooper> Foam::cellLooper::New
 }
 
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
-// Get faces (on cell) connected to vertI which are not using edgeI
 Foam::labelList Foam::cellLooper::getVertFacesNonEdge
 (
     const label celli,
@@ -101,7 +100,6 @@ Foam::labelList Foam::cellLooper::getVertFacesNonEdge
 }
 
 
-// Get first edge connected to vertI and on facei
 Foam::label Foam::cellLooper::getFirstVertEdge
 (
     const label facei,
@@ -131,7 +129,6 @@ Foam::label Foam::cellLooper::getFirstVertEdge
 }
 
 
-// Get edges (on cell) connected to vertI which are not on facei
 Foam::labelList Foam::cellLooper::getVertEdgesNonFace
 (
     const label celli,
@@ -166,8 +163,6 @@ Foam::labelList Foam::cellLooper::getVertEdgesNonFace
 }
 
 
-// Return edge from cellEdges that is most perpendicular
-// to refinement direction.
 Foam::label Foam::cellLooper::getMisAlignedEdge
 (
     const vector& refDir,
diff --git a/src/dynamicMesh/meshCut/cellLooper/cellLooper.H b/src/dynamicMesh/meshCut/cellLooper/cellLooper.H
index 2642fd641f62f4165dbeb20e2540b69c684e1b11..065edef71f921a52ceb2ee3516e8a160b8096e01 100644
--- a/src/dynamicMesh/meshCut/cellLooper/cellLooper.H
+++ b/src/dynamicMesh/meshCut/cellLooper/cellLooper.H
@@ -71,8 +71,6 @@ class cellLooper
 :
     public edgeVertex
 {
-    // Private data
-
 
 protected:
 
@@ -105,6 +103,7 @@ protected:
         //  to refinement direction.
         label getMisAlignedEdge(const vector& refDir, const label celli) const;
 
+
 private:
 
     // Private Member Functions
diff --git a/src/dynamicMesh/motionSolver/componentDisplacement/componentDisplacementMotionSolver.C b/src/dynamicMesh/motionSolvers/componentDisplacement/componentDisplacementMotionSolver.C
similarity index 100%
rename from src/dynamicMesh/motionSolver/componentDisplacement/componentDisplacementMotionSolver.C
rename to src/dynamicMesh/motionSolvers/componentDisplacement/componentDisplacementMotionSolver.C
diff --git a/src/dynamicMesh/motionSolver/componentDisplacement/componentDisplacementMotionSolver.H b/src/dynamicMesh/motionSolvers/componentDisplacement/componentDisplacementMotionSolver.H
similarity index 98%
rename from src/dynamicMesh/motionSolver/componentDisplacement/componentDisplacementMotionSolver.H
rename to src/dynamicMesh/motionSolvers/componentDisplacement/componentDisplacementMotionSolver.H
index 9a773a755b18e3d9bb84ef4cf886b55efeca5161..8f960cbb8e6ebb4ba74ef0a43c170b7953867c17 100644
--- a/src/dynamicMesh/motionSolver/componentDisplacement/componentDisplacementMotionSolver.H
+++ b/src/dynamicMesh/motionSolvers/componentDisplacement/componentDisplacementMotionSolver.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2012 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2012-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -72,6 +72,7 @@ protected:
         //- Point motion field
         mutable pointScalarField pointDisplacement_;
 
+
 private:
 
     // Private Member Functions
@@ -88,6 +89,7 @@ private:
         //- Disallow default bitwise assignment
         void operator=(const componentDisplacementMotionSolver&);
 
+
 public:
 
     //- Runtime type information
diff --git a/src/dynamicMesh/motionSolver/componentVelocity/componentVelocityMotionSolver.C b/src/dynamicMesh/motionSolvers/componentVelocity/componentVelocityMotionSolver.C
similarity index 97%
rename from src/dynamicMesh/motionSolver/componentVelocity/componentVelocityMotionSolver.C
rename to src/dynamicMesh/motionSolvers/componentVelocity/componentVelocityMotionSolver.C
index 7d38bcfa5415b25ec5f1ac9c9b1359dbf48e2e9f..04afe757684105ebe7c29b47f1924f532e36f56c 100644
--- a/src/dynamicMesh/motionSolver/componentVelocity/componentVelocityMotionSolver.C
+++ b/src/dynamicMesh/motionSolvers/componentVelocity/componentVelocityMotionSolver.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2012-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2012-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
diff --git a/src/dynamicMesh/motionSolver/componentVelocity/componentVelocityMotionSolver.H b/src/dynamicMesh/motionSolvers/componentVelocity/componentVelocityMotionSolver.H
similarity index 98%
rename from src/dynamicMesh/motionSolver/componentVelocity/componentVelocityMotionSolver.H
rename to src/dynamicMesh/motionSolvers/componentVelocity/componentVelocityMotionSolver.H
index 10449407774ff6c906b615e20d042dea8c4149b9..cbc7ab3a9ee36a9befc9ff3f35cbb933291f721e 100644
--- a/src/dynamicMesh/motionSolver/componentVelocity/componentVelocityMotionSolver.H
+++ b/src/dynamicMesh/motionSolvers/componentVelocity/componentVelocityMotionSolver.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2012-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2012-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -69,6 +69,7 @@ protected:
         //- Point motion field
         mutable pointScalarField pointMotionU_;
 
+
 private:
 
     // Private Member Functions
@@ -85,6 +86,7 @@ private:
         //- Disallow default bitwise assignment
         void operator=(const componentVelocityMotionSolver&);
 
+
 public:
 
     //- Runtime type information
diff --git a/src/dynamicMesh/motionSolvers/displacement/displacement/displacementMotionSolver.C b/src/dynamicMesh/motionSolvers/displacement/displacement/displacementMotionSolver.C
new file mode 100644
index 0000000000000000000000000000000000000000..a8797b3cd973d06f15679e1094a273ad34225b9c
--- /dev/null
+++ b/src/dynamicMesh/motionSolvers/displacement/displacement/displacementMotionSolver.C
@@ -0,0 +1,142 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2012-2016 OpenFOAM Foundation
+     \\/     M anipulation  | Copyright (C) 2016 OpenCFD Ltd.
+-------------------------------------------------------------------------------
+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 3 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, see <http://www.gnu.org/licenses/>.
+
+\*---------------------------------------------------------------------------*/
+
+#include "displacementMotionSolver.H"
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+namespace Foam
+{
+    defineTypeNameAndDebug(displacementMotionSolver, 0);
+    defineRunTimeSelectionTable(displacementMotionSolver, displacement);
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
+
+Foam::displacementMotionSolver::displacementMotionSolver
+(
+    const polyMesh& mesh,
+    const IOdictionary& dict,
+    const word& type
+)
+:
+    points0MotionSolver(mesh, dict, type),
+    pointDisplacement_
+    (
+        IOobject
+        (
+            "pointDisplacement",
+            time().timeName(),
+            mesh,
+            IOobject::MUST_READ,
+            IOobject::AUTO_WRITE
+        ),
+        pointMesh::New(mesh)
+    )
+{}
+
+
+Foam::displacementMotionSolver::displacementMotionSolver
+(
+    const polyMesh& mesh,
+    const IOdictionary& dict,
+    const pointVectorField& pointDisplacement,
+    const pointIOField& points0,
+    const word& type
+)
+:
+    points0MotionSolver(mesh, dict, points0, type),
+    pointDisplacement_
+    (
+        IOobject(pointDisplacement, "pointDisplacement"),
+        pointDisplacement
+    )
+{}
+
+
+// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
+
+Foam::autoPtr<Foam::displacementMotionSolver>
+Foam::displacementMotionSolver::New
+(
+    const word& solverTypeName,
+    const polyMesh& mesh,
+    const IOdictionary& solverDict,
+    const pointVectorField& pointDisplacement,
+    const pointIOField& points0
+)
+{
+    //const word solverTypeName(solverDict.lookup("solver"));
+
+    Info<< "Selecting motion solver: " << solverTypeName << endl;
+
+    const_cast<Time&>(mesh.time()).libs().open
+    (
+        solverDict,
+        "motionSolverLibs",
+        displacementConstructorTablePtr_
+    );
+
+    if (!displacementConstructorTablePtr_)
+    {
+        FatalErrorInFunction
+            << "solver table is empty"
+            << exit(FatalError);
+    }
+
+    displacementConstructorTable::iterator cstrIter =
+        displacementConstructorTablePtr_->find(solverTypeName);
+
+    if (cstrIter == displacementConstructorTablePtr_->end())
+    {
+        FatalErrorInFunction
+            << "Unknown solver type "
+            << solverTypeName << nl << nl
+            << "Valid solver types are:" << endl
+            << displacementConstructorTablePtr_->sortedToc()
+            << exit(FatalError);
+    }
+
+    return autoPtr<displacementMotionSolver>
+    (
+        cstrIter()
+        (
+            mesh,
+            solverDict,
+            pointDisplacement,
+            points0
+        )
+    );
+}
+
+
+// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
+
+Foam::displacementMotionSolver::~displacementMotionSolver()
+{}
+
+
+// ************************************************************************* //
diff --git a/src/dynamicMesh/motionSolver/displacement/displacementMotionSolver.H b/src/dynamicMesh/motionSolvers/displacement/displacement/displacementMotionSolver.H
similarity index 82%
rename from src/dynamicMesh/motionSolver/displacement/displacementMotionSolver.H
rename to src/dynamicMesh/motionSolvers/displacement/displacement/displacementMotionSolver.H
index 1162c1309a166ecb98581dc029fe773f1f8c1efd..eb6e585f29e0dd6998287d6a8cf6f9f7b8cc342c 100644
--- a/src/dynamicMesh/motionSolver/displacement/displacementMotionSolver.H
+++ b/src/dynamicMesh/motionSolvers/displacement/displacement/displacementMotionSolver.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2012-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2012-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -38,24 +38,20 @@ SourceFiles
 #ifndef displacementMotionSolver_H
 #define displacementMotionSolver_H
 
-#include "motionSolver.H"
-#include "pointFields.H"
-#include "pointIOField.H"
+#include "points0MotionSolver.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 namespace Foam
 {
 
-class mapPolyMesh;
-
 /*---------------------------------------------------------------------------*\
-                   Class displacementMotionSolver Declaration
+                  Class displacementMotionSolver Declaration
 \*---------------------------------------------------------------------------*/
 
 class displacementMotionSolver
 :
-    public motionSolver
+    public points0MotionSolver
 {
 protected:
 
@@ -64,9 +60,6 @@ protected:
         //- Point motion field
         mutable pointVectorField pointDisplacement_;
 
-        //- Starting points
-        pointIOField points0_;
-
 
 private:
 
@@ -101,11 +94,6 @@ public:
             (mesh, dict, pointDisplacement, points0)
         );
 
-    // Static Member Functions
-
-        //- Return IO object for points0
-        static IOobject points0IO(const polyMesh& mesh);
-
 
     // Selectors
 
@@ -148,18 +136,6 @@ public:
 
     // Member Functions
 
-        //- Return reference to the reference field
-        pointField& points0()
-        {
-            return points0_;
-        }
-
-        //- Return reference to the reference field
-        const pointField& points0() const
-        {
-            return points0_;
-        }
-
         //- Return reference to the point motion displacement field
         pointVectorField& pointDisplacement()
         {
@@ -171,12 +147,6 @@ public:
         {
             return pointDisplacement_;
         }
-
-        //- Update local data for geometry changes
-        virtual void movePoints(const pointField&);
-
-        //-  Update local data for topology changes
-        virtual void updateMesh(const mapPolyMesh&);
 };
 
 
diff --git a/src/fvMotionSolver/fvMotionSolvers/displacement/interpolation/displacementInterpolationMotionSolver.C b/src/dynamicMesh/motionSolvers/displacement/interpolation/displacementInterpolationMotionSolver.C
similarity index 100%
rename from src/fvMotionSolver/fvMotionSolvers/displacement/interpolation/displacementInterpolationMotionSolver.C
rename to src/dynamicMesh/motionSolvers/displacement/interpolation/displacementInterpolationMotionSolver.C
diff --git a/src/fvMotionSolver/fvMotionSolvers/displacement/interpolation/displacementInterpolationMotionSolver.H b/src/dynamicMesh/motionSolvers/displacement/interpolation/displacementInterpolationMotionSolver.H
similarity index 100%
rename from src/fvMotionSolver/fvMotionSolvers/displacement/interpolation/displacementInterpolationMotionSolver.H
rename to src/dynamicMesh/motionSolvers/displacement/interpolation/displacementInterpolationMotionSolver.H
diff --git a/src/fvMotionSolver/fvMotionSolvers/displacement/layeredSolver/displacementLayeredMotionMotionSolver.C b/src/dynamicMesh/motionSolvers/displacement/layeredSolver/displacementLayeredMotionMotionSolver.C
similarity index 100%
rename from src/fvMotionSolver/fvMotionSolvers/displacement/layeredSolver/displacementLayeredMotionMotionSolver.C
rename to src/dynamicMesh/motionSolvers/displacement/layeredSolver/displacementLayeredMotionMotionSolver.C
diff --git a/src/fvMotionSolver/fvMotionSolvers/displacement/layeredSolver/displacementLayeredMotionMotionSolver.H b/src/dynamicMesh/motionSolvers/displacement/layeredSolver/displacementLayeredMotionMotionSolver.H
similarity index 100%
rename from src/fvMotionSolver/fvMotionSolvers/displacement/layeredSolver/displacementLayeredMotionMotionSolver.H
rename to src/dynamicMesh/motionSolvers/displacement/layeredSolver/displacementLayeredMotionMotionSolver.H
diff --git a/src/fvMotionSolver/fvMotionSolvers/displacement/layeredSolver/pointEdgeStructuredWalk.C b/src/dynamicMesh/motionSolvers/displacement/layeredSolver/pointEdgeStructuredWalk.C
similarity index 95%
rename from src/fvMotionSolver/fvMotionSolvers/displacement/layeredSolver/pointEdgeStructuredWalk.C
rename to src/dynamicMesh/motionSolvers/displacement/layeredSolver/pointEdgeStructuredWalk.C
index a2ab64d1dee4ad441e5193bf0d4b9a570f53dd80..5bb626935b1c3608772599df3aaba8089598ea45 100644
--- a/src/fvMotionSolver/fvMotionSolvers/displacement/layeredSolver/pointEdgeStructuredWalk.C
+++ b/src/dynamicMesh/motionSolvers/displacement/layeredSolver/pointEdgeStructuredWalk.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
diff --git a/src/fvMotionSolver/fvMotionSolvers/displacement/layeredSolver/pointEdgeStructuredWalk.H b/src/dynamicMesh/motionSolvers/displacement/layeredSolver/pointEdgeStructuredWalk.H
similarity index 100%
rename from src/fvMotionSolver/fvMotionSolvers/displacement/layeredSolver/pointEdgeStructuredWalk.H
rename to src/dynamicMesh/motionSolvers/displacement/layeredSolver/pointEdgeStructuredWalk.H
diff --git a/src/fvMotionSolver/fvMotionSolvers/displacement/layeredSolver/pointEdgeStructuredWalkI.H b/src/dynamicMesh/motionSolvers/displacement/layeredSolver/pointEdgeStructuredWalkI.H
similarity index 100%
rename from src/fvMotionSolver/fvMotionSolvers/displacement/layeredSolver/pointEdgeStructuredWalkI.H
rename to src/dynamicMesh/motionSolvers/displacement/layeredSolver/pointEdgeStructuredWalkI.H
diff --git a/src/dynamicMesh/motionSolver/displacement/displacementMotionSolver.C b/src/dynamicMesh/motionSolvers/displacement/points0/points0MotionSolver.C
similarity index 70%
rename from src/dynamicMesh/motionSolver/displacement/displacementMotionSolver.C
rename to src/dynamicMesh/motionSolvers/displacement/points0/points0MotionSolver.C
index 1cb7de59d39c120373773692b501740c788d7279..f8a006d6fee0e422e826cc6172dafa10184c2317 100644
--- a/src/dynamicMesh/motionSolver/displacement/displacementMotionSolver.C
+++ b/src/dynamicMesh/motionSolvers/displacement/points0/points0MotionSolver.C
@@ -3,7 +3,7 @@
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
     \\  /    A nd           | Copyright (C) 2012-2016 OpenFOAM Foundation
-     \\/     M anipulation  | Copyright (C) 2015 OpenCFD Ltd.
+     \\/     M anipulation  | Copyright (C) 2015-2016 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -23,21 +23,20 @@ License
 
 \*---------------------------------------------------------------------------*/
 
-#include "displacementMotionSolver.H"
+#include "points0MotionSolver.H"
 #include "mapPolyMesh.H"
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
 namespace Foam
 {
-    defineTypeNameAndDebug(displacementMotionSolver, 0);
-    defineRunTimeSelectionTable(displacementMotionSolver, displacement);
+    defineTypeNameAndDebug(points0MotionSolver, 0);
 }
 
 
 // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
 
-Foam::IOobject Foam::displacementMotionSolver::points0IO(const polyMesh& mesh)
+Foam::IOobject Foam::points0MotionSolver::points0IO(const polyMesh& mesh)
 {
     const word instance =
         mesh.time().findInstance
@@ -65,7 +64,7 @@ Foam::IOobject Foam::displacementMotionSolver::points0IO(const polyMesh& mesh)
     }
     else
     {
-        // check that points0 are actually in constant directory
+        // Check that points0 are actually in constant directory
 
         IOobject io
         (
@@ -84,7 +83,7 @@ Foam::IOobject Foam::displacementMotionSolver::points0IO(const polyMesh& mesh)
         }
         else
         {
-            // copy of original mesh points
+            // Copy of original mesh points
 
             return
                 IOobject
@@ -104,7 +103,7 @@ Foam::IOobject Foam::displacementMotionSolver::points0IO(const polyMesh& mesh)
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
-Foam::displacementMotionSolver::displacementMotionSolver
+Foam::points0MotionSolver::points0MotionSolver
 (
     const polyMesh& mesh,
     const IOdictionary& dict,
@@ -112,18 +111,6 @@ Foam::displacementMotionSolver::displacementMotionSolver
 )
 :
     motionSolver(mesh, dict, type),
-    pointDisplacement_
-    (
-        IOobject
-        (
-            "pointDisplacement",
-            time().timeName(),
-            mesh,
-            IOobject::MUST_READ,
-            IOobject::AUTO_WRITE
-        ),
-        pointMesh::New(mesh)
-    ),
     points0_(pointIOField(points0IO(mesh)))
 {
     if (points0_.size() != mesh.nPoints())
@@ -150,21 +137,15 @@ Foam::displacementMotionSolver::displacementMotionSolver
 }
 
 
-Foam::displacementMotionSolver::displacementMotionSolver
+Foam::points0MotionSolver::points0MotionSolver
 (
     const polyMesh& mesh,
     const IOdictionary& dict,
-    const pointVectorField& pointDisplacement,
     const pointIOField& points0,
     const word& type
 )
 :
     motionSolver(mesh, dict, type),
-    pointDisplacement_
-    (
-        IOobject(pointDisplacement, "pointDisplacement"),
-        pointDisplacement
-    ),
     points0_(points0)
 {
     if (points0_.size() != mesh.nPoints())
@@ -178,77 +159,19 @@ Foam::displacementMotionSolver::displacementMotionSolver
 }
 
 
-// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
-
-Foam::autoPtr<Foam::displacementMotionSolver>
-Foam::displacementMotionSolver::New
-(
-    const word& solverTypeName,
-    const polyMesh& mesh,
-    const IOdictionary& solverDict,
-    const pointVectorField& pointDisplacement,
-    const pointIOField& points0
-)
-{
-    //const word solverTypeName(solverDict.lookup("solver"));
-
-    Info<< "Selecting motion solver: " << solverTypeName << endl;
-
-    const_cast<Time&>(mesh.time()).libs().open
-    (
-        solverDict,
-        "motionSolverLibs",
-        displacementConstructorTablePtr_
-    );
-
-    if (!displacementConstructorTablePtr_)
-    {
-        FatalErrorInFunction
-            << "solver table is empty"
-            << exit(FatalError);
-    }
-
-    displacementConstructorTable::iterator cstrIter =
-        displacementConstructorTablePtr_->find(solverTypeName);
-
-    if (cstrIter == displacementConstructorTablePtr_->end())
-    {
-        FatalErrorInFunction
-            << "Unknown solver type "
-            << solverTypeName << nl << nl
-            << "Valid solver types are:" << endl
-            << displacementConstructorTablePtr_->sortedToc()
-            << exit(FatalError);
-    }
-
-    return autoPtr<displacementMotionSolver>
-    (
-        cstrIter()
-        (
-            mesh,
-            solverDict,
-            pointDisplacement,
-            points0
-        )
-    );
-}
-
-
 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
 
-Foam::displacementMotionSolver::~displacementMotionSolver()
+Foam::points0MotionSolver::~points0MotionSolver()
 {}
 
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
-void Foam::displacementMotionSolver::movePoints(const pointField&)
-{
-    // No local data to update
-}
+void Foam::points0MotionSolver::movePoints(const pointField&)
+{}
 
 
-void Foam::displacementMotionSolver::updateMesh(const mapPolyMesh& mpm)
+void Foam::points0MotionSolver::updateMesh(const mapPolyMesh& mpm)
 {
     // pointMesh already updates pointFields
 
diff --git a/src/dynamicMesh/motionSolvers/displacement/points0/points0MotionSolver.H b/src/dynamicMesh/motionSolvers/displacement/points0/points0MotionSolver.H
new file mode 100644
index 0000000000000000000000000000000000000000..18041f268f3aff098d636aa329bf74f024860355
--- /dev/null
+++ b/src/dynamicMesh/motionSolvers/displacement/points0/points0MotionSolver.H
@@ -0,0 +1,140 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     M anipulation  | Copyright (C) 2016 OpenCFD Ltd.
+-------------------------------------------------------------------------------
+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 3 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, see <http://www.gnu.org/licenses/>.
+
+Class
+    Foam::points0MotionSolver
+
+Description
+    Virtual base class for displacement motion solvers, where the point
+    motion is relative to a set of fixed points (points0).
+
+SourceFiles
+    points0MotionSolver.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef points0MotionSolver_H
+#define points0MotionSolver_H
+
+#include "motionSolver.H"
+#include "pointFields.H"
+#include "pointIOField.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+class mapPolyMesh;
+
+/*---------------------------------------------------------------------------*\
+                   Class points0MotionSolver Declaration
+\*---------------------------------------------------------------------------*/
+
+class points0MotionSolver
+:
+    public motionSolver
+{
+protected:
+
+    // Protected data
+
+        //- Starting points
+        pointIOField points0_;
+
+
+private:
+
+    // Private Member Functions
+
+        //- Disallow default bitwise copy construct
+        points0MotionSolver(const points0MotionSolver&);
+
+        //- Disallow default bitwise assignment
+        void operator=(const points0MotionSolver&);
+
+
+public:
+
+    //- Runtime type information
+    TypeName("points0MotionSolver");
+
+
+    // Constructors
+
+        //- Construct from mesh and dictionary
+        points0MotionSolver
+        (
+            const polyMesh&,
+            const IOdictionary&,
+            const word& type
+        );
+
+        //- Construct from mesh and dictionary
+        points0MotionSolver
+        (
+            const polyMesh&,
+            const IOdictionary&,
+            const pointIOField& points0,
+            const word& type
+        );
+
+
+    //- Destructor
+    virtual ~points0MotionSolver();
+
+
+    // Member Functions
+
+        //- Return IO object for points0
+        static IOobject points0IO(const polyMesh& mesh);
+
+        //- Return reference to the reference field
+        pointField& points0()
+        {
+            return points0_;
+        }
+
+        //- Return reference to the reference field
+        const pointField& points0() const
+        {
+            return points0_;
+        }
+
+        //- Update local data for geometry changes
+        virtual void movePoints(const pointField&);
+
+        //-  Update local data for topology changes
+        virtual void updateMesh(const mapPolyMesh&);
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/multiSolidBodyMotionSolver.C b/src/dynamicMesh/motionSolvers/displacement/solidBody/multiSolidBodyMotionSolver.C
new file mode 100644
index 0000000000000000000000000000000000000000..6992db05b0798c045f30437d875383fe1b9817e9
--- /dev/null
+++ b/src/dynamicMesh/motionSolvers/displacement/solidBody/multiSolidBodyMotionSolver.C
@@ -0,0 +1,160 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+\*---------------------------------------------------------------------------*/
+
+#include "multiSolidBodyMotionSolver.H"
+#include "addToRunTimeSelectionTable.H"
+#include "transformField.H"
+#include "cellZoneMesh.H"
+#include "boolList.H"
+#include "syncTools.H"
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+namespace Foam
+{
+    defineTypeNameAndDebug(multiSolidBodyMotionSolver, 0);
+    addToRunTimeSelectionTable
+    (
+        motionSolver,
+        multiSolidBodyMotionSolver,
+        dictionary
+    );
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
+
+Foam::multiSolidBodyMotionSolver::multiSolidBodyMotionSolver
+(
+    const polyMesh& mesh,
+    const IOdictionary& dict
+)
+:
+    points0MotionSolver(mesh, dict, typeName)
+{
+    zoneIDs_.setSize(coeffDict().size());
+    SBMFs_.setSize(coeffDict().size());
+    pointIDs_.setSize(coeffDict().size());
+    label zonei = 0;
+
+    forAllConstIter(dictionary, coeffDict(), iter)
+    {
+        if (iter().isDict())
+        {
+            zoneIDs_[zonei] = mesh.cellZones().findZoneID(iter().keyword());
+
+            if (zoneIDs_[zonei] == -1)
+            {
+                FatalIOErrorInFunction
+                (
+                    coeffDict()
+                )   << "Cannot find cellZone named " << iter().keyword()
+                    << ". Valid zones are " << mesh.cellZones().names()
+                    << exit(FatalIOError);
+            }
+
+            const dictionary& subDict = iter().dict();
+
+            SBMFs_.set
+            (
+                zonei,
+                solidBodyMotionFunction::New(subDict, mesh.time())
+            );
+
+            // Collect points of cell zone.
+            const cellZone& cz = mesh.cellZones()[zoneIDs_[zonei]];
+
+            boolList movePts(mesh.nPoints(), false);
+
+            forAll(cz, i)
+            {
+                label celli = cz[i];
+                const cell& c = mesh.cells()[celli];
+                forAll(c, j)
+                {
+                    const face& f = mesh.faces()[c[j]];
+                    forAll(f, k)
+                    {
+                        label pointi = f[k];
+                        movePts[pointi] = true;
+                    }
+                }
+            }
+
+            syncTools::syncPointList(mesh, movePts, orEqOp<bool>(), false);
+
+            DynamicList<label> ptIDs(mesh.nPoints());
+            forAll(movePts, i)
+            {
+                if (movePts[i])
+                {
+                    ptIDs.append(i);
+                }
+            }
+
+            pointIDs_[zonei].transfer(ptIDs);
+
+            Info<< "Applying solid body motion " << SBMFs_[zonei].type()
+                << " to " << pointIDs_[zonei].size() << " points of cellZone "
+                << iter().keyword() << endl;
+
+            zonei++;
+        }
+    }
+    zoneIDs_.setSize(zonei);
+    SBMFs_.setSize(zonei);
+    pointIDs_.setSize(zonei);
+}
+
+
+// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
+
+Foam::multiSolidBodyMotionSolver::~multiSolidBodyMotionSolver()
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
+
+Foam::tmp<Foam::pointField> Foam::multiSolidBodyMotionSolver::curPoints() const
+{
+    tmp<pointField> ttransformedPts(new pointField(mesh().points()));
+    pointField& transformedPts = ttransformedPts.ref();
+
+    forAll(zoneIDs_, i)
+    {
+        const labelList& zonePoints = pointIDs_[i];
+
+        UIndirectList<point>(transformedPts, zonePoints) = transformPoints
+        (
+            SBMFs_[i].transformation(),
+            pointField(points0_, zonePoints)
+        );
+    }
+
+    return ttransformedPts;
+}
+
+
+// ************************************************************************* //
diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/multiSolidBodyMotionFvMesh.H b/src/dynamicMesh/motionSolvers/displacement/solidBody/multiSolidBodyMotionSolver.H
similarity index 69%
rename from src/dynamicFvMesh/solidBodyMotionFvMesh/multiSolidBodyMotionFvMesh.H
rename to src/dynamicMesh/motionSolvers/displacement/solidBody/multiSolidBodyMotionSolver.H
index 3c36131d975dffe606323581040d6c42591adb05..14232574ac14ef5fcbda21d82958776a0278af3d 100644
--- a/src/dynamicFvMesh/solidBodyMotionFvMesh/multiSolidBodyMotionFvMesh.H
+++ b/src/dynamicMesh/motionSolvers/displacement/solidBody/multiSolidBodyMotionSolver.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -22,23 +22,21 @@ License
     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 
 Class
-    Foam::multiSolidBodyMotionFvMesh
+    Foam::multiSolidBodyMotionSolver
 
 Description
     Solid-body motion of the mesh specified by a run-time selectable
     motion function.
 
 SourceFiles
-    multiSolidBodyMotionFvMesh.C
+    multiSolidBodyMotionSolver.C
 
 \*---------------------------------------------------------------------------*/
 
-#ifndef multiSolidBodyMotionFvMesh_H
-#define multiSolidBodyMotionFvMesh_H
+#ifndef multiSolidBodyMotionSolver_H
+#define multiSolidBodyMotionSolver_H
 
-#include "dynamicFvMesh.H"
-#include "dictionary.H"
-#include "pointIOField.H"
+#include "points0MotionSolver.H"
 #include "solidBodyMotionFunction.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -47,24 +45,18 @@ namespace Foam
 {
 
 /*---------------------------------------------------------------------------*\
-                   Class multiSolidBodyMotionFvMesh Declaration
+                   Class multiSolidBodyMotionSolver Declaration
 \*---------------------------------------------------------------------------*/
 
-class multiSolidBodyMotionFvMesh
+class multiSolidBodyMotionSolver
 :
-    public dynamicFvMesh
+    public points0MotionSolver
 {
     // Private data
 
-        //- Dictionary of motion control parameters
-        const dictionary dynamicMeshCoeffs_;
-
         //- The motion control function
         PtrList<solidBodyMotionFunction> SBMFs_;
 
-        //- The reference points which are transformed
-        pointIOField undisplacedPoints_;
-
         //- Specified cellZones
         labelList zoneIDs_;
 
@@ -75,32 +67,40 @@ class multiSolidBodyMotionFvMesh
     // Private Member Functions
 
         //- Disallow default bitwise copy construct
-        multiSolidBodyMotionFvMesh(const multiSolidBodyMotionFvMesh&);
+        multiSolidBodyMotionSolver(const multiSolidBodyMotionSolver&);
 
         //- Disallow default bitwise assignment
-        void operator=(const multiSolidBodyMotionFvMesh&);
+        void operator=(const multiSolidBodyMotionSolver&);
 
 
 public:
 
     //- Runtime type information
-    TypeName("multiSolidBodyMotionFvMesh");
+    TypeName("multiSolidBodyMotionSolver");
 
 
     // Constructors
 
-        //- Construct from IOobject
-        multiSolidBodyMotionFvMesh(const IOobject& io);
+        //- Construct from mesh and dictionary
+        multiSolidBodyMotionSolver
+        (
+            const polyMesh&,
+            const IOdictionary&
+        );
 
 
     //- Destructor
-    ~multiSolidBodyMotionFvMesh();
+    ~multiSolidBodyMotionSolver();
 
 
     // Member Functions
 
-        //- Update the mesh for both mesh motion and topology change
-        virtual bool update();
+        //- Return point location obtained from the current motion field
+        virtual tmp<pointField> curPoints() const;
+
+        //- Solve for motion
+        virtual void solve()
+        {}
 };
 
 
diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.C b/src/dynamicMesh/motionSolvers/displacement/solidBody/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.C
similarity index 100%
rename from src/dynamicFvMesh/solidBodyMotionFvMesh/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.C
rename to src/dynamicMesh/motionSolvers/displacement/solidBody/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.C
diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.H b/src/dynamicMesh/motionSolvers/displacement/solidBody/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.H
similarity index 100%
rename from src/dynamicFvMesh/solidBodyMotionFvMesh/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.H
rename to src/dynamicMesh/motionSolvers/displacement/solidBody/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.H
diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/SDA/SDA.C b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/SDA/SDA.C
similarity index 100%
rename from src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/SDA/SDA.C
rename to src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/SDA/SDA.C
diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/SDA/SDA.H b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/SDA/SDA.H
similarity index 100%
rename from src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/SDA/SDA.H
rename to src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/SDA/SDA.H
diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/axisRotationMotion/axisRotationMotion.C b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/axisRotationMotion/axisRotationMotion.C
similarity index 100%
rename from src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/axisRotationMotion/axisRotationMotion.C
rename to src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/axisRotationMotion/axisRotationMotion.C
diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/axisRotationMotion/axisRotationMotion.H b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/axisRotationMotion/axisRotationMotion.H
similarity index 98%
rename from src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/axisRotationMotion/axisRotationMotion.H
rename to src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/axisRotationMotion/axisRotationMotion.H
index 9f78e72d1b0cb9a8af27d05f1d0da82fbea5bba3..8cbd3e8ce68f853fc278a87e2c2f323a4133de1a 100644
--- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/axisRotationMotion/axisRotationMotion.H
+++ b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/axisRotationMotion/axisRotationMotion.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2012-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2012-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/linearMotion/linearMotion.C b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/linearMotion/linearMotion.C
similarity index 100%
rename from src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/linearMotion/linearMotion.C
rename to src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/linearMotion/linearMotion.C
diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/linearMotion/linearMotion.H b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/linearMotion/linearMotion.H
similarity index 98%
rename from src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/linearMotion/linearMotion.H
rename to src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/linearMotion/linearMotion.H
index 036ed957b63a48c9dbe2ff1e19a5d8786e61fc8d..afc90d74422b0d1c782e2e15374a40ac64c96801 100644
--- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/linearMotion/linearMotion.H
+++ b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/linearMotion/linearMotion.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/multiMotion/multiMotion.C b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/multiMotion/multiMotion.C
similarity index 100%
rename from src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/multiMotion/multiMotion.C
rename to src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/multiMotion/multiMotion.C
diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/multiMotion/multiMotion.H b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/multiMotion/multiMotion.H
similarity index 98%
rename from src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/multiMotion/multiMotion.H
rename to src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/multiMotion/multiMotion.H
index 93eb8dd8e53b6a465ef44f732045d266c1601e49..47ce23cc5ab8b7a1f0151caaaddebcb3c2489ccd 100644
--- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/multiMotion/multiMotion.H
+++ b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/multiMotion/multiMotion.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.C b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.C
similarity index 100%
rename from src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.C
rename to src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.C
diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.H b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.H
similarity index 98%
rename from src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.H
rename to src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.H
index d080f486ef414c9027f6c40ff010e4f06320e02e..ef0ea54fd8c5e9c0873b9d57fd819135332ecaec 100644
--- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.H
+++ b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.C b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.C
similarity index 100%
rename from src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.C
rename to src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.C
diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.H b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.H
similarity index 98%
rename from src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.H
rename to src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.H
index 60692b98f2f8bfe0cf5f7dddb141b86a8def077a..198796c61331b1a6af1641311176e4555884af61 100644
--- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.H
+++ b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.C b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.C
similarity index 100%
rename from src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.C
rename to src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.C
diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.H b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.H
similarity index 100%
rename from src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.H
rename to src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.H
diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.C b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.C
similarity index 100%
rename from src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.C
rename to src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.C
diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.H b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.H
similarity index 98%
rename from src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.H
rename to src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.H
index 1e0ed0363b2f38930def43c529408be25267da0a..232ce1b4ccdf5f051a5a94b5daf25c0320690bd3 100644
--- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.H
+++ b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2014 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C
similarity index 97%
rename from src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C
rename to src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C
index b0f0921750a8c0ff9fe091fbf497a7bb63500cc7..dfb9d5e1f37fe98ff810baa23610ca7587282714 100644
--- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C
+++ b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.C b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.C
similarity index 100%
rename from src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.C
rename to src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.C
diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.H b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.H
similarity index 98%
rename from src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.H
rename to src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.H
index 0a5bfc736f7dcdef46f3ed6eeee632f655317b63..4c6c05b4f1f25add3947619eb9964367ea5b3c34 100644
--- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.H
+++ b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.C b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionSolver.C
similarity index 51%
rename from src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.C
rename to src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionSolver.C
index b4a993f11c62f685e229cfa802d2b5739560bdb5..d14e87ce9cd22fe68298e8f6a46eb73cf12e64b1 100644
--- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.C
+++ b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionSolver.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -23,9 +23,8 @@ License
 
 \*---------------------------------------------------------------------------*/
 
-#include "solidBodyMotionFvMesh.H"
+#include "solidBodyMotionSolver.H"
 #include "addToRunTimeSelectionTable.H"
-#include "volFields.H"
 #include "transformField.H"
 #include "cellZoneMesh.H"
 #include "cellSet.H"
@@ -36,91 +35,61 @@ License
 
 namespace Foam
 {
-    defineTypeNameAndDebug(solidBodyMotionFvMesh, 0);
-    addToRunTimeSelectionTable(dynamicFvMesh, solidBodyMotionFvMesh, IOobject);
+    defineTypeNameAndDebug(solidBodyMotionSolver, 0);
+    addToRunTimeSelectionTable
+    (
+        motionSolver,
+        solidBodyMotionSolver,
+        dictionary
+    );
 }
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
-Foam::solidBodyMotionFvMesh::solidBodyMotionFvMesh(const IOobject& io)
+Foam::solidBodyMotionSolver::solidBodyMotionSolver
+(
+    const polyMesh& mesh,
+    const IOdictionary& dict
+)
 :
-    dynamicFvMesh(io),
-    dynamicMeshCoeffs_
-    (
-        IOdictionary
-        (
-            IOobject
-            (
-                "dynamicMeshDict",
-                io.time().constant(),
-                *this,
-                IOobject::MUST_READ_IF_MODIFIED,
-                IOobject::NO_WRITE,
-                false
-            )
-        ).subDict(typeName + "Coeffs")
-    ),
-    SBMFPtr_(solidBodyMotionFunction::New(dynamicMeshCoeffs_, io.time())),
-    undisplacedPoints_
-    (
-        IOobject
-        (
-            "points",
-            io.time().constant(),
-            meshSubDir,
-            *this,
-            IOobject::MUST_READ,
-            IOobject::NO_WRITE,
-            false
-        )
-    ),
+    points0MotionSolver(mesh, dict, typeName),
+    SBMFPtr_(solidBodyMotionFunction::New(coeffDict(), mesh.time())),
     pointIDs_(),
-    moveAllCells_(false),
-    UName_(dynamicMeshCoeffs_.lookupOrDefault<word>("U", "U"))
+    moveAllCells_(false)
 {
-    if (undisplacedPoints_.size() != nPoints())
-    {
-        FatalIOErrorInFunction(dynamicMeshCoeffs_)
-            << "Read " << undisplacedPoints_.size()
-            << " undisplaced points from " << undisplacedPoints_.objectPath()
-            << " but the current mesh has " << nPoints()
-            << exit(FatalIOError);
-    }
-
     word cellZoneName =
-        dynamicMeshCoeffs_.lookupOrDefault<word>("cellZone", "none");
+        coeffDict().lookupOrDefault<word>("cellZone", "none");
 
     word cellSetName =
-        dynamicMeshCoeffs_.lookupOrDefault<word>("cellSet", "none");
+        coeffDict().lookupOrDefault<word>("cellSet", "none");
 
     if ((cellZoneName != "none") && (cellSetName != "none"))
     {
-        FatalIOErrorInFunction(dynamicMeshCoeffs_)
+        FatalIOErrorInFunction(coeffDict())
             << "Either cellZone OR cellSet can be supplied, but not both. "
             << "If neither is supplied, all cells will be included"
             << exit(FatalIOError);
     }
 
-
     labelList cellIDs;
     if (cellZoneName != "none")
     {
         Info<< "Applying solid body motion to cellZone " << cellZoneName
             << endl;
 
-        label zoneID = cellZones().findZoneID(cellZoneName);
+        label zoneID = mesh.cellZones().findZoneID(cellZoneName);
 
         if (zoneID == -1)
         {
             FatalErrorInFunction
                 << "Unable to find cellZone " << cellZoneName
                 << ".  Valid cellZones are:"
-                << cellZones().names()
+                << mesh.cellZones().names()
                 << exit(FatalError);
         }
 
-        cellIDs = cellZones()[zoneID];
+        cellIDs = mesh.cellZones()[zoneID];
     }
 
     if (cellSetName != "none")
@@ -128,7 +97,7 @@ Foam::solidBodyMotionFvMesh::solidBodyMotionFvMesh(const IOobject& io)
         Info<< "Applying solid body motion to cellSet " << cellSetName
             << endl;
 
-        cellSet set(*this, cellSetName);
+        cellSet set(mesh, cellSetName);
 
         cellIDs = set.toc();
     }
@@ -144,15 +113,15 @@ Foam::solidBodyMotionFvMesh::solidBodyMotionFvMesh(const IOobject& io)
     {
         // collect point IDs of points in cell zone
 
-        boolList movePts(nPoints(), false);
+        boolList movePts(mesh.nPoints(), false);
 
         forAll(cellIDs, i)
         {
             label celli = cellIDs[i];
-            const cell& c = cells()[celli];
+            const cell& c = mesh.cells()[celli];
             forAll(c, j)
             {
-                const face& f = faces()[c[j]];
+                const face& f = mesh.faces()[c[j]];
                 forAll(f, k)
                 {
                     label pointi = f[k];
@@ -161,9 +130,9 @@ Foam::solidBodyMotionFvMesh::solidBodyMotionFvMesh(const IOobject& io)
             }
         }
 
-        syncTools::syncPointList(*this, movePts, orEqOp<bool>(), false);
+        syncTools::syncPointList(mesh, movePts, orEqOp<bool>(), false);
 
-        DynamicList<label> ptIDs(nPoints());
+        DynamicList<label> ptIDs(mesh.nPoints());
         forAll(movePts, i)
         {
             if (movePts[i])
@@ -179,59 +148,31 @@ Foam::solidBodyMotionFvMesh::solidBodyMotionFvMesh(const IOobject& io)
 
 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
 
-Foam::solidBodyMotionFvMesh::~solidBodyMotionFvMesh()
+Foam::solidBodyMotionSolver::~solidBodyMotionSolver()
 {}
 
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
-bool Foam::solidBodyMotionFvMesh::update()
+Foam::tmp<Foam::pointField> Foam::solidBodyMotionSolver::curPoints() const
 {
-    static bool hasWarned = false;
-
     if (moveAllCells_)
     {
-        fvMesh::movePoints
-        (
-            transformPoints
-            (
-                SBMFPtr_().transformation(),
-                undisplacedPoints_
-            )
-        );
+        return transformPoints(SBMFPtr_().transformation(), points0_);
     }
     else
     {
-        pointField transformedPts(undisplacedPoints_);
+        tmp<pointField> ttransformedPts(new pointField(mesh().points()));
+        pointField& transformedPts = ttransformedPts.ref();
 
-        UIndirectList<point>(transformedPts, pointIDs_) =
-            transformPoints
-            (
-                SBMFPtr_().transformation(),
-                pointField(transformedPts, pointIDs_)
-            );
-
-        fvMesh::movePoints(transformedPts);
-    }
-
-
-    if (foundObject<volVectorField>(UName_))
-    {
-        const volVectorField& U = lookupObject<volVectorField>(UName_);
-
-        const_cast<volVectorField&>(U).correctBoundaryConditions();
-    }
-    else if (!hasWarned)
-    {
-        hasWarned = true;
+        UIndirectList<point>(transformedPts, pointIDs_) = transformPoints
+        (
+            SBMFPtr_().transformation(),
+            pointField(points0_, pointIDs_)
+        );
 
-        WarningInFunction
-            << "Did not find volVectorField " << UName_
-            << " Not updating " << UName_ << "boundary conditions."
-            << endl;
+        return ttransformedPts;
     }
-
-    return true;
 }
 
 
diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.H b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionSolver.H
similarity index 69%
rename from src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.H
rename to src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionSolver.H
index d7d8bf4680815161e0dced4010f3009a0b0273cb..4b36558c2c3083feded2084c9e06164893f10689 100644
--- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.H
+++ b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionSolver.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2014 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -22,23 +22,21 @@ License
     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 
 Class
-    Foam::solidBodyMotionFvMesh
+    Foam::solidBodyMotionSolver
 
 Description
     Solid-body motion of the mesh specified by a run-time selectable
     motion function.
 
 SourceFiles
-    solidBodyMotionFvMesh.C
+    solidBodyMotionSolver.C
 
 \*---------------------------------------------------------------------------*/
 
-#ifndef solidBodyMotionFvMesh_H
-#define solidBodyMotionFvMesh_H
+#ifndef solidBodyMotionSolver_H
+#define solidBodyMotionSolver_H
 
-#include "dynamicFvMesh.H"
-#include "dictionary.H"
-#include "pointIOField.H"
+#include "points0MotionSolver.H"
 #include "solidBodyMotionFunction.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -47,63 +45,62 @@ namespace Foam
 {
 
 /*---------------------------------------------------------------------------*\
-                   Class solidBodyMotionFvMesh Declaration
+                   Class solidBodyMotionSolver Declaration
 \*---------------------------------------------------------------------------*/
 
-class solidBodyMotionFvMesh
+class solidBodyMotionSolver
 :
-    public dynamicFvMesh
+    public points0MotionSolver
 {
     // Private data
 
-        //- Dictionary of motion control parameters
-        const dictionary dynamicMeshCoeffs_;
-
         //- The motion control function
         autoPtr<solidBodyMotionFunction> SBMFPtr_;
 
-        //- The reference points which are transformed
-        pointIOField undisplacedPoints_;
-
         //- Points to move when cell zone is supplied
         labelList pointIDs_;
 
         //- Flag to indicate whether all cells should move
         bool moveAllCells_;
 
-        //- Name of velocity field
-        word UName_;
-
 
     // Private Member Functions
 
         //- Disallow default bitwise copy construct
-        solidBodyMotionFvMesh(const solidBodyMotionFvMesh&);
+        solidBodyMotionSolver(const solidBodyMotionSolver&);
 
         //- Disallow default bitwise assignment
-        void operator=(const solidBodyMotionFvMesh&);
+        void operator=(const solidBodyMotionSolver&);
 
 
 public:
 
     //- Runtime type information
-    TypeName("solidBodyMotionFvMesh");
+    TypeName("solidBody");
 
 
     // Constructors
 
-        //- Construct from IOobject
-        solidBodyMotionFvMesh(const IOobject& io);
+        //- Construct from mesh and dictionary
+        solidBodyMotionSolver
+        (
+            const polyMesh&,
+            const IOdictionary&
+        );
 
 
     //- Destructor
-    ~solidBodyMotionFvMesh();
+    ~solidBodyMotionSolver();
 
 
     // Member Functions
 
-        //- Update the mesh for both mesh motion and topology change
-        virtual bool update();
+        //- Return point location obtained from the current motion field
+        virtual tmp<pointField> curPoints() const;
+
+        //- Solve for motion
+        virtual void solve()
+        {}
 };
 
 
diff --git a/src/dynamicMesh/motionSolver/motionSolver/motionSolver.C b/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C
similarity index 87%
rename from src/dynamicMesh/motionSolver/motionSolver/motionSolver.C
rename to src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C
index efcaab60e1e415fbf759365dcaa07675e2d63cf2..a637338472ef24de23fdf26fa5ff6122fe9ed6db 100644
--- a/src/dynamicMesh/motionSolver/motionSolver/motionSolver.C
+++ b/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -89,6 +89,13 @@ Foam::motionSolver::motionSolver
 {}
 
 
+Foam::autoPtr<Foam::motionSolver> Foam::motionSolver::clone() const
+{
+    NotImplemented;
+    return autoPtr<motionSolver>(nullptr);
+}
+
+
 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
 
 Foam::autoPtr<Foam::motionSolver> Foam::motionSolver::New
@@ -150,6 +157,36 @@ Foam::autoPtr<Foam::motionSolver> Foam::motionSolver::New(const polyMesh& mesh)
 }
 
 
+Foam::motionSolver::iNew::iNew(const polyMesh& mesh)
+:
+    mesh_(mesh)
+{}
+
+
+Foam::autoPtr<Foam::motionSolver> Foam::motionSolver::iNew::operator()
+(
+    Istream& is
+) const
+{
+    dictionaryEntry dict(dictionary::null, is);
+
+    return motionSolver::New
+    (
+        mesh_,
+        IOdictionary
+        (
+            IOobject
+            (
+                dict.name() + ":meshSolver",
+                mesh_.time().constant(),
+                mesh_
+            ),
+            dict
+        )
+    );
+}
+
+
 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
 
 Foam::motionSolver::~motionSolver()
diff --git a/src/dynamicMesh/motionSolver/motionSolver/motionSolver.H b/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.H
similarity index 90%
rename from src/dynamicMesh/motionSolver/motionSolver/motionSolver.H
rename to src/dynamicMesh/motionSolvers/motionSolver/motionSolver.H
index a252436b168184b5b9176fe4203386ceca45a8c0..b0349cdc1ba8f00bd3128e3d3938cb154eb09455 100644
--- a/src/dynamicMesh/motionSolver/motionSolver/motionSolver.H
+++ b/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2014 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -38,6 +38,10 @@ SourceFiles
 #include "IOdictionary.H"
 #include "pointField.H"
 
+#include "Time.H"
+#include "polyMesh.H"
+#include "dictionaryEntry.H"
+
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 namespace Foam
@@ -55,9 +59,6 @@ class motionSolver
 :
     public IOdictionary
 {
-
-private:
-
     // Private data
 
         //- Reference to mesh
@@ -74,6 +75,7 @@ protected:
         //- De-register object if registered and assign to current
         static IOobject stealRegistration(const IOdictionary& dict);
 
+
 public:
 
     //- Runtime type information
@@ -101,6 +103,19 @@ public:
         //  was registered this will 'steal' that registration.
         static autoPtr<motionSolver> New(const polyMesh&, const IOdictionary&);
 
+        //- Class used for the construction of PtrLists of motionSolvers
+        class iNew
+        {
+            const polyMesh& mesh_;
+
+        public:
+
+            iNew(const polyMesh& mesh);
+
+            autoPtr<motionSolver> operator()(Istream& is) const;
+        };
+
+
 
     // Constructors
 
@@ -115,6 +130,9 @@ public:
             const word& type
         );
 
+        //- Clone function
+        virtual autoPtr<motionSolver> clone() const;
+
 
     //- Destructor
     virtual ~motionSolver();
diff --git a/src/dynamicMesh/motionSolver/velocityDisplacement/velocityDisplacementMotionSolver.C b/src/dynamicMesh/motionSolvers/velocity/velocityDisplacement/velocityDisplacementMotionSolver.C
similarity index 98%
rename from src/dynamicMesh/motionSolver/velocityDisplacement/velocityDisplacementMotionSolver.C
rename to src/dynamicMesh/motionSolvers/velocity/velocityDisplacement/velocityDisplacementMotionSolver.C
index 8c8848bae5fdb1048f7c71ed36d106199a43f648..cc51e8ef74ab7e80a31383b4f97a64edbfed63d0 100644
--- a/src/dynamicMesh/motionSolver/velocityDisplacement/velocityDisplacementMotionSolver.C
+++ b/src/dynamicMesh/motionSolvers/velocity/velocityDisplacement/velocityDisplacementMotionSolver.C
@@ -75,7 +75,7 @@ Foam::velocityDisplacementMotionSolver::velocityDisplacementMotionSolver
     velocityMotionSolver(mesh, dict, typeName),
     displacementMotionSolverPtr_()
 {
-    pointIOField points0(displacementMotionSolver::points0IO(mesh));
+    pointIOField points0(points0MotionSolver::points0IO(mesh));
 
     pointVectorField pointDisplacement
     (
diff --git a/src/dynamicMesh/motionSolver/velocityDisplacement/velocityDisplacementMotionSolver.H b/src/dynamicMesh/motionSolvers/velocity/velocityDisplacement/velocityDisplacementMotionSolver.H
similarity index 100%
rename from src/dynamicMesh/motionSolver/velocityDisplacement/velocityDisplacementMotionSolver.H
rename to src/dynamicMesh/motionSolvers/velocity/velocityDisplacement/velocityDisplacementMotionSolver.H
diff --git a/src/dynamicMesh/motionSolver/velocity/velocityMotionSolver.C b/src/dynamicMesh/motionSolvers/velocity/velocityMotionSolver.C
similarity index 96%
rename from src/dynamicMesh/motionSolver/velocity/velocityMotionSolver.C
rename to src/dynamicMesh/motionSolvers/velocity/velocityMotionSolver.C
index 35f9924b497e7a97f000b05bc23562e2acfe67b7..a6c2604bea55409f3a9e5eaf815123673024a0ad 100644
--- a/src/dynamicMesh/motionSolver/velocity/velocityMotionSolver.C
+++ b/src/dynamicMesh/motionSolvers/velocity/velocityMotionSolver.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2012 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2012-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
diff --git a/src/dynamicMesh/motionSolver/velocity/velocityMotionSolver.H b/src/dynamicMesh/motionSolvers/velocity/velocityMotionSolver.H
similarity index 97%
rename from src/dynamicMesh/motionSolver/velocity/velocityMotionSolver.H
rename to src/dynamicMesh/motionSolvers/velocity/velocityMotionSolver.H
index a9a5c160d1afc4d29949930ef3de8fdd56d1cf84..e675b87d73b9538ec63c8398e03b5c28f83713b3 100644
--- a/src/dynamicMesh/motionSolver/velocity/velocityMotionSolver.H
+++ b/src/dynamicMesh/motionSolvers/velocity/velocityMotionSolver.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2012 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2012-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
diff --git a/src/edgeMesh/edgeMeshFormats/starcd/STARCDedgeFormat.C b/src/edgeMesh/edgeMeshFormats/starcd/STARCDedgeFormat.C
index 9a002009a1c84f0bb88d4bf32134570edc983f5a..2d6e658d88afe46e4961f670088b84f0d8f9a263 100644
--- a/src/edgeMesh/edgeMeshFormats/starcd/STARCDedgeFormat.C
+++ b/src/edgeMesh/edgeMeshFormats/starcd/STARCDedgeFormat.C
@@ -56,7 +56,7 @@ inline void Foam::fileFormats::STARCDedgeFormat::writeLines
 }
 
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 void Foam::fileFormats::STARCDedgeFormat::writeCase
 (
diff --git a/src/edgeMesh/edgeMeshFormats/starcd/STARCDedgeFormat.H b/src/edgeMesh/edgeMeshFormats/starcd/STARCDedgeFormat.H
index d4c2206ff6c31e0c3dc16144d8ed149168d5edb9..295cbebfbc354cd7cb047dbb27693021ad0fd7d4 100644
--- a/src/edgeMesh/edgeMeshFormats/starcd/STARCDedgeFormat.H
+++ b/src/edgeMesh/edgeMeshFormats/starcd/STARCDedgeFormat.H
@@ -87,6 +87,7 @@ protected:
         const label nEdges
     );
 
+
 public:
 
     // Constructors
diff --git a/src/edgeMesh/edgeMeshFormats/vtk/VTKedgeFormat.C b/src/edgeMesh/edgeMeshFormats/vtk/VTKedgeFormat.C
index 01e792e2cee195153f80c10389d73aa7993c9724..fe18c897f497378d3d3efac1895ca2087295f3dd 100644
--- a/src/edgeMesh/edgeMeshFormats/vtk/VTKedgeFormat.C
+++ b/src/edgeMesh/edgeMeshFormats/vtk/VTKedgeFormat.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -30,7 +30,7 @@ License
 #include "vtkUnstructuredReader.H"
 #include "Time.H"
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 void Foam::fileFormats::VTKedgeFormat::writeHeader
 (
diff --git a/src/edgeMesh/edgeMeshI.H b/src/edgeMesh/edgeMeshI.H
index 4c808c239d56fd837048ba218bc81fca4e2febc6..5ccff22321492bc97d18f82c77e527954bbebadd 100644
--- a/src/edgeMesh/edgeMeshI.H
+++ b/src/edgeMesh/edgeMeshI.H
@@ -23,6 +23,20 @@ License
 
 \*---------------------------------------------------------------------------*/
 
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
+
+inline Foam::pointField& Foam::edgeMesh::storedPoints()
+{
+    return points_;
+}
+
+
+inline Foam::edgeList& Foam::edgeMesh::storedEdges()
+{
+    return edges_;
+}
+
+
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
 inline Foam::edgeMesh::edgeMesh(const edgeMesh& em)
@@ -58,18 +72,6 @@ inline const Foam::labelListList& Foam::edgeMesh::pointEdges() const
 }
 
 
-inline Foam::pointField& Foam::edgeMesh::storedPoints()
-{
-    return points_;
-}
-
-
-inline Foam::edgeList& Foam::edgeMesh::storedEdges()
-{
-    return edges_;
-}
-
-
 // * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
 
 void Foam::edgeMesh::operator=(const edgeMesh& rhs)
diff --git a/src/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.C b/src/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.C
index 136d0eb198d6af0c45e6bb6d86458b0f48801e22..49e240abdfe253a14d4cba5e510beeb12eb50b62 100644
--- a/src/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.C
+++ b/src/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.C
@@ -169,7 +169,7 @@ bool Foam::extendedEdgeMesh::canRead
 }
 
 
-// * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 Foam::extendedEdgeMesh::pointStatus
 Foam::extendedEdgeMesh::classifyFeaturePoint
diff --git a/src/fileFormats/sampledSetWriters/writer.C b/src/fileFormats/sampledSetWriters/writer.C
index 036de180bae294eddaa35f64397348772ea5570c..afc3603dabd3372b49e2629d47fa2a1a9a6712c2 100644
--- a/src/fileFormats/sampledSetWriters/writer.C
+++ b/src/fileFormats/sampledSetWriters/writer.C
@@ -53,7 +53,7 @@ Foam::autoPtr<Foam::writer<Type>> Foam::writer<Type>::New
 }
 
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 template<class Type>
 Foam::fileName Foam::writer<Type>::getBaseName
diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZone.C b/src/finiteVolume/cfdTools/general/MRF/MRFZone.C
index bcda0985249ec9c7efc555bd243fff21278d8c1e..b1f64847c586cf1c038cea5b1f40ff248f93e6ac 100644
--- a/src/finiteVolume/cfdTools/general/MRF/MRFZone.C
+++ b/src/finiteVolume/cfdTools/general/MRF/MRFZone.C
@@ -405,6 +405,11 @@ void Foam::MRFZone::addCoriolis
 
 void Foam::MRFZone::makeRelative(volVectorField& U) const
 {
+    if (cellZoneID_ == -1)
+    {
+        return;
+    }
+
     const volVectorField& C = mesh_.C();
 
     const vector Omega = this->Omega();
@@ -474,6 +479,11 @@ void Foam::MRFZone::makeRelative
 
 void Foam::MRFZone::makeAbsolute(volVectorField& U) const
 {
+    if (cellZoneID_ == -1)
+    {
+        return;
+    }
+
     const volVectorField& C = mesh_.C();
 
     const vector Omega = this->Omega();
@@ -530,6 +540,11 @@ void Foam::MRFZone::makeAbsolute
 
 void Foam::MRFZone::correctBoundaryVelocity(volVectorField& U) const
 {
+    if (!active_)
+    {
+        return;
+    }
+
     const vector Omega = this->Omega();
 
     // Included patches
diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZoneTemplates.C b/src/finiteVolume/cfdTools/general/MRF/MRFZoneTemplates.C
index a5feb783deefefd670eab8bfba13d37444989618..0a591035d6d3305a5bd8af6486006470a93fcff7 100644
--- a/src/finiteVolume/cfdTools/general/MRF/MRFZoneTemplates.C
+++ b/src/finiteVolume/cfdTools/general/MRF/MRFZoneTemplates.C
@@ -38,6 +38,11 @@ void Foam::MRFZone::makeRelativeRhoFlux
     surfaceScalarField& phi
 ) const
 {
+    if (!active_)
+    {
+        return;
+    }
+
     const surfaceVectorField& Cf = mesh_.Cf();
     const surfaceVectorField& Sf = mesh_.Sf();
 
@@ -65,6 +70,11 @@ void Foam::MRFZone::makeRelativeRhoFlux
     FieldField<fvsPatchField, scalar>& phi
 ) const
 {
+    if (!active_)
+    {
+        return;
+    }
+
     const surfaceVectorField& Cf = mesh_.Cf();
     const surfaceVectorField& Sf = mesh_.Sf();
 
@@ -105,6 +115,11 @@ void Foam::MRFZone::makeRelativeRhoFlux
     const label patchi
 ) const
 {
+    if (!active_)
+    {
+        return;
+    }
+
     const surfaceVectorField& Cf = mesh_.Cf();
     const surfaceVectorField& Sf = mesh_.Sf();
 
@@ -138,6 +153,11 @@ void Foam::MRFZone::makeAbsoluteRhoFlux
     surfaceScalarField& phi
 ) const
 {
+    if (!active_)
+    {
+        return;
+    }
+
     const surfaceVectorField& Cf = mesh_.Cf();
     const surfaceVectorField& Sf = mesh_.Sf();
 
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.H
index e5caf978687183b07362d80d54449371490a7c94..7a2f84166409a4280dd23dd5c4b614fe09b73154 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.H
+++ b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.H
@@ -29,7 +29,8 @@ Group
 
 Description
     This boundary condition provides an advective outflow condition, based on
-    solving DDt(psi, U) = 0 at the boundary.
+    solving DDt(W, field) = 0 at the boundary where \c W is the wave velocity
+    and \c field is the field to which this boundary condition is applied.
 
     The standard (Euler, backward, CrankNicolson, localEuler) time schemes are
     supported.  Additionally an optional mechanism to relax the value at
@@ -37,7 +38,7 @@ Description
     switched on by specifying the relaxation length-scale \c lInf and the
     far-field value \c fieldInf.
 
-    The flow/wave speed at the outlet is provided by the virtual function
+    The flow/wave speed \c (w) at the outlet is provided by the virtual function
     advectionSpeed() the default implementation of which requires the name of
     the flux field \c (phi) and optionally the density \c (rho) if the
     mass-flux rather than the volumetric-flux is given.
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedFieldFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedFieldFvPatchField.C
index dafc629b50608c1f5fd1470a751b664db3b3b8c8..3dff767145ec5af98ee80e81d5a938006cd9f407 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedFieldFvPatchField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedFieldFvPatchField.C
@@ -138,6 +138,27 @@ Foam::mappedFieldFvPatchField<Type>::mappedFieldFvPatchField
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
+template<class Type>
+void Foam::mappedFieldFvPatchField<Type>::autoMap
+(
+    const fvPatchFieldMapper& m
+)
+{
+    mappedPatchBase::clearOut();
+}
+
+
+template<class Type>
+void Foam::mappedFieldFvPatchField<Type>::rmap
+(
+    const fvPatchField<Type>& ptf,
+    const labelList& addr
+)
+{
+    mappedPatchBase::clearOut();
+}
+
+
 template<class Type>
 void Foam::mappedFieldFvPatchField<Type>::updateCoeffs()
 {
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedFieldFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedFieldFvPatchField.H
index 2c2026545e51cb0e5036e278c00f60e6d376c372..59af6f564c162982bba18dd89bfe4449ba2db888 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedFieldFvPatchField.H
+++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedFieldFvPatchField.H
@@ -193,6 +193,22 @@ public:
 
     // Member functions
 
+        // Mapping functions
+
+            //- Map (and resize as needed) from self given a mapping object
+            virtual void autoMap
+            (
+                const fvPatchFieldMapper&
+            );
+
+            //- Reverse map the given fvPatchField onto this fvPatchField
+            virtual void rmap
+            (
+                const fvPatchField<Type>&,
+                const labelList&
+            );
+
+
         // Evaluation functions
 
             //- Update the coefficients associated with the patch field
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedValue/mappedFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedValue/mappedFixedValueFvPatchField.C
index 13e09b1d8ff05de08fcb4295be9a3fbc89eb8e3d..9754e04a6af7b2d10d8dae0381b840b019b34a63 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedValue/mappedFixedValueFvPatchField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedValue/mappedFixedValueFvPatchField.C
@@ -24,7 +24,6 @@ License
 \*---------------------------------------------------------------------------*/
 
 #include "mappedFixedValueFvPatchField.H"
-#include "mappedPatchBase.H"
 #include "volFields.H"
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.H
index 63865c88922b3f8a4a50c64246be60db5416fbd9..07a8783354ee2fe390b41f7c5b52c7adf692a89c 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.H
+++ b/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.H
@@ -29,18 +29,19 @@ Group
 
 Description
     This boundary condition provides a wave transmissive outflow condition,
-    based onsolving DDt(psi, U) = 0 at the boundary.
+    based on solving DDt(W, field) = 0 at the boundary \c W is the wave velocity
+    and \c field is the field to which this boundary condition is applied.
 
     The wave speed is calculated using:
 
         \f[
-            x_p = \frac{\phi_p}{|Sf|} + \sqrt{\frac{\gamma}{\psi_p}}
+            w_p = \frac{\phi_p}{|Sf|} + \sqrt{\frac{\gamma}{\psi_p}}
         \f]
 
     where
 
     \vartable
-        x_p     | patch values
+        w_p     | patch wave speed
         \phi_p  | patch face flux
         \psi_p  | patch compressibility
         Sf      | patch face area vector
diff --git a/src/finiteVolume/finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.H b/src/finiteVolume/finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.H
index fb90de654fe2c35905d4d4a8b2d7aa39ff884975..20f2034181563ed47d32d5dbdb668c2aaf7d07df 100644
--- a/src/finiteVolume/finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.H
+++ b/src/finiteVolume/finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.H
@@ -39,7 +39,6 @@ SourceFiles
 #define gaussConvectionScheme_H
 
 #include "convectionScheme.H"
-#include "etcFiles.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -51,10 +50,6 @@ namespace Foam
 namespace fv
 {
 
-//- Temporary debug switch to provide warning about backward-compatibility
-//  issue with setting div schemes for steady-state
-extern int warnUnboundedGauss;
-
 /*---------------------------------------------------------------------------*\
                        Class gaussConvectionScheme Declaration
 \*---------------------------------------------------------------------------*/
@@ -111,29 +106,7 @@ public:
             (
                 surfaceInterpolationScheme<Type>::New(mesh, faceFlux, is)
             )
-        {
-            is.rewind();
-            word bounded(is);
-
-            if
-            (
-                warnUnboundedGauss
-             && word(mesh.ddtScheme("default")) == "steadyState"
-             && bounded != "bounded"
-            )
-            {
-                fileNameList controlDictFiles(findEtcFiles("controlDict"));
-
-                IOWarningInFunction(is)
-                    << "Unbounded 'Gauss' div scheme used in "
-                       "steady-state solver, use 'bounded Gauss' "
-                       "to ensure boundedness.\n"
-                    << "    To remove this warning switch off "
-                    << "'warnUnboundedGauss' in "
-                    << controlDictFiles[controlDictFiles.size()-1]
-                    << endl;
-            }
-        }
+        {}
 
 
     // Member Functions
diff --git a/src/finiteVolume/finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionSchemes.C b/src/finiteVolume/finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionSchemes.C
index 65386824bc1dd3ccd3190ad1cf3f1c86f61a1d02..c5ac92905fe401701551ff9575227d76ce391b46 100644
--- a/src/finiteVolume/finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionSchemes.C
+++ b/src/finiteVolume/finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionSchemes.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -28,11 +28,6 @@ License
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-int Foam::fv::warnUnboundedGauss
-(
-    Foam::debug::debugSwitch("warnUnboundedGauss", true)
-);
-
 makeFvConvectionScheme(gaussConvectionScheme)
 
 // ************************************************************************* //
diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C
index 3ac77ae34c758e7c999fe6875d3007b4445086fa..2fd8acaea7a6e69f3b3801f7b60b7ea469edf38a 100644
--- a/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C
+++ b/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C
@@ -317,6 +317,33 @@ EulerDdtScheme<Type>::fvcDdt
 }
 
 
+template<class Type>
+tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
+EulerDdtScheme<Type>::fvcDdt
+(
+    const GeometricField<Type, fvsPatchField, surfaceMesh>& sf
+)
+{
+    dimensionedScalar rDeltaT = 1.0/mesh().time().deltaT();
+
+    IOobject ddtIOobject
+    (
+        "ddt("+sf.name()+')',
+        mesh().time().timeName(),
+        mesh()
+    );
+
+    return tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
+    (
+        new GeometricField<Type, fvsPatchField, surfaceMesh>
+        (
+            ddtIOobject,
+            rDeltaT*(sf - sf.oldTime())
+        )
+    );
+}
+
+
 template<class Type>
 tmp<fvMatrix<Type>>
 EulerDdtScheme<Type>::fvmDdt
diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.H b/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.H
index 385063f97c5a957e21fd3de7e11dc64b16b50306..e83543364baaaabf6472666a344949f55209cecd 100644
--- a/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.H
+++ b/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.H
@@ -127,6 +127,11 @@ public:
             const GeometricField<Type, fvPatchField, volMesh>& psi
         );
 
+        tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> fvcDdt
+        (
+            const GeometricField<Type, fvsPatchField, surfaceMesh>&
+        );
+
         tmp<fvMatrix<Type>> fvmDdt
         (
             const GeometricField<Type, fvPatchField, volMesh>&
diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C
index 41024f831ca3e90b8e48b153b4df60d737154584..98d0ec1057b7ff7c957521d2f1bc36f640bfe38f 100644
--- a/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C
+++ b/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C
@@ -132,6 +132,22 @@ tmp<fvMatrix<Type>> ddtScheme<Type>::fvmDdt
 }
 
 
+template<class Type>
+tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> ddtScheme<Type>::fvcDdt
+(
+    const GeometricField<Type, fvsPatchField, surfaceMesh>& sf
+)
+{
+    NotImplemented;
+
+    return tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
+    (
+        GeometricField<Type, fvsPatchField, surfaceMesh>::null()
+    );
+}
+
+
+
 template<class Type>
 tmp<surfaceScalarField> ddtScheme<Type>::fvcDdtPhiCoeff
 (
diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.H b/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.H
index ed9cccf55d8581098b6b2b8f37e00d737a13a751..e2d1ca5c7bb3f27892f5b9f99b23f3d538ccd198 100644
--- a/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.H
+++ b/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.H
@@ -170,6 +170,11 @@ public:
             const GeometricField<Type, fvPatchField, volMesh>&
         ) = 0;
 
+        virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> fvcDdt
+        (
+            const GeometricField<Type, fvsPatchField, surfaceMesh>&
+        );
+
         virtual tmp<fvMatrix<Type>> fvmDdt
         (
             const GeometricField<Type, fvPatchField, volMesh>&
diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdt.C b/src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdt.C
index 0d607c86b4b53442eade3a65c0d9ab841cfc55e5..3d09e85917f3b5510a4cb535242ed79d11bffd35 100644
--- a/src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdt.C
+++ b/src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdt.C
@@ -29,6 +29,7 @@ License
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
 Foam::word Foam::fv::localEulerDdt::rDeltaTName("rDeltaT");
+Foam::word Foam::fv::localEulerDdt::rDeltaTfName("rDeltaTf");
 Foam::word Foam::fv::localEulerDdt::rSubDeltaTName("rSubDeltaT");
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -53,6 +54,18 @@ const Foam::volScalarField& Foam::fv::localEulerDdt::localRDeltaT
 }
 
 
+const Foam::surfaceScalarField& Foam::fv::localEulerDdt::localRDeltaTf
+(
+    const fvMesh& mesh
+)
+{
+    return mesh.objectRegistry::lookupObject<surfaceScalarField>
+    (
+        rDeltaTfName
+    );
+}
+
+
 Foam::tmp<Foam::volScalarField> Foam::fv::localEulerDdt::localRSubDeltaT
 (
     const fvMesh& mesh,
diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdtScheme.C
index 2dcdb83bb6583e6af85e08ae4089046c01f1d141..cad1b1aa902b1adf3c4d9f96c71fb7ddad149423 100644
--- a/src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdtScheme.C
+++ b/src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdtScheme.C
@@ -46,6 +46,13 @@ const volScalarField& localEulerDdtScheme<Type>::localRDeltaT() const
 }
 
 
+template<class Type>
+const surfaceScalarField& localEulerDdtScheme<Type>::localRDeltaTf() const
+{
+    return localEulerDdt::localRDeltaTf(mesh());
+}
+
+
 template<class Type>
 tmp<GeometricField<Type, fvPatchField, volMesh>>
 localEulerDdtScheme<Type>::fvcDdt
@@ -333,6 +340,33 @@ localEulerDdtScheme<Type>::fvcDdt
 }
 
 
+template<class Type>
+tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
+localEulerDdtScheme<Type>::fvcDdt
+(
+    const GeometricField<Type, fvsPatchField, surfaceMesh>& sf
+)
+{
+    const surfaceScalarField& rDeltaT = localRDeltaTf();
+
+    IOobject ddtIOobject
+    (
+        "ddt("+sf.name()+')',
+        mesh().time().timeName(),
+        mesh()
+    );
+
+    return tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
+    (
+        new GeometricField<Type, fvsPatchField, surfaceMesh>
+        (
+            ddtIOobject,
+            rDeltaT*(sf - sf.oldTime())
+        )
+    );
+}
+
+
 template<class Type>
 tmp<fvMatrix<Type>>
 localEulerDdtScheme<Type>::fvmDdt
diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdtScheme.H b/src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdtScheme.H
index fb256d799a8ac1b5a86374ae567be0dc46866d2e..1d6841aaa18c2dbaa56da5c0840d34fa6c969b8c 100644
--- a/src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdtScheme.H
+++ b/src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdtScheme.H
@@ -72,6 +72,9 @@ public:
     //- Name of the reciprocal local time-step field
     static word rDeltaTName;
 
+    //- Name of the reciprocal local face time-step field
+    static word rDeltaTfName;
+
     //- Name of the reciprocal local sub-cycling time-step field
     static word rSubDeltaTName;
 
@@ -91,6 +94,10 @@ public:
         //  looked-up from the objectRegistry
         static const volScalarField& localRDeltaT(const fvMesh& mesh);
 
+        //- Return the reciprocal of the local face time-step
+        //  looked-up from the objectRegistry
+        static const surfaceScalarField& localRDeltaTf(const fvMesh& mesh);
+
         //- Calculate and return the reciprocal of the local sub-cycling
         //  time-step
         static tmp<volScalarField> localRSubDeltaT
@@ -122,6 +129,9 @@ class localEulerDdtScheme
         //- Return the reciprocal of the local time-step
         const volScalarField& localRDeltaT() const;
 
+        //- Return the reciprocal of the local face time-step
+        const surfaceScalarField& localRDeltaTf() const;
+
 
 public:
 
@@ -181,6 +191,11 @@ public:
             const GeometricField<Type, fvPatchField, volMesh>& psi
         );
 
+        tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> fvcDdt
+        (
+            const GeometricField<Type, fvsPatchField, surfaceMesh>&
+        );
+
         tmp<fvMatrix<Type>> fvmDdt
         (
             const GeometricField<Type, fvPatchField, volMesh>&
diff --git a/src/finiteVolume/finiteVolume/fvc/fvcDdt.C b/src/finiteVolume/finiteVolume/fvc/fvcDdt.C
index 391da38be341ef0760a8d700941eef98c7ebad19..6087724834f4e863d116f9bd822799e0d646e63e 100644
--- a/src/finiteVolume/finiteVolume/fvc/fvcDdt.C
+++ b/src/finiteVolume/finiteVolume/fvc/fvcDdt.C
@@ -125,6 +125,21 @@ ddt
 }
 
 
+template<class Type>
+tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
+ddt
+(
+    const GeometricField<Type, fvsPatchField, surfaceMesh>& sf
+)
+{
+    return fv::ddtScheme<Type>::New
+    (
+        sf.mesh(),
+        sf.mesh().ddtScheme("ddt(" + sf.name() + ')')
+    ).ref().fvcDdt(sf);
+}
+
+
 template<class Type>
 tmp<GeometricField<Type, fvPatchField, volMesh>>
 ddt
diff --git a/src/finiteVolume/finiteVolume/fvc/fvcDdt.H b/src/finiteVolume/finiteVolume/fvc/fvcDdt.H
index c164445ebf4e743e3a3e2e57e7ac486fe9b9ccfc..0c6ee4b35a8cbf5bac2d4e22073273653a01953b 100644
--- a/src/finiteVolume/finiteVolume/fvc/fvcDdt.H
+++ b/src/finiteVolume/finiteVolume/fvc/fvcDdt.H
@@ -88,6 +88,12 @@ namespace fvc
         const GeometricField<Type, fvPatchField, volMesh>&
     );
 
+    template<class Type>
+    tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> ddt
+    (
+        const GeometricField<Type, fvsPatchField, surfaceMesh>&
+    );
+
     template<class Type>
     tmp<GeometricField<Type, fvPatchField, volMesh>> ddt
     (
diff --git a/src/finiteVolume/finiteVolume/snGradSchemes/orthogonalSnGrad/orthogonalSnGrad.H b/src/finiteVolume/finiteVolume/snGradSchemes/orthogonalSnGrad/orthogonalSnGrad.H
index ce30f2b290a43292f32ce270e1e50b30af4b7a81..80ca7f4f172e8b94ee5d332d0776d1158fcdcd8f 100644
--- a/src/finiteVolume/finiteVolume/snGradSchemes/orthogonalSnGrad/orthogonalSnGrad.H
+++ b/src/finiteVolume/finiteVolume/snGradSchemes/orthogonalSnGrad/orthogonalSnGrad.H
@@ -28,7 +28,8 @@ Group
     grpFvSnGradSchemes
 
 Description
-    Simple central-difference snGrad scheme without non-orthogonal correction.
+    Simple central-difference snGrad scheme using the cell-centre to cell-centre
+    delta-coefficients.
 
 SourceFiles
     orthogonalSnGrad.C
diff --git a/src/finiteVolume/finiteVolume/snGradSchemes/uncorrectedSnGrad/uncorrectedSnGrad.H b/src/finiteVolume/finiteVolume/snGradSchemes/uncorrectedSnGrad/uncorrectedSnGrad.H
index 0f587e827edfed97194595bf9884992b6fe075c1..ea903ad96856fa5197db0f28a59b22a128036000 100644
--- a/src/finiteVolume/finiteVolume/snGradSchemes/uncorrectedSnGrad/uncorrectedSnGrad.H
+++ b/src/finiteVolume/finiteVolume/snGradSchemes/uncorrectedSnGrad/uncorrectedSnGrad.H
@@ -28,7 +28,8 @@ Group
     grpFvSnGradSchemes
 
 Description
-    Simple central-difference snGrad scheme without non-orthogonal correction.
+    Simple central-difference snGrad scheme using the non-orthogonal mesh
+    delta-coefficients but without non-orthogonal correction.
 
 SourceFiles
     uncorrectedSnGrad.C
diff --git a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C
index 16270c07d5e5bf154bbda4427cbb25a86f76fcef..4c2ffb5a1f18bc3f11a3f0be6a21833d98738ec2 100644
--- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C
+++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C
@@ -30,7 +30,7 @@ License
 #include "coupledFvPatchFields.H"
 #include "UIndirectList.H"
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 template<class Type>
 template<class Type2>
diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToCell/globalIndexStencils/cellToCellStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/globalIndexStencils/cellToCellStencil.C
index ce21c3a6d27eb53b1d0153c0ad5d2e6be365a192..b6820ee887cb58c3a2a7a7f4d75958698b3dd1c2 100644
--- a/src/finiteVolume/fvMesh/extendedStencil/cellToCell/globalIndexStencils/cellToCellStencil.C
+++ b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/globalIndexStencils/cellToCellStencil.C
@@ -28,7 +28,7 @@ License
 #include "SortableList.H"
 #include "emptyPolyPatch.H"
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 void Foam::cellToCellStencil::merge
 (
diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.C
index d0534ea014665cea0b6e2e65d04d19d6a98cb8af..26713fdcfbe296618df9c070559832fc7c154d98 100644
--- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.C
+++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.C
@@ -32,11 +32,11 @@ License
 
 namespace Foam
 {
-defineTypeNameAndDebug(extendedCellToFaceStencil, 0);
+    defineTypeNameAndDebug(extendedCellToFaceStencil, 0);
 }
 
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 void Foam::extendedCellToFaceStencil::writeStencilStats
 (
diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.H
index c3c57bc7fd4a50963c359d9f52879b6b5b686e09..13852515ff5b171ce88dd557adf8fff150cffaf2 100644
--- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.H
+++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.H
@@ -72,7 +72,7 @@ protected:
         const polyMesh& mesh_;
 
 
-protected:
+    // Protected member functions
 
         //- Write some statistics about stencil
         static void writeStencilStats
@@ -82,6 +82,7 @@ protected:
             const mapDistribute& map
         );
 
+
 public:
 
     // Declare name of the class and its debug switch
diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/globalIndexStencils/cellToFaceStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/globalIndexStencils/cellToFaceStencil.C
index 2016ada0620a3e7ad3e8799df23ee06c3baac4c9..4b0aa39c00acbfec7fd7a2fd5182a5ce91ad5601 100644
--- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/globalIndexStencils/cellToFaceStencil.C
+++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/globalIndexStencils/cellToFaceStencil.C
@@ -29,7 +29,7 @@ License
 #include "syncTools.H"
 #include "dummyTransform.H"
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 void Foam::cellToFaceStencil::merge
 (
diff --git a/src/finiteVolume/fvMesh/fvBoundaryMesh/fvBoundaryMesh.C b/src/finiteVolume/fvMesh/fvBoundaryMesh/fvBoundaryMesh.C
index 27d76e2df029b997338368932cdb12afb862df26..dd33d2368b8b36cc079d679785b7a4bac5880007 100644
--- a/src/finiteVolume/fvMesh/fvBoundaryMesh/fvBoundaryMesh.C
+++ b/src/finiteVolume/fvMesh/fvBoundaryMesh/fvBoundaryMesh.C
@@ -131,6 +131,8 @@ Foam::lduInterfacePtrsList Foam::fvBoundaryMesh::interfaces() const
 }
 
 
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
+
 void Foam::fvBoundaryMesh::readUpdate(const polyBoundaryMesh& basicBdry)
 {
     clear();
diff --git a/src/finiteVolume/interpolation/interpolation/interpolationCellPoint/cellPointWeight/cellPointWeight.C b/src/finiteVolume/interpolation/interpolation/interpolationCellPoint/cellPointWeight/cellPointWeight.C
index 58c36623015c51c184e24f6757795475dbb84931..218644c3617e4cda730f4bacc6180e70a6c3bd66 100644
--- a/src/finiteVolume/interpolation/interpolation/interpolationCellPoint/cellPointWeight/cellPointWeight.C
+++ b/src/finiteVolume/interpolation/interpolation/interpolationCellPoint/cellPointWeight/cellPointWeight.C
@@ -33,7 +33,7 @@ int Foam::cellPointWeight::debug(debug::debugSwitch("cellPointWeight", 0));
 
 Foam::scalar Foam::cellPointWeight::tol(SMALL);
 
-// * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 void Foam::cellPointWeight::findTetrahedron
 (
diff --git a/src/finiteVolume/interpolation/interpolation/interpolationPointMVC/pointMVCWeight.C b/src/finiteVolume/interpolation/interpolation/interpolationPointMVC/pointMVCWeight.C
index 1a556ae56bae81d839d04253f72505413cd292a2..064bf94aea345e9fe3a4fa89faac176d326a89ef 100644
--- a/src/finiteVolume/interpolation/interpolation/interpolationPointMVC/pointMVCWeight.C
+++ b/src/finiteVolume/interpolation/interpolation/interpolationPointMVC/pointMVCWeight.C
@@ -36,7 +36,7 @@ namespace Foam
 Foam::scalar Foam::pointMVCWeight::tol(SMALL);
 
 
-// * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 void Foam::pointMVCWeight::calcWeights
 (
diff --git a/src/functionObjects/Allwmake b/src/functionObjects/Allwmake
index 56315084bb7d56a04059550aabca0c62a96d217b..073a57e3f5b06a60136b976379a54ceb65b6709e 100755
--- a/src/functionObjects/Allwmake
+++ b/src/functionObjects/Allwmake
@@ -3,7 +3,6 @@ cd ${0%/*} || exit 1    # Run from this directory
 
 # Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-set -x
 
 wmake $targetType field
 wmake $targetType forces
diff --git a/src/functionObjects/field/MachNo/MachNo.C b/src/functionObjects/field/MachNo/MachNo.C
index b3fbccee6fa12e3637212a624ffa85d2233279f4..190496e0713faa67183aa3dd40812e1de520fef4 100644
--- a/src/functionObjects/field/MachNo/MachNo.C
+++ b/src/functionObjects/field/MachNo/MachNo.C
@@ -52,11 +52,11 @@ bool Foam::functionObjects::MachNo::calc()
     if
     (
         foundObject<volVectorField>(fieldName_)
-     && mesh_.foundObject<fluidThermo>(fluidThermo::dictName)
+     && foundObject<fluidThermo>(fluidThermo::dictName)
     )
     {
         const fluidThermo& thermo =
-            mesh_.lookupObject<fluidThermo>(fluidThermo::dictName);
+            lookupObject<fluidThermo>(fluidThermo::dictName);
 
         const volVectorField& U = lookupObject<volVectorField>(fieldName_);
 
diff --git a/src/functionObjects/field/Make/files b/src/functionObjects/field/Make/files
index e8e4f79e4ea2dd00d83b3cf530d7bec97f780126..f23259eb67b3ce45e527c61f6ada3d13f388f172 100644
--- a/src/functionObjects/field/Make/files
+++ b/src/functionObjects/field/Make/files
@@ -51,6 +51,10 @@ blendingFactor/blendingFactor.C
 pressure/pressure.C
 MachNo/MachNo.C
 
+fieldsExpression/fieldsExpression.C
+add/add.C
+subtract/subtract.C
+
 turbulenceFields/turbulenceFields.C
 yPlus/yPlus.C
 wallShearStress/wallShearStress.C
diff --git a/src/functionObjects/field/add/add.C b/src/functionObjects/field/add/add.C
new file mode 100644
index 0000000000000000000000000000000000000000..88be04e7a6290b35edccfd3210a216cfc59ad12e
--- /dev/null
+++ b/src/functionObjects/field/add/add.C
@@ -0,0 +1,70 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+\*---------------------------------------------------------------------------*/
+
+#include "add.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace functionObjects
+{
+    defineTypeNameAndDebug(add, 0);
+    addToRunTimeSelectionTable(functionObject, add, dictionary);
+}
+}
+
+
+// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+
+bool Foam::functionObjects::add::calc()
+{
+    return calcAllTypes(*this);
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
+
+Foam::functionObjects::add::add
+(
+    const word& name,
+    const Time& runTime,
+    const dictionary& dict
+)
+:
+    fieldsExpression(name, runTime, dict)
+{
+    setResultName("add");
+}
+
+
+// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
+
+Foam::functionObjects::add::~add()
+{}
+
+
+// ************************************************************************* //
diff --git a/src/functionObjects/field/add/add.H b/src/functionObjects/field/add/add.H
new file mode 100644
index 0000000000000000000000000000000000000000..1198c2b0df0eb7c7fe521979a1d2125a44b2b2c1
--- /dev/null
+++ b/src/functionObjects/field/add/add.H
@@ -0,0 +1,129 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+Class
+    Foam::functionObjects::add
+
+Group
+    grpFieldFunctionObjects
+
+Description
+    Add a list of fields.
+
+    The operation can be applied to any volume or surface fields generating a
+    volume or surface scalar field.
+
+    Example of function object specification:
+    \verbatim
+    Ttot
+    {
+        type            add;
+        libs            ("libfieldFunctionObjects.so");
+        fields          (T Tdelta);
+        result          Ttot;
+        executeControl  writeTime;
+        writeControl    writeTime;
+    }
+    \endverbatim
+
+See also
+    Foam::functionObjects::fieldsExpression
+    Foam::functionObjects::fvMeshFunctionObject
+
+SourceFiles
+    add.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef functionObjects_add_H
+#define functionObjects_add_H
+
+#include "fieldsExpression.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace functionObjects
+{
+
+/*---------------------------------------------------------------------------*\
+                           Class add Declaration
+\*---------------------------------------------------------------------------*/
+
+class add
+:
+    public fieldsExpression
+{
+    // Private Member Functions
+
+        //- Add the list of fields of the specified type
+        //  and return the result
+        template<class GeoFieldType>
+        tmp<GeoFieldType> calcFieldType() const;
+
+        //- Add the list of fields and return true if successful
+        virtual bool calc();
+
+
+public:
+
+    friend class fieldsExpression;
+
+
+    //- Runtime type information
+    TypeName("add");
+
+
+    // Constructors
+
+        //- Construct from Time and dictionary
+        add
+        (
+            const word& name,
+            const Time& runTime,
+            const dictionary& dict
+        );
+
+
+    //- Destructor
+    virtual ~add();
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace functionObjects
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#ifdef NoRepository
+    #include "addTemplates.C"
+#endif
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/functionObjects/field/add/addTemplates.C b/src/functionObjects/field/add/addTemplates.C
new file mode 100644
index 0000000000000000000000000000000000000000..13b81af0efefe7a6af270e58ceaba513e0367beb
--- /dev/null
+++ b/src/functionObjects/field/add/addTemplates.C
@@ -0,0 +1,47 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+\*---------------------------------------------------------------------------*/
+
+// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+
+template<class GeoFieldType>
+Foam::tmp<GeoFieldType>
+Foam::functionObjects::add::calcFieldType() const
+{
+    tmp<GeoFieldType> tresult
+    (
+        lookupObject<GeoFieldType>(fieldNames_[0])
+      + lookupObject<GeoFieldType>(fieldNames_[1])
+    );
+
+    for (label i=2; i<fieldNames_.size(); i++)
+    {
+        tresult.ref() += lookupObject<GeoFieldType>(fieldNames_[i]);
+    }
+
+    return tresult;
+}
+
+
+// ************************************************************************* //
diff --git a/src/functionObjects/field/fieldAverage/fieldAverage.C b/src/functionObjects/field/fieldAverage/fieldAverage.C
index 46c30fbc973859f7faa505f2072aff4badb523f2..5ce702d66ae21860c62c831f28fd642f1cb1a9a6 100644
--- a/src/functionObjects/field/fieldAverage/fieldAverage.C
+++ b/src/functionObjects/field/fieldAverage/fieldAverage.C
@@ -40,7 +40,7 @@ namespace functionObjects
 }
 
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 void Foam::functionObjects::fieldAverage::resetFields()
 {
diff --git a/src/functionObjects/field/fieldAverage/fieldAverage.H b/src/functionObjects/field/fieldAverage/fieldAverage.H
index 31a4763bfa6be29a015a338edd37cd04f6632df1..20c8380d7eecb302e1115a2a795bb180309977da 100644
--- a/src/functionObjects/field/fieldAverage/fieldAverage.H
+++ b/src/functionObjects/field/fieldAverage/fieldAverage.H
@@ -189,7 +189,7 @@ protected:
             label periodIndex_;
 
 
-    // Private Member Functions
+    // Protected Member Functions
 
         // Initialisation routines
 
diff --git a/src/functionObjects/field/fieldAverage/fieldAverageTemplates.C b/src/functionObjects/field/fieldAverage/fieldAverageTemplates.C
index f5995f718a7df98f46ff787137e7fa82b6ddf8b1..fd6c50542d03b8c03bd96090bd5e2ce480bd1a53 100644
--- a/src/functionObjects/field/fieldAverage/fieldAverageTemplates.C
+++ b/src/functionObjects/field/fieldAverage/fieldAverageTemplates.C
@@ -213,11 +213,10 @@ void Foam::functionObjects::fieldAverage::calculateMeanFieldType
 
         if (faItems_[fieldi].iterBase())
         {
-            dt = 1.0;
+            dt = 1;
             Dt = scalar(totalIter_[fieldi]);
         }
 
-        scalar alpha = (Dt - dt)/Dt;
         scalar beta = dt/Dt;
 
         if (faItems_[fieldi].window() > 0)
@@ -226,12 +225,11 @@ void Foam::functionObjects::fieldAverage::calculateMeanFieldType
 
             if (Dt - dt >= w)
             {
-                alpha = (w - dt)/w;
                 beta = dt/w;
             }
         }
 
-        meanField = alpha*meanField + beta*baseField;
+        meanField = (1 - beta)*meanField + beta*baseField;
     }
 }
 
@@ -277,11 +275,10 @@ void Foam::functionObjects::fieldAverage::calculatePrime2MeanFieldType
 
         if (faItems_[fieldi].iterBase())
         {
-            dt = 1.0;
+            dt = 1;
             Dt = scalar(totalIter_[fieldi]);
         }
 
-        scalar alpha = (Dt - dt)/Dt;
         scalar beta = dt/Dt;
 
         if (faItems_[fieldi].window() > 0)
@@ -290,13 +287,12 @@ void Foam::functionObjects::fieldAverage::calculatePrime2MeanFieldType
 
             if (Dt - dt >= w)
             {
-                alpha = (w - dt)/w;
                 beta = dt/w;
             }
         }
 
         prime2MeanField =
-            alpha*prime2MeanField
+            (1 - beta)*prime2MeanField
           + beta*sqr(baseField)
           - sqr(meanField);
     }
@@ -316,11 +312,7 @@ void Foam::functionObjects::fieldAverage::calculatePrime2MeanFields() const
     {
         if (faItems_[i].prime2Mean())
         {
-            calculatePrime2MeanFieldType<VolFieldType1, VolFieldType2>
-            (
-                i
-            );
-
+            calculatePrime2MeanFieldType<VolFieldType1, VolFieldType2>(i);
             calculatePrime2MeanFieldType<SurfaceFieldType1, SurfaceFieldType2>
             (
                 i
diff --git a/src/functionObjects/field/fieldExpression/fieldExpression.C b/src/functionObjects/field/fieldExpression/fieldExpression.C
index d56bff0bdebf5ad48bcb207b6887aea9ae30a2f1..6bb432ca3d910e4c3ab40981b34ee0c3572d5450 100644
--- a/src/functionObjects/field/fieldExpression/fieldExpression.C
+++ b/src/functionObjects/field/fieldExpression/fieldExpression.C
@@ -39,13 +39,6 @@ namespace functionObjects
 
 // * * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * //
 
-bool Foam::functionObjects::fieldExpression::calc()
-{
-    NotImplemented;
-    return false;
-}
-
-
 void Foam::functionObjects::fieldExpression::setResultName
 (
     const word& typeName,
@@ -122,7 +115,7 @@ bool Foam::functionObjects::fieldExpression::execute()
     {
         Warning
             << "    functionObjects::" << type() << " " << name()
-            << " cannot find required field " << fieldName_ << endl;
+            << " failed to execute." << endl;
 
         // Clear the result field from the objectRegistry if present
         clear();
diff --git a/src/functionObjects/field/fieldExpression/fieldExpression.H b/src/functionObjects/field/fieldExpression/fieldExpression.H
index 56cd540469df258844b494ca28f4c32a7cee326d..0ae69f8aecceeae105e7dd749c13150b3ecfc71d 100644
--- a/src/functionObjects/field/fieldExpression/fieldExpression.H
+++ b/src/functionObjects/field/fieldExpression/fieldExpression.H
@@ -72,10 +72,13 @@ protected:
 
     // Protected member functions
 
-        virtual bool calc();
+        virtual bool calc() = 0;
 
         void setResultName(const word& typeName, const word& defaultArg);
 
+        template<class Type>
+        bool foundObject(const word& name);
+
 
 private:
 
@@ -134,6 +137,12 @@ public:
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
+#ifdef NoRepository
+    #include "fieldExpressionTemplates.C"
+#endif
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
 #endif
 
 // ************************************************************************* //
diff --git a/src/functionObjects/field/fieldExpression/fieldExpressionTemplates.C b/src/functionObjects/field/fieldExpression/fieldExpressionTemplates.C
new file mode 100644
index 0000000000000000000000000000000000000000..442834b6e5d68f9d8196035dbf9729db58e10280
--- /dev/null
+++ b/src/functionObjects/field/fieldExpression/fieldExpressionTemplates.C
@@ -0,0 +1,52 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+\*---------------------------------------------------------------------------*/
+
+#include "fieldExpression.H"
+
+// * * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * //
+
+template<class Type>
+bool Foam::functionObjects::fieldExpression::foundObject
+(
+    const word& name
+)
+{
+    if (fvMeshFunctionObject::foundObject<Type>(name))
+    {
+        return true;
+    }
+    else
+    {
+        Warning
+            << "    functionObjects::" << type() << " " << this->name()
+            << " cannot find required object " << name << " of type "
+            << Type::typeName << endl;
+
+        return false;
+    }
+}
+
+
+// ************************************************************************* //
diff --git a/src/functionObjects/field/fieldMinMax/fieldMinMax.C b/src/functionObjects/field/fieldMinMax/fieldMinMax.C
index c2f6b643a6333f72891d7a480bc2179dded645a0..491b05fb61f183bfde807f2f0e47a2f611ddfdb6 100644
--- a/src/functionObjects/field/fieldMinMax/fieldMinMax.C
+++ b/src/functionObjects/field/fieldMinMax/fieldMinMax.C
@@ -52,7 +52,7 @@ const Foam::NamedEnum
 > Foam::functionObjects::fieldMinMax::modeTypeNames_;
 
 
-// * * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 void Foam::functionObjects::fieldMinMax::writeFileHeader(Ostream& os) const
 {
diff --git a/src/functionObjects/field/fieldMinMax/fieldMinMax.H b/src/functionObjects/field/fieldMinMax/fieldMinMax.H
index 5196740be89be028fe712ad6474c3493cc6ce216..86d61d0d09963aaeb07b3b3a2deab6ea138a36eb 100644
--- a/src/functionObjects/field/fieldMinMax/fieldMinMax.H
+++ b/src/functionObjects/field/fieldMinMax/fieldMinMax.H
@@ -28,7 +28,7 @@ Group
     grpFieldFunctionObjects
 
 Description
-    Calculates the value and location of scalar minimim and maximum for a list
+    Calculates the value and location of scalar minimum and maximum for a list
     of user-specified fields.
 
     For variables with a rank greater than zero, either the min/max of a
@@ -127,7 +127,7 @@ protected:
         wordList fieldSet_;
 
 
-    // Private Member Functions
+    // Protected Member Functions
 
         //- Helper function to write the output
         template<class Type>
diff --git a/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValue.C b/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValue.C
index 578cf6884bd1be5d5ca673270268091eac4706a8..446a6440447d213eb9f1234ab6dc54421beeb611 100644
--- a/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValue.C
+++ b/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValue.C
@@ -97,7 +97,7 @@ const Foam::NamedEnum
 > Foam::functionObjects::fieldValues::surfaceFieldValue::operationTypeNames_;
 
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 void Foam::functionObjects::fieldValues::surfaceFieldValue::setFaceZoneFaces()
 {
diff --git a/src/functionObjects/field/fieldsExpression/fieldsExpression.C b/src/functionObjects/field/fieldsExpression/fieldsExpression.C
new file mode 100644
index 0000000000000000000000000000000000000000..482c1aa932e641fc525ea4cb9edaf1a3ccca2750
--- /dev/null
+++ b/src/functionObjects/field/fieldsExpression/fieldsExpression.C
@@ -0,0 +1,158 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+\*---------------------------------------------------------------------------*/
+
+#include "fieldsExpression.H"
+#include "dictionary.H"
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace functionObjects
+{
+    defineTypeNameAndDebug(fieldsExpression, 0);
+}
+}
+
+
+// * * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * //
+
+void Foam::functionObjects::fieldsExpression::setResultName
+(
+    const word& typeName,
+    const wordList& defaultArgs
+)
+{
+    if (fieldNames_.empty())
+    {
+        fieldNames_ = defaultArgs;
+    }
+
+    if (resultName_.empty())
+    {
+        if (!fieldNames_.empty())
+        {
+            resultName_ = typeName + '(' + fieldNames_[0];
+            for (label i=1; i<fieldNames_.size(); i++)
+            {
+                resultName_ += ',' + fieldNames_[i];
+            }
+            resultName_ += ')';
+        }
+        else
+        {
+            resultName_ = typeName;
+        }
+    }
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
+
+Foam::functionObjects::fieldsExpression::fieldsExpression
+(
+    const word& name,
+    const Time& runTime,
+    const dictionary& dict,
+    const wordList& fieldNames,
+    const word& resultName
+)
+:
+    fvMeshFunctionObject(name, runTime, dict),
+    fieldNames_(fieldNames),
+    resultName_(resultName)
+{
+    read(dict);
+
+    if (fieldNames_.size() < 2)
+    {
+        FatalIOErrorInFunction(dict)
+            << "functionObject::" << type() << " " << name
+            << " requires at least 2 fields only "
+            << fieldNames_.size() << " provided: " << fieldNames_
+            << exit(FatalIOError);
+    }
+}
+
+
+// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
+
+Foam::functionObjects::fieldsExpression::~fieldsExpression()
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
+
+bool Foam::functionObjects::fieldsExpression::read(const dictionary& dict)
+{
+    fvMeshFunctionObject::read(dict);
+
+    if (fieldNames_.empty() || dict.found("fields"))
+    {
+        dict.lookup("fields") >> fieldNames_;
+    }
+
+    if (dict.found("result"))
+    {
+        dict.lookup("result") >> resultName_;
+    }
+
+    return true;
+}
+
+
+bool Foam::functionObjects::fieldsExpression::execute()
+{
+    if (!calc())
+    {
+        Warning
+            << "    functionObjects::" << type() << " " << name()
+            << " cannot find required fields " << fieldNames_ << endl;
+
+        // Clear the result fields from the objectRegistry if present
+        clear();
+
+        return false;
+    }
+    else
+    {
+        return true;
+    }
+}
+
+
+bool Foam::functionObjects::fieldsExpression::write()
+{
+    return writeObject(resultName_);
+}
+
+
+bool Foam::functionObjects::fieldsExpression::clear()
+{
+    return clearObject(resultName_);
+}
+
+
+// ************************************************************************* //
diff --git a/src/functionObjects/field/fieldsExpression/fieldsExpression.H b/src/functionObjects/field/fieldsExpression/fieldsExpression.H
new file mode 100644
index 0000000000000000000000000000000000000000..da99ee331eac30de3efd88647012e831fe550456
--- /dev/null
+++ b/src/functionObjects/field/fieldsExpression/fieldsExpression.H
@@ -0,0 +1,162 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2012-2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+Class
+    Foam::functionObjects::fieldsExpression
+
+Group
+    grpFieldFunctionObjects
+
+Description
+
+See also
+    Foam::functionObjects::fvMeshFunctionObject
+
+SourceFiles
+    fieldsExpression.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef functionObjects_fieldsExpression_H
+#define functionObjects_fieldsExpression_H
+
+#include "fvMeshFunctionObject.H"
+#include "volFieldsFwd.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace functionObjects
+{
+
+/*---------------------------------------------------------------------------*\
+                         Class fieldsExpression Declaration
+\*---------------------------------------------------------------------------*/
+
+class fieldsExpression
+:
+    public fvMeshFunctionObject
+{
+protected:
+
+    // Protected member data
+
+        //- Names of fields to process
+        wordList fieldNames_;
+
+        //- Name of result fields
+        word resultName_;
+
+
+    // Protected member functions
+
+        void setResultName
+        (
+            const word& typeName,
+            const wordList& defaultArg = wordList::null()
+        );
+
+        //- Call 'calcFieldType' for the given functionObject
+        //  for 'volField' and 'surfaceField' field types
+        template<class Type, class FOType>
+        bool calcFieldTypes(FOType& fo);
+
+        //- Call 'calcFieldTypes' for the given 'Type' and functionObject
+        template<class Type, class FOType>
+        bool calcType(FOType& fo);
+
+        //- Call 'calcType' for the given functionObject
+        //  for each primitive type
+        template<class FOType>
+        bool calcAllTypes(FOType& fo);
+
+        virtual bool calc() = 0;
+
+
+private:
+
+    // Private Member Functions
+
+        //- Disallow default bitwise copy construct
+        fieldsExpression(const fieldsExpression&);
+
+        //- Disallow default bitwise assignment
+        void operator=(const fieldsExpression&);
+
+
+public:
+
+    //- Runtime type information
+    TypeName("fieldsExpression");
+
+
+    // Constructors
+
+        //- Construct from Time and dictionary
+        fieldsExpression
+        (
+            const word& name,
+            const Time& runTime,
+            const dictionary& dict,
+            const wordList& fieldNames = wordList::null(),
+            const word& resultName = word::null
+        );
+
+
+    //- Destructor
+    virtual ~fieldsExpression();
+
+
+    // Member Functions
+
+        //- Read the fieldsExpression data
+        virtual bool read(const dictionary&);
+
+        //- Calculate the result fields
+        virtual bool execute();
+
+        //- Write the result fields
+        virtual bool write();
+
+        //- Clear the result fields from the objectRegistry
+        virtual bool clear();
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace functionObjects
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#ifdef NoRepository
+    #include "fieldsExpressionTemplates.C"
+#endif
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/functionObjects/field/fieldsExpression/fieldsExpressionTemplates.C b/src/functionObjects/field/fieldsExpression/fieldsExpressionTemplates.C
new file mode 100644
index 0000000000000000000000000000000000000000..b9b3be11359d67230518659125f9575756f93507
--- /dev/null
+++ b/src/functionObjects/field/fieldsExpression/fieldsExpressionTemplates.C
@@ -0,0 +1,82 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+\*---------------------------------------------------------------------------*/
+
+#include "volFields.H"
+#include "surfaceFields.H"
+
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
+
+template<class Type, class FOType>
+bool Foam::functionObjects::fieldsExpression::calcFieldTypes(FOType& fo)
+{
+    typedef GeometricField<Type, fvPatchField, volMesh> VolFieldType;
+    typedef GeometricField<Type, fvsPatchField, surfaceMesh> SurfaceFieldType;
+
+    if (foundObject<VolFieldType>(fieldNames_[0]))
+    {
+        return store
+        (
+            resultName_,
+            fo.template calcFieldType<VolFieldType>()
+        );
+    }
+    else if (foundObject<SurfaceFieldType>(fieldNames_[0]))
+    {
+        return store
+        (
+            resultName_,
+            fo.template calcFieldType<SurfaceFieldType>()
+        );
+    }
+    else
+    {
+        return false;
+    }
+}
+
+
+template<class Type, class FOType>
+bool Foam::functionObjects::fieldsExpression::calcType(FOType& fo)
+{
+    return calcFieldTypes<Type>(fo);
+}
+
+
+template<class FOType>
+bool Foam::functionObjects::fieldsExpression::calcAllTypes(FOType& fo)
+{
+    bool processed = false;
+
+    processed = processed || fo.template calcType<scalar>(fo);
+    processed = processed || fo.template calcType<vector>(fo);
+    processed = processed || fo.template calcType<sphericalTensor>(fo);
+    processed = processed || fo.template calcType<symmTensor>(fo);
+    processed = processed || fo.template calcType<tensor>(fo);
+
+    return processed;
+}
+
+
+// ************************************************************************* //
diff --git a/src/functionObjects/field/grad/gradTemplates.C b/src/functionObjects/field/grad/gradTemplates.C
index fb505bb8b6f9de218c8445e7d19e8cf595702c12..d1ad033526adcb64e4396f88eb97fc88e66d597d 100644
--- a/src/functionObjects/field/grad/gradTemplates.C
+++ b/src/functionObjects/field/grad/gradTemplates.C
@@ -39,7 +39,7 @@ bool Foam::functionObjects::grad::calcGrad()
         (
             resultName_,
             fvc::grad(lookupObject<VolFieldType>(fieldName_)),
-            true
+            mesh_.changing() && mesh_.cache(resultName_)
         );
     }
     else if (foundObject<SurfaceFieldType>(fieldName_))
@@ -48,7 +48,7 @@ bool Foam::functionObjects::grad::calcGrad()
         (
             resultName_,
             fvc::grad(lookupObject<SurfaceFieldType>(fieldName_)),
-            true
+            mesh_.changing() && mesh_.cache(resultName_)
         );
     }
     else
diff --git a/src/functionObjects/field/nearWallFields/nearWallFields.C b/src/functionObjects/field/nearWallFields/nearWallFields.C
index 061aca85e974e041d74c8ed818ccac9c94089305..2744a95919b593b84740ad7934a0aaa602785745 100644
--- a/src/functionObjects/field/nearWallFields/nearWallFields.C
+++ b/src/functionObjects/field/nearWallFields/nearWallFields.C
@@ -42,7 +42,7 @@ namespace functionObjects
 }
 
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 void Foam::functionObjects::nearWallFields::calcAddressing()
 {
diff --git a/src/functionObjects/field/subtract/subtract.C b/src/functionObjects/field/subtract/subtract.C
new file mode 100644
index 0000000000000000000000000000000000000000..8405fd11fa94a14ba690f05ee78d819323a58a9a
--- /dev/null
+++ b/src/functionObjects/field/subtract/subtract.C
@@ -0,0 +1,70 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+\*---------------------------------------------------------------------------*/
+
+#include "subtract.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace functionObjects
+{
+    defineTypeNameAndDebug(subtract, 0);
+    addToRunTimeSelectionTable(functionObject, subtract, dictionary);
+}
+}
+
+
+// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+
+bool Foam::functionObjects::subtract::calc()
+{
+    return calcAllTypes(*this);
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
+
+Foam::functionObjects::subtract::subtract
+(
+    const word& name,
+    const Time& runTime,
+    const dictionary& dict
+)
+:
+    fieldsExpression(name, runTime, dict)
+{
+    setResultName("subtract");
+}
+
+
+// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
+
+Foam::functionObjects::subtract::~subtract()
+{}
+
+
+// ************************************************************************* //
diff --git a/src/functionObjects/field/subtract/subtract.H b/src/functionObjects/field/subtract/subtract.H
new file mode 100644
index 0000000000000000000000000000000000000000..6fb4aa7fd25ac1c9d743a291468e196f9b93bd81
--- /dev/null
+++ b/src/functionObjects/field/subtract/subtract.H
@@ -0,0 +1,129 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+Class
+    Foam::functionObjects::subtract
+
+Group
+    grpFieldFunctionObjects
+
+Description
+    From the first field subtract the remaining fields in the list.
+
+    The operation can be applied to any volume or surface fields generating a
+    volume or surface scalar field.
+
+    Example of function object specification:
+    \verbatim
+    Tdiff
+    {
+        type            subtract;
+        libs            ("libfieldFunctionObjects.so");
+        fields          (T Tmean);
+        result          Tdiff;
+        executeControl  writeTime;
+        writeControl    writeTime;
+    }
+    \endverbatim
+
+See also
+    Foam::functionObjects::fieldsExpression
+    Foam::functionObjects::fvMeshFunctionObject
+
+SourceFiles
+    subtract.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef functionObjects_subtract_H
+#define functionObjects_subtract_H
+
+#include "fieldsExpression.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace functionObjects
+{
+
+/*---------------------------------------------------------------------------*\
+                           Class subtract Declaration
+\*---------------------------------------------------------------------------*/
+
+class subtract
+:
+    public fieldsExpression
+{
+    // Private Member Functions
+
+        //- Subtract the list of fields of the specified type
+        //  and return the result
+        template<class GeoFieldType>
+        tmp<GeoFieldType> calcFieldType() const;
+
+        //- Subtract the list of fields and return true if successful
+        virtual bool calc();
+
+
+public:
+
+    friend class fieldsExpression;
+
+
+    //- Runtime type information
+    TypeName("subtract");
+
+
+    // Constructors
+
+        //- Construct from Time and dictionary
+        subtract
+        (
+            const word& name,
+            const Time& runTime,
+            const dictionary& dict
+        );
+
+
+    //- Destructor
+    virtual ~subtract();
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace functionObjects
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#ifdef NoRepository
+    #include "subtractTemplates.C"
+#endif
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/functionObjects/field/subtract/subtractTemplates.C b/src/functionObjects/field/subtract/subtractTemplates.C
new file mode 100644
index 0000000000000000000000000000000000000000..07aee1e98c8c89fd5ee14f943ed08fea066a31cd
--- /dev/null
+++ b/src/functionObjects/field/subtract/subtractTemplates.C
@@ -0,0 +1,47 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+\*---------------------------------------------------------------------------*/
+
+// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+
+template<class GeoFieldType>
+Foam::tmp<GeoFieldType>
+Foam::functionObjects::subtract::calcFieldType() const
+{
+    tmp<GeoFieldType> tresult
+    (
+        lookupObject<GeoFieldType>(fieldNames_[0])
+      - lookupObject<GeoFieldType>(fieldNames_[1])
+    );
+
+    for (label i=2; i<fieldNames_.size(); i++)
+    {
+        tresult.ref() -= lookupObject<GeoFieldType>(fieldNames_[i]);
+    }
+
+    return tresult;
+}
+
+
+// ************************************************************************* //
diff --git a/src/functionObjects/field/wallBoundedStreamLine/wallBoundedParticle.C b/src/functionObjects/field/wallBoundedStreamLine/wallBoundedParticle.C
index 1a36431ff3721b6a69db120c215b4e6c359eada9..f27d8603222ae1aa7ee7e93e5eea4f99e159bd93 100644
--- a/src/functionObjects/field/wallBoundedStreamLine/wallBoundedParticle.C
+++ b/src/functionObjects/field/wallBoundedStreamLine/wallBoundedParticle.C
@@ -33,7 +33,7 @@ const std::size_t Foam::wallBoundedParticle::sizeofFields_
 );
 
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 Foam::edge Foam::wallBoundedParticle::currentEdge() const
 {
diff --git a/src/functionObjects/utilities/codedFunctionObject/codedFunctionObject.C b/src/functionObjects/utilities/codedFunctionObject/codedFunctionObject.C
index 29c98a9126b94a98d5c1ff31cf6c0e00a8e87336..df771eb9bbde374e297c2ace61a3dcb20354d6cd 100644
--- a/src/functionObjects/utilities/codedFunctionObject/codedFunctionObject.C
+++ b/src/functionObjects/utilities/codedFunctionObject/codedFunctionObject.C
@@ -50,7 +50,7 @@ namespace functionObjects
 }
 }
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 void Foam::functionObjects::codedFunctionObject::prepare
 (
diff --git a/src/functionObjects/utilities/codedFunctionObject/codedFunctionObject.H b/src/functionObjects/utilities/codedFunctionObject/codedFunctionObject.H
index cb8b76feb0eefeb2089db0f079d075045119165c..f11c43d4b430c6caa9cbfef8f0452c7a980ab379 100644
--- a/src/functionObjects/utilities/codedFunctionObject/codedFunctionObject.H
+++ b/src/functionObjects/utilities/codedFunctionObject/codedFunctionObject.H
@@ -56,12 +56,11 @@ Usage
             // Lookup U
             const volVectorField& U = mesh().lookupObject<volVectorField>("U");
             // Write
-            mag(U).write();
-        }
+            mag(U)().write();
+        #};"
     }
     \endverbatim
 
-
 See also
     Foam::functionObject
     Foam::codedBase
diff --git a/src/functionObjects/utilities/timeActivatedFileUpdate/timeActivatedFileUpdate.C b/src/functionObjects/utilities/timeActivatedFileUpdate/timeActivatedFileUpdate.C
index 640fb58d103aefb545140843697c98872c00a6ea..8dc18591c65c6425f51e888de80d71cec5103022 100644
--- a/src/functionObjects/utilities/timeActivatedFileUpdate/timeActivatedFileUpdate.C
+++ b/src/functionObjects/utilities/timeActivatedFileUpdate/timeActivatedFileUpdate.C
@@ -65,7 +65,9 @@ void Foam::functionObjects::timeActivatedFileUpdate::updateFile()
         Log << nl << type() << ": copying file" << nl << timeVsFile_[i].second()
             << nl << "to:" << nl << fileToUpdate_ << nl << endl;
 
-        cp(timeVsFile_[i].second(), fileToUpdate_);
+        fileName destFile(fileToUpdate_ + Foam::name(pid()));
+        cp(timeVsFile_[i].second(), destFile);
+        mv(destFile, fileToUpdate_);
         lastIndex_ = i;
     }
 }
diff --git a/src/fvAgglomerationMethods/Allwmake b/src/fvAgglomerationMethods/Allwmake
index aac219e3378d9ed54414df041c9d8d21dd1b0c78..dcef4328c21f652e15f5793cb48fc400a22e364d 100755
--- a/src/fvAgglomerationMethods/Allwmake
+++ b/src/fvAgglomerationMethods/Allwmake
@@ -3,7 +3,6 @@ cd ${0%/*} || exit 1    # Run from this directory
 
 # Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-set -x
 
 export ParMGridGen=$WM_THIRD_PARTY_DIR/ParMGridGen-1.0
 
diff --git a/src/fvMotionSolver/Make/files b/src/fvMotionSolver/Make/files
index 19475e258b45772839a59aa3e15702d19f8418cf..550af29faa6caae7567af5d7d081ab5cca9d8aba 100644
--- a/src/fvMotionSolver/Make/files
+++ b/src/fvMotionSolver/Make/files
@@ -1,9 +1,6 @@
-fvMotionSolvers/fvMotionSolverCore/fvMotionSolverCore.C
+fvMotionSolvers/fvMotionSolver/fvMotionSolver.C
 fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.C
 fvMotionSolvers/displacement/laplacian/displacementLaplacianFvMotionSolver.C
-fvMotionSolvers/displacement/interpolation/displacementInterpolationMotionSolver.C
-fvMotionSolvers/displacement/layeredSolver/displacementLayeredMotionMotionSolver.C
-fvMotionSolvers/displacement/layeredSolver/pointEdgeStructuredWalk.C
 fvMotionSolvers/displacement/surfaceAlignedSBRStress/surfaceAlignedSBRStressFvMotionSolver.C
 
 fvMotionSolvers/componentDisplacement/componentLaplacian/displacementComponentLaplacianFvMotionSolver.C
diff --git a/src/fvMotionSolver/fvMotionSolvers/componentDisplacement/componentLaplacian/displacementComponentLaplacianFvMotionSolver.C b/src/fvMotionSolver/fvMotionSolvers/componentDisplacement/componentLaplacian/displacementComponentLaplacianFvMotionSolver.C
index b0efd536051895e9d9e2bdb5eaba85718e03bc20..a8c37d2c3046f33619eb19ada7a12b51dbed69b2 100644
--- a/src/fvMotionSolver/fvMotionSolvers/componentDisplacement/componentLaplacian/displacementComponentLaplacianFvMotionSolver.C
+++ b/src/fvMotionSolver/fvMotionSolvers/componentDisplacement/componentLaplacian/displacementComponentLaplacianFvMotionSolver.C
@@ -55,7 +55,7 @@ displacementComponentLaplacianFvMotionSolver
 )
 :
     componentDisplacementMotionSolver(mesh, dict, type()),
-    fvMotionSolverCore(mesh),
+    fvMotionSolver(mesh),
     cellDisplacement_
     (
         IOobject
diff --git a/src/fvMotionSolver/fvMotionSolvers/componentDisplacement/componentLaplacian/displacementComponentLaplacianFvMotionSolver.H b/src/fvMotionSolver/fvMotionSolvers/componentDisplacement/componentLaplacian/displacementComponentLaplacianFvMotionSolver.H
index bed5a61674f0c9adbc55d3e14712bc12034dfe5c..91cd122a2589edc714724b6bb258ceb38aa59bcc 100644
--- a/src/fvMotionSolver/fvMotionSolvers/componentDisplacement/componentLaplacian/displacementComponentLaplacianFvMotionSolver.H
+++ b/src/fvMotionSolver/fvMotionSolvers/componentDisplacement/componentLaplacian/displacementComponentLaplacianFvMotionSolver.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -40,7 +40,7 @@ SourceFiles
 #define displacementComponentLaplacianFvMotionSolver_H
 
 #include "componentDisplacementMotionSolver.H"
-#include "fvMotionSolverCore.H"
+#include "fvMotionSolver.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -58,7 +58,7 @@ class motionDiffusivity;
 class displacementComponentLaplacianFvMotionSolver
 :
     public componentDisplacementMotionSolver,
-    public fvMotionSolverCore
+    public fvMotionSolver
 {
     // Private data
 
diff --git a/src/fvMotionSolver/fvMotionSolvers/componentVelocity/componentLaplacian/velocityComponentLaplacianFvMotionSolver.C b/src/fvMotionSolver/fvMotionSolvers/componentVelocity/componentLaplacian/velocityComponentLaplacianFvMotionSolver.C
index 072918a0c3891527bb6d14944a958b45ca919acc..6facb081384786e181e2949df9fbecb933e14270 100644
--- a/src/fvMotionSolver/fvMotionSolvers/componentVelocity/componentLaplacian/velocityComponentLaplacianFvMotionSolver.C
+++ b/src/fvMotionSolver/fvMotionSolvers/componentVelocity/componentLaplacian/velocityComponentLaplacianFvMotionSolver.C
@@ -54,7 +54,7 @@ velocityComponentLaplacianFvMotionSolver
 )
 :
     componentVelocityMotionSolver(mesh, dict, typeName),
-    fvMotionSolverCore(mesh),
+    fvMotionSolver(mesh),
     cellMotionU_
     (
         IOobject
diff --git a/src/fvMotionSolver/fvMotionSolvers/componentVelocity/componentLaplacian/velocityComponentLaplacianFvMotionSolver.H b/src/fvMotionSolver/fvMotionSolvers/componentVelocity/componentLaplacian/velocityComponentLaplacianFvMotionSolver.H
index d4075ff93b58196af391033453701aef9372fe2e..35db5b256e7db9c285ed87584e43fbe466f0c8f4 100644
--- a/src/fvMotionSolver/fvMotionSolvers/componentVelocity/componentLaplacian/velocityComponentLaplacianFvMotionSolver.H
+++ b/src/fvMotionSolver/fvMotionSolvers/componentVelocity/componentLaplacian/velocityComponentLaplacianFvMotionSolver.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -40,7 +40,7 @@ SourceFiles
 #define velocityComponentLaplacianFvMotionSolver_H
 
 #include "componentVelocityMotionSolver.H"
-#include "fvMotionSolverCore.H"
+#include "fvMotionSolver.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -58,7 +58,7 @@ class motionDiffusivity;
 class velocityComponentLaplacianFvMotionSolver
 :
     public componentVelocityMotionSolver,
-    public fvMotionSolverCore
+    public fvMotionSolver
 {
     // Private data
 
@@ -121,7 +121,6 @@ public:
 
         //- Update topology
         virtual void updateMesh(const mapPolyMesh&);
-
 };
 
 
diff --git a/src/fvMotionSolver/fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.C b/src/fvMotionSolver/fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.C
index f1c71ae36c5e4ddeaf3d026040ce36d99b1e4d10..bc33e0cc8c16548c88051a086a3739157a17689e 100644
--- a/src/fvMotionSolver/fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.C
+++ b/src/fvMotionSolver/fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.C
@@ -65,7 +65,7 @@ Foam::displacementSBRStressFvMotionSolver::displacementSBRStressFvMotionSolver
 )
 :
     displacementMotionSolver(mesh, dict, dict.lookup("solver")),
-    fvMotionSolverCore(mesh),
+    fvMotionSolver(mesh),
     cellDisplacement_
     (
         IOobject
@@ -108,7 +108,7 @@ displacementSBRStressFvMotionSolver
 )
 :
     displacementMotionSolver(mesh, dict, pointDisplacement, points0, typeName),
-    fvMotionSolverCore(mesh),
+    fvMotionSolver(mesh),
     cellDisplacement_
     (
         IOobject
diff --git a/src/fvMotionSolver/fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.H b/src/fvMotionSolver/fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.H
index 5e4c7b64c1fc98ab6cf022673d8e7fa760b765a0..857e7e51d896b7453ec22961111d33788169f9c2 100644
--- a/src/fvMotionSolver/fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.H
+++ b/src/fvMotionSolver/fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -40,7 +40,7 @@ SourceFiles
 #define displacementSBRStressFvMotionSolver_H
 
 #include "displacementMotionSolver.H"
-#include "fvMotionSolverCore.H"
+#include "fvMotionSolver.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -58,7 +58,7 @@ class motionDiffusivity;
 class displacementSBRStressFvMotionSolver
 :
     public displacementMotionSolver,
-    public fvMotionSolverCore
+    public fvMotionSolver
 {
     // Private data
 
diff --git a/src/fvMotionSolver/fvMotionSolvers/displacement/laplacian/displacementLaplacianFvMotionSolver.C b/src/fvMotionSolver/fvMotionSolvers/displacement/laplacian/displacementLaplacianFvMotionSolver.C
index f4e78392cfce2e1b136e80a762b76d20cc7c4ce7..85c120136485d1c1d9889d8629f8cec53de47620 100644
--- a/src/fvMotionSolver/fvMotionSolvers/displacement/laplacian/displacementLaplacianFvMotionSolver.C
+++ b/src/fvMotionSolver/fvMotionSolvers/displacement/laplacian/displacementLaplacianFvMotionSolver.C
@@ -63,7 +63,7 @@ Foam::displacementLaplacianFvMotionSolver::displacementLaplacianFvMotionSolver
 )
 :
     displacementMotionSolver(mesh, dict, typeName),
-    fvMotionSolverCore(mesh),
+    fvMotionSolver(mesh),
     cellDisplacement_
     (
         IOobject
@@ -153,7 +153,7 @@ displacementLaplacianFvMotionSolver
 )
 :
     displacementMotionSolver(mesh, dict, pointDisplacement, points0, typeName),
-    fvMotionSolverCore(mesh),
+    fvMotionSolver(mesh),
     cellDisplacement_
     (
         IOobject
diff --git a/src/fvMotionSolver/fvMotionSolvers/displacement/laplacian/displacementLaplacianFvMotionSolver.H b/src/fvMotionSolver/fvMotionSolvers/displacement/laplacian/displacementLaplacianFvMotionSolver.H
index 1df49597a6b9fe9c230105a0e0114e0b1ed89887..3abc4cbf09450e14f239912339166adcf0b1b3aa 100644
--- a/src/fvMotionSolver/fvMotionSolvers/displacement/laplacian/displacementLaplacianFvMotionSolver.H
+++ b/src/fvMotionSolver/fvMotionSolvers/displacement/laplacian/displacementLaplacianFvMotionSolver.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -40,7 +40,7 @@ SourceFiles
 #define displacementLaplacianFvMotionSolver_H
 
 #include "displacementMotionSolver.H"
-#include "fvMotionSolverCore.H"
+#include "fvMotionSolver.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -58,7 +58,7 @@ class motionDiffusivity;
 class displacementLaplacianFvMotionSolver
 :
     public displacementMotionSolver,
-    public fvMotionSolverCore
+    public fvMotionSolver
 {
     // Private data
 
diff --git a/src/fvMotionSolver/fvMotionSolvers/fvMotionSolverCore/fvMotionSolverCore.C b/src/fvMotionSolver/fvMotionSolvers/fvMotionSolver/fvMotionSolver.C
similarity index 86%
rename from src/fvMotionSolver/fvMotionSolvers/fvMotionSolverCore/fvMotionSolverCore.C
rename to src/fvMotionSolver/fvMotionSolvers/fvMotionSolver/fvMotionSolver.C
index 3a1cc5273ffebcd1116e163ac2a4dcacba9e4882..e86d7b2472d8b35e52b91995d1b063bd3383d87f 100644
--- a/src/fvMotionSolver/fvMotionSolvers/fvMotionSolverCore/fvMotionSolverCore.C
+++ b/src/fvMotionSolver/fvMotionSolvers/fvMotionSolver/fvMotionSolver.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2012 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2012-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -23,19 +23,19 @@ License
 
 \*---------------------------------------------------------------------------*/
 
-#include "fvMotionSolverCore.H"
+#include "fvMotionSolver.H"
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
 namespace Foam
 {
-    defineTypeNameAndDebug(fvMotionSolverCore, 0);
+    defineTypeNameAndDebug(fvMotionSolver, 0);
 }
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
-Foam::fvMotionSolverCore::fvMotionSolverCore(const polyMesh& mesh)
+Foam::fvMotionSolver::fvMotionSolver(const polyMesh& mesh)
 :
     fvMesh_(refCast<const fvMesh>(mesh))
 {}
diff --git a/src/fvMotionSolver/fvMotionSolvers/fvMotionSolverCore/fvMotionSolverCore.H b/src/fvMotionSolver/fvMotionSolvers/fvMotionSolver/fvMotionSolver.H
similarity index 92%
rename from src/fvMotionSolver/fvMotionSolvers/fvMotionSolverCore/fvMotionSolverCore.H
rename to src/fvMotionSolver/fvMotionSolvers/fvMotionSolver/fvMotionSolver.H
index cea29b3112e7ba4806fbd2a3712579c4b9383722..02dd93a417e54a39b737774c003764de2590d2fb 100644
--- a/src/fvMotionSolver/fvMotionSolvers/fvMotionSolverCore/fvMotionSolverCore.H
+++ b/src/fvMotionSolver/fvMotionSolvers/fvMotionSolver/fvMotionSolver.H
@@ -22,18 +22,18 @@ License
     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 
 Class
-    Foam::fvMotionSolverCore
+    Foam::fvMotionSolver
 
 Description
     Base class for fvMesh based motionSolvers.
 
 SourceFiles
-    fvMotionSolverCore.C
+    fvMotionSolver.C
 
 \*---------------------------------------------------------------------------*/
 
-#ifndef fvMotionSolverCore_H
-#define fvMotionSolverCore_H
+#ifndef fvMotionSolver_H
+#define fvMotionSolver_H
 
 #include "fvMesh.H"
 
@@ -46,7 +46,7 @@ namespace Foam
                 Class velocityMotionSolver Declaration
 \*---------------------------------------------------------------------------*/
 
-class fvMotionSolverCore
+class fvMotionSolver
 {
 
 protected:
@@ -76,7 +76,7 @@ public:
     // Constructors
 
         //- Construct from polyMesh
-        fvMotionSolverCore(const polyMesh&);
+        fvMotionSolver(const polyMesh&);
 
 
     // Member Functions
@@ -96,7 +96,7 @@ public:
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 #ifdef NoRepository
-    #include "fvMotionSolverCoreTemplates.C"
+    #include "fvMotionSolverTemplates.C"
 #endif
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/fvMotionSolver/fvMotionSolvers/fvMotionSolverCore/fvMotionSolverCoreTemplates.C b/src/fvMotionSolver/fvMotionSolvers/fvMotionSolver/fvMotionSolverTemplates.C
similarity index 95%
rename from src/fvMotionSolver/fvMotionSolvers/fvMotionSolverCore/fvMotionSolverCoreTemplates.C
rename to src/fvMotionSolver/fvMotionSolvers/fvMotionSolver/fvMotionSolverTemplates.C
index 1a1d3697aad61480f8b40e9ca02d207a424a8527..8d1ba014d9118b7025fc0ae6ad900f0f6e13070e 100644
--- a/src/fvMotionSolver/fvMotionSolvers/fvMotionSolverCore/fvMotionSolverCoreTemplates.C
+++ b/src/fvMotionSolver/fvMotionSolvers/fvMotionSolver/fvMotionSolverTemplates.C
@@ -23,14 +23,14 @@ License
 
 \*---------------------------------------------------------------------------*/
 
-#include "fvMotionSolverCore.H"
+#include "fvMotionSolver.H"
 #include "fixedValuePointPatchFields.H"
 #include "cellMotionFvPatchFields.H"
 
 // * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 template<class Type>
-Foam::wordList Foam::fvMotionSolverCore::cellMotionBoundaryTypes
+Foam::wordList Foam::fvMotionSolver::cellMotionBoundaryTypes
 (
     const typename GeometricField<Type, pointPatchField, pointMesh>::
     Boundary& pmUbf
diff --git a/src/fvMotionSolver/fvMotionSolvers/velocity/laplacian/velocityLaplacianFvMotionSolver.C b/src/fvMotionSolver/fvMotionSolvers/velocity/laplacian/velocityLaplacianFvMotionSolver.C
index 2b6c50bfd2d8399c9ab20fadfe885cafe2585d4b..46e7f34e2d77550d88c45e18df2807c0902023d8 100644
--- a/src/fvMotionSolver/fvMotionSolvers/velocity/laplacian/velocityLaplacianFvMotionSolver.C
+++ b/src/fvMotionSolver/fvMotionSolvers/velocity/laplacian/velocityLaplacianFvMotionSolver.C
@@ -53,7 +53,7 @@ Foam::velocityLaplacianFvMotionSolver::velocityLaplacianFvMotionSolver
 )
 :
     velocityMotionSolver(mesh, dict, typeName),
-    fvMotionSolverCore(mesh),
+    fvMotionSolver(mesh),
     cellMotionU_
     (
         IOobject
diff --git a/src/fvMotionSolver/fvMotionSolvers/velocity/laplacian/velocityLaplacianFvMotionSolver.H b/src/fvMotionSolver/fvMotionSolvers/velocity/laplacian/velocityLaplacianFvMotionSolver.H
index af213a96756a9f57d8fb7183435514533b5de42e..457aee03d86d87a255141687ea276d2e942950ae 100644
--- a/src/fvMotionSolver/fvMotionSolvers/velocity/laplacian/velocityLaplacianFvMotionSolver.H
+++ b/src/fvMotionSolver/fvMotionSolvers/velocity/laplacian/velocityLaplacianFvMotionSolver.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -40,7 +40,7 @@ SourceFiles
 #define velocityLaplacianFvMotionSolver_H
 
 #include "velocityMotionSolver.H"
-#include "fvMotionSolverCore.H"
+#include "fvMotionSolver.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -58,7 +58,7 @@ class motionDiffusivity;
 class velocityLaplacianFvMotionSolver
 :
     public velocityMotionSolver,
-    public fvMotionSolverCore
+    public fvMotionSolver
 {
     // Private data
 
diff --git a/src/fvOptions/sources/derived/effectivenessHeatExchangerSource/effectivenessHeatExchangerSource.H b/src/fvOptions/sources/derived/effectivenessHeatExchangerSource/effectivenessHeatExchangerSource.H
index 92831a8c1d94b53b7ba99cc25bbff39b00564fe0..56afff2adb6d13c8e2ecf88aab32d264696bec8e 100644
--- a/src/fvOptions/sources/derived/effectivenessHeatExchangerSource/effectivenessHeatExchangerSource.H
+++ b/src/fvOptions/sources/derived/effectivenessHeatExchangerSource/effectivenessHeatExchangerSource.H
@@ -205,7 +205,6 @@ private:
 
     // Private Member Functions
 
-
         //- Disallow default bitwise copy construct
         effectivenessHeatExchangerSource
         (
diff --git a/src/fvOptions/sources/derived/meanVelocityForce/meanVelocityForce.C b/src/fvOptions/sources/derived/meanVelocityForce/meanVelocityForce.C
index 96cd17ce60d55a6ab779935a0a32eb6c5d103ad1..8581f53bb9b5a796fd8f71019d803665bd6ba2be 100644
--- a/src/fvOptions/sources/derived/meanVelocityForce/meanVelocityForce.C
+++ b/src/fvOptions/sources/derived/meanVelocityForce/meanVelocityForce.C
@@ -47,7 +47,7 @@ namespace fv
 }
 
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 void Foam::fv::meanVelocityForce::writeProps
 (
diff --git a/src/fvOptions/sources/general/codedSource/CodedSource.C b/src/fvOptions/sources/general/codedSource/CodedSource.C
index f29021c94be400cf66d87994c47834a3afc892f9..4611cd23174a545c6401fea75a83844b3fc8e2fa 100644
--- a/src/fvOptions/sources/general/codedSource/CodedSource.C
+++ b/src/fvOptions/sources/general/codedSource/CodedSource.C
@@ -29,7 +29,7 @@ License
 #include "dynamicCode.H"
 #include "dynamicCodeContext.H"
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 template<class Type>
 void Foam::fv::CodedSource<Type>::prepare
diff --git a/src/lagrangian/Allwmake b/src/lagrangian/Allwmake
index 3d09e66bf56c332b49abacd6a6e840a2301a9eb5..a70ae861ba0e324ddd00fb67616613dd6c236699 100755
--- a/src/lagrangian/Allwmake
+++ b/src/lagrangian/Allwmake
@@ -3,7 +3,6 @@ cd ${0%/*} || exit 1    # Run from this directory
 
 # Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-set -x
 
 wmake $targetType distributionModels
 wmake $targetType basic
diff --git a/src/lagrangian/basic/Cloud/Cloud.C b/src/lagrangian/basic/Cloud/Cloud.C
index 710e36bfd2837d72a0f7fc74b26e9e2dd978fa2d..4dd3558af7b8ef4d0a41480ef2de7c280b0512b8 100644
--- a/src/lagrangian/basic/Cloud/Cloud.C
+++ b/src/lagrangian/basic/Cloud/Cloud.C
@@ -258,7 +258,12 @@ void Foam::Cloud<ParticleType>::move(TrackData& td, const scalar trackTime)
             {
                 // If we are running in parallel and the particle is on a
                 // boundary face
-                if (Pstream::parRun() && p.face() >= pMesh().nInternalFaces())
+                if
+                (
+                    Pstream::parRun()
+                 && td.switchProcessor
+                 && p.face() >= pMesh().nInternalFaces()
+                )
                 {
                     label patchi = pbm.whichPatch(p.face());
 
diff --git a/src/lagrangian/distributionModels/Make/files b/src/lagrangian/distributionModels/Make/files
index c7b621cf58f61832e575a0e71ad3e27fcd990119..aee429b06c3dc8ab4bb6e37cd03a59d1a191ac48 100644
--- a/src/lagrangian/distributionModels/Make/files
+++ b/src/lagrangian/distributionModels/Make/files
@@ -7,6 +7,7 @@ general/general.C
 multiNormal/multiNormal.C
 normal/normal.C
 RosinRammler/RosinRammler.C
+massRosinRammler/massRosinRammler.C
 uniform/uniform.C
 
 LIB = $(FOAM_LIBBIN)/libdistributionModels
diff --git a/src/lagrangian/distributionModels/RosinRammler/RosinRammler.C b/src/lagrangian/distributionModels/RosinRammler/RosinRammler.C
index f2e5ac09657af49c238d698542de2f07184eaf09..2e5a04561975c6b33e0cd64c5bd0d8c4ea030098 100644
--- a/src/lagrangian/distributionModels/RosinRammler/RosinRammler.C
+++ b/src/lagrangian/distributionModels/RosinRammler/RosinRammler.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -30,11 +30,11 @@ License
 
 namespace Foam
 {
-    namespace distributionModels
-    {
-        defineTypeNameAndDebug(RosinRammler, 0);
-        addToRunTimeSelectionTable(distributionModel, RosinRammler, dictionary);
-    }
+namespace distributionModels
+{
+    defineTypeNameAndDebug(RosinRammler, 0);
+    addToRunTimeSelectionTable(distributionModel, RosinRammler, dictionary);
+}
 }
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/src/lagrangian/distributionModels/RosinRammler/RosinRammler.H b/src/lagrangian/distributionModels/RosinRammler/RosinRammler.H
index 64cc13ca3f929437e36acd51ac2e5791212ca40e..972a48d0470f81b28cc63f6c96eb23afb7ac055d 100644
--- a/src/lagrangian/distributionModels/RosinRammler/RosinRammler.H
+++ b/src/lagrangian/distributionModels/RosinRammler/RosinRammler.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -100,7 +100,7 @@ public:
 
     // Member Functions
 
-         //- Sample the distributionModel
+        //- Sample the distributionModel
         virtual scalar sample() const;
 
         //- Return the minimum value
diff --git a/src/lagrangian/distributionModels/distributionModel/distributionModel.H b/src/lagrangian/distributionModels/distributionModel/distributionModel.H
index fe5e876544984ceed14a32e2605f79f619ccd8a7..5e712e10eca22ea19d97b72b6369ef3641496ca9 100644
--- a/src/lagrangian/distributionModels/distributionModel/distributionModel.H
+++ b/src/lagrangian/distributionModels/distributionModel/distributionModel.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -36,6 +36,7 @@ Description
     - multi-normal
     - normal
     - Rosin-Rammler
+    - Mass-based Rosin-Rammler
     - uniform
 
     The distributionModel is tabulated in equidistant nPoints, in an interval.
diff --git a/src/lagrangian/distributionModels/exponential/exponential.C b/src/lagrangian/distributionModels/exponential/exponential.C
index 01298de33c54c99fb0a182a00ef3ef4e0a2cdfcf..013e5c39bb73678c948247343f2ed36576c5de5f 100644
--- a/src/lagrangian/distributionModels/exponential/exponential.C
+++ b/src/lagrangian/distributionModels/exponential/exponential.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -30,11 +30,11 @@ License
 
 namespace Foam
 {
-    namespace distributionModels
-    {
-        defineTypeNameAndDebug(exponential, 0);
-        addToRunTimeSelectionTable(distributionModel, exponential, dictionary);
-    }
+namespace distributionModels
+{
+    defineTypeNameAndDebug(exponential, 0);
+    addToRunTimeSelectionTable(distributionModel, exponential, dictionary);
+}
 }
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/src/lagrangian/distributionModels/exponential/exponential.H b/src/lagrangian/distributionModels/exponential/exponential.H
index 0bcadfc0b8a2d5213495345855cbe8f84da7c240..ff2473e2b9e5eb13d42ccf79831084f86069db22 100644
--- a/src/lagrangian/distributionModels/exponential/exponential.H
+++ b/src/lagrangian/distributionModels/exponential/exponential.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -93,7 +93,7 @@ public:
 
     // Member Functions
 
-         //- Sample the distributionModel
+        //- Sample the distributionModel
         virtual scalar sample() const;
 
         //- Return the minimum value
diff --git a/src/lagrangian/distributionModels/fixedValue/fixedValue.C b/src/lagrangian/distributionModels/fixedValue/fixedValue.C
index 048a9482f3090e648494ce7a48751bec9328ccfc..f8f0c234a9f555644214e0c05d4cbacbc7738e7b 100644
--- a/src/lagrangian/distributionModels/fixedValue/fixedValue.C
+++ b/src/lagrangian/distributionModels/fixedValue/fixedValue.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -30,11 +30,11 @@ License
 
 namespace Foam
 {
-    namespace distributionModels
-    {
-        defineTypeNameAndDebug(fixedValue, 0);
-        addToRunTimeSelectionTable(distributionModel, fixedValue, dictionary);
-    }
+namespace distributionModels
+{
+    defineTypeNameAndDebug(fixedValue, 0);
+    addToRunTimeSelectionTable(distributionModel, fixedValue, dictionary);
+}
 }
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/src/lagrangian/distributionModels/fixedValue/fixedValue.H b/src/lagrangian/distributionModels/fixedValue/fixedValue.H
index 3de10f43b621d24bcb6b6140118ee3b71c493c16..32fe917b56b0f0ace0803bc26a1be46be7bb924a 100644
--- a/src/lagrangian/distributionModels/fixedValue/fixedValue.H
+++ b/src/lagrangian/distributionModels/fixedValue/fixedValue.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -84,7 +84,7 @@ public:
 
     // Member Functions
 
-         //- Sample the distributionModel
+        //- Sample the distributionModel
         virtual scalar sample() const;
 
         //- Return the minimum value
diff --git a/src/lagrangian/distributionModels/general/general.C b/src/lagrangian/distributionModels/general/general.C
index 5199ff807454ff233bcc826581dc795e51a78ff3..78663997a117d2ab607c7be11eee2a012d5443cb 100644
--- a/src/lagrangian/distributionModels/general/general.C
+++ b/src/lagrangian/distributionModels/general/general.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -30,11 +30,11 @@ License
 
 namespace Foam
 {
-    namespace distributionModels
-    {
-        defineTypeNameAndDebug(general, 0);
-        addToRunTimeSelectionTable(distributionModel, general, dictionary);
-    }
+namespace distributionModels
+{
+    defineTypeNameAndDebug(general, 0);
+    addToRunTimeSelectionTable(distributionModel, general, dictionary);
+}
 }
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/src/lagrangian/distributionModels/massRosinRammler/massRosinRammler.C b/src/lagrangian/distributionModels/massRosinRammler/massRosinRammler.C
new file mode 100644
index 0000000000000000000000000000000000000000..015343b711794299f303dc0fbadf078201f978d9
--- /dev/null
+++ b/src/lagrangian/distributionModels/massRosinRammler/massRosinRammler.C
@@ -0,0 +1,114 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+\*---------------------------------------------------------------------------*/
+
+#include "massRosinRammler.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace distributionModels
+{
+    defineTypeNameAndDebug(massRosinRammler, 0);
+    addToRunTimeSelectionTable(distributionModel, massRosinRammler, dictionary);
+}
+}
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
+
+Foam::distributionModels::massRosinRammler::massRosinRammler
+(
+    const dictionary& dict,
+    cachedRandom& rndGen
+)
+:
+    distributionModel(typeName, dict, rndGen),
+    minValue_(readScalar(distributionModelDict_.lookup("minValue"))),
+    maxValue_(readScalar(distributionModelDict_.lookup("maxValue"))),
+    d_(readScalar(distributionModelDict_.lookup("d"))),
+    n_(readScalar(distributionModelDict_.lookup("n")))
+{
+    check();
+}
+
+
+Foam::distributionModels::massRosinRammler::massRosinRammler
+(
+    const massRosinRammler& p
+)
+:
+    distributionModel(p),
+    minValue_(p.minValue_),
+    maxValue_(p.maxValue_),
+    d_(p.d_),
+    n_(p.n_)
+{}
+
+
+// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
+
+Foam::distributionModels::massRosinRammler::~massRosinRammler()
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
+
+Foam::scalar Foam::distributionModels::massRosinRammler::sample() const
+{
+    scalar d;
+
+    // Re-sample if the calculated d is out of the physical range
+    do
+    {
+        const scalar a = 3/n_ + 1;
+        const scalar P = rndGen_.sample01<scalar>();
+        const scalar x = invIncGamma(a, P);
+        d = d_*pow(x, 1/n_);
+    } while (d < minValue_ || d > maxValue_);
+
+    return d;
+}
+
+
+Foam::scalar Foam::distributionModels::massRosinRammler::minValue() const
+{
+    return minValue_;
+}
+
+
+Foam::scalar Foam::distributionModels::massRosinRammler::maxValue() const
+{
+    return maxValue_;
+}
+
+
+Foam::scalar Foam::distributionModels::massRosinRammler::meanValue() const
+{
+    return d_;
+}
+
+
+// ************************************************************************* //
diff --git a/src/lagrangian/distributionModels/massRosinRammler/massRosinRammler.H b/src/lagrangian/distributionModels/massRosinRammler/massRosinRammler.H
new file mode 100644
index 0000000000000000000000000000000000000000..f1745326b676b439cdd8a321b313463a7c163109
--- /dev/null
+++ b/src/lagrangian/distributionModels/massRosinRammler/massRosinRammler.H
@@ -0,0 +1,137 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+Class
+    Foam::massRosinRammler
+
+Description
+    Mass-based Rosin-Rammler distributionModel.
+
+    Corrected form of the Rosin-Rammler distribution taking into account the
+    varying number of particels per parces for for fixed-mass parcels.  This
+    distribution should be used when
+    \verbatim
+        parcelBasisType mass;
+    \endverbatim
+
+    See equation 10 in reference:
+    \verbatim
+        Yoon, S. S., Hewson, J. C., DesJardin, P. E., Glaze, D. J.,
+        Black, A. R., & Skaggs, R. R. (2004).
+        Numerical modeling and experimental measurements of a high speed
+        solid-cone water spray for use in fire suppression applications.
+        International Journal of Multiphase Flow, 30(11), 1369-1388.
+    \endverbatim
+
+SourceFiles
+    massRosinRammler.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef massRosinRammler_H
+#define massRosinRammler_H
+
+#include "distributionModel.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace distributionModels
+{
+
+/*---------------------------------------------------------------------------*\
+                       Class massRosinRammler Declaration
+\*---------------------------------------------------------------------------*/
+
+class massRosinRammler
+:
+    public distributionModel
+{
+    // Private data
+
+        //- Distribution minimum
+        scalar minValue_;
+
+        //- Distribution maximum
+        scalar maxValue_;
+
+        //- Characteristic droplet size
+        scalar d_;
+
+        //- Empirical dimensionless constant to specify the distribution width,
+        //  sometimes referred to as the dispersion coefficient
+        scalar n_;
+
+
+public:
+
+    //- Runtime type information
+    TypeName("massRosinRammler");
+
+
+    // Constructors
+
+        //- Construct from components
+        massRosinRammler(const dictionary& dict, cachedRandom& rndGen);
+
+        //- Construct copy
+        massRosinRammler(const massRosinRammler& p);
+
+        //- Construct and return a clone
+        virtual autoPtr<distributionModel> clone() const
+        {
+            return autoPtr<distributionModel>(new massRosinRammler(*this));
+        }
+
+
+    //- Destructor
+    virtual ~massRosinRammler();
+
+
+    // Member Functions
+
+        //- Sample the distributionModel
+        virtual scalar sample() const;
+
+        //- Return the minimum value
+        virtual scalar minValue() const;
+
+        //- Return the maximum value
+        virtual scalar maxValue() const;
+
+        //- Return the mean value
+        virtual scalar meanValue() const;
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace distributionModels
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/lagrangian/distributionModels/multiNormal/multiNormal.C b/src/lagrangian/distributionModels/multiNormal/multiNormal.C
index 9a8bf423ec8d9304fe359edef2baa313743dd4fc..1cbb5a585639042b95b93f424378f71f233e4825 100644
--- a/src/lagrangian/distributionModels/multiNormal/multiNormal.C
+++ b/src/lagrangian/distributionModels/multiNormal/multiNormal.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -30,11 +30,11 @@ License
 
 namespace Foam
 {
-    namespace distributionModels
-    {
-        defineTypeNameAndDebug(multiNormal, 0);
-        addToRunTimeSelectionTable(distributionModel, multiNormal, dictionary);
-    }
+namespace distributionModels
+{
+    defineTypeNameAndDebug(multiNormal, 0);
+    addToRunTimeSelectionTable(distributionModel, multiNormal, dictionary);
+}
 }
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/src/lagrangian/distributionModels/normal/normal.C b/src/lagrangian/distributionModels/normal/normal.C
index a585ee59a1eb96913c544c806c9dafa0bf3aeae1..1fc16376a901492a01b9df75d8a7b8ffdef6e2ad 100644
--- a/src/lagrangian/distributionModels/normal/normal.C
+++ b/src/lagrangian/distributionModels/normal/normal.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -31,11 +31,11 @@ License
 
 namespace Foam
 {
-    namespace distributionModels
-    {
-        defineTypeNameAndDebug(normal, 0);
-        addToRunTimeSelectionTable(distributionModel, normal, dictionary);
-    }
+namespace distributionModels
+{
+    defineTypeNameAndDebug(normal, 0);
+    addToRunTimeSelectionTable(distributionModel, normal, dictionary);
+}
 }
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/src/lagrangian/distributionModels/uniform/uniform.C b/src/lagrangian/distributionModels/uniform/uniform.C
index 05f7a21befbef52e3d67badabd11dc2ad2aac205..72a0d2fc3ddb7cd339c3e703f462b28a8292dcde 100644
--- a/src/lagrangian/distributionModels/uniform/uniform.C
+++ b/src/lagrangian/distributionModels/uniform/uniform.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -30,11 +30,11 @@ License
 
 namespace Foam
 {
-    namespace distributionModels
-    {
-        defineTypeNameAndDebug(uniform, 0);
-        addToRunTimeSelectionTable(distributionModel, uniform, dictionary);
-    }
+namespace distributionModels
+{
+    defineTypeNameAndDebug(uniform, 0);
+    addToRunTimeSelectionTable(distributionModel, uniform, dictionary);
+}
 }
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/src/lagrangian/distributionModels/uniform/uniform.H b/src/lagrangian/distributionModels/uniform/uniform.H
index 21d0e1c14bdee9519d59c07223264acc7c54092e..20eb4a9c533ffd7f3475feb66599e8756c2e0caf 100644
--- a/src/lagrangian/distributionModels/uniform/uniform.H
+++ b/src/lagrangian/distributionModels/uniform/uniform.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -88,7 +88,7 @@ public:
 
     // Member Functions
 
-         //- Sample the distributionModel
+        //- Sample the distributionModel
         virtual scalar sample() const;
 
         //- Return the minimum value
diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C
index fa33bcce52f608d1651564b36200b313776d0099..5c65a074023826f2ff75e828dea092f368b1b8b3 100644
--- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C
+++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C
@@ -490,6 +490,8 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
 }
 
 
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
+
 template<class ParcelType>
 template<class TrackData>
 void Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation
diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.C
index 2d2ac4d45a85801f051e725bc6ddcf38d730cb2e..38e9684af65039e1ed3ef4006b0edc95876c1057 100644
--- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.C
+++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.C
@@ -74,6 +74,8 @@ void Foam::FacePostProcessing<CloudType>::makeLogFile
 }
 
 
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
+
 template<class CloudType>
 void Foam::FacePostProcessing<CloudType>::write()
 {
diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleCollector/ParticleCollector.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleCollector/ParticleCollector.C
index 8ea2b51386d3a29d1ed8d49fa4306889ddccc761..c559e3f5dfb62136f59c0dc3c5045e1373491eed 100644
--- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleCollector/ParticleCollector.C
+++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleCollector/ParticleCollector.C
@@ -385,6 +385,8 @@ void Foam::ParticleCollector<CloudType>::collectParcelConcentricCircles
 }
 
 
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
+
 template<class CloudType>
 void Foam::ParticleCollector<CloudType>::write()
 {
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C
index 38e324f3ecaa2e3e303b1df38d16c45bfca5ab7c..2adde529d777f8e1a73708d49fe60265862bce8d 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C
+++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C
@@ -169,7 +169,7 @@ bool Foam::InjectionModel<CloudType>::findCellAtPosition
             FatalErrorInFunction
                 << "Cannot find parcel injection cell. "
                 << "Parcel position = " << p0 << nl
-                << abort(FatalError);
+                << exit(FatalError);
         }
         else
         {
@@ -215,8 +215,8 @@ Foam::scalar Foam::InjectionModel<CloudType>::setNumberOfParticles
         {
             nP = 0.0;
             FatalErrorInFunction
-             << "Unknown parcelBasis type" << nl
-             << exit(FatalError);
+                << "Unknown parcelBasis type" << nl
+                << exit(FatalError);
         }
     }
 
@@ -358,8 +358,8 @@ Foam::InjectionModel<CloudType>::InjectionModel
     else
     {
         FatalErrorInFunction
-         << "parcelBasisType must be either 'number', 'mass' or 'fixed'" << nl
-         << exit(FatalError);
+            << "parcelBasisType must be either 'number', 'mass' or 'fixed'"
+            << nl << exit(FatalError);
     }
 }
 
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.C
index e9c4bc33e2873abb4089af450b705aa9f2241625..522725fdeb5aca893cae0d39d4910aa94611c185 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.C
+++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.C
@@ -28,6 +28,8 @@ License
 #include "SubField.H"
 #include "cachedRandom.H"
 #include "triPointRef.H"
+#include "volFields.H"
+#include "polyMeshTetDecomposition.H"
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
@@ -148,7 +150,7 @@ void Foam::patchInjectionBase::updateMesh(const polyMesh& mesh)
 
 void Foam::patchInjectionBase::setPositionAndCell
 (
-    const polyMesh& mesh,
+    const fvMesh& mesh,
     cachedRandom& rnd,
     vector& position,
     label& cellOwner,
@@ -174,25 +176,25 @@ void Foam::patchInjectionBase::setPositionAndCell
         if (Pstream::myProcNo() == proci)
         {
             // Find corresponding decomposed face triangle
-            label triI = 0;
+            label trii = 0;
             scalar offset = sumTriMagSf_[proci];
             forAllReverse(triCumulativeMagSf_, i)
             {
                 if (areaFraction > triCumulativeMagSf_[i] + offset)
                 {
-                    triI = i;
+                    trii = i;
                     break;
                 }
             }
 
             // Set cellOwner
-            label facei = triToFace_[triI];
+            label facei = triToFace_[trii];
             cellOwner = cellOwners_[facei];
 
             // Find random point in triangle
             const polyPatch& patch = mesh.boundaryMesh()[patchId_];
             const pointField& points = patch.points();
-            const face& tf = triFace_[triI];
+            const face& tf = triFace_[trii];
             const triPointRef tri(points[tf[0]], points[tf[1]], points[tf[2]]);
             const point pf(tri.randomPoint(rnd));
 
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.H
index 47c003b60b796a07633f0cc5c8c3962e336e54e7..2124b3acfc877b1e220a61f4d7d41312639b8a00 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.H
+++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.H
@@ -28,7 +28,7 @@ Description
     Base class for patch-based injection models.
 
     Class handles injecting at a random point adjacent to the patch faces to
-    provide a more stochsatic view of the injection process.  Patch faces are
+    provide a more stochastic view of the injection process.  Patch faces are
     triangulated, and area fractions accumulated.  The fractional areas are
     then applied to determine across which face a parcel is to be injected.
 
@@ -53,6 +53,7 @@ namespace Foam
 
 // Forward class declarations
 class polyMesh;
+class fvMesh;
 class cachedRandom;
 
 /*---------------------------------------------------------------------------*\
@@ -116,7 +117,7 @@ public:
         //- Set the injection position and owner cell, tetFace and tetPt
         virtual void setPositionAndCell
         (
-            const polyMesh& mesh,
+            const fvMesh& mesh,
             cachedRandom& rnd,
             vector& position,
             label& cellOwner,
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Drag/NonSphereDrag/NonSphereDragForce.C b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Drag/NonSphereDrag/NonSphereDragForce.C
index 3cbccc478734c44f27e0227f2cb909cc1a881af1..674d4b182414d87a3591d78565caf2d37afbbb06 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Drag/NonSphereDrag/NonSphereDragForce.C
+++ b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Drag/NonSphereDrag/NonSphereDragForce.C
@@ -25,7 +25,7 @@ License
 
 #include "NonSphereDragForce.H"
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 template<class CloudType>
 Foam::scalar Foam::NonSphereDragForce<CloudType>::CdRe(const scalar Re) const
diff --git a/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/AveragingMethod/AveragingMethod.C b/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/AveragingMethod/AveragingMethod.C
index c9c473a8395758a42381676d823b6bf57a00d00d..f6833065856ab21240a8724ee6f63a64841f14b7 100644
--- a/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/AveragingMethod/AveragingMethod.C
+++ b/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/AveragingMethod/AveragingMethod.C
@@ -27,6 +27,13 @@ License
 #include "runTimeSelectionTables.H"
 #include "pointMesh.H"
 
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
+
+template<class Type>
+void Foam::AveragingMethod<Type>::updateGrad()
+{}
+
+
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
 template<class Type>
@@ -106,15 +113,6 @@ Foam::AveragingMethod<Type>::~AveragingMethod()
 {}
 
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
-
-template<class Type>
-void Foam::AveragingMethod<Type>::updateGrad()
-{
-    // do nothing
-}
-
-
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
 template<class Type>
diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C
index eef6b78f394541c8707b3d91210687cb050d31a8..18136186b7b1059af1963782b2bf3b3376ce9cdb 100644
--- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C
+++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C
@@ -29,7 +29,7 @@ License
 
 using namespace Foam::constant::mathematical;
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 template<class CloudType>
 Foam::tmp<Foam::scalarField> Foam::LiquidEvaporation<CloudType>::calcXc
diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationBoil/LiquidEvaporationBoil.C b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationBoil/LiquidEvaporationBoil.C
index da98006d456f21b12b7d3aec7f86bde5f8d4f1d3..4836532061367b83f98ac6addaf7f75942f3dcd4 100644
--- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationBoil/LiquidEvaporationBoil.C
+++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationBoil/LiquidEvaporationBoil.C
@@ -29,7 +29,7 @@ License
 
 using namespace Foam::constant::mathematical;
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 template<class CloudType>
 Foam::tmp<Foam::scalarField> Foam::LiquidEvaporationBoil<CloudType>::calcXc
diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C b/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C
index 8ef554b1e5c11535b594557bf15bc4d750f77384..a47b35df94908d12dc50f21832e83b415d351d60 100644
--- a/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C
+++ b/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C
@@ -81,6 +81,8 @@ Foam::word Foam::ThermoSurfaceFilm<CloudType>::interactionTypeStr
 }
 
 
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
+
 template<class CloudType>
 Foam::vector Foam::ThermoSurfaceFilm<CloudType>::tangentVector
 (
diff --git a/src/lagrangian/molecularDynamics/Allwmake b/src/lagrangian/molecularDynamics/Allwmake
index 8a53eb6fb611efa362a386b8e86ab1ff2e0a7f05..c1221b264c932267017fe7a4801039e5f037e354 100755
--- a/src/lagrangian/molecularDynamics/Allwmake
+++ b/src/lagrangian/molecularDynamics/Allwmake
@@ -3,7 +3,6 @@ cd ${0%/*} || exit 1    # Run from this directory
 
 # Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-set -x
 
 wmake $targetType potential
 wmake $targetType molecularMeasurements
diff --git a/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotential.C b/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotential.C
index 8c3f8fa448ff300e0e61008dff0530416faed1fb..18724c978781b7e6e9cc07fa4657f6e0a3347492 100644
--- a/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotential.C
+++ b/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotential.C
@@ -35,8 +35,7 @@ namespace Foam
 }
 
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
-
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 void Foam::pairPotential::scaleEnergy(scalar& e, const scalar r) const
 {
diff --git a/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotential.H b/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotential.H
index e75eaf624e24f1b203be2209687d752e804ca255..cafa9a49a3cc2d5f1732746da22ae60549593680 100644
--- a/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotential.H
+++ b/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotential.H
@@ -60,7 +60,7 @@ class pairPotential
 
 protected:
 
-    // Protected data
+    // Protected member data
 
         word name_;
         dictionary pairPotentialProperties_;
@@ -79,7 +79,7 @@ protected:
         bool writeTables_;
 
 
-    // Private Member Functions
+    // Protected member functions
 
         void scaleEnergy(scalar& e, const scalar r) const;
 
@@ -93,7 +93,7 @@ protected:
 public:
 
     //- Runtime type information
-        TypeName("pairPotential");
+    TypeName("pairPotential");
 
 
     // Declare run-time constructor selection table
diff --git a/src/mesh/Allwmake b/src/mesh/Allwmake
index e0b125892841570047a77f0a1117122a5cb9daff..9aa9ba5bfcc7d030af4e9dcf45e8c5b5bef77e0f 100755
--- a/src/mesh/Allwmake
+++ b/src/mesh/Allwmake
@@ -3,7 +3,6 @@ cd ${0%/*} || exit 1    # Run from this directory
 
 # Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-set -x
 
 wmake $targetType snappyHexMesh
 wmake $targetType blockMesh
diff --git a/src/mesh/blockMesh/Make/files b/src/mesh/blockMesh/Make/files
index 53d856529db4de050e6ff3a378b61eda2cd65b0d..5831633613d88cf5e29a50861feeb48cad4aff5b 100644
--- a/src/mesh/blockMesh/Make/files
+++ b/src/mesh/blockMesh/Make/files
@@ -1,6 +1,7 @@
 blockVertices/blockVertex/blockVertex.C
 blockVertices/pointVertex/pointVertex.C
 blockVertices/projectVertex/projectVertex.C
+blockVertices/namedVertex/namedVertex.C
 
 blockEdges/bezier/bezier.C
 blockEdges/blockEdge/blockEdge.C
@@ -14,6 +15,7 @@ blockEdges/BSplineEdge/BSplineEdge.C
 blockEdges/splineEdge/CatmullRomSpline.C
 blockEdges/splineEdge/splineEdge.C
 blockEdges/projectEdge/projectEdge.C
+blockEdges/projectCurveEdge/projectCurveEdge.C
 
 blockFaces/blockFace/blockFace.C
 blockFaces/projectFace/projectFace.C
@@ -24,8 +26,9 @@ gradingDescriptor/gradingDescriptors.C
 blockDescriptor/blockDescriptor.C
 blockDescriptor/blockDescriptorEdges.C
 
-block/block.C
-block/blockCreate.C
+blocks/block/block.C
+blocks/block/blockCreate.C
+blocks/namedBlock/namedBlock.C
 
 blockMesh/blockMesh.C
 blockMesh/blockMeshCreate.C
@@ -34,4 +37,8 @@ blockMesh/blockMeshCheck.C
 blockMesh/blockMeshMerge.C
 blockMesh/blockMeshMergeFast.C
 
+blockMeshTools/blockMeshTools.C
+
+searchableExtrudedCircle/searchableExtrudedCircle.C
+
 LIB = $(FOAM_LIBBIN)/libblockMesh
diff --git a/src/mesh/blockMesh/Make/options b/src/mesh/blockMesh/Make/options
index bf6ca71abfb4c715b09e5ed1679f365702c55784..5467dc3ce38635ce1b666c5263855f795f66e302 100644
--- a/src/mesh/blockMesh/Make/options
+++ b/src/mesh/blockMesh/Make/options
@@ -1,9 +1,11 @@
 EXE_INC = \
     -I$(LIB_SRC)/meshTools/lnInclude \
     -I$(LIB_SRC)/fileFormats/lnInclude \
+    -I$(LIB_SRC)/edgeMesh/lnInclude \
     -I$(LIB_SRC)/surfMesh/lnInclude
 
 LIB_LIBS = \
     -lmeshTools \
     -lfileFormats \
+    -ledgeMesh \
     -lsurfMesh
diff --git a/src/mesh/blockMesh/blockDescriptor/blockDescriptor.C b/src/mesh/blockMesh/blockDescriptor/blockDescriptor.C
index fb9a413013b96eab4cb401f21335a6b16d896027..7593b3763e16bbe71e1a4663924269d1cd55fc7b 100644
--- a/src/mesh/blockMesh/blockDescriptor/blockDescriptor.C
+++ b/src/mesh/blockMesh/blockDescriptor/blockDescriptor.C
@@ -24,6 +24,7 @@ License
 \*---------------------------------------------------------------------------*/
 
 #include "blockDescriptor.H"
+#include "blockMeshTools.H"
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
 
@@ -164,6 +165,8 @@ Foam::blockDescriptor::blockDescriptor
 
 Foam::blockDescriptor::blockDescriptor
 (
+    const dictionary& dict,
+    const label index,
     const pointField& vertices,
     const blockEdgeList& edges,
     const blockFaceList& faces,
@@ -173,13 +176,24 @@ Foam::blockDescriptor::blockDescriptor
     vertices_(vertices),
     edges_(edges),
     faces_(faces),
-    blockShape_(is),
     density_(),
     expand_(12, gradingDescriptors()),
     zoneName_(),
     curvedFaces_(-1),
     nCurvedFaces_(0)
 {
+    // Read cell model and list of vertices (potentially with variables)
+    word model(is);
+    blockShape_ = cellShape
+    (
+        model,
+        blockMeshTools::read<label>
+        (
+            is,
+            dict.subOrEmptyDict("namedVertices")
+        )
+    );
+
     // Examine next token
     token t(is);
 
@@ -347,6 +361,25 @@ void Foam::blockDescriptor::correctFacePoints
 }
 
 
+void Foam::blockDescriptor::write
+(
+    Ostream& os,
+    const label val,
+    const dictionary& d
+)
+{
+    const dictionary* varDictPtr = d.subDictPtr("namedBlocks");
+    if (varDictPtr)
+    {
+        blockMeshTools::write(os, val, *varDictPtr);
+    }
+    else
+    {
+        os << val;
+    }
+}
+
+
 // * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
 
 Foam::Ostream& Foam::operator<<(Ostream& os, const blockDescriptor& bd)
diff --git a/src/mesh/blockMesh/blockDescriptor/blockDescriptor.H b/src/mesh/blockMesh/blockDescriptor/blockDescriptor.H
index b0f7b1412cfef83aa8dca994b71f5df70864ceee..e4d3b72cb91bfcb41c26fe084e76ec21152c96de 100644
--- a/src/mesh/blockMesh/blockDescriptor/blockDescriptor.H
+++ b/src/mesh/blockMesh/blockDescriptor/blockDescriptor.H
@@ -152,6 +152,8 @@ public:
         //- Construct from Istream
         blockDescriptor
         (
+            const dictionary& dict,
+            const label index,
             const pointField& vertices,
             const blockEdgeList&,
             const blockFaceList&,
@@ -161,6 +163,9 @@ public:
 
     // Member Functions
 
+        //- Reference to point field defining the block mesh
+        inline const pointField& vertices() const;
+
         //- Return reference to the list of curved faces
         inline const blockFaceList& faces() const;
 
@@ -233,6 +238,9 @@ public:
         //  to lie on the faces of the block
         void correctFacePoints(FixedList<pointField, 6>&) const;
 
+        //- Write block index with dictionary lookup
+        static void write(Ostream&, const label blocki, const dictionary&);
+
 
     // IOstream Operators
 
diff --git a/src/mesh/blockMesh/blockDescriptor/blockDescriptorI.H b/src/mesh/blockMesh/blockDescriptor/blockDescriptorI.H
index 823860a820d276c6693f745195d24c17bc17900a..13ec39c2e67f9798c2cbbd763439406c4012e742 100644
--- a/src/mesh/blockMesh/blockDescriptor/blockDescriptorI.H
+++ b/src/mesh/blockMesh/blockDescriptor/blockDescriptorI.H
@@ -25,6 +25,12 @@ License
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
+inline const Foam::pointField& Foam::blockDescriptor::vertices() const
+{
+    return vertices_;
+}
+
+
 inline const Foam::blockFaceList& Foam::blockDescriptor::faces() const
 {
     return faces_;
diff --git a/src/mesh/blockMesh/blockEdges/BSplineEdge/BSplineEdge.C b/src/mesh/blockMesh/blockEdges/BSplineEdge/BSplineEdge.C
index 4e16c18264c06d3925c628910180db9efefa51f1..dc62dbc3e4a47fb8a41b197c5adc7f633113e6d5 100644
--- a/src/mesh/blockMesh/blockEdges/BSplineEdge/BSplineEdge.C
+++ b/src/mesh/blockMesh/blockEdges/BSplineEdge/BSplineEdge.C
@@ -62,12 +62,14 @@ Foam::blockEdges::BSplineEdge::BSplineEdge
 
 Foam::blockEdges::BSplineEdge::BSplineEdge
 (
+    const dictionary& dict,
+    const label index,
     const searchableSurfaces& geometry,
     const pointField& points,
     Istream& is
 )
 :
-    blockEdge(points, is),
+    blockEdge(dict, index, points, is),
     BSpline(appendEndPoints(points, start_, end_, pointField(is)))
 {
     token t(is);
diff --git a/src/mesh/blockMesh/blockEdges/BSplineEdge/BSplineEdge.H b/src/mesh/blockMesh/blockEdges/BSplineEdge/BSplineEdge.H
index 81c06d63a79041d853429d2ae34fe04de6b748df..72cbeeab7ac9d31c2c05236c3d2aa35280f31b04 100644
--- a/src/mesh/blockMesh/blockEdges/BSplineEdge/BSplineEdge.H
+++ b/src/mesh/blockMesh/blockEdges/BSplineEdge/BSplineEdge.H
@@ -83,6 +83,8 @@ public:
         //- Construct from Istream, setting pointsList
         BSplineEdge
         (
+            const dictionary& dict,
+            const label index,
             const searchableSurfaces& geometry,
             const pointField&,
             Istream&
diff --git a/src/mesh/blockMesh/blockEdges/arcEdge/arcEdge.C b/src/mesh/blockMesh/blockEdges/arcEdge/arcEdge.C
index 5d012e0531c35ebe7adae77608e9e55afc5e0443..793cc27b2f58e3eda49e5245cb502aa3b685a1ca 100644
--- a/src/mesh/blockMesh/blockEdges/arcEdge/arcEdge.C
+++ b/src/mesh/blockMesh/blockEdges/arcEdge/arcEdge.C
@@ -123,12 +123,14 @@ Foam::blockEdges::arcEdge::arcEdge
 
 Foam::blockEdges::arcEdge::arcEdge
 (
+    const dictionary& dict,
+    const label index,
     const searchableSurfaces& geometry,
     const pointField& points,
     Istream& is
 )
 :
-    blockEdge(points, is),
+    blockEdge(dict, index, points, is),
     p1_(points_[start_]),
     p2_(is),
     p3_(points_[end_]),
diff --git a/src/mesh/blockMesh/blockEdges/arcEdge/arcEdge.H b/src/mesh/blockMesh/blockEdges/arcEdge/arcEdge.H
index 4406ec40a11f6c0851b1af7666fc7821738d9a56..260e5dc7bb4da21c43246ffff1530eb35bd010a6 100644
--- a/src/mesh/blockMesh/blockEdges/arcEdge/arcEdge.H
+++ b/src/mesh/blockMesh/blockEdges/arcEdge/arcEdge.H
@@ -92,6 +92,8 @@ public:
         //- Construct from Istream setting pointsList
         arcEdge
         (
+            const dictionary& dict,
+            const label index,
             const searchableSurfaces& geometry,
             const pointField& points,
             Istream&
diff --git a/src/mesh/blockMesh/blockEdges/blockEdge/blockEdge.C b/src/mesh/blockMesh/blockEdges/blockEdge/blockEdge.C
index 4ed2647a741782235ee66daf06059a75a9adb30f..12f63a3057d33f6c14f708305e7120dd09aa9ea4 100644
--- a/src/mesh/blockMesh/blockEdges/blockEdge/blockEdge.C
+++ b/src/mesh/blockMesh/blockEdges/blockEdge/blockEdge.C
@@ -24,6 +24,7 @@ License
 \*---------------------------------------------------------------------------*/
 
 #include "blockEdge.H"
+#include "blockVertex.H"
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
@@ -51,13 +52,15 @@ Foam::blockEdge::blockEdge
 
 Foam::blockEdge::blockEdge
 (
+    const dictionary& dict,
+    const label index,
     const pointField& points,
     Istream& is
 )
 :
     points_(points),
-    start_(readLabel(is)),
-    end_(readLabel(is))
+    start_(blockVertex::read(is, dict)),
+    end_(blockVertex::read(is, dict))
 {}
 
 
@@ -70,6 +73,8 @@ Foam::autoPtr<Foam::blockEdge> Foam::blockEdge::clone() const
 
 Foam::autoPtr<Foam::blockEdge> Foam::blockEdge::New
 (
+    const dictionary& dict,
+    const label index,
     const searchableSurfaces& geometry,
     const pointField& points,
     Istream& is
@@ -95,7 +100,7 @@ Foam::autoPtr<Foam::blockEdge> Foam::blockEdge::New
             << abort(FatalError);
     }
 
-    return autoPtr<blockEdge>(cstrIter()(geometry, points, is));
+    return autoPtr<blockEdge>(cstrIter()(dict, index, geometry, points, is));
 }
 
 
@@ -139,6 +144,15 @@ Foam::blockEdge::position(const scalarList& lambdas) const
 }
 
 
+void Foam::blockEdge::write(Ostream& os, const dictionary& d) const
+{
+    blockVertex::write(os, start_, d);
+    os << tab;
+    blockVertex::write(os, end_, d);
+    os << endl;
+}
+
+
 // * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
 
 Foam::Ostream& Foam::operator<<(Ostream& os, const blockEdge& p)
diff --git a/src/mesh/blockMesh/blockEdges/blockEdge/blockEdge.H b/src/mesh/blockMesh/blockEdges/blockEdge/blockEdge.H
index e6e3196ea94a3981245aff19e4368af12e1550ce..bde77adbc29b4feee21aa483a361e84e30a27153 100644
--- a/src/mesh/blockMesh/blockEdges/blockEdge/blockEdge.H
+++ b/src/mesh/blockMesh/blockEdges/blockEdge/blockEdge.H
@@ -92,11 +92,13 @@ public:
             blockEdge,
             Istream,
             (
+                const dictionary& dict,
+                const label index,
                 const searchableSurfaces& geometry,
                 const pointField& points,
                 Istream& is
             ),
-            (geometry, points, is)
+            (dict, index, geometry, points, is)
         );
 
 
@@ -113,6 +115,8 @@ public:
         //- Construct from Istream setting pointsList
         blockEdge
         (
+            const dictionary& dict,
+            const label index,
             const pointField&,
             Istream&
         );
@@ -123,6 +127,8 @@ public:
         //- New function which constructs and returns pointer to a blockEdge
         static autoPtr<blockEdge> New
         (
+            const dictionary& dict,
+            const label index,
             const searchableSurfaces& geometry,
             const pointField&,
             Istream&
@@ -132,20 +138,29 @@ public:
         //  PtrLists of blockEdge
         class iNew
         {
+            const dictionary& dict_;
             const searchableSurfaces& geometry_;
             const pointField& points_;
+            mutable label index_;
 
         public:
 
-            iNew(const searchableSurfaces& geometry, const pointField& points)
+            iNew
+            (
+                const dictionary& dict,
+                const searchableSurfaces& geometry,
+                const pointField& points
+            )
             :
+                dict_(dict),
                 geometry_(geometry),
-                points_(points)
+                points_(points),
+                index_(0)
             {}
 
             autoPtr<blockEdge> operator()(Istream& is) const
             {
-                return blockEdge::New(geometry_, points_, is);
+                return blockEdge::New(dict_, index_++, geometry_, points_, is);
             }
         };
 
@@ -195,6 +210,9 @@ public:
         //- Return the length of the curve
         virtual scalar length() const = 0;
 
+        //- Write edge with variable backsubstitution
+        void write(Ostream&, const dictionary&) const;
+
 
     // Ostream operator
 
diff --git a/src/mesh/blockMesh/blockEdges/lineEdge/lineEdge.C b/src/mesh/blockMesh/blockEdges/lineEdge/lineEdge.C
index 45b4434850a1f3cb5964e86836c08aa143e2e25a..9206151f56223b0e7809cff921f36a4e7aeaca6e 100644
--- a/src/mesh/blockMesh/blockEdges/lineEdge/lineEdge.C
+++ b/src/mesh/blockMesh/blockEdges/lineEdge/lineEdge.C
@@ -53,12 +53,14 @@ Foam::blockEdges::lineEdge::lineEdge
 
 Foam::blockEdges::lineEdge::lineEdge
 (
+    const dictionary& dict,
+    const label index,
     const searchableSurfaces& geometry,
     const pointField& points,
     Istream& is
 )
 :
-    blockEdge(points, is)
+    blockEdge(dict, index, points, is)
 {}
 
 
diff --git a/src/mesh/blockMesh/blockEdges/lineEdge/lineEdge.H b/src/mesh/blockMesh/blockEdges/lineEdge/lineEdge.H
index e70ffd10bf79477159eaa3e3ed15729963361200..c5266b28c3d2c49d4e7c70c9a4a3c8894db25d94 100644
--- a/src/mesh/blockMesh/blockEdges/lineEdge/lineEdge.H
+++ b/src/mesh/blockMesh/blockEdges/lineEdge/lineEdge.H
@@ -68,6 +68,8 @@ public:
         //- Construct from Istream with a pointField
         lineEdge
         (
+            const dictionary& dict,
+            const label index,
             const searchableSurfaces& geometry,
             const pointField&,
             Istream&
diff --git a/src/mesh/blockMesh/blockEdges/polyLineEdge/polyLine.C b/src/mesh/blockMesh/blockEdges/polyLineEdge/polyLine.C
index ac7572f59534b2454387b461e6a08cecc33ad5e3..a54b2f790e3c70fc7b7493b2d0d3dd8b31f69d16 100644
--- a/src/mesh/blockMesh/blockEdges/polyLineEdge/polyLine.C
+++ b/src/mesh/blockMesh/blockEdges/polyLineEdge/polyLine.C
@@ -25,7 +25,7 @@ License
 
 #include "polyLine.H"
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 void Foam::polyLine::calcParam()
 {
diff --git a/src/mesh/blockMesh/blockEdges/polyLineEdge/polyLineEdge.C b/src/mesh/blockMesh/blockEdges/polyLineEdge/polyLineEdge.C
index 1396636a66f62ebe1ed0be3d969e712e52a169d3..63e8fb4d00be11e19a900ed9dd7a542fad7b1499 100644
--- a/src/mesh/blockMesh/blockEdges/polyLineEdge/polyLineEdge.C
+++ b/src/mesh/blockMesh/blockEdges/polyLineEdge/polyLineEdge.C
@@ -55,12 +55,14 @@ Foam::blockEdges::polyLineEdge::polyLineEdge
 
 Foam::blockEdges::polyLineEdge::polyLineEdge
 (
+    const dictionary& dict,
+    const label index,
     const searchableSurfaces& geometry,
     const pointField& ps,
     Istream& is
 )
 :
-    blockEdge(ps, is),
+    blockEdge(dict, index, ps, is),
     polyLine(appendEndPoints(ps, start_, end_, pointField(is)))
 {}
 
diff --git a/src/mesh/blockMesh/blockEdges/polyLineEdge/polyLineEdge.H b/src/mesh/blockMesh/blockEdges/polyLineEdge/polyLineEdge.H
index adcd7fd1b47c641467ad89d1c2513da007bbef9d..62e42ca31c302916bec0d0ebd0708f0141dbf69c 100644
--- a/src/mesh/blockMesh/blockEdges/polyLineEdge/polyLineEdge.H
+++ b/src/mesh/blockMesh/blockEdges/polyLineEdge/polyLineEdge.H
@@ -83,6 +83,8 @@ public:
         //- Construct from Istream
         polyLineEdge
         (
+            const dictionary& dict,
+            const label index,
             const searchableSurfaces& geometry,
             const pointField&,
             Istream&
diff --git a/src/mesh/blockMesh/blockEdges/projectCurveEdge/projectCurveEdge.C b/src/mesh/blockMesh/blockEdges/projectCurveEdge/projectCurveEdge.C
new file mode 100644
index 0000000000000000000000000000000000000000..cf49d9ce5997c6370cc316407c3bc8a0a2e83437
--- /dev/null
+++ b/src/mesh/blockMesh/blockEdges/projectCurveEdge/projectCurveEdge.C
@@ -0,0 +1,258 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+\*---------------------------------------------------------------------------*/
+
+#include "searchableSurfacesQueries.H"
+#include "projectCurveEdge.H"
+#include "unitConversion.H"
+#include "addToRunTimeSelectionTable.H"
+#include "pointConstraint.H"
+#include "OBJstream.H"
+#include "linearInterpolationWeights.H"
+#include "searchableExtrudedCircle.H"
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+namespace Foam
+{
+    defineTypeNameAndDebug(projectCurveEdge, 0);
+    addToRunTimeSelectionTable(blockEdge, projectCurveEdge, Istream);
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
+
+Foam::projectCurveEdge::projectCurveEdge
+(
+    const dictionary& dict,
+    const label index,
+    const searchableSurfaces& geometry,
+    const pointField& points,
+    Istream& is
+)
+:
+    blockEdge(dict, index, points, is),
+    geometry_(geometry)
+{
+    wordList names(is);
+    surfaces_.setSize(names.size());
+    forAll(names, i)
+    {
+        surfaces_[i] = geometry_.findSurfaceID(names[i]);
+
+        if (surfaces_[i] == -1)
+        {
+            FatalIOErrorInFunction(is)
+                << "Cannot find surface " << names[i] << " in geometry"
+                << exit(FatalIOError);
+        }
+
+        if (isA<searchableExtrudedCircle>(geometry_[surfaces_[i]]))
+        {
+            Info<< type() << " : Using curved surface "
+                << geometry_[surfaces_[i]].name()
+                << " to predict starting points." << endl;
+        }
+    }
+}
+
+
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
+
+Foam::tmp<Foam::pointField>
+Foam::projectCurveEdge::position(const scalarList& lambdas) const
+{
+    // For debugging to tag the output
+    static label eIter = 0;
+
+    autoPtr<OBJstream> debugStr;
+    if (debug)
+    {
+        debugStr.reset
+        (
+            new OBJstream("projectCurveEdge_" + Foam::name(eIter++) + ".obj")
+        );
+        Info<< "Writing lines from straight-line start points"
+            << " to projected points to " << debugStr().name() << endl;
+    }
+
+
+    tmp<pointField> tpoints(new pointField(lambdas.size()));
+    pointField& points = tpoints.ref();
+
+    const point& startPt = points_[start_];
+    const point& endPt = points_[end_];
+    const vector d = endPt-startPt;
+
+    // Initial guess
+    forAll(lambdas, i)
+    {
+        points[i] = startPt+lambdas[i]*d;
+    }
+
+    // Use special interpolation to keep initial guess on same position on
+    // surface
+    forAll(surfaces_, i)
+    {
+        if (isA<searchableExtrudedCircle>(geometry_[surfaces_[i]]))
+        {
+            const searchableExtrudedCircle& s =
+            refCast<const searchableExtrudedCircle>
+            (
+                geometry_[surfaces_[i]]
+            );
+            List<pointIndexHit> nearInfo;
+            s.findParametricNearest
+            (
+                points[0],
+                points.last(),
+                scalarField(lambdas),
+                scalarField(points.size(), magSqr(d)),
+                nearInfo
+            );
+            forAll(nearInfo, i)
+            {
+                if (nearInfo[i].hit())
+                {
+                    points[i] = nearInfo[i].hitPoint();
+                }
+            }
+
+            break;
+        }
+    }
+
+
+
+    // Upper limit for number of iterations
+    const label maxIter = 10;
+    // Residual tolerance
+    const scalar relTol = 0.1;
+    const scalar absTol = 1e-4;
+
+    scalar initialResidual = 0.0;
+
+    for (label iter = 0; iter < maxIter; iter++)
+    {
+        // Do projection
+        {
+            List<pointConstraint> constraints(lambdas.size());
+            pointField start(points);
+            searchableSurfacesQueries::findNearest
+            (
+                geometry_,
+                surfaces_,
+                start,
+                scalarField(start.size(), magSqr(d)),
+                points,
+                constraints
+            );
+
+            // Reset start and end point
+            if (lambdas[0] < SMALL)
+            {
+                points[0] = startPt;
+            }
+            if (lambdas.last() > 1.0-SMALL)
+            {
+                points.last() = endPt;
+            }
+
+            if (debugStr.valid())
+            {
+                forAll(points, i)
+                {
+                    debugStr().write(linePointRef(start[i], points[i]));
+                }
+            }
+        }
+
+        // Calculate lambdas (normalised coordinate along edge)
+        scalarField projLambdas(points.size());
+        {
+            projLambdas[0] = 0.0;
+            for (label i = 1; i < points.size(); i++)
+            {
+                projLambdas[i] = projLambdas[i-1] + mag(points[i]-points[i-1]);
+            }
+            projLambdas /= projLambdas.last();
+        }
+        linearInterpolationWeights interpolator(projLambdas);
+
+        // Compare actual distances and move points (along straight line;
+        // not along surface)
+        vectorField residual(points.size(), vector::zero);
+        labelList indices;
+        scalarField weights;
+        for (label i = 1; i < points.size() - 1; i++)
+        {
+            interpolator.valueWeights(lambdas[i], indices, weights);
+
+            point predicted = vector::zero;
+            forAll(indices, indexi)
+            {
+                predicted += weights[indexi]*points[indices[indexi]];
+            }
+            residual[i] = predicted-points[i];
+        }
+
+        scalar scalarResidual = sum(mag(residual));
+
+        if (debug)
+        {
+            Pout<< "Iter:" << iter << " initialResidual:" << initialResidual
+                << " residual:" << scalarResidual << endl;
+        }
+
+        if (scalarResidual < absTol*0.5*lambdas.size())
+        {
+            break;
+        }
+        else if (iter == 0)
+        {
+            initialResidual = scalarResidual;
+        }
+        else if (scalarResidual/initialResidual < relTol)
+        {
+            break;
+        }
+
+
+        if (debugStr.valid())
+        {
+            forAll(points, i)
+            {
+                const point predicted(points[i] + residual[i]);
+                debugStr().write(linePointRef(points[i], predicted));
+            }
+        }
+
+        points += residual;
+    }
+
+    return tpoints;
+}
+
+
+// ************************************************************************* //
diff --git a/src/mesh/blockMesh/blockEdges/projectCurveEdge/projectCurveEdge.H b/src/mesh/blockMesh/blockEdges/projectCurveEdge/projectCurveEdge.H
new file mode 100644
index 0000000000000000000000000000000000000000..27d7f7ffcac5bb860500e90cf912b86b5692c60a
--- /dev/null
+++ b/src/mesh/blockMesh/blockEdges/projectCurveEdge/projectCurveEdge.H
@@ -0,0 +1,128 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+Class
+    Foam::projectCurveEdge
+
+Description
+    Defines the edge from the projection onto a surface (single surface)
+    or intersection of two surfaces.
+
+SourceFiles
+    projectCurveEdge.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef projectCurveEdge_H
+#define projectCurveEdge_H
+
+#include "blockEdge.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+class pointConstraint;
+
+/*---------------------------------------------------------------------------*\
+                      Class projectCurveEdge Declaration
+\*---------------------------------------------------------------------------*/
+
+class projectCurveEdge
+:
+    public blockEdge
+{
+    // Private data
+
+        const searchableSurfaces& geometry_;
+
+        //- The indices of surfaces onto which the points are projected
+        labelList surfaces_;
+
+
+    // Private Member Functions
+
+        //- Disallow default bitwise copy construct
+        projectCurveEdge(const projectCurveEdge&);
+
+        //- Disallow default bitwise assignment
+        void operator=(const projectCurveEdge&);
+
+
+public:
+
+    //- Runtime type information
+    TypeName("projectCurve");
+
+
+    // Constructors
+
+        //- Construct from Istream setting pointsList
+        projectCurveEdge
+        (
+            const dictionary& dict,
+            const label index,
+            const searchableSurfaces& geometry,
+            const pointField& points,
+            Istream&
+        );
+
+
+    //- Destructor
+    virtual ~projectCurveEdge()
+    {}
+
+
+    // Member Functions
+
+        //- Return the point positions corresponding to the curve parameters
+        //  0 <= lambda <= 1
+        virtual point position(const scalar) const
+        {
+            NotImplemented;
+            return point::max;
+        }
+
+        //- Return the point positions corresponding to the curve parameters
+        //  0 <= lambda <= 1
+        virtual tmp<pointField> position(const scalarList&) const;
+
+        //- Return the length of the curve
+        virtual scalar length() const
+        {
+            NotImplemented;
+            return 1;
+        }
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/mesh/blockMesh/blockEdges/projectEdge/projectEdge.C b/src/mesh/blockMesh/blockEdges/projectEdge/projectEdge.C
index 9f10f341918cad067e0705ab25a0abce66c4aa13..4af420d1880334f1457f7fc4738e685258d31ff9 100644
--- a/src/mesh/blockMesh/blockEdges/projectEdge/projectEdge.C
+++ b/src/mesh/blockMesh/blockEdges/projectEdge/projectEdge.C
@@ -29,6 +29,7 @@ License
 #include "addToRunTimeSelectionTable.H"
 #include "pointConstraint.H"
 #include "OBJstream.H"
+#include "linearInterpolationWeights.H"
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
@@ -79,12 +80,14 @@ void Foam::projectEdge::findNearest
 
 Foam::projectEdge::projectEdge
 (
+    const dictionary& dict,
+    const label index,
     const searchableSurfaces& geometry,
     const pointField& points,
     Istream& is
 )
 :
-    blockEdge(points, is),
+    blockEdge(dict, index, points, is),
     geometry_(geometry)
 {
     wordList names(is);
@@ -108,7 +111,7 @@ Foam::projectEdge::projectEdge
 Foam::point Foam::projectEdge::position(const scalar lambda) const
 {
     // Initial guess
-    const point start(points_[start_]+lambda*(points_[end_]-points_[start_]));
+    const point start(points_[start_] + lambda*(points_[end_]-points_[start_]));
 
     point near(start);
 
@@ -125,7 +128,20 @@ Foam::point Foam::projectEdge::position(const scalar lambda) const
 Foam::tmp<Foam::pointField>
 Foam::projectEdge::position(const scalarList& lambdas) const
 {
-    static label iter = 0;
+    // For debugging to tag the output
+    static label eIter = 0;
+
+    autoPtr<OBJstream> debugStr;
+    if (debug)
+    {
+        debugStr.reset
+        (
+            new OBJstream("projectEdge_" + Foam::name(eIter++) + ".obj")
+        );
+        Info<< "Writing lines from straight-line start points"
+            << " to projected points to " << debugStr().name() << endl;
+    }
+
 
     tmp<pointField> tpoints(new pointField(lambdas.size()));
     pointField& points = tpoints.ref();
@@ -141,17 +157,26 @@ Foam::projectEdge::position(const scalarList& lambdas) const
     }
 
 
-    for (label i = 0; i < 3; i++)
+    // Upper limit for number of iterations
+    const label maxIter = 10;
+    // Residual tolerance
+    const scalar relTol = 0.1;
+    const scalar absTol = 1e-4;
+
+    scalar initialResidual = 0.0;
+
+    for (label iter = 0; iter < maxIter; iter++)
     {
         // Do projection
         {
             List<pointConstraint> constraints(lambdas.size());
+            pointField start(points);
             searchableSurfacesQueries::findNearest
             (
                 geometry_,
                 surfaces_,
-                pointField(points),
-                scalarField(points.size(), magSqr(d)),
+                start,
+                scalarField(start.size(), magSqr(d)),
                 points,
                 constraints
             );
@@ -165,63 +190,77 @@ Foam::projectEdge::position(const scalarList& lambdas) const
             {
                 points.last() = endPt;
             }
+
+            if (debugStr.valid())
+            {
+                forAll(points, i)
+                {
+                    debugStr().write(linePointRef(start[i], points[i]));
+                }
+            }
         }
 
-        // Calculate distances
-        scalarField nearLength(points.size());
+        // Calculate lambdas (normalised coordinate along edge)
+        scalarField projLambdas(points.size());
         {
-            nearLength[0] = 0.0;
-            for(label i = 1; i < points.size(); i++)
+            projLambdas[0] = 0.0;
+            for (label i = 1; i < points.size(); i++)
             {
-                nearLength[i] = nearLength[i-1] + mag(points[i]-points[i-1]);
+                projLambdas[i] = projLambdas[i-1] + mag(points[i]-points[i-1]);
             }
+            projLambdas /= projLambdas.last();
         }
+        linearInterpolationWeights interpolator(projLambdas);
 
         // Compare actual distances and move points (along straight line;
         // not along surface)
-        for(label i = 1; i < points.size() - 1; i++)
+        vectorField residual(points.size(), vector::zero);
+        labelList indices;
+        scalarField weights;
+        for (label i = 1; i < points.size() - 1; i++)
         {
-            scalar nearDelta = mag(points[i]-points[i-1])/nearLength.last();
-            scalar wantedDelta = lambdas[i]-lambdas[i-1];
+            interpolator.valueWeights(lambdas[i], indices, weights);
 
-            vector v(points[i]-points[i-1]);
-            points[i] = points[i-1]+wantedDelta/nearDelta*v;
+            point predicted = vector::zero;
+            forAll(indices, indexi)
+            {
+                predicted += weights[indexi]*points[indices[indexi]];
+            }
+            residual[i] = predicted-points[i];
         }
-    }
 
+        scalar scalarResidual = sum(mag(residual));
 
-    if (debug)
-    {
-        OBJstream str("projectEdge_" + Foam::name(iter++) + ".obj");
-        Info<< "Writing lines from straight-line start points"
-            << " to projected points to " << str.name() << endl;
-
-        pointField startPts(lambdas.size());
-        forAll(lambdas, i)
+        if (debug)
         {
-            startPts[i] = startPt+lambdas[i]*d;
+            Pout<< "Iter:" << iter << " initialResidual:" << initialResidual
+                << " residual:" << scalarResidual << endl;
         }
 
-        pointField nearPts(lambdas.size());
-        List<pointConstraint> nearConstraints(lambdas.size());
+        if (scalarResidual < absTol*0.5*lambdas.size())
         {
-            const scalar distSqr = magSqr(d);
-            searchableSurfacesQueries::findNearest
-            (
-                geometry_,
-                surfaces_,
-                startPts,
-                scalarField(startPts.size(), distSqr),
-                nearPts,
-                nearConstraints
-            );
+            break;
+        }
+        else if (iter == 0)
+        {
+            initialResidual = scalarResidual;
+        }
+        else if (scalarResidual/initialResidual < relTol)
+        {
+            break;
         }
 
-        forAll(startPts, i)
+
+        if (debugStr.valid())
         {
-            str.write(linePointRef(startPts[i], nearPts[i]));
-            str.write(linePointRef(nearPts[i], points[i]));
+            forAll(points, i)
+            {
+                const point predicted(points[i] + residual[i]);
+                debugStr().write(linePointRef(points[i], predicted));
+            }
         }
+
+        points += residual;
     }
 
     return tpoints;
diff --git a/src/mesh/blockMesh/blockEdges/projectEdge/projectEdge.H b/src/mesh/blockMesh/blockEdges/projectEdge/projectEdge.H
index cf8baebe75edf3a8d824d3e099e2305c2f558165..320f658eb57411b89e1ed39deb8ecf1163960534 100644
--- a/src/mesh/blockMesh/blockEdges/projectEdge/projectEdge.H
+++ b/src/mesh/blockMesh/blockEdges/projectEdge/projectEdge.H
@@ -84,6 +84,8 @@ public:
         //- Construct from Istream setting pointsList
         projectEdge
         (
+            const dictionary& dict,
+            const label index,
             const searchableSurfaces& geometry,
             const pointField& points,
             Istream&
diff --git a/src/mesh/blockMesh/blockEdges/splineEdge/splineEdge.C b/src/mesh/blockMesh/blockEdges/splineEdge/splineEdge.C
index 5a6be74f4e8dd94b6b87d1fd777825f72eb069de..0e70e255c82b2b74a44e2093ffe46712387fe3b9 100644
--- a/src/mesh/blockMesh/blockEdges/splineEdge/splineEdge.C
+++ b/src/mesh/blockMesh/blockEdges/splineEdge/splineEdge.C
@@ -62,12 +62,14 @@ Foam::blockEdges::splineEdge::splineEdge
 
 Foam::blockEdges::splineEdge::splineEdge
 (
+    const dictionary& dict,
+    const label index,
     const searchableSurfaces& geometry,
     const pointField& points,
     Istream& is
 )
 :
-    blockEdge(points, is),
+    blockEdge(dict, index, points, is),
     CatmullRomSpline(appendEndPoints(points, start_, end_, pointField(is)))
 {
     token t(is);
diff --git a/src/mesh/blockMesh/blockEdges/splineEdge/splineEdge.H b/src/mesh/blockMesh/blockEdges/splineEdge/splineEdge.H
index 4080b606c82a7b72698632567851e96c5ecc5da5..e1457a2d87070597293918e400b6f26bca495917 100644
--- a/src/mesh/blockMesh/blockEdges/splineEdge/splineEdge.H
+++ b/src/mesh/blockMesh/blockEdges/splineEdge/splineEdge.H
@@ -83,6 +83,8 @@ public:
         //- Construct from Istream, setting pointsList
         splineEdge
         (
+            const dictionary& dict,
+            const label index,
             const searchableSurfaces& geometry,
             const pointField&,
             Istream&
diff --git a/src/mesh/blockMesh/blockFaces/blockFace/blockFace.C b/src/mesh/blockMesh/blockFaces/blockFace/blockFace.C
index 388c9fcc5dc9402c8e11d4fc9a8135584d7875d6..7f777b8a8031e5a362e71320b670781d4945a2b3 100644
--- a/src/mesh/blockMesh/blockFaces/blockFace/blockFace.C
+++ b/src/mesh/blockMesh/blockFaces/blockFace/blockFace.C
@@ -24,6 +24,8 @@ License
 \*---------------------------------------------------------------------------*/
 
 #include "blockFace.H"
+#include "blockMeshTools.H"
+#include "blockVertex.H"
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
@@ -42,9 +44,21 @@ Foam::blockFace::blockFace(const face& vertices)
 {}
 
 
-Foam::blockFace::blockFace(Istream& is)
+Foam::blockFace::blockFace
+(
+    const dictionary& dict,
+    const label index,
+    Istream& is
+)
 :
-    vertices_(is)
+    vertices_
+    (
+        blockMeshTools::read<label>
+        (
+            is,
+            dict.subOrEmptyDict("namedVertices")
+        )
+    )
 {}
 
 
@@ -57,6 +71,8 @@ Foam::autoPtr<Foam::blockFace> Foam::blockFace::clone() const
 
 Foam::autoPtr<Foam::blockFace> Foam::blockFace::New
 (
+    const dictionary& dict,
+    const label index,
     const searchableSurfaces& geometry,
     Istream& is
 )
@@ -81,7 +97,26 @@ Foam::autoPtr<Foam::blockFace> Foam::blockFace::New
             << abort(FatalError);
     }
 
-    return autoPtr<blockFace>(cstrIter()(geometry, is));
+    return autoPtr<blockFace>(cstrIter()(dict, index, geometry, is));
+}
+
+
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
+
+void Foam::blockFace::write(Ostream& os, const dictionary& d) const
+{
+    // Write size and start delimiter
+    os << vertices_.size() << token::BEGIN_LIST;
+
+    // Write contents
+    forAll(vertices_, i)
+    {
+        if (i > 0) os << token::SPACE;
+        blockVertex::write(os, vertices_[i], d);
+    }
+
+    // Write end delimiter
+    os << token::END_LIST;
 }
 
 
diff --git a/src/mesh/blockMesh/blockFaces/blockFace/blockFace.H b/src/mesh/blockMesh/blockFaces/blockFace/blockFace.H
index fee6771d79bb6b6a2dd08cef7626aa180a675bb6..f890aa3ae79bf79a08335a35f648a770184c6d26 100644
--- a/src/mesh/blockMesh/blockFaces/blockFace/blockFace.H
+++ b/src/mesh/blockMesh/blockFaces/blockFace/blockFace.H
@@ -77,10 +77,12 @@ public:
             blockFace,
             Istream,
             (
+                const dictionary& dict,
+                const label index,
                 const searchableSurfaces& geometry,
                 Istream& is
             ),
-            (geometry, is)
+            (dict, index, geometry, is)
         );
 
 
@@ -90,7 +92,12 @@ public:
         blockFace(const face& vertices);
 
         //- Construct from Istream
-        blockFace(Istream&);
+        blockFace
+        (
+            const dictionary& dict,
+            const label index,
+            Istream&
+        );
 
         //- Clone function
         virtual autoPtr<blockFace> clone() const;
@@ -98,6 +105,8 @@ public:
         //- New function which constructs and returns pointer to a blockFace
         static autoPtr<blockFace> New
         (
+            const dictionary& dict,
+            const label index,
             const searchableSurfaces& geometry,
             Istream&
         );
@@ -106,18 +115,22 @@ public:
         //  PtrLists of blockFace
         class iNew
         {
+            const dictionary& dict_;
             const searchableSurfaces& geometry_;
+            mutable label index_;
 
         public:
 
-            iNew(const searchableSurfaces& geometry)
+            iNew(const dictionary& dict, const searchableSurfaces& geometry)
             :
-                geometry_(geometry)
+                dict_(dict),
+                geometry_(geometry),
+                index_(0)
             {}
 
             autoPtr<blockFace> operator()(Istream& is) const
             {
-                return blockFace::New(geometry_, is);
+                return blockFace::New(dict_, index_++, geometry_, is);
             }
         };
 
@@ -145,6 +158,9 @@ public:
             pointField& points
         ) const = 0;
 
+        //- Write face with variable backsubstitution
+        void write(Ostream&, const dictionary&) const;
+
 
     // Ostream operator
 
diff --git a/src/mesh/blockMesh/blockFaces/projectFace/projectFace.C b/src/mesh/blockMesh/blockFaces/projectFace/projectFace.C
index 2cf9c9742769e71c72f30e3c6cf9fd86b2e60cc0..36129e6c8ac981b1f907ce66a348b35e3370a927 100644
--- a/src/mesh/blockMesh/blockFaces/projectFace/projectFace.C
+++ b/src/mesh/blockMesh/blockFaces/projectFace/projectFace.C
@@ -27,6 +27,8 @@ License
 #include "unitConversion.H"
 #include "addToRunTimeSelectionTable.H"
 #include "blockDescriptor.H"
+#include "OBJstream.H"
+#include "linearInterpolationWeights.H"
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
@@ -66,15 +68,74 @@ const Foam::searchableSurface& Foam::blockFaces::projectFace::lookupSurface
 }
 
 
+Foam::label Foam::blockFaces::projectFace::index
+(
+    const labelPair& n,
+    const labelPair& coord
+) const
+{
+    return coord.first() + coord.second()*n.first();
+}
+
+
+void Foam::blockFaces::projectFace::calcLambdas
+(
+    const labelPair& n,
+    const pointField& points,
+    scalarField& lambdaI,
+    scalarField& lambdaJ
+) const
+{
+    lambdaI.setSize(points.size());
+    lambdaI = 0.0;
+    lambdaJ.setSize(points.size());
+    lambdaJ = 0.0;
+
+    for (label i = 1; i < n.first(); i++)
+    {
+        for (label j = 1; j < n.second(); j++)
+        {
+            label ij = index(n, labelPair(i, j));
+            label iMin1j = index(n, labelPair(i-1, j));
+            lambdaI[ij] = lambdaI[iMin1j] + mag(points[ij]-points[iMin1j]);
+
+            label ijMin1 = index(n, labelPair(i, j-1));
+            lambdaJ[ij] = lambdaJ[ijMin1] + mag(points[ij]-points[ijMin1]);
+        }
+    }
+
+    for (label i = 1; i < n.first(); i++)
+    {
+        label ijLast = index(n, labelPair(i, n.second()-1));
+        for (label j = 1; j < n.second(); j++)
+        {
+            label ij = index(n, labelPair(i, j));
+            lambdaJ[ij] /= lambdaJ[ijLast];
+        }
+    }
+    for (label j = 1; j < n.second(); j++)
+    {
+        label iLastj = index(n, labelPair(n.first()-1, j));
+        for (label i = 1; i < n.first(); i++)
+        {
+            label ij = index(n, labelPair(i, j));
+            lambdaI[ij] /= lambdaI[iLastj];
+        }
+    }
+}
+
+
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
 Foam::blockFaces::projectFace::projectFace
 (
+    const dictionary& dict,
+    const label index,
     const searchableSurfaces& geometry,
     Istream& is
 )
 :
-    blockFace(is),
+    blockFace(dict, index, is),
     surface_(lookupSurface(geometry, is))
 {}
 
@@ -88,20 +149,215 @@ void Foam::blockFaces::projectFace::project
     pointField& points
 ) const
 {
-    List<pointIndexHit> hits;
-    scalarField nearestDistSqr
-    (
-        points.size(),
-        magSqr(points[0] - points[points.size()-1])
-    );
-    surface_.findNearest(points, nearestDistSqr, hits);
-
-    forAll(hits, i)
+    // For debugging to tag the output
+    static label fIter = 0;
+
+    autoPtr<OBJstream> debugStr;
+    if (debug)
     {
-        if (hits[i].hit())
+        debugStr.reset
+        (
+            new OBJstream("projectFace_" + Foam::name(fIter++) + ".obj")
+        );
+        Info<< "Face:" << blockFacei << " on block:" << desc.blockShape()
+            << " with verts:" << desc.vertices()
+            << " writing lines from start points"
+            << " to projected points to " << debugStr().name() << endl;
+    }
+
+
+    // Find out range of vertices in face
+    labelPair n(-1, -1);
+    switch (blockFacei)
+    {
+        case 0:
+        case 1:
+        {
+            n.first() = desc.density()[1] + 1;
+            n.second() = desc.density()[2] + 1;
+        }
+        break;
+
+        case 2:
+        case 3:
+        {
+            n.first() = desc.density()[0] + 1;
+            n.second() = desc.density()[2] + 1;
+        }
+        break;
+
+        case 4:
+        case 5:
         {
-            points[i] = hits[i].hitPoint();
+            n.first() = desc.density()[0] + 1;
+            n.second() = desc.density()[1] + 1;
         }
+        break;
+    }
+
+
+    // Calculate initial normalised edge lengths (= u,v coordinates)
+    scalarField lambdaI(points.size(), 0.0);
+    scalarField lambdaJ(points.size(), 0.0);
+    calcLambdas(n, points, lambdaI, lambdaJ);
+
+
+    // Upper limit for number of iterations
+    const label maxIter = 10;
+    // Residual tolerance
+    const scalar relTol = 0.1;
+
+    scalar initialResidual = 0.0;
+    scalar iResidual = 0.0;
+    scalar jResidual = 0.0;
+
+    for (label iter = 0; iter < maxIter;  iter++)
+    {
+        // Do projection
+        {
+            List<pointIndexHit> hits;
+            scalarField nearestDistSqr
+            (
+                points.size(),
+                magSqr(points[0] - points[points.size()-1])
+            );
+            surface_.findNearest(points, nearestDistSqr, hits);
+
+            forAll(hits, i)
+            {
+                if (hits[i].hit())
+                {
+                    const point& hitPt = hits[i].hitPoint();
+                    if (debugStr.valid())
+                    {
+                        debugStr().write(linePointRef(points[i], hitPt));
+                    }
+                    points[i] = hitPt;
+                }
+            }
+        }
+
+        if (debug)
+        {
+            Pout<< "Iter:" << iter << " initialResidual:" << initialResidual
+                << " iResidual+jResidual:" << iResidual+jResidual << endl;
+        }
+
+
+        if (iter > 0 && (iResidual+jResidual)/initialResidual < relTol)
+        {
+            break;
+        }
+
+
+        // Predict along i
+        vectorField residual(points.size(), vector::zero);
+
+        // Work arrays for interpolation
+        labelList indices;
+        scalarField weights;
+        for (label j = 1; j < n.second()-1; j++)
+        {
+            // Calculate actual lamdba along constant j line
+            scalarField projLambdas(n.first());
+            projLambdas[0] = 0.0;
+            for (label i = 1; i < n.first(); i++)
+            {
+                label ij = index(n, labelPair(i, j));
+                label iMin1j = index(n, labelPair(i-1, j));
+                projLambdas[i] =
+                    projLambdas[i-1]
+                   +mag(points[ij]-points[iMin1j]);
+            }
+            projLambdas /= projLambdas.last();
+
+            linearInterpolationWeights interpolator(projLambdas);
+
+            for (label i = 1; i < n.first()-1; i++)
+            {
+                label ij = index(n, labelPair(i, j));
+
+                interpolator.valueWeights(lambdaI[ij], indices, weights);
+
+                point predicted = vector::zero;
+                forAll(indices, indexi)
+                {
+                    label ptIndex = index(n, labelPair(indices[indexi], j));
+                    predicted += weights[indexi]*points[ptIndex];
+                }
+                residual[ij] = predicted-points[ij];
+            }
+        }
+
+        if (debugStr.valid())
+        {
+            forAll(points, i)
+            {
+                const point predicted(points[i] + residual[i]);
+                debugStr().write(linePointRef(points[i], predicted));
+            }
+        }
+
+        iResidual = sum(mag(residual));
+
+        // Update points before doing j. Note: is this needed? Complicates
+        // residual checking.
+        points += residual;
+
+
+        // Predict along j
+        residual = vector::zero;
+        for (label i = 1; i < n.first()-1; i++)
+        {
+            // Calculate actual lamdba along constant i line
+            scalarField projLambdas(n.second());
+            projLambdas[0] = 0.0;
+            for (label j = 1; j < n.second(); j++)
+            {
+                label ij = index(n, labelPair(i, j));
+                label ijMin1 = index(n, labelPair(i, j-1));
+                projLambdas[j] =
+                    projLambdas[j-1]
+                   +mag(points[ij]-points[ijMin1]);
+            }
+
+            projLambdas /= projLambdas.last();
+
+            linearInterpolationWeights interpolator(projLambdas);
+
+            for (label j = 1; j < n.second()-1; j++)
+            {
+                label ij = index(n, labelPair(i, j));
+
+                interpolator.valueWeights(lambdaJ[ij], indices, weights);
+
+                point predicted = vector::zero;
+                forAll(indices, indexi)
+                {
+                    label ptIndex = index(n, labelPair(i, indices[indexi]));
+                    predicted += weights[indexi]*points[ptIndex];
+                }
+                residual[ij] = predicted-points[ij];
+            }
+        }
+
+        if (debugStr.valid())
+        {
+            forAll(points, i)
+            {
+                const point predicted(points[i] + residual[i]);
+                debugStr().write(linePointRef(points[i], predicted));
+            }
+        }
+
+        jResidual = sum(mag(residual));
+
+        if (iter == 0)
+        {
+            initialResidual = iResidual + jResidual;
+        }
+
+        points += residual;
     }
 }
 
diff --git a/src/mesh/blockMesh/blockFaces/projectFace/projectFace.H b/src/mesh/blockMesh/blockFaces/projectFace/projectFace.H
index c1b56bbcdba83e101bc1ae23be684b33d011e5dd..635318b05c27501c95bdb281a87a94e1f9f33409 100644
--- a/src/mesh/blockMesh/blockFaces/projectFace/projectFace.H
+++ b/src/mesh/blockMesh/blockFaces/projectFace/projectFace.H
@@ -67,6 +67,22 @@ class projectFace
             Istream& is
         ) const;
 
+        //- Convert i,j to single index
+        label index
+        (
+            const labelPair& n,
+            const labelPair& coord
+        ) const;
+
+        //- Calulate lambdas (but unnormalised)
+        void calcLambdas
+        (
+            const labelPair& n,
+            const pointField& points,
+            scalarField& lambdaI,
+            scalarField& lambdaJ
+        ) const;
+
         //- Disallow default bitwise copy construct
         projectFace(const projectFace&);
 
@@ -85,6 +101,8 @@ public:
         //- Construct from Istream setting pointsList
         projectFace
         (
+            const dictionary& dict,
+            const label index,
             const searchableSurfaces& geometry,
             Istream&
         );
diff --git a/src/mesh/blockMesh/blockMesh/blockMesh.C b/src/mesh/blockMesh/blockMesh/blockMesh.C
index 366288e5ae72ef566d50681c0262a60650a2844f..10bb74f76521af7530500a299142a2153d4267e1 100644
--- a/src/mesh/blockMesh/blockMesh/blockMesh.C
+++ b/src/mesh/blockMesh/blockMesh/blockMesh.C
@@ -38,33 +38,34 @@ namespace Foam
 
 Foam::blockMesh::blockMesh(const IOdictionary& dict, const word& regionName)
 :
-    verboseOutput(dict.lookupOrDefault<Switch>("verbose", true)),
+    meshDict_(dict),
+    verboseOutput(meshDict_.lookupOrDefault<Switch>("verbose", true)),
     geometry_
     (
         IOobject
         (
             "geometry",                 // dummy name
-            dict.time().constant(),     // instance
+            meshDict_.time().constant(),     // instance
             "geometry",                 // local
-            dict.time(),                // registry
+            meshDict_.time(),                // registry
             IOobject::MUST_READ,
             IOobject::NO_WRITE
         ),
-        dict.found("geometry")
-      ? dict.subDict("geometry")
+        meshDict_.found("geometry")
+      ? meshDict_.subDict("geometry")
       : dictionary(),
         true
     ),
     scaleFactor_(1.0),
     blockVertices_
     (
-        dict.lookup("vertices"),
-        blockVertex::iNew(geometry_)
+        meshDict_.lookup("vertices"),
+        blockVertex::iNew(meshDict_, geometry_)
     ),
     vertices_(Foam::vertices(blockVertices_)),
-    topologyPtr_(createTopology(dict, regionName))
+    topologyPtr_(createTopology(meshDict_, regionName))
 {
-    Switch fastMerge(dict.lookupOrDefault<Switch>("fastMerge", false));
+    Switch fastMerge(meshDict_.lookupOrDefault<Switch>("fastMerge", false));
 
     if (fastMerge)
     {
diff --git a/src/mesh/blockMesh/blockMesh/blockMesh.H b/src/mesh/blockMesh/blockMesh/blockMesh.H
index fcd3698c34027ee3f08cf42be98ce2751a5d25af..01f9bf6411b0bf7e1e9675d818d4ab3f1c4cb821 100644
--- a/src/mesh/blockMesh/blockMesh/blockMesh.H
+++ b/src/mesh/blockMesh/blockMesh/blockMesh.H
@@ -65,6 +65,9 @@ class blockMesh
 {
     // Private data
 
+        //- Reference to mesh dictionary
+        const IOdictionary& meshDict_;
+
         //- Switch for verbose output
         bool verboseOutput;
 
@@ -139,7 +142,7 @@ class blockMesh
 
         polyMesh* createTopology(const IOdictionary&, const word& regionName);
 
-        void check(const polyMesh&) const;
+        void check(const polyMesh&, const dictionary&) const;
 
         //- Determine the merge info and the final number of cells/points
         void calcMergeInfo();
@@ -178,6 +181,12 @@ public:
 
         // Access
 
+            //- Access to input dictionary
+            const dictionary& meshDict() const
+            {
+                return meshDict_;
+            }
+
             //- Optional searchable geometry to project face-points to
             const searchableSurfaces& geometry() const
             {
diff --git a/src/mesh/blockMesh/blockMesh/blockMeshCheck.C b/src/mesh/blockMesh/blockMesh/blockMeshCheck.C
index 10bd9e3116df63d26c852f0972749ffa94da3752..fc0c08b8623443bfcd277132f852d8755a958a00 100644
--- a/src/mesh/blockMesh/blockMesh/blockMeshCheck.C
+++ b/src/mesh/blockMesh/blockMesh/blockMeshCheck.C
@@ -27,7 +27,7 @@ License
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
 
-void Foam::blockMesh::check(const polyMesh& bm) const
+void Foam::blockMesh::check(const polyMesh& bm, const dictionary& dict) const
 {
     Info<< nl << "Check topology" << endl;
 
@@ -40,8 +40,9 @@ void Foam::blockMesh::check(const polyMesh& bm) const
         {
             if (edges_[cei].compare(edges_[cej]) != 0)
             {
-                Info<< "    Curved edge " << edges_[cej]
-                    << "    is a duplicate of curved edge " << edges_[cei]
+                Info<< "    Curved edge ";
+                edges_[cej].write(Info, dict);
+                Info<< "    is a duplicate of curved edge " << edges_[cei]
                     << endl;
                 ok = false;
                 break;
@@ -74,8 +75,9 @@ void Foam::blockMesh::check(const polyMesh& bm) const
 
         if (!found)
         {
-            Info<< "    Curved edge " << edges_[cei]
-                << "    does not correspond to a block edge."
+            Info<< "    Curved edge ";
+            edges_[cei].write(Info, dict);
+            Info<< "    does not correspond to a block edge."
                 << endl;
             ok = false;
         }
@@ -90,9 +92,11 @@ void Foam::blockMesh::check(const polyMesh& bm) const
         {
             if (faces_[cfi].compare(faces_[cfj]) != 0)
             {
-                Info<< "    Curved face " << faces_[cfj]
-                    << "    is a duplicate of curved face " << faces_[cfi]
-                    << endl;
+                Info<< "    Curved face ";
+                faces_[cfj].write(Info, dict);
+                Info<< "    is a duplicate of curved face ";
+                faces_[cfi].write(Info, dict);
+                Info<< endl;
                 ok = false;
                 break;
             }
@@ -112,9 +116,9 @@ void Foam::blockMesh::check(const polyMesh& bm) const
 
         if (!found)
         {
-            Info<< "    Curved face " << faces_[cfi]
-                << "    does not correspond to a block face."
-                << endl;
+            Info<< "    Curved face ";
+            faces_[cfi].write(Info, dict);
+            Info<< "    does not correspond to a block face." << endl;
             ok = false;
         }
     }
diff --git a/src/mesh/blockMesh/blockMesh/blockMeshTopology.C b/src/mesh/blockMesh/blockMesh/blockMeshTopology.C
index ab998442051ad93e6b1bf0bc884573f33f857f43..ff275c852e6b69c484306d64126ab320fdcf8718 100644
--- a/src/mesh/blockMesh/blockMesh/blockMeshTopology.C
+++ b/src/mesh/blockMesh/blockMesh/blockMeshTopology.C
@@ -24,6 +24,7 @@ License
 \*---------------------------------------------------------------------------*/
 
 #include "blockMesh.H"
+#include "blockMeshTools.H"
 #include "Time.H"
 #include "preservePatchTypes.H"
 #include "emptyPolyPatch.H"
@@ -110,6 +111,11 @@ void Foam::blockMesh::readPatches
     wordList& nbrPatchNames
 )
 {
+    // Collect all variables
+    dictionary varDict(meshDescription.subOrEmptyDict("namedVertices"));
+    varDict.merge(meshDescription.subOrEmptyDict("namedBlocks"));
+
+
     ITstream& patchStream(meshDescription.lookup("patches"));
 
     // Read number of patches in mesh
@@ -160,7 +166,11 @@ void Foam::blockMesh::readPatches
             >> patchNames[nPatches];
 
         // Read patch faces
-        patchStream >> tmpBlocksPatches[nPatches];
+        tmpBlocksPatches[nPatches] = blockMeshTools::read<face>
+        (
+            patchStream,
+            varDict
+        );
 
 
         // Check for multiple patches
@@ -258,6 +268,11 @@ void Foam::blockMesh::readBoundary
     PtrList<dictionary>& patchDicts
 )
 {
+    // Collect all variables
+    dictionary varDict(meshDescription.subOrEmptyDict("namedVertices"));
+    varDict.merge(meshDescription.subOrEmptyDict("namedBlocks"));
+
+
     // Read like boundary file
     const PtrList<entry> patchesInfo
     (
@@ -286,7 +301,12 @@ void Foam::blockMesh::readBoundary
         patchDicts.set(patchi, new dictionary(patchInfo.dict()));
 
         // Read block faces
-        patchDicts[patchi].lookup("faces") >> tmpBlocksPatches[patchi];
+        tmpBlocksPatches[patchi] = blockMeshTools::read<face>
+        (
+            patchDicts[patchi].lookup("faces"),
+            varDict
+        );
+
 
         checkPatchLabels
         (
@@ -353,7 +373,7 @@ Foam::polyMesh* Foam::blockMesh::createTopology
         blockEdgeList edges
         (
             meshDescription.lookup("edges"),
-            blockEdge::iNew(geometry_, vertices_)
+            blockEdge::iNew(meshDescription, geometry_, vertices_)
         );
 
         edges_.transfer(edges);
@@ -375,7 +395,7 @@ Foam::polyMesh* Foam::blockMesh::createTopology
         blockFaceList faces
         (
             meshDescription.lookup("faces"),
-            blockFace::iNew(geometry_)
+            blockFace::iNew(meshDescription, geometry_)
         );
 
         faces_.transfer(faces);
@@ -395,7 +415,7 @@ Foam::polyMesh* Foam::blockMesh::createTopology
         blockList blocks
         (
             meshDescription.lookup("blocks"),
-            block::iNew(vertices_, edges_, faces_)
+            block::iNew(meshDescription, vertices_, edges_, faces_)
         );
 
         transfer(blocks);
@@ -545,7 +565,7 @@ Foam::polyMesh* Foam::blockMesh::createTopology
         );
     }
 
-    check(*blockMeshPtr);
+    check(*blockMeshPtr, meshDescription);
 
     return blockMeshPtr;
 }
diff --git a/src/mesh/blockMesh/blockMeshTools/blockMeshTools.C b/src/mesh/blockMesh/blockMeshTools/blockMeshTools.C
new file mode 100644
index 0000000000000000000000000000000000000000..465998ce9d65ecd4ea802126e077d6e3517741ba
--- /dev/null
+++ b/src/mesh/blockMesh/blockMeshTools/blockMeshTools.C
@@ -0,0 +1,136 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+\*---------------------------------------------------------------------------*/
+
+#include "blockMeshTools.H"
+
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
+
+void Foam::blockMeshTools::read
+(
+    Istream& is,
+    label& val,
+    const dictionary& dict
+)
+{
+    token t(is);
+    if (t.isLabel())
+    {
+        val = t.labelToken();
+    }
+    else if (t.isWord())
+    {
+        const word& varName = t.wordToken();
+        const entry* ePtr = dict.lookupScopedEntryPtr
+        (
+            varName,
+            true,
+            true
+        );
+        if (ePtr)
+        {
+            // Read as label
+            val = Foam::readLabel(ePtr->stream());
+        }
+        else
+        {
+            FatalIOErrorInFunction(is)
+                << "Undefined variable "
+                << varName << ". Valid variables are " << dict
+                << exit(FatalIOError);
+        }
+    }
+    else
+    {
+        FatalIOErrorInFunction(is)
+            << "Illegal token " << t.info()
+            << " when trying to read label"
+            << exit(FatalIOError);
+    }
+
+    is.fatalCheck
+    (
+        "operator>>(Istream&, List<T>&) : reading entry"
+    );
+}
+
+
+Foam::label Foam::blockMeshTools::read
+(
+    Istream& is,
+    const dictionary& dict
+)
+{
+    label val;
+    read(is, val, dict);
+    return val;
+}
+
+
+void Foam::blockMeshTools::write
+(
+    Ostream& os,
+    const label val,
+    const dictionary& dict
+)
+{
+    forAllConstIter(dictionary, dict, iter)
+    {
+        if (iter().isStream())
+        {
+            label keyVal(Foam::readLabel(iter().stream()));
+            if (keyVal == val)
+            {
+                os << iter().keyword();
+                return;
+            }
+        }
+    }
+    os << val;
+}
+
+
+const Foam::keyType& Foam::blockMeshTools::findEntry
+(
+    const dictionary& dict,
+    const label val
+)
+{
+    forAllConstIter(dictionary, dict, iter)
+    {
+        if (iter().isStream())
+        {
+            label keyVal(Foam::readLabel(iter().stream()));
+            if (keyVal == val)
+            {
+                return iter().keyword();
+            }
+        }
+    }
+
+    return keyType::null;
+}
+
+
+// ************************************************************************* //
diff --git a/src/mesh/blockMesh/blockMeshTools/blockMeshTools.H b/src/mesh/blockMesh/blockMeshTools/blockMeshTools.H
new file mode 100644
index 0000000000000000000000000000000000000000..ee18555f90985bddf1c41c28594e880efafed0a1
--- /dev/null
+++ b/src/mesh/blockMesh/blockMeshTools/blockMeshTools.H
@@ -0,0 +1,85 @@
+/*---------------------------------------------------------------------------* \
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+Namespace
+    Foam::blockMeshTools
+
+Description
+    Tools for parsing label(List) with dictionary lookup.
+
+SourceFiles
+    blockMeshTools.C
+    blockMeshToolsTemplates.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef blockMeshTools_H
+#define blockMeshTools_H
+
+#include "dictionary.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace blockMeshTools
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+    //- In-place read with dictionary lookup
+    void read(Istream&, label&, const dictionary&);
+
+    //- In-place read with dictionary lookup
+    template<class T>
+    void read(Istream&, List<T>&, const dictionary&);
+
+    //- Return-read with dictionary lookup
+    label read(Istream&, const dictionary&);
+
+    //- Return-read with dictionary lookup
+    template<class T>
+    List<T> read(Istream& is, const dictionary&);
+
+    //- Write with dictionary lookup
+    void write(Ostream&, const label, const dictionary&);
+
+    //- Linear search for label entry
+    const keyType& findEntry(const dictionary&, const label);
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace blockMeshTools
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#ifdef NoRepository
+    #include "blockMeshToolsTemplates.C"
+#endif
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/mesh/blockMesh/blockMeshTools/blockMeshToolsTemplates.C b/src/mesh/blockMesh/blockMeshTools/blockMeshToolsTemplates.C
new file mode 100644
index 0000000000000000000000000000000000000000..1df2dcc975a77f5498c66b46eb4db6a51f694404
--- /dev/null
+++ b/src/mesh/blockMesh/blockMeshTools/blockMeshToolsTemplates.C
@@ -0,0 +1,115 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+\*---------------------------------------------------------------------------*/
+
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
+
+template<class T>
+void Foam::blockMeshTools::read
+(
+    Istream& is,
+    List<T>& L,
+    const dictionary& dict
+)
+{
+    token firstToken(is);
+
+    if (firstToken.isLabel())
+    {
+        label s = firstToken.labelToken();
+
+        // Set list length to that read
+        L.setSize(s);
+
+        // Read list contents depending on data format
+
+        // Read beginning of contents
+        char delimiter = is.readBeginList("List");
+
+        if (s)
+        {
+            if (delimiter == token::BEGIN_LIST)
+            {
+                for (label i=0; i<s; i++)
+                {
+                    read(is, L[i], dict);
+                }
+            }
+        }
+
+        // Read end of contents
+        is.readEndList("List");
+    }
+    else if (firstToken.isPunctuation())
+    {
+        if (firstToken.pToken() != token::BEGIN_LIST)
+        {
+            FatalIOErrorInFunction(is)
+                << "incorrect first token, expected '(', found "
+                << firstToken.info()
+                << exit(FatalIOError);
+        }
+
+        SLList<T> sll;
+
+        while (true)
+        {
+            token t(is);
+            if (t.isPunctuation() && t.pToken() == token::END_LIST)
+            {
+                break;
+            }
+            is.putBack(t);
+            T elem;
+            read(is, elem, dict);
+            sll.append(elem);
+        }
+
+        // Convert the singly-linked list to this list
+        L = sll;
+    }
+    else
+    {
+        FatalIOErrorInFunction(is)
+            << "incorrect first token, expected <int> or '(', found "
+            << firstToken.info()
+            << exit(FatalIOError);
+    }
+}
+
+
+template<class T>
+Foam::List<T> Foam::blockMeshTools::read
+(
+    Istream& is,
+    const dictionary& dict
+)
+{
+    List<T> L;
+    read(is, L, dict);
+    return L;
+}
+
+
+// ************************************************************************* //
diff --git a/src/mesh/blockMesh/blockVertices/blockVertex/blockVertex.C b/src/mesh/blockMesh/blockVertices/blockVertex/blockVertex.C
index fe8ab41dc590827f32ef1f0a22e6b9586c83871c..fba46625b14df8787e1e8b6fb0d09e5f5de689f4 100644
--- a/src/mesh/blockMesh/blockVertices/blockVertex/blockVertex.C
+++ b/src/mesh/blockMesh/blockVertices/blockVertex/blockVertex.C
@@ -25,6 +25,7 @@ License
 
 #include "blockVertex.H"
 #include "pointVertex.H"
+#include "blockMeshTools.H"
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
@@ -50,6 +51,8 @@ Foam::autoPtr<Foam::blockVertex> Foam::blockVertex::clone() const
 
 Foam::autoPtr<Foam::blockVertex> Foam::blockVertex::New
 (
+    const dictionary& dict,
+    const label index,
     const searchableSurfaces& geometry,
     Istream& is
 )
@@ -61,14 +64,14 @@ Foam::autoPtr<Foam::blockVertex> Foam::blockVertex::New
 
     token firstToken(is);
 
-    if (firstToken.pToken() == token::BEGIN_LIST)
+    if (firstToken.isPunctuation() && firstToken.pToken() == token::BEGIN_LIST)
     {
         // Putback the opening bracket
         is.putBack(firstToken);
 
         return autoPtr<blockVertex>
         (
-            new blockVertices::pointVertex(geometry, is)
+            new blockVertices::pointVertex(dict, index, geometry, is)
         );
     }
     else if (firstToken.isWord())
@@ -88,7 +91,7 @@ Foam::autoPtr<Foam::blockVertex> Foam::blockVertex::New
                 << abort(FatalError);
         }
 
-        return autoPtr<blockVertex>(cstrIter()(geometry, is));
+        return autoPtr<blockVertex>(cstrIter()(dict, index, geometry, is));
     }
     else
     {
@@ -102,4 +105,34 @@ Foam::autoPtr<Foam::blockVertex> Foam::blockVertex::New
 }
 
 
+Foam::label Foam::blockVertex::read(Istream& is, const dictionary& dict)
+{
+    const dictionary* varDictPtr = dict.subDictPtr("namedVertices");
+    if (varDictPtr)
+    {
+        return blockMeshTools::read(is, *varDictPtr);
+    }
+    return readLabel(is);
+}
+
+
+void Foam::blockVertex::write
+(
+    Ostream& os,
+    const label val,
+    const dictionary& d
+)
+{
+    const dictionary* varDictPtr = d.subDictPtr("namedVertices");
+    if (varDictPtr)
+    {
+        blockMeshTools::write(os, val, *varDictPtr);
+    }
+    else
+    {
+        os << val;
+    }
+}
+
+
 // ************************************************************************* //
diff --git a/src/mesh/blockMesh/blockVertices/blockVertex/blockVertex.H b/src/mesh/blockMesh/blockVertices/blockVertex/blockVertex.H
index 7d5bb9fbd635c16ca9a6da3774578f8b7640fdab..90a5169f041090f77921bc6374eec49a45233eb0 100644
--- a/src/mesh/blockMesh/blockVertices/blockVertex/blockVertex.H
+++ b/src/mesh/blockMesh/blockVertices/blockVertex/blockVertex.H
@@ -63,10 +63,12 @@ public:
             blockVertex,
             Istream,
             (
+                const dictionary& dict,
+                const label index,
                 const searchableSurfaces& geometry,
                 Istream& is
             ),
-            (geometry, is)
+            (dict, index, geometry, is)
         );
 
 
@@ -81,6 +83,8 @@ public:
         //- New function which constructs and returns pointer to a blockVertex
         static autoPtr<blockVertex> New
         (
+            const dictionary& dict,
+            const label index,
             const searchableSurfaces& geometry,
             Istream&
         );
@@ -89,18 +93,22 @@ public:
         //  PtrLists of blockVertex
         class iNew
         {
+            const dictionary& dict_;
             const searchableSurfaces& geometry_;
+            mutable label index_;
 
         public:
 
-            iNew(const searchableSurfaces& geometry)
+            iNew(const dictionary& dict, const searchableSurfaces& geometry)
             :
-                geometry_(geometry)
+                dict_(dict),
+                geometry_(geometry),
+                index_(0)
             {}
 
             autoPtr<blockVertex> operator()(Istream& is) const
             {
-                return blockVertex::New(geometry_, is);
+                return blockVertex::New(dict_, index_++, geometry_, is);
             }
         };
 
@@ -113,6 +121,12 @@ public:
     // Member Functions
 
         virtual operator point() const = 0;
+
+        //- Read vertex index with optional name lookup
+        static label read(Istream&, const dictionary&);
+
+        //- Write vertex index with optional name backsubstitution
+        static void write(Ostream&, const label, const dictionary&);
 };
 
 
diff --git a/src/mesh/blockMesh/blockVertices/namedVertex/namedVertex.C b/src/mesh/blockMesh/blockVertices/namedVertex/namedVertex.C
new file mode 100644
index 0000000000000000000000000000000000000000..5e9738602ed1b53ee84fd9c94a20684b09d50378
--- /dev/null
+++ b/src/mesh/blockMesh/blockVertices/namedVertex/namedVertex.C
@@ -0,0 +1,78 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+\*---------------------------------------------------------------------------*/
+
+#include "namedVertex.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace blockVertices
+{
+    defineTypeNameAndDebug(namedVertex, 0);
+    addToRunTimeSelectionTable(blockVertex, namedVertex, Istream);
+}
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
+
+Foam::blockVertices::namedVertex::namedVertex
+(
+    const dictionary& dict,
+    const label index,
+    const searchableSurfaces& geometry,
+    Istream& is
+)
+:
+    name_(is),
+    vertexPtr_(blockVertex::New(dict, index, geometry, is))
+{
+    dictionary& d = const_cast<dictionary&>(dict);
+
+    dictionary* varDictPtr = d.subDictPtr("namedVertices");
+    if (varDictPtr)
+    {
+        const_cast<dictionary&>(*varDictPtr).add(name_, index);
+    }
+    else
+    {
+        dictionary varDict;
+        varDict.add(name_, index);
+        d.add("namedVertices", varDict);
+    }
+}
+
+
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
+
+Foam::blockVertices::namedVertex::operator point() const
+{
+    return vertexPtr_().operator point();
+}
+
+
+// ************************************************************************* //
diff --git a/src/mesh/blockMesh/blockVertices/namedVertex/namedVertex.H b/src/mesh/blockMesh/blockVertices/namedVertex/namedVertex.H
new file mode 100644
index 0000000000000000000000000000000000000000..9e30ed15de0c2fcecab3c5ab5b97ca1f83d0fc14
--- /dev/null
+++ b/src/mesh/blockMesh/blockVertices/namedVertex/namedVertex.H
@@ -0,0 +1,104 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+Class
+    Foam::blockVertices::namedVertex
+
+Description
+    Gives name to a vertex.
+
+SourceFiles
+    namedVertex.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef blockVertices_namedVertex_H
+#define blockVertices_namedVertex_H
+
+#include "blockVertex.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace blockVertices
+{
+
+/*---------------------------------------------------------------------------*\
+                           Class namedVertex Declaration
+\*---------------------------------------------------------------------------*/
+
+class namedVertex
+:
+    public blockVertex
+{
+protected:
+
+    // Protected member data
+
+        //- The dictionary variable name for the vertex number
+        word name_;
+
+        //- The vertex location
+        autoPtr<blockVertex> vertexPtr_;
+
+
+public:
+
+    //- Runtime type information
+    TypeName("name");
+
+
+    // Constructors
+
+        //- Construct from Istream setting pointsList
+        namedVertex
+        (
+            const dictionary&,
+            const label index,
+            const searchableSurfaces& geometry,
+            Istream&
+        );
+
+
+    //- Destructor
+    virtual ~namedVertex()
+    {}
+
+
+    // Member Functions
+
+        virtual operator point() const;
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace blockVertices
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/mesh/blockMesh/blockVertices/pointVertex/pointVertex.C b/src/mesh/blockMesh/blockVertices/pointVertex/pointVertex.C
index 4b3120d98b2a3bea482f4366650d0ec5293ad573..4af95df1637f5aec1a8fe61a4a96a055dda5deb2 100644
--- a/src/mesh/blockMesh/blockVertices/pointVertex/pointVertex.C
+++ b/src/mesh/blockMesh/blockVertices/pointVertex/pointVertex.C
@@ -42,6 +42,8 @@ namespace blockVertices
 
 Foam::blockVertices::pointVertex::pointVertex
 (
+    const dictionary&,
+    const label index,
     const searchableSurfaces& geometry,
     Istream& is
 )
diff --git a/src/mesh/blockMesh/blockVertices/pointVertex/pointVertex.H b/src/mesh/blockMesh/blockVertices/pointVertex/pointVertex.H
index 1179c66bd5d8e2da6c70d9f7cb68276f1f0e6d21..929f92a25c201acc8caebb0ebd0da562923100a5 100644
--- a/src/mesh/blockMesh/blockVertices/pointVertex/pointVertex.H
+++ b/src/mesh/blockMesh/blockVertices/pointVertex/pointVertex.H
@@ -70,6 +70,8 @@ public:
         //- Construct from Istream setting pointsList
         pointVertex
         (
+            const dictionary&,
+            const label index,
             const searchableSurfaces& geometry,
             Istream&
         );
diff --git a/src/mesh/blockMesh/blockVertices/projectVertex/projectVertex.C b/src/mesh/blockMesh/blockVertices/projectVertex/projectVertex.C
index 04cff7d250343172f36a0b60ea58c2135aed0cba..f5d23fc50c9f1c21cc92a9678c4970c742ce3a28 100644
--- a/src/mesh/blockMesh/blockVertices/projectVertex/projectVertex.C
+++ b/src/mesh/blockMesh/blockVertices/projectVertex/projectVertex.C
@@ -45,11 +45,13 @@ namespace blockVertices
 
 Foam::blockVertices::projectVertex::projectVertex
 (
+    const dictionary& dict,
+    const label index,
     const searchableSurfaces& geometry,
     Istream& is
 )
 :
-    pointVertex(geometry, is),
+    pointVertex(dict, index, geometry, is),
     geometry_(geometry)
 {
     wordList names(is);
@@ -79,8 +81,11 @@ Foam::blockVertices::projectVertex::operator point() const
 
 
     // Note: how far do we need to search? Probably not further than
-    //       span of surfaces themselves.
+    //       span of surfaces themselves. Make sure to limit in case
+    //       of e.g. searchablePlane which has infinite bb.
     boundBox bb(searchableSurfacesQueries::bounds(geometry_, surfaces_));
+    bb.min() = max(bb.min(), point(-GREAT, -GREAT, -GREAT));
+    bb.max() = min(bb.max(), point(GREAT, GREAT, GREAT));
 
     searchableSurfacesQueries::findNearest
     (
diff --git a/src/mesh/blockMesh/blockVertices/projectVertex/projectVertex.H b/src/mesh/blockMesh/blockVertices/projectVertex/projectVertex.H
index 929b6a68ebe646fb6136e60cf3b520d5b517af42..d47dce6e8cbd89403986fce2f31f9b2c266bda3f 100644
--- a/src/mesh/blockMesh/blockVertices/projectVertex/projectVertex.H
+++ b/src/mesh/blockMesh/blockVertices/projectVertex/projectVertex.H
@@ -81,6 +81,8 @@ public:
         //- Construct from Istream setting pointsList
         projectVertex
         (
+            const dictionary&,
+            const label index,
             const searchableSurfaces& geometry,
             Istream&
         );
diff --git a/src/mesh/blockMesh/blocks/block/block.C b/src/mesh/blockMesh/blocks/block/block.C
new file mode 100644
index 0000000000000000000000000000000000000000..5d75aa5574f40903e41c973e6cd79b3623252eb2
--- /dev/null
+++ b/src/mesh/blockMesh/blocks/block/block.C
@@ -0,0 +1,119 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+\*---------------------------------------------------------------------------*/
+
+#include "block.H"
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+namespace Foam
+{
+    defineTypeNameAndDebug(block, 0);
+    defineRunTimeSelectionTable(block, Istream);
+}
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
+
+Foam::block::block
+(
+    const dictionary& dict,
+    const label index,
+    const pointField& vertices,
+    const blockEdgeList& edges,
+    const blockFaceList& faces,
+    Istream& is
+)
+:
+    blockDescriptor(dict, index, vertices, edges, faces, is)
+{
+    createPoints();
+    createBoundary();
+}
+
+
+Foam::block::block(const blockDescriptor& blockDesc)
+:
+    blockDescriptor(blockDesc)
+{
+    createPoints();
+    createBoundary();
+}
+
+
+Foam::autoPtr<Foam::block> Foam::block::New
+(
+    const dictionary& dict,
+    const label index,
+    const pointField& points,
+    const blockEdgeList& edges,
+    const blockFaceList& faces,
+    Istream& is
+)
+{
+    if (debug)
+    {
+        InfoInFunction << "Constructing block" << endl;
+    }
+
+    const word blockOrCellShapeType(is);
+
+    IstreamConstructorTable::iterator cstrIter =
+        IstreamConstructorTablePtr_->find(blockOrCellShapeType);
+
+    if (cstrIter == IstreamConstructorTablePtr_->end())
+    {
+        is.putBack(blockOrCellShapeType);
+        return autoPtr<block>(new block(dict, index, points, edges, faces, is));
+    }
+    else
+    {
+        return autoPtr<block>
+        (
+            cstrIter()
+            (
+                dict,
+                index,
+                points,
+                edges,
+                faces,
+                is
+            )
+        );
+    }
+}
+
+
+// * * * * * * * * * * * * * * * IOstream Operators  * * * * * * * * * * * * //
+
+Foam::Ostream& Foam::operator<<(Ostream& os, const block& b)
+{
+    os << b.points() << nl
+       << b.cells() << nl
+       << b.boundaryPatches() << endl;
+
+    return os;
+}
+
+
+// ************************************************************************* //
diff --git a/src/mesh/blockMesh/block/block.H b/src/mesh/blockMesh/blocks/block/block.H
similarity index 78%
rename from src/mesh/blockMesh/block/block.H
rename to src/mesh/blockMesh/blocks/block/block.H
index 7b55c5f59f1afb29765d7969b8b6e5170b0e9445..fb3012016d55d8b9ee1f5ad9789158c0ea4d4069 100644
--- a/src/mesh/blockMesh/block/block.H
+++ b/src/mesh/blockMesh/blocks/block/block.H
@@ -91,11 +91,36 @@ class block
 
 public:
 
+    //- Runtime type information
+    TypeName("block");
+
+
+    // Declare run-time constructor selection tables
+
+        declareRunTimeSelectionTable
+        (
+            autoPtr,
+            block,
+            Istream,
+            (
+                const dictionary& dict,
+                const label index,
+                const pointField& vertices,
+                const blockEdgeList& edges,
+                const blockFaceList& faces,
+                Istream& is
+            ),
+            (dict, index, vertices, edges, faces, is)
+        );
+
+
     // Constructors
 
         //- Construct from components with Istream
         block
         (
+            const dictionary& dict,
+            const label index,
             const pointField& vertices,
             const blockEdgeList& edges,
             const blockFaceList& faces,
@@ -112,35 +137,56 @@ public:
             return autoPtr<block>(nullptr);
         }
 
+        //- New function which constructs and returns pointer to a block
+        static autoPtr<block> New
+        (
+            const dictionary& dict,
+            const label index,
+            const pointField& points,
+            const blockEdgeList& edges,
+            const blockFaceList& faces,
+            Istream&
+        );
+
         //- Class used for the read-construction of
         //  PtrLists of blocks
         class iNew
         {
+            const dictionary& dict_;
             const pointField& points_;
             const blockEdgeList& edges_;
             const blockFaceList& faces_;
+            mutable label index_;
 
         public:
 
             iNew
             (
+                const dictionary& dict,
                 const pointField& points,
                 const blockEdgeList& edges,
                 const blockFaceList& faces
             )
             :
+                dict_(dict),
                 points_(points),
                 edges_(edges),
-                faces_(faces)
+                faces_(faces),
+                index_(0)
             {}
 
             autoPtr<block> operator()(Istream& is) const
             {
-                return autoPtr<block>(new block(points_, edges_, faces_, is));
+                return block::New(dict_, index_++, points_, edges_, faces_, is);
             }
         };
 
 
+    //- Destructor
+    virtual ~block()
+    {}
+
+
     // Member Functions
 
         // Access
diff --git a/src/mesh/blockMesh/block/blockCreate.C b/src/mesh/blockMesh/blocks/block/blockCreate.C
similarity index 100%
rename from src/mesh/blockMesh/block/blockCreate.C
rename to src/mesh/blockMesh/blocks/block/blockCreate.C
diff --git a/src/mesh/blockMesh/block/blockI.H b/src/mesh/blockMesh/blocks/block/blockI.H
similarity index 100%
rename from src/mesh/blockMesh/block/blockI.H
rename to src/mesh/blockMesh/blocks/block/blockI.H
diff --git a/src/mesh/blockMesh/block/blockList.H b/src/mesh/blockMesh/blocks/block/blockList.H
similarity index 95%
rename from src/mesh/blockMesh/block/blockList.H
rename to src/mesh/blockMesh/blocks/block/blockList.H
index bfca6c9c60848ccaad05a9644190b634946b7ac4..80b8a328af597b678718eb4c97c456d05a2a860e 100644
--- a/src/mesh/blockMesh/block/blockList.H
+++ b/src/mesh/blockMesh/blocks/block/blockList.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -53,4 +53,3 @@ typedef PtrList<block> blockList;
 #endif
 
 // ************************************************************************* //
-
diff --git a/src/mesh/blockMesh/blocks/namedBlock/namedBlock.C b/src/mesh/blockMesh/blocks/namedBlock/namedBlock.C
new file mode 100644
index 0000000000000000000000000000000000000000..023638b75ed724d2d7ee2f354c3fb1a8718ab212
--- /dev/null
+++ b/src/mesh/blockMesh/blocks/namedBlock/namedBlock.C
@@ -0,0 +1,71 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+\*---------------------------------------------------------------------------*/
+
+#include "namedBlock.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace blocks
+{
+    defineTypeNameAndDebug(namedBlock, 0);
+    addToRunTimeSelectionTable(block, namedBlock, Istream);
+}
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
+
+Foam::blocks::namedBlock::namedBlock
+(
+    const dictionary& dict,
+    const label index,
+    const pointField& vertices,
+    const blockEdgeList& edges,
+    const blockFaceList& faces,
+    Istream& is
+)
+:
+    word(is),
+    block(dict, index, vertices, edges, faces, is)
+{
+    dictionary& d = const_cast<dictionary&>(dict);
+    dictionary* varDictPtr = d.subDictPtr("namedBlocks");
+    if (varDictPtr)
+    {
+        const_cast<dictionary&>(*varDictPtr).add(*this, index);
+    }
+    else
+    {
+        dictionary varDict;
+        varDict.add(*this, index);
+        d.add("namedBlocks", varDict);
+    }
+}
+
+
+// ************************************************************************* //
diff --git a/src/mesh/blockMesh/blocks/namedBlock/namedBlock.H b/src/mesh/blockMesh/blocks/namedBlock/namedBlock.H
new file mode 100644
index 0000000000000000000000000000000000000000..992cbb0526517212da2915692ecc159ceb4e32b2
--- /dev/null
+++ b/src/mesh/blockMesh/blocks/namedBlock/namedBlock.H
@@ -0,0 +1,91 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+Class
+    Foam::blocks::namedBlock
+
+Description
+    Gives name to a block.
+
+SourceFiles
+    namedBlock.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef blocks_namedBlock_H
+#define blocks_namedBlock_H
+
+#include "block.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace blocks
+{
+
+/*---------------------------------------------------------------------------*\
+                           Class namedBlock Declaration
+\*---------------------------------------------------------------------------*/
+
+class namedBlock
+:
+    public word,
+    public block
+{
+public:
+
+    //- Runtime type information
+    TypeName("name");
+
+
+    // Constructors
+
+        //- Construct from Istream setting pointsList
+        namedBlock
+        (
+            const dictionary& dict,
+            const label index,
+            const pointField& vertices,
+            const blockEdgeList& edges,
+            const blockFaceList& faces,
+            Istream& is
+        );
+
+
+    //- Destructor
+    virtual ~namedBlock()
+    {}
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace blocks
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/mesh/blockMesh/searchableExtrudedCircle/searchableExtrudedCircle.C b/src/mesh/blockMesh/searchableExtrudedCircle/searchableExtrudedCircle.C
new file mode 100644
index 0000000000000000000000000000000000000000..9656656b77b726405f0b19bfe9ba227d7b100872
--- /dev/null
+++ b/src/mesh/blockMesh/searchableExtrudedCircle/searchableExtrudedCircle.C
@@ -0,0 +1,437 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+\*---------------------------------------------------------------------------*/
+
+#include "searchableExtrudedCircle.H"
+#include "addToRunTimeSelectionTable.H"
+#include "Time.H"
+#include "edgeMesh.H"
+#include "indexedOctree.H"
+#include "treeDataEdge.H"
+#include "linearInterpolationWeights.H"
+#include "quaternion.H"
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+namespace Foam
+{
+    defineTypeNameAndDebug(searchableExtrudedCircle, 0);
+    addToRunTimeSelectionTable
+    (
+        searchableSurface,
+        searchableExtrudedCircle,
+        dict
+    );
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
+
+Foam::searchableExtrudedCircle::searchableExtrudedCircle
+(
+    const IOobject& io,
+    const dictionary& dict
+)
+:
+    searchableSurface(io),
+    eMeshPtr_
+    (
+        edgeMesh::New
+        (
+            IOobject
+            (
+                dict.lookup("file"),                // name
+                io.time().constant(),               // instance
+                "triSurface",                       // local
+                io.time(),                          // registry
+                IOobject::MUST_READ,
+                IOobject::NO_WRITE,
+                false
+            ).objectPath()
+        )
+    ),
+    radius_(readScalar(dict.lookup("radius")))
+{
+    const edgeMesh& eMesh = eMeshPtr_();
+
+    const pointField& points = eMesh.points();
+    const edgeList& edges = eMesh.edges();
+    bounds() = boundBox(points, false);
+
+    vector halfSpan(0.5*bounds().span());
+    point ctr(bounds().midpoint());
+
+    bounds().min() = ctr - mag(halfSpan)*vector(1, 1, 1);
+    bounds().max() = ctr + mag(halfSpan)*vector(1, 1, 1);
+
+    // Calculate bb of all points
+    treeBoundBox bb(bounds());
+
+    // Slightly extended bb. Slightly off-centred just so on symmetric
+    // geometry there are less face/edge aligned items.
+    bb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
+    bb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
+
+    edgeTree_.reset
+    (
+        new indexedOctree<treeDataEdge>
+        (
+            treeDataEdge
+            (
+                false,                  // do not cache bb
+                edges,
+                points,
+                identity(edges.size())
+            ),
+            bb,     // overall search domain
+            8,      // maxLevel
+            10,     // leafsize
+            3.0     // duplicity
+        )
+    );
+}
+
+
+// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
+
+Foam::searchableExtrudedCircle::~searchableExtrudedCircle()
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
+
+const Foam::wordList& Foam::searchableExtrudedCircle::regions() const
+{
+    if (regions_.empty())
+    {
+        regions_.setSize(1);
+        regions_[0] = "region0";
+    }
+    return regions_;
+}
+
+
+Foam::label Foam::searchableExtrudedCircle::size() const
+{
+    return eMeshPtr_().points().size();
+}
+
+
+Foam::tmp<Foam::pointField> Foam::searchableExtrudedCircle::coordinates() const
+{
+    return eMeshPtr_().points();
+}
+
+
+void Foam::searchableExtrudedCircle::boundingSpheres
+(
+    pointField& centres,
+    scalarField& radiusSqr
+) const
+{
+    centres = eMeshPtr_().points();
+    radiusSqr.setSize(centres.size());
+    radiusSqr = Foam::sqr(radius_);
+    // Add a bit to make sure all points are tested inside
+    radiusSqr += Foam::sqr(SMALL);
+}
+
+
+void Foam::searchableExtrudedCircle::findNearest
+(
+    const pointField& samples,
+    const scalarField& nearestDistSqr,
+    List<pointIndexHit>& info
+) const
+{
+    const indexedOctree<treeDataEdge>& tree = edgeTree_();
+
+    info.setSize(samples.size());
+
+    forAll(samples, i)
+    {
+        info[i] = tree.findNearest(samples[i], nearestDistSqr[i]);
+
+        if (info[i].hit())
+        {
+            vector d(samples[i]-info[i].hitPoint());
+            info[i].setPoint(info[i].hitPoint() + d/mag(d)*radius_);
+        }
+    }
+}
+
+
+void Foam::searchableExtrudedCircle::findParametricNearest
+(
+    const point& start,
+    const point& end,
+    const scalarField& rawLambdas,
+    const scalarField& nearestDistSqr,
+    List<pointIndexHit>& info
+) const
+{
+    const edgeMesh& mesh = eMeshPtr_();
+    const indexedOctree<treeDataEdge>& tree = edgeTree_();
+    const edgeList& edges = mesh.edges();
+    const pointField& points = mesh.points();
+    const labelListList& pointEdges = mesh.pointEdges();
+
+    const scalar maxDistSqr(Foam::magSqr(bounds().span()));
+
+    // Normalise lambdas
+    const scalarField lambdas
+    (
+        (rawLambdas-rawLambdas[0])
+       /(rawLambdas.last()-rawLambdas[0])
+    );
+
+
+    // Nearest point on curve and local axis direction
+    pointField curvePoints(lambdas.size());
+    vectorField axialVecs(lambdas.size());
+
+    const pointIndexHit startInfo = tree.findNearest(start, maxDistSqr);
+    curvePoints[0] = startInfo.hitPoint();
+    axialVecs[0] = edges[startInfo.index()].vec(points);
+
+    const pointIndexHit endInfo = tree.findNearest(end, maxDistSqr);
+    curvePoints.last() = endInfo.hitPoint();
+    axialVecs.last() = edges[endInfo.index()].vec(points);
+
+
+
+    scalarField curveLambdas(points.size(), -1.0);
+
+    {
+        scalar endDistance = -1.0;
+
+        // Determine edge lengths walking from start to end.
+
+        const point& start = curvePoints[0];
+        const point& end = curvePoints.last();
+
+        label edgei = startInfo.index();
+        const edge& startE = edges[edgei];
+
+        label pointi = startE[0];
+        if ((startE.vec(points)&(end-start)) > 0)
+        {
+            pointi = startE[1];
+        }
+
+        curveLambdas[pointi] = mag(points[pointi]-curvePoints[0]);
+        label otherPointi = startE.otherVertex(pointi);
+        curveLambdas[otherPointi] = -mag(points[otherPointi]-curvePoints[0]);
+
+        //Pout<< "for point:" << points[pointi] << " have distance "
+        //    << curveLambdas[pointi] << endl;
+
+
+        while (true)
+        {
+            const labelList& pEdges = pointEdges[pointi];
+            if (pEdges.size() == 1)
+            {
+                break;
+            }
+            else if (pEdges.size() != 2)
+            {
+                FatalErrorInFunction << "Curve " << name()
+                    << " is not a single path. This is not supported"
+                    << exit(FatalError);
+                break;
+            }
+
+            label oldEdgei = edgei;
+            if (pEdges[0] == oldEdgei)
+            {
+                edgei = pEdges[1];
+            }
+            else
+            {
+                edgei = pEdges[0];
+            }
+
+            if (edgei == endInfo.index())
+            {
+                endDistance = curveLambdas[pointi] + mag(end-points[pointi]);
+
+                //Pout<< "Found end edge:" << edges[edgei].centre(points)
+                //    << " endPt:" << end
+                //    << " point before:" << points[pointi]
+                //    << " accumulated length:" << endDistance << endl;
+            }
+
+
+            label oldPointi = pointi;
+            pointi = edges[edgei].otherVertex(oldPointi);
+
+            if (curveLambdas[pointi] >= 0)
+            {
+                break;
+            }
+
+            curveLambdas[pointi] =
+                curveLambdas[oldPointi] + edges[edgei].mag(points);
+        }
+
+        // Normalise curveLambdas
+        forAll(curveLambdas, i)
+        {
+            if (curveLambdas[i] >= 0)
+            {
+                curveLambdas[i] /= endDistance;
+            }
+        }
+    }
+
+
+
+    // Interpolation engine
+    linearInterpolationWeights interpolator(curveLambdas);
+
+    // Find wanted location along curve
+    labelList indices;
+    scalarField weights;
+    for (label i = 1; i < curvePoints.size()-1; i++)
+    {
+        interpolator.valueWeights(lambdas[i], indices, weights);
+
+        if (indices.size() == 1)
+        {
+            // On outside of curve. Choose one of the connected edges.
+            label pointi = indices[0];
+            const point& p0 = points[pointi];
+            label edge0 = pointEdges[pointi][0];
+            const edge& e0 = edges[edge0];
+            axialVecs[i] = e0.vec(points);
+            curvePoints[i] = weights[0]*p0;
+        }
+        else if (indices.size() == 2)
+        {
+            const point& p0 = points[indices[0]];
+            const point& p1 = points[indices[1]];
+            axialVecs[i] = p1-p0;
+            curvePoints[i] = weights[0]*p0+weights[1]*p1;
+        }
+    }
+    axialVecs /= mag(axialVecs);
+
+
+    // Now we have the lambdas, curvePoints and axialVecs.
+
+
+
+    info.setSize(lambdas.size());
+    info = pointIndexHit();
+
+    // Given the current lambdas interpolate radial direction inbetween
+    // endpoints (all projected onto the starting coordinate system)
+    quaternion qStart;
+    vector radialStart;
+    {
+        radialStart = start-curvePoints[0];
+        radialStart -= (radialStart&axialVecs[0])*axialVecs[0];
+        radialStart /= mag(radialStart);
+        qStart = quaternion(radialStart, 0.0);
+
+        info[0] = pointIndexHit(true, start, 0);
+    }
+
+    quaternion qProjectedEnd;
+    {
+        vector radialEnd(end-curvePoints.last());
+        radialEnd -= (radialEnd&axialVecs.last())*axialVecs.last();
+        radialEnd /= mag(radialEnd);
+
+        vector projectedEnd = radialEnd;
+        projectedEnd -= (projectedEnd&axialVecs[0])*axialVecs[0];
+        projectedEnd /= mag(projectedEnd);
+        qProjectedEnd = quaternion(projectedEnd, 0.0);
+
+        info.last() = pointIndexHit(true, end, 0);
+    }
+
+    for (label i = 1; i < lambdas.size()-1; i++)
+    {
+        quaternion q(slerp(qStart, qProjectedEnd, lambdas[i]));
+        vector radialDir(q.transform(radialStart));
+
+        radialDir -= (radialDir&axialVecs[i])*axialVecs.last();
+        radialDir /= mag(radialDir);
+
+        info[i] = pointIndexHit(true, curvePoints[i]+radius_*radialDir, 0);
+    }
+}
+
+
+void Foam::searchableExtrudedCircle::getRegion
+(
+    const List<pointIndexHit>& info,
+    labelList& region
+) const
+{
+    region.setSize(info.size());
+    region = 0;
+}
+
+
+void Foam::searchableExtrudedCircle::getNormal
+(
+    const List<pointIndexHit>& info,
+    vectorField& normal
+) const
+{
+    const edgeMesh& mesh = eMeshPtr_();
+    const indexedOctree<treeDataEdge>& tree = edgeTree_();
+    const edgeList& edges = mesh.edges();
+    const pointField& points = mesh.points();
+
+    normal.setSize(info.size());
+    normal = Zero;
+
+    forAll(info, i)
+    {
+        if (info[i].hit())
+        {
+            // Find nearest on curve
+            pointIndexHit curvePt = tree.findNearest
+            (
+                info[i].hitPoint(),
+                Foam::magSqr(bounds().span())
+            );
+
+            normal[i] = info[i].hitPoint()-curvePt.hitPoint();
+
+            // Subtract axial direction
+            vector axialVec = edges[curvePt.index()].vec(points);
+            axialVec /= mag(axialVec);
+            normal[i] -= (normal[i]&axialVec)*axialVec;
+            normal[i] /= mag(normal[i]);
+        }
+    }
+}
+
+
+// ************************************************************************* //
diff --git a/src/mesh/blockMesh/searchableExtrudedCircle/searchableExtrudedCircle.H b/src/mesh/blockMesh/searchableExtrudedCircle/searchableExtrudedCircle.H
new file mode 100644
index 0000000000000000000000000000000000000000..864638dbc171ebc42ffa0d62de561525876b5dc9
--- /dev/null
+++ b/src/mesh/blockMesh/searchableExtrudedCircle/searchableExtrudedCircle.H
@@ -0,0 +1,236 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+Class
+    Foam::searchableExtrudedCircle
+
+Description
+    Searching on edgemesh with constant radius
+
+SourceFiles
+    searchableExtrudedCircle.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef searchableExtrudedCircle_H
+#define searchableExtrudedCircle_H
+
+#include "treeBoundBox.H"
+#include "searchableSurface.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// Forward declaration of classes
+class edgeMesh;
+class treeDataEdge;
+template <class Type> class indexedOctree;
+
+/*---------------------------------------------------------------------------*\
+                  Class searchableExtrudedCircle Declaration
+\*---------------------------------------------------------------------------*/
+
+class searchableExtrudedCircle
+:
+    public searchableSurface
+{
+    // Private Member Data
+
+        //- Feature
+        autoPtr<edgeMesh> eMeshPtr_;
+
+        //- Search structure
+        autoPtr<indexedOctree<treeDataEdge>> edgeTree_;
+
+        //- Radius
+        const scalar radius_;
+
+        //- Names of regions
+        mutable wordList regions_;
+
+
+    // Private Member Functions
+
+        //- Disallow default bitwise copy construct
+        searchableExtrudedCircle(const searchableExtrudedCircle&);
+
+        //- Disallow default bitwise assignment
+        void operator=(const searchableExtrudedCircle&);
+
+
+public:
+
+    //- Runtime type information
+    TypeName("searchableExtrudedCircle");
+
+
+    // Constructors
+
+        //- Construct from dictionary (used by searchableSurface)
+        searchableExtrudedCircle
+        (
+            const IOobject& io,
+            const dictionary& dict
+        );
+
+
+    //- Destructor
+    virtual ~searchableExtrudedCircle();
+
+
+    // Member Functions
+
+        virtual const wordList& regions() const;
+
+        //- Whether supports volume type below
+        virtual bool hasVolumeType() const
+        {
+            return true;
+        }
+
+        //- Range of local indices that can be returned.
+        virtual label size() const;
+
+        //- Get representative set of element coordinates
+        //  Usually the element centres (should be of length size()).
+        virtual tmp<pointField> coordinates() const;
+
+        //- Get bounding spheres (centre and radius squared), one per element.
+        //  Any point on element is guaranteed to be inside.
+        virtual void boundingSpheres
+        (
+            pointField& centres,
+            scalarField& radiusSqr
+        ) const;
+
+        //- Get the points that define the surface.
+        virtual tmp<pointField> points() const
+        {
+            return coordinates();
+        }
+
+        //- Does any part of the surface overlap the supplied bound box?
+        virtual bool overlaps(const boundBox& bb) const
+        {
+            NotImplemented;
+            return false;
+        }
+
+
+        // Multiple point queries.
+
+            virtual void findNearest
+            (
+                const pointField& sample,
+                const scalarField& nearestDistSqr,
+                List<pointIndexHit>&
+            ) const;
+
+            //- Unique to parametric geometry: given points find
+            //  an interpolated (along the curve) point on the surface.
+            //  The lambdas[0] is equivalent for start, lambdas.last()
+            //  is equivalent for end.
+            virtual void findParametricNearest
+            (
+                const point& start,
+                const point& end,
+                const scalarField& lambdas,
+                const scalarField& nearestDistSqr,
+                List<pointIndexHit>&
+            ) const;
+
+            virtual void findLine
+            (
+                const pointField& start,
+                const pointField& end,
+                List<pointIndexHit>&
+            ) const
+            {
+                NotImplemented;
+            }
+
+            virtual void findLineAny
+            (
+                const pointField& start,
+                const pointField& end,
+                List<pointIndexHit>&
+            ) const
+            {
+                NotImplemented;
+            }
+
+            //- Get all intersections in order from start to end.
+            virtual void findLineAll
+            (
+                const pointField& start,
+                const pointField& end,
+                List<List<pointIndexHit>>&
+            ) const
+            {
+                NotImplemented;
+            }
+
+            //- From a set of points and indices get the region
+            virtual void getRegion
+            (
+                const List<pointIndexHit>&,
+                labelList& region
+            ) const;
+
+            //- From a set of points and indices get the normal
+            virtual void getNormal
+            (
+                const List<pointIndexHit>&,
+                vectorField& normal
+            ) const;
+
+            //- Determine type (inside/outside/mixed) for point. unknown if
+            //  cannot be determined (e.g. non-manifold surface)
+            virtual void getVolumeType
+            (
+                const pointField&,
+                List<volumeType>&
+            ) const
+            {
+                NotImplemented;
+            }
+
+            bool writeData(Ostream&) const
+            {
+                NotImplemented;
+                return false;
+            }
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/mesh/snappyHexMesh/refinementFeatures/refinementFeatures.C b/src/mesh/snappyHexMesh/refinementFeatures/refinementFeatures.C
index fb6bf7601b7a4e80bae13abac1c9e0adeb75656b..aa05d3b8cba385bfa948df9deb2dd29c023aae30 100644
--- a/src/mesh/snappyHexMesh/refinementFeatures/refinementFeatures.C
+++ b/src/mesh/snappyHexMesh/refinementFeatures/refinementFeatures.C
@@ -299,59 +299,6 @@ void Foam::refinementFeatures::buildTrees(const label featI)
 }
 
 
-const Foam::PtrList<Foam::indexedOctree<Foam::treeDataEdge>>&
-Foam::refinementFeatures::regionEdgeTrees() const
-{
-    if (!regionEdgeTreesPtr_.valid())
-    {
-        regionEdgeTreesPtr_.reset
-        (
-            new PtrList<indexedOctree<treeDataEdge>>(size())
-        );
-        PtrList<indexedOctree<treeDataEdge>>& trees = regionEdgeTreesPtr_();
-
-        forAll(*this, featI)
-        {
-            const extendedEdgeMesh& eMesh = operator[](featI);
-            const pointField& points = eMesh.points();
-            const edgeList& edges = eMesh.edges();
-
-            // Calculate bb of all points
-            treeBoundBox bb(points);
-
-            // Random number generator. Bit dodgy since not exactly random ;-)
-            Random rndGen(65431);
-
-            // Slightly extended bb. Slightly off-centred just so on symmetric
-            // geometry there are less face/edge aligned items.
-            bb = bb.extend(rndGen, 1e-4);
-            bb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
-            bb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
-
-            trees.set
-            (
-                featI,
-                new indexedOctree<treeDataEdge>
-                (
-                    treeDataEdge
-                    (
-                        false,                  // do not cache bb
-                        edges,
-                        points,
-                        eMesh.regionEdges()
-                    ),
-                    bb,     // overall search domain
-                    8,      // maxLevel
-                    10,     // leafsize
-                    3.0     // duplicity
-                )
-            );
-        }
-    }
-    return regionEdgeTreesPtr_();
-}
-
-
 // Find maximum level of a shell.
 void Foam::refinementFeatures::findHigherLevel
 (
@@ -425,6 +372,61 @@ void Foam::refinementFeatures::findHigherLevel
 }
 
 
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
+
+const Foam::PtrList<Foam::indexedOctree<Foam::treeDataEdge>>&
+Foam::refinementFeatures::regionEdgeTrees() const
+{
+    if (!regionEdgeTreesPtr_.valid())
+    {
+        regionEdgeTreesPtr_.reset
+        (
+            new PtrList<indexedOctree<treeDataEdge>>(size())
+        );
+        PtrList<indexedOctree<treeDataEdge>>& trees = regionEdgeTreesPtr_();
+
+        forAll(*this, featI)
+        {
+            const extendedEdgeMesh& eMesh = operator[](featI);
+            const pointField& points = eMesh.points();
+            const edgeList& edges = eMesh.edges();
+
+            // Calculate bb of all points
+            treeBoundBox bb(points);
+
+            // Random number generator. Bit dodgy since not exactly random ;-)
+            Random rndGen(65431);
+
+            // Slightly extended bb. Slightly off-centred just so on symmetric
+            // geometry there are less face/edge aligned items.
+            bb = bb.extend(rndGen, 1e-4);
+            bb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
+            bb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
+
+            trees.set
+            (
+                featI,
+                new indexedOctree<treeDataEdge>
+                (
+                    treeDataEdge
+                    (
+                        false,                  // do not cache bb
+                        edges,
+                        points,
+                        eMesh.regionEdges()
+                    ),
+                    bb,     // overall search domain
+                    8,      // maxLevel
+                    10,     // leafsize
+                    3.0     // duplicity
+                )
+            );
+        }
+    }
+    return regionEdgeTreesPtr_();
+}
+
+
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
 Foam::refinementFeatures::refinementFeatures
diff --git a/src/mesh/snappyHexMesh/refinementFeatures/refinementFeatures.H b/src/mesh/snappyHexMesh/refinementFeatures/refinementFeatures.H
index 062e8ddbf99e28314180961f3f7e3ad45a502eb6..6147c81bcf311dbcac00a69ea6550a0f2279dfd8 100644
--- a/src/mesh/snappyHexMesh/refinementFeatures/refinementFeatures.H
+++ b/src/mesh/snappyHexMesh/refinementFeatures/refinementFeatures.H
@@ -53,8 +53,6 @@ class refinementFeatures
 :
     public PtrList<extendedFeatureEdgeMesh>
 {
-private:
-
     // Private data
 
         //- Per shell the list of ranges
diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethod.C b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethod.C
index 68c561b2f0b216badfd5f5fc2d6c8aa87671b1e6..76b39fa700c495041e358e677a0b4126181b27e6 100644
--- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethod.C
+++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethod.C
@@ -28,7 +28,7 @@ License
 #include "mapDistribute.H"
 #include "unitConversion.H"
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 template<class SourcePatch, class TargetPatch>
 void Foam::AMIMethod<SourcePatch, TargetPatch>::checkPatches() const
diff --git a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C
index fe47d9aa101282357bd7d830fd0257ed1f817b7b..74015e3ece131becd743119842c206a20cb54d61 100644
--- a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C
+++ b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C
@@ -71,44 +71,6 @@ Foam::vector Foam::cyclicAMIPolyPatch::findFaceNormalMaxRadius
 }
 
 
-// * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * * //
-
-void Foam::cyclicAMIPolyPatch::calcTransforms()
-{
-    const cyclicAMIPolyPatch& half0 = *this;
-    vectorField half0Areas(half0.size());
-    forAll(half0, facei)
-    {
-        half0Areas[facei] = half0[facei].normal(half0.points());
-    }
-
-    const cyclicAMIPolyPatch& half1 = neighbPatch();
-    vectorField half1Areas(half1.size());
-    forAll(half1, facei)
-    {
-        half1Areas[facei] = half1[facei].normal(half1.points());
-    }
-
-    calcTransforms
-    (
-        half0,
-        half0.faceCentres(),
-        half0Areas,
-        half1.faceCentres(),
-        half1Areas
-    );
-
-    if (debug)
-    {
-        Pout<< "calcTransforms() : patch: " << name() << nl
-            << "    forwardT = " << forwardT() << nl
-            << "    reverseT = " << reverseT() << nl
-            << "    separation = " << separation() << nl
-            << "    collocated = " << collocated() << nl << endl;
-    }
-}
-
-
 void Foam::cyclicAMIPolyPatch::calcTransforms
 (
     const primitivePatch& half0,
@@ -323,7 +285,7 @@ void Foam::cyclicAMIPolyPatch::calcTransforms
 }
 
 
-// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * * //
 
 void Foam::cyclicAMIPolyPatch::resetAMI
 (
@@ -399,6 +361,42 @@ void Foam::cyclicAMIPolyPatch::resetAMI
 }
 
 
+void Foam::cyclicAMIPolyPatch::calcTransforms()
+{
+    const cyclicAMIPolyPatch& half0 = *this;
+    vectorField half0Areas(half0.size());
+    forAll(half0, facei)
+    {
+        half0Areas[facei] = half0[facei].normal(half0.points());
+    }
+
+    const cyclicAMIPolyPatch& half1 = neighbPatch();
+    vectorField half1Areas(half1.size());
+    forAll(half1, facei)
+    {
+        half1Areas[facei] = half1[facei].normal(half1.points());
+    }
+
+    calcTransforms
+    (
+        half0,
+        half0.faceCentres(),
+        half0Areas,
+        half1.faceCentres(),
+        half1Areas
+    );
+
+    if (debug)
+    {
+        Pout<< "calcTransforms() : patch: " << name() << nl
+            << "    forwardT = " << forwardT() << nl
+            << "    reverseT = " << reverseT() << nl
+            << "    separation = " << separation() << nl
+            << "    collocated = " << collocated() << nl << endl;
+    }
+}
+
+
 void Foam::cyclicAMIPolyPatch::initGeometry(PstreamBuffers& pBufs)
 {
     // The AMI is no longer valid. Leave it up to demand-driven calculation
diff --git a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.H b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.H
index cb36eb0af0de364eff47b2dd9e28a71996300d56..6963aa9d253e5dc091f6c21fad62accb8089653f 100644
--- a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.H
+++ b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.H
@@ -53,9 +53,6 @@ class cyclicAMIPolyPatch
 :
     public coupledPolyPatch
 {
-
-private:
-
     // Private Member Functions
 
         //- Return normal of face at max distance from rotation axis
diff --git a/src/meshTools/algorithms/MeshWave/FaceCellWave.C b/src/meshTools/algorithms/MeshWave/FaceCellWave.C
index 8518350e809094ed405beb1ac19024df0c512a81..f76d71657456766cb37b3fc8fc5c716e8860ca6a 100644
--- a/src/meshTools/algorithms/MeshWave/FaceCellWave.C
+++ b/src/meshTools/algorithms/MeshWave/FaceCellWave.C
@@ -104,7 +104,7 @@ namespace Foam
 }
 
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 template<class Type, class TrackingData>
 bool Foam::FaceCellWave<Type, TrackingData>::updateCell
diff --git a/src/meshTools/algorithms/MeshWave/FaceCellWave.H b/src/meshTools/algorithms/MeshWave/FaceCellWave.H
index 0653e255c13debe0d44745eff6529dc47e73aac0..f86aab57d04a6b7d3d71284a1c02a845a501776e 100644
--- a/src/meshTools/algorithms/MeshWave/FaceCellWave.H
+++ b/src/meshTools/algorithms/MeshWave/FaceCellWave.H
@@ -77,8 +77,6 @@ class FaceCellWave
 :
     public FaceCellWaveName
 {
-private:
-
     // Private Member Functions
 
         //- Disallow default bitwise copy construct
@@ -90,7 +88,7 @@ private:
 
 protected:
 
-    // Private data
+    // Protected data
 
         //- Reference to mesh
         const polyMesh& mesh_;
@@ -244,7 +242,7 @@ protected:
             void handleExplicitConnections();
 
 
-      // Private static data
+      // Protected static data
 
             static const scalar geomTol_;
             static scalar propagationTol_;
diff --git a/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.H b/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.H
index 38ef08c3b220b498fbf4e0283854854bb7371a3e..1fe40bfc354b4868dd831dfe8de32010b05f3687 100644
--- a/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.H
+++ b/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.H
@@ -133,7 +133,7 @@ public:
 
 
     //- Helper class for finding nearest
-    // Nearest:
+    //  Nearest:
     //  - point+local index
     //  - sqr(distance)
     //  - processor
diff --git a/src/meshTools/sets/topoSetSource/topoSetSource.C b/src/meshTools/sets/topoSetSource/topoSetSource.C
index 295af9f0f9530f651af02734380701aa252f2b67..216c417c64e0f62c98e41badb96b30e991791aed 100644
--- a/src/meshTools/sets/topoSetSource/topoSetSource.C
+++ b/src/meshTools/sets/topoSetSource/topoSetSource.C
@@ -134,7 +134,7 @@ Foam::Istream& Foam::topoSetSource::checkIs(Istream& is)
 }
 
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 void Foam::topoSetSource::addOrDelete
 (
diff --git a/src/meshTools/sets/topoSets/cellZoneSet.C b/src/meshTools/sets/topoSets/cellZoneSet.C
index 5fc39bf1420ded10f0105d7e9caf2fab1c81265f..9551827c29103201bc02509f6b1c1074b5ccd268 100644
--- a/src/meshTools/sets/topoSets/cellZoneSet.C
+++ b/src/meshTools/sets/topoSets/cellZoneSet.C
@@ -229,7 +229,13 @@ void cellZoneSet::deleteSet(const topoSet& set)
 
 
 void cellZoneSet::sync(const polyMesh& mesh)
-{}
+{
+    cellSet::sync(mesh);
+
+    // Take over contents of cellSet into addressing.
+    addressing_ = sortedToc();
+    updateSet();
+}
 
 
 label cellZoneSet::maxSize(const polyMesh& mesh) const
diff --git a/src/meshTools/sets/topoSets/cellZoneSet.H b/src/meshTools/sets/topoSets/cellZoneSet.H
index d3dfe2e63bd70fe3b5a4e311101239d25de7b29e..ee7a3ebb63951e60d0179c2239cc5d9c06714263 100644
--- a/src/meshTools/sets/topoSets/cellZoneSet.H
+++ b/src/meshTools/sets/topoSets/cellZoneSet.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -25,7 +25,7 @@ Class
     Foam::cellZoneSet
 
 Description
-    Like cellSet but updates cellZone when writing.
+    Like cellSet but -reads data from cellZone -updates cellZone when writing.
 
 SourceFiles
     cellZone.C
@@ -126,7 +126,7 @@ public:
         //- Delete elements present in set.
         virtual void deleteSet(const topoSet& set);
 
-        //- Sync cellZoneSet across coupled patches.
+        //- Sync cellSet across coupled patches; update cellZone from cellSet
         virtual void sync(const polyMesh& mesh);
 
         //- Write maxLen items with label and coordinates.
@@ -150,10 +150,6 @@ public:
 
         //- Return max index+1.
         virtual label maxSize(const polyMesh& mesh) const;
-
-
-
-
 };
 
 
diff --git a/src/meshTools/sets/topoSets/faceZoneSet.C b/src/meshTools/sets/topoSets/faceZoneSet.C
index cbd882d76c98c020ba0425314ebb4b38f5efacb7..608109f7d522707f0b5641518608656b8a5f3836 100644
--- a/src/meshTools/sets/topoSets/faceZoneSet.C
+++ b/src/meshTools/sets/topoSets/faceZoneSet.C
@@ -26,6 +26,9 @@ License
 #include "faceZoneSet.H"
 #include "mapPolyMesh.H"
 #include "polyMesh.H"
+#include "setToFaceZone.H"
+#include "setsToFaceZone.H"
+#include "syncTools.H"
 
 #include "addToRunTimeSelectionTable.H"
 
@@ -322,7 +325,132 @@ void faceZoneSet::deleteSet(const topoSet& set)
 
 
 void faceZoneSet::sync(const polyMesh& mesh)
-{}
+{
+    // Make sure that the faceZone is consistent with the faceSet
+    {
+        const labelHashSet zoneSet(addressing_);
+
+        // Get elements that are in zone but not faceSet
+        labelHashSet badSet(zoneSet);
+        badSet -= *this;
+
+        // Add elements that are in faceSet but not in zone
+        labelHashSet fSet(*this);
+        fSet -= zoneSet;
+
+        badSet += fSet;
+
+        label nBad = returnReduce(badSet.size(), sumOp<label>());
+
+        if (nBad)
+        {
+            WarningInFunction << "Detected " << nBad
+                << " faces that are in the faceZone but not"
+                << " in the faceSet or vice versa."
+                << " The faceZoneSet should only be manipulated"
+                << " using " << setsToFaceZone::typeName
+                << " or " << setToFaceZone::typeName << endl;
+        }
+    }
+
+
+    // Make sure that on coupled faces orientation is opposite. Pushes
+    // master orientation to slave in case of conflict.
+
+
+    // 0 : not in faceZone
+    // 1 : in faceZone and unflipped
+    //-1 : in faceZone and flipped
+    const label UNFLIPPED = 1;
+    const label FLIPPED = -1;
+    labelList myZoneFace(mesh.nFaces()-mesh.nInternalFaces(), 0);
+
+    forAll(addressing_, i)
+    {
+        label bFacei = addressing_[i]-mesh.nInternalFaces();
+
+        if (bFacei >= 0)
+        {
+            if (flipMap_[i])
+            {
+                myZoneFace[bFacei] = FLIPPED;
+            }
+            else
+            {
+                myZoneFace[bFacei] = UNFLIPPED;
+            }
+        }
+    }
+
+    labelList neiZoneFace(myZoneFace);
+    syncTools::swapBoundaryFaceList(mesh, neiZoneFace);
+
+
+    const PackedBoolList isMasterFace(syncTools::getMasterFaces(mesh));
+
+
+    // Rebuild faceZone addressing and flipMap
+    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+    DynamicList<label> newAddressing(addressing_.size());
+    DynamicList<bool> newFlipMap(flipMap_.size());
+
+    forAll(addressing_, i)
+    {
+        label facei = addressing_[i];
+        if (facei < mesh.nInternalFaces())
+        {
+            newAddressing.append(facei);
+            newFlipMap.append(flipMap_[i]);
+        }
+    }
+
+    for (label facei = mesh.nInternalFaces(); facei < mesh.nFaces(); facei++)
+    {
+        label myStat = myZoneFace[facei-mesh.nInternalFaces()];
+        label neiStat = neiZoneFace[facei-mesh.nInternalFaces()];
+
+        if (myStat == 0)
+        {
+            if (neiStat == UNFLIPPED)
+            {
+                // Neighbour is unflipped so I am flipped
+                newAddressing.append(facei);
+                newFlipMap.append(true);
+            }
+            else if (neiStat == FLIPPED)
+            {
+                newAddressing.append(facei);
+                newFlipMap.append(false);
+            }
+        }
+        else
+        {
+            if (myStat == neiStat)
+            {
+                // Conflict. masterFace wins
+                newAddressing.append(facei);
+                if (isMasterFace[facei])
+                {
+                    newFlipMap.append(myStat == FLIPPED);
+                }
+                else
+                {
+                    newFlipMap.append(neiStat == UNFLIPPED);
+                }
+            }
+            else
+            {
+                newAddressing.append(facei);
+                newFlipMap.append(myStat == FLIPPED);
+            }
+        }
+    }
+
+    addressing_.transfer(newAddressing);
+    flipMap_.transfer(newFlipMap);
+    updateSet();
+}
 
 
 label faceZoneSet::maxSize(const polyMesh& mesh) const
diff --git a/src/meshTools/sets/topoSets/faceZoneSet.H b/src/meshTools/sets/topoSets/faceZoneSet.H
index f96482911f0540f9d5d3575c55a64c0435e89089..35a0133041f5c97b77361fef2a687d665e6bc028 100644
--- a/src/meshTools/sets/topoSets/faceZoneSet.H
+++ b/src/meshTools/sets/topoSets/faceZoneSet.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -25,7 +25,7 @@ Class
     Foam::faceZoneSet
 
 Description
-    Like faceSet but updates faceZone when writing.
+    Like faceSet but -reads data from faceZone -updates faceZone when writing.
 
 SourceFiles
     faceZone.C
@@ -167,10 +167,6 @@ public:
 
         //- Return max index+1.
         virtual label maxSize(const polyMesh& mesh) const;
-
-
-
-
 };
 
 
diff --git a/src/meshTools/sets/topoSets/pointZoneSet.C b/src/meshTools/sets/topoSets/pointZoneSet.C
index 4b2794363b3cdeaeb21ad74bb8f2c0dbf5b46bbc..726dc77777f8a43be43f2c9c24aafa70e82c920a 100644
--- a/src/meshTools/sets/topoSets/pointZoneSet.C
+++ b/src/meshTools/sets/topoSets/pointZoneSet.C
@@ -230,7 +230,13 @@ void pointZoneSet::deleteSet(const topoSet& set)
 
 
 void pointZoneSet::sync(const polyMesh& mesh)
-{}
+{
+    pointSet::sync(mesh);
+
+    // Take over contents of pointSet into addressing.
+    addressing_ = sortedToc();
+    updateSet();
+}
 
 
 label pointZoneSet::maxSize(const polyMesh& mesh) const
diff --git a/src/meshTools/sets/topoSets/pointZoneSet.H b/src/meshTools/sets/topoSets/pointZoneSet.H
index e8e6519f8fd628e9ea0208940e370c849190f97c..daaf4bdc0f2853971d4f843075044fe82e9270f8 100644
--- a/src/meshTools/sets/topoSets/pointZoneSet.H
+++ b/src/meshTools/sets/topoSets/pointZoneSet.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -25,7 +25,8 @@ Class
     Foam::pointZoneSet
 
 Description
-    Like pointSet but updates pointZone when writing.
+    Like pointSet but -reads data from pointZone -updates pointZone when
+    writing.
 
 SourceFiles
     pointZone.C
@@ -153,10 +154,6 @@ public:
 
         //- Return max index+1.
         virtual label maxSize(const polyMesh& mesh) const;
-
-
-
-
 };
 
 
diff --git a/src/meshTools/sets/topoSets/topoSet.C b/src/meshTools/sets/topoSets/topoSet.C
index d5c2491a1d74d556356cf96bb9d3e041ef27f798..59f0ea2ff5ad6fa8847c3979da84ab3374e4d9b3 100644
--- a/src/meshTools/sets/topoSets/topoSet.C
+++ b/src/meshTools/sets/topoSets/topoSet.C
@@ -130,7 +130,7 @@ Foam::fileName Foam::topoSet::localPath
 }
 
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 // Update stored cell numbers using map.
 // Do in two passes to prevent allocation if nothing changed.
diff --git a/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.H b/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.H
index 46db7124cbafc8088864bf7621c9aeb2c006d885..d90c862dc972b298baece9ee24484dbb6e432bef 100644
--- a/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.H
+++ b/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.H
@@ -162,7 +162,7 @@ class triSurfaceTools
             );
 
             //- Calculate minimum (cos of) edge angle using addressing from
-            /// collapsing
+            //  collapsing
             //  edge to v1 at pt. Returns 1 if v1 is on edge without neighbours
             //  (and hence no edge angle can be defined)
             static scalar collapseMinCosAngle
diff --git a/src/parallel/Allwmake b/src/parallel/Allwmake
index 2f1cf312705c0d14cfc6d31ee2e694a11fdd1969..a588a2b796e3eb73dee0040745caa319b84d11a5 100755
--- a/src/parallel/Allwmake
+++ b/src/parallel/Allwmake
@@ -3,11 +3,9 @@ cd ${0%/*} || exit 1    # Run from this directory
 
 # Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-set -x
 
 decompose/Allwmake $targetType $*
 reconstruct/Allwmake $targetType $*
 wmake $targetType distributed
 
-
 #------------------------------------------------------------------------------
diff --git a/src/parallel/decompose/Allwclean b/src/parallel/decompose/Allwclean
index 62e2d2969853d6aa3bcd7d30fac6901d243ef3cb..e0acdabc1532e1140e48bffcd4cb4316bae9d49d 100755
--- a/src/parallel/decompose/Allwclean
+++ b/src/parallel/decompose/Allwclean
@@ -5,20 +5,17 @@ cd ${0%/*} || exit 1    # Run from this directory
 if settings=`$WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch`
 then
     . $settings
-    echo "using SCOTCH_ARCH_PATH=$SCOTCH_ARCH_PATH"
+    echo "    using SCOTCH_ARCH_PATH=$SCOTCH_ARCH_PATH"
 else
     echo
-    echo "Error: no config.sh/scotch settings"
+    echo "    Error: no config.sh/scotch settings"
     echo
 fi
 
 
-#
-# define how to clean an mpi-versioned library
-#
+# Define how to clean an mpi-versioned library
 wcleanMpiLib()
 {
-    set +x
     for libName
     do
     (
@@ -28,11 +25,8 @@ wcleanMpiLib()
         wclean $libName
     )
     done
-    set -x
 }
 
-set -x
-
 if [ -n "$SCOTCH_ARCH_PATH" ]
 then
     wclean scotchDecomp
@@ -42,16 +36,11 @@ then
         wcleanMpiLib ptscotchDecomp
     fi
 else
-    echo
-    echo "Skipping scotchDecomp (ptscotchDecomp)"
-    echo
+    echo "    skipping scotchDecomp (ptscotchDecomp)"
 fi
 
-
 wclean metisDecomp
-
 wclean decompositionMethods
-
 wclean decompose
 
 #------------------------------------------------------------------------------
diff --git a/src/parallel/decompose/AllwmakeLnInclude b/src/parallel/decompose/AllwmakeLnInclude
index 4f421640947ca9a44905439c9b1b5d98d815d0b5..74fdde1f38c5cc8e2a51acf9ba6cb5f06ee3706c 100755
--- a/src/parallel/decompose/AllwmakeLnInclude
+++ b/src/parallel/decompose/AllwmakeLnInclude
@@ -1,6 +1,5 @@
 #!/bin/sh
 cd ${0%/*} || exit 1    # Run from this directory
-set -x
 
 wmakeLnInclude decompositionMethods
 wmakeLnInclude metisDecomp
diff --git a/src/parallel/decompose/metisDecomp/metisDecomp.C b/src/parallel/decompose/metisDecomp/metisDecomp.C
index 8e27852ecc2a03295c1b1a4a592d895cb6d7f808..2cb09cbb77cbc672438f9d0954f2616435d16b82 100644
--- a/src/parallel/decompose/metisDecomp/metisDecomp.C
+++ b/src/parallel/decompose/metisDecomp/metisDecomp.C
@@ -291,7 +291,7 @@ Foam::labelList Foam::metisDecomp::decompose
         fineDistribution[i] = finalDecomp[agglom[i]];
     }
 
-    return finalDecomp;
+    return fineDistribution;
 }
 
 
diff --git a/src/parallel/reconstruct/Allwmake b/src/parallel/reconstruct/Allwmake
index 647a42cb3de3e32f1e0f9e4e1539735d0225a16e..d9ebb6fc90087aa8ecfb8e391df365a69cfc638b 100755
--- a/src/parallel/reconstruct/Allwmake
+++ b/src/parallel/reconstruct/Allwmake
@@ -3,7 +3,6 @@ cd ${0%/*} || exit 1    # Run from this directory
 
 # Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-set -x
 
 wmake $targetType reconstruct
 
diff --git a/src/regionModels/Allwclean b/src/regionModels/Allwclean
index 94b0901855ea3a8a6b6122a9cfad66588bc7d184..2996d85d6158179e6e7c4c1f5ef16e0805ff00ad 100755
--- a/src/regionModels/Allwclean
+++ b/src/regionModels/Allwclean
@@ -1,7 +1,6 @@
 #!/bin/sh
 cd ${0%/*} || exit 1    # Run from this directory
 makeType=${1:-libso}
-set -x
 
 wclean $makeType regionModel
 wclean $makeType pyrolysisModels
@@ -9,5 +8,4 @@ wclean $makeType surfaceFilmModels
 wclean $makeType thermalBaffleModels
 wclean $makeType regionCoupling
 
-
 #------------------------------------------------------------------------------
diff --git a/src/regionModels/Allwmake b/src/regionModels/Allwmake
index c8e86eef7d65f54a8952c5f4035fab7f1d455e1a..1f2348ee2c43d5f36a2984689ebda670ddc70db9 100755
--- a/src/regionModels/Allwmake
+++ b/src/regionModels/Allwmake
@@ -3,7 +3,6 @@ cd ${0%/*} || exit 1    # Run from this directory
 
 # Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-set -x
 
 wmake $targetType regionModel
 wmake $targetType pyrolysisModels
@@ -12,5 +11,4 @@ wmake $targetType surfaceFilmModels/derivedFvPatchFields/wallFunctions
 wmake $targetType thermalBaffleModels
 wmake $targetType regionCoupling
 
-
 #------------------------------------------------------------------------------
diff --git a/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModel.C b/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModel.C
index 2b1f968f68d362c98b6e6d11cfd13839f44cf209..61f5502341e83ff16ececef0fd0ef0ea9df2b730 100644
--- a/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModel.C
+++ b/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModel.C
@@ -24,8 +24,6 @@ License
 \*---------------------------------------------------------------------------*/
 
 #include "pyrolysisModel.H"
-#include "fvMesh.H"
-#include "mappedFieldFvPatchField.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/src/regionModels/regionModel/regionModel1D/regionModel1D.H b/src/regionModels/regionModel/regionModel1D/regionModel1D.H
index 592e0af3176606edab18a16c69a006d90f10face..3663a946488ab172711bf4d6ca63a1a2bc50a298 100644
--- a/src/regionModels/regionModel/regionModel1D/regionModel1D.H
+++ b/src/regionModels/regionModel/regionModel1D/regionModel1D.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -54,9 +54,6 @@ class regionModel1D
 :
     public regionModel
 {
-
-private:
-
     // Private Member Functions
 
         //- Disallow default bitwise copy construct
diff --git a/src/regionModels/regionModel/singleLayerRegion/singleLayerRegion.H b/src/regionModels/regionModel/singleLayerRegion/singleLayerRegion.H
index ac0892c49f0398460b9cfac894ecd4b922777613..ccababa2724e5519daa8ba72c01e952e951f01cd 100644
--- a/src/regionModels/regionModel/singleLayerRegion/singleLayerRegion.H
+++ b/src/regionModels/regionModel/singleLayerRegion/singleLayerRegion.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -52,9 +52,6 @@ class singleLayerRegion
 :
     public regionModel
 {
-
-private:
-
     // Private Member Functions
 
         //- Disallow default bitwise copy construct
diff --git a/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.H b/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.H
index cbf5717f115c5e0158f5cd2435853d3174dd5464..941aa73145333c49c1623235bf3e312591afb09c 100644
--- a/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.H
+++ b/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.H
@@ -65,8 +65,6 @@ class thermoSingleLayer
 :
     public kinematicSingleLayer
 {
-private:
-
     // Private member functions
 
         //- Disallow default bitwise copy construct
diff --git a/src/regionModels/thermalBaffleModels/derivedFvPatchFields/thermalBaffle/thermalBaffleFvPatchScalarField.C b/src/regionModels/thermalBaffleModels/derivedFvPatchFields/thermalBaffle/thermalBaffleFvPatchScalarField.C
index 34bdfe2f85fb546ac3b8b92dcfe9e6e7892171a0..ca1f1511c068078f7fa4093de60dfbee925f4d1a 100644
--- a/src/regionModels/thermalBaffleModels/derivedFvPatchFields/thermalBaffle/thermalBaffleFvPatchScalarField.C
+++ b/src/regionModels/thermalBaffleModels/derivedFvPatchFields/thermalBaffle/thermalBaffleFvPatchScalarField.C
@@ -26,7 +26,6 @@ License
 #include "thermalBaffleFvPatchScalarField.H"
 #include "addToRunTimeSelectionTable.H"
 #include "emptyPolyPatch.H"
-#include "polyPatch.H"
 #include "mappedWallPolyPatch.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/renumber/renumberMethods/structuredRenumber/OppositeFaceCellWave.C b/src/renumber/renumberMethods/structuredRenumber/OppositeFaceCellWave.C
index 4e865bd0b11c13e6ede0254b59a75233202a2721..33d7810da8cc501ed1c3e697ce8b3242c1108dfc 100644
--- a/src/renumber/renumberMethods/structuredRenumber/OppositeFaceCellWave.C
+++ b/src/renumber/renumberMethods/structuredRenumber/OppositeFaceCellWave.C
@@ -26,7 +26,7 @@ License
 #include "OppositeFaceCellWave.H"
 #include "polyMesh.H"
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 template<class Type, class TrackingData>
 void Foam::OppositeFaceCellWave<Type, TrackingData>::opposingFaceLabels
diff --git a/src/renumber/renumberMethods/structuredRenumber/OppositeFaceCellWave.H b/src/renumber/renumberMethods/structuredRenumber/OppositeFaceCellWave.H
index bcfe3cb0ddafc991691bd72fdf48bd852303cf0d..12701070822163bc433417eab95fe6584fb16cce 100644
--- a/src/renumber/renumberMethods/structuredRenumber/OppositeFaceCellWave.H
+++ b/src/renumber/renumberMethods/structuredRenumber/OppositeFaceCellWave.H
@@ -52,14 +52,14 @@ namespace Foam
 {
 
 /*---------------------------------------------------------------------------*\
-                        Class OppositeFaceCellWaveName Declaration
+                  Class OppositeFaceCellWaveName Declaration
 \*---------------------------------------------------------------------------*/
 
 TemplateName(OppositeFaceCellWave);
 
 
 /*---------------------------------------------------------------------------*\
-                           Class OppositeFaceCellWave Declaration
+                    Class OppositeFaceCellWave Declaration
 \*---------------------------------------------------------------------------*/
 
 template<class Type, class TrackingData = int>
diff --git a/src/rigidBodyDynamics/rigidBodyModel/rigidBodyModel.C b/src/rigidBodyDynamics/rigidBodyModel/rigidBodyModel.C
index b2236c39c49e25b344729c724b17aafff511a9a9..4a8de4eac4d72b0557ff26ed31edc9f7c0f02a8b 100644
--- a/src/rigidBodyDynamics/rigidBodyModel/rigidBodyModel.C
+++ b/src/rigidBodyDynamics/rigidBodyModel/rigidBodyModel.C
@@ -114,6 +114,53 @@ void Foam::RBD::rigidBodyModel::addRestraints
 }
 
 
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
+
+Foam::label Foam::RBD::rigidBodyModel::join_
+(
+    const label parentID,
+    const spatialTransform& XT,
+    autoPtr<joint> jointPtr,
+    autoPtr<rigidBody> bodyPtr
+)
+{
+    // Append the body
+    const rigidBody& body = bodyPtr();
+    bodies_.append(bodyPtr);
+    const label bodyID = nBodies()-1;
+    bodyIDs_.insert(body.name(), bodyID);
+
+    // If the parentID refers to a merged body find the parent into which it has
+    // been merged and set lambda and XT accordingly
+    if (merged(parentID))
+    {
+        const subBody& sBody = mergedBody(parentID);
+        lambda_.append(sBody.masterID());
+        XT_.append(XT & sBody.masterXT());
+    }
+    else
+    {
+        lambda_.append(parentID);
+        XT_.append(XT);
+    }
+
+    // Append the joint
+    const joint& prevJoint = joints_[joints_.size() - 1];
+    joints_.append(jointPtr);
+    joint& curJoint = joints_[joints_.size() - 1];
+    curJoint.index() = joints_.size() - 1;
+    curJoint.qIndex() = prevJoint.qIndex() + prevJoint.nDoF();
+
+    // Increment the degrees of freedom
+    nDoF_ += curJoint.nDoF();
+    unitQuaternions_ = unitQuaternions_ || curJoint.unitQuaternion();
+
+    resizeState();
+
+    return bodyID;
+}
+
+
 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
 
 Foam::RBD::rigidBodyModel::rigidBodyModel()
@@ -168,52 +215,7 @@ Foam::RBD::rigidBodyModel::~rigidBodyModel()
 {}
 
 
-// * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * * //
-
-Foam::label Foam::RBD::rigidBodyModel::join_
-(
-    const label parentID,
-    const spatialTransform& XT,
-    autoPtr<joint> jointPtr,
-    autoPtr<rigidBody> bodyPtr
-)
-{
-    // Append the body
-    const rigidBody& body = bodyPtr();
-    bodies_.append(bodyPtr);
-    const label bodyID = nBodies()-1;
-    bodyIDs_.insert(body.name(), bodyID);
-
-    // If the parentID refers to a merged body find the parent into which it has
-    // been merged and set lambda and XT accordingly
-    if (merged(parentID))
-    {
-        const subBody& sBody = mergedBody(parentID);
-        lambda_.append(sBody.masterID());
-        XT_.append(XT & sBody.masterXT());
-    }
-    else
-    {
-        lambda_.append(parentID);
-        XT_.append(XT);
-    }
-
-    // Append the joint
-    const joint& prevJoint = joints_[joints_.size() - 1];
-    joints_.append(jointPtr);
-    joint& curJoint = joints_[joints_.size() - 1];
-    curJoint.index() = joints_.size() - 1;
-    curJoint.qIndex() = prevJoint.qIndex() + prevJoint.nDoF();
-
-    // Increment the degrees of freedom
-    nDoF_ += curJoint.nDoF();
-    unitQuaternions_ = unitQuaternions_ || curJoint.unitQuaternion();
-
-    resizeState();
-
-    return bodyID;
-}
-
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
 Foam::label Foam::RBD::rigidBodyModel::join
 (
diff --git a/src/sampling/meshToMesh/calcMethod/meshToMeshMethod/meshToMeshMethod.C b/src/sampling/meshToMesh/calcMethod/meshToMeshMethod/meshToMeshMethod.C
index 63c8a58d7a4fff2585e39bb6626ca9c0a9ad54aa..9a99aa04e1c12d5c0a4ab816c0ac985a28902a17 100644
--- a/src/sampling/meshToMesh/calcMethod/meshToMeshMethod/meshToMeshMethod.C
+++ b/src/sampling/meshToMesh/calcMethod/meshToMeshMethod/meshToMeshMethod.C
@@ -39,7 +39,7 @@ namespace Foam
 
 Foam::scalar Foam::meshToMeshMethod::tolerance_ = 1e-6;
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 Foam::labelList Foam::meshToMeshMethod::maskCells() const
 {
diff --git a/src/sampling/meshToMesh0/calculateMeshToMesh0Addressing.C b/src/sampling/meshToMesh0/calculateMeshToMesh0Addressing.C
index 3bd2a71e54c1b89bc393e52b49de18e42e8b946b..cbbebf229ccd9fde2290f87fe51a5ad158213d14 100644
--- a/src/sampling/meshToMesh0/calculateMeshToMesh0Addressing.C
+++ b/src/sampling/meshToMesh0/calculateMeshToMesh0Addressing.C
@@ -156,6 +156,7 @@ void Foam::meshToMesh0::calcAddressing()
                     << "Source patch " << fromPatch.name()
                     << " has no faces. Not performing mapping for it."
                     << endl;
+                boundaryAddressing_[patchi].setSize(toPatch.size());
                 boundaryAddressing_[patchi] = -1;
             }
             else
diff --git a/src/sampling/probes/probes.C b/src/sampling/probes/probes.C
index a8f217084c5c71f0bb28aab5b5c50dc343d727f0..e920b946b83dc1b94c83dc56a4e3551d8f40f302 100644
--- a/src/sampling/probes/probes.C
+++ b/src/sampling/probes/probes.C
@@ -46,7 +46,7 @@ namespace Foam
 }
 
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 void Foam::probes::findElements(const fvMesh& mesh)
 {
diff --git a/src/sampling/sampledSet/sampledSet/sampledSet.C b/src/sampling/sampledSet/sampledSet/sampledSet.C
index 50979b68bec7014a8c8de493ea4f0adb6e244933..f583aaea86d7685eb423b16a50bedecbf0e64601 100644
--- a/src/sampling/sampledSet/sampledSet/sampledSet.C
+++ b/src/sampling/sampledSet/sampledSet/sampledSet.C
@@ -39,7 +39,7 @@ namespace Foam
 }
 
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 Foam::label Foam::sampledSet::getBoundaryCell(const label facei) const
 {
diff --git a/src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormatCore.C b/src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormatCore.C
index 6d1a8d3fc19db4f088aefa68adcf89ff803f1122..3f309be57e415ef794d1022291bfb46dee7747f5 100644
--- a/src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormatCore.C
+++ b/src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormatCore.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -28,7 +28,7 @@ License
 #include "IFstream.H"
 #include "IStringStream.H"
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 bool Foam::fileFormats::AC3DsurfaceFormatCore::readCmd
 (
diff --git a/src/surfMesh/surfaceFormats/vtk/VTKsurfaceFormatCore.C b/src/surfMesh/surfaceFormats/vtk/VTKsurfaceFormatCore.C
index 501806c4174e074859a043eb83e10cdb56e54453..9a28648d0c22c0310f6834c99fecfa893ed4552d 100644
--- a/src/surfMesh/surfaceFormats/vtk/VTKsurfaceFormatCore.C
+++ b/src/surfMesh/surfaceFormats/vtk/VTKsurfaceFormatCore.C
@@ -26,7 +26,7 @@ License
 #include "VTKsurfaceFormatCore.H"
 #include "clock.H"
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 void Foam::fileFormats::VTKsurfaceFormatCore::writeHeader
 (
diff --git a/src/surfMesh/surfaceFormats/x3d/X3DsurfaceFormatCore.C b/src/surfMesh/surfaceFormats/x3d/X3DsurfaceFormatCore.C
index 2ba0dbf5f39b7ec2f710bc3407afb28f54bdc32b..0dd477304a4c237e3438166ca4057342c2340e90 100644
--- a/src/surfMesh/surfaceFormats/x3d/X3DsurfaceFormatCore.C
+++ b/src/surfMesh/surfaceFormats/x3d/X3DsurfaceFormatCore.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -26,7 +26,7 @@ License
 #include "X3DsurfaceFormatCore.H"
 #include "clock.H"
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 void Foam::fileFormats::X3DsurfaceFormatCore::writeHeader
 (
diff --git a/src/thermophysicalModels/Allwmake b/src/thermophysicalModels/Allwmake
index 5df22b24b82d8095a899bfb9575c9e9fcec88b6a..2c90db55a8d9bdf2bd7cd00d8f4e77a29e765030 100755
--- a/src/thermophysicalModels/Allwmake
+++ b/src/thermophysicalModels/Allwmake
@@ -3,7 +3,6 @@ cd ${0%/*} || exit 1    # Run from this directory
 
 # Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-set -x
 
 wmake $targetType specie
 wmake $targetType solidSpecie
diff --git a/src/thermophysicalModels/properties/Allwmake b/src/thermophysicalModels/properties/Allwmake
index e2da041c684bd40f26fac6ade3002d38c1cea354..5ad45938fc016e9fe7fd99ff6024fa4303639ae6 100755
--- a/src/thermophysicalModels/properties/Allwmake
+++ b/src/thermophysicalModels/properties/Allwmake
@@ -3,12 +3,10 @@ cd ${0%/*} || exit 1    # Run from this directory
 
 # Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-set -x
 
 wmake $targetType liquidProperties
 wmake $targetType liquidMixtureProperties
 wmake $targetType solidProperties
 wmake $targetType solidMixtureProperties
 
-
 #------------------------------------------------------------------------------
diff --git a/src/thermophysicalModels/reactionThermo/psiuReactionThermo/psiuReactionThermo.C b/src/thermophysicalModels/reactionThermo/psiuReactionThermo/psiuReactionThermo.C
index c58ff931407a105f1a7dbcf9a0455878fa2d794e..f7161a5b097bd78aa5b33d0c50e080bf6c92fc7b 100644
--- a/src/thermophysicalModels/reactionThermo/psiuReactionThermo/psiuReactionThermo.C
+++ b/src/thermophysicalModels/reactionThermo/psiuReactionThermo/psiuReactionThermo.C
@@ -40,7 +40,7 @@ namespace Foam
 defineTypeNameAndDebug(psiuReactionThermo, 0);
 defineRunTimeSelectionTable(psiuReactionThermo, fvMesh);
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 wordList psiuReactionThermo::heuBoundaryTypes()
 {
diff --git a/src/transportModels/Allwmake b/src/transportModels/Allwmake
index 4fcc281a6ef08d2d7f2825cbbee0642b93c9bdac..b533c83c310910626d17fab1363f2cb82564527e 100755
--- a/src/transportModels/Allwmake
+++ b/src/transportModels/Allwmake
@@ -3,7 +3,6 @@ cd ${0%/*} || exit 1    # Run from this directory
 
 # Parse arguments for library compilation
 . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-set -x
 
 wmake $targetType twoPhaseMixture
 wmake $targetType interfaceProperties
diff --git a/src/transportModels/incompressible/Make/files b/src/transportModels/incompressible/Make/files
index 40eea6a11f289696c650f9995eb232fb29622309..b181820bd83a285a2c20516f97be9c599452ca37 100644
--- a/src/transportModels/incompressible/Make/files
+++ b/src/transportModels/incompressible/Make/files
@@ -6,6 +6,7 @@ viscosityModels/CrossPowerLaw/CrossPowerLaw.C
 viscosityModels/BirdCarreau/BirdCarreau.C
 viscosityModels/HerschelBulkley/HerschelBulkley.C
 viscosityModels/Casson/Casson.C
+viscosityModels/strainRateFunction/strainRateFunction.C
 
 transportModel/transportModel.C
 singlePhaseTransportModel/singlePhaseTransportModel.C
diff --git a/src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.C b/src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.C
index ad110c26e937fffa072e696c8a5ada631f3d10e2..061feda8ab44312203d63c3386547be118e3edef 100644
--- a/src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.C
+++ b/src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.C
@@ -36,7 +36,7 @@ namespace Foam
 }
 
 
-// * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * * //
+// * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * * //
 
 void Foam::incompressibleTwoPhaseMixture::calcNu()
 {
diff --git a/src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.H b/src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.H
index e867e5be75d219b915f6ba543241bc85621fde7d..7821b2d9fb027d4a6c051cc323a8cff83045c5b1 100644
--- a/src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.H
+++ b/src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.H
@@ -72,7 +72,7 @@ protected:
         volScalarField nu_;
 
 
-    // Private Member Functions
+    // Protected Member Functions
 
         //- Calculate and return the laminar viscosity
         void calcNu();
diff --git a/src/transportModels/incompressible/viscosityModels/strainRateFunction/strainRateFunction.C b/src/transportModels/incompressible/viscosityModels/strainRateFunction/strainRateFunction.C
new file mode 100644
index 0000000000000000000000000000000000000000..6c218d710a7be2852c7654680c45a7203a09e1d3
--- /dev/null
+++ b/src/transportModels/incompressible/viscosityModels/strainRateFunction/strainRateFunction.C
@@ -0,0 +1,138 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+\*---------------------------------------------------------------------------*/
+
+#include "strainRateFunction.H"
+#include "addToRunTimeSelectionTable.H"
+#include "surfaceFields.H"
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace viscosityModels
+{
+    defineTypeNameAndDebug(strainRateFunction, 0);
+
+    addToRunTimeSelectionTable
+    (
+        viscosityModel,
+        strainRateFunction,
+        dictionary
+    );
+}
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
+
+Foam::viscosityModels::strainRateFunction::strainRateFunction
+(
+    const word& name,
+    const dictionary& viscosityProperties,
+    const volVectorField& U,
+    const surfaceScalarField& phi
+)
+:
+    viscosityModel(name, viscosityProperties, U, phi),
+    strainRateFunctionCoeffs_(viscosityProperties.subDict(typeName + "Coeffs")),
+    strainRateFunction_
+    (
+        Function1<scalar>::New("function", strainRateFunctionCoeffs_)
+    ),
+    nu_
+    (
+        IOobject
+        (
+            name,
+            U_.time().timeName(),
+            U_.db(),
+            IOobject::NO_READ,
+            IOobject::AUTO_WRITE
+        ),
+        U_.mesh(),
+        dimensionedScalar(name, dimViscosity, 0)
+    )
+{
+    correct();
+}
+
+
+// * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * * //
+
+Foam::tmp<Foam::volScalarField>
+Foam::viscosityModels::strainRateFunction::nu() const
+{
+    return nu_;
+}
+
+
+Foam::tmp<Foam::scalarField>
+Foam::viscosityModels::strainRateFunction::nu(const label patchi) const
+{
+    return nu_.boundaryField()[patchi];
+}
+
+
+void Foam::viscosityModels::strainRateFunction::correct()
+{
+    tmp<volScalarField> tsigma = strainRate();
+    const volScalarField& sigma = tsigma();
+
+    nu_.primitiveFieldRef() = strainRateFunction_->value(sigma());
+
+    volScalarField::Boundary& nuBf = nu_.boundaryFieldRef();
+    const volScalarField::Boundary& sigmaBf = sigma.boundaryField();
+
+    forAll(nuBf, patchi)
+    {
+        nuBf[patchi] = strainRateFunction_->value(sigmaBf[patchi]);
+    }
+}
+
+
+bool Foam::viscosityModels::strainRateFunction::read
+(
+    const dictionary& viscosityProperties
+)
+{
+    viscosityModel::read(viscosityProperties);
+
+    strainRateFunctionCoeffs_ = viscosityProperties.subDict
+    (
+        typeName + "Coeffs"
+    );
+
+    strainRateFunction_.clear();
+    strainRateFunction_ = Function1<scalar>::New
+    (
+        "function",
+        strainRateFunctionCoeffs_
+    );
+
+    return true;
+}
+
+
+// ************************************************************************* //
diff --git a/src/transportModels/incompressible/viscosityModels/strainRateFunction/strainRateFunction.H b/src/transportModels/incompressible/viscosityModels/strainRateFunction/strainRateFunction.H
new file mode 100644
index 0000000000000000000000000000000000000000..90c102e322b02f38576979710785fd78dcade21b
--- /dev/null
+++ b/src/transportModels/incompressible/viscosityModels/strainRateFunction/strainRateFunction.H
@@ -0,0 +1,131 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+Class
+    Foam::viscosityModels::strainRateFunction
+
+Description
+    Run-time selected strain-rate function non-Newtonian viscosity model.
+
+    Example linear function of strain-rate:
+    \verbatim
+        transportModel  strainRateFunction;
+
+        strainRateFunctionCoeffs
+        {
+            function polynomial ((0 0.1) (1 1.3));
+        }
+    \endverbatim
+
+See also
+    Foam::viscosityModel
+    Foam::Function1
+
+SourceFiles
+    strainRateFunction.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef strainRateFunction_H
+#define strainRateFunction_H
+
+#include "viscosityModel.H"
+#include "volFields.H"
+#include "Function1.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace viscosityModels
+{
+
+/*---------------------------------------------------------------------------*\
+                           Class strainRateFunction Declaration
+\*---------------------------------------------------------------------------*/
+
+class strainRateFunction
+:
+    public viscosityModel
+{
+    // Private data
+
+        //- Coefficients dictionary
+        dictionary strainRateFunctionCoeffs_;
+
+        //- Strain-rate function
+        autoPtr<Function1<scalar>> strainRateFunction_;
+
+        //- Current viscosity field
+        volScalarField nu_;
+
+
+public:
+
+    //- Runtime type information
+    TypeName("strainRateFunction");
+
+
+    // Constructors
+
+        //- Construct from components
+        strainRateFunction
+        (
+            const word& name,
+            const dictionary& viscosityProperties,
+            const volVectorField& U,
+            const surfaceScalarField& phi
+        );
+
+
+    //- Destructor
+    virtual ~strainRateFunction()
+    {}
+
+
+    // Member Functions
+
+        //- Return the laminar viscosity
+        virtual tmp<volScalarField> nu() const;
+
+        //- Return the laminar viscosity for patch
+        virtual tmp<scalarField> nu(const label patchi) const;
+
+        //- Correct the laminar viscosity
+        virtual void correct();
+
+        //- Read transportProperties dictionary
+        virtual bool read(const dictionary& viscosityProperties);
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace viscosityModels
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/triSurface/triSurface/triSurface.C b/src/triSurface/triSurface/triSurface.C
index 289a47d1c7a6b5b46f2dc6914932454bb3e843fb..6bc2e9d64bdf2872f34c5feb795b275dbd6adc45 100644
--- a/src/triSurface/triSurface/triSurface.C
+++ b/src/triSurface/triSurface/triSurface.C
@@ -37,10 +37,12 @@ License
 
 namespace Foam
 {
-defineTypeNameAndDebug(triSurface, 0);
+    defineTypeNameAndDebug(triSurface, 0);
 }
 
 
+// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+
 Foam::fileName Foam::triSurface::triSurfInstance(const Time& d)
 {
     fileName foamName(d.caseName() + ".ftr");
diff --git a/tutorials/compressible/rhoPimpleDyMFoam/annularThermalMixer/constant/dynamicMeshDict b/tutorials/compressible/rhoPimpleDyMFoam/annularThermalMixer/constant/dynamicMeshDict
index 2aec9f5a22feca83be85373f9475a8500a40e6cc..c26839558206b95ea65cc690405d84826e1fffb6 100644
--- a/tutorials/compressible/rhoPimpleDyMFoam/annularThermalMixer/constant/dynamicMeshDict
+++ b/tutorials/compressible/rhoPimpleDyMFoam/annularThermalMixer/constant/dynamicMeshDict
@@ -17,9 +17,11 @@ FoamFile
 
 #include "${FOAM_CASE}/constant/caseSettings"
 
-dynamicFvMesh   solidBodyMotionFvMesh;
+dynamicFvMesh   dynamicMotionSolverFvMesh;
 
-solidBodyMotionFvMeshCoeffs
+solver solidBody;
+
+solidBodyCoeffs
 {
     cellZone        rotatingZone;
 
diff --git a/tutorials/compressible/rhoSimpleFoam/squareBend/system/fvSolution b/tutorials/compressible/rhoSimpleFoam/squareBend/system/fvSolution
index ded27f6165f6eb1743af20df619080ca2e1e5b3d..6b7468052d42e87b4bbb828be334a61c276a0197 100644
--- a/tutorials/compressible/rhoSimpleFoam/squareBend/system/fvSolution
+++ b/tutorials/compressible/rhoSimpleFoam/squareBend/system/fvSolution
@@ -66,7 +66,7 @@ relaxationFactors
     {
         p               1;
         U               0.9;
-        e               0.9;
+        e               0.8;
         k               0.9;
         epsilon         0.9;
     }
diff --git a/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/constant/transportProperties b/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/constant/transportProperties
index 882305eb00cdeb6877903585105e20a60cfe89f4..06ee8fc8f435cec127f0721fb1789ae8528212dd 100644
--- a/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/constant/transportProperties
+++ b/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/constant/transportProperties
@@ -27,9 +27,9 @@ beta            [0 0 0 -1 0 0 0] 3e-03;
 TRef            [0 0 0 1 0 0 0] 300;
 
 // Laminar Prandtl number
-Pr              [0 0 0 0 0 0 0] 0.9;
+Pr              [0 0 0 0 0 0 0] 0.7;
 
 // Turbulent Prandtl number
-Prt             [0 0 0 0 0 0 0] 0.7;
+Prt             [0 0 0 0 0 0 0] 0.85;
 
 // ************************************************************************* //
diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/constant/transportProperties b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/constant/transportProperties
index 882305eb00cdeb6877903585105e20a60cfe89f4..06ee8fc8f435cec127f0721fb1789ae8528212dd 100644
--- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/constant/transportProperties
+++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/constant/transportProperties
@@ -27,9 +27,9 @@ beta            [0 0 0 -1 0 0 0] 3e-03;
 TRef            [0 0 0 1 0 0 0] 300;
 
 // Laminar Prandtl number
-Pr              [0 0 0 0 0 0 0] 0.9;
+Pr              [0 0 0 0 0 0 0] 0.7;
 
 // Turbulent Prandtl number
-Prt             [0 0 0 0 0 0 0] 0.7;
+Prt             [0 0 0 0 0 0 0] 0.85;
 
 // ************************************************************************* //
diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/constant/transportProperties b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/constant/transportProperties
index 882305eb00cdeb6877903585105e20a60cfe89f4..06ee8fc8f435cec127f0721fb1789ae8528212dd 100644
--- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/constant/transportProperties
+++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/constant/transportProperties
@@ -27,9 +27,9 @@ beta            [0 0 0 -1 0 0 0] 3e-03;
 TRef            [0 0 0 1 0 0 0] 300;
 
 // Laminar Prandtl number
-Pr              [0 0 0 0 0 0 0] 0.9;
+Pr              [0 0 0 0 0 0 0] 0.7;
 
 // Turbulent Prandtl number
-Prt             [0 0 0 0 0 0 0] 0.7;
+Prt             [0 0 0 0 0 0 0] 0.85;
 
 // ************************************************************************* //
diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/makeMesh b/tutorials/incompressible/SRFPimpleFoam/rotor2D/makeMesh
index ea511db9f4aae5fe13cf5301cd200028ec03cfef..ed804d4c3ef59e1866b8cad410323621f062ea81 100755
--- a/tutorials/incompressible/SRFPimpleFoam/rotor2D/makeMesh
+++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/makeMesh
@@ -1,8 +1,6 @@
 #!/bin/sh
 cd ${0%/*} || exit 1    # Run from this directory
 
-set -x
-
 m4 < system/blockMeshDict.m4 > system/blockMeshDict
 blockMesh > log.blockMesh 2>&1
 
diff --git a/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/constant/dynamicMeshDict b/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/constant/dynamicMeshDict
index 00ef84689bc4e12c67406c7505ddee94d2996dae..79938b32435f04b0c0962c715b83332391b2709f 100644
--- a/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/constant/dynamicMeshDict
+++ b/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/constant/dynamicMeshDict
@@ -15,11 +15,11 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-dynamicFvMesh   solidBodyMotionFvMesh;
+dynamicFvMesh   dynamicMotionSolverFvMesh;
 
-motionSolverLibs ( "libfvMotionSolvers.so" );
+solver solidBody;
 
-solidBodyMotionFvMeshCoeffs
+solidBodyCoeffs
 {
     cellZone        rotor;
 
@@ -32,5 +32,4 @@ solidBodyMotionFvMeshCoeffs
     }
 }
 
-
 // ************************************************************************* //
diff --git a/tutorials/incompressible/pimpleDyMFoam/oscillatingInletACMI2D/constant/dynamicMeshDict b/tutorials/incompressible/pimpleDyMFoam/oscillatingInletACMI2D/constant/dynamicMeshDict
index 8e7f72b360e6f8ff304094a71408adac8cdbc86c..6043ee040c1701986ff21e1e04e3f0bf8512f96b 100644
--- a/tutorials/incompressible/pimpleDyMFoam/oscillatingInletACMI2D/constant/dynamicMeshDict
+++ b/tutorials/incompressible/pimpleDyMFoam/oscillatingInletACMI2D/constant/dynamicMeshDict
@@ -15,11 +15,13 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-dynamicFvMesh   solidBodyMotionFvMesh;
+dynamicFvMesh   dynamicMotionSolverFvMesh;
 
 motionSolverLibs ( "libfvMotionSolvers.so" );
 
-solidBodyMotionFvMeshCoeffs
+solver solidBody;
+
+solidBodyCoeffs
 {
     cellZone        inletChannel;
 
diff --git a/tutorials/incompressible/pimpleDyMFoam/propeller/constant/dynamicMeshDict b/tutorials/incompressible/pimpleDyMFoam/propeller/constant/dynamicMeshDict
index 11785e06eff46c6b046a1e4a67c9862236062ab0..a863182374461cb41c6aeaa33c38fc7b646f052a 100644
--- a/tutorials/incompressible/pimpleDyMFoam/propeller/constant/dynamicMeshDict
+++ b/tutorials/incompressible/pimpleDyMFoam/propeller/constant/dynamicMeshDict
@@ -15,11 +15,13 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-dynamicFvMesh   solidBodyMotionFvMesh;
+dynamicFvMesh   dynamicMotionSolverFvMesh;
 
 motionSolverLibs ( "libfvMotionSolvers.so" );
 
-solidBodyMotionFvMeshCoeffs
+solver solidBody;
+
+solidBodyCoeffs
 {
     cellZone        innerCylinderSmall;
 
diff --git a/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/Allrun b/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/Allrun
index 8f459da132154ca59474bb7d6ed514be1677d80d..43ab19017d4a50268db55da0dc6ebb7b20e9b04f 100755
--- a/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/Allrun
+++ b/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/Allrun
@@ -15,7 +15,7 @@ runApplication blockMesh
 runApplication decomposePar -decomposeParDict system/decomposeParDict.hierarchical
 
 # \cp system/decomposeParDict.ptscotch system/decomposeParDict
-runParallel snappyHexMesh -decomposeParDict system/decomposeParDict.ptscotch -profiling -overwrite -parallel
+runParallel snappyHexMesh -decomposeParDict system/decomposeParDict.ptscotch -profiling -overwrite
 
 find . -type f -iname "*level*" -exec rm {} \;
 
diff --git a/tutorials/mesh/blockMesh/pipe/Allrun b/tutorials/mesh/blockMesh/pipe/Allrun
new file mode 100755
index 0000000000000000000000000000000000000000..3c4ef3e7fffd9530e7208b7e0b463a777a3bac00
--- /dev/null
+++ b/tutorials/mesh/blockMesh/pipe/Allrun
@@ -0,0 +1,9 @@
+#!/bin/sh
+cd ${0%/*} || exit 1    # Run from this directory
+
+# Source tutorial run functions
+. $WM_PROJECT_DIR/bin/tools/RunFunctions
+
+runApplication blockMesh
+
+#------------------------------------------------------------------------------
diff --git a/tutorials/mesh/blockMesh/pipe/constant/triSurface/curve.obj b/tutorials/mesh/blockMesh/pipe/constant/triSurface/curve.obj
new file mode 100644
index 0000000000000000000000000000000000000000..9d5e40f6d7725c20f2a5a00c5e608bbaaf46e24f
--- /dev/null
+++ b/tutorials/mesh/blockMesh/pipe/constant/triSurface/curve.obj
@@ -0,0 +1,9 @@
+v -5   0.4  0
+v -4   0.4  0
+v -3   0.4  0.7
+v -2.5 0.4  2
+v -2   0.4  2
+v -1   0.4  0.7
+v -0.6 0.4  0
+v 10   0.4  0
+l 1 2 3 4 5 6 7 8
diff --git a/tutorials/mesh/blockMesh/pipe/constant/triSurface/curve2.vtk b/tutorials/mesh/blockMesh/pipe/constant/triSurface/curve2.vtk
new file mode 100644
index 0000000000000000000000000000000000000000..02142a3426c73a8d3b52d201f2221887320bb8dc
--- /dev/null
+++ b/tutorials/mesh/blockMesh/pipe/constant/triSurface/curve2.vtk
@@ -0,0 +1,13 @@
+# vtk DataFile Version 4.0
+vtk output
+ASCII
+DATASET POLYDATA
+POINTS 17 double
+-5.0437 0.4 -0.0159845 -4.54848 0.4 0.00946291 -4.30524 0.4 0.0219617
+-4.11475 0.4 0.0317502 -3.65463 0.4 0.0664504 -3.42509 0.4 0.242198
+-3.26981 0.4 0.570689 -3.04354 0.4 0.986036 -2.80622 0.4 1.28924
+-2.45212 0.4 1.43367 -2.10187 0.4 1.42911 -1.8115 0.4 1.2018
+-1.52708 0.4 0.866397 -1.30229 0.4 0.49514 -1.04633 0.4 0.189424
+-0.5819 0.4 -5.75752e-05 4 0.4 0
+LINES 1 18
+17 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
diff --git a/tutorials/mesh/blockMesh/pipe/system/blockMeshDict b/tutorials/mesh/blockMesh/pipe/system/blockMeshDict
new file mode 100644
index 0000000000000000000000000000000000000000..5c283f373b0664ab6bee53e211e37ad2c633a132
--- /dev/null
+++ b/tutorials/mesh/blockMesh/pipe/system/blockMeshDict
@@ -0,0 +1,177 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       dictionary;
+    object      blockMeshDict;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+geometry
+{
+    cylinder
+    {
+        type searchableCylinder;
+        point1 (0 -4 0);
+        point2 (0 4 0);
+        radius 0.7;
+    }
+    cylinder3
+    {
+        type searchableCylinder;
+        point1 (-10 0.4 0);
+        point2 (10 0.4 0);
+        radius 0.5;
+    }
+    cylinder2
+    {
+        type    searchableExtrudedCircle;
+        file    "curve2.vtk";
+        radius  0.5;
+    }
+    inletPlane
+    {
+        type    searchablePlate;
+        origin  (-4 -50 -50);
+        span    (0 100 100);
+    }
+}
+
+vertices
+(
+    // Vertical cylinder
+    name v0 project (-1 -0.1 -1) (cylinder cylinder2)
+    name v1 project ( 1 -0.1 -1) (cylinder)
+    name v2 project ( 1  0.9 -1) (cylinder)
+    name v3 project (-1  0.9 -1) (cylinder cylinder2)
+    name v4 project (-1 -0.1  1) (cylinder cylinder2)
+    name v5 project ( 1 -0.1  1) (cylinder)
+    name v6 project ( 1  0.9  1) (cylinder)
+    name v7 project (-1  0.9  1) (cylinder cylinder2)
+
+
+    // Horizontal cylinder
+    name v8  project (-4  0 -0.5) (cylinder2 inletPlane)
+    name v9  project (-4  1 -0.5) (cylinder2 inletPlane)
+    name v10 project (-4  0  0.5) (cylinder2 inletPlane)
+    name v11 project (-4  1  0.5) (cylinder2 inletPlane)
+
+
+    // On top of vertical cylinder
+    name v12 project (-1 2 -1) (cylinder)
+    name v13 project ( 1 2 -1) (cylinder)
+    name v14 project ( 1 2  1) (cylinder)
+    name v15 project (-1 2  1) (cylinder)
+
+    // Below vertical cylinder
+    name v16 project (-1 -1 -1) (cylinder)
+    name v17 project ( 1 -1 -1) (cylinder)
+    name v18 project ( 1 -1  1) (cylinder)
+    name v19 project (-1 -1  1) (cylinder)
+);
+
+blocks
+(
+    hex (v0 v1 v2 v3 v4 v5 v6 v7) (8 8 8) simpleGrading (1 1 1)
+    name sideBlock hex (v0 v3 v9 v8 v4 v7 v11 v10) (8 20 8)
+        simpleGrading (1 1 1)
+
+    hex ( v7 v6 v2 v3 v15 v14 v13 v12) (8 8 8) simpleGrading (1 1 1)
+    hex (v16 v19 v18 v17 v0 v4 v5 v1) (8 8 8) simpleGrading (1 1 1)
+);
+
+edges
+(
+    project v0 v1 (cylinder)
+    project v1 v2 (cylinder)
+    project v2 v3 (cylinder)
+
+    project v1 v5 (cylinder)
+    project v2 v6 (cylinder)
+
+    project v4 v5 (cylinder)
+    project v5 v6 (cylinder)
+    project v6 v7 (cylinder)
+
+    // Common face
+    project v3 v0 (cylinder cylinder2)
+    project v3 v7 (cylinder cylinder2)
+    project v7 v4 (cylinder cylinder2)
+    project v0 v4 (cylinder cylinder2)
+
+    // Inlet
+    project v8 v10 (cylinder2 inletPlane)
+    project v10 v11 (cylinder2 inletPlane)
+    project v11 v9 (cylinder2 inletPlane)
+    project v9 v8 (cylinder2 inletPlane)
+
+    // Sides of horizontal cylinder. Use projectCurve to do interpolation
+    // for radial direction to keep points along edges at constant radial
+    // direction.
+    projectCurve v8  v0 (cylinder2)
+    projectCurve v9  v3 (cylinder2)
+    projectCurve v11 v7 (cylinder2)
+    projectCurve v10 v4 (cylinder2)
+
+
+
+    // Top cylinder
+    project v12 v15 (cylinder)
+    project v15 v14 (cylinder)
+    project v14 v13 (cylinder)
+    project v13 v12 (cylinder)
+
+    // Bottom cylinder
+    project v16 v17 (cylinder)
+    project v17 v18 (cylinder)
+    project v18 v19 (cylinder)
+    project v19 v16 (cylinder)
+);
+
+faces
+(
+    // Common face
+    project (v0 v4 v7 v3) cylinder
+
+    project (v8 v0 v4 v10) cylinder2
+    project (v10 v4 v7 v11) cylinder2
+    project (v11 v7 v3 v9) cylinder2
+    project (v8 v9 v3 v0) cylinder2
+);
+
+
+defaultPatch
+{
+    name walls;
+    type wall;
+}
+
+boundary
+(
+    side
+    {
+        type    patch;
+        faces   ((sideBlock 3));   //((v8 v10 v11 v9));
+    }
+
+    inlet
+    {
+        type    patch;
+        faces   ((v17 v18 v19 v16));
+    }
+
+    outlet
+    {
+        type    patch;
+        faces   ((v12 v15 v14 v13));
+    }
+);
+
+// ************************************************************************* //
diff --git a/tutorials/mesh/blockMesh/pipe/system/controlDict b/tutorials/mesh/blockMesh/pipe/system/controlDict
new file mode 100644
index 0000000000000000000000000000000000000000..451036b13e91663bb120a3198a9149f782a110ea
--- /dev/null
+++ b/tutorials/mesh/blockMesh/pipe/system/controlDict
@@ -0,0 +1,58 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       dictionary;
+    location    "system";
+    object      controlDict;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+libs            ("libblockMesh.so");
+
+DebugSwitches
+{
+//    project 1;
+//    searchableExtrudedCircle 1;
+//    projectCurve 1;
+}
+
+application     blockMesh;
+
+startFrom       startTime;
+
+startTime       0;
+
+stopAt          endTime;
+
+endTime         0;
+
+deltaT          0;
+
+writeControl    timeStep;
+
+writeInterval   1;
+
+purgeWrite      0;
+
+writeFormat     ascii;
+
+writePrecision  6;
+
+writeCompression off;
+
+timeFormat      general;
+
+timePrecision   6;
+
+runTimeModifiable true;
+
+
+// ************************************************************************* //
diff --git a/tutorials/mesh/blockMesh/pipe/system/fvSchemes b/tutorials/mesh/blockMesh/pipe/system/fvSchemes
new file mode 100644
index 0000000000000000000000000000000000000000..606b28ce04cbf3cc6330261345fabaa76b4d47b4
--- /dev/null
+++ b/tutorials/mesh/blockMesh/pipe/system/fvSchemes
@@ -0,0 +1,37 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       dictionary;
+    location    "system";
+    object      fvSchemes;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+ddtSchemes
+{}
+
+gradSchemes
+{}
+
+divSchemes
+{}
+
+laplacianSchemes
+{}
+
+interpolationSchemes
+{}
+
+snGradSchemes
+{}
+
+
+// ************************************************************************* //
diff --git a/tutorials/mesh/blockMesh/pipe/system/fvSolution b/tutorials/mesh/blockMesh/pipe/system/fvSolution
new file mode 100644
index 0000000000000000000000000000000000000000..6db4e1a6ba541b790f69ca0a506d8c2f547e51cc
--- /dev/null
+++ b/tutorials/mesh/blockMesh/pipe/system/fvSolution
@@ -0,0 +1,18 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       dictionary;
+    location    "system";
+    object      fvSolution;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+// ************************************************************************* //
diff --git a/tutorials/mesh/foamyHexMesh/mixerVessel/constant/dynamicMeshDict b/tutorials/mesh/foamyHexMesh/mixerVessel/constant/dynamicMeshDict
index 9099cdd5c13bf4fb008f27113dc55138a7671c0e..24b3e86887d072ce7329a5ac60a9a6d7fd4ccec6 100644
--- a/tutorials/mesh/foamyHexMesh/mixerVessel/constant/dynamicMeshDict
+++ b/tutorials/mesh/foamyHexMesh/mixerVessel/constant/dynamicMeshDict
@@ -15,11 +15,13 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-dynamicFvMesh   solidBodyMotionFvMesh;
+dynamicFvMesh   dynamicMotionSolverFvMesh;
 
 motionSolverLibs ( "libfvMotionSolvers.so" );
 
-solidBodyMotionFvMeshCoeffs
+solver solidBody;
+
+solidBodyCoeffs
 {
     cellZone        rotating;
 
diff --git a/tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/constant/dynamicMeshDict b/tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/constant/dynamicMeshDict
index d02a77dba8f31c78e01a04fb2e491f47d916fe21..26a2e7018f9a43a2944a6f42988588fe224b9f8b 100644
--- a/tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/constant/dynamicMeshDict
+++ b/tutorials/multiphase/compressibleInterDyMFoam/RAS/sloshingTank2D/constant/dynamicMeshDict
@@ -15,9 +15,11 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-dynamicFvMesh   solidBodyMotionFvMesh;
+dynamicFvMesh   dynamicMotionSolverFvMesh;
 
-solidBodyMotionFvMeshCoeffs
+solver solidBody;
+
+solidBodyCoeffs
 {
     solidBodyMotionFunction SDA;
     SDACoeffs
diff --git a/tutorials/multiphase/interDyMFoam/RAS/mixerVesselAMI/constant/dynamicMeshDict b/tutorials/multiphase/interDyMFoam/RAS/mixerVesselAMI/constant/dynamicMeshDict
index 9099cdd5c13bf4fb008f27113dc55138a7671c0e..24b3e86887d072ce7329a5ac60a9a6d7fd4ccec6 100644
--- a/tutorials/multiphase/interDyMFoam/RAS/mixerVesselAMI/constant/dynamicMeshDict
+++ b/tutorials/multiphase/interDyMFoam/RAS/mixerVesselAMI/constant/dynamicMeshDict
@@ -15,11 +15,13 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-dynamicFvMesh   solidBodyMotionFvMesh;
+dynamicFvMesh   dynamicMotionSolverFvMesh;
 
 motionSolverLibs ( "libfvMotionSolvers.so" );
 
-solidBodyMotionFvMeshCoeffs
+solver solidBody;
+
+solidBodyCoeffs
 {
     cellZone        rotating;
 
diff --git a/tutorials/multiphase/interDyMFoam/laminar/sloshingTank2D/constant/dynamicMeshDict b/tutorials/multiphase/interDyMFoam/laminar/sloshingTank2D/constant/dynamicMeshDict
index d02a77dba8f31c78e01a04fb2e491f47d916fe21..26a2e7018f9a43a2944a6f42988588fe224b9f8b 100644
--- a/tutorials/multiphase/interDyMFoam/laminar/sloshingTank2D/constant/dynamicMeshDict
+++ b/tutorials/multiphase/interDyMFoam/laminar/sloshingTank2D/constant/dynamicMeshDict
@@ -15,9 +15,11 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-dynamicFvMesh   solidBodyMotionFvMesh;
+dynamicFvMesh   dynamicMotionSolverFvMesh;
 
-solidBodyMotionFvMeshCoeffs
+solver solidBody;
+
+solidBodyCoeffs
 {
     solidBodyMotionFunction SDA;
     SDACoeffs
diff --git a/tutorials/multiphase/interDyMFoam/laminar/sloshingTank2D3DoF/constant/dynamicMeshDict b/tutorials/multiphase/interDyMFoam/laminar/sloshingTank2D3DoF/constant/dynamicMeshDict
index 256d87cc3f9d0fa71c4d09742fa76c77eae20820..cdf917c2f4e9a2b22984ccc5a135d5a96e19f163 100644
--- a/tutorials/multiphase/interDyMFoam/laminar/sloshingTank2D3DoF/constant/dynamicMeshDict
+++ b/tutorials/multiphase/interDyMFoam/laminar/sloshingTank2D3DoF/constant/dynamicMeshDict
@@ -15,9 +15,11 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-dynamicFvMesh   solidBodyMotionFvMesh;
+dynamicFvMesh   dynamicMotionSolverFvMesh;
 
-solidBodyMotionFvMeshCoeffs
+solver solidBody;
+
+solidBodyCoeffs
 {
     solidBodyMotionFunction SDA;
     SDACoeffs
diff --git a/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D/constant/dynamicMeshDict b/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D/constant/dynamicMeshDict
index 34f15c02b714294f0bcf78b6f7645011fc77f853..e483843b00fe8f80c39c1484b3eb475400b93f5d 100644
--- a/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D/constant/dynamicMeshDict
+++ b/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D/constant/dynamicMeshDict
@@ -15,9 +15,11 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-dynamicFvMesh   solidBodyMotionFvMesh;
+dynamicFvMesh   dynamicMotionSolverFvMesh;
 
-solidBodyMotionFvMeshCoeffs
+solver solidBody;
+
+solidBodyCoeffs
 {
     solidBodyMotionFunction SDA;
     SDACoeffs
diff --git a/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D3DoF/constant/dynamicMeshDict b/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D3DoF/constant/dynamicMeshDict
index 256d87cc3f9d0fa71c4d09742fa76c77eae20820..cdf917c2f4e9a2b22984ccc5a135d5a96e19f163 100644
--- a/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D3DoF/constant/dynamicMeshDict
+++ b/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D3DoF/constant/dynamicMeshDict
@@ -15,9 +15,11 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-dynamicFvMesh   solidBodyMotionFvMesh;
+dynamicFvMesh   dynamicMotionSolverFvMesh;
 
-solidBodyMotionFvMeshCoeffs
+solver solidBody;
+
+solidBodyCoeffs
 {
     solidBodyMotionFunction SDA;
     SDACoeffs
diff --git a/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D6DoF/constant/dynamicMeshDict b/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D6DoF/constant/dynamicMeshDict
index 64c23c651214cd094922664f48701cc23efd1151..70672aefe05a49a343cfc68c9c6f2075ee7ba80a 100644
--- a/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D6DoF/constant/dynamicMeshDict
+++ b/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D6DoF/constant/dynamicMeshDict
@@ -15,9 +15,11 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-dynamicFvMesh   solidBodyMotionFvMesh;
+dynamicFvMesh   dynamicMotionSolverFvMesh;
 
-solidBodyMotionFvMeshCoeffs
+solver solidBody;
+
+solidBodyCoeffs
 {
     solidBodyMotionFunction tabulated6DoFMotion;
     tabulated6DoFMotionCoeffs
diff --git a/tutorials/multiphase/interDyMFoam/laminar/testTubeMixer/constant/dynamicMeshDict b/tutorials/multiphase/interDyMFoam/laminar/testTubeMixer/constant/dynamicMeshDict
index c6fa67e32640901a6fc815f49cecffe83526765b..1f0d4c253ea14c8eec4c68b84d8c0b372549ab5b 100644
--- a/tutorials/multiphase/interDyMFoam/laminar/testTubeMixer/constant/dynamicMeshDict
+++ b/tutorials/multiphase/interDyMFoam/laminar/testTubeMixer/constant/dynamicMeshDict
@@ -15,9 +15,11 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-dynamicFvMesh   solidBodyMotionFvMesh;
+dynamicFvMesh   dynamicMotionSolverFvMesh;
 
-solidBodyMotionFvMeshCoeffs
+solver solidBody;
+
+solidBodyCoeffs
 {
     solidBodyMotionFunction multiMotion;
 
diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/constant/dynamicMeshDict b/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/constant/dynamicMeshDict
index f235e0ee9c908dc4734c50662c079568cfb98b67..9f4a4cd86d5c9c09ac9de7cd87b80f54a832b5fd 100644
--- a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/constant/dynamicMeshDict
+++ b/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/constant/dynamicMeshDict
@@ -15,11 +15,13 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-dynamicFvMesh   solidBodyMotionFvMesh;
+dynamicFvMesh   dynamicMotionSolverFvMesh;
 
 motionSolverLibs ( "libfvMotionSolvers.so" );
 
-solidBodyMotionFvMeshCoeffs
+solver solidBody;
+
+solidBodyCoeffs
 {
     cellZone        innerCylinderSmall;
 
diff --git a/tutorials/multiphase/multiphaseInterDyMFoam/laminar/mixerVesselAMI2D/constant/dynamicMeshDict b/tutorials/multiphase/multiphaseInterDyMFoam/laminar/mixerVesselAMI2D/constant/dynamicMeshDict
index 00ef84689bc4e12c67406c7505ddee94d2996dae..bfce8712bb2747c065a9660c4cb538be3776f251 100644
--- a/tutorials/multiphase/multiphaseInterDyMFoam/laminar/mixerVesselAMI2D/constant/dynamicMeshDict
+++ b/tutorials/multiphase/multiphaseInterDyMFoam/laminar/mixerVesselAMI2D/constant/dynamicMeshDict
@@ -15,11 +15,13 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-dynamicFvMesh   solidBodyMotionFvMesh;
+dynamicFvMesh   dynamicMotionSolverFvMesh;
 
 motionSolverLibs ( "libfvMotionSolvers.so" );
 
-solidBodyMotionFvMeshCoeffs
+solver solidBody;
+
+solidBodyCoeffs
 {
     cellZone        rotor;
 
diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/Allrun b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/Allrun
index c056332036ab4e1ae0f90a6f704c5f4c28e184cb..59d62c7881fb2c2c8fed84d24def73039b9694a6 100755
--- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/Allrun
+++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/Allrun
@@ -10,7 +10,7 @@ runApplication $(getApplication)
 if ! isTest $@
 then
     foamDictionary system/controlDict -entry endTime -set 5
-    foamDictionary 2/T.liquid -entry boundaryField.wall2.q -set 1e5
+    foamDictionary 2/T.liquid -entry boundaryField.wall2.q -set 'uniform 1e5'
     runApplication -a $(getApplication)
 fi
 
diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/Allrun b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/Allrun
index c056332036ab4e1ae0f90a6f704c5f4c28e184cb..59d62c7881fb2c2c8fed84d24def73039b9694a6 100755
--- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/Allrun
+++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/Allrun
@@ -10,7 +10,7 @@ runApplication $(getApplication)
 if ! isTest $@
 then
     foamDictionary system/controlDict -entry endTime -set 5
-    foamDictionary 2/T.liquid -entry boundaryField.wall2.q -set 1e5
+    foamDictionary 2/T.liquid -entry boundaryField.wall2.q -set 'uniform 1e5'
     runApplication -a $(getApplication)
 fi
 
diff --git a/wmake/makefiles/apps b/wmake/makefiles/apps
index b8abcd2e95461f9bd7e06904967c21cfddc0dc6c..d871a2a83b7d87e5b7b050f3377efd9ed749c8a4 100644
--- a/wmake/makefiles/apps
+++ b/wmake/makefiles/apps
@@ -1,8 +1,8 @@
-#-------------------------------*- makefile -*---------------------------------
+#----------------------------*- makefile-gmake -*------------------------------
 # =========                 |
 # \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
 #  \\    /   O peration     |
-#   \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+#   \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
 #    \\/     M anipulation  |
 #------------------------------------------------------------------------------
 # License
diff --git a/wmake/makefiles/files b/wmake/makefiles/files
index c17179eaaad33232d3c74723a98282261af03dea..21b43c71920ad00ce0c008320cfb0e4146f323eb 100644
--- a/wmake/makefiles/files
+++ b/wmake/makefiles/files
@@ -1,4 +1,4 @@
-#-------------------------------*- makefile -*---------------------------------
+#----------------------------*- makefile-gmake -*------------------------------
 # =========                 |
 # \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
 #  \\    /   O peration     |
diff --git a/wmake/makefiles/general b/wmake/makefiles/general
index b7f49358a173c24a417ee7b73364b17cead07302..c4085123af809495c0bac280c30e0f1011094495 100644
--- a/wmake/makefiles/general
+++ b/wmake/makefiles/general
@@ -1,4 +1,4 @@
-#-------------------------------*- makefile -*---------------------------------
+#----------------------------*- makefile-gmake -*------------------------------
 # =========                 |
 # \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
 #  \\    /   O peration     |
@@ -128,18 +128,28 @@ LIB_HEADER_DIRS = \
 # Define link statements for executables
 #------------------------------------------------------------------------------
 
+.PHONY: all
+all: $(EXE)
+	@:
+
+.PHONY: silent
+silent:
+	@:
+
 $(EXE): $(OBJECTS)
 	@$(WM_SCRIPTS)/makeTargetDir $(EXE)
-	$(LINKEXE) $(OBJECTS) -L$(LIB_PLATFORMS) \
+	$(call QUIET_MESSAGE,ld,$(EXE))
+	$E $(LINKEXE) $(OBJECTS) -L$(LIB_PLATFORMS) \
 	    $(EXE_LIBS) $(PROJECT_LIBS) $(SYS_LIBS) \
 	    $(LINK_LIBS) $(GLIBS) -o $(EXE)
 
-exe:    $(SEXE)
-	@echo \'$(SEXE)\' is up to date.
+.PHONY: exe
+exe: $(SEXE) | silent
 
-$(SEXE):$(OBJECTS)
+$(SEXE): $(OBJECTS)
 	@$(WM_SCRIPTS)/makeTargetDir $(SEXE)
-	$(LINKEXE) $(OBJECTS) $(EXE_LIBS) \
+	$(call QUIET_MESSAGE,ld,$(SEXE))
+	$E $(LINKEXE) $(OBJECTS) $(EXE_LIBS) \
 	    $(SYS_LIBS) $(LINK_LIBS) $(GLIBS) -o $(SEXE)
 
 
@@ -147,32 +157,37 @@ $(SEXE):$(OBJECTS)
 # Define link statements for libraries
 #------------------------------------------------------------------------------
 
-objects: $(OBJECTS)
+.PHONY: objects
+objects: $(OBJECTS) | silent
 
-libso:  $(LIB).$(SO)
-	@echo \'$(LIB).$(SO)\' is up to date.
+.PHONY: libso
+libso: $(LIB).$(SO) | silent
 
 $(LIB).$(SO): $(OBJECTS)
 	@$(WM_SCRIPTS)/makeTargetDir $(LIB)
-	$(LINKLIBSO) $(OBJECTS) -L$(LIB_PLATFORMS) \
+	$(call QUIET_MESSAGE,ld,$(LIB).$(SO))
+	$E $(LINKLIBSO) $(OBJECTS) -L$(LIB_PLATFORMS) \
 	    $(LIB_LIBS) $(GLIB_LIBS) -o $(LIB).$(SO)
 
-lib:    $(LIB).a
-	@echo \'$(LIB).a\' is up to date.
+.PHONY: lib
+lib: $(LIB).a | silent
 
 $(LIB).a: $(OBJECTS)
 	@$(WM_SCRIPTS)/makeTargetDir $(LIB)
 	@rm -f $(LIB).a
-	$(AR) $(ARFLAGS) $(LIB).a $(OBJECTS)
-	$(RANLIB) $(LIB).a
+	$(call QUIET_MESSAGE,ar,$(LIB))
+	$E $(AR) $(ARFLAGS) $(LIB).a $(OBJECTS)
+	$(call QUIET_MESSAGE,ranlib,$(notdir $(LIB)))
+	$E $(RANLIB) $(LIB).a
 
-libo:   $(LIB).o
-	@echo \'$(LIB).o\' is up to date.
+.PHONY: libo
+libo: $(LIB).o | silent
 
 $(LIB).o: $(OBJECTS)
 	@$(WM_SCRIPTS)/makeTargetDir $(LIB)
 	@rm -f $(LIB).o
-	$(LD) -r -o $(LIB).o $(OBJECTS)
+	$(call QUIET_MESSAGE,ld,$(LIB).o)
+	$E $(LD) -r -o $(LIB).o $(OBJECTS)
 
 
 #------------------------------------------------------------------------------
@@ -187,7 +202,7 @@ lnInclude: $(MAKE_DIR)/files $(MAKE_DIR)/options
 # Declare all object files depend on $(OBJECTS_DIR)/options
 #------------------------------------------------------------------------------
 
-$(OBJECTS) : $(OBJECTS_DIR)/options
+$(OBJECTS): $(OBJECTS_DIR)/options
 $(foreach S,$(SOURCE),$(eval $(OBJECTS_DIR)/$(basename $S).o : $(OBJECTS_DIR)/$S.dep))
 
 
@@ -205,4 +220,4 @@ ifeq ($(findstring lnInclude,$(MAKECMDGOALS))$(findstring updatedep,$(MAKECMDGOA
 endif
 
 
-#------------------------------------------------------------------------------
+#----------------------------- vim: set ft=make: ------------------------------
diff --git a/wmake/rules/General/bison b/wmake/rules/General/bison
index 4811b0ec1ca31b4bb8f4180fd0ab322c66805ed4..590996c953c15e038a6a7bd07d9ecfcd5e08e1b6 100644
--- a/wmake/rules/General/bison
+++ b/wmake/rules/General/bison
@@ -1,11 +1,13 @@
 SUFFIXES += .y .Y
 
-ytoo = $(WM_SCHEDULER) bison -v -d -y $< $(AND) \
+ytoo = $E $(call QUIET_MESSAGE,bison,$(<F)) \
+    $(WM_SCHEDULER) bison -v -d -y $< $(AND) \
     mv y.tab.c $(@D)/$(<F).c $(AND) \
     mv y.tab.h $(@D)/$(<F).h $(AND) \
     $(cc) $(cFLAGS) -c  $(@D)/$(<F).c -o $@
 
-Ytoo = $(WM_SCHEDULER) bison -v -d -y $< $(AND) \
+Ytoo = $E $(call QUIET_MESSAGE,bison,$(<F)) \
+    $(WM_SCHEDULER) bison -v -d -y $< $(AND) \
     mv y.tab.c $(@D)/$(<F).C $(AND) \
     mv y.tab.h $(@D)/$(<F).H $(AND) \
     $(CC) $(c++FLAGS) -c  $(@D)/$(<F).C -o $@
diff --git a/wmake/rules/General/btyacc b/wmake/rules/General/btyacc
index 90124ebd458adecdd75257719c4df3b112128fff..b8b26e00267643cbba33d10f406674d0ceffa209 100644
--- a/wmake/rules/General/btyacc
+++ b/wmake/rules/General/btyacc
@@ -1,6 +1,7 @@
 SUFFIXES += .y
 
-ytoo = $(WM_SCHEDULER) btyacc -v -d $(SKELETON) $< $(AND) \
+ytoo = $E $(call QUIET_MESSAGE,btyacc,$(<F)) \
+    $(WM_SCHEDULER) btyacc -v -d $(SKELETON) $< $(AND) \
     mv y_tab.c $(@D)/$(<F).C $(AND) \
     mv y_tab.h $(@D)/$(<F).H $(AND) \
     $(CC) $(c++FLAGS) -c $(@D)/$(<F).C -o $@
diff --git a/wmake/rules/General/btyacc++ b/wmake/rules/General/btyacc++
index 2aa66cc8cb65bb60cd51ac8535e7fd438379cf2c..fdbbf78453265ea6776edeaee5e8d2e5792b7682 100644
--- a/wmake/rules/General/btyacc++
+++ b/wmake/rules/General/btyacc++
@@ -1,6 +1,7 @@
 SUFFIXES += .Y
 
-Ytoo = $(WM_SCHEDULER) btyacc++ -v -d $(SKELETON) $< $(AND) \
+Ytoo = $E $(call QUIET_MESSAGE,btyacc++,$(<F)) \
+    $(WM_SCHEDULER) btyacc++ -v -d $(SKELETON) $< $(AND) \
     mv y_tab.c $(@D)/$(<F).C $(AND) \
     mv y_tab.h $(@D)/$(<F).H $(AND) \
     $(CC) $(c++FLAGS) -c $(@D)/$(<F).C -o $@
diff --git a/wmake/rules/General/byacc b/wmake/rules/General/byacc
index 177733805c4d33321f5407c87bd35961c1c3f20b..093d28745c335e30befdffa4236ba49656dbe9e6 100644
--- a/wmake/rules/General/byacc
+++ b/wmake/rules/General/byacc
@@ -1,6 +1,7 @@
 SUFFIXES += .y
 
-ytoo = $(WM_SCHEDULER) byacc -v $(YYPREFIX) -d $< $(AND) \
+ytoo = $E $(call QUIET_MESSAGE,byacc,$(<F)) \
+    $(WM_SCHEDULER) byacc -v $(YYPREFIX) -d $< $(AND) \
     mv y.tab.c $(@D)/$(<F).C $(AND) \
     mv y.tab.h $(@D)/$(<F).H $(AND) \
     $(CC) $(c++FLAGS) -c $(@D)/$(<F).C -o $@
diff --git a/wmake/rules/General/flex b/wmake/rules/General/flex
index 3f2fe373f750985995e0a480d50cad531b0c1c44..4029b97b10db361710a3eb4599db2881d5b63ab9 100644
--- a/wmake/rules/General/flex
+++ b/wmake/rules/General/flex
@@ -1,4 +1,5 @@
 SUFFIXES += .l
 
-ltoo = $(WM_SCHEDULER) flex -o $(@D)/$(<F).c $< $(AND) \
+ltoo = $E $(call QUIET_MESSAGE,flex,$(<F)) \
+    $(WM_SCHEDULER) flex -o $(@D)/$(<F).c $< $(AND) \
     $(cc) $(cFLAGS) -c  $(@D)/$(<F).c -o $@
diff --git a/wmake/rules/General/flex++ b/wmake/rules/General/flex++
index 4a140628fc36b9b3ef231d41fef9384e9f2771ef..dcea7ec72a9f5060ca76cdcea249c47edd5c6807 100644
--- a/wmake/rules/General/flex++
+++ b/wmake/rules/General/flex++
@@ -1,4 +1,5 @@
 SUFFIXES += .L
 
-Ltoo = $(WM_SCHEDULER) flex -+ -o$(@D)/$(<F).C -f $< $(AND) \
+Ltoo = $E $(call QUIET_MESSAGE,flex++,$(<F)) \
+    $(WM_SCHEDULER) flex -+ -o$(@D)/$(<F).C -f $< $(AND) \
     $(CC) $(c++FLAGS) $(c++LESSWARN) -c $(@D)/$(<F).C -o $@
diff --git a/wmake/rules/General/general b/wmake/rules/General/general
index f7e42cbef34a9482b129c9b44e04b196d520fc3a..4dffa627e3e7005362634e3722a87afb1ca61a99 100644
--- a/wmake/rules/General/general
+++ b/wmake/rules/General/general
@@ -1,5 +1,5 @@
 #-------------------------------*- makefile -*---------------------------------
-WM_VERSION = OPENFOAM_PLUS=1609
+WM_VERSION = OPENFOAM_PLUS=1612
 
 AR         = ar
 ARFLAGS    = cr
diff --git a/wmake/rules/General/moc b/wmake/rules/General/moc
index 02a075843e099a8b2bdc5e8311c8df5fe5a05655..1a0d4160cc68ab4dc6c7e489757c94fda35a25fe 100644
--- a/wmake/rules/General/moc
+++ b/wmake/rules/General/moc
@@ -1,4 +1,5 @@
 SUFFIXES += .qt
 
-qttoo = $(WM_SCHEDULER) $(QTDIR)/bin/moc -f $< -o $(@D)/$(<F).C $(AND) \
-    $(CC) $(c++FLAGS) -c $(@D)/$(<F).C -o $@
+qttoo = $E $(call QUIET_MESSAGE,moc,$(<F)) \
+       $(WM_SCHEDULER) $(QTDIR)/bin/moc -f $< -o $(@D)/$(<F).C $(AND) \
+       $(CC) $(c++FLAGS) -c $(@D)/$(<F).C -o $@
diff --git a/wmake/rules/General/standard b/wmake/rules/General/standard
index ccd69cede3aa7f8003f25b3cbdc49096a4752a9d..0aa96894077f5938c6539f704d993a28d93b841e 100644
--- a/wmake/rules/General/standard
+++ b/wmake/rules/General/standard
@@ -1,4 +1,4 @@
-#-------------------------------*- makefile -*---------------------------------
+#----------------------------*- makefile-gmake -*------------------------------
 
 SUFFIXES=
 
diff --git a/wmake/rules/General/transform b/wmake/rules/General/transform
index 3fa0152040e2b57dbe58779c47458356af8b299a..165c4a1f4e8b9211e92c79385e74abe7dfc7ea9d 100644
--- a/wmake/rules/General/transform
+++ b/wmake/rules/General/transform
@@ -1,13 +1,32 @@
-#-------------------------------*- makefile -*---------------------------------
+#----------------------------*- makefile-gmake -*------------------------------
+
+ifneq ("$(WM_QUIET)","")
+    E=@
+    define QUIET_MESSAGE
+        @echo "    $1: $2";
+    endef
+    define VERBOSE_MESSAGE
+    endef
+else
+    E=
+    define QUIET_MESSAGE
+    endef
+    define VERBOSE_MESSAGE
+        @echo "$1 $2";
+    endef
+endif
 
 define DEFINE_TRANSFORM
 $(OBJECTS_DIR)/%.o : %$1
-	$$($(subst .,,$(1))too)
+	$(call QUIET_MESSAGE,$(subst .,,$(1))too,$(value <F))
+	$E $$($(subst .,,$(1))too)
 endef
 
 $(foreach s,$(SUFFIXES),$(eval $(call DEFINE_TRANSFORM,$(s))))
 
 $(OBJECTS_DIR)/%.dep : %
+	$(call QUIET_MESSAGE,wmkdep,$(<F))
+	$(call VERBOSE_MESSAGE,Making dependency list for source file,$(<F))
 	@$(WM_SCRIPTS)/makeTargetDir $@
 	@$(WMAKE_BIN)/wmkdep -I$(*D) $(LIB_HEADER_DIRS) $< | \
 		sed -e 's,^$(WM_PROJECT_DIR)/,$$(WM_PROJECT_DIR)/,' \
diff --git a/wmake/rules/General/version b/wmake/rules/General/version
index ffd070d0be814cc26573ba6e6071af419a5d0f55..ef3aa5c37d53ba79d4eb8e0dba34520621036fd5 100644
--- a/wmake/rules/General/version
+++ b/wmake/rules/General/version
@@ -1,4 +1,4 @@
-#-------------------------------*- makefile -*---------------------------------
+#----------------------------*- makefile-gmake -*------------------------------
 
 SUFFIXES += .Cver
 
diff --git a/wmake/rules/General/yacc b/wmake/rules/General/yacc
index 18d8902160787bfe5e837370ed81efd830a1b8aa..0daacdbb89222b3946e043842cbb4e5b909d6325 100644
--- a/wmake/rules/General/yacc
+++ b/wmake/rules/General/yacc
@@ -1,11 +1,13 @@
 SUFFIXES += .y .Y
 
-ytoo = $(WM_SCHEDULER) yacc -v -d $< $(AND) \
+ytoo = $E $(call QUIET_MESSAGE,yacc,$(<F)) \
+    $(WM_SCHEDULER) yacc -v -d $< $(AND) \
     mv y.tab.c $(@D)/$(<F).c $(AND) \
     mv y.tab.h $(@D)/parser.h $(AND) \
     $(CC) $(c++FLAGS) -c $(@D)/$(<F).c -o $@
 
-Ytoo = $(WM_SCHEDULER) yacc -v -d $< $(AND) \
+Ytoo = $E $(call QUIET_MESSAGE,yacc,$(<F)) \
+    $(WM_SCHEDULER) yacc -v -d $< $(AND) \
     mv y.tab.c $(@D)/$(<F).C $(AND) \
     mv y.tab.h $(@D)/parser.H $(AND) \
     $(CC) $(c++FLAGS) -c $(@D)/$(<F).C -o $@
diff --git a/wmake/scripts/AllwmakeParseArguments b/wmake/scripts/AllwmakeParseArguments
index c8bb3ccb7133f822a6434d0240ad24449fc0d42e..a985064effb564da3a768fac92f73e0d2bfda98a 100644
--- a/wmake/scripts/AllwmakeParseArguments
+++ b/wmake/scripts/AllwmakeParseArguments
@@ -97,6 +97,10 @@ done
 if [ -z "$fromWmake" ]
 then
     exec wmake -all $qOpt $*
+else
+    # Print command
+    [ -z "$targetType" ] || targetSpace=" "
+    echo "$Script $targetType$targetSpace$(echo $PWD | sed s%$WM_PROJECT_DIR/%% )"
 fi
 
 
diff --git a/wmake/src/Makefile b/wmake/src/Makefile
index f14baad937e099495610bff48240f15ba6bc2f04..9ced8251c991ca5e467e8d9761200126966e2f24 100644
--- a/wmake/src/Makefile
+++ b/wmake/src/Makefile
@@ -60,17 +60,17 @@ include $(GENERAL_RULES)/general
 all:  $(WMAKE_BIN)/dirToString $(WMAKE_BIN)/wmkdep
 
 clean:
-	rm -f $(WMAKE_BIN)/* 2>/dev/null
-
+	@E rm -f $(WMAKE_BIN)/* 2>/dev/null
 
 $(WMAKE_BIN)/dirToString: dirToString.c
 	@mkdir -p $(WMAKE_BIN)
-	$(cc) $(cFLAGS) dirToString.c -o $(WMAKE_BIN)/dirToString
-
+	$(call QUIET_MESSAGE,compile,$<)
+	$E $(cc) $(cFLAGS) dirToString.c -o $(WMAKE_BIN)/dirToString
 
 $(WMAKE_BIN)/wmkdep: wmkdep.l
 	@mkdir -p $(WMAKE_BIN)
-	flex wmkdep.l
+	$(call QUIET_MESSAGE,lex,$<)
+	$E flex wmkdep.l; \
 	$(cc) $(cFLAGS) lex.yy.c -o $(WMAKE_BIN)/wmkdep
 	@rm -f lex.yy.c 2>/dev/null
 
diff --git a/wmake/src/wmkdep.l b/wmake/src/wmkdep.l
index a98a5972787d41b59a8f26a564d981e642e1afd1..b0b48d1055d3280dbfd50f0b767ee5da239919dc 100644
--- a/wmake/src/wmkdep.l
+++ b/wmake/src/wmkdep.l
@@ -145,7 +145,7 @@ const char* bufferPaths[FILE_STACK_SIZE];
 int main(int argc, char* argv[])
 {
     char *basePos, *dotPos;
-    int i;
+    int i, silent;
 
     if (argc == 1)
     {
@@ -154,8 +154,6 @@ int main(int argc, char* argv[])
     }
 
     sourceFile = strdup(argv[argc-1]);
-    fprintf(stderr, "Making dependency list for source file %s\n", sourceFile);
-
 
     if ((basePos = strrchr(sourceFile, '/')) == NULL)
     {
diff --git a/wmake/wclean b/wmake/wclean
index fe8156aeb5142a5e125fe3758276fb06a7d58844..e2f6a3142c3154e1c7d45f2d6c097de1898d6846 100755
--- a/wmake/wclean
+++ b/wmake/wclean
@@ -122,8 +122,9 @@ then
         }
     fi
 
-    # Provide some feedback
-    echo "$Script $targetType ${dir:-.}"
+    # Print command
+    [ -z "$targetType" ] || targetSpace=" "
+    echo "$Script $targetType$targetSpace${dir:-.}"
 fi
 
 
@@ -164,7 +165,7 @@ then
 
         if [ -d $objectsDir ]
         then
-            echo "Removing redundant object directories in $objectsDir"
+            echo "    Removing redundant object directories in $objectsDir"
 
             find $objectsDir -name 'variables' -print | \
             while read variablesFile
@@ -230,7 +231,7 @@ then
         for dir in `find . \( -type d -a -name Make \)`
         do
             dir=${dir%/Make} # Parent directory - trim /Make from the end
-            echo $dir
+
             # If Allwclean exists execute otherwise wclean
             if [ -e "$dir/Allwclean" ]
             then
@@ -253,7 +254,7 @@ unset targetType
 if [ -d $MakeDir ]
 then
     objectsDir=$MakeDir/$WM_OPTIONS
-    if echo $PWD | grep "$WM_PROJECT_DIR"
+    if [ $(echo $PWD | grep "$WM_PROJECT_DIR") ]
     then
         platformPath=$WM_PROJECT_DIR/platforms/${WM_OPTIONS}
         objectsDir=$platformPath$(echo $PWD | sed s%$WM_PROJECT_DIR%% )
diff --git a/wmake/wmake b/wmake/wmake
index ebf50cd4ba40543cbfa19a35c75d7698cd9304df..38f3d3ff6e5e1ccfb4a0168871e04dd4719157a3 100755
--- a/wmake/wmake
+++ b/wmake/wmake
@@ -67,7 +67,7 @@ Usage: $Script [OPTION] [dir]
        $Script [OPTION] target [dir [MakeDir]]
 
 options:
-  -s | -silent      'silent' mode (does not echo commands)
+  -s | -silent      Quiet mode (does not echo commands)
   -a | -all         wmake all sub-directories, running Allwmake if present
   -q | -queue       wmakeQueue all sub-directories, running Allwmake if present
   -k or -non-stop   Compile without stopping when errors occur
@@ -138,7 +138,7 @@ do
             usage
             ;;
         -s | -silent)
-            make="$make -s"
+            export WM_QUIET=1
             ;;
         -a | -all | all)
             all="all"
@@ -268,6 +268,10 @@ then
             exit 1
         }
     fi
+
+    # Print command
+    [ -z "$targetType" ] || targetSpace=" "
+    echo "$Script $targetType$targetSpace${dir:-.}"
 fi
 
 
@@ -386,7 +390,7 @@ fi
 #------------------------------------------------------------------------------
 
 objectsDir=$MakeDir/$WM_OPTIONS
-if echo $PWD | grep "$WM_PROJECT_DIR"
+if [ $(echo $PWD | grep "$WM_PROJECT_DIR") ]
 then
     platformPath=$WM_PROJECT_DIR/platforms/${WM_OPTIONS}
     objectsDir=$platformPath$(echo $PWD | sed s%$WM_PROJECT_DIR%% )
diff --git a/wmake/wmakeCollect b/wmake/wmakeCollect
index 4f1ca4bf4f93d89934c82b91c0c2285b1f1494dd..2aaa2c6eef5fb531961c7de42238481bdddec7fe 100755
--- a/wmake/wmakeCollect
+++ b/wmake/wmakeCollect
@@ -99,6 +99,12 @@ then
 fi
 
 
+if [ -n "$WM_QUIET" ]
+then
+    E="@"
+fi
+
+
 # Collected makefile for this build
 makefile="$WM_COLLECT_DIR.Makefile"
 
@@ -117,6 +123,9 @@ then
     # Make sure directories exist
     mkdir -p $WM_COLLECT_DIR
 
+    # The current source file
+    source="${@: -3:1}"
+
     # The current target
     object="${@: -1:1}"
 
@@ -128,7 +137,9 @@ then
 
     # Add the build rule for the current target
     echo "$object: $makefile" >> $file
-    echo -e "\tcd $PWD && \\" >> $file
+    [ -z "$E" ] ||
+        echo -e "\t@echo \"    compiling: ${source##*/}\"" >> $file
+    echo -e "\t$E cd $PWD && \\" >> $file
     echo -e "\t${@:1:($#-1)} $object" >> $file
     echo >> $file
 else
diff --git a/wmake/wmakeLnInclude b/wmake/wmakeLnInclude
index a9195b962866eefc0cc47e48a71b4bdb97f94332..3db3802de4cb15945533348d1d7c8ebf5a1bcb9d 100755
--- a/wmake/wmakeLnInclude
+++ b/wmake/wmakeLnInclude
@@ -138,9 +138,12 @@ fi
 
 cd $incDir || exit 1
 
-[ "$silentOpt" = true ] || {
+if [ "$silentOpt" = true -o -n "$WM_QUIET" ]
+then
+    echo "    ln: $incDir" 1>&2
+else
     echo "$Script: linking include files to $incDir" 1>&2
-}
+fi
 
 
 #------------------------------------------------------------------------------