diff --git a/README b/README
deleted file mode 100644
index d2a992048cf9e82eaf49f8b5e41b655b393247a8..0000000000000000000000000000000000000000
--- a/README
+++ /dev/null
@@ -1,209 +0,0 @@
-#                            -*- mode: org; -*-
-#
-#+TITLE:             OpenFOAM README for version 1.6
-#+AUTHOR:                      OpenCFD Ltd.
-#+DATE:                         April 2010
-#+LINK:                  http://www.opencfd.co.uk
-#+OPTIONS: author:nil ^:{}
-
-* Copyright
-  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.  See the file COPYING in this directory, for a description of the
-  GNU General Public License terms under which you can copy the files.
-
-* System requirements
-  OpenFOAM is developed and tested on Linux, but should work with other POSIX
-  systems.  To check your system setup, execute the foamSystemCheck script in
-  the bin/ directory of the OpenFOAM installation. If no problems are reported,
-  proceed to "3. Installation"; otherwise contact your system administrator.
-
-  If the user wishes to run OpenFOAM in 32/64-bit mode they should consult the
-  section "Running OpenFOAM in 32-bit mode".
-
-*** Qt (from http://trolltech.com/products/qt)
-    The ParaView 3.7.0 visualisation package requires Qt to be installed on the
-    system.  ParaView's producers state that ParaView is only officially
-    supported on Qt version 4.6.x.  However, we have found in limited tests that
-    ParaView works satisfactorily with Qt than 4.5.x.  To
-    check whether Qt4 is installed, and the version, type:
-    + qmake --version
-
-    Both 32-bit and 64-bit version of ParaView were compiled with Qt-4.4.3 (with
-    openSUSE-11.1).  If the user finds that a ParaView binary fails to run, then
-    it is almost certainly due to a conflict in compiled and installed Qt
-    versions and they will need to consult the section below on "Compiling
-    ParaView and the PV3FoamReader module."
-
-    The default versions of Qt used by some GNU/Linux releases are as follows.
-    + ubuntu-7.10:   Version 4.3.2
-    + ubuntu-8.04:   Version 4.3.4
-    + ubuntu-9.04:   Version 4.5.0
-    + openSUSE-10.2: Version 4.2.1 - too old
-    + openSUSE-10.3: Version 4.3.1
-    + openSUSE-11.0: Version 4.4.0
-    + openSUSE-11.1: Version 4.4.3
-    + openSUSE-11.2: Version 4.5.3
-
-    Compilation and running of ParaView has been successful using the libraries
-    downloaded in the "libqt4-dev" package on ubuntu.
-
-    If you don't have an appropriate version of Qt installed you can download
-    the sources e.g.:
-    http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.2.tar.gz
-    and compile and install in /usr/local or some other location that does not
-    conflict with the pre-installed version.
-
-* Installation
-  Download and unpack the files in the $HOME/OpenFOAM directory as described in:
-  http://www.OpenFOAM.org/download.html
-
-  The environment variable settings are contained in files in an etc/ directory
-  in the OpenFOAM release. e.g. in
-
-  + $HOME/OpenFOAM/OpenFOAM-1.6/etc/
-
-  1) EITHER, if running bash or ksh (if in doubt type 'echo $SHELL'), source the
-    etc/bashrc file by adding the following line to the end of your
-    $HOME/.bashrc file:
-
-    + . $HOME/OpenFOAM/OpenFOAM-1.6/etc/bashrc
-
-    Then update the environment variables by sourcing the $HOME/.bashrc file by
-    typing in the terminal:
-
-    + . $HOME/.bashrc
-
-  2) OR, if running tcsh or csh, source the etc/cshrc file by adding the
-    following line to the end of your $HOME/.cshrc file:
-
-    + source $HOME/OpenFOAM/OpenFOAM-1.6/etc/cshrc
-
-    Then update the environment variables by sourcing the $HOME/.cshrc file by
-    typing in the terminal:
-
-    + source $HOME/.cshrc
-
-*** Installation in alternative locations
-    OpenFOAM may also be installed in alternative locations. However, the
-    installation directory should be network available (e.g., NFS) if parallel
-    calculations are planned.
-
-    The environment variable 'FOAM_INST_DIR' can be used to find and source the
-    appropriate resource file. Here is a bash/ksh/sh example:
-
-    + export FOAM_INST_DIR=/data/app/OpenFOAM
-    + foamDotFile=$FOAM_INST_DIR/OpenFOAM-1.6/etc/bashrc
-    + [ -f $foamDotFile ] && . $foamDotFile
-
-    and a csh/tcsh example:
-
-    + setenv FOAM_INST_DIR /data/app/OpenFOAM
-    + foamDotFile=$FOAM_INST_DIR/OpenFOAM-1.6/etc/cshrc
-    + if ( -f $foamDotFile ) source $foamDotFile
-
-    The value set in '$FOAM_INST_DIR' will be used to locate the remaining parts
-    of the OpenFOAM installation.
-
-* Building from Sources (Optional)
-  If you cannot find an appropriate binary pack for your platform, you can build
-  the complete OpenFOAM from the source-pack.  You will first need to compile or
-  obtain a recent version of gcc (we recommend gcc-4.4.?) for your platform,
-  which may be obtained from http://gcc.gnu.org/.
-
-  Install the compiler in
-  $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gcc-<GCC_VERSION>
-  and change the gcc version number in $WM_PROJECT_DIR/etc/settings.sh and
-  $WM_PROJECT_DIR/etc/settings.csh appropriately and finally update the
-  environment variables as in section 3.
-
-  Now go to the top-level source directory $WM_PROJECT_DIR and execute the
-  top-level build script './Allwmake'.  In principle this will build everything,
-  but if problems occur with the build order it may be necessary to update the
-  environment variables and re-execute './Allwmake'.
-
-  If you experience difficulties with building the source-pack, or your platform
-  is not currently supported, please contact <enquiries@OpenCFD.co.uk> to
-  negotiate a support contract and we will do the port and maintain it for
-  future releases.
-
-* Testing the installation
-  To check your installation setup, execute the 'foamInstallationTest' script
-  (in the bin/ directory of the OpenFOAM installation). If no problems are
-  reported, proceed to getting started with OpenFOAM; otherwise, go back and
-  check you have installed the software correctly and/or contact your system
-  administrator.
-
-* Getting Started
-  Create a project directory within the $HOME/OpenFOAM directory named
-  <USER>-1.6 (e.g. 'chris-1.6' for user chris and OpenFOAM version 1.6)
-  and create a directory named 'run' within it, e.g. by typing:
-
-  + mkdir -p $FOAM_RUN/run
-
-  Copy the 'tutorial' examples directory in the OpenFOAM distribution to the
-  'run' directory.  If the OpenFOAM environment variables are set correctly,
-  then the following command will be correct:
-
-  + cp -r $WM_PROJECT_DIR/tutorials $FOAM_RUN
-
-  Run the first example case of incompressible laminar flow in a cavity:
-
-  + cd $FOAM_RUN/tutorials/incompressible/icoFoam/cavity
-  + blockMesh
-  + icoFoam
-  + paraFoam
-
-  Refer to the OpenFOAM User Guide at http://www.OpenFOAM.org/doc/user.html for
-  more information.
-
-* Compiling Paraview 3.7.0 and the PV3FoamReader module
-  If there are problems encountered with ParaView, then it may be necessary to
-  compile ParaView from sources.  The compilation
-  is a fairly simple process using the makeParaView script
-  (found in ThirdParty directory), which has worked in our tests with other
-  packages supplied in the ThirdParty directory, namely cmake-2.8.0 and
-  gcc-4.4.3.  Execute the following:
-  + cd $WM_THIRD_PARTY_DIR
-  + rm -rf paraview-3.7.0/platforms
-  + rm -rf platforms/*/paraview-3.7.0
-  + ./makeParaView
-
-  The PV3blockMeshReader and the PV3FoamReader ParaView plugins are compiled
-  as usual for OpenFOAM utilities:
-  + cd $FOAM_UTILITIES/postProcessing/graphics/PV3Readers/
-  + ./Allwclean
-  + ./Allwmake
-
-*** Compiling Paraview with a local version of Qt
-    If the user still encounters problems with ParaView, it may relate to the
-    version of Qt, in which case, it is recommended that the user first
-    downloads a supported version of Qt /e.g./ 4.5.3 as described in the section
-    on "Qt".  The user should unpack the source pack in the $WM_THIRD_PARTY_DIR.
-    Then the user can build Qt by executing from within $WM_THIRD_PARTY_DIR:
-    + ./makeQt
-
-    The user should then compile ParaView using the local version of Qt by
-    executing makeParaView with the -qmake option, giving the full path of the
-    newly built qmake as an argument:
-    + ./makeParaView -qmake <path_to_qmake>
-
-    The user must then recompile the PV3blockMeshReader and the
-    PV3FoamReader plugins as usual (see above).
-
-* Documentation
-  http://www.OpenFOAM.org/doc
-
-* Help
-  http://www.OpenFOAM.org http://www.OpenFOAM.org/discussion.html
-
-* Reporting Bugs in OpenFOAM
-  http://www.OpenFOAM.org/bugs.html
-
-* Running OpenFOAM in 32-bit mode on 64-bit machines
-  Linux users with a 64-bit machine may install either the OpenFOAM 32-bit
-  version (linux) or the OpenFOAM 64-bit version (linux64), or both.  The 64-bit
-  is the default mode on a 64-bit machine.  To use an installed 32-bit version,
-  the user must set the environment variable WM_ARCH_OPTION to 32 before
-  sourcing the etc/bashrc (or etc/cshrc) file.
diff --git a/ReleaseNotes-1.6 b/ReleaseNotes-1.6
deleted file mode 100644
index 545021a6b3ccc7b4c960a2c482e173e21f0c7c23..0000000000000000000000000000000000000000
--- a/ReleaseNotes-1.6
+++ /dev/null
@@ -1,374 +0,0 @@
-#                            -*- mode: org; -*-
-#
-#+TITLE:           OpenFOAM release notes for version 1.6
-#+AUTHOR:                      OpenCFD Ltd.
-#+DATE:                         July 2009
-#+LINK:                  http://www.opencfd.co.uk
-#+OPTIONS: author:nil ^:{}
-
-* Overview
-  OpenFOAM-1.6 is a significant upgrade to version 1.5 in ways that are
-  outlined below.  This release passes all our standard tests and the
-  tutorials have been broadly checked.  If there are any bugs, please report
-  them using the instructions set out here:
-  http://www.OpenFOAM.org/bugs.html.
-
-* GNU/Linux version
-  The 32bit and 64bit binary packs of the OpenFOAM release were compiled on
-  a machine running openSUSE GNU/Linux version 11.1 and also tested on
-  Ubuntu 9.  We recommend that users run OpenFOAM on one of these, or on a
-  similarly recent version of GNU/Linux.  This release has also been
-  successfully compiled and tested on older GNU/Linux releases, but this
-  requires the installation of Qt 4.3.? (the sources for which are supplied
-  with OpenFOAM-1.6, see README) for ParaView-3 to run.
-
-* C++ Compiler version
-  + Release compiled with GCC 4.3.3.
-  + Built-in support for the Intel C++ 10.? compiler (untested).
-  + The choice of the compiler is controlled by the setting of the
-    ~$WM_COMPILER~ and ~$WM_COMPILER_ARCH~ environment variables in the
-    /OpenFOAM-1.6/etc/bashrc/ (or /cshrc/) file.
-  + The location of the compiler installation is controlled by the
-    ~$compilerInstall~ environment variable in the
-    /OpenFOAM-1.6/etc/settings.sh/ (or /settings.csh/) file.
-
-* Library developments
-
-*** Core library
-
-***** Dictionary improvements/changes
-      + Dictionaries can use words (unquoted) or regular expressions (quoted)
-        for their keywords. When searching, an exact match has priority over a
-        regular expression match.  Multiple regular expressions are matched in
-        reverse order.
-      + The *new* =#includeIfPresent= directive is similar to the =#include=
-        directive, but does not generate an error if the file does not exist.
-      + The default =#inputMode= is now '=merge=', which corresponds to the most
-        general usage. The =#inputMode warn= corresponds to the previous default
-        behaviour.
-      + The *new* =#inputMode protect= can be used to conditionally merge
-        default values into existing dictionaries.
-      + *New* =digest()= method to calculate and return the SHA1 message digest.
-
-***** Regular Expressions
-      The addition of regular expressions marks a major improvement in
-      usability.
-      + *New* =regExp= class provides support for accessing POSIX extended
-        regular expresssions from within OpenFOAM.
-      + *New* =wordRe= class can contain a =word= or a =regExp= .
-      + *New* =stringListOps= to search string lists based on regular
-        expressions, =wordRe= or =wordReList=.
-      + =Istream= and =Ostream= now retain backslashes when reading/writing
-        strings.
-
-***** Convenience changes
-      + =IOobject= has a *new* constructor for creating an =IOobject= from a
-        single-path specification (eg, see =blockMesh -dict= option).
-      + =argList= has *new* convenience methods for accessing options more
-        directly: =option()=, =optionFound()=, =optionLookup()=, =optionRead()=,
-        =optionReadIfPresent()=.
-      + The *new* =readList(Istream&)= can read a bracket-delimited list or
-        handle a single value as a list of size 1. This can be a useful
-        convenience when processing command-line options.
-      + Export *new* environment variable =FOAM_CASENAME= that contains the
-        name part of the =FOAM_CASE= environment variable.
-
-*** Turbulence modelling
-    + Major development of turbulence model libraries to give extra flexibility
-      at the solver level.  For solvers that can support either RAS/LES
-      computations, the selection is made in the
-      /constant/turbulenceProperties/, by setting the =simulationType= keyword
-      to:
-      - =laminar=,
-      - =RASModel=,
-      - =LESModel=.
-    + Depending on the selection, the model is the instantiated from /constant//
-      - /RASProperties/,
-      - /LESProperties/.
-
-***** RAS wall functions
-      Wall functions are now run-time selectable per patch for RAS.
-      + Velocity:
-        - Apply to turbulent viscosities =nut= or =mut=,
-        - Apply to =k=, =Q=, =R=,
-        - Apply to =epsilon=, =omega=.
-      + Temperature:
-        - Apply to turbulent thermal diffusivity, =alphat= (compressible only).
-      + To apply wall functions:
-        - To recapture the functionality of previous OpenFOAM versions (v1.5 and
-          earlier) assign:
-          - for velocity:
-            - =nut=: =nutWallFunction=,
-            - =mut=: =muWallFunction=,
-            - =epsilon=: =epsilonWallFunction=,
-            - =omega=: =omegaWallFunction=,
-            - =k=, =q=, =R=: =kqRWallFunction=.
-          - for temperature:
-            - =alphat=: =alphatWallFunction=.
-        - New =alphaSgsJayatillekeWallFunction= thermal wall function for
-          compressible LES.
-
-***** *New* LES turbulence models
-      + Spalart-Allmaras DDES.
-      + Spalart-Allmaras IDDES.
-
-***** Upgrading:
-      + *New* utility - =applyWallFunctionBoundaryConditions=.
-      + Solvers will automatically update existing cases.
-        - New fields created based on the presence of the =nut/mut= field.
-        - Boundary conditions include scoping, i.e compressibility:: for
-          compressible solvers.
-        - Modified fields will be backed-up to /<field>.old/.
-      + NOTE:
-        - Fields are only updated for those fields associated with the current
-          turbulence model selection, i.e. if fields exist for use with other
-          models, they will not be updated.
-        - The new specification is not backwards compatible.
-
-*** Thermo-physical Models
-    + Old compressibility-based thermo package renamed
-      =basicThermo= \rightarrow =basicPsiThermo=.
-    + *New* =basicRhoThermo= thermo package.
-      - Additional density field stored.
-      - General form - can be used for other types of media, e.g. liquids.
-      - Additional polynomial-based thermodynamics:
-        - Equation of state: =icoPolynomial=,
-        - Transport: =polynomialTransport=,
-        - Thermo: =hPolynomialThermo=.
-    + Removed earlier hard-coding of gas thermophysics for chemistry modelling:
-      - =reactingMixture= now templated on thermo package,
-      - =chemistryModel= now templated on thermo package,
-      - =chemistrySolver= now templated on thermo package.
-    + *New* =fvDOM= radition model
-      - finite volume, discrete ordinates method.
-    + *New* (reinstated) =eThermo= thermodynamics package
-      - internal energy-based thermodynamics.
-
-*** Lagrangian
-
-***** Intermediate
-      + Overhaul of the underlying framework.
-      + Reacting now split into reacting and reacting multiphase.
-      + New structure for variable composition.
-      + Many new sub-models, including:
-        - Injection
-          - =PatchInjection= - injection local to patch face cells,
-          - =FieldActivatedInjection= - injection based on satisfying external
-            criterion,
-          - LookupTableInjection - explicity define injection locations and all
-            parcel properties.
-        - Post-processing
-          - patch post-processing - collect data for parcels impacting user,
-            defined patches.
-        - Patch interaction
-          - generalised behaviour for parcel interaction with patch.
-        - Phase change
-          - liquid evaporation.
-
-***** Coal combustion
-      + *New* library - extension of reacting-multiphase functionality.
-        - Surface reaction/combustion models.
-
-*** Discrete methods
-    + *New* library offering DSMC simulation functionality - see =dsmcFoam=
-      below.
-    + Significant development of the libraries offering molecular dynamics
-      simulation functionality - see =mdFoam= and =mdEquilibrationFoam= below.
-
-*** Numerics
-    + *new* polynomial-fit higher-order interpolation schemes:
-      - =biLinearFit=
-      - =linearFit=
-      - =quadraticLinearFit=
-      - =quadraticFit=
-      - =linearPureUpwindFit=
-      - =quadraticLinearPureUpwindFit=
-      - =quadraticLinearUpwindFit=
-      - =quadraticUpwindFit=
-      - =cubicUpwindFit=
-    + *new* polynomial-fit higher-order Sn-Grad: =quadraticFitSnGrad=.
-
-*** *New* surfMesh library
-    Provides a more efficient storage mechanism than possible with =triSurface=
-    without restrictions on the shape of the face (templated parameter).
-    + =MeshedSurface= class - with zero or more contiguous =surfZones= .
-    + =UnsortedMeshedSurface= class - unordered surface zones (as per
-      =triSurface=).
-    + =surfMesh= class - for reading/writing in native OpenFOAM format.
-
-* Solvers
-*** Solver restructuring
-    The upgrade to the turbulence models means that the simulation type, i.e.
-    laminar, RAS or LES can be selected at run time. This has allowed a reduction
-    in the number of solvers, simplifying the overall code structure
-    + Solvers which support laminar, RAS and LES:
-      - =turbFoam=, =oodles= \rightarrow =pisoFoam=.
-      - =turbDyMFoam= \rightarrow =pimpleDyMFoam=.
-      - =rhoTurbFoam=, =coodles= \rightarrow =rhoPisoFoam=.
-      - =xoodles= \rightarrow absorbed into =XiFoam=.
-      - =buoyantFoam=, =lesBuoyantFoam= \rightarrow =buoyantPisoFoam=.
-      - =interFoam=, =rasInterFoam=, =lesInterFoam= \rightarrow =interFoam=.
-      - =lesCavitatingFoam=, =rasCavitatingFoam= \rightarrow =cavitatingFoam=.
-    + Solvers which support LES only:
-      - =channelOodles= \rightarrow =channelFoam= (LES).
-    + =pd= replaced by static pressure =p=.  All solvers in which buoyancy affects
-      might be strong have been converted from using =pd= to =p= with improved
-      numerics to give equally good accuracy and stability.  This change is
-      prompted by the need to remove the confusion surrounding the meaning and
-      purpose of =pd=.
-    + =g= (acceleration due to gravity) is now a *new*
-      =uniformDimensionedVectorField= which has the behaviour of a field, is
-      registered to an =objectRegistry=, but stores only a single value.  Thus
-      =g= and other =UniformDimensionedFields= can be created and looked-up
-      elsewhere in the code, /e.g./ in =fvPatchFields=.
-
-*** Solver control improvements
-    Now uses consistent dictionary entries for the solver controls.
-    + This Allows dictionary substitutions and regular expressions in
-      /system/fvSolution/.
-    + The old solver control syntax is still supported (warning emitted), but
-      the *new* =foamUpgradeFvSolution= utility can be used to convert
-      /system/fvSolution/ to the new format.
-
-*** *New* Solvers
-    + =buoyantBoussinesqSimpleFoam= Steady state heat transfer solver using a
-      Boussinesq approximation for buoyancy, with laminar, RAS or LES turbulence
-      modelling.
-    + =buoyantBoussinesqPisoFoam= Transient heat transfer solver using a
-      Boussinesq approximation for buoyancy, with laminar, RAS or LES turbulence
-      modelling.
-    + =coalChemistryFoam= Transient, reacting lagrangian solver, employing a coal
-      cloud and a thermo cloud, with chemistry, and laminar, RAS or LES turbulence
-      modelling.
-    + =porousExplicitSourceReactingParcelFoam= Transient, reacting lagrangian
-      solver, employing a single phase reacting cloud, with porous media, explicit
-      mass sources, and laminar, RAS or LES turbulence modelling.
-    + =rhoReactingFoam= Density-based thermodynamics variant of the reactingFoam
-      solver, i.e. now applicable to liquid systems.
-    + =dsmcFoam= DSMC (Direct Simulation Monte-Carlo) solver for rarefied gas
-      dynamics simulations, able to simulate mixtures of an arbitrary number of
-      gas species.  The variable hard sphere collision model with Larsen-Borgnakke
-      internal energy redistribution (see "Molecular Gas Dynamics and the Direct
-      Simulation of Gas Flows" G.A. Bird, 1994) is available; other run-time
-      selectable collision models can be easily added.
-
-*** Updated solvers
-    + =mdFoam= Molecular Dynamics (MD) solver able to simulate a mixture of an
-      arbitrary number of mono-atomic and small, rigid polyatomic (i.e. H2O, N2)
-      molecular species, with 6 degree of freedom motion, in complex geometries. A
-      molecule of any species can be built by specifying its sites of mass and
-      charge. All molecules interact with short-range dispersion forces and
-      pairwise electrostatic interactions using methods described in: Fennell and
-      Gezelter, J. Chem. Phys. 124, 234104 (2006).
-    + =mdEquilibrationFoam= Similar to mdFoam, but employs velocity scaling to
-      adjust the simulation temperature to a target value. Useful to equilibrate a
-      case before simulation.
-    + =chtMultiRegionFoam= New boundary condition allows independent decomposition
-      of coupled regions without any constraint on the decomposition.
-
-* Boundary conditions
-  + Improved set of direct mapped boundary conditions.
-  + =buoyantPressureFvPatchScalarField=, the *new* buoyancy pressure boundary
-    condition now supports =p= and =pd= for backward compatibility.
-  + =uniformDensityHydrostaticPressure= is an additional pressure boundary
-    condition to aid the transition from =pd= to =p= as it behaves similarly to
-    specifying a uniform =pd= at an outlet for example.
-  + =activeBaffleVelocity= dynamically combines cyclic and wall patches so that
-    the flow through the patch can be controlled /e.g./ by pressure drop.
-  + =rotatingWallVelocity= specifies a rotating velocity, given the rotational
-    speed, origin and axis.
-
-* Utilities
-
-*** Improvements
-   + =blockMesh= has a *new* =-dict= option for specifying an alternative
-     dictionary for the block mesh description. The '=convertToMeters=' entry
-     is now optional, and the alternative '=scale=' entry can be used for
-     less typing.
-   + =foamToEnsight= has a *new* =-noPatches= option to suppress generation
-     of patches.
-   + =foamToEnsightParts= has *new* =-noMesh= and =-index= options that can
-     be useful when post-processing results incrementally.
-   + =snappyHexMesh= has lower memory footprint. New distributed triangulated
-     surface type for meshing surfaces with extremely large triangle count.
-     Now supports multi-region meshing of arbitrarily complex regions.
-
-*** *New* utilities
-   + =particleTracks= - generate particle tracks for lagrangian calculations.
-   + =dsmcInitialise= - preprocessing utility to create initial configurations
-     of DSMC particles in a geometry.
-   + =surfaceRedistributePar= - preprocessing utility to create distributed
-     triangulated surface.
-
-*** *New* foamCalc functions
-    + =interpolate= performs fvc::interpolate(<field>).
-    + =randomise= randomises a <field> by a given perturbation.
-    + =addSubtract= provides simple add/subtract field functionality.
-
-*** Usage
-   + =timeSelector= can now combine =-time ranges= and =-latestTime= options.
-     For example, -time '0.01:0.09' -latestTime vs. -time '0.01:'.
-     More reliable behaviour for cases missing /constant// or /0// directories.
-     When the =-noZero= option is enabled, =-latestTime= will not select the
-     =0/= directory unless the =-zeroTime= option is given.
-     This helps avoid ill effects caused by accidentally using the
-     /0// directory in certain utilities (eg, =reconstructPar=).
-   + =-region= option added to more utilities.
-
-*** Improvements to Paraview reader module
-   + =PV3FoamReader= added mesh region handling. The region name is parsed
-     from the filename. Eg, /case{region}.OpenFOAM/.
-   + =paraFoam= with a *new* =-region= option for specifying an alternative
-     region. A *new* =-touch= option to generate the /.OpenFOAM/ file only.
-     Only creates (and removes) /.OpenFOAM/ files if they didn't already
-     exist, which is useful in connection with the =-touch= option.
-
-* Post-processing
-  + Sampling on iso-surfaces, interpolated or non-interpolated.
-  + Sampling on surface defined by distance to surface (=distanceSurface=).
-  + Cutting planes for arbitrary meshes.
-  + Output to any surface geometry format supported by the =surfMesh= library.
-
-*** Function objects
-
-***** Improvements for function objects and time-looping
-      + The =functionObjectList= retains the order of the =functionObject=
-        order, which allows a chaining of operations. It is thus internally more
-        efficient when /system/controlDict/ uses =functions {..}= instead of
-        =functions (..)=, but both forms are supported.
-      + The =functionObject= now has an additional =end()= method that is called
-        when =Time::loop()= or =Time::run()= determine that the time-loop exits.
-        Accordingly, one of these two idioms should be used in solver code:
-        1. =while (runTime.loop() { ... }=,
-        2. =while (runTime.run()) { runTime++; ... }=.
-      + *New* =functionObjectList= now tracks the SHA1 message digest of the
-        sub-directories. This avoids reloading a =functionObject= when
-        something unrelated in /system/controlDict/ changed.
-
-***** *New* function objects:
-       + =systemCall= - executes a list of system instructions.
-       + =fieldMinMax= - computes the min/max of a <field>.
-       + =staticPressure= - converts kinematic pressure to static pressure.
-       + =dsmcFields= - calculates intensive fields (velocity and temperature)
-         from averaged extensive fields (i.e. momentum and energy).
-
-***** Usage
-       + Improved output control: =timeStep= or =outputTime=.
-
-* Tutorial restructuring
-  to reflect solver application structure.
-
-* Third-party Software
-  + =gcc= upgraded to version 4.3.3.
-  + =OpenMPI= upgraded to version 1.3.3.
-  + =ParaView= upgraded to version 3.6.1.
-  + =Scotch= *new* decomposition method: \\
-    Scotch (http://gforge.inria.fr/projects/scotch/) is a general multi-level
-    decomposition method originating from the ScAlApplix project (Inria). It is
-    a framework for general recursive partitioning methods and a such comparable
-    to Metis but with a permissive licence.
-
-    The corresponding decomposition method (in =decomposeParDict=) is
-    =scotch=.  An optional =strategy= string can be supplied to change the
-    decomposition methods; initial testing shows the default strategy producing
-    decompositions comparable in quality to Metis.
diff --git a/ReleaseNotes-dev b/ReleaseNotes-dev
new file mode 100644
index 0000000000000000000000000000000000000000..18a61718b0c7455d5ce9d6f4c7c150daebc61fdc
--- /dev/null
+++ b/ReleaseNotes-dev
@@ -0,0 +1,77 @@
+#                            -*- mode: org; -*-
+#
+#+TITLE:  OpenFOAM release notes for version dev
+#+AUTHOR:                      OpenCFD Ltd.
+#+DATE:                            TBA
+#+LINK:                  http://www.openfoam.com
+#+OPTIONS: author:nil ^:{}
+# Copyright (c) 2010 OpenCFD Ltd.
+
+* Overview
+  OpenFOAM-dev is the latest major release of OpenFOAM including many new
+  developments a number of bug-fixes.  This release passes our standard tests
+  and the tutorials have been broadly checked.  Please report any bugs by
+  following the link: http://www.openfoam.com/bugs.
+
+* GNU/Linux version
+  This release of OpenFOAM is distributed primarily in 2 ways: (1) as a Debian
+  pack containing binaries and source; (2) from the SourceForge source code
+  repository (see [[./README.org][README]]).
+
+  The Ubuntu/Debian pack is available for 32 and 64 bit versions of the 10.04
+  LTS operating system using the system compiler and libraries that will be
+  installed automatically from standard Debian packs.
+
+  To use the source version from the SourceForge repository, we provide a source
+  pack of third-party packages that can be compiled on the user's system.  This
+  does not include =gcc=, since the system installed version is typically
+  sufficient, but includes =paraview-3.8.0=, =openmpi-1.4.1=, =scotch_5.1=,
+  =metis-5.0pre2=, =ParMetis-3.1= and =ParMGridGen-1.0=.
+
+* Library developments
+  There have been a number of developments to the libraries to support the
+  extension of functionality in solver and utility applications.
+*** Core library
+    + Large number of code refinements and consistency improvements to support
+      other developments.
+*** Turbulence modelling
+*** Thermo-physical Models
+*** DSMC
+*** Dynamic Mesh
+*** Numerics
+
+* Solvers
+  A number of new solvers have been developed for a range of engineering
+  applications.  There has been a set of improvements to certain classes of
+  solver that are introduced in this release.
+*** *New* Solvers
+    + ...
+*** Modifications to multiphase and buoyant solvers
+    + ...
+*** Modifications to solvers for sensible enthalpy
+    + ...
+*** Modifications to steady-state compressible solvers
+    + ...
+*** Other modifications
+    + ...
+
+* Boundary conditions
+  New boundary conditions have been introduced to support new applications in
+  OpenFOAM.
+  + ...
+
+* Utilities
+  There have been some utilities added and updated in this release.
+*** *New* utilities
+    + ...
+*** Updated utilities
+    + ...
+
+* Post-processing
+  + =foamToEnsight=: new =-nodeValues= option to generate and output nodal
+    field data.
+
+* New tutorials
+  There is a large number of new tutorials to support the new solvers in the
+  release.
+  + ...
diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/TEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/TEqn.H
index a7a019a2103bbbb61a7591ae88ef2df2b9d69ad1..9a835792a4ec379bccfe2d933d34999c35b0a19a 100644
--- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/TEqn.H
+++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/TEqn.H
@@ -1,9 +1,8 @@
 {
-    volScalarField kappaEff
-    (
-        "kappaEff",
-        turbulence->nu()/Pr + turbulence->nut()/Prt
-    );
+    kappat = turbulence->nut()/Prt;
+    kappat.correctBoundaryConditions();
+
+    volScalarField kappaEff("kappaEff", turbulence->nu()/Pr + kappat);
 
     fvScalarMatrix TEqn
     (
@@ -13,7 +12,7 @@
     );
 
     TEqn.relax();
-    TEqn.solve();
+    TEqn.solve(mesh.solver(T.select(finalIter)));
 
     rhok = 1.0 - beta*(T - TRef);
 }
diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/UEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/UEqn.H
index 35387f4ff40468426b6ebc31a6fb517553759fe4..20a05e5cd448366b05f8f9de882545190c31e8a0 100644
--- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/UEqn.H
+++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/UEqn.H
@@ -18,9 +18,10 @@
             fvc::reconstruct
             (
                 (
-                    fvc::interpolate(rhok)*(g & mesh.Sf())
-                  - fvc::snGrad(p)*mesh.magSf()
-                )
-            )
+                  - ghf*fvc::snGrad(rhok)
+                  - fvc::snGrad(p_rgh)
+                )*mesh.magSf()
+            ),
+            mesh.solver(U.select(finalIter))
         );
     }
diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C
index ebf68d409c9965a3333fe337090125190ba60b83..54519906a481cc48c873364a7036aab81c60dd96 100644
--- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C
+++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C
@@ -87,7 +87,7 @@ int main(int argc, char *argv[])
 
             if (nOuterCorr != 1)
             {
-                p.storePrevIter();
+                p_rgh.storePrevIter();
             }
 
             #include "UEqn.H"
diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/createFields.H b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/createFields.H
index 704918bb0958698acbefd505b91e4bbe821c9720..342af079d8d3f2711e2ab1fb6c841ebc63e82559 100644
--- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/createFields.H
+++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/createFields.H
@@ -14,12 +14,12 @@
         mesh
     );
 
-    Info<< "Reading field p\n" << endl;
-    volScalarField p
+    Info<< "Reading field p_rgh\n" << endl;
+    volScalarField p_rgh
     (
         IOobject
         (
-            "p",
+            "p_rgh",
             runTime.timeName(),
             mesh,
             IOobject::MUST_READ,
@@ -52,17 +52,6 @@
         incompressible::RASModel::New(U, phi, laminarTransport)
     );
 
-    label pRefCell = 0;
-    scalar pRefValue = 0.0;
-    setRefCell
-    (
-        p,
-        mesh.solutionDict().subDict("PIMPLE"),
-        pRefCell,
-        pRefValue
-    );
-
-
     // Kinematic density for buoyancy force
     volScalarField rhok
     (
@@ -74,3 +63,57 @@
         ),
         1.0 - beta*(T - TRef)
     );
+
+    // kinematic turbulent thermal thermal conductivity m2/s
+    Info<< "Reading field kappat\n" << endl;
+    volScalarField kappat
+    (
+        IOobject
+        (
+            "kappat",
+            runTime.timeName(),
+            mesh,
+            IOobject::MUST_READ,
+            IOobject::AUTO_WRITE
+        ),
+        mesh
+    );
+
+    Info<< "Calculating field g.h\n" << endl;
+    volScalarField gh("gh", g & mesh.C());
+    surfaceScalarField ghf("ghf", g & mesh.Cf());
+
+    volScalarField p
+    (
+        IOobject
+        (
+            "p",
+            runTime.timeName(),
+            mesh,
+            IOobject::NO_READ,
+            IOobject::AUTO_WRITE
+        ),
+        p_rgh + rhok*gh
+    );
+
+    label pRefCell = 0;
+    scalar pRefValue = 0.0;
+    setRefCell
+    (
+        p,
+        p_rgh,
+        mesh.solutionDict().subDict("PIMPLE"),
+        pRefCell,
+        pRefValue
+    );
+
+    if (p_rgh.needReference())
+    {
+        p += dimensionedScalar
+        (
+            "p",
+            p.dimensions(),
+            pRefValue - getRefCellValue(p, pRefCell)
+        );
+    }
+
diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H
index 21be033f9bc5a209848fb1198fddfd4f8cbf9cfa..60828e18dc544a08dba7a5827577d2cf0df76ac5 100644
--- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H
+++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H
@@ -7,22 +7,23 @@
     phi = (fvc::interpolate(U) & mesh.Sf())
         + fvc::ddtPhiCorr(rUA, U, phi);
 
-    surfaceScalarField buoyancyPhi =
-        rUAf*fvc::interpolate(rhok)*(g & mesh.Sf());
-    phi += buoyancyPhi;
+    surfaceScalarField buoyancyPhi = rUAf*ghf*fvc::snGrad(rhok)*mesh.magSf();
+    phi -= buoyancyPhi;
 
     for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
     {
-        fvScalarMatrix pEqn
+        fvScalarMatrix p_rghEqn
         (
-            fvm::laplacian(rUAf, p) == fvc::div(phi)
+            fvm::laplacian(rUAf, p_rgh) == fvc::div(phi)
         );
 
-        pEqn.solve
+        p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
+
+        p_rghEqn.solve
         (
             mesh.solver
             (
-                p.select
+                p_rgh.select
                 (
                     (
                         finalIter
@@ -36,17 +37,30 @@
         if (nonOrth == nNonOrthCorr)
         {
             // Calculate the conservative fluxes
-            phi -= pEqn.flux();
+            phi -= p_rghEqn.flux();
 
             // Explicitly relax pressure for momentum corrector
-            p.relax();
+            p_rgh.relax();
 
             // Correct the momentum source with the pressure gradient flux
             // calculated from the relaxed pressure
-            U += rUA*fvc::reconstruct((buoyancyPhi - pEqn.flux())/rUAf);
+            U -= rUA*fvc::reconstruct((buoyancyPhi + p_rghEqn.flux())/rUAf);
             U.correctBoundaryConditions();
         }
     }
 
     #include "continuityErrs.H"
+
+    p = p_rgh + rhok*gh;
+
+    if (p_rgh.needReference())
+    {
+        p += dimensionedScalar
+        (
+            "p",
+            p.dimensions(),
+            pRefValue - getRefCellValue(p, pRefCell)
+        );
+        p_rgh = p - rhok*gh;
+    }
 }
diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/TEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/TEqn.H
index 2084d4dbda4f63d8f7fd82cbf9d1bcd33c17f999..180a33d9186d3f450ed4bb06c8b4e79bb69ee41f 100644
--- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/TEqn.H
+++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/TEqn.H
@@ -1,9 +1,8 @@
 {
-    volScalarField kappaEff
-    (
-        "kappaEff",
-        turbulence->nu()/Pr + turbulence->nut()/Prt
-    );
+    kappat = turbulence->nut()/Prt;
+    kappat.correctBoundaryConditions();
+
+    volScalarField kappaEff("kappaEff", turbulence->nu()/Pr + kappat);
 
     fvScalarMatrix TEqn
     (
diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/createFields.H b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/createFields.H
index b84f0735b0c17862a00164de431cf667d7026e24..477a3228331f2f98218d1f764ed8e84f1a72133f 100644
--- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/createFields.H
+++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/createFields.H
@@ -64,6 +64,21 @@
         1.0 - beta*(T - TRef)
     );
 
+    // kinematic turbulent thermal thermal conductivity m2/s
+    Info<< "Reading field kappat\n" << endl;
+    volScalarField kappat
+    (
+        IOobject
+        (
+            "kappat",
+            runTime.timeName(),
+            mesh,
+            IOobject::MUST_READ,
+            IOobject::AUTO_WRITE
+        ),
+        mesh
+    );
+
     Info<< "Calculating field g.h\n" << endl;
     volScalarField gh("gh", g & mesh.C());
     surfaceScalarField ghf("ghf", g & mesh.Cf());
@@ -81,29 +96,23 @@
         p_rgh + rhok*gh
     );
 
-    label p_rghRefCell = 0;
-    scalar p_rghRefValue = 0.0;
+    label pRefCell = 0;
+    scalar pRefValue = 0.0;
     setRefCell
     (
+        p,
         p_rgh,
         mesh.solutionDict().subDict("SIMPLE"),
-        p_rghRefCell,
-        p_rghRefValue
+        pRefCell,
+        pRefValue
     );
 
-    scalar pRefValue = 0.0;
-
     if (p_rgh.needReference())
     {
-        pRefValue = readScalar
-        (
-            mesh.solutionDict().subDict("SIMPLE").lookup("pRefValue")
-        );
-
         p += dimensionedScalar
         (
             "p",
             p.dimensions(),
-            pRefValue - getRefCellValue(p, p_rghRefCell)
+            pRefValue - getRefCellValue(p, pRefCell)
         );
     }
diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H
index 5664bb2154b13c134cd17ced9962e661f8ba8ff6..50149ed36013ce28d445149b454076b546c1ee0b 100644
--- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H
+++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H
@@ -18,17 +18,9 @@
             fvm::laplacian(rUAf, p_rgh) == fvc::div(phi)
         );
 
-        p_rghEqn.setReference(p_rghRefCell, p_rghRefValue);
+        p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
 
-        // retain the residual from the first iteration
-        if (nonOrth == 0)
-        {
-            p_rghEqn.solve();
-        }
-        else
-        {
-            p_rghEqn.solve();
-        }
+        p_rghEqn.solve();
 
         if (nonOrth == nNonOrthCorr)
         {
@@ -55,7 +47,8 @@
         (
             "p",
             p.dimensions(),
-            pRefValue - getRefCellValue(p, p_rghRefCell)
+            pRefValue - getRefCellValue(p, pRefCell)
         );
+        p_rgh = p - rhok*gh;
     }
 }
diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/UEqn.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/UEqn.H
index d4878d063dab6ee8ed4243c61d529832d3dd9c6a..8c6a3f7671aafa72e1bd3dc53cf8644d1345a642 100644
--- a/applications/solvers/heatTransfer/buoyantPimpleFoam/UEqn.H
+++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/UEqn.H
@@ -17,8 +17,11 @@
          ==
             fvc::reconstruct
             (
-                fvc::interpolate(rho)*(g & mesh.Sf())
-              - fvc::snGrad(p)*mesh.magSf()
-            )
+                (
+                  - ghf*fvc::snGrad(rho)
+                  - fvc::snGrad(p_rgh)
+                )*mesh.magSf()
+            ),
+            mesh.solver(U.select(finalIter))
         );
     }
diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C b/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C
index 0075c1e3edb5736b8ba0252f94b6149b4b8192d3..cb4c4d34f68fc5e40759e5142d6ecffc9eb86e3e 100644
--- a/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C
+++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C
@@ -80,7 +80,7 @@ int main(int argc, char *argv[])
 
             if (nOuterCorr != 1)
             {
-                p.storePrevIter();
+                p_rgh.storePrevIter();
             }
 
             #include "UEqn.H"
diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/createFields.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/createFields.H
index b8ac5595e47cec77aa257c54a1710f91b08f20f7..e39d0bb80333b1cb16731cb0d63356c100aaf093 100644
--- a/applications/solvers/heatTransfer/buoyantPimpleFoam/createFields.H
+++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/createFields.H
@@ -53,15 +53,30 @@
         )
     );
 
+    Info<< "Calculating field g.h\n" << endl;
+    volScalarField gh("gh", g & mesh.C());
+    surfaceScalarField ghf("ghf", g & mesh.Cf());
+
+    Info<< "Reading field p_rgh\n" << endl;
+    volScalarField p_rgh
+    (
+        IOobject
+        (
+            "p_rgh",
+            runTime.timeName(),
+            mesh,
+            IOobject::MUST_READ,
+            IOobject::AUTO_WRITE
+        ),
+        mesh
+    );
+
+    // Force p_rgh to be consistent with p
+    p_rgh = p - rho*gh;
+
     Info<< "Creating field DpDt\n" << endl;
     volScalarField DpDt
     (
         "DpDt",
         fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p)
     );
-
-    thermo.correct();
-
-    dimensionedScalar initialMass = fvc::domainIntegrate(rho);
-
-    dimensionedScalar totalVolume = sum(mesh.V());
diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/hEqn.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/hEqn.H
index 3125cc3ffa86ce120e7dbbf774c9b46941105418..94537508b3725cc562118f196e2cca0de6664651 100644
--- a/applications/solvers/heatTransfer/buoyantPimpleFoam/hEqn.H
+++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/hEqn.H
@@ -9,7 +9,7 @@
     );
 
     hEqn.relax();
-    hEqn.solve();
+    hEqn.solve(mesh.solver(h.select(finalIter)));
 
     thermo.correct();
 }
diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H
index a1c3dbfed59fb52e459c460e2c439290499f5300..e625f122a3b86d8fd2b076bb3a066b98c531d0fa 100644
--- a/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H
+++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H
@@ -1,11 +1,9 @@
 {
-    bool closedVolume = p.needReference();
-
     rho = thermo.rho();
 
     // Thermodynamic density needs to be updated by psi*d(p) after the
     // pressure solution - done in 2 parts. Part 1:
-    thermo.rho() -= psi*p;
+    thermo.rho() -= psi*p_rgh;
 
     volScalarField rUA = 1.0/UEqn.A();
     surfaceScalarField rhorUAf("(rho*(1|A(U)))", fvc::interpolate(rho*rUA));
@@ -18,24 +16,23 @@
       + fvc::ddtPhiCorr(rUA, rho, U, phi)
     );
 
-    surfaceScalarField buoyancyPhi =
-        rhorUAf*fvc::interpolate(rho)*(g & mesh.Sf());
+    surfaceScalarField buoyancyPhi = -rhorUAf*ghf*fvc::snGrad(rho)*mesh.magSf();
     phi += buoyancyPhi;
 
     for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
     {
-        fvScalarMatrix pEqn
+        fvScalarMatrix p_rghEqn
         (
-            fvc::ddt(rho) + psi*correction(fvm::ddt(p))
+            fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh))
           + fvc::div(phi)
-          - fvm::laplacian(rhorUAf, p)
+          - fvm::laplacian(rhorUAf, p_rgh)
         );
 
-        pEqn.solve
+        p_rghEqn.solve
         (
             mesh.solver
             (
-                p.select
+                p_rgh.select
                 (
                     (
                         finalIter
@@ -49,34 +46,25 @@
         if (nonOrth == nNonOrthCorr)
         {
             // Calculate the conservative fluxes
-            phi += pEqn.flux();
+            phi += p_rghEqn.flux();
 
             // Explicitly relax pressure for momentum corrector
-            p.relax();
+            p_rgh.relax();
 
             // Correct the momentum source with the pressure gradient flux
             // calculated from the relaxed pressure
-            U += rUA*fvc::reconstruct((buoyancyPhi + pEqn.flux())/rhorUAf);
+            U += rUA*fvc::reconstruct((buoyancyPhi + p_rghEqn.flux())/rhorUAf);
             U.correctBoundaryConditions();
         }
     }
 
+    p = p_rgh + rho*gh;
+
     // Second part of thermodynamic density update
-    thermo.rho() += psi*p;
+    thermo.rho() += psi*p_rgh;
 
     DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
 
     #include "rhoEqn.H"
     #include "compressibleContinuityErrs.H"
-
-    // For closed-volume cases adjust the pressure and density levels
-    // to obey overall mass continuity
-    if (closedVolume)
-    {
-        p +=
-            (initialMass - fvc::domainIntegrate(psi*p))
-            /fvc::domainIntegrate(psi);
-        thermo.rho() = psi*p;
-        rho += (initialMass - fvc::domainIntegrate(rho))/totalVolume;
-    }
 }
diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C
index 06fa5d12a02e9e932ac71b099a956a085c420897..64cc110cecee14e2cde99619620b568e08cd5405 100644
--- a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C
+++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C
@@ -62,10 +62,7 @@ int main(int argc, char *argv[])
         {
             #include "UEqn.H"
             #include "hEqn.H"
-            for (int i=0; i<3; i++)
-            {
             #include "pEqn.H"
-            }
         }
 
         turbulence->correct();
diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H
index cf231503323ee8eb7661bfb42e36bb08c5b7d830..d6fa9acee96ce088fe9c4b08bba8ee8b2f7de786 100644
--- a/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H
+++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H
@@ -23,20 +23,6 @@
     volScalarField& h = thermo.h();
     const volScalarField& psi = thermo.psi();
 
-    Info<< "Reading field p_rgh\n" << endl;
-    volScalarField p_rgh
-    (
-        IOobject
-        (
-            "p_rgh",
-            runTime.timeName(),
-            mesh,
-            IOobject::MUST_READ,
-            IOobject::AUTO_WRITE
-        ),
-        mesh
-    );
-
     Info<< "Reading field U\n" << endl;
     volVectorField U
     (
@@ -53,7 +39,6 @@
 
     #include "compressibleCreatePhi.H"
 
-
     Info<< "Creating turbulence model\n" << endl;
     autoPtr<compressible::RASModel> turbulence
     (
@@ -66,40 +51,39 @@
         )
     );
 
+
     Info<< "Calculating field g.h\n" << endl;
     volScalarField gh("gh", g & mesh.C());
     surfaceScalarField ghf("ghf", g & mesh.Cf());
 
-    p = p_rgh + rho*gh;
-    thermo.correct();
-    rho = thermo.rho();
+    Info<< "Reading field p_rgh\n" << endl;
+    volScalarField p_rgh
+    (
+        IOobject
+        (
+            "p_rgh",
+            runTime.timeName(),
+            mesh,
+            IOobject::MUST_READ,
+            IOobject::AUTO_WRITE
+        ),
+        mesh
+    );
+
+    // Force p_rgh to be consistent with p
     p_rgh = p - rho*gh;
 
-    label p_rghRefCell = 0;
-    scalar p_rghRefValue = 0.0;
+
+    label pRefCell = 0;
+    scalar pRefValue = 0.0;
     setRefCell
     (
+        p,
         p_rgh,
         mesh.solutionDict().subDict("SIMPLE"),
-        p_rghRefCell,
-        p_rghRefValue
+        pRefCell,
+        pRefValue
     );
 
-    scalar pRefValue = 0.0;
-
-    if (p_rgh.needReference())
-    {
-        pRefValue = readScalar
-        (
-            mesh.solutionDict().subDict("SIMPLE").lookup("pRefValue")
-        );
-
-        p += dimensionedScalar
-        (
-            "p",
-            p.dimensions(),
-            pRefValue - getRefCellValue(p, p_rghRefCell)
-        );
-    }
-
     dimensionedScalar initialMass = fvc::domainIntegrate(rho);
+    dimensionedScalar totalVolume = sum(mesh.V());
diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H
index 3088b42c697ce467ec0c6448654fba2445b26eef..f1a62d4770a6581921e1b9a3479d3d2dd4a6c10d 100644
--- a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H
+++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H
@@ -1,11 +1,12 @@
 {
     rho = thermo.rho();
+    rho.relax();
 
     volScalarField rUA = 1.0/UEqn().A();
     surfaceScalarField rhorUAf("(rho*(1|A(U)))", fvc::interpolate(rho*rUA));
 
     U = rUA*UEqn().H();
-    //UEqn.clear();
+    UEqn.clear();
 
     phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf());
     bool closedVolume = adjustPhi(phi, U, p_rgh);
@@ -20,7 +21,7 @@
             fvm::laplacian(rhorUAf, p_rgh) == fvc::div(phi)
         );
 
-        p_rghEqn.setReference(p_rghRefCell, p_rghRefValue);
+        p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
         p_rghEqn.solve();
 
         if (nonOrth == nNonOrthCorr)
@@ -42,13 +43,13 @@
 
     p = p_rgh + rho*gh;
 
-    // For closed-volume cases adjust the pressure and density levels
+    // For closed-volume cases adjust the pressure level
     // to obey overall mass continuity
     if (closedVolume)
     {
         p += (initialMass - fvc::domainIntegrate(psi*p))
             /fvc::domainIntegrate(psi);
-        p_rgh == p - rho*gh;
+        p_rgh = p - rho*gh;
     }
 
     rho = thermo.rho();
diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam_old/Make/files b/applications/solvers/heatTransfer/buoyantSimpleFoam_old/Make/files
new file mode 100644
index 0000000000000000000000000000000000000000..25c10cc98f75684c718201b973fbcaf989c57a97
--- /dev/null
+++ b/applications/solvers/heatTransfer/buoyantSimpleFoam_old/Make/files
@@ -0,0 +1,3 @@
+buoyantSimpleFoam.C
+
+EXE = $(FOAM_APPBIN)/buoyantSimpleFoam
diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam_old/Make/options b/applications/solvers/heatTransfer/buoyantSimpleFoam_old/Make/options
new file mode 100644
index 0000000000000000000000000000000000000000..ec604cf28cd4c9d764e745b5947a08c0b47449bf
--- /dev/null
+++ b/applications/solvers/heatTransfer/buoyantSimpleFoam_old/Make/options
@@ -0,0 +1,13 @@
+EXE_INC = \
+    -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
+    -I$(LIB_SRC)/turbulenceModels \
+    -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
+    -I$(LIB_SRC)/finiteVolume/cfdTools \
+    -I$(LIB_SRC)/finiteVolume/lnInclude
+
+EXE_LIBS = \
+    -lmeshTools \
+    -lbasicThermophysicalModels \
+    -lspecie \
+    -lcompressibleRASModels \
+    -lfiniteVolume
diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam_old/UEqn.H b/applications/solvers/heatTransfer/buoyantSimpleFoam_old/UEqn.H
new file mode 100644
index 0000000000000000000000000000000000000000..e51dfcdfcbd4dced772545407931b76412a48e78
--- /dev/null
+++ b/applications/solvers/heatTransfer/buoyantSimpleFoam_old/UEqn.H
@@ -0,0 +1,24 @@
+    // Solve the Momentum equation
+
+    tmp<fvVectorMatrix> UEqn
+    (
+        fvm::div(phi, U)
+      + turbulence->divDevRhoReff(U)
+    );
+
+    UEqn().relax();
+
+    solve
+    (
+        UEqn()
+     ==
+        rho*g
+      - fvc::grad(p)
+        /*
+        fvc::reconstruct
+        (
+            fvc::interpolate(rho)*(g & mesh.Sf())
+          - fvc::snGrad(p)*mesh.magSf()
+        )
+        */
+    );
diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam_old/buoyantSimpleFoam.C b/applications/solvers/heatTransfer/buoyantSimpleFoam_old/buoyantSimpleFoam.C
new file mode 100644
index 0000000000000000000000000000000000000000..24878e339c53deecf402b0d5f4236afd085238f0
--- /dev/null
+++ b/applications/solvers/heatTransfer/buoyantSimpleFoam_old/buoyantSimpleFoam.C
@@ -0,0 +1,83 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software: you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 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/>.
+
+Application
+    buoyantSimpleFoam
+
+Description
+    Steady-state solver for buoyant, turbulent flow of compressible fluids
+
+\*---------------------------------------------------------------------------*/
+
+#include "fvCFD.H"
+#include "basicPsiThermo.H"
+#include "RASModel.H"
+#include "fixedGradientFvPatchFields.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+int main(int argc, char *argv[])
+{
+    #include "setRootCase.H"
+    #include "createTime.H"
+    #include "createMesh.H"
+    #include "readGravitationalAcceleration.H"
+    #include "createFields.H"
+    #include "initContinuityErrs.H"
+
+    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+    Info<< "\nStarting time loop\n" << endl;
+
+    while (runTime.loop())
+    {
+        Info<< "Time = " << runTime.timeName() << nl << endl;
+
+        #include "readSIMPLEControls.H"
+
+        p.storePrevIter();
+        rho.storePrevIter();
+
+        // Pressure-velocity SIMPLE corrector
+        {
+            #include "UEqn.H"
+            #include "hEqn.H"
+            #include "pEqn.H"
+        }
+
+        turbulence->correct();
+
+        runTime.write();
+
+        Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
+            << "  ClockTime = " << runTime.elapsedClockTime() << " s"
+            << nl << endl;
+    }
+
+    Info<< "End\n" << endl;
+
+    return 0;
+}
+
+
+// ************************************************************************* //
diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam_old/createFields.H b/applications/solvers/heatTransfer/buoyantSimpleFoam_old/createFields.H
new file mode 100644
index 0000000000000000000000000000000000000000..b304ace1046bbb82fff0318762b17848835cce1d
--- /dev/null
+++ b/applications/solvers/heatTransfer/buoyantSimpleFoam_old/createFields.H
@@ -0,0 +1,69 @@
+    Info<< "Reading thermophysical properties\n" << endl;
+
+    autoPtr<basicPsiThermo> pThermo
+    (
+        basicPsiThermo::New(mesh)
+    );
+    basicPsiThermo& thermo = pThermo();
+
+    volScalarField rho
+    (
+        IOobject
+        (
+            "rho",
+            runTime.timeName(),
+            mesh,
+            IOobject::NO_READ,
+            IOobject::NO_WRITE
+        ),
+        thermo.rho()
+    );
+
+    volScalarField& p = thermo.p();
+    volScalarField& h = thermo.h();
+    const volScalarField& psi = thermo.psi();
+
+
+    Info<< "Reading field U\n" << endl;
+    volVectorField U
+    (
+        IOobject
+        (
+            "U",
+            runTime.timeName(),
+            mesh,
+            IOobject::MUST_READ,
+            IOobject::AUTO_WRITE
+        ),
+        mesh
+    );
+
+    #include "compressibleCreatePhi.H"
+
+
+    Info<< "Creating turbulence model\n" << endl;
+    autoPtr<compressible::RASModel> turbulence
+    (
+        compressible::RASModel::New
+        (
+            rho,
+            U,
+            phi,
+            thermo
+        )
+    );
+
+    thermo.correct();
+
+    label pRefCell = 0;
+    scalar pRefValue = 0.0;
+    setRefCell
+    (
+        p,
+        mesh.solutionDict().subDict("SIMPLE"),
+        pRefCell,
+        pRefValue
+    );
+
+
+    dimensionedScalar initialMass = fvc::domainIntegrate(rho);
diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam_old/hEqn.H b/applications/solvers/heatTransfer/buoyantSimpleFoam_old/hEqn.H
new file mode 100644
index 0000000000000000000000000000000000000000..b91a17ee7cb36244b1a7694d6ed345b3d990d1ca
--- /dev/null
+++ b/applications/solvers/heatTransfer/buoyantSimpleFoam_old/hEqn.H
@@ -0,0 +1,17 @@
+{
+    fvScalarMatrix hEqn
+    (
+        fvm::div(phi, h)
+      - fvm::Sp(fvc::div(phi), h)
+      - fvm::laplacian(turbulence->alphaEff(), h)
+     ==
+        fvc::div(phi/fvc::interpolate(rho)*fvc::interpolate(p))
+      - p*fvc::div(phi/fvc::interpolate(rho))
+    );
+
+    hEqn.relax();
+
+    hEqn.solve();
+
+    thermo.correct();
+}
diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam_old/pEqn.H b/applications/solvers/heatTransfer/buoyantSimpleFoam_old/pEqn.H
new file mode 100644
index 0000000000000000000000000000000000000000..43625e053e30bcb7fad24452af5d34c6b1e0e888
--- /dev/null
+++ b/applications/solvers/heatTransfer/buoyantSimpleFoam_old/pEqn.H
@@ -0,0 +1,57 @@
+{
+    rho = thermo.rho();
+
+    volScalarField rUA = 1.0/UEqn().A();
+    surfaceScalarField rhorUAf("(rho*(1|A(U)))", fvc::interpolate(rho*rUA));
+
+    U = rUA*UEqn().H();
+    UEqn.clear();
+
+    phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf());
+    bool closedVolume = adjustPhi(phi, U, p);
+
+    surfaceScalarField buoyancyPhi =
+        rhorUAf*fvc::interpolate(rho)*(g & mesh.Sf());
+    phi += buoyancyPhi;
+
+    for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
+    {
+        fvScalarMatrix pEqn
+        (
+            fvm::laplacian(rhorUAf, p) == fvc::div(phi)
+        );
+
+        pEqn.setReference(pRefCell, pRefValue);
+        pEqn.solve();
+
+        if (nonOrth == nNonOrthCorr)
+        {
+            // For closed-volume cases adjust the pressure and density levels
+            // to obey overall mass continuity
+            if (closedVolume)
+            {
+                p += (initialMass - fvc::domainIntegrate(psi*p))
+                    /fvc::domainIntegrate(psi);
+            }
+
+            // Calculate the conservative fluxes
+            phi -= pEqn.flux();
+
+            // Explicitly relax pressure for momentum corrector
+            p.relax();
+
+            // Correct the momentum source with the pressure gradient flux
+            // calculated from the relaxed pressure
+            U += rUA*(rho*g - fvc::grad(p));
+            //U += rUA*fvc::reconstruct((buoyancyPhi - pEqn.flux())/rhorUAf);
+            U.correctBoundaryConditions();
+        }
+    }
+
+    #include "continuityErrs.H"
+
+    rho = thermo.rho();
+    rho.relax();
+    Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value()
+        << endl;
+}
diff --git a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C
index 0dbe80c67c0d408339bead48b579580d79bb6523..6c35536333ace6a10582d022ef26fecb80b351d8 100644
--- a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C
+++ b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C
@@ -58,7 +58,7 @@ int main(int argc, char *argv[])
 
         #include "readSIMPLEControls.H"
 
-        p.storePrevIter();
+        p_rgh.storePrevIter();
         rho.storePrevIter();
 
         // Pressure-velocity SIMPLE corrector
diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/files b/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/files
index 68d70ae7187555261c2768c20fbb586f74fdf3da..c62898c31f5de1989ceb9977ea572c045cd3d6f1 100644
--- a/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/files
+++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/files
@@ -1,5 +1,3 @@
-regionProperties/regionProperties.C
-
 derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C
 
 fluid/compressibleCourantNo.C
diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options b/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options
index 7edc67dc751532c27671320cf72af0d22fad1dec..71580ca21de8e37617c4d60c7f3f70ffd923d2b5 100644
--- a/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options
+++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options
@@ -1,13 +1,12 @@
 EXE_INC = \
     -Ifluid \
     -Isolid \
-    -IregionProperties \
     -Iinclude \
     -I$(LIB_SRC)/meshTools/lnInclude \
     -I$(LIB_SRC)/finiteVolume/lnInclude \
     -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
     -I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \
-    -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel
+    -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude
 
 EXE_LIBS = \
     -lbasicThermophysicalModels \
diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C
index a81b0faaf3eb60890151e8d3a66af70de4d4bff5..36b3f1c3b0f5357b4ae28cca263b09d063c1ea18 100644
--- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C
+++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C
@@ -93,6 +93,8 @@ int main(int argc, char *argv[])
         // --- PIMPLE loop
         for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
         {
+            bool finalIter = oCorr == nOuterCorr-1;
+
             forAll(fluidRegions, i)
             {
                 Info<< "\nSolving for fluid region "
diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/UEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/UEqn.H
index d5ae07ff9be5ed6c95ec926f5a07c7d7ecde78a0..68b29fd0c2babc531af4fe730abd8a08c3ecf5ff 100644
--- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/UEqn.H
+++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/UEqn.H
@@ -13,7 +13,9 @@
      ==
         fvc::reconstruct
         (
-            fvc::interpolate(rho)*(g & mesh.Sf())
-          - fvc::snGrad(p)*mesh.magSf()
+            (
+              - ghf*fvc::snGrad(rho)
+              - fvc::snGrad(p_rgh)
+            )*mesh.magSf()
         )
     );
diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/createFluidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/createFluidFields.H
index 2d2ccf9a5eb4d443059ba97985a77b229407073e..167484a7c730e5a0cd5b74fc4eb0f4d6b4e572fb 100644
--- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/createFluidFields.H
+++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/createFluidFields.H
@@ -6,12 +6,16 @@
     PtrList<surfaceScalarField> phiFluid(fluidRegions.size());
     PtrList<uniformDimensionedVectorField> gFluid(fluidRegions.size());
     PtrList<compressible::turbulenceModel> turbulence(fluidRegions.size());
-    PtrList<volScalarField> DpDtf(fluidRegions.size());
+    PtrList<volScalarField> p_rghFluid(fluidRegions.size());
+    PtrList<volScalarField> ghFluid(fluidRegions.size());
+    PtrList<surfaceScalarField> ghfFluid(fluidRegions.size());
 
     List<scalar> initialMassFluid(fluidRegions.size());
     List<label> pRefCellFluid(fluidRegions.size(),0);
     List<scalar> pRefValueFluid(fluidRegions.size(),0.0);
 
+    PtrList<dimensionedScalar> rhoMax(fluidRegions.size());
+    PtrList<dimensionedScalar> rhoMin(fluidRegions.size());
 
     // Populate fluid field pointer lists
     forAll(fluidRegions, i)
@@ -130,15 +134,74 @@
             ).ptr()
         );
 
+        Info<< "    Adding to ghFluid\n" << endl;
+        ghFluid.set
+        (
+            i,
+            new volScalarField("gh", gFluid[i] & fluidRegions[i].C())
+        );
+
+        Info<< "    Adding to ghfFluid\n" << endl;
+        ghfFluid.set
+        (
+            i,
+            new surfaceScalarField("ghf", gFluid[i] & fluidRegions[i].Cf())
+        );
+
+        p_rghFluid.set
+        (
+            i,
+            new volScalarField
+            (
+                IOobject
+                (
+                    "p_rgh",
+                    runTime.timeName(),
+                    fluidRegions[i],
+                    IOobject::MUST_READ,
+                    IOobject::AUTO_WRITE
+                ),
+                fluidRegions[i]
+            )
+        );
+
+        // Force p_rgh to be consistent with p
+        p_rghFluid[i] = thermoFluid[i].p() - rhoFluid[i]*ghFluid[i];
+
         initialMassFluid[i] = fvc::domainIntegrate(rhoFluid[i]).value();
 
         setRefCell
         (
             thermoFluid[i].p(),
+            p_rghFluid[i],
             fluidRegions[i].solutionDict().subDict("SIMPLE"),
             pRefCellFluid[i],
             pRefValueFluid[i]
         );
+
+        rhoMax.set
+        (
+            i,
+            new dimensionedScalar
+            (
+                fluidRegions[i].solutionDict().subDict("SIMPLE").lookup
+                (
+                    "rhoMax"
+                )
+            )
+        );
+
+        rhoMin.set
+        (
+            i,
+            new dimensionedScalar
+            (
+                fluidRegions[i].solutionDict().subDict("SIMPLE").lookup
+                (
+                    "rhoMin"
+                )
+            )
+        );
     }
 
 
diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/hEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/hEqn.H
index cef0122928dae7e51242c2a77a1afe422421151e..7869046fa0213e4b92d30119fa40f2149489095b 100644
--- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/hEqn.H
+++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/hEqn.H
@@ -5,8 +5,8 @@
       - fvm::Sp(fvc::div(phi), h)
       - fvm::laplacian(turb.alphaEff(), h)
      ==
-        fvc::div(phi/fvc::interpolate(rho)*fvc::interpolate(p))
-      - p*fvc::div(phi/fvc::interpolate(rho))
+        fvc::div(phi/fvc::interpolate(rho), rho/psi, "div(U,p)")
+      - (rho/psi)*fvc::div(phi/fvc::interpolate(rho))
     );
 
     hEqn.relax();
diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/pEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/pEqn.H
index 9462dc2c39debaeb2fef992a2f42a02a1ea2fc82..317d377f1bd376021c3450cfee07f8ec085d7bb4 100644
--- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/pEqn.H
+++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/pEqn.H
@@ -1,7 +1,9 @@
 {
     // From buoyantSimpleFoam
-
     rho = thermo.rho();
+    rho = max(rho, rhoMin[i]);
+    rho = min(rho, rhoMax[i]);
+    rho.relax();
 
     volScalarField rUA = 1.0/UEqn().A();
     surfaceScalarField rhorUAf("(rho*(1|A(U)))", fvc::interpolate(rho*rUA));
@@ -10,59 +12,54 @@
     UEqn.clear();
 
     phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf());
-    bool closedVolume = adjustPhi(phi, U, p);
+    bool closedVolume = adjustPhi(phi, U, p_rgh);
 
-    surfaceScalarField buoyancyPhi =
-        rhorUAf*fvc::interpolate(rho)*(g & mesh.Sf());
-    phi += buoyancyPhi;
+    surfaceScalarField buoyancyPhi = rhorUAf*ghf*fvc::snGrad(rho)*mesh.magSf();
+    phi -= buoyancyPhi;
 
     // Solve pressure
     for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
     {
-        fvScalarMatrix pEqn
+        fvScalarMatrix p_rghEqn
         (
-            fvm::laplacian(rhorUAf, p) == fvc::div(phi)
+            fvm::laplacian(rhorUAf, p_rgh) == fvc::div(phi)
         );
 
-        pEqn.setReference(pRefCell, pRefValue);
+        p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
 
-        // retain the residual from the first iteration
-        if (nonOrth == 0)
-        {
-            pEqn.solve();
-        }
-        else
-        {
-            pEqn.solve();
-        }
+        p_rghEqn.solve();
 
         if (nonOrth == nNonOrthCorr)
         {
-            // For closed-volume cases adjust the pressure and density levels
-            // to obey overall mass continuity
-            if (closedVolume)
-            {
-                p += (initialMass - fvc::domainIntegrate(psi*p))
-                    /fvc::domainIntegrate(psi);
-            }
-
             // Calculate the conservative fluxes
-            phi -= pEqn.flux();
+            phi -= p_rghEqn.flux();
 
             // Explicitly relax pressure for momentum corrector
-            p.relax();
+            p_rgh.relax();
 
             // Correct the momentum source with the pressure gradient flux
             // calculated from the relaxed pressure
-            U += rUA*fvc::reconstruct((buoyancyPhi - pEqn.flux())/rhorUAf);
+            U -= rUA*fvc::reconstruct((buoyancyPhi + p_rghEqn.flux())/rhorUAf);
             U.correctBoundaryConditions();
         }
     }
 
+    p = p_rgh + rho*gh;
 
     #include "continuityErrs.H"
 
+    // For closed-volume cases adjust the pressure level
+    // to obey overall mass continuity
+    if (closedVolume)
+    {
+        p += (initialMass - fvc::domainIntegrate(psi*p))
+            /fvc::domainIntegrate(psi);
+        p_rgh = p - rho*gh;
+    }
+
     rho = thermo.rho();
+    rho = max(rho, rhoMin[i]);
+    rho = min(rho, rhoMax[i]);
     rho.relax();
 
     Info<< "Min/max rho:" << min(rho).value() << ' '
diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/setRegionFluidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/setRegionFluidFields.H
index 8491056ea325e7f20258da63a16e60c9ab2130e2..cac7750e972927250bbfd7f9aec2c5131cacf3de 100644
--- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/setRegionFluidFields.H
+++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/setRegionFluidFields.H
@@ -5,7 +5,6 @@
     volScalarField& K = KFluid[i];
     volVectorField& U = UFluid[i];
     surfaceScalarField& phi = phiFluid[i];
-    const dimensionedVector& g = gFluid[i];
 
     compressible::turbulenceModel& turb = turbulence[i];
 
@@ -22,3 +21,7 @@
 
     const label pRefCell = pRefCellFluid[i];
     const scalar pRefValue = pRefValueFluid[i];
+
+    volScalarField& p_rgh = p_rghFluid[i];
+    const volScalarField& gh = ghFluid[i];
+    const surfaceScalarField& ghf = ghfFluid[i];
diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/solveFluid.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/solveFluid.H
index 5198941366285201708ca870b3763390a07c5db8..2b6de83ca3dadda1628be14ca5862743135d57e5 100644
--- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/solveFluid.H
+++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/solveFluid.H
@@ -1,6 +1,6 @@
 //  Pressure-velocity SIMPLE corrector
 
-    p.storePrevIter();
+    p_rgh.storePrevIter();
     rho.storePrevIter();
     {
         #include "UEqn.H"
diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/UEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/UEqn.H
index 65467f80864609f9225e9d058b9568890c500988..119eeb4fd7d314bbd353934519093edb327e39c4 100644
--- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/UEqn.H
+++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/UEqn.H
@@ -16,8 +16,11 @@
          ==
             fvc::reconstruct
             (
-                fvc::interpolate(rho)*(g & mesh.Sf())
-              - fvc::snGrad(p)*mesh.magSf()
-            )
+                (
+                  - ghf*fvc::snGrad(rho)
+                  - fvc::snGrad(p_rgh)
+                )*mesh.magSf()
+            ),
+            mesh.solver(U.select(finalIter))
         );
     }
diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/createFluidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/createFluidFields.H
index 1826a77217e86ac89941941c2d8e452d783e94fb..b0a7f95912fa92648880d15a94dc49aacb6386e4 100644
--- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/createFluidFields.H
+++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/createFluidFields.H
@@ -6,6 +6,9 @@
     PtrList<surfaceScalarField> phiFluid(fluidRegions.size());
     PtrList<uniformDimensionedVectorField> gFluid(fluidRegions.size());
     PtrList<compressible::turbulenceModel> turbulence(fluidRegions.size());
+    PtrList<volScalarField> p_rghFluid(fluidRegions.size());
+    PtrList<volScalarField> ghFluid(fluidRegions.size());
+    PtrList<surfaceScalarField> ghfFluid(fluidRegions.size());
     PtrList<volScalarField> DpDtFluid(fluidRegions.size());
 
     List<scalar> initialMassFluid(fluidRegions.size());
@@ -129,6 +132,42 @@
             ).ptr()
         );
 
+        Info<< "    Adding to ghFluid\n" << endl;
+        ghFluid.set
+        (
+            i,
+            new volScalarField("gh", gFluid[i] & fluidRegions[i].C())
+        );
+
+        Info<< "    Adding to ghfFluid\n" << endl;
+        ghfFluid.set
+        (
+            i,
+            new surfaceScalarField("ghf", gFluid[i] & fluidRegions[i].Cf())
+        );
+
+        p_rghFluid.set
+        (
+            i,
+            new volScalarField
+            (
+                IOobject
+                (
+                    "p_rgh",
+                    runTime.timeName(),
+                    fluidRegions[i],
+                    IOobject::MUST_READ,
+                    IOobject::AUTO_WRITE
+                ),
+                fluidRegions[i]
+            )
+        );
+
+        // Force p_rgh to be consistent with p
+        p_rghFluid[i] = thermoFluid[i].p() - rhoFluid[i]*ghFluid[i];
+
+        initialMassFluid[i] = fvc::domainIntegrate(rhoFluid[i]).value();
+
         Info<< "    Adding to DpDtFluid\n" << endl;
         DpDtFluid.set
         (
@@ -147,6 +186,4 @@
                 )
             )
         );
-
-        initialMassFluid[i] = fvc::domainIntegrate(rhoFluid[i]).value();
     }
diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/hEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/hEqn.H
index e070537db2c701e27baafd6cf64ef015e3898100..16ba36f7dc71513a6204dde059fb1cfe8868062d 100644
--- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/hEqn.H
+++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/hEqn.H
@@ -7,16 +7,9 @@
      ==
         DpDt
     );
-    if (oCorr == nOuterCorr-1)
-    {
-        hEqn.relax();
-        hEqn.solve(mesh.solver("hFinal"));
-    }
-    else
-    {
-        hEqn.relax();
-        hEqn.solve();
-    }
+
+    hEqn.relax();
+    hEqn.solve(mesh.solver(h.select(finalIter)));
 
     thermo.correct();
 
diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H
index a264b68fe5eab2388d38ca1aaf75a3f416db2330..9bf3c4acc50b7f60fa54786de4d187c90d9f677a 100644
--- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H
+++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H
@@ -1,5 +1,5 @@
 {
-    bool closedVolume = p.needReference();
+    bool closedVolume = p_rgh.needReference();
 
     rho = thermo.rho();
 
@@ -17,34 +17,35 @@
         )
     );
 
-    phi = phiU + fvc::interpolate(rho)*(g & mesh.Sf())*rhorUAf;
+    phi = phiU - rhorUAf*ghf*fvc::snGrad(rho)*mesh.magSf();
 
     for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
     {
-        fvScalarMatrix pEqn
+        fvScalarMatrix p_rghEqn
         (
-            fvm::ddt(psi, p)
+            fvm::ddt(psi, p_rgh) + fvc::ddt(psi, rho)*gh
           + fvc::div(phi)
-          - fvm::laplacian(rhorUAf, p)
+          - fvm::laplacian(rhorUAf, p_rgh)
         );
 
-        if
+        p_rghEqn.solve
         (
-            oCorr == nOuterCorr-1
-         && corr == nCorr-1
-         && nonOrth == nNonOrthCorr
-        )
-        {
-            pEqn.solve(mesh.solver(p.name() + "Final"));
-        }
-        else
-        {
-            pEqn.solve(mesh.solver(p.name()));
-        }
+            mesh.solver
+            (
+                p_rgh.select
+                (
+                    (
+                        oCorr == nOuterCorr-1
+                     && corr == nCorr-1
+                     && nonOrth == nNonOrthCorr
+                    )
+                )
+            )
+        );
 
         if (nonOrth == nNonOrthCorr)
         {
-            phi += pEqn.flux();
+            phi += p_rghEqn.flux();
         }
     }
 
@@ -52,6 +53,8 @@
     U += rUA*fvc::reconstruct((phi - phiU)/rhorUAf);
     U.correctBoundaryConditions();
 
+    p = p_rgh + rho*gh;
+
     // Update pressure substantive derivative
     DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
 
@@ -65,9 +68,10 @@
     // to obey overall mass continuity
     if (closedVolume)
     {
-        p += (massIni - fvc::domainIntegrate(psi*p))
+        p += (initialMass - fvc::domainIntegrate(psi*p))
             /fvc::domainIntegrate(psi);
         rho = thermo.rho();
+        p_rgh = p - rho*gh;
     }
 
     // Update thermal conductivity
diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/readFluidMultiRegionPISOControls.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/readFluidMultiRegionPISOControls.H
deleted file mode 100644
index 1f8cdb82a334c408603fed2745d4fbc224a7bfa4..0000000000000000000000000000000000000000
--- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/readFluidMultiRegionPISOControls.H
+++ /dev/null
@@ -1,17 +0,0 @@
-    const dictionary& piso = fluidRegions[i].solutionDict().subDict("PISO");
-
-    const int nOuterCorr =
-        piso.lookupOrDefault<int>("nOuterCorrectors", 1);
-
-    const int nCorr =
-        piso.lookupOrDefault<int>("nCorrectors", 1);
-
-    const int nNonOrthCorr =
-        piso.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0);
-
-    const bool momentumPredictor =
-        piso.lookupOrDefault("momentumPredictor", true);
-
-    const bool transonic =
-        piso.lookupOrDefault("transonic", false);
-
diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/setRegionFluidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/setRegionFluidFields.H
index 50a3011484689c25f6a26cce1e454bcbd20239b2..89aaec4737e014d64eb68bca51c0240c75231ba1 100644
--- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/setRegionFluidFields.H
+++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/setRegionFluidFields.H
@@ -1,11 +1,10 @@
-    const fvMesh& mesh = fluidRegions[i];
+    fvMesh& mesh = fluidRegions[i];
 
     basicPsiThermo& thermo = thermoFluid[i];
     volScalarField& rho = rhoFluid[i];
     volScalarField& K = KFluid[i];
     volVectorField& U = UFluid[i];
     surfaceScalarField& phi = phiFluid[i];
-    const dimensionedVector& g = gFluid[i];
 
     compressible::turbulenceModel& turb = turbulence[i];
     volScalarField& DpDt = DpDtFluid[i];
@@ -14,4 +13,13 @@
     const volScalarField& psi = thermo.psi();
     volScalarField& h = thermo.h();
 
-    const dimensionedScalar massIni("massIni", dimMass, initialMassFluid[i]);
+    volScalarField& p_rgh = p_rghFluid[i];
+    const volScalarField& gh = ghFluid[i];
+    const surfaceScalarField& ghf = ghfFluid[i];
+
+    const dimensionedScalar initialMass
+    (
+        "initialMass",
+        dimMass,
+        initialMassFluid[i]
+    );
diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solveFluid.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solveFluid.H
index 86dd4344c15310f219bfb9bda406b22f2ffe7585..b36cf89d34e0821d116be4614d00d60708040da2 100644
--- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solveFluid.H
+++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solveFluid.H
@@ -1,3 +1,8 @@
+if (finalIter)
+{
+    mesh.data::add("finalIteration", true);
+}
+
 if (oCorr == 0)
 {
     #include "rhoEqn.H"
@@ -16,3 +21,8 @@ for (int corr=0; corr<nCorr; corr++)
 turb.correct();
 
 rho = thermo.rho();
+
+if (finalIter)
+{
+    mesh.data::remove("finalIteration");
+}
diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/storeOldFluidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/storeOldFluidFields.H
index f63e85458e25253209094f92995e0c3c91858fc5..94fd01a2baa30ffc9b16466ba1672f7e8a70dfd2 100644
--- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/storeOldFluidFields.H
+++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/storeOldFluidFields.H
@@ -1,2 +1,2 @@
-    p.storePrevIter();
+    p_rgh.storePrevIter();
     rho.storePrevIter();
diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/regionProperties/regionProperties.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/regionProperties/regionProperties.C
deleted file mode 100644
index 12839784d69a3a6c719d8cd2dd39c30f0d51154f..0000000000000000000000000000000000000000
--- a/applications/solvers/heatTransfer/chtMultiRegionFoam/regionProperties/regionProperties.C
+++ /dev/null
@@ -1,68 +0,0 @@
-/*---------------------------------------------------------------------------*\
-  =========                 |
-  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-   \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
-     \\/     M anipulation  |
--------------------------------------------------------------------------------
-License
-    This file is part of OpenFOAM.
-
-    OpenFOAM is free software: you can redistribute it and/or modify it
-    under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 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 "regionProperties.H"
-
-// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
-
-Foam::regionProperties::regionProperties(const Time& runTime)
-:
-    IOdictionary
-    (
-        IOobject
-        (
-            "regionProperties",
-            runTime.time().constant(),
-            runTime.db(),
-            IOobject::MUST_READ_IF_MODIFIED,
-            IOobject::NO_WRITE
-        )
-    ),
-    fluidRegionNames_(lookup("fluidRegionNames")),
-    solidRegionNames_(lookup("solidRegionNames"))
-{}
-
-
-// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
-
-Foam::regionProperties::~regionProperties()
-{}
-
-
-// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
-
-const Foam::List<Foam::word>& Foam::regionProperties::fluidRegionNames() const
-{
-    return fluidRegionNames_;
-}
-
-
-const Foam::List<Foam::word>& Foam::regionProperties::solidRegionNames() const
-{
-    return solidRegionNames_;
-}
-
-
-// ************************************************************************* //
diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H
index be13e670c326347f530dd991a4656e1dad22030f..837305659e6c088fa7048bb0e174a6da57fc418c 100644
--- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H
+++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H
@@ -8,9 +8,5 @@
             << solidRegions[i].name() << nl << endl;
 
         Info<< "    Adding to thermos\n" << endl;
-        thermos.set
-        (
-            i,
-            basicSolidThermo::New(solidRegions[i])
-        );
+        thermos.set(i, basicSolidThermo::New(solidRegions[i]));
     }
diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solveSolid.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solveSolid.H
index ce8b1d0f408d4ec033f88c37846a8c7ab80e61b0..05b26d1626d159c635fa1fd4b11d4348c1cc931c 100644
--- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solveSolid.H
+++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solveSolid.H
@@ -1,3 +1,8 @@
+if (finalIter)
+{
+    mesh.data::add("finalIteration", true);
+}
+
 {
     for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
     {
@@ -7,8 +12,13 @@
           - fvm::laplacian(K, T)
         );
         TEqn().relax();
-        TEqn().solve();
+        TEqn().solve(mesh.solver(T.select(finalIter)));
     }
 
     Info<< "Min/max T:" << min(T) << ' ' << max(T) << endl;
 }
+
+if (finalIter)
+{
+    mesh.data::remove("finalIteration");
+}
diff --git a/applications/solvers/lagrangian/coalChemistryFoam/UEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/UEqn.H
index b02a7c61e86523217ddf733841a2084e46cc2673..5851cdcf9510b6412b701c89090bf80a20297cb7 100644
--- a/applications/solvers/lagrangian/coalChemistryFoam/UEqn.H
+++ b/applications/solvers/lagrangian/coalChemistryFoam/UEqn.H
@@ -13,5 +13,5 @@
 
     if (momentumPredictor)
     {
-        solve(UEqn == -fvc::grad(p));
+        solve(UEqn == -fvc::grad(p), mesh.solver(U.select(finalIter)));
     }
diff --git a/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C b/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C
index 5f373cc2243d4542b6a804f29778182f4feb8ea1..f32be6214b2a213a0370145040b4682e15cea103 100644
--- a/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C
+++ b/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C
@@ -90,17 +90,28 @@ int main(int argc, char *argv[])
         #include "rhoEqn.H"
 
         // --- PIMPLE loop
-        for (int ocorr=1; ocorr<=nOuterCorr; ocorr++)
+        for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
         {
+            bool finalIter = oCorr == nOuterCorr - 1;
+            if (finalIter)
+            {
+                mesh.data::add("finalIteration", true);
+            }
+
             #include "UEqn.H"
             #include "YEqn.H"
             #include "hsEqn.H"
 
             // --- PISO loop
-            for (int corr=1; corr<=nCorr; corr++)
+            for (int corr=0; corr<nCorr; corr++)
             {
                 #include "pEqn.H"
             }
+
+            if (finalIter)
+            {
+                mesh.data::remove("finalIteration");
+            }
         }
 
         turbulence->correct();
diff --git a/applications/solvers/lagrangian/coalChemistryFoam/hsEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/hsEqn.H
index ced6b6400448a84182e7fba55a56bb06d18f14ab..40eb26709e14404510769f6aba0c77eeb62ef948 100644
--- a/applications/solvers/lagrangian/coalChemistryFoam/hsEqn.H
+++ b/applications/solvers/lagrangian/coalChemistryFoam/hsEqn.H
@@ -15,7 +15,7 @@
 
     hsEqn.relax();
 
-    hsEqn.solve();
+    hsEqn.solve(mesh.solver(hs.select(finalIter)));
 
     thermo.correct();
 
diff --git a/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H
index b31ad45ed4529b30d6d0dbc6c32c1b1e7f5ca6f0..d3efde0b349680e486d04e2097b64e7be9220efd 100644
--- a/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H
+++ b/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H
@@ -26,7 +26,20 @@ if (transonic)
             coalParcels.Srho()
         );
 
-        pEqn.solve();
+        pEqn.solve
+        (
+            mesh.solver
+            (
+                p.select
+                (
+                    (
+                        finalIter
+                     && corr == nCorr-1
+                     && nonOrth == nNonOrthCorr
+                    )
+                )
+            )
+        );
 
         if (nonOrth == nNonOrthCorr)
         {
@@ -54,7 +67,20 @@ else
             coalParcels.Srho()
         );
 
-        pEqn.solve();
+        pEqn.solve
+        (
+            mesh.solver
+            (
+                p.select
+                (
+                    (
+                        finalIter
+                     && corr == nCorr-1
+                     && nonOrth == nNonOrthCorr
+                    )
+                )
+            )
+        );
 
         if (nonOrth == nNonOrthCorr)
         {
diff --git a/applications/solvers/multiphase/bubbleFoam/createPhia.H b/applications/solvers/multiphase/bubbleFoam/createPhia.H
index ac0418c5dc93bb35f67f4c730356a89e480ae8d2..2b2781d753aded5e07bd4407478e4efdac612e84 100644
--- a/applications/solvers/multiphase/bubbleFoam/createPhia.H
+++ b/applications/solvers/multiphase/bubbleFoam/createPhia.H
@@ -6,24 +6,26 @@
         IOobject::NO_READ
     );
 
-
-    surfaceScalarField* phiaPtr;
+    autoPtr<surfaceScalarField> phiaPtr(NULL);
 
     if (phiaHeader.headerOk())
     {
         Info<< "Reading face flux field phia\n" << endl;
 
-        phiaPtr = new surfaceScalarField
+        phiaPtr.reset
         (
-            IOobject
+            new surfaceScalarField
             (
-                "phia",
-                runTime.timeName(),
-                mesh,
-                IOobject::MUST_READ,
-                IOobject::AUTO_WRITE
-            ),
-            mesh
+                IOobject
+                (
+                    "phia",
+                    runTime.timeName(),
+                    mesh,
+                    IOobject::MUST_READ,
+                    IOobject::AUTO_WRITE
+                ),
+                mesh
+            )
         );
     }
     else
@@ -44,19 +46,22 @@
             }
         }
 
-        phiaPtr = new surfaceScalarField
+        phiaPtr.reset
         (
-            IOobject
+            new surfaceScalarField
             (
-                "phia",
-                runTime.timeName(),
-                mesh,
-                IOobject::NO_READ,
-                IOobject::AUTO_WRITE
-            ),
-            fvc::interpolate(Ua) & mesh.Sf(),
-            phiTypes
+                IOobject
+                (
+                    "phia",
+                    runTime.timeName(),
+                    mesh,
+                    IOobject::NO_READ,
+                    IOobject::AUTO_WRITE
+                ),
+                fvc::interpolate(Ua) & mesh.Sf(),
+                phiTypes
+            )
         );
     }
 
-    surfaceScalarField& phia = *phiaPtr;
+    surfaceScalarField& phia = phiaPtr();
diff --git a/applications/solvers/multiphase/bubbleFoam/createPhib.H b/applications/solvers/multiphase/bubbleFoam/createPhib.H
index bdf4c46bcc44fc78cedc9c8a7e34d57c3b3839b1..84db6492b649bc05ed5f03642093b0487890029b 100644
--- a/applications/solvers/multiphase/bubbleFoam/createPhib.H
+++ b/applications/solvers/multiphase/bubbleFoam/createPhib.H
@@ -6,24 +6,26 @@
         IOobject::NO_READ
     );
 
-
-    surfaceScalarField* phibPtr;
+    autoPtr<surfaceScalarField> phibPtr(NULL);
 
     if (phibHeader.headerOk())
     {
         Info<< "Reading face flux field phib\n" << endl;
 
-        phibPtr = new surfaceScalarField
+        phibPtr.reset
         (
-            IOobject
+            new surfaceScalarField
             (
-                "phib",
-                runTime.timeName(),
-                mesh,
-                IOobject::MUST_READ,
-                IOobject::AUTO_WRITE
-            ),
-            mesh
+                IOobject
+                (
+                    "phib",
+                    runTime.timeName(),
+                    mesh,
+                    IOobject::MUST_READ,
+                    IOobject::AUTO_WRITE
+                ),
+                mesh
+            )
         );
     }
     else
@@ -44,19 +46,22 @@
             }
         }
 
-        phibPtr = new surfaceScalarField
+        phibPtr.reset
         (
-            IOobject
+            new surfaceScalarField
             (
-                "phib",
-                runTime.timeName(),
-                mesh,
-                IOobject::NO_READ,
-                IOobject::AUTO_WRITE
-            ),
-            fvc::interpolate(Ub) & mesh.Sf(),
-            phiTypes
+                IOobject
+                (
+                    "phib",
+                    runTime.timeName(),
+                    mesh,
+                    IOobject::NO_READ,
+                    IOobject::AUTO_WRITE
+                ),
+                fvc::interpolate(Ub) & mesh.Sf(),
+                phiTypes
+            )
         );
     }
 
-    surfaceScalarField& phib = *phibPtr;
+    surfaceScalarField& phib = phibPtr();
diff --git a/applications/solvers/multiphase/cavitatingFoam/Make/options b/applications/solvers/multiphase/cavitatingFoam/Make/options
index 836301986d7683136b51b40ee42504c18b6ed2f9..0f2981ab4c1f723977c143543a9dc22fd2710109 100644
--- a/applications/solvers/multiphase/cavitatingFoam/Make/options
+++ b/applications/solvers/multiphase/cavitatingFoam/Make/options
@@ -7,8 +7,8 @@ EXE_INC = \
     -I$(LIB_SRC)/thermophysicalModels/barotropicCompressibilityModel/lnInclude
 
 EXE_LIBS = \
-    -lincompressibleTurbulenceModel \
     -lincompressibleTransportModels \
+    -lincompressibleTurbulenceModel \
     -lincompressibleRASModels \
     -lincompressibleLESModels \
     -lfiniteVolume \
diff --git a/applications/solvers/multiphase/cavitatingFoam/UEqn.H b/applications/solvers/multiphase/cavitatingFoam/UEqn.H
index 11eaf617bc659982773b64e54f862bf715927b12..01911faaa3dbd1b23e49004c2ba1573226050510 100644
--- a/applications/solvers/multiphase/cavitatingFoam/UEqn.H
+++ b/applications/solvers/multiphase/cavitatingFoam/UEqn.H
@@ -20,3 +20,5 @@
     {
         solve(UEqn == -fvc::grad(p));
     }
+
+    Info<< "max(U) " << max(mag(U)).value() << endl;
diff --git a/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C b/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C
index 1076f4807dfaf854a4df7b185a33b464622965ef..42543b3c3718d862ba53661633a27c4501049b13 100644
--- a/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C
+++ b/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C
@@ -25,7 +25,8 @@ Application
     cavitatingFoam
 
 Description
-    Transient cavitation code based on the barotropic equation of state.
+    Transient cavitation code based on the homogeneous equilibrium model
+    from which the compressibility of the liquid/vapour "mixture" is obtained.
 
     Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
 
diff --git a/applications/solvers/multiphase/cavitatingFoam/pEqn.H b/applications/solvers/multiphase/cavitatingFoam/pEqn.H
index 979834717be78414443c08afdf542d4355eb5b64..bcaedb7a1cf9bad8df2ea9aeffd76357ab55e51b 100644
--- a/applications/solvers/multiphase/cavitatingFoam/pEqn.H
+++ b/applications/solvers/multiphase/cavitatingFoam/pEqn.H
@@ -52,9 +52,32 @@
         }
     }
 
-    Info<< "max-min p: " << max(p).value()
+    Info<< "Predicted p max-min : " << max(p).value()
         << " " << min(p).value() << endl;
 
+    rho == max
+    (
+        psi*p
+      + (1.0 - gamma)*rhol0
+      + ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat,
+        rhoMin
+    );
+
+    #include "gammaPsi.H"
+
+    p =
+    (
+        rho
+      - (1.0 - gamma)*rhol0
+      - ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat
+    )/psi;
+
+    p.correctBoundaryConditions();
+
+    Info<< "Phase-change corrected p max-min : " << max(p).value()
+        << " " << min(p).value() << endl;
+
+    // Correct velocity
 
     U = HbyA - rUA*fvc::grad(p);
 
@@ -70,17 +93,4 @@
     U.correctBoundaryConditions();
 
     Info<< "max(U) " << max(mag(U)).value() << endl;
-
-    rho == max
-    (
-        psi*p
-      + (1.0 - gamma)*rhol0
-      + ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat,
-        rhoMin
-    );
-
-    Info<< "max-min rho: " << max(rho).value()
-        << " " << min(rho).value() << endl;
-
-    #include "gammaPsi.H"
 }
diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/alphaEqns.H b/applications/solvers/multiphase/compressibleInterDyMFoam/alphaEqns.H
deleted file mode 100644
index f54526276762aeee1aacd3e87fda796a961ce529..0000000000000000000000000000000000000000
--- a/applications/solvers/multiphase/compressibleInterDyMFoam/alphaEqns.H
+++ /dev/null
@@ -1,86 +0,0 @@
-{
-    word alphaScheme("div(phi,alpha)");
-    word alpharScheme("div(phirb,alpha)");
-
-    surfaceScalarField phir = phic*interface.nHatf();
-
-    for (int gCorr=0; gCorr<nAlphaCorr; gCorr++)
-    {
-        volScalarField::DimensionedInternalField Sp
-        (
-            IOobject
-            (
-                "Sp",
-                runTime.timeName(),
-                mesh
-            ),
-            mesh,
-            dimensionedScalar("Sp", dgdt.dimensions(), 0.0)
-        );
-
-        volScalarField::DimensionedInternalField Su
-        (
-            IOobject
-            (
-                "Su",
-                runTime.timeName(),
-                mesh
-            ),
-            // Divergence term is handled explicitly to be
-            // consistent with the explicit transport solution
-            divU*min(alpha1, scalar(1))
-        );
-
-        forAll(dgdt, celli)
-        {
-            if (dgdt[celli] > 0.0 && alpha1[celli] > 0.0)
-            {
-                Sp[celli] -= dgdt[celli]*alpha1[celli];
-                Su[celli] += dgdt[celli]*alpha1[celli];
-            }
-            else if (dgdt[celli] < 0.0 && alpha1[celli] < 1.0)
-            {
-                Sp[celli] += dgdt[celli]*(1.0 - alpha1[celli]);
-            }
-        }
-
-
-        surfaceScalarField phiAlpha1 =
-            fvc::flux
-            (
-                phi,
-                alpha1,
-                alphaScheme
-            )
-          + fvc::flux
-            (
-                -fvc::flux(-phir, alpha2, alpharScheme),
-                alpha1,
-                alpharScheme
-            );
-
-        MULES::explicitSolve
-        (
-            geometricOneField(),
-            alpha1,
-            phi,
-            phiAlpha1,
-            Sp,
-            Su,
-            1,
-            0
-        );
-
-        surfaceScalarField rho1f = fvc::interpolate(rho1);
-        surfaceScalarField rho2f = fvc::interpolate(rho2);
-        rhoPhi = phiAlpha1*(rho1f - rho2f) + phi*rho2f;
-
-        alpha2 = scalar(1) - alpha1;
-    }
-
-    Info<< "Liquid phase volume fraction = "
-        << alpha1.weightedAverage(mesh.V()).value()
-        << "  Min(alpha1) = " << min(alpha1).value()
-        << "  Min(alpha2) = " << min(alpha2).value()
-        << endl;
-}
diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/createFields.H b/applications/solvers/multiphase/compressibleInterDyMFoam/createFields.H
deleted file mode 100644
index 9d3be93d0e56e5cf1f2a9e82d7ddf3fb23122762..0000000000000000000000000000000000000000
--- a/applications/solvers/multiphase/compressibleInterDyMFoam/createFields.H
+++ /dev/null
@@ -1,144 +0,0 @@
-    Info<< "Reading field p\n" << endl;
-    volScalarField p
-    (
-        IOobject
-        (
-            "p",
-            runTime.timeName(),
-            mesh,
-            IOobject::MUST_READ,
-            IOobject::AUTO_WRITE
-        ),
-        mesh
-    );
-
-    Info<< "Reading field alpha1\n" << endl;
-    volScalarField alpha1
-    (
-        IOobject
-        (
-            "alpha1",
-            runTime.timeName(),
-            mesh,
-            IOobject::MUST_READ,
-            IOobject::AUTO_WRITE
-        ),
-        mesh
-    );
-
-    Info<< "Calculating field alpha1\n" << endl;
-    volScalarField alpha2("alpha2", scalar(1) - alpha1);
-
-    Info<< "Reading field U\n" << endl;
-    volVectorField U
-    (
-        IOobject
-        (
-            "U",
-            runTime.timeName(),
-            mesh,
-            IOobject::MUST_READ,
-            IOobject::AUTO_WRITE
-        ),
-        mesh
-    );
-
-    #include "createPhi.H"
-
-
-    Info<< "Reading transportProperties\n" << endl;
-    twoPhaseMixture twoPhaseProperties(U, phi);
-
-    dimensionedScalar rho10
-    (
-        twoPhaseProperties.subDict
-        (
-            twoPhaseProperties.phase1Name()
-        ).lookup("rho0")
-    );
-
-    dimensionedScalar rho20
-    (
-        twoPhaseProperties.subDict
-        (
-            twoPhaseProperties.phase2Name()
-        ).lookup("rho0")
-    );
-
-    dimensionedScalar psi1
-    (
-        twoPhaseProperties.subDict
-        (
-            twoPhaseProperties.phase1Name()
-        ).lookup("psi")
-    );
-
-    dimensionedScalar psi2
-    (
-        twoPhaseProperties.subDict
-        (
-            twoPhaseProperties.phase2Name()
-        ).lookup("psi")
-    );
-
-    dimensionedScalar pMin(twoPhaseProperties.lookup("pMin"));
-
-    volScalarField rho1 = rho10 + psi1*p;
-    volScalarField rho2 = rho20 + psi2*p;
-
-    volScalarField rho
-    (
-        IOobject
-        (
-            "rho",
-            runTime.timeName(),
-            mesh,
-            IOobject::READ_IF_PRESENT,
-            IOobject::AUTO_WRITE
-        ),
-        alpha1*rho1 + alpha2*rho2
-    );
-
-
-    // Mass flux
-    // Initialisation does not matter because rhoPhi is reset after the
-    // alpha1 solution before it is used in the U equation.
-    surfaceScalarField rhoPhi
-    (
-        IOobject
-        (
-            "rho*phi",
-            runTime.timeName(),
-            mesh,
-            IOobject::NO_READ,
-            IOobject::NO_WRITE
-        ),
-        fvc::interpolate(rho)*phi
-    );
-
-    volScalarField dgdt =
-        pos(alpha2)*fvc::div(phi)/max(alpha2, scalar(0.0001));
-
-    // Construct interface from alpha1 distribution
-    interfaceProperties interface(alpha1, U, twoPhaseProperties);
-
-    // Construct incompressible turbulence model
-    autoPtr<incompressible::turbulenceModel> turbulence
-    (
-        incompressible::turbulenceModel::New(U, phi, twoPhaseProperties)
-    );
-
-
-    wordList pcorrTypes
-    (
-        p.boundaryField().size(),
-        zeroGradientFvPatchScalarField::typeName
-    );
-
-    forAll(p.boundaryField(), i)
-    {
-        if (p.boundaryField()[i].fixesValue())
-        {
-            pcorrTypes[i] = fixedValueFvPatchScalarField::typeName;
-        }
-    }
diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterDyMFoam/pEqn.H
deleted file mode 100644
index df32583b499eb96cb64ae8bdd12646157836eae0..0000000000000000000000000000000000000000
--- a/applications/solvers/multiphase/compressibleInterDyMFoam/pEqn.H
+++ /dev/null
@@ -1,95 +0,0 @@
-{
-    volScalarField rUA = 1.0/UEqn.A();
-    surfaceScalarField rUAf = fvc::interpolate(rUA);
-
-    tmp<fvScalarMatrix> pEqnComp;
-
-    if (transonic)
-    {
-        pEqnComp =
-            (fvm::ddt(p) + fvm::div(phi, p) - fvm::Sp(fvc::div(phi), p));
-    }
-    else
-    {
-        pEqnComp =
-            (fvm::ddt(p) + fvc::div(phi, p) - fvc::Sp(fvc::div(phi), p));
-    }
-
-
-    U = rUA*UEqn.H();
-
-    surfaceScalarField phiU
-    (
-        "phiU",
-        (fvc::interpolate(U) & mesh.Sf())
-    );
-
-    phi = phiU +
-        (
-            fvc::interpolate(interface.sigmaK())
-           *fvc::snGrad(alpha1)*mesh.magSf()
-          + fvc::interpolate(rho)*(g & mesh.Sf())
-        )*rUAf;
-
-    for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
-    {
-        fvScalarMatrix pEqnIncomp
-        (
-            fvc::div(phi)
-          - fvm::laplacian(rUAf, p)
-        );
-
-        if
-        (
-            oCorr == nOuterCorr-1
-            && corr == nCorr-1
-            && nonOrth == nNonOrthCorr
-        )
-        {
-            solve
-            (
-                (
-                    max(alpha1, scalar(0))*(psi1/rho1)
-                  + max(alpha2, scalar(0))*(psi2/rho2)
-                )
-               *pEqnComp()
-              + pEqnIncomp,
-                mesh.solver(p.name() + "Final")
-            );
-        }
-        else
-        {
-            solve
-            (
-                (
-                    max(alpha1, scalar(0))*(psi1/rho1)
-                  + max(alpha2, scalar(0))*(psi2/rho2)
-                )
-               *pEqnComp()
-              + pEqnIncomp
-            );
-        }
-
-        if (nonOrth == nNonOrthCorr)
-        {
-            dgdt =
-                (pos(alpha2)*(psi2/rho2) - pos(alpha1)*(psi1/rho1))
-               *(pEqnComp & p);
-            phi += pEqnIncomp.flux();
-        }
-    }
-
-    U += rUA*fvc::reconstruct((phi - phiU)/rUAf);
-    U.correctBoundaryConditions();
-
-    p.max(pMin);
-
-    rho1 = rho10 + psi1*p;
-    rho2 = rho20 + psi2*p;
-
-    Info<< "max(U) " << max(mag(U)).value() << endl;
-    Info<< "min(p) " << min(p).value() << endl;
-
-    // Make the fluxes relative to the mesh motion
-    fvc::makeRelative(phi, U);
-}
diff --git a/applications/solvers/multiphase/compressibleInterFoam/Allwclean b/applications/solvers/multiphase/compressibleInterFoam/Allwclean
new file mode 100755
index 0000000000000000000000000000000000000000..2b936f934b86465239872eead52647f68585281e
--- /dev/null
+++ b/applications/solvers/multiphase/compressibleInterFoam/Allwclean
@@ -0,0 +1,8 @@
+#!/bin/sh
+cd ${0%/*} || exit 1    # run from this directory
+set -x
+
+wclean
+wclean compressibleInterDyMFoam
+
+# ----------------------------------------------------------------- end-of-file
diff --git a/applications/solvers/multiphase/compressibleInterFoam/Allwmake b/applications/solvers/multiphase/compressibleInterFoam/Allwmake
new file mode 100755
index 0000000000000000000000000000000000000000..644094d070c06f795bc28a73aa33aa66db86114f
--- /dev/null
+++ b/applications/solvers/multiphase/compressibleInterFoam/Allwmake
@@ -0,0 +1,8 @@
+#!/bin/sh
+cd ${0%/*} || exit 1    # run from this directory
+set -x
+
+wmake
+wmake compressibleInterDyMFoam
+
+# ----------------------------------------------------------------- end-of-file
diff --git a/applications/solvers/multiphase/compressibleInterFoam/Make/options b/applications/solvers/multiphase/compressibleInterFoam/Make/options
index 93098736927e4d08efde0cb169499b1dedca1cec..c8ce69c074b6f87f924a391ae8778b3f19e946ee 100644
--- a/applications/solvers/multiphase/compressibleInterFoam/Make/options
+++ b/applications/solvers/multiphase/compressibleInterFoam/Make/options
@@ -6,7 +6,7 @@ EXE_INC = \
     -I$(LIB_SRC)/finiteVolume/lnInclude
 
 EXE_LIBS = \
-    -linterfaceProperties \
+    -ltwoPhaseInterfaceProperties \
     -lincompressibleTransportModels \
     -lincompressibleTurbulenceModel \
     -lincompressibleRASModels \
diff --git a/applications/solvers/multiphase/compressibleInterFoam/UEqn.H b/applications/solvers/multiphase/compressibleInterFoam/UEqn.H
index 0b1a9ac029d776dbd57da20f91c14da8ee88f5a7..320953ab6fbb2ab0bb5af932929990e9e83c0f58 100644
--- a/applications/solvers/multiphase/compressibleInterFoam/UEqn.H
+++ b/applications/solvers/multiphase/compressibleInterFoam/UEqn.H
@@ -24,10 +24,10 @@
          ==
             fvc::reconstruct
             (
-                fvc::interpolate(rho)*(g & mesh.Sf())
-              + (
+                (
                     fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
-                  - fvc::snGrad(p)
+                  - ghf*fvc::snGrad(rho)
+                  - fvc::snGrad(p_rgh)
                 ) * mesh.magSf()
             )
         );
diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/Make/files b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/files
similarity index 100%
rename from applications/solvers/multiphase/compressibleInterDyMFoam/Make/files
rename to applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/files
diff --git a/applications/solvers/multiphase/interDyMFoam/Make/options b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/options
similarity index 86%
rename from applications/solvers/multiphase/interDyMFoam/Make/options
rename to applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/options
index dd6e8ee57c24f96342f91a325cf53f6bc1a658cf..b9b0ec54daad947bcdc8beda5cc0acc93b435bc9 100644
--- a/applications/solvers/multiphase/interDyMFoam/Make/options
+++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/options
@@ -1,5 +1,5 @@
 EXE_INC = \
-    -I../interFoam \
+    -I.. \
     -I$(LIB_SRC)/transportModels \
     -I$(LIB_SRC)/transportModels/incompressible/lnInclude \
     -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
@@ -10,7 +10,7 @@ EXE_INC = \
     -I$(LIB_SRC)/dynamicFvMesh/lnInclude
 
 EXE_LIBS = \
-    -linterfaceProperties \
+    -ltwoPhaseInterfaceProperties \
     -lincompressibleTransportModels \
     -lincompressibleTurbulenceModel \
     -lincompressibleRASModels \
@@ -18,5 +18,4 @@ EXE_LIBS = \
     -lfiniteVolume \
     -ldynamicMesh \
     -lmeshTools \
-    -ldynamicFvMesh \
-    -ltopoChangerFvMesh
+    -ldynamicFvMesh
diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/alphaEqnsSubCycle.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/alphaEqnsSubCycle.H
similarity index 93%
rename from applications/solvers/multiphase/compressibleInterDyMFoam/alphaEqnsSubCycle.H
rename to applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/alphaEqnsSubCycle.H
index 32a7163130ebe623fec24babb865c2a4f8bb9322..e668296b6da3a214b2bf87bc58f992618a0e62d0 100644
--- a/applications/solvers/multiphase/compressibleInterDyMFoam/alphaEqnsSubCycle.H
+++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/alphaEqnsSubCycle.H
@@ -27,7 +27,7 @@
             !(++alphaSubCycle).end();
         )
         {
-#           include "alphaEqns.H"
+            #include "alphaEqns.H"
             rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi;
         }
 
@@ -35,7 +35,7 @@
     }
     else
     {
-#       include "alphaEqns.H"
+        #include "alphaEqns.H"
     }
 
     if (oCorr == 0)
diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/compressibleInterDyMFoam.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C
similarity index 93%
rename from applications/solvers/multiphase/compressibleInterDyMFoam/compressibleInterDyMFoam.C
rename to applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C
index d9497b943984d7e4438bd6cac8e757561aee9863..c2f1d04706d47475a271cba54f4ed907b083d50d 100644
--- a/applications/solvers/multiphase/compressibleInterDyMFoam/compressibleInterDyMFoam.C
+++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C
@@ -22,7 +22,7 @@ License
     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 
 Application
-    compressibleLesInterFoam
+    compressibleInterDyMFoam
 
 Description
     Solver for 2 compressible, isothermal immiscible fluids using a VOF
@@ -30,9 +30,10 @@ Description
     with optional mesh motion and mesh topology changes including adaptive
     re-meshing.
 
-    The momentum and other fluid properties are of the "mixture" and a
-    single momentum equation is solved.  Turbulence modelling is generic,
-    i.e. laminar, RAS or LES may be selected.
+    The momentum and other fluid properties are of the "mixture" and a single
+    momentum equation is solved.
+
+    Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
 
 \*---------------------------------------------------------------------------*/
 
@@ -55,6 +56,7 @@ int main(int argc, char *argv[])
     #include "readControls.H"
     #include "initContinuityErrs.H"
     #include "createFields.H"
+    #include "createPcorrTypes.H"
     #include "CourantNo.H"
     #include "setInitialDeltaT.H"
 
@@ -89,6 +91,9 @@ int main(int argc, char *argv[])
                 Info<< "Execution time for mesh.update() = "
                     << runTime.elapsedCpuTime() - timeBeforeMeshUpdate
                     << " s" << endl;
+
+                gh = g & mesh.C();
+                ghf = g & mesh.Cf();
             }
 
             if (mesh.changing() && correctPhi)
diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/correctPhi.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/correctPhi.H
similarity index 95%
rename from applications/solvers/multiphase/compressibleInterDyMFoam/correctPhi.H
rename to applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/correctPhi.H
index e4bef5a60fe65de90f85b1f0713fac45be23658b..f681ba65940dd3eb12b67ad38628f19537ca2c96 100644
--- a/applications/solvers/multiphase/compressibleInterDyMFoam/correctPhi.H
+++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/correctPhi.H
@@ -42,7 +42,7 @@
 
     adjustPhi(phi, U, pcorr);
 
-    for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
+    for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
     {
         fvScalarMatrix pcorrEqn
         (
diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/createPcorrTypes.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/createPcorrTypes.H
new file mode 100644
index 0000000000000000000000000000000000000000..dfd4afb49bb11a5546c3aa34cda8b0964b94a1a3
--- /dev/null
+++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/createPcorrTypes.H
@@ -0,0 +1,13 @@
+    wordList pcorrTypes
+    (
+        p_rgh.boundaryField().size(),
+        zeroGradientFvPatchScalarField::typeName
+    );
+
+    for (label i=0; i<p_rgh.boundaryField().size(); i++)
+    {
+        if (p_rgh.boundaryField()[i].fixesValue())
+        {
+            pcorrTypes[i] = fixedValueFvPatchScalarField::typeName;
+        }
+    }
diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/pEqn.H
new file mode 100644
index 0000000000000000000000000000000000000000..0df0847c076f10ccc4888e2a5ff788269d721c7b
--- /dev/null
+++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/pEqn.H
@@ -0,0 +1,96 @@
+{
+    volScalarField rUA = 1.0/UEqn.A();
+    surfaceScalarField rUAf = fvc::interpolate(rUA);
+
+    tmp<fvScalarMatrix> p_rghEqnComp;
+
+    if (transonic)
+    {
+        p_rghEqnComp =
+        (
+            fvm::ddt(p_rgh)
+          + fvm::div(phi, p_rgh)
+          - fvm::Sp(fvc::div(phi), p_rgh)
+        );
+    }
+    else
+    {
+        p_rghEqnComp =
+        (
+            fvm::ddt(p_rgh)
+          + fvc::div(phi, p_rgh)
+          - fvc::Sp(fvc::div(phi), p_rgh)
+        );
+    }
+
+
+    U = rUA*UEqn.H();
+
+    surfaceScalarField phiU
+    (
+        "phiU",
+        (fvc::interpolate(U) & mesh.Sf())
+      + fvc::ddtPhiCorr(rUA, rho, U, phi)
+    );
+
+    phi = phiU +
+        (
+            fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
+          - ghf*fvc::snGrad(rho)
+        )*rUAf*mesh.magSf();
+
+    for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
+    {
+        fvScalarMatrix p_rghEqnIncomp
+        (
+            fvc::div(phi)
+          - fvm::laplacian(rUAf, p_rgh)
+        );
+
+        solve
+        (
+            (
+                max(alpha1, scalar(0))*(psi1/rho1)
+              + max(alpha2, scalar(0))*(psi2/rho2)
+            )
+           *p_rghEqnComp()
+          + p_rghEqnIncomp,
+            mesh.solver
+            (
+                p_rgh.select
+                (
+                    oCorr == nOuterCorr-1
+                 && corr == nCorr-1
+                 && nonOrth == nNonOrthCorr
+                )
+            )
+        );
+
+        if (nonOrth == nNonOrthCorr)
+        {
+            dgdt =
+                (pos(alpha2)*(psi2/rho2) - pos(alpha1)*(psi1/rho1))
+               *(p_rghEqnComp & p_rgh);
+            phi += p_rghEqnIncomp.flux();
+        }
+    }
+
+    U += rUA*fvc::reconstruct((phi - phiU)/rUAf);
+    U.correctBoundaryConditions();
+
+    p = max
+    (
+        (p_rgh + gh*(alpha1*rho10 + alpha2*rho20))
+       /(1.0 - gh*(alpha1*psi1 + alpha2*psi2)),
+        pMin
+    );
+
+    rho1 = rho10 + psi1*p;
+    rho2 = rho20 + psi2*p;
+
+    Info<< "max(U) " << max(mag(U)).value() << endl;
+    Info<< "min(p_rgh) " << min(p_rgh).value() << endl;
+
+    // Make the fluxes relative to the mesh motion
+    fvc::makeRelative(phi, U);
+}
diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/readControls.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/readControls.H
similarity index 54%
rename from applications/solvers/multiphase/compressibleInterDyMFoam/readControls.H
rename to applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/readControls.H
index a5a2a183e5b5911c7148b6794eda84a6d0a374c5..a2e4ef3747f5e90cf13fcc16d721275040144869 100644
--- a/applications/solvers/multiphase/compressibleInterDyMFoam/readControls.H
+++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/readControls.H
@@ -1,5 +1,5 @@
-    #include "readPISOControls.H"
-    #include "readTimeControls.H"
+   #include "readPISOControls.H"
+   #include "readTimeControls.H"
 
     label nAlphaCorr
     (
@@ -19,9 +19,14 @@
             << exit(FatalError);
     }
 
-    const bool correctPhi =
-        piso.lookupOrDefault("correctPhi", true);
-
-    const bool checkMeshCourantNo =
-        piso.lookupOrDefault("checkMeshCourantNo", false);
+    bool correctPhi = true;
+    if (piso.found("correctPhi"))
+    {
+        correctPhi = Switch(piso.lookup("correctPhi"));
+    }
 
+    bool checkMeshCourantNo = false;
+    if (piso.found("checkMeshCourantNo"))
+    {
+        checkMeshCourantNo = Switch(piso.lookup("checkMeshCourantNo"));
+    }
diff --git a/applications/solvers/multiphase/compressibleInterFoam/createFields.H b/applications/solvers/multiphase/compressibleInterFoam/createFields.H
index 3e6904d383e677c976ac8daacd110b31af414f75..fab0df9284a8db2bb5356d48828bf77100cdd7ab 100644
--- a/applications/solvers/multiphase/compressibleInterFoam/createFields.H
+++ b/applications/solvers/multiphase/compressibleInterFoam/createFields.H
@@ -1,9 +1,9 @@
-    Info<< "Reading field p\n" << endl;
-    volScalarField p
+    Info<< "Reading field p_rgh\n" << endl;
+    volScalarField p_rgh
     (
         IOobject
         (
-            "p",
+            "p_rgh",
             runTime.timeName(),
             mesh,
             IOobject::MUST_READ,
@@ -83,6 +83,28 @@
 
     dimensionedScalar pMin(twoPhaseProperties.lookup("pMin"));
 
+    Info<< "Calculating field g.h\n" << endl;
+    volScalarField gh("gh", g & mesh.C());
+    surfaceScalarField ghf("ghf", g & mesh.Cf());
+
+    volScalarField p
+    (
+        IOobject
+        (
+            "p",
+            runTime.timeName(),
+            mesh,
+            IOobject::NO_READ,
+            IOobject::AUTO_WRITE
+        ),
+        max
+        (
+            (p_rgh + gh*(alpha1*rho10 + alpha2*rho20))
+           /(1.0 - gh*(alpha1*psi1 + alpha2*psi2)),
+            pMin
+        )
+    );
+
     volScalarField rho1 = rho10 + psi1*p;
     volScalarField rho2 = rho20 + psi2*p;
 
diff --git a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H
index 335ba473f10bc59b813250cb43f4a86e507307dd..eefe6bec08424b9e41766adacb936681cb69b950 100644
--- a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H
+++ b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H
@@ -2,17 +2,25 @@
     volScalarField rUA = 1.0/UEqn.A();
     surfaceScalarField rUAf = fvc::interpolate(rUA);
 
-    tmp<fvScalarMatrix> pEqnComp;
+    tmp<fvScalarMatrix> p_rghEqnComp;
 
     if (transonic)
     {
-        pEqnComp =
-            (fvm::ddt(p) + fvm::div(phi, p) - fvm::Sp(fvc::div(phi), p));
+        p_rghEqnComp =
+        (
+            fvm::ddt(p_rgh)
+          + fvm::div(phi, p_rgh)
+          - fvm::Sp(fvc::div(phi), p_rgh)
+        );
     }
     else
     {
-        pEqnComp =
-            (fvm::ddt(p) + fvc::div(phi, p) - fvc::Sp(fvc::div(phi), p));
+        p_rghEqnComp =
+        (
+            fvm::ddt(p_rgh)
+          + fvc::div(phi, p_rgh)
+          - fvc::Sp(fvc::div(phi), p_rgh)
+        );
     }
 
 
@@ -21,22 +29,22 @@
     surfaceScalarField phiU
     (
         "phiU",
-        (fvc::interpolate(U) & mesh.Sf()) + fvc::ddtPhiCorr(rUA, rho, U, phi)
+        (fvc::interpolate(U) & mesh.Sf())
+      + fvc::ddtPhiCorr(rUA, rho, U, phi)
     );
 
     phi = phiU +
         (
-            fvc::interpolate(interface.sigmaK())
-           *fvc::snGrad(alpha1)*mesh.magSf()
-          + fvc::interpolate(rho)*(g & mesh.Sf())
-        )*rUAf;
+            fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
+          - ghf*fvc::snGrad(rho)
+        )*rUAf*mesh.magSf();
 
     for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
     {
-        fvScalarMatrix pEqnIncomp
+        fvScalarMatrix p_rghEqnIncomp
         (
             fvc::div(phi)
-          - fvm::laplacian(rUAf, p)
+          - fvm::laplacian(rUAf, p_rgh)
         );
 
         solve
@@ -45,27 +53,41 @@
                 max(alpha1, scalar(0))*(psi1/rho1)
               + max(alpha2, scalar(0))*(psi2/rho2)
             )
-           *pEqnComp()
-          + pEqnIncomp
+           *p_rghEqnComp()
+          + p_rghEqnIncomp,
+            mesh.solver
+            (
+                p_rgh.select
+                (
+                    oCorr == nOuterCorr-1
+                 && corr == nCorr-1
+                 && nonOrth == nNonOrthCorr
+                )
+            )
         );
 
         if (nonOrth == nNonOrthCorr)
         {
             dgdt =
                 (pos(alpha2)*(psi2/rho2) - pos(alpha1)*(psi1/rho1))
-               *(pEqnComp & p);
-            phi += pEqnIncomp.flux();
+               *(p_rghEqnComp & p_rgh);
+            phi += p_rghEqnIncomp.flux();
         }
     }
 
     U += rUA*fvc::reconstruct((phi - phiU)/rUAf);
     U.correctBoundaryConditions();
 
-    p.max(pMin);
+    p = max
+    (
+        (p_rgh + gh*(alpha1*rho10 + alpha2*rho20))
+       /(1.0 - gh*(alpha1*psi1 + alpha2*psi2)),
+        pMin
+    );
 
     rho1 = rho10 + psi1*p;
     rho2 = rho20 + psi2*p;
 
     Info<< "max(U) " << max(mag(U)).value() << endl;
-    Info<< "min(p) " << min(p).value() << endl;
+    Info<< "min(p_rgh) " << min(p_rgh).value() << endl;
 }
diff --git a/applications/solvers/multiphase/interDyMFoam/correctPhi.H b/applications/solvers/multiphase/interDyMFoam/correctPhi.H
deleted file mode 100644
index 72550e621c0b6dc381f92f591fceed084b32494f..0000000000000000000000000000000000000000
--- a/applications/solvers/multiphase/interDyMFoam/correctPhi.H
+++ /dev/null
@@ -1,62 +0,0 @@
-{
-    if (mesh.changing())
-    {
-        forAll(U.boundaryField(), patchi)
-        {
-            if (U.boundaryField()[patchi].fixesValue())
-            {
-                U.boundaryField()[patchi].initEvaluate();
-            }
-        }
-
-        forAll(U.boundaryField(), patchi)
-        {
-            if (U.boundaryField()[patchi].fixesValue())
-            {
-                U.boundaryField()[patchi].evaluate();
-
-                phi.boundaryField()[patchi] =
-                U.boundaryField()[patchi] & mesh.Sf().boundaryField()[patchi];
-            }
-        }
-    }
-
-    #include "continuityErrs.H"
-
-    volScalarField pcorr
-    (
-        IOobject
-        (
-            "pcorr",
-            runTime.timeName(),
-            mesh,
-            IOobject::NO_READ,
-            IOobject::NO_WRITE
-        ),
-        mesh,
-        dimensionedScalar("pcorr", p.dimensions(), 0.0),
-        pcorrTypes
-    );
-
-    dimensionedScalar rAUf("(1|A(U))", dimTime/rho.dimensions(), 1.0);
-
-    adjustPhi(phi, U, pcorr);
-
-    for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
-    {
-        fvScalarMatrix pcorrEqn
-        (
-            fvm::laplacian(rAUf, pcorr) == fvc::div(phi)
-        );
-
-        pcorrEqn.setReference(pRefCell, pRefValue);
-        pcorrEqn.solve();
-
-        if (nonOrth == nNonOrthCorr)
-        {
-            phi -= pcorrEqn.flux();
-        }
-    }
-
-    #include "continuityErrs.H"
-}
diff --git a/applications/solvers/multiphase/interDyMFoam/createFields.H b/applications/solvers/multiphase/interDyMFoam/createFields.H
deleted file mode 100644
index 843931df10419d182446282fd20db677bdd4fc4a..0000000000000000000000000000000000000000
--- a/applications/solvers/multiphase/interDyMFoam/createFields.H
+++ /dev/null
@@ -1,112 +0,0 @@
-    Info<< "Reading field p\n" << endl;
-    volScalarField p
-    (
-        IOobject
-        (
-            "p",
-            runTime.timeName(),
-            mesh,
-            IOobject::MUST_READ,
-            IOobject::AUTO_WRITE
-        ),
-        mesh
-    );
-
-    Info<< "Reading field alpha1\n" << endl;
-    volScalarField alpha1
-    (
-        IOobject
-        (
-            "alpha1",
-            runTime.timeName(),
-            mesh,
-            IOobject::MUST_READ,
-            IOobject::AUTO_WRITE
-        ),
-        mesh
-    );
-
-    Info<< "Reading field U\n" << endl;
-    volVectorField U
-    (
-        IOobject
-        (
-            "U",
-            runTime.timeName(),
-            mesh,
-            IOobject::MUST_READ,
-            IOobject::AUTO_WRITE
-        ),
-        mesh
-    );
-
-#   include "createPhi.H"
-
-
-    Info<< "Reading transportProperties\n" << endl;
-    twoPhaseMixture twoPhaseProperties(U, phi);
-
-    const dimensionedScalar& rho1 = twoPhaseProperties.rho1();
-    const dimensionedScalar& rho2 = twoPhaseProperties.rho2();
-
-
-    // Need to store rho for ddt(rho, U)
-    volScalarField rho
-    (
-        IOobject
-        (
-            "rho",
-            runTime.timeName(),
-            mesh,
-            IOobject::READ_IF_PRESENT
-        ),
-        alpha1*rho1 + (scalar(1) - alpha1)*rho2,
-        alpha1.boundaryField().types()
-    );
-    rho.oldTime();
-
-
-    // Mass flux
-    // Initialisation does not matter because rhoPhi is reset after the
-    // alpha1 solution before it is used in the U equation.
-    surfaceScalarField rhoPhi
-    (
-        IOobject
-        (
-            "rho*phi",
-            runTime.timeName(),
-            mesh,
-            IOobject::NO_READ,
-            IOobject::NO_WRITE
-        ),
-        rho1*phi
-    );
-
-
-    // Construct interface from alpha1 distribution
-    interfaceProperties interface(alpha1, U, twoPhaseProperties);
-
-    // Construct incompressible turbulence model
-    autoPtr<incompressible::turbulenceModel> turbulence
-    (
-        incompressible::turbulenceModel::New(U, phi, twoPhaseProperties)
-    );
-
-    wordList pcorrTypes
-    (
-        p.boundaryField().size(),
-        zeroGradientFvPatchScalarField::typeName
-    );
-
-    forAll(p.boundaryField(), i)
-    {
-        if (p.boundaryField()[i].fixesValue())
-        {
-            pcorrTypes[i] = fixedValueFvPatchScalarField::typeName;
-        }
-    }
-
-
-    label pRefCell = 0;
-    scalar pRefValue = 0.0;
-    setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
diff --git a/applications/solvers/multiphase/interDyMFoam/pEqn.H b/applications/solvers/multiphase/interDyMFoam/pEqn.H
deleted file mode 100644
index afefb0a5f091b8131962713a5561cadcbaed2dec..0000000000000000000000000000000000000000
--- a/applications/solvers/multiphase/interDyMFoam/pEqn.H
+++ /dev/null
@@ -1,52 +0,0 @@
-{
-    volScalarField rAU = 1.0/UEqn.A();
-    surfaceScalarField rAUf = fvc::interpolate(rAU);
-
-    U = rAU*UEqn.H();
-    surfaceScalarField phiU("phiU", (fvc::interpolate(U) & mesh.Sf()));
-
-    if (p.needReference())
-    {
-        fvc::makeRelative(phiU, U);
-        adjustPhi(phiU, U, p);
-        fvc::makeAbsolute(phiU, U);
-    }
-
-    phi = phiU +
-    (
-        fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)*mesh.magSf()
-      + fvc::interpolate(rho)*(g & mesh.Sf())
-    )*rAUf;
-
-    for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
-    {
-        fvScalarMatrix pEqn
-        (
-            fvm::laplacian(rAUf, p) == fvc::div(phi)
-        );
-
-        pEqn.setReference(pRefCell, pRefValue);
-
-        if (corr == nCorr-1 && nonOrth == nNonOrthCorr)
-        {
-            pEqn.solve(mesh.solver(p.name() + "Final"));
-        }
-        else
-        {
-            pEqn.solve(mesh.solver(p.name()));
-        }
-
-        if (nonOrth == nNonOrthCorr)
-        {
-            phi -= pEqn.flux();
-        }
-    }
-
-    U += rAU*fvc::reconstruct((phi - phiU)/rAUf);
-    U.correctBoundaryConditions();
-
-    #include "continuityErrs.H"
-
-    // Make the fluxes relative to the mesh motion
-    fvc::makeRelative(phi, U);
-}
diff --git a/applications/solvers/multiphase/interDyMFoam/readControls.H b/applications/solvers/multiphase/interDyMFoam/readControls.H
deleted file mode 100644
index 10b09bf8ffa6a706103d59b386da2a5124ebca9c..0000000000000000000000000000000000000000
--- a/applications/solvers/multiphase/interDyMFoam/readControls.H
+++ /dev/null
@@ -1,9 +0,0 @@
-#   include "readTimeControls.H"
-#   include "readPISOControls.H"
-
-    const bool correctPhi =
-        piso.lookupOrDefault("correctPhi", true);
-
-    const bool checkMeshCourantNo =
-        piso.lookupOrDefault("checkMeshCourantNo", false);
-
diff --git a/applications/solvers/multiphase/interFoam/Allwclean b/applications/solvers/multiphase/interFoam/Allwclean
new file mode 100755
index 0000000000000000000000000000000000000000..350d4b268b070f686f65a6e959f2f5abdfde608d
--- /dev/null
+++ b/applications/solvers/multiphase/interFoam/Allwclean
@@ -0,0 +1,10 @@
+#!/bin/sh
+cd ${0%/*} || exit 1    # run from this directory
+set -x
+
+wclean
+wclean interDyMFoam
+wclean MRFInterFoam
+wclean porousInterFoam
+
+# ----------------------------------------------------------------- end-of-file
diff --git a/applications/solvers/multiphase/interFoam/Allwmake b/applications/solvers/multiphase/interFoam/Allwmake
new file mode 100755
index 0000000000000000000000000000000000000000..b25e4440e60bc084516b2829565268642a7ea2cc
--- /dev/null
+++ b/applications/solvers/multiphase/interFoam/Allwmake
@@ -0,0 +1,10 @@
+#!/bin/sh
+cd ${0%/*} || exit 1    # run from this directory
+set -x
+
+wmake
+wmake interDyMFoam
+wmake MRFInterFoam
+wmake porousInterFoam
+
+# ----------------------------------------------------------------- end-of-file
diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/MRFInterFoam.C b/applications/solvers/multiphase/interFoam/MRFInterFoam/MRFInterFoam.C
similarity index 97%
rename from tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/MRFInterFoam.C
rename to applications/solvers/multiphase/interFoam/MRFInterFoam/MRFInterFoam.C
index 9d386e6276798297ce5af05132f72aebcdf095cf..54c5b5b75d1d9f0753e8ea817cb909a6c033f003 100644
--- a/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/MRFInterFoam.C
+++ b/applications/solvers/multiphase/interFoam/MRFInterFoam/MRFInterFoam.C
@@ -51,7 +51,6 @@ int main(int argc, char *argv[])
     #include "setRootCase.H"
     #include "createTime.H"
     #include "createMesh.H"
-    #include "readGravitationalAcceleration.H"
     #include "readPISOControls.H"
     #include "initContinuityErrs.H"
     #include "createFields.H"
@@ -70,6 +69,7 @@ int main(int argc, char *argv[])
         #include "readPISOControls.H"
         #include "readTimeControls.H"
         #include "CourantNo.H"
+        #include "alphaCourantNo.H"
         #include "setDeltaT.H"
 
         runTime++;
@@ -79,6 +79,7 @@ int main(int argc, char *argv[])
         twoPhaseProperties.correct();
 
         #include "alphaEqnSubCycle.H"
+        #include "zonePhaseVolumes.H"
 
         #include "UEqn.H"
 
@@ -88,8 +89,6 @@ int main(int argc, char *argv[])
             #include "pEqn.H"
         }
 
-        #include "continuityErrs.H"
-
         turbulence->correct();
 
         runTime.write();
diff --git a/applications/solvers/multiphase/interFoam/MRFInterFoam/Make/files b/applications/solvers/multiphase/interFoam/MRFInterFoam/Make/files
new file mode 100644
index 0000000000000000000000000000000000000000..9610e63ee14feeaf4f2f1a9c84bcf731dc1ce8a7
--- /dev/null
+++ b/applications/solvers/multiphase/interFoam/MRFInterFoam/Make/files
@@ -0,0 +1,3 @@
+MRFInterFoam.C
+
+EXE = $(FOAM_APPBIN)/MRFInterFoam
diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/Make/options b/applications/solvers/multiphase/interFoam/MRFInterFoam/Make/options
similarity index 82%
rename from tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/Make/options
rename to applications/solvers/multiphase/interFoam/MRFInterFoam/Make/options
index e4acc4ce993fdad66ddeb7fb84c06b2824ccbc53..24349f694e016e85732d7896b7b98c57083eaa66 100644
--- a/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/Make/options
+++ b/applications/solvers/multiphase/interFoam/MRFInterFoam/Make/options
@@ -1,5 +1,5 @@
 EXE_INC = \
-    -I$(FOAM_SOLVERS)/multiphase/interFoam \
+    -I.. \
     -I$(LIB_SRC)/transportModels \
     -I$(LIB_SRC)/transportModels/incompressible/lnInclude \
     -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
@@ -7,8 +7,9 @@ EXE_INC = \
     -I$(LIB_SRC)/finiteVolume/lnInclude
 
 EXE_LIBS = \
-    -linterfaceProperties \
+    -ltwoPhaseInterfaceProperties \
     -lincompressibleTransportModels \
+    -lincompressibleTurbulenceModel \
     -lincompressibleRASModels \
     -lincompressibleLESModels \
     -lfiniteVolume
diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/UEqn.H b/applications/solvers/multiphase/interFoam/MRFInterFoam/UEqn.H
similarity index 86%
rename from tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/UEqn.H
rename to applications/solvers/multiphase/interFoam/MRFInterFoam/UEqn.H
index ae944a9d0e5b4060da256b629f1ff0326d014967..80e9d09b3b5538f977f6ab04d3b77dcfcad229ff 100644
--- a/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/UEqn.H
+++ b/applications/solvers/multiphase/interFoam/MRFInterFoam/UEqn.H
@@ -25,10 +25,10 @@
          ==
             fvc::reconstruct
             (
-                fvc::interpolate(rho)*(g & mesh.Sf())
-              + (
+                (
                     fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
-                  - fvc::snGrad(p)
+                  - ghf*fvc::snGrad(rho)
+                  - fvc::snGrad(p_rgh)
                 ) * mesh.magSf()
             )
         );
diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/createMRFZones.H b/applications/solvers/multiphase/interFoam/MRFInterFoam/createMRFZones.H
similarity index 100%
rename from tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/createMRFZones.H
rename to applications/solvers/multiphase/interFoam/MRFInterFoam/createMRFZones.H
diff --git a/applications/solvers/multiphase/interFoam/MRFInterFoam/pEqn.H b/applications/solvers/multiphase/interFoam/MRFInterFoam/pEqn.H
new file mode 100644
index 0000000000000000000000000000000000000000..7944df48142d57f7564ed13530be411a53402a58
--- /dev/null
+++ b/applications/solvers/multiphase/interFoam/MRFInterFoam/pEqn.H
@@ -0,0 +1,62 @@
+{
+    volScalarField rAU = 1.0/UEqn.A();
+    surfaceScalarField rAUf = fvc::interpolate(rAU);
+
+    U = rAU*UEqn.H();
+    surfaceScalarField phiU
+    (
+        "phiU",
+        (fvc::interpolate(U) & mesh.Sf())
+      + fvc::ddtPhiCorr(rAU, rho, U, phi)
+    );
+    mrfZones.relativeFlux(phiU);
+
+    adjustPhi(phiU, U, p_rgh);
+
+    phi = phiU +
+    (
+        fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
+      - ghf*fvc::snGrad(rho)
+    )*rAUf*mesh.magSf();
+
+    for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
+    {
+        fvScalarMatrix p_rghEqn
+        (
+            fvm::laplacian(rAUf, p_rgh) == fvc::div(phi)
+        );
+
+        p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
+
+        p_rghEqn.solve
+        (
+            mesh.solver
+            (
+                p_rgh.select(corr == nCorr-1 && nonOrth == nNonOrthCorr)
+            )
+        );
+
+        if (nonOrth == nNonOrthCorr)
+        {
+            phi -= p_rghEqn.flux();
+        }
+    }
+
+    U += rAU*fvc::reconstruct((phi - phiU)/rAUf);
+    U.correctBoundaryConditions();
+
+    #include "continuityErrs.H"
+
+    p == p_rgh + rho*gh;
+
+    if (p_rgh.needReference())
+    {
+        p += dimensionedScalar
+        (
+            "p",
+            p.dimensions(),
+            pRefValue - getRefCellValue(p, pRefCell)
+        );
+        p_rgh = p - rho*gh;
+    }
+}
diff --git a/applications/solvers/multiphase/interFoam/MRFInterFoam/zonePhaseVolumes.H b/applications/solvers/multiphase/interFoam/MRFInterFoam/zonePhaseVolumes.H
new file mode 100644
index 0000000000000000000000000000000000000000..e0355fe4b14c30c6fbf146f65f1fa36648359bee
--- /dev/null
+++ b/applications/solvers/multiphase/interFoam/MRFInterFoam/zonePhaseVolumes.H
@@ -0,0 +1,21 @@
+{
+    const scalarField& V = mesh.V();
+
+    forAll(mesh.cellZones(), czi)
+    {
+        const labelList& cellLabels = mesh.cellZones()[czi];
+
+        scalar phaseVolume = 0;
+
+        forAll(cellLabels, cli)
+        {
+            label celli = cellLabels[cli];
+            phaseVolume += alpha1[celli]*V[celli];
+        }
+
+        reduce(phaseVolume, sumOp<scalar>());
+
+        Info<< "Phase volume in zone " << mesh.cellZones()[czi].name()
+            << " = " << phaseVolume*1e6 << " ml " << endl;
+    }
+}
diff --git a/applications/solvers/multiphase/interFoam/Make/options b/applications/solvers/multiphase/interFoam/Make/options
index 93098736927e4d08efde0cb169499b1dedca1cec..c8ce69c074b6f87f924a391ae8778b3f19e946ee 100644
--- a/applications/solvers/multiphase/interFoam/Make/options
+++ b/applications/solvers/multiphase/interFoam/Make/options
@@ -6,7 +6,7 @@ EXE_INC = \
     -I$(LIB_SRC)/finiteVolume/lnInclude
 
 EXE_LIBS = \
-    -linterfaceProperties \
+    -ltwoPhaseInterfaceProperties \
     -lincompressibleTransportModels \
     -lincompressibleTurbulenceModel \
     -lincompressibleRASModels \
diff --git a/applications/solvers/multiphase/interFoam/UBlendingFactor.H b/applications/solvers/multiphase/interFoam/UBlendingFactor.H
deleted file mode 100644
index ade1b8e7f3518e713918601628f7b9b7d7dd98bb..0000000000000000000000000000000000000000
--- a/applications/solvers/multiphase/interFoam/UBlendingFactor.H
+++ /dev/null
@@ -1,6 +0,0 @@
-    surfaceScalarField alpha1f = fvc::interpolate(alpha1);
-    surfaceScalarField UBlendingFactor
-    (
-        "UBlendingFactor",
-        sqrt(max(min(4*alpha1f*(1.0 - alpha1f), 1.0), 0.0))
-    );
diff --git a/applications/solvers/multiphase/interFoam/UEqn.H b/applications/solvers/multiphase/interFoam/UEqn.H
index 0b1a9ac029d776dbd57da20f91c14da8ee88f5a7..320953ab6fbb2ab0bb5af932929990e9e83c0f58 100644
--- a/applications/solvers/multiphase/interFoam/UEqn.H
+++ b/applications/solvers/multiphase/interFoam/UEqn.H
@@ -24,10 +24,10 @@
          ==
             fvc::reconstruct
             (
-                fvc::interpolate(rho)*(g & mesh.Sf())
-              + (
+                (
                     fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
-                  - fvc::snGrad(p)
+                  - ghf*fvc::snGrad(rho)
+                  - fvc::snGrad(p_rgh)
                 ) * mesh.magSf()
             )
         );
diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightWriteBinary.C b/applications/solvers/multiphase/interFoam/alphaCourantNo.H
similarity index 60%
rename from applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightWriteBinary.C
rename to applications/solvers/multiphase/interFoam/alphaCourantNo.H
index bd3c2342fadb96575d71506ab540fd6adbed375f..b970d4ce23fc0af3b4a1248d7569fd4a3ebae9a4 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightWriteBinary.C
+++ b/applications/solvers/multiphase/interFoam/alphaCourantNo.H
@@ -21,58 +21,38 @@ License
     You should have received a copy of the GNU General Public License
     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 
-\*---------------------------------------------------------------------------*/
+Global
+    CourantNo
 
-#include "ensightWriteBinary.H"
-#include <fstream>
+Description
+    Calculates and outputs the mean and maximum Courant Numbers.
 
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+\*---------------------------------------------------------------------------*/
 
-void writeEnsDataBinary
+scalar maxAlphaCo
 (
-    const char* val,
-    std::ofstream& ensFile
-)
-{
-    char buffer[80] = {0};
-    strcpy(buffer, val);
-    ensFile.write(buffer, 80*sizeof(char));
-}
+    readScalar(runTime.controlDict().lookup("maxAlphaCo"))
+);
 
+scalar alphaCoNum = 0.0;
+scalar meanAlphaCoNum = 0.0;
 
-void writeEnsDataBinary
-(
-    const int val,
-    std::ofstream& ensFile
-)
+if (mesh.nInternalFaces())
 {
-    ensFile.write(reinterpret_cast<const char*>(&val), sizeof(int));
-}
+    surfaceScalarField alphaf = fvc::interpolate(alpha1);
 
+    surfaceScalarField SfUfbyDelta =
+        pos(alphaf - 0.01)*pos(0.99 - alphaf)
+       *mesh.surfaceInterpolation::deltaCoeffs()*mag(phi);
 
-void writeEnsDataBinary
-(
-    const scalarField& sf,
-    std::ofstream& ensightFile
-)
-{
-    if (sf.size())
-    {
-        List<float> temp(sf.size());
+    alphaCoNum = max(SfUfbyDelta/mesh.magSf())
+        .value()*runTime.deltaT().value();
 
-        forAll(sf, i)
-        {
-            temp[i] = float(sf[i]);
-        }
-
-        ensightFile.write
-        (
-            reinterpret_cast<char*>(temp.begin()),
-            sf.size()*sizeof(float)
-        );
-    }
+    meanAlphaCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
+        .value()*runTime.deltaT().value();
 }
 
+Info<< "Interface Courant Number mean: " << meanAlphaCoNum
+    << " max: " << alphaCoNum << endl;
 
 // ************************************************************************* //
-
diff --git a/applications/solvers/multiphase/interFoam/correctPhi.H b/applications/solvers/multiphase/interFoam/correctPhi.H
index 0b5cd3ff5954bbc0c7d410522a2e76b17f67b242..e08d3702e87816066224e995ccb4f0617897352e 100644
--- a/applications/solvers/multiphase/interFoam/correctPhi.H
+++ b/applications/solvers/multiphase/interFoam/correctPhi.H
@@ -3,13 +3,13 @@
 
     wordList pcorrTypes
     (
-        p.boundaryField().size(),
+        p_rgh.boundaryField().size(),
         zeroGradientFvPatchScalarField::typeName
     );
 
-    forAll(p.boundaryField(), i)
+    forAll (p_rgh.boundaryField(), i)
     {
-        if (p.boundaryField()[i].fixesValue())
+        if (p_rgh.boundaryField()[i].fixesValue())
         {
             pcorrTypes[i] = fixedValueFvPatchScalarField::typeName;
         }
@@ -26,11 +26,11 @@
             IOobject::NO_WRITE
         ),
         mesh,
-        dimensionedScalar("pcorr", p.dimensions(), 0.0),
+        dimensionedScalar("pcorr", p_rgh.dimensions(), 0.0),
         pcorrTypes
     );
 
-    dimensionedScalar rUAf("(1|A(U))", dimTime/rho.dimensions(), 1.0);
+    dimensionedScalar rAUf("(1|A(U))", dimTime/rho.dimensions(), 1.0);
 
     adjustPhi(phi, U, pcorr);
 
@@ -38,7 +38,7 @@
     {
         fvScalarMatrix pcorrEqn
         (
-            fvm::laplacian(rUAf, pcorr) == fvc::div(phi)
+            fvm::laplacian(rAUf, pcorr) == fvc::div(phi)
         );
 
         pcorrEqn.setReference(pRefCell, pRefValue);
diff --git a/applications/solvers/multiphase/interFoam/createFields.H b/applications/solvers/multiphase/interFoam/createFields.H
index 622d5d578c977d745f94419f993145222842d8a9..174cba3e1a2f957bdc608806d10ed330d2601b9f 100644
--- a/applications/solvers/multiphase/interFoam/createFields.H
+++ b/applications/solvers/multiphase/interFoam/createFields.H
@@ -1,9 +1,9 @@
-    Info<< "Reading field p\n" << endl;
-    volScalarField p
+    Info<< "Reading field p_rgh\n" << endl;
+    volScalarField p_rgh
     (
         IOobject
         (
-            "p",
+            "p_rgh",
             runTime.timeName(),
             mesh,
             IOobject::MUST_READ,
@@ -40,7 +40,7 @@
         mesh
     );
 
-#   include "createPhi.H"
+    #include "createPhi.H"
 
 
     Info<< "Reading transportProperties\n" << endl;
@@ -83,11 +83,6 @@
     );
 
 
-    label pRefCell = 0;
-    scalar pRefValue = 0.0;
-    setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
-
-
     // Construct interface from alpha1 distribution
     interfaceProperties interface(alpha1, U, twoPhaseProperties);
 
@@ -97,3 +92,54 @@
     (
         incompressible::turbulenceModel::New(U, phi, twoPhaseProperties)
     );
+
+    #include "readGravitationalAcceleration.H"
+
+    /*
+    dimensionedVector g0(g);
+
+    // Read the data file and initialise the interpolation table
+    interpolationTable<vector> timeSeriesAcceleration
+    (
+        runTime.path()/runTime.caseConstant()/"acceleration.dat"
+    );
+    */
+
+    Info<< "Calculating field g.h\n" << endl;
+    volScalarField gh("gh", g & mesh.C());
+    surfaceScalarField ghf("ghf", g & mesh.Cf());
+
+    volScalarField p
+    (
+        IOobject
+        (
+            "p",
+            runTime.timeName(),
+            mesh,
+            IOobject::NO_READ,
+            IOobject::AUTO_WRITE
+        ),
+        p_rgh + rho*gh
+    );
+
+    label pRefCell = 0;
+    scalar pRefValue = 0.0;
+    setRefCell
+    (
+        p,
+        p_rgh,
+        mesh.solutionDict().subDict("PISO"),
+        pRefCell,
+        pRefValue
+    );
+
+    if (p_rgh.needReference())
+    {
+        p += dimensionedScalar
+        (
+            "p",
+            p.dimensions(),
+            pRefValue - getRefCellValue(p, pRefCell)
+        );
+        p_rgh = p - rho*gh;
+    }
diff --git a/applications/solvers/multiphase/interDyMFoam/Make/files b/applications/solvers/multiphase/interFoam/interDyMFoam/Make/files
similarity index 100%
rename from applications/solvers/multiphase/interDyMFoam/Make/files
rename to applications/solvers/multiphase/interFoam/interDyMFoam/Make/files
diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/Make/options b/applications/solvers/multiphase/interFoam/interDyMFoam/Make/options
similarity index 93%
rename from applications/solvers/multiphase/compressibleInterDyMFoam/Make/options
rename to applications/solvers/multiphase/interFoam/interDyMFoam/Make/options
index 2a732d1a72f968f46274391ba7bde66aa8d503be..102475c1ed51e510ab99a174607cf845510d372c 100644
--- a/applications/solvers/multiphase/compressibleInterDyMFoam/Make/options
+++ b/applications/solvers/multiphase/interFoam/interDyMFoam/Make/options
@@ -1,4 +1,5 @@
 EXE_INC = \
+    -I.. \
     -I$(LIB_SRC)/transportModels \
     -I$(LIB_SRC)/transportModels/incompressible/lnInclude \
     -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
@@ -9,7 +10,7 @@ EXE_INC = \
     -I$(LIB_SRC)/dynamicFvMesh/lnInclude
 
 EXE_LIBS = \
-    -linterfaceProperties \
+    -ltwoPhaseInterfaceProperties \
     -lincompressibleTransportModels \
     -lincompressibleTurbulenceModel \
     -lincompressibleRASModels \
@@ -19,4 +20,3 @@ EXE_LIBS = \
     -lmeshTools \
     -ldynamicFvMesh \
     -ltopoChangerFvMesh
-
diff --git a/applications/solvers/multiphase/interDyMFoam/interDyMFoam.C b/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C
similarity index 97%
rename from applications/solvers/multiphase/interDyMFoam/interDyMFoam.C
rename to applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C
index bacf503c5a2e855fcee3b823f3e72d813d5b12fd..d78f2274975302f4e77fc5386aa9dd7e7ac7f659 100644
--- a/applications/solvers/multiphase/interDyMFoam/interDyMFoam.C
+++ b/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C
@@ -47,7 +47,6 @@ int main(int argc, char *argv[])
     #include "setRootCase.H"
     #include "createTime.H"
     #include "createDynamicFvMesh.H"
-    #include "readGravitationalAcceleration.H"
     #include "readPISOControls.H"
     #include "initContinuityErrs.H"
     #include "createFields.H"
@@ -62,6 +61,7 @@ int main(int argc, char *argv[])
     while (runTime.run())
     {
         #include "readControls.H"
+        #include "alphaCourantNo.H"
         #include "CourantNo.H"
 
         // Make the fluxes absolute
@@ -83,6 +83,9 @@ int main(int argc, char *argv[])
             Info<< "Execution time for mesh.update() = "
                 << runTime.elapsedCpuTime() - timeBeforeMeshUpdate
                 << " s" << endl;
+
+            gh = g & mesh.C();
+            ghf = g & mesh.Cf();
         }
 
         if (mesh.changing() && correctPhi)
diff --git a/applications/solvers/multiphase/interFoam/interDyMFoam/pEqn.H b/applications/solvers/multiphase/interFoam/interDyMFoam/pEqn.H
new file mode 100644
index 0000000000000000000000000000000000000000..59c0cd19295dab7f4d58bf487a694a882ebf2db4
--- /dev/null
+++ b/applications/solvers/multiphase/interFoam/interDyMFoam/pEqn.H
@@ -0,0 +1,64 @@
+{
+    volScalarField rAU = 1.0/UEqn.A();
+    surfaceScalarField rAUf = fvc::interpolate(rAU);
+
+    U = rAU*UEqn.H();
+    surfaceScalarField phiU("phiU", (fvc::interpolate(U) & mesh.Sf()));
+
+    if (p_rgh.needReference())
+    {
+        fvc::makeRelative(phiU, U);
+        adjustPhi(phiU, U, p_rgh);
+        fvc::makeAbsolute(phiU, U);
+    }
+
+    phi = phiU +
+    (
+        fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
+      - ghf*fvc::snGrad(rho)
+    )*rAUf*mesh.magSf();
+
+    for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
+    {
+        fvScalarMatrix p_rghEqn
+        (
+            fvm::laplacian(rAUf, p_rgh) == fvc::div(phi)
+        );
+
+        p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
+
+        p_rghEqn.solve
+        (
+            mesh.solver
+            (
+                p_rgh.select(corr == nCorr-1 && nonOrth == nNonOrthCorr)
+            )
+        );
+
+        if (nonOrth == nNonOrthCorr)
+        {
+            phi -= p_rghEqn.flux();
+        }
+    }
+
+    U += rAU*fvc::reconstruct((phi - phiU)/rAUf);
+    U.correctBoundaryConditions();
+
+    #include "continuityErrs.H"
+
+    // Make the fluxes relative to the mesh motion
+    fvc::makeRelative(phi, U);
+
+    p == p_rgh + rho*gh;
+
+    if (p_rgh.needReference())
+    {
+        p += dimensionedScalar
+        (
+            "p",
+            p.dimensions(),
+            pRefValue - getRefCellValue(p, pRefCell)
+        );
+        p_rgh = p - rho*gh;
+    }
+}
diff --git a/applications/solvers/multiphase/interFoam/interDyMFoam/readControls.H b/applications/solvers/multiphase/interFoam/interDyMFoam/readControls.H
new file mode 100644
index 0000000000000000000000000000000000000000..3640d73adc6bbe61745f1a3b7ed4dbf4421131f3
--- /dev/null
+++ b/applications/solvers/multiphase/interFoam/interDyMFoam/readControls.H
@@ -0,0 +1,14 @@
+#   include "readTimeControls.H"
+#   include "readPISOControls.H"
+
+    bool correctPhi = true;
+    if (piso.found("correctPhi"))
+    {
+        correctPhi = Switch(piso.lookup("correctPhi"));
+    }
+
+    bool checkMeshCourantNo = false;
+    if (piso.found("checkMeshCourantNo"))
+    {
+        checkMeshCourantNo = Switch(piso.lookup("checkMeshCourantNo"));
+    }
diff --git a/applications/solvers/multiphase/interFoam/interFoam.C b/applications/solvers/multiphase/interFoam/interFoam.C
index 569601adc4d40edfe7028bc31215f4e65ab6fc11..b8bae27d67d1b72db4a103e5e602f0ec77350a98 100644
--- a/applications/solvers/multiphase/interFoam/interFoam.C
+++ b/applications/solvers/multiphase/interFoam/interFoam.C
@@ -43,6 +43,7 @@ Description
 #include "interfaceProperties.H"
 #include "twoPhaseMixture.H"
 #include "turbulenceModel.H"
+#include "interpolationTable.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -51,7 +52,6 @@ int main(int argc, char *argv[])
     #include "setRootCase.H"
     #include "createTime.H"
     #include "createMesh.H"
-    #include "readGravitationalAcceleration.H"
     #include "readPISOControls.H"
     #include "initContinuityErrs.H"
     #include "createFields.H"
@@ -69,6 +69,7 @@ int main(int argc, char *argv[])
         #include "readPISOControls.H"
         #include "readTimeControls.H"
         #include "CourantNo.H"
+        #include "alphaCourantNo.H"
         #include "setDeltaT.H"
 
         runTime++;
@@ -87,8 +88,6 @@ int main(int argc, char *argv[])
             #include "pEqn.H"
         }
 
-        #include "continuityErrs.H"
-
         turbulence->correct();
 
         runTime.write();
diff --git a/applications/solvers/multiphase/interFoam/pEqn.H b/applications/solvers/multiphase/interFoam/pEqn.H
index 9025c6b7bac80dc1224a3e12843a9c5cf34d63c8..6437572c3b7d69d2c5b837c149c02cc4c4c982bb 100644
--- a/applications/solvers/multiphase/interFoam/pEqn.H
+++ b/applications/solvers/multiphase/interFoam/pEqn.H
@@ -1,49 +1,61 @@
 {
-    volScalarField rUA = 1.0/UEqn.A();
-    surfaceScalarField rUAf = fvc::interpolate(rUA);
-
-    U = rUA*UEqn.H();
+    volScalarField rAU = 1.0/UEqn.A();
+    surfaceScalarField rAUf = fvc::interpolate(rAU);
 
+    U = rAU*UEqn.H();
     surfaceScalarField phiU
     (
         "phiU",
         (fvc::interpolate(U) & mesh.Sf())
-      + fvc::ddtPhiCorr(rUA, rho, U, phi)
+      + fvc::ddtPhiCorr(rAU, rho, U, phi)
     );
 
-    adjustPhi(phiU, U, p);
+    adjustPhi(phiU, U, p_rgh);
 
     phi = phiU +
-        (
-            fvc::interpolate(interface.sigmaK())
-           *fvc::snGrad(alpha1)*mesh.magSf()
-          + fvc::interpolate(rho)*(g & mesh.Sf())
-        )*rUAf;
+    (
+        fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
+      - ghf*fvc::snGrad(rho)
+    )*rAUf*mesh.magSf();
 
     for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
     {
-        fvScalarMatrix pEqn
+        fvScalarMatrix p_rghEqn
         (
-            fvm::laplacian(rUAf, p) == fvc::div(phi)
+            fvm::laplacian(rAUf, p_rgh) == fvc::div(phi)
         );
 
-        pEqn.setReference(pRefCell, pRefValue);
+        p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
 
-        if (corr == nCorr-1 && nonOrth == nNonOrthCorr)
-        {
-            pEqn.solve(mesh.solver(p.name() + "Final"));
-        }
-        else
-        {
-            pEqn.solve(mesh.solver(p.name()));
-        }
+        p_rghEqn.solve
+        (
+            mesh.solver
+            (
+                p_rgh.select(corr == nCorr-1 && nonOrth == nNonOrthCorr)
+            )
+        );
 
         if (nonOrth == nNonOrthCorr)
         {
-            phi -= pEqn.flux();
+            phi -= p_rghEqn.flux();
         }
     }
 
-    U += rUA*fvc::reconstruct((phi - phiU)/rUAf);
+    U += rAU*fvc::reconstruct((phi - phiU)/rAUf);
     U.correctBoundaryConditions();
+
+    #include "continuityErrs.H"
+
+    p == p_rgh + rho*gh;
+
+    if (p_rgh.needReference())
+    {
+        p += dimensionedScalar
+        (
+            "p",
+            p.dimensions(),
+            pRefValue - getRefCellValue(p, pRefCell)
+        );
+        p_rgh = p - rho*gh;
+    }
 }
diff --git a/applications/solvers/multiphase/interFoam/porousInterFoam/Make/files b/applications/solvers/multiphase/interFoam/porousInterFoam/Make/files
new file mode 100644
index 0000000000000000000000000000000000000000..dda65f11ff20ff5d73aee7e2c8f6f3fad1a488db
--- /dev/null
+++ b/applications/solvers/multiphase/interFoam/porousInterFoam/Make/files
@@ -0,0 +1,3 @@
+porousInterFoam.C
+
+EXE = $(FOAM_APPBIN)/porousInterFoam
diff --git a/applications/solvers/multiphase/interFoam/porousInterFoam/Make/options b/applications/solvers/multiphase/interFoam/porousInterFoam/Make/options
new file mode 100644
index 0000000000000000000000000000000000000000..a33b9c82be9f4edb030379ce085e7de5cdf097f3
--- /dev/null
+++ b/applications/solvers/multiphase/interFoam/porousInterFoam/Make/options
@@ -0,0 +1,17 @@
+EXE_INC = \
+    -I.. \
+    -I$(LIB_SRC)/transportModels \
+    -I$(LIB_SRC)/transportModels/incompressible/lnInclude \
+    -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
+    -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
+    -I$(LIB_SRC)/finiteVolume/lnInclude \
+    -I$(LIB_SRC)/meshTools/lnInclude
+
+EXE_LIBS = \
+    -ltwoPhaseInterfaceProperties \
+    -lincompressibleTransportModels \
+    -lincompressibleTurbulenceModel \
+    -lincompressibleRASModels \
+    -lincompressibleLESModels \
+    -lfiniteVolume \
+    -lmeshTools
diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/UEqn.H b/applications/solvers/multiphase/interFoam/porousInterFoam/UEqn.H
similarity index 63%
rename from applications/solvers/multiphase/compressibleInterDyMFoam/UEqn.H
rename to applications/solvers/multiphase/interFoam/porousInterFoam/UEqn.H
index 138e58fc7f72b23abdcba18deef3da53e3b6b951..9d84a865f527bcf0a4a3e37ab26a15907ebf17b0 100644
--- a/applications/solvers/multiphase/compressibleInterDyMFoam/UEqn.H
+++ b/applications/solvers/multiphase/interFoam/porousInterFoam/UEqn.H
@@ -5,17 +5,22 @@
       + fvc::interpolate(rho*turbulence->nut())
     );
 
+    // Calculate and cache mu for the porous media
+    volScalarField mu(twoPhaseProperties.mu());
+
     fvVectorMatrix UEqn
     (
-        fvm::ddt(rho, U)
+        pZones.ddt(rho, U)
       + fvm::div(rhoPhi, U)
       - fvm::laplacian(muEff, U)
       - (fvc::grad(U) & fvc::grad(muEff))
-    //- fvc::div(muf*(mesh.Sf() & fvc::interpolate(fvc::grad(U)().T())))
+    //- fvc::div(muEff*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf()))
     );
 
     UEqn.relax();
 
+    pZones.addResistance(UEqn);
+
     if (momentumPredictor)
     {
         solve
@@ -24,10 +29,10 @@
          ==
             fvc::reconstruct
             (
-                fvc::interpolate(rho)*(g & mesh.Sf())
-              + (
+                (
                     fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
-                  - fvc::snGrad(p)
+                  - ghf*fvc::snGrad(rho)
+                  - fvc::snGrad(p_rgh)
                 ) * mesh.magSf()
             )
         );
diff --git a/applications/solvers/multiphase/interFoam/porousInterFoam/createPorousZones.H b/applications/solvers/multiphase/interFoam/porousInterFoam/createPorousZones.H
new file mode 100644
index 0000000000000000000000000000000000000000..430b466aac6e6cd3c634a3e75257d9efa477561c
--- /dev/null
+++ b/applications/solvers/multiphase/interFoam/porousInterFoam/createPorousZones.H
@@ -0,0 +1 @@
+    porousZones pZones(mesh);
diff --git a/applications/solvers/multiphase/interFoam/porousInterFoam/porousInterFoam.C b/applications/solvers/multiphase/interFoam/porousInterFoam/porousInterFoam.C
new file mode 100644
index 0000000000000000000000000000000000000000..c49f5aecb1d2c1edd955e8b99ab7af241a6fad72
--- /dev/null
+++ b/applications/solvers/multiphase/interFoam/porousInterFoam/porousInterFoam.C
@@ -0,0 +1,108 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software: you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 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/>.
+
+Application
+    porousInterFoam
+
+Description
+    Solver for 2 incompressible, isothermal immiscible fluids using a VOF
+    (volume of fluid) phase-fraction based interface capturing approach.
+    The momentum and other fluid properties are of the "mixture" and a single
+    momentum equation is solved.
+
+    Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
+
+    For a two-fluid approach see twoPhaseEulerFoam.
+
+    Explicit handling of porous zones is included.
+
+\*---------------------------------------------------------------------------*/
+
+#include "fvCFD.H"
+#include "MULES.H"
+#include "subCycle.H"
+#include "interfaceProperties.H"
+#include "twoPhaseMixture.H"
+#include "turbulenceModel.H"
+#include "porousZones.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+int main(int argc, char *argv[])
+{
+    #include "setRootCase.H"
+    #include "createTime.H"
+    #include "createMesh.H"
+    #include "readPISOControls.H"
+    #include "initContinuityErrs.H"
+    #include "createFields.H"
+    #include "createPorousZones.H"
+    #include "readTimeControls.H"
+    #include "correctPhi.H"
+    #include "CourantNo.H"
+    #include "setInitialDeltaT.H"
+
+    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+    Info<< "\nStarting time loop\n" << endl;
+
+    while (runTime.run())
+    {
+        #include "readPISOControls.H"
+        #include "readTimeControls.H"
+        #include "CourantNo.H"
+        #include "alphaCourantNo.H"
+        #include "setDeltaT.H"
+
+        runTime++;
+
+        Info<< "Time = " << runTime.timeName() << nl << endl;
+
+        twoPhaseProperties.correct();
+
+        #include "alphaEqnSubCycle.H"
+
+        #include "UEqn.H"
+
+        // --- PISO loop
+        for (int corr=0; corr<nCorr; corr++)
+        {
+            #include "pEqn.H"
+        }
+
+        turbulence->correct();
+
+        runTime.write();
+
+        Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
+            << "  ClockTime = " << runTime.elapsedClockTime() << " s"
+            << nl << endl;
+    }
+
+    Info<< "End\n" << endl;
+
+    return 0;
+}
+
+
+// ************************************************************************* //
diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightWriteBinary.H b/applications/solvers/multiphase/interFoam/setDeltaT.H
similarity index 65%
rename from applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightWriteBinary.H
rename to applications/solvers/multiphase/interFoam/setDeltaT.H
index e29a823e15927489e6b799fafb25d2e54b04f2b1..b315dcd1a0695205339b26ae101423a2b0441242 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightWriteBinary.H
+++ b/applications/solvers/multiphase/interFoam/setDeltaT.H
@@ -21,47 +21,33 @@ License
     You should have received a copy of the GNU General Public License
     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 
-InApplication
-    foamToEnsight
+Global
+    setDeltaT
 
 Description
-    Collection of functions for binary write in EnSight files
-
-SourceFiles
-    ensightWriteBinary.C
+    Reset the timestep to maintain a constant maximum courant Number.
+    Reduction of time-step is immediate, but increase is damped to avoid
+    unstable oscillations.
 
 \*---------------------------------------------------------------------------*/
 
-#ifndef ensightWriteBinary_H
-#define ensightWriteBinary_H
-
-#include "ensightMesh.H"
-
-using namespace Foam;
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-void writeEnsDataBinary
-(
-    const char* val,
-    std::ofstream& ensFile
-);
-
-void writeEnsDataBinary
-(
-    const int val,
-    std::ofstream& ensFile
-);
-
+if (adjustTimeStep)
+{
+    scalar maxDeltaTFact =
+        min(maxCo/(CoNum + SMALL), maxAlphaCo/(alphaCoNum + SMALL));
 
-void writeEnsDataBinary
-(
-    const scalarField& sf,
-    std::ofstream& ensightFile
-);
+    scalar deltaTFact = min(min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
 
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+    runTime.setDeltaT
+    (
+        min
+        (
+            deltaTFact*runTime.deltaT().value(),
+            maxDeltaT
+        )
+    );
 
-#endif
+    Info<< "deltaT = " <<  runTime.deltaT().value() << endl;
+}
 
 // ************************************************************************* //
diff --git a/applications/solvers/multiphase/interMixingFoam/Make/options b/applications/solvers/multiphase/interMixingFoam/Make/options
index 62271c2bb7e22cca0a814450bbe541cb5de6d4e4..cb135724cf03d61326b5f2dbe095900c545b904b 100644
--- a/applications/solvers/multiphase/interMixingFoam/Make/options
+++ b/applications/solvers/multiphase/interMixingFoam/Make/options
@@ -5,12 +5,13 @@ EXE_INC = \
     -IincompressibleThreePhaseMixture \
     -IthreePhaseInterfaceProperties \
     -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
+    -I$(LIB_SRC)/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/alphaContactAngle \
     -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
     -I$(LIB_SRC)/finiteVolume/lnInclude \
     -I$(LIB_SRC)/transportModels
 
 EXE_LIBS = \
-    -linterfaceProperties \
+    -ltwoPhaseInterfaceProperties \
     -lincompressibleTransportModels \
     -lincompressibleTurbulenceModel \
     -lincompressibleRASModels \
diff --git a/applications/solvers/multiphase/interMixingFoam/alphaCourantNo.H b/applications/solvers/multiphase/interMixingFoam/alphaCourantNo.H
new file mode 100644
index 0000000000000000000000000000000000000000..a560a60d270ffcc3594b6aa9a53cb042c4cb551a
--- /dev/null
+++ b/applications/solvers/multiphase/interMixingFoam/alphaCourantNo.H
@@ -0,0 +1,61 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software: you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 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
+    CourantNo
+
+Description
+    Calculates and outputs the mean and maximum Courant Numbers.
+
+\*---------------------------------------------------------------------------*/
+
+scalar maxAlphaCo
+(
+    readScalar(runTime.controlDict().lookup("maxAlphaCo"))
+);
+
+scalar alphaCoNum = 0.0;
+scalar meanAlphaCoNum = 0.0;
+
+if (mesh.nInternalFaces())
+{
+    surfaceScalarField alpha1f = fvc::interpolate(alpha1);
+    surfaceScalarField alpha2f = fvc::interpolate(alpha2);
+
+    surfaceScalarField SfUfbyDelta = max
+    (
+        pos(alpha1f - 0.01)*pos(0.99 - alpha1f),
+        pos(alpha2f - 0.01)*pos(0.99 - alpha2f)
+    )*mesh.surfaceInterpolation::deltaCoeffs()*mag(phi);
+
+    alphaCoNum = max(SfUfbyDelta/mesh.magSf())
+        .value()*runTime.deltaT().value();
+
+    meanAlphaCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
+        .value()*runTime.deltaT().value();
+}
+
+Info<< "Interface Courant Number mean: " << meanAlphaCoNum
+    << " max: " << alphaCoNum << endl;
+
+// ************************************************************************* //
diff --git a/applications/solvers/multiphase/interMixingFoam/createFields.H b/applications/solvers/multiphase/interMixingFoam/createFields.H
index 9615e6c18645286de8cbdf87ba5c1a127b251236..8ef77a5546d75e09ac0bd57450cf5a1c0ef6173e 100644
--- a/applications/solvers/multiphase/interMixingFoam/createFields.H
+++ b/applications/solvers/multiphase/interMixingFoam/createFields.H
@@ -1,9 +1,9 @@
-    Info<< "Reading field p\n" << endl;
-    volScalarField p
+    Info<< "Reading field p_rgh\n" << endl;
+    volScalarField p_rgh
     (
         IOobject
         (
-            "p",
+            "p_rgh",
             runTime.timeName(),
             mesh,
             IOobject::MUST_READ,
@@ -73,7 +73,7 @@
         mesh
     );
 
-#   include "createPhi.H"
+    #include "createPhi.H"
 
     threePhaseMixture threePhaseProperties(U, phi);
 
@@ -116,11 +116,6 @@
     );
 
 
-    label pRefCell = 0;
-    scalar pRefValue = 0.0;
-    setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
-
-
     // Construct interface from alpha distribution
     threePhaseInterfaceProperties interface(threePhaseProperties);
 
@@ -130,3 +125,43 @@
     (
         incompressible::turbulenceModel::New(U, phi, threePhaseProperties)
     );
+
+
+    Info<< "Calculating field g.h\n" << endl;
+    volScalarField gh("gh", g & mesh.C());
+    surfaceScalarField ghf("ghf", g & mesh.Cf());
+
+    volScalarField p
+    (
+        IOobject
+        (
+            "p",
+            runTime.timeName(),
+            mesh,
+            IOobject::NO_READ,
+            IOobject::AUTO_WRITE
+        ),
+        p_rgh + rho*gh
+    );
+
+    label pRefCell = 0;
+    scalar pRefValue = 0.0;
+    setRefCell
+    (
+        p,
+        p_rgh,
+        mesh.solutionDict().subDict("PISO"),
+        pRefCell,
+        pRefValue
+    );
+
+    if (p_rgh.needReference())
+    {
+        p += dimensionedScalar
+        (
+            "p",
+            p.dimensions(),
+            pRefValue - getRefCellValue(p, pRefCell)
+        );
+        p_rgh = p - rho*gh;
+    }
diff --git a/applications/solvers/multiphase/interMixingFoam/incompressibleThreePhaseMixture/threePhaseMixture.C b/applications/solvers/multiphase/interMixingFoam/incompressibleThreePhaseMixture/threePhaseMixture.C
index f25716d0e8d2b8875eeb1494280919b2006eb7ea..4ea4c4d9899793ab2e50a136b075c1b6fb47b46e 100644
--- a/applications/solvers/multiphase/interMixingFoam/incompressibleThreePhaseMixture/threePhaseMixture.C
+++ b/applications/solvers/multiphase/interMixingFoam/incompressibleThreePhaseMixture/threePhaseMixture.C
@@ -80,7 +80,7 @@ Foam::threePhaseMixture::threePhaseMixture
         viscosityModel::New
         (
             "nu3",
-            subDict(phase2Name_),
+            subDict(phase3Name_),
             U,
             phi
         )
diff --git a/applications/solvers/multiphase/interMixingFoam/interMixingFoam.C b/applications/solvers/multiphase/interMixingFoam/interMixingFoam.C
index 0950ef03893178e46c330df8630b22e2a3dde0a9..696e3597ff2f980f70db9c19e3998005d45bba9e 100644
--- a/applications/solvers/multiphase/interMixingFoam/interMixingFoam.C
+++ b/applications/solvers/multiphase/interMixingFoam/interMixingFoam.C
@@ -62,6 +62,7 @@ int main(int argc, char *argv[])
         #include "readPISOControls.H"
         #include "readTimeControls.H"
         #include "CourantNo.H"
+        #include "alphaCourantNo.H"
         #include "setDeltaT.H"
 
         runTime++;
diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/Make/files b/applications/solvers/multiphase/interPhaseChangeFoam/Make/files
index 5a7f01e980fb6486431abd7a293e68a7609c8fc6..5f65a3a4c24cecc960a90944230ab84fee83fdfe 100644
--- a/applications/solvers/multiphase/interPhaseChangeFoam/Make/files
+++ b/applications/solvers/multiphase/interPhaseChangeFoam/Make/files
@@ -1,6 +1,6 @@
 interPhaseChangeFoam.C
 phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C
-phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixtureNew.C
+phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C
 phaseChangeTwoPhaseMixtures/Kunz/Kunz.C
 phaseChangeTwoPhaseMixtures/Merkle/Merkle.C
 phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C
diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/Make/options b/applications/solvers/multiphase/interPhaseChangeFoam/Make/options
index fb77739916159a1973054dae1b8cafc7e353e853..960639f66a7491157d548f90d8774fa7618d9dd0 100644
--- a/applications/solvers/multiphase/interPhaseChangeFoam/Make/options
+++ b/applications/solvers/multiphase/interPhaseChangeFoam/Make/options
@@ -7,7 +7,7 @@ EXE_INC = \
     -I$(LIB_SRC)/finiteVolume/lnInclude
 
 EXE_LIBS = \
-    -linterfaceProperties \
+    -ltwoPhaseInterfaceProperties \
     -lincompressibleTransportModels \
     -lincompressibleTurbulenceModel \
     -lincompressibleRASModels \
diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/UEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/UEqn.H
index 757e37a2cfdc7d9dbdacd0621120452219ac2a2c..042f6f18a11d70f991f9446c4d33e16895d91dbf 100644
--- a/applications/solvers/multiphase/interPhaseChangeFoam/UEqn.H
+++ b/applications/solvers/multiphase/interPhaseChangeFoam/UEqn.H
@@ -25,10 +25,10 @@
          ==
             fvc::reconstruct
             (
-                fvc::interpolate(rho)*(g & mesh.Sf())
-              + (
+                (
                     fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
-                  - fvc::snGrad(p)
+                  - ghf*fvc::snGrad(rho)
+                  - fvc::snGrad(p_rgh)
                 ) * mesh.magSf()
             )
         );
diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H
index 8d769a3e3883e0509168ddb65da3123c67ae33ec..05226dc72f4ae8109004ecaf4f6d5f26d996e446 100644
--- a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H
+++ b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H
@@ -50,18 +50,18 @@
           + vDotcAlphal
         );
 
-        // MULES::explicitSolve(alpha1, phi, phiAlpha, 1, 0);
-        // MULES::explicitSolve
-        // (
-        //     geometricOneField(),
-        //     alpha1,
-        //     phi,
-        //     phiAlpha,
-        //     Sp,
-        //     Su,
-        //     1,
-        //     0
-        // );
+        //MULES::explicitSolve
+        //(
+        //    geometricOneField(),
+        //    alpha1,
+        //    phi,
+        //    phiAlpha,
+        //    Sp,
+        //    Su,
+        //    1,
+        //    0
+        //);
+
         MULES::implicitSolve
         (
             geometricOneField(),
diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H
index dd1d828030fa10b1e607e0081cb0b2fae02aba31..df45bc64825d15a622c6630868a1eddcb7aac4b2 100644
--- a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H
+++ b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H
@@ -36,12 +36,12 @@ surfaceScalarField rhoPhi
             !(++alphaSubCycle).end();
         )
         {
-#           include "alphaEqn.H"
+            #include "alphaEqn.H"
         }
     }
     else
     {
-#       include "alphaEqn.H"
+        #include "alphaEqn.H"
     }
 
     if (nOuterCorr == 1)
diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/correctPhi.H b/applications/solvers/multiphase/interPhaseChangeFoam/correctPhi.H
deleted file mode 100644
index 30e5c542e918b0f3df2b83f22c72062ff6f319ad..0000000000000000000000000000000000000000
--- a/applications/solvers/multiphase/interPhaseChangeFoam/correctPhi.H
+++ /dev/null
@@ -1,54 +0,0 @@
-{
-    #include "continuityErrs.H"
-
-    wordList pcorrTypes
-    (
-        p.boundaryField().size(),
-        zeroGradientFvPatchScalarField::typeName
-    );
-
-    forAll(p.boundaryField(), i)
-    {
-        if (p.boundaryField()[i].fixesValue())
-        {
-            pcorrTypes[i] = fixedValueFvPatchScalarField::typeName;
-        }
-    }
-
-    volScalarField pcorr
-    (
-        IOobject
-        (
-            "pcorr",
-            runTime.timeName(),
-            mesh,
-            IOobject::NO_READ,
-            IOobject::NO_WRITE
-        ),
-        mesh,
-        dimensionedScalar("pcorr", p.dimensions(), 0.0),
-        pcorrTypes
-    );
-
-    dimensionedScalar rUAf("(1|A(U))", dimTime/rho.dimensions(), 1.0);
-
-    adjustPhi(phi, U, pcorr);
-
-    for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
-    {
-        fvScalarMatrix pcorrEqn
-        (
-            fvm::laplacian(rUAf, pcorr) == fvc::div(phi)
-        );
-
-        pcorrEqn.setReference(pRefCell, pRefValue);
-        pcorrEqn.solve();
-
-        if (nonOrth == nNonOrthCorr)
-        {
-            phi -= pcorrEqn.flux();
-        }
-    }
-
-#   include "continuityErrs.H"
-}
diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/createFields.H b/applications/solvers/multiphase/interPhaseChangeFoam/createFields.H
index 98d166214b2ca5d34fa2aa554dfab679e16df7ee..381e80b8816851ce85ccc32217ea447e8ad78aed 100644
--- a/applications/solvers/multiphase/interPhaseChangeFoam/createFields.H
+++ b/applications/solvers/multiphase/interPhaseChangeFoam/createFields.H
@@ -1,9 +1,9 @@
-    Info<< "Reading field p\n" << endl;
-    volScalarField p
+    Info<< "Reading field p_rgh\n" << endl;
+    volScalarField p_rgh
     (
         IOobject
         (
-            "p",
+            "p_rgh",
             runTime.timeName(),
             mesh,
             IOobject::MUST_READ,
@@ -40,7 +40,7 @@
         mesh
     );
 
-#   include "createPhi.H"
+    #include "createPhi.H"
 
     Info<< "Creating phaseChangeTwoPhaseMixture\n" << endl;
     autoPtr<phaseChangeTwoPhaseMixture> twoPhaseProperties =
@@ -65,12 +65,6 @@
     );
     rho.oldTime();
 
-
-    label pRefCell = 0;
-    scalar pRefValue = 0.0;
-    setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
-
-
     // Construct interface from alpha1 distribution
     interfaceProperties interface(alpha1, U, twoPhaseProperties());
 
@@ -79,3 +73,43 @@
     (
         incompressible::turbulenceModel::New(U, phi, twoPhaseProperties())
     );
+
+
+    Info<< "Calculating field g.h\n" << endl;
+    volScalarField gh("gh", g & mesh.C());
+    surfaceScalarField ghf("ghf", g & mesh.Cf());
+
+    volScalarField p
+    (
+        IOobject
+        (
+            "p",
+            runTime.timeName(),
+            mesh,
+            IOobject::NO_READ,
+            IOobject::AUTO_WRITE
+        ),
+        p_rgh + rho*gh
+    );
+
+    label pRefCell = 0;
+    scalar pRefValue = 0.0;
+    setRefCell
+    (
+        p,
+        p_rgh,
+        mesh.solutionDict().subDict("PISO"),
+        pRefCell,
+        pRefValue
+    );
+
+    if (p_rgh.needReference())
+    {
+        p += dimensionedScalar
+        (
+            "p",
+            p.dimensions(),
+            pRefValue - getRefCellValue(p, pRefCell)
+        );
+        p_rgh = p - rho*gh;
+    }
diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C
index b05dca4436c29d7726b5e88a1f305c1763e71e2a..f39edffbb3afcadb7196e388b513a03743494825 100644
--- a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C
+++ b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C
@@ -59,7 +59,7 @@ int main(int argc, char *argv[])
     #include "initContinuityErrs.H"
     #include "createFields.H"
     #include "readTimeControls.H"
-    #include "correctPhi.H"
+    #include "../interFoam/correctPhi.H"
     #include "CourantNo.H"
     #include "setInitialDeltaT.H"
 
@@ -82,9 +82,11 @@ int main(int argc, char *argv[])
 
         turbulence->correct();
 
-        // --- Outer-corrector loop
+        // --- Pressure-velocity PIMPLE corrector loop
         for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
         {
+            bool finalIter = oCorr == nOuterCorr-1;
+
             #include "UEqn.H"
 
             // --- PISO loop
@@ -92,8 +94,6 @@ int main(int argc, char *argv[])
             {
                 #include "pEqn.H"
             }
-
-            #include "continuityErrs.H"
         }
 
         twoPhaseProperties->correct();
diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H
index 3c7d47880a8e637d78eb4c4108b134326e1cb545..cb42a4474a047d5ce12b413f46725308255d41a7 100644
--- a/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H
+++ b/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H
@@ -11,14 +11,13 @@
       + fvc::ddtPhiCorr(rUA, rho, U, phi)
     );
 
-    adjustPhi(phiU, U, p);
+    adjustPhi(phiU, U, p_rgh);
 
     phi = phiU +
         (
-            fvc::interpolate(interface.sigmaK())
-           *fvc::snGrad(alpha1)*mesh.magSf()
-          + fvc::interpolate(rho)*(g & mesh.Sf())
-        )*rUAf;
+            fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
+          - ghf*fvc::snGrad(rho)
+        )*rUAf*mesh.magSf();
 
     Pair<tmp<volScalarField> > vDotP = twoPhaseProperties->vDotP();
     const volScalarField& vDotcP = vDotP[0]();
@@ -26,29 +25,48 @@
 
     for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
     {
-        fvScalarMatrix pEqn
+        fvScalarMatrix p_rghEqn
         (
-            fvc::div(phi) - fvm::laplacian(rUAf, p)
-          - (vDotvP - vDotcP)*pSat + fvm::Sp(vDotvP - vDotcP, p)
+            fvc::div(phi) - fvm::laplacian(rUAf, p_rgh)
+          - (vDotvP - vDotcP)*(pSat - rho*gh) + fvm::Sp(vDotvP - vDotcP, p_rgh)
         );
 
-        pEqn.setReference(pRefCell, pRefValue);
+        p_rghEqn.setReference(pRefCell, pRefValue);
 
-        if (corr == nCorr-1 && nonOrth == nNonOrthCorr)
-        {
-            pEqn.solve(mesh.solver(p.name() + "Final"));
-        }
-        else
-        {
-            pEqn.solve(mesh.solver(p.name()));
-        }
+        p_rghEqn.solve
+        (
+            mesh.solver
+            (
+                p_rgh.select
+                (
+                    finalIter
+                 && corr == nCorr-1
+                 && nonOrth == nNonOrthCorr
+                )
+            )
+        );
 
         if (nonOrth == nNonOrthCorr)
         {
-            phi += pEqn.flux();
+            phi += p_rghEqn.flux();
         }
     }
 
     U += rUA*fvc::reconstruct((phi - phiU)/rUAf);
     U.correctBoundaryConditions();
+
+    #include "continuityErrs.H"
+
+    p == p_rgh + rho*gh;
+
+    if (p_rgh.needReference())
+    {
+        p += dimensionedScalar
+        (
+            "p",
+            p.dimensions(),
+            pRefValue - getRefCellValue(p, pRefCell)
+        );
+        p_rgh = p - rho*gh;
+    }
 }
diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.H b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.H
index 1404cd058be8d0b6e6dc1d0fad3d806fdab57364..107dad20a7ece80c6770bbd5f491d7b320dfee61 100644
--- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.H
+++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.H
@@ -9,16 +9,16 @@ 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 Generac License as published by
-    the Free Software Foundation; either  2 of the License, or
+    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 ho it will be useful, but WITHOUT
-    ANY WARRANTY; without even the imarranty of MERCHANTABILITY or
-    FITNESS FOR A PARTICULAR PURPOSE.he GNU General Public License
+    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 oNU General Public License
+    You should have received a copy of the GNU General Public License
     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 
 Class
diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.H b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.H
index 44156e9d828c72f5d59f506591ac2c40b6daa380..59fb524f47ddedb6fd55ae93c8e3ba2e1728aec3 100644
--- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.H
+++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.H
@@ -9,16 +9,16 @@ 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 Generac License as published by
-    the Free Software Foundation; either  2 of the License, or
+    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 ho it will be useful, but WITHOUT
-    ANY WARRANTY; without even the imarranty of MERCHANTABILITY or
-    FITNESS FOR A PARTICULAR PURPOSE.he GNU General Public License
+    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 oNU General Public License
+    You should have received a copy of the GNU General Public License
     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 
 Class
diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.H b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.H
index 2847beb85d933d20bbcca73f96309776029131b5..090b5d75da52f2b3031da12b06d224902e28de75 100644
--- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.H
+++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.H
@@ -1,5 +1,5 @@
 /*---------------------------------------------------------------------------*\
-  ========Merkle=                 |
+  =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
     \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
@@ -9,16 +9,16 @@ 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 Generac License as published by
-    the Free Software Foundation; either  2 of the License, or
+    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 ho it will be useful, but WITHOUT
-    ANY WARRANTY; without even the imarranty of MERCHANTABILITY or
-    FITNESS FOR A PARTICULAR PURPOSE.he GNU General Public License
+    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 oNU General Public License
+    You should have received a copy of the GNU General Public License
     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 
 Class
diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixtureNew.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C
similarity index 74%
rename from applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixtureNew.C
rename to applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C
index 64abdb0ef4a295ca015eeedd24eb42cc455cd79f..f5d3f8c38bb2f32a4a762212532ffae141811e6e 100644
--- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixtureNew.C
+++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C
@@ -36,27 +36,30 @@ Foam::phaseChangeTwoPhaseMixture::New
     const word& alpha1Name
 )
 {
-    // get model name, but do not register the dictionary
-    const word mixtureType
+    IOdictionary transportPropertiesDict
     (
-        IOdictionary
+        IOobject
         (
-            IOobject
-            (
-                "transportProperties",
-                U.time().constant(),
-                U.db(),
-                IOobject::MUST_READ_IF_MODIFIED,
-                IOobject::NO_WRITE,
-                false
-            )
-        ).lookup("phaseChangeTwoPhaseMixture")
+            "transportProperties",
+            U.time().constant(),
+            U.db(),
+            IOobject::MUST_READ,
+            IOobject::NO_WRITE,
+            false
+        )
     );
 
-    Info<< "Selecting phaseChange model " << mixtureType << endl;
+    word phaseChangeTwoPhaseMixtureTypeName
+    (
+        transportPropertiesDict.lookup("phaseChangeTwoPhaseMixture")
+    );
+
+    Info<< "Selecting phaseChange model "
+        << phaseChangeTwoPhaseMixtureTypeName << endl;
 
     componentsConstructorTable::iterator cstrIter =
-        componentsConstructorTablePtr_->find(mixtureType);
+        componentsConstructorTablePtr_
+            ->find(phaseChangeTwoPhaseMixtureTypeName);
 
     if (cstrIter == componentsConstructorTablePtr_->end())
     {
@@ -64,8 +67,8 @@ Foam::phaseChangeTwoPhaseMixture::New
         (
             "phaseChangeTwoPhaseMixture::New"
         )   << "Unknown phaseChangeTwoPhaseMixture type "
-            << mixtureType << nl << nl
-            << "Valid phaseChangeTwoPhaseMixture types are : " << endl
+            << phaseChangeTwoPhaseMixtureTypeName << endl << endl
+            << "Valid  phaseChangeTwoPhaseMixtures are : " << endl
             << componentsConstructorTablePtr_->sortedToc()
             << exit(FatalError);
     }
diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.H b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.H
index c17d878ffdb43f36bb3c1ca137ce45220a3de05a..6dea8832da9465a5862b3b2f3af99dc857998d6b 100644
--- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.H
+++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.H
@@ -28,7 +28,7 @@ Description
 
 SourceFiles
     phaseChangeTwoPhaseMixture.C
-    phaseChangeModelNew.C
+    newPhaseChangeModel.C
 
 \*---------------------------------------------------------------------------*/
 
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/Allwclean b/applications/solvers/multiphase/multiphaseInterFoam/Allwclean
new file mode 100755
index 0000000000000000000000000000000000000000..6f55580c42a1139176cd44f717656c590537704f
--- /dev/null
+++ b/applications/solvers/multiphase/multiphaseInterFoam/Allwclean
@@ -0,0 +1,8 @@
+#!/bin/sh
+cd ${0%/*} || exit 1    # run from this directory
+set -x
+
+wclean
+wclean MRFMultiphaseInterFoam
+
+# ----------------------------------------------------------------- end-of-file
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/Allwmake b/applications/solvers/multiphase/multiphaseInterFoam/Allwmake
new file mode 100755
index 0000000000000000000000000000000000000000..6e47f91dd922f2e8ac52df6d835e0e8bc70ef55f
--- /dev/null
+++ b/applications/solvers/multiphase/multiphaseInterFoam/Allwmake
@@ -0,0 +1,9 @@
+#!/bin/sh
+cd ${0%/*} || exit 1    # run from this directory
+set -x
+
+wmake libso multiphaseMixture
+wmake
+wmake MRFMultiphaseInterFoam
+
+# ----------------------------------------------------------------- end-of-file
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/MRFMultiphaseInterFoam.C b/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/MRFMultiphaseInterFoam.C
new file mode 100644
index 0000000000000000000000000000000000000000..fee2292746a0f2989fef83651e98025ddfa8eccc
--- /dev/null
+++ b/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/MRFMultiphaseInterFoam.C
@@ -0,0 +1,99 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software: you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 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/>.
+
+Application
+    MRFMultiphaseInterFoam
+
+Description
+    Solver for n incompressible fluids which captures the interfaces and
+    includes surface-tension and contact-angle effects for each phase.
+
+    Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
+
+\*---------------------------------------------------------------------------*/
+
+#include "fvCFD.H"
+#include "multiphaseMixture.H"
+#include "turbulenceModel.H"
+#include "MRFZones.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+int main(int argc, char *argv[])
+{
+    #include "setRootCase.H"
+    #include "createTime.H"
+    #include "createMesh.H"
+    #include "readPISOControls.H"
+    #include "initContinuityErrs.H"
+    #include "createFields.H"
+    #include "createMRFZones.H"
+    #include "readTimeControls.H"
+    #include "correctPhi.H"
+    #include "CourantNo.H"
+    #include "setInitialDeltaT.H"
+
+    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+    Info<< "\nStarting time loop\n" << endl;
+
+    while (runTime.run())
+    {
+        #include "readPISOControls.H"
+        #include "readTimeControls.H"
+        #include "CourantNo.H"
+        #include "alphaCourantNo.H"
+        #include "setDeltaT.H"
+
+        runTime++;
+
+        Info<< "Time = " << runTime.timeName() << nl << endl;
+
+        mixture.solve();
+        rho = mixture.rho();
+        #include "zonePhaseVolumes.H"
+
+        #include "UEqn.H"
+
+        // --- PISO loop
+        for (int corr=0; corr<nCorr; corr++)
+        {
+            #include "pEqn.H"
+        }
+
+        turbulence->correct();
+
+        runTime.write();
+
+        Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
+            << "  ClockTime = " << runTime.elapsedClockTime() << " s"
+            << nl << endl;
+    }
+
+    Info<< "End\n" << endl;
+
+    return 0;
+}
+
+
+// ************************************************************************* //
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/Make/files b/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/Make/files
new file mode 100644
index 0000000000000000000000000000000000000000..c4ed7d3fc42d968535f30d60d095b1379424ea64
--- /dev/null
+++ b/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/Make/files
@@ -0,0 +1,3 @@
+MRFMultiphaseInterFoam.C
+
+EXE = $(FOAM_APPBIN)/MRFMultiphaseInterFoam
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/Make/options b/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/Make/options
new file mode 100644
index 0000000000000000000000000000000000000000..11e9aee8a52c5fd7f83efceaf8ca1e8ccaf7a4a9
--- /dev/null
+++ b/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/Make/options
@@ -0,0 +1,19 @@
+EXE_INC = \
+    -I.. \
+    -I../../interFoam \
+    -I../../interFoam/MRFInterFoam \
+    -I../multiphaseMixture/lnInclude \
+    -I$(LIB_SRC)/transportModels \
+    -I$(LIB_SRC)/transportModels/incompressible/lnInclude \
+    -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
+    -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
+    -I$(LIB_SRC)/finiteVolume/lnInclude
+
+EXE_LIBS = \
+    -lmultiphaseInterFoam \
+    -linterfaceProperties \
+    -lincompressibleTransportModels \
+    -lincompressibleTurbulenceModel \
+    -lincompressibleRASModels \
+    -lincompressibleLESModels \
+    -lfiniteVolume
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/UEqn.H b/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/UEqn.H
new file mode 100644
index 0000000000000000000000000000000000000000..b47e7111922fdca962813649538ff88c5e633789
--- /dev/null
+++ b/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/UEqn.H
@@ -0,0 +1,35 @@
+    surfaceScalarField muEff
+    (
+        "muEff",
+        mixture.muf()
+      + fvc::interpolate(rho*turbulence->nut())
+    );
+
+    fvVectorMatrix UEqn
+    (
+        fvm::ddt(rho, U)
+      + fvm::div(mixture.rhoPhi(), U)
+      - fvm::laplacian(muEff, U)
+      - (fvc::grad(U) & fvc::grad(muEff))
+    //- fvc::div(muEff*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf()))
+    );
+    mrfZones.addCoriolis(rho, UEqn);
+
+    UEqn.relax();
+
+    if (momentumPredictor)
+    {
+        solve
+        (
+            UEqn
+         ==
+            fvc::reconstruct
+            (
+                (
+                    mixture.surfaceTensionForce()
+                  - ghf*fvc::snGrad(rho)
+                  - fvc::snGrad(p_rgh)
+                ) * mesh.magSf()
+            )
+        );
+    }
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/pEqn.H b/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/pEqn.H
new file mode 100644
index 0000000000000000000000000000000000000000..3f59b6b3fca29006bbfde5ec4d146f947b1bea2a
--- /dev/null
+++ b/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/pEqn.H
@@ -0,0 +1,63 @@
+{
+    volScalarField rAU = 1.0/UEqn.A();
+    surfaceScalarField rAUf = fvc::interpolate(rAU);
+
+    U = rAU*UEqn.H();
+
+    surfaceScalarField phiU
+    (
+        "phiU",
+        (fvc::interpolate(U) & mesh.Sf())
+      //+ fvc::ddtPhiCorr(rAU, rho, U, phi)
+    );
+    mrfZones.relativeFlux(phiU);
+
+    adjustPhi(phiU, U, p_rgh);
+
+    phi = phiU +
+    (
+        mixture.surfaceTensionForce()
+      - ghf*fvc::snGrad(rho)
+    )*rAUf*mesh.magSf();
+
+    for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
+    {
+        fvScalarMatrix p_rghEqn
+        (
+            fvm::laplacian(rAUf, p_rgh) == fvc::div(phi)
+        );
+
+        p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
+
+        p_rghEqn.solve
+        (
+            mesh.solver
+            (
+                p_rgh.select(corr == nCorr-1 && nonOrth == nNonOrthCorr)
+            )
+        );
+
+        if (nonOrth == nNonOrthCorr)
+        {
+            phi -= p_rghEqn.flux();
+        }
+    }
+
+    U += rAU*fvc::reconstruct((phi - phiU)/rAUf);
+    U.correctBoundaryConditions();
+
+    #include "continuityErrs.H"
+
+    p == p_rgh + rho*gh;
+
+    if (p_rgh.needReference())
+    {
+        p += dimensionedScalar
+        (
+            "p",
+            p.dimensions(),
+            pRefValue - getRefCellValue(p, pRefCell)
+        );
+        p_rgh = p - rho*gh;
+    }
+}
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/zonePhaseVolumes.H b/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/zonePhaseVolumes.H
new file mode 100644
index 0000000000000000000000000000000000000000..0c5d12217b5a4df9420a27bd341057f17dc9c48f
--- /dev/null
+++ b/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/zonePhaseVolumes.H
@@ -0,0 +1,26 @@
+{
+    const scalarField& V = mesh.V();
+
+    forAll(mesh.cellZones(), czi)
+    {
+        const labelList& cellLabels = mesh.cellZones()[czi];
+
+        forAllConstIter(PtrDictionary<phase>, mixture.phases(), iter)
+        {
+            const volScalarField& alpha = iter();
+            scalar phaseVolume = 0;
+
+            forAll(cellLabels, cli)
+            {
+                label celli = cellLabels[cli];
+                phaseVolume += alpha[celli]*V[celli];
+            }
+
+            reduce(phaseVolume, sumOp<scalar>());
+
+            Info<< alpha.name()
+                << " phase volume in zone " << mesh.cellZones()[czi].name()
+                << " = " << phaseVolume*1e6 << " ml " << endl;
+        }
+    }
+}
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/Make/files b/applications/solvers/multiphase/multiphaseInterFoam/Make/files
index 4820de61a553d6ea05ce5e7acc09c7fdaf36737f..ded13878db099522449fdae018a324f9f16065fb 100644
--- a/applications/solvers/multiphase/multiphaseInterFoam/Make/files
+++ b/applications/solvers/multiphase/multiphaseInterFoam/Make/files
@@ -1,6 +1,3 @@
-multiphaseMixture/phase/phase.C
-multiphaseMixture/multiphaseAlphaContactAngle/multiphaseAlphaContactAngleFvPatchScalarField.C
-multiphaseMixture/multiphaseMixture.C
 multiphaseInterFoam.C
 
 EXE = $(FOAM_APPBIN)/multiphaseInterFoam
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/Make/options b/applications/solvers/multiphase/multiphaseInterFoam/Make/options
index 92c738c687ab920d649f0e16d222aeaa93928bff..022293a58fe2755a668ac229e466b8791c50ae5d 100644
--- a/applications/solvers/multiphase/multiphaseInterFoam/Make/options
+++ b/applications/solvers/multiphase/multiphaseInterFoam/Make/options
@@ -1,17 +1,17 @@
 EXE_INC = \
     -I../interFoam \
-    -ImultiphaseMixture \
-    -ImultiphaseMixture/phase \
-    -ImultiphaseMixture/multiphaseAlphaContactAngle \
+    -ImultiphaseMixture/lnInclude \
     -I$(LIB_SRC)/transportModels \
     -I$(LIB_SRC)/transportModels/incompressible/lnInclude \
+    -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
     -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
     -I$(LIB_SRC)/finiteVolume/lnInclude
 
 EXE_LIBS = \
+    -lmultiphaseInterFoam \
     -linterfaceProperties \
     -lincompressibleTransportModels \
     -lincompressibleTurbulenceModel \
     -lincompressibleRASModels \
     -lincompressibleLESModels \
-    -lfiniteVolume
\ No newline at end of file
+    -lfiniteVolume
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/UEqn.H b/applications/solvers/multiphase/multiphaseInterFoam/UEqn.H
index 17686b592c4750443414cec36260eaa98f1a3205..a2145bc0a2d1f95eaae85d0573202712db22112c 100644
--- a/applications/solvers/multiphase/multiphaseInterFoam/UEqn.H
+++ b/applications/solvers/multiphase/multiphaseInterFoam/UEqn.H
@@ -24,10 +24,10 @@
          ==
             fvc::reconstruct
             (
-                fvc::interpolate(rho)*(g & mesh.Sf())
-              + (
+                (
                     mixture.surfaceTensionForce()
-                  - fvc::snGrad(p)
+                  - ghf*fvc::snGrad(rho)
+                  - fvc::snGrad(p_rgh)
                 ) * mesh.magSf()
             )
         );
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/alphaCourantNo.H b/applications/solvers/multiphase/multiphaseInterFoam/alphaCourantNo.H
new file mode 100644
index 0000000000000000000000000000000000000000..50e64f5f51e5773d9f26cf0aa57e869f461b728f
--- /dev/null
+++ b/applications/solvers/multiphase/multiphaseInterFoam/alphaCourantNo.H
@@ -0,0 +1,56 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software: you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 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
+    CourantNo
+
+Description
+    Calculates and outputs the mean and maximum Courant Numbers.
+
+\*---------------------------------------------------------------------------*/
+
+scalar maxAlphaCo
+(
+    readScalar(runTime.controlDict().lookup("maxAlphaCo"))
+);
+
+scalar alphaCoNum = 0.0;
+scalar meanAlphaCoNum = 0.0;
+
+if (mesh.nInternalFaces())
+{
+    surfaceScalarField SfUfbyDelta =
+        mixture.nearInterface()
+       *mesh.surfaceInterpolation::deltaCoeffs()*mag(phi);
+
+    alphaCoNum = max(SfUfbyDelta/mesh.magSf())
+        .value()*runTime.deltaT().value();
+
+    meanAlphaCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
+        .value()*runTime.deltaT().value();
+}
+
+Info<< "Interface Courant Number mean: " << meanAlphaCoNum
+    << " max: " << alphaCoNum << endl;
+
+// ************************************************************************* //
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/createFields.H b/applications/solvers/multiphase/multiphaseInterFoam/createFields.H
index 6ef68821969fae9ec3e0009b25aed4e1c772c567..e3ebd1074377204b2b0dde0ead3381c02a6d1d4e 100644
--- a/applications/solvers/multiphase/multiphaseInterFoam/createFields.H
+++ b/applications/solvers/multiphase/multiphaseInterFoam/createFields.H
@@ -1,9 +1,9 @@
-    Info<< "Reading field p\n" << endl;
-    volScalarField p
+    Info<< "Reading field p_rgh\n" << endl;
+    volScalarField p_rgh
     (
         IOobject
         (
-            "p",
+            "p_rgh",
             runTime.timeName(),
             mesh,
             IOobject::MUST_READ,
@@ -45,13 +45,48 @@
     rho.oldTime();
 
 
-    label pRefCell = 0;
-    scalar pRefValue = 0.0;
-    setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
-
-
     // Construct incompressible turbulence model
     autoPtr<incompressible::turbulenceModel> turbulence
     (
         incompressible::turbulenceModel::New(U, phi, mixture)
     );
+
+    #include "readGravitationalAcceleration.H"
+
+    Info<< "Calculating field g.h\n" << endl;
+    volScalarField gh("gh", g & mesh.C());
+    surfaceScalarField ghf("ghf", g & mesh.Cf());
+
+    volScalarField p
+    (
+        IOobject
+        (
+            "p",
+            runTime.timeName(),
+            mesh,
+            IOobject::NO_READ,
+            IOobject::AUTO_WRITE
+        ),
+        p_rgh + rho*gh
+    );
+
+    label pRefCell = 0;
+    scalar pRefValue = 0.0;
+    setRefCell
+    (
+        p,
+        p_rgh,
+        mesh.solutionDict().subDict("PISO"),
+        pRefCell,
+        pRefValue
+    );
+
+    if (p_rgh.needReference())
+    {
+        p += dimensionedScalar
+        (
+            "p",
+            p.dimensions(),
+            pRefValue - getRefCellValue(p, pRefCell)
+        );
+    }
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterFoam.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterFoam.C
index 357835289ee9ff2dff4e8487f5cde3dcbd8d5e5c..39a1761574e829d3965a596d206c4aa6630628ec 100644
--- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterFoam.C
+++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterFoam.C
@@ -43,7 +43,6 @@ int main(int argc, char *argv[])
     #include "setRootCase.H"
     #include "createTime.H"
     #include "createMesh.H"
-    #include "readGravitationalAcceleration.H"
     #include "readPISOControls.H"
     #include "initContinuityErrs.H"
     #include "createFields.H"
@@ -61,13 +60,14 @@ int main(int argc, char *argv[])
         #include "readPISOControls.H"
         #include "readTimeControls.H"
         #include "CourantNo.H"
+        #include "alphaCourantNo.H"
         #include "setDeltaT.H"
 
         runTime++;
 
         Info<< "Time = " << runTime.timeName() << nl << endl;
 
-        mixture.correct();
+        mixture.solve();
         rho = mixture.rho();
 
         #include "UEqn.H"
@@ -78,18 +78,16 @@ int main(int argc, char *argv[])
             #include "pEqn.H"
         }
 
-        #include "continuityErrs.H"
-
-        //turbulence->correct();
+        turbulence->correct();
 
         runTime.write();
 
-        Info<< "ExecutionTime = "
-            << runTime.elapsedCpuTime()
-            << " s\n" << endl << endl;
+        Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
+            << "  ClockTime = " << runTime.elapsedClockTime() << " s"
+            << nl << endl;
     }
 
-    Info<< "\n end \n";
+    Info<< "End\n" << endl;
 
     return 0;
 }
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/Make/files b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/Make/files
new file mode 100644
index 0000000000000000000000000000000000000000..5912ebaf0ec88a7e4da9cd07dcc66798250b97d7
--- /dev/null
+++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/Make/files
@@ -0,0 +1,5 @@
+phase/phase.C
+alphaContactAngle/alphaContactAngleFvPatchScalarField.C
+multiphaseMixture.C
+
+LIB = $(FOAM_LIBBIN)/libmultiphaseInterFoam
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/Make/options b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/Make/options
new file mode 100644
index 0000000000000000000000000000000000000000..52e2caf9d74a712a7e38b6a0c62610a0f90a15dc
--- /dev/null
+++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/Make/options
@@ -0,0 +1,11 @@
+EXE_INC = \
+    -IalphaContactAngle \
+    -I$(LIB_SRC)/transportModels \
+    -I$(LIB_SRC)/transportModels/incompressible/lnInclude \
+    -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
+    -I$(LIB_SRC)/finiteVolume/lnInclude
+
+EXE_LIBS = \
+    -linterfaceProperties \
+    -lincompressibleTransportModels \
+    -lfiniteVolume
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseAlphaContactAngle/multiphaseAlphaContactAngleFvPatchScalarField.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C
similarity index 74%
rename from applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseAlphaContactAngle/multiphaseAlphaContactAngleFvPatchScalarField.C
rename to applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C
index be18ee1ec6a08776631933eff0cdf12b43bca77f..6256b1cebfe7cdd02395cf1638237c628c8f48e8 100644
--- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseAlphaContactAngle/multiphaseAlphaContactAngleFvPatchScalarField.C
+++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C
@@ -23,7 +23,7 @@ License
 
 \*---------------------------------------------------------------------------*/
 
-#include "multiphaseAlphaContactAngleFvPatchScalarField.H"
+#include "alphaContactAngleFvPatchScalarField.H"
 #include "addToRunTimeSelectionTable.H"
 #include "fvPatchFieldMapper.H"
 
@@ -32,8 +32,7 @@ License
 namespace Foam
 {
 
-multiphaseAlphaContactAngleFvPatchScalarField::interfaceThetaProps::
-interfaceThetaProps
+alphaContactAngleFvPatchScalarField::interfaceThetaProps::interfaceThetaProps
 (
     Istream& is
 )
@@ -48,10 +47,10 @@ interfaceThetaProps
 Istream& operator>>
 (
     Istream& is,
-    multiphaseAlphaContactAngleFvPatchScalarField::interfaceThetaProps& tp
+    alphaContactAngleFvPatchScalarField::interfaceThetaProps& tp
 )
 {
-    is  >> tp.theta0_ >> tp.uTheta_ >> tp.thetaA_ >> tp.thetaR_;
+    is >> tp.theta0_ >> tp.uTheta_ >> tp.thetaA_ >> tp.thetaR_;
     return is;
 }
 
@@ -59,7 +58,7 @@ Istream& operator>>
 Ostream& operator<<
 (
     Ostream& os,
-    const multiphaseAlphaContactAngleFvPatchScalarField::interfaceThetaProps& tp
+    const alphaContactAngleFvPatchScalarField::interfaceThetaProps& tp
 )
 {
     os  << tp.theta0_ << token::SPACE
@@ -73,8 +72,7 @@ Ostream& operator<<
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
-multiphaseAlphaContactAngleFvPatchScalarField::
-multiphaseAlphaContactAngleFvPatchScalarField
+alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
 (
     const fvPatch& p,
     const DimensionedField<scalar, volMesh>& iF
@@ -84,10 +82,9 @@ multiphaseAlphaContactAngleFvPatchScalarField
 {}
 
 
-multiphaseAlphaContactAngleFvPatchScalarField::
-multiphaseAlphaContactAngleFvPatchScalarField
+alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
 (
-    const multiphaseAlphaContactAngleFvPatchScalarField& gcpsf,
+    const alphaContactAngleFvPatchScalarField& gcpsf,
     const fvPatch& p,
     const DimensionedField<scalar, volMesh>& iF,
     const fvPatchFieldMapper& mapper
@@ -98,8 +95,7 @@ multiphaseAlphaContactAngleFvPatchScalarField
 {}
 
 
-multiphaseAlphaContactAngleFvPatchScalarField::
-multiphaseAlphaContactAngleFvPatchScalarField
+alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
 (
     const fvPatch& p,
     const DimensionedField<scalar, volMesh>& iF,
@@ -113,10 +109,9 @@ multiphaseAlphaContactAngleFvPatchScalarField
 }
 
 
-multiphaseAlphaContactAngleFvPatchScalarField::
-multiphaseAlphaContactAngleFvPatchScalarField
+alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
 (
-    const multiphaseAlphaContactAngleFvPatchScalarField& gcpsf,
+    const alphaContactAngleFvPatchScalarField& gcpsf,
     const DimensionedField<scalar, volMesh>& iF
 )
 :
@@ -127,7 +122,7 @@ multiphaseAlphaContactAngleFvPatchScalarField
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
-void multiphaseAlphaContactAngleFvPatchScalarField::write(Ostream& os) const
+void alphaContactAngleFvPatchScalarField::write(Ostream& os) const
 {
     fvPatchScalarField::write(os);
     os.writeKeyword("thetaProperties")
@@ -138,11 +133,7 @@ void multiphaseAlphaContactAngleFvPatchScalarField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makePatchTypeField
-(
-    fvPatchScalarField,
-    multiphaseAlphaContactAngleFvPatchScalarField
-);
+makePatchTypeField(fvPatchScalarField, alphaContactAngleFvPatchScalarField);
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseAlphaContactAngle/multiphaseAlphaContactAngleFvPatchScalarField.H b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.H
similarity index 83%
rename from applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseAlphaContactAngle/multiphaseAlphaContactAngleFvPatchScalarField.H
rename to applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.H
index 32f5c3a4ebc57700fa8ef93a046987a423e5d33f..f7c75c9147a1f784d67899f6e65ee1a80f2da737 100644
--- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseAlphaContactAngle/multiphaseAlphaContactAngleFvPatchScalarField.H
+++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.H
@@ -22,19 +22,19 @@ License
     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 
 Class
-    Foam::multiphaseAlphaContactAngleFvPatchScalarField
+    Foam::alphaContactAngleFvPatchScalarField
 
 Description
     Contact-angle boundary condition for multi-phase interface-capturing
     simulations.  Used in conjuction with multiphaseMixture.
 
 SourceFiles
-    multiphaseAlphaContactAngleFvPatchScalarField.C
+    alphaContactAngleFvPatchScalarField.C
 
 \*---------------------------------------------------------------------------*/
 
-#ifndef multiphaseAlphaContactAngleFvPatchScalarField_H
-#define multiphaseAlphaContactAngleFvPatchScalarField_H
+#ifndef alphaContactAngleFvPatchScalarField_H
+#define alphaContactAngleFvPatchScalarField_H
 
 #include "zeroGradientFvPatchFields.H"
 #include "multiphaseMixture.H"
@@ -45,10 +45,10 @@ namespace Foam
 {
 
 /*---------------------------------------------------------------------------*\
-                           Class multiphaseAlphaContactAngleFvPatch Declaration
+                           Class alphaContactAngleFvPatch Declaration
 \*---------------------------------------------------------------------------*/
 
-class multiphaseAlphaContactAngleFvPatchScalarField
+class alphaContactAngleFvPatchScalarField
 :
     public zeroGradientFvPatchScalarField
 {
@@ -132,32 +132,31 @@ private:
 public:
 
     //- Runtime type information
-    TypeName("multiphaseAlphaContactAngle");
+    TypeName("alphaContactAngle");
 
 
     // Constructors
 
         //- Construct from patch and internal field
-        multiphaseAlphaContactAngleFvPatchScalarField
+        alphaContactAngleFvPatchScalarField
         (
             const fvPatch&,
             const DimensionedField<scalar, volMesh>&
         );
 
         //- Construct from patch, internal field and dictionary
-        multiphaseAlphaContactAngleFvPatchScalarField
+        alphaContactAngleFvPatchScalarField
         (
             const fvPatch&,
             const DimensionedField<scalar, volMesh>&,
             const dictionary&
         );
 
-        //- Construct by mapping given
-        //  multiphaseAlphaContactAngleFvPatchScalarField onto a new
-        //  patch
-        multiphaseAlphaContactAngleFvPatchScalarField
+        //- Construct by mapping given alphaContactAngleFvPatchScalarField
+        //  onto a new patch
+        alphaContactAngleFvPatchScalarField
         (
-            const multiphaseAlphaContactAngleFvPatchScalarField&,
+            const alphaContactAngleFvPatchScalarField&,
             const fvPatch&,
             const DimensionedField<scalar, volMesh>&,
             const fvPatchFieldMapper&
@@ -168,14 +167,14 @@ public:
         {
             return tmp<fvPatchScalarField>
             (
-                new multiphaseAlphaContactAngleFvPatchScalarField(*this)
+                new alphaContactAngleFvPatchScalarField(*this)
             );
         }
 
         //- Construct as copy setting internal field reference
-        multiphaseAlphaContactAngleFvPatchScalarField
+        alphaContactAngleFvPatchScalarField
         (
-            const multiphaseAlphaContactAngleFvPatchScalarField&,
+            const alphaContactAngleFvPatchScalarField&,
             const DimensionedField<scalar, volMesh>&
         );
 
@@ -187,7 +186,7 @@ public:
         {
             return tmp<fvPatchScalarField>
             (
-                new multiphaseAlphaContactAngleFvPatchScalarField(*this, iF)
+                new alphaContactAngleFvPatchScalarField(*this, iF)
             );
         }
 
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C
index a4b4de1c4387aa56dfa69e82692f3b86b5a316df..c0582b5c1392ecebd87a2c614e03813fe0add90b 100644
--- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C
+++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C
@@ -24,11 +24,10 @@ License
 \*---------------------------------------------------------------------------*/
 
 #include "multiphaseMixture.H"
-#include "multiphaseAlphaContactAngleFvPatchScalarField.H"
+#include "alphaContactAngleFvPatchScalarField.H"
 #include "Time.H"
 #include "subCycle.H"
 #include "fvCFD.H"
-#include "mathematicalConstants.H"
 
 // * * * * * * * * * * * * * * * Static Member Data  * * * * * * * * * * * * //
 
@@ -237,7 +236,7 @@ Foam::multiphaseMixture::surfaceTensionForce() const
 }
 
 
-void Foam::multiphaseMixture::correct()
+void Foam::multiphaseMixture::solve()
 {
     forAllIter(PtrDictionary<phase>, phases_, iter)
     {
@@ -296,6 +295,10 @@ void Foam::multiphaseMixture::correct()
 }
 
 
+void Foam::multiphaseMixture::correct()
+{}
+
+
 Foam::tmp<Foam::surfaceVectorField> Foam::multiphaseMixture::nHatfv
 (
     const volScalarField& alpha1,
@@ -351,11 +354,10 @@ void Foam::multiphaseMixture::correctContactAngle
 
     forAll(boundary, patchi)
     {
-        if (isA<multiphaseAlphaContactAngleFvPatchScalarField>(gbf[patchi]))
+        if (isA<alphaContactAngleFvPatchScalarField>(gbf[patchi]))
         {
-            const multiphaseAlphaContactAngleFvPatchScalarField& acap =
-                refCast<const multiphaseAlphaContactAngleFvPatchScalarField>
-                (gbf[patchi]);
+            const alphaContactAngleFvPatchScalarField& acap =
+                refCast<const alphaContactAngleFvPatchScalarField>(gbf[patchi]);
 
             vectorField& nHatPatch = nHatb[patchi];
 
@@ -363,7 +365,7 @@ void Foam::multiphaseMixture::correctContactAngle
                 mesh_.Sf().boundaryField()[patchi]
                /mesh_.magSf().boundaryField()[patchi];
 
-            multiphaseAlphaContactAngleFvPatchScalarField::thetaPropsTable::
+            alphaContactAngleFvPatchScalarField::thetaPropsTable::
                 const_iterator tp =
                 acap.thetaProps().find(interfacePair(alpha1, alpha2));
 
@@ -455,6 +457,34 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseMixture::K
 }
 
 
+Foam::tmp<Foam::surfaceScalarField>
+Foam::multiphaseMixture::nearInterface() const
+{
+    tmp<surfaceScalarField> tnearInt
+    (
+        new surfaceScalarField
+        (
+            IOobject
+            (
+                "nearInterface",
+                mesh_.time().timeName(),
+                mesh_
+            ),
+            mesh_,
+            dimensionedScalar("nearInterface", dimless, 0.0)
+        )
+    );
+
+    forAllConstIter(PtrDictionary<phase>, phases_, iter)
+    {
+        surfaceScalarField alphaf = fvc::interpolate(iter());
+        tnearInt() = max(tnearInt(), pos(alphaf - 0.01)*pos(0.99 - alphaf));
+    }
+
+    return tnearInt;
+}
+
+
 void Foam::multiphaseMixture::solveAlphas
 (
     const label nAlphaCorr,
@@ -466,7 +496,7 @@ void Foam::multiphaseMixture::solveAlphas
     nSolves++;
 
     word alphaScheme("div(phi,alpha)");
-    word alphacScheme("div(phic,alpha)");
+    word alphacScheme("div(phirb,alpha)");
 
     tmp<fv::convectionScheme<scalar> > mvConvection
     (
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H
index c553b76fcaf981f53dfccc8eb4d5cd75ba48f071..32a7f1011801caee40772f080cac21eb975d0ea9 100644
--- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H
+++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H
@@ -164,7 +164,7 @@ private:
         multivariateSurfaceInterpolationScheme<scalar>::fieldTable alphaTable_;
 
 
-    // Private Member Functions
+    // Private member functions
 
         void calcAlphas();
 
@@ -256,6 +256,13 @@ public:
 
         tmp<surfaceScalarField> surfaceTensionForce() const;
 
+        //- Indicator of the proximity of the interface
+        //  Field values are 1 near and 0 away for the interface.
+        tmp<surfaceScalarField> nearInterface() const;
+
+        //- Solve for the mixture phase-fractions
+        void solve();
+
         //- Correct the mixture properties
         void correct();
 
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/pEqn.H b/applications/solvers/multiphase/multiphaseInterFoam/pEqn.H
index 7e9f30c01c01b1091c5e2a02e0af88718e5f1a48..c06b843d8b37d62e10806cff8ea620e2e35443ca 100644
--- a/applications/solvers/multiphase/multiphaseInterFoam/pEqn.H
+++ b/applications/solvers/multiphase/multiphaseInterFoam/pEqn.H
@@ -1,47 +1,62 @@
 {
-    volScalarField rUA = 1.0/UEqn.A();
-    surfaceScalarField rUAf = fvc::interpolate(rUA);
+    volScalarField rAU = 1.0/UEqn.A();
+    surfaceScalarField rAUf = fvc::interpolate(rAU);
 
-    U = rUA*UEqn.H();
+    U = rAU*UEqn.H();
 
     surfaceScalarField phiU
     (
         "phiU",
-        (fvc::interpolate(U) & mesh.Sf()) + fvc::ddtPhiCorr(rUA, rho, U, phi)
+        (fvc::interpolate(U) & mesh.Sf())
+      + fvc::ddtPhiCorr(rAU, rho, U, phi)
     );
 
-    adjustPhi(phiU, U, p);
+    adjustPhi(phiU, U, p_rgh);
 
     phi = phiU +
-        (
-            mixture.surfaceTensionForce()*mesh.magSf()
-          + fvc::interpolate(rho)*(g & mesh.Sf())
-        )*rUAf;
+    (
+        mixture.surfaceTensionForce()
+      - ghf*fvc::snGrad(rho)
+    )*rAUf*mesh.magSf();
 
     for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
     {
-        fvScalarMatrix pEqn
+        fvScalarMatrix p_rghEqn
         (
-            fvm::laplacian(rUAf, p) == fvc::div(phi)
+            fvm::laplacian(rAUf, p_rgh) == fvc::div(phi)
         );
 
-        pEqn.setReference(pRefCell, pRefValue);
+        p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
 
-        if (corr == nCorr-1)
-        {
-            pEqn.solve(mesh.solver(p.name() + "Final"));
-        }
-        else
-        {
-            pEqn.solve(mesh.solver(p.name()));
-        }
+        p_rghEqn.solve
+        (
+            mesh.solver
+            (
+                p_rgh.select(corr == nCorr-1 && nonOrth == nNonOrthCorr)
+            )
+        );
 
         if (nonOrth == nNonOrthCorr)
         {
-            phi -= pEqn.flux();
+            phi -= p_rghEqn.flux();
         }
     }
 
-    U += rUA*fvc::reconstruct((phi - phiU)/rUAf);
+    U += rAU*fvc::reconstruct((phi - phiU)/rAUf);
     U.correctBoundaryConditions();
+
+    #include "continuityErrs.H"
+
+    p == p_rgh + rho*gh;
+
+    if (p_rgh.needReference())
+    {
+        p += dimensionedScalar
+        (
+            "p",
+            p.dimensions(),
+            pRefValue - getRefCellValue(p, pRefCell)
+        );
+        p_rgh = p - rho*gh;
+    }
 }
diff --git a/applications/solvers/multiphase/settlingFoam/UEqn.H b/applications/solvers/multiphase/settlingFoam/UEqn.H
index 390eeb05023cf76f8869339660f94ea4e15adb21..cd3985b364d286b46c295125d817a2aa64740dda 100644
--- a/applications/solvers/multiphase/settlingFoam/UEqn.H
+++ b/applications/solvers/multiphase/settlingFoam/UEqn.H
@@ -22,7 +22,10 @@
           ==
             fvc::reconstruct
             (
-                (- ghf*fvc::snGrad(rho) - fvc::snGrad(pmh))*mesh.magSf()
+                (
+                  - ghf*fvc::snGrad(rho)
+                  - fvc::snGrad(p_rgh)
+                )*mesh.magSf()
             )
         );
     }
diff --git a/applications/solvers/multiphase/settlingFoam/createFields.H b/applications/solvers/multiphase/settlingFoam/createFields.H
index a2a5707b9eb8f063d0034587f3cbe5d7ee711c19..cfa2e9fd384c62b2271a6b7bdaec58db2b07dc5a 100644
--- a/applications/solvers/multiphase/settlingFoam/createFields.H
+++ b/applications/solvers/multiphase/settlingFoam/createFields.H
@@ -1,9 +1,9 @@
-    Info<< "Reading field pmh\n" << endl;
-    volScalarField pmh
+    Info<< "Reading field p_rgh\n" << endl;
+    volScalarField p_rgh
     (
         IOobject
         (
-            "pmh",
+            "p_rgh",
             runTime.timeName(),
             mesh,
             IOobject::MUST_READ,
@@ -357,32 +357,27 @@
             IOobject::NO_READ,
             IOobject::AUTO_WRITE
         ),
-        pmh + rho*gh
+        p_rgh + rho*gh
     );
 
-    label pmhRefCell = 0;
-    scalar pmhRefValue = 0.0;
+    label pRefCell = 0;
+    scalar pRefValue = 0.0;
     setRefCell
     (
-        pmh,
+        p,
+        p_rgh,
         mesh.solutionDict().subDict("PISO"),
-        pmhRefCell,
-        pmhRefValue
+        pRefCell,
+        pRefValue
     );
 
-    scalar pRefValue = 0.0;
-
-    if (pmh.needReference())
+    if (p_rgh.needReference())
     {
-        pRefValue = readScalar
-        (
-            mesh.solutionDict().subDict("PISO").lookup("pRefValue")
-        );
-
         p += dimensionedScalar
         (
             "p",
             p.dimensions(),
-            pRefValue - getRefCellValue(p, pmhRefCell)
+            pRefValue - getRefCellValue(p, pRefCell)
         );
+        p_rgh = p - rho*gh;
     }
diff --git a/applications/solvers/multiphase/settlingFoam/kEpsilon.H b/applications/solvers/multiphase/settlingFoam/kEpsilon.H
index e27594ffed49a1d5b4804a6be73d0864a0c9e965..2262ba3dbc2387866ea3b19ddf3756508986c874 100644
--- a/applications/solvers/multiphase/settlingFoam/kEpsilon.H
+++ b/applications/solvers/multiphase/settlingFoam/kEpsilon.H
@@ -44,8 +44,7 @@ if (turbulence)
 
 
     // Turbulent kinetic energy equation
-
-    solve
+    fvScalarMatrix kEqn
     (
         fvm::ddt(rho, k)
       + fvm::div(phi, k)
@@ -60,7 +59,8 @@ if (turbulence)
       - fvm::Sp(rho*epsilon/k, k)
     );
 
-    //FIXME: why no kEqn.relax()?
+    kEqn.relax();
+    kEqn.solve();
 
     bound(k, kMin);
 
diff --git a/applications/solvers/multiphase/settlingFoam/pEqn.H b/applications/solvers/multiphase/settlingFoam/pEqn.H
index 77bb0f45924a76e91afb6a146011adfe10abaafb..3d1e6816d732609944e431e06d8355c4a0ae7a32 100644
--- a/applications/solvers/multiphase/settlingFoam/pEqn.H
+++ b/applications/solvers/multiphase/settlingFoam/pEqn.H
@@ -15,24 +15,37 @@ phi =
     );
 
 surfaceScalarField phiU("phiU", phi);
-phi += fvc::interpolate(rho)*(g & mesh.Sf())*rUAf;
+phi -= ghf*fvc::snGrad(rho)*rUAf*mesh.magSf();
 
 for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
 {
-    fvScalarMatrix pEqn
+    fvScalarMatrix p_rghEqn
     (
-        fvm::laplacian(rUAf, p) == fvc::ddt(rho) + fvc::div(phi)
+        fvm::laplacian(rUAf, p_rgh) == fvc::ddt(rho) + fvc::div(phi)
     );
 
-    pEqn.setReference(pRefCell, pRefValue);
-    pEqn.solve();
+    p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
+    p_rghEqn.solve();
 
     if (nonOrth == nNonOrthCorr)
     {
-        phi -= pEqn.flux();
+        phi -= p_rghEqn.flux();
     }
 }
 
+p == p_rgh + rho*gh;
+
+if (p_rgh.needReference())
+{
+    p += dimensionedScalar
+    (
+        "p",
+        p.dimensions(),
+        pRefValue - getRefCellValue(p, pRefCell)
+    );
+    p_rgh = p - rho*gh;
+}
+
 #include "rhoEqn.H"
 #include "compressibleContinuityErrs.H"
 
diff --git a/applications/solvers/multiphase/settlingFoam/pmhEqn.H b/applications/solvers/multiphase/settlingFoam/pmhEqn.H
deleted file mode 100644
index 642479b8d0374fe3945d790bbbbe0cf6504f7cf6..0000000000000000000000000000000000000000
--- a/applications/solvers/multiphase/settlingFoam/pmhEqn.H
+++ /dev/null
@@ -1,52 +0,0 @@
-volScalarField rUA = 1.0/UEqn.A();
-
-surfaceScalarField rUAf
-(
-    "(rho*(1|A(U)))",
-    fvc::interpolate(rho)*fvc::interpolate(rUA)
-);
-
-U = rUA*UEqn.H();
-phi =
-    fvc::interpolate(rho)
-   *(
-       (fvc::interpolate(U) & mesh.Sf())
-     + fvc::ddtPhiCorr(rUA, rho, U, phi)
-    );
-
-surfaceScalarField phiU("phiU", phi);
-phi -= ghf*fvc::snGrad(rho)*rUAf*mesh.magSf();
-
-for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
-{
-    fvScalarMatrix pmhEqn
-    (
-        fvm::laplacian(rUAf, pmh) == fvc::ddt(rho) + fvc::div(phi)
-    );
-
-    pmhEqn.setReference(pmhRefCell, pmhRefValue);
-    pmhEqn.solve();
-
-    if (nonOrth == nNonOrthCorr)
-    {
-        phi -= pmhEqn.flux();
-    }
-}
-
-p == pmh + rho*gh;
-
-if (pmh.needReference())
-{
-    p += dimensionedScalar
-    (
-        "p",
-        p.dimensions(),
-        pRefValue - getRefCellValue(p, pmhRefCell)
-    );
-}
-
-#include "rhoEqn.H"
-#include "compressibleContinuityErrs.H"
-
-U += rUA*fvc::reconstruct((phi - phiU)/rUAf);
-U.correctBoundaryConditions();
diff --git a/applications/solvers/multiphase/settlingFoam/settlingFoam.C b/applications/solvers/multiphase/settlingFoam/settlingFoam.C
index 45706cf782242677a6198959f9511ce4fdc6b55a..26b648a650e3d926d90cbcfdebc6ec9a919c5457 100644
--- a/applications/solvers/multiphase/settlingFoam/settlingFoam.C
+++ b/applications/solvers/multiphase/settlingFoam/settlingFoam.C
@@ -76,7 +76,7 @@ int main(int argc, char *argv[])
             // --- PISO loop
             for (int corr=0; corr<nCorr; corr++)
             {
-                #include "pmhEqn.H"
+                #include "pEqn.H"
             }
 
             #include "kEpsilon.H"
diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options b/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options
index 93098736927e4d08efde0cb169499b1dedca1cec..c8ce69c074b6f87f924a391ae8778b3f19e946ee 100644
--- a/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options
+++ b/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options
@@ -6,7 +6,7 @@ EXE_INC = \
     -I$(LIB_SRC)/finiteVolume/lnInclude
 
 EXE_LIBS = \
-    -linterfaceProperties \
+    -ltwoPhaseInterfaceProperties \
     -lincompressibleTransportModels \
     -lincompressibleTurbulenceModel \
     -lincompressibleRASModels \
diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/UEqn.H b/applications/solvers/multiphase/twoLiquidMixingFoam/UEqn.H
index ed0fbf776cd224705c9085ea503f1fe2a9fa5383..5d9a317e0868b881e0e8ab06b30821b991377be2 100644
--- a/applications/solvers/multiphase/twoLiquidMixingFoam/UEqn.H
+++ b/applications/solvers/multiphase/twoLiquidMixingFoam/UEqn.H
@@ -12,7 +12,6 @@
       - fvm::laplacian(muEff, U)
       - (fvc::grad(U) & fvc::grad(muEff))
     //- fvc::div(muEff*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf()))
-    //- fvc::div(rho*turbulence->nuEff()*dev(fvc::grad(U)().T()))
     );
 
     UEqn.relax();
@@ -25,8 +24,10 @@
          ==
             fvc::reconstruct
             (
-                fvc::interpolate(rho)*(g & mesh.Sf())
-              - mesh.magSf()*fvc::snGrad(p)
+                (
+                  - ghf*fvc::snGrad(rho)
+                  - fvc::snGrad(p_rgh)
+                ) * mesh.magSf()
             )
         );
     }
diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H b/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H
index 8194753c8fca0674fc224b189f88851e4cb24d34..d152baba0bb44a1f2cd042596f94030157e0f713 100644
--- a/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H
+++ b/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H
@@ -3,7 +3,6 @@
     (
         fvm::ddt(alpha1)
       + fvm::div(phi, alpha1)
-      //- fvm::Sp(fvc::div(phi), alpha1)
       - fvm::laplacian
         (
             Dab + alphatab*turbulence->nut(), alpha1,
diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H b/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H
index b94bf6c23e65cb80f5557f2bccd1ecd8e4c23946..73af502ce2bc521d8c7d3cdb43d58f1cba4e56ea 100644
--- a/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H
+++ b/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H
@@ -1,9 +1,9 @@
-    Info<< "Reading field p\n" << endl;
-    volScalarField p
+    Info<< "Reading field p_rgh\n" << endl;
+    volScalarField p_rgh
     (
         IOobject
         (
-            "p",
+            "p_rgh",
             runTime.timeName(),
             mesh,
             IOobject::MUST_READ,
@@ -74,14 +74,47 @@
         rho1*phi
     );
 
-
-    label pRefCell = 0;
-    scalar pRefValue = 0.0;
-    setRefCell(p, mesh.solutionDict().subDict("PIMPLE"), pRefCell, pRefValue);
-
-
     // Construct incompressible turbulence model
     autoPtr<incompressible::turbulenceModel> turbulence
     (
         incompressible::turbulenceModel::New(U, phi, twoPhaseProperties)
     );
+
+    Info<< "Calculating field g.h\n" << endl;
+    volScalarField gh("gh", g & mesh.C());
+    surfaceScalarField ghf("ghf", g & mesh.Cf());
+
+    volScalarField p
+    (
+        IOobject
+        (
+            "p",
+            runTime.timeName(),
+            mesh,
+            IOobject::NO_READ,
+            IOobject::AUTO_WRITE
+        ),
+        p_rgh + rho*gh
+    );
+
+    label pRefCell = 0;
+    scalar pRefValue = 0.0;
+    setRefCell
+    (
+        p,
+        p_rgh,
+        mesh.solutionDict().subDict("PIMPLE"),
+        pRefCell,
+        pRefValue
+    );
+
+    if (p_rgh.needReference())
+    {
+        p += dimensionedScalar
+        (
+            "p",
+            p.dimensions(),
+            pRefValue - getRefCellValue(p, pRefCell)
+        );
+        p_rgh = p - rho*gh;
+    }
diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H b/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H
index 25003e1b25330346e33dad7d98da2790e88b4eda..ca11063449ca8ee3b44fb683a87995ce676c3846 100644
--- a/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H
+++ b/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H
@@ -1,48 +1,62 @@
 {
-    volScalarField rUA = 1.0/UEqn.A();
-    surfaceScalarField rUAf = fvc::interpolate(rUA);
-
-    U = rUA*UEqn.H();
+    volScalarField rAU = 1.0/UEqn.A();
+    surfaceScalarField rAUf = fvc::interpolate(rAU);
 
+    U = rAU*UEqn.H();
     surfaceScalarField phiU
     (
         "phiU",
         (fvc::interpolate(U) & mesh.Sf())
-      + fvc::ddtPhiCorr(rUA, rho, U, phi)
+      + fvc::ddtPhiCorr(rAU, rho, U, phi)
     );
 
-    phi = phiU + fvc::interpolate(rho)*(g & mesh.Sf())*rUAf;
+    adjustPhi(phiU, U, p_rgh);
+
+    phi = phiU - ghf*fvc::snGrad(rho)*rAUf*mesh.magSf();
 
     for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
     {
-        fvScalarMatrix pEqn
+        fvScalarMatrix p_rghEqn
         (
-            fvm::laplacian(rUAf, p) == fvc::div(phi)
+            fvm::laplacian(rAUf, p_rgh) == fvc::div(phi)
         );
 
-        pEqn.setReference(pRefCell, pRefValue);
+        p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
 
-        pEqn.solve
+        p_rghEqn.solve
         (
             mesh.solver
             (
-                p.select
+                p_rgh.select
                 (
-                    (
-                        finalIter
-                     && corr == nCorr-1
-                     && nonOrth == nNonOrthCorr
-                    )
+                    finalIter
+                 && corr == nCorr-1
+                 && nonOrth == nNonOrthCorr
                 )
             )
         );
 
         if (nonOrth == nNonOrthCorr)
         {
-            phi -= pEqn.flux();
+            phi -= p_rghEqn.flux();
         }
     }
 
-    U += rUA*fvc::reconstruct((phi - phiU)/rUAf);
+    U += rAU*fvc::reconstruct((phi - phiU)/rAUf);
     U.correctBoundaryConditions();
+
+    #include "continuityErrs.H"
+
+    p == p_rgh + rho*gh;
+
+    if (p_rgh.needReference())
+    {
+        p += dimensionedScalar
+        (
+            "p",
+            p.dimensions(),
+            pRefValue - getRefCellValue(p, pRefCell)
+        );
+        p_rgh = p - rho*gh;
+    }
 }
diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C b/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C
index d776311d4c2f67431a946eae36e65d0797d52c84..8d626930c43da34f9311ab189321c45a423c86fa 100644
--- a/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C
+++ b/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C
@@ -86,8 +86,6 @@ int main(int argc, char *argv[])
                 #include "pEqn.H"
             }
 
-            #include "continuityErrs.H"
-
             turbulence->correct();
 
             if (finalIter)
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/CourantNos.H b/applications/solvers/multiphase/twoPhaseEulerFoam/CourantNos.H
index f18461d66aac1342e5fe8b966520413f0f372b56..75dcd68c7fbde8e856b00651af8b22b3fbeb624a 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/CourantNos.H
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/CourantNos.H
@@ -5,7 +5,7 @@
     (
         mesh.surfaceInterpolation::deltaCoeffs()*mag(phia - phib)
        /mesh.magSf()
-    ).value()*runTime.deltaTValue();
+    ).value()*runTime.deltaT().value();
 
     Info<< "Max Ur Courant Number = " << UrCoNum << endl;
 
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/UEqns.H b/applications/solvers/multiphase/twoPhaseEulerFoam/UEqns.H
index c32855904a88b0e73cfb756a1218300293c3004b..6eb2fe8850b3e66016a7ea13e37b29c26448e93d 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/UEqns.H
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/UEqns.H
@@ -21,7 +21,6 @@ fvVectorMatrix UbEqn(Ub, Ub.dimensions()*dimVol/dimTime);
             ((2.0/3.0)*I)*(sqr(Ct)*k + nuEffa*tr(gradUaT)) - nuEffa*gradUaT
         );
 
-
         if (kineticTheory.on())
         {
             Rca -= ((kineticTheory.lambda()/rhoa)*tr(gradUaT))*tensor(I);
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/createFields.H b/applications/solvers/multiphase/twoPhaseEulerFoam/createFields.H
index 65761d9ec9b69c4f2889f01544572f84dc191aad..e422fe845b67041fb3277271559232271ecf2716 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/createFields.H
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/createFields.H
@@ -7,7 +7,7 @@
             "transportProperties",
             runTime.constant(),
             mesh,
-            IOobject::MUST_READ_IF_MODIFIED,
+            IOobject::MUST_READ,
             IOobject::NO_WRITE
         )
     );
@@ -153,7 +153,7 @@
             "interfacialProperties",
             runTime.constant(),
             mesh,
-            IOobject::MUST_READ_IF_MODIFIED,
+            IOobject::MUST_READ,
             IOobject::NO_WRITE
         )
     );
@@ -175,8 +175,10 @@
     );
 
     word dragPhase("blended");
-    if (interfacialProperties.readIfPresent("dragPhase", dragPhase))
+    if (interfacialProperties.found("dragPhase"))
     {
+        dragPhase = word(interfacialProperties.lookup("dragPhase"));
+
         bool validDrag =
             dragPhase == "a" || dragPhase == "b" || dragPhase == "blended";
 
@@ -188,7 +190,7 @@
         }
     }
 
-    Info<< "dragPhase is " << dragPhase << endl;
+    Info << "dragPhase is " << dragPhase << endl;
     kineticTheoryModel kineticTheory
     (
         phasea,
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/Make/files b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/Make/files
index cf4603e1f8bb470b31f0b46b70c817c5b2bce94f..8d23cb95501ca817bd2e4e85715828025f76ebcf 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/Make/files
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/Make/files
@@ -1,5 +1,5 @@
 dragModels/dragModel/dragModel.C
-dragModels/dragModel/dragModelNew.C
+dragModels/dragModel/newDragModel.C
 dragModels/Ergun/Ergun.C
 dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C
 dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C
index 187e6fc20265a312bbc69ca2c2700c87965ca0ea..da72226edb8646ef60bc863057c053752909afc2 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C
@@ -88,7 +88,7 @@ Foam::tmp<Foam::volScalarField> Foam::GidaspowErgunWenYu::K
     volScalarField& KWenYu = tKWenYu();
 
     // Ergun
-    forAll(beta, cellj)
+    forAll (beta, cellj)
     {
         if (beta[cellj] <= 0.8)
         {
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C
index 08ddce7a85ddb7de02b3c1ba876ab8b98e2791da..517b21cfe7d7eb408e3f88a72faf72e0c8e48be6 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C
@@ -72,7 +72,7 @@ Foam::tmp<Foam::volScalarField> Foam::SyamlalOBrien::K
     volScalarField A = pow(beta, 4.14);
     volScalarField B = 0.8*pow(beta, 1.28);
 
-    forAll(beta, celli)
+    forAll (beta, celli)
     {
         if (beta[celli] > 0.85)
         {
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.H
index 52f5e277c03157eab91aa0de2992cacfa0aee30a..8e8ce0ca3c78c156b2481a1243ce2e65fae5e414 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.H
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.H
@@ -28,7 +28,7 @@ Description
 
 SourceFiles
     dragModel.C
-    dragModelNew.C
+    newDragModel.C
 
 \*---------------------------------------------------------------------------*/
 
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModelNew.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C
similarity index 72%
rename from applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModelNew.C
rename to applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C
index 7e2b967dd582ed8ba9ab4dcad322afb6b6bec5a3..4170fdae595a315246ea50c15ce4c4c98a83b693 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModelNew.C
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C
@@ -35,24 +35,29 @@ Foam::autoPtr<Foam::dragModel> Foam::dragModel::New
     const phaseModel& phaseb
 )
 {
-    const word modelType(interfaceDict.lookup("dragModel" + phasea.name()));
+    word dragModelType
+    (
+        interfaceDict.lookup("dragModel" + phasea.name())
+    );
 
-    Info<< "Selecting dragModel for phase " << phasea.name()
-        << ": " << modelType << endl;
+    Info << "Selecting dragModel for phase "
+        << phasea.name()
+        << ": "
+        << dragModelType << endl;
 
     dictionaryConstructorTable::iterator cstrIter =
-        dictionaryConstructorTablePtr_->find(modelType);
+        dictionaryConstructorTablePtr_->find(dragModelType);
 
     if (cstrIter == dictionaryConstructorTablePtr_->end())
     {
-        FatalErrorIn
-        (
-            "dragModel::New(...)"
-        )   << "Unknown dragModel type "
-            << modelType << nl << nl
-            << "Valid dragModel types are : " << endl
-            << dictionaryConstructorTablePtr_->sortedToc()
-            << abort(FatalError);
+        FatalError
+            << "dragModel::New : " << endl
+                << "    unknown dragModelType type "
+                << dragModelType
+                << ", constructor not in hash table" << endl << endl
+                << "    Valid dragModel types are : " << endl;
+        Info << dictionaryConstructorTablePtr_->sortedToc()
+             << abort(FatalError);
     }
 
     return cstrIter()(interfaceDict, alpha, phasea, phaseb);
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kEpsilon.H b/applications/solvers/multiphase/twoPhaseEulerFoam/kEpsilon.H
index dab75ee07d2d386e48a80345348abc49d8552c20..3d53ef8684ef7141ab99a6089122e5bdd2f8b48b 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/kEpsilon.H
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kEpsilon.H
@@ -1,4 +1,4 @@
-if(turbulence)
+if (turbulence)
 {
     if (mesh.changing())
     {
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/Make/files b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/Make/files
index 43c2f6df9d4e607c79e1e6382e873d72a10d34ee..a6ff2ca0f0274499ca8c2a400e7b7c1d37f22d0c 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/Make/files
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/Make/files
@@ -1,32 +1,32 @@
 kineticTheoryModel/kineticTheoryModel.C
 
 viscosityModel/viscosityModel/viscosityModel.C
-viscosityModel/viscosityModel/viscosityModelNew.C
+viscosityModel/viscosityModel/newViscosityModel.C
 viscosityModel/Gidaspow/GidaspowViscosity.C
 viscosityModel/Syamlal/SyamlalViscosity.C
 viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C
 viscosityModel/none/noneViscosity.C
 
 conductivityModel/conductivityModel/conductivityModel.C
-conductivityModel/conductivityModel/conductivityModelNew.C
+conductivityModel/conductivityModel/newConductivityModel.C
 conductivityModel/Gidaspow/GidaspowConductivity.C
 conductivityModel/Syamlal/SyamlalConductivity.C
 conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C
 
 radialModel/radialModel/radialModel.C
-radialModel/radialModel/radialModelNew.C
+radialModel/radialModel/newRadialModel.C
 radialModel/CarnahanStarling/CarnahanStarlingRadial.C
 radialModel/Gidaspow/GidaspowRadial.C
 radialModel/LunSavage/LunSavageRadial.C
 radialModel/SinclairJackson/SinclairJacksonRadial.C
 
 granularPressureModel/granularPressureModel/granularPressureModel.C
-granularPressureModel/granularPressureModel/granularPressureModelNew.C
+granularPressureModel/granularPressureModel/newGranularPressureModel.C
 granularPressureModel/Lun/LunPressure.C
 granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.C
 
 frictionalStressModel/frictionalStressModel/frictionalStressModel.C
-frictionalStressModel/frictionalStressModel/frictionalStressModelNew.C
+frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C
 frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C
 frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C
 
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.H b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.H
index 4f5510542a81c839397ac5c6f7569b04bd7eb9d1..0c6fc995584968b0494b3600706604b5fb8a6598 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.H
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.H
@@ -48,7 +48,7 @@ namespace Foam
 
 class conductivityModel
 {
-    // Private Member Functions
+    // Private member functions
 
         //- Disallow default bitwise copy construct
         conductivityModel(const conductivityModel&);
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModelNew.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C
similarity index 72%
rename from applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModelNew.C
rename to applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C
index 72a48f84d79933378ab03c6257098febc643bd4c..e5ce4a1f6f90aa6668c959a857731fb6525af2ab 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModelNew.C
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C
@@ -32,23 +32,23 @@ Foam::autoPtr<Foam::conductivityModel> Foam::conductivityModel::New
     const dictionary& dict
 )
 {
-    const word modelType(dict.lookup("conductivityModel"));
+    word conductivityModelType(dict.lookup("conductivityModel"));
 
-    Info<< "Selecting conductivityModel " << modelType << endl;
+    Info<< "Selecting conductivityModel "
+        << conductivityModelType << endl;
 
     dictionaryConstructorTable::iterator cstrIter =
-        dictionaryConstructorTablePtr_->find(modelType);
+        dictionaryConstructorTablePtr_->find(conductivityModelType);
 
     if (cstrIter == dictionaryConstructorTablePtr_->end())
     {
-        FatalErrorIn
-        (
-            "conductivityModel::New(const dictionary&)"
-        )   << "Unknown conductivityModel type "
-            << modelType << nl << nl
-            << "Valid conductivityModel types are :" << endl
-            << dictionaryConstructorTablePtr_->sortedToc()
-            << abort(FatalError);
+        FatalError
+            << "conductivityModel::New(const dictionary&) : " << endl
+            << "    unknown conductivityModelType type "
+            << conductivityModelType
+            << ", constructor not in hash table" << endl << endl
+            << "    Valid conductivityModelType types are :" << endl;
+        Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError);
     }
 
     return autoPtr<conductivityModel>(cstrIter()(dict));
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModelNew.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C
similarity index 72%
rename from applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModelNew.C
rename to applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C
index 70c364844a5fdc7b0cf6b17b213381244fac37a0..7ae225cf501fe02b95ad6a32678b376bb25a480f 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModelNew.C
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C
@@ -32,23 +32,23 @@ Foam::autoPtr<Foam::frictionalStressModel> Foam::frictionalStressModel::New
     const dictionary& dict
 )
 {
-    const word modelType(dict.lookup("frictionalStressModel"));
+    word frictionalStressModelType(dict.lookup("frictionalStressModel"));
 
-    Info<< "Selecting frictionalStressModel " << modelType << endl;
+    Info<< "Selecting frictionalStressModel "
+        << frictionalStressModelType << endl;
 
     dictionaryConstructorTable::iterator cstrIter =
-        dictionaryConstructorTablePtr_->find(modelType);
+        dictionaryConstructorTablePtr_->find(frictionalStressModelType);
 
     if (cstrIter == dictionaryConstructorTablePtr_->end())
     {
-        FatalErrorIn
-        (
-            "frictionalStressModel::New(const dictionary&)"
-        )
-            << "Unknown frictionalStressModel type "
-            << modelType << nl << nl
-            << "Valid frictionalStressModel types are :" << endl
-            << dictionaryConstructorTablePtr_->sortedToc()
+        FatalError
+            << "frictionalStressModel::New(const dictionary&) : " << endl
+            << "    unknown frictionalStressModelType type "
+            << frictionalStressModelType
+            << ", constructor not in hash table" << endl << endl
+            << "    Valid frictionalStressModelType types are :" << endl;
+        Info<< dictionaryConstructorTablePtr_->sortedToc()
             << abort(FatalError);
     }
 
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.H b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.H
index a94b3fb59304ab37ff2f8cafb1f31aa85824afb1..f99859f8ee0c6740d599e6f771a119fd576027d5 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.H
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.H
@@ -48,7 +48,7 @@ namespace Foam
 
 class granularPressureModel
 {
-    // Private Member Functions
+    // Private member functions
 
         //- Disallow default bitwise copy construct
         granularPressureModel(const granularPressureModel&);
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModelNew.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C
similarity index 72%
rename from applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModelNew.C
rename to applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C
index 57e844eea2d84ff0f4beeb4bd1c5a8c7e749a4e9..5d079a3878e43c7cfd9d9806bf6aff7c225a9e9d 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModelNew.C
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C
@@ -32,22 +32,23 @@ Foam::autoPtr<Foam::granularPressureModel> Foam::granularPressureModel::New
     const dictionary& dict
 )
 {
-    const word modelType(dict.lookup("granularPressureModel"));
+    word granularPressureModelType(dict.lookup("granularPressureModel"));
 
-    Info<< "Selecting granularPressureModel " << modelType << endl;
+    Info<< "Selecting granularPressureModel "
+        << granularPressureModelType << endl;
 
     dictionaryConstructorTable::iterator cstrIter =
-        dictionaryConstructorTablePtr_->find(modelType);
+        dictionaryConstructorTablePtr_->find(granularPressureModelType);
 
     if (cstrIter == dictionaryConstructorTablePtr_->end())
     {
-        FatalErrorIn
-        (
-            "granularPressureModel::New(const dictionary&)"
-        )   << "Unknown granularPressureModel type "
-            << modelType << nl << nl
-            << "Valid granularPressureModel types are :" << endl
-            << dictionaryConstructorTablePtr_->sortedToc()
+        FatalError
+            << "granularPressureModel::New(const dictionary&) : " << endl
+            << "    unknown granularPressureModelType type "
+            << granularPressureModelType
+            << ", constructor not in hash table" << endl << endl
+            << "    Valid granularPressureModelType types are :" << endl;
+        Info<< dictionaryConstructorTablePtr_->sortedToc()
             << abort(FatalError);
     }
 
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/radialModelNew.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/newRadialModel.C
similarity index 75%
rename from applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/radialModelNew.C
rename to applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/newRadialModel.C
index 49af5ad4130d8d4f4a868cff1689647a42649736..45aa1841700a53eafdd6d64e2e656b8fb1d75849 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/radialModelNew.C
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/newRadialModel.C
@@ -32,23 +32,23 @@ Foam::autoPtr<Foam::radialModel> Foam::radialModel::New
     const dictionary& dict
 )
 {
-    const word modelType(dict.lookup("radialModel"));
+    word radialModelType(dict.lookup("radialModel"));
 
-    Info<< "Selecting radialModel " << modelType << endl;
+    Info<< "Selecting radialModel "
+        << radialModelType << endl;
 
     dictionaryConstructorTable::iterator cstrIter =
-        dictionaryConstructorTablePtr_->find(modelType);
+        dictionaryConstructorTablePtr_->find(radialModelType);
 
     if (cstrIter == dictionaryConstructorTablePtr_->end())
     {
-        FatalErrorIn
-        (
-            "radialModel::New(const dictionary&)"
-        )
-            << "Unknown radialModel type "
-            << modelType << nl << nl
-            << "Valid radialModel types are :" << endl
-            << dictionaryConstructorTablePtr_->sortedToc()
+        FatalError
+            << "radialModel::New(const dictionary&) : " << endl
+            << "    unknown radialModelType type "
+            << radialModelType
+            << ", constructor not in hash table" << endl << endl
+            << "    Valid radialModelType types are :" << endl;
+        Info<< dictionaryConstructorTablePtr_->sortedToc()
             << abort(FatalError);
     }
 
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/radialModel.H b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/radialModel.H
index ebb716d79941920017fca7f8b98d70864e202647..8a5b9aa4e93e63b24d726546776fbc6f4767130b 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/radialModel.H
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/radialModel.H
@@ -48,7 +48,7 @@ namespace Foam
 
 class radialModel
 {
-    // Private Member Functions
+    // Private member functions
 
         //- Disallow default bitwise copy construct
         radialModel(const radialModel&);
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModelNew.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C
similarity index 73%
rename from applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModelNew.C
rename to applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C
index 217f55eb651a14ab7bbde354d3d63645531583d6..cef3993efb69b90aaccff2e48e50dc4f41789e0e 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModelNew.C
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C
@@ -33,23 +33,23 @@ Foam::kineticTheoryModels::viscosityModel::New
     const dictionary& dict
 )
 {
-    const word modelType(dict.lookup("viscosityModel"));
+    word viscosityModelType(dict.lookup("viscosityModel"));
 
-    Info<< "Selecting viscosityModel " << modelType << endl;
+    Info<< "Selecting viscosityModel "
+        << viscosityModelType << endl;
 
     dictionaryConstructorTable::iterator cstrIter =
-        dictionaryConstructorTablePtr_->find(modelType);
+        dictionaryConstructorTablePtr_->find(viscosityModelType);
 
     if (cstrIter == dictionaryConstructorTablePtr_->end())
     {
-        FatalErrorIn
-        (
-            "viscosityModel::New(const dictionary&)"
-        )   << "Unknown viscosityModel type "
-            << modelType << nl << nl
-            << "Valid viscosityModel types are :" << endl
-            << dictionaryConstructorTablePtr_->sortedToc()
-            << abort(FatalError);
+        FatalError
+            << "viscosityModel::New(const dictionary&) : " << endl
+            << "    unknown viscosityModelType type "
+            << viscosityModelType
+            << ", constructor not in hash table" << endl << endl
+            << "    Valid viscosityModelType types are :" << endl;
+        Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError);
     }
 
     return autoPtr<viscosityModel>(cstrIter()(dict));
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.H b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.H
index 5482e74264e97d430f37be821c4f57a61f04b0b6..12ce2a639bed3ea52bd1b8978e48de23b4cec914 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.H
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.H
@@ -52,7 +52,7 @@ namespace kineticTheoryModels
 
 class viscosityModel
 {
-    // Private Member Functions
+    // Private member functions
 
         //- Disallow default bitwise copy construct
         viscosityModel(const viscosityModel&);
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H b/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H
index 39a133d39bf4219d1d9a0aadc32db5bf7f50b555..f92944a41487c086990330a3442c90dfd4981f74 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H
@@ -50,10 +50,11 @@
 
     surfaceScalarField Dp
     (
-        "(rho*(1|A(U)))", alphaf*rUaAf/rhoa + betaf*rUbAf/rhob
+        "(rho*(1|A(U)))",
+        alphaf*rUaAf/rhoa + betaf*rUbAf/rhob
     );
 
-    for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
+    for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
     {
         fvScalarMatrix pEqn
         (
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/packingLimiter.H b/applications/solvers/multiphase/twoPhaseEulerFoam/packingLimiter.H
index 60c3bc8fa0c1d0873ed520016537b9b544f0c214..ba6dcf7ce6798ca56501b5585bad6130ff383730 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/packingLimiter.H
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/packingLimiter.H
@@ -7,7 +7,7 @@
         labelListList neighbour = mesh.cellCells();
         scalarField cellVolumes = mesh.cellVolumes();
 
-        forAll(alphaEx, celli)
+        forAll (alphaEx, celli)
         {
             // Finding the labels of the neighbouring cells
             labelList neighbourCell = neighbour[celli];
@@ -15,12 +15,12 @@
             // Initializing neighbouring cells contribution
             scalar neighboursEx = 0.0;
 
-            forAll(neighbourCell, cellj)
+            forAll (neighbourCell, cellj)
             {
                 labelList neighboursNeighbour = neighbour[neighbourCell[cellj]];
                 scalar neighboursNeighbourCellVolumes = 0.0;
 
-                forAll(neighboursNeighbour, cellk)
+                forAll (neighboursNeighbour, cellk)
                 {
                     neighboursNeighbourCellVolumes +=
                         cellVolumes[neighboursNeighbour[cellk]];
diff --git a/applications/test/IndirectList/IndirectListTest.C b/applications/test/IndirectList/IndirectListTest.C
index 44589f57c0791819534d2da3e48fae156faeec86..5fe724cc1b128870e00b08d9387b8662ff254d7f 100644
--- a/applications/test/IndirectList/IndirectListTest.C
+++ b/applications/test/IndirectList/IndirectListTest.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -30,6 +30,15 @@ Description
 
 using namespace Foam;
 
+template<class ListType>
+void printInfo(const ListType& lst)
+{
+    Info<< "addr: " << lst.addressing() << nl
+        << "list: " << lst << nl
+        << endl;
+}
+
+
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 // Main program:
 
@@ -42,8 +51,7 @@ int main(int argc, char *argv[])
         completeList[i] = 0.1*i;
     }
 
-    Info<< "raw : " << completeList << nl
-        << endl;
+    Info<< "raw : " << completeList << nl << endl;
 
 
     List<label> addresses(5);
@@ -53,11 +61,9 @@ int main(int argc, char *argv[])
     addresses[3] = 8;
     addresses[4] = 5;
 
-    IndirectList<double> idl(completeList, addresses);
+    IndirectList<double> idl1(completeList, addresses);
 
-    Info<< "addr: " << idl.addressing() << nl
-        << "list: " << idl() << nl
-        << endl;
+    printInfo(idl1);
 
     addresses[4] = 1;
     addresses[3] = 0;
@@ -65,11 +71,26 @@ int main(int argc, char *argv[])
     addresses[1] = 8;
     addresses[0] = 5;
 
-    idl.resetAddressing(addresses.xfer());
+    idl1.resetAddressing(addresses.xfer());
 
-    Info<< "addr: " << idl.addressing() << nl
-        << "list: " << idl() << nl
-        << endl;
+    printInfo(idl1);
+
+    // test copying
+    UIndirectList<double> uidl1(idl1);
+    IndirectList<double> idl2(uidl1);
+    IndirectList<double> idl3(idl2);
+
+    printInfo(uidl1);
+
+    idl1.resetAddressing(List<label>());
+//    idl2.resetAddressing(List<label>());
+
+    Info<<"after resetAddressing:" << nl << endl;
+
+    printInfo(uidl1);
+    printInfo(idl1);
+    printInfo(idl2);
+    printInfo(idl3);
 
     Info<< "End\n" << endl;
 
diff --git a/applications/test/PackedList/PackedListTest.C b/applications/test/PackedList/PackedListTest.C
index ad5c7b3342422e9640b1ec9201672da20d753079..7d47532f1bae230ed6395c532c6f3803db1e7929 100644
--- a/applications/test/PackedList/PackedListTest.C
+++ b/applications/test/PackedList/PackedListTest.C
@@ -166,7 +166,7 @@ int main(int argc, char *argv[])
 
         if (args.optionFound("info"))
         {
-            packLst.print(Info);
+            packLst.printInfo(Info);
         }
 
         Info<< nl;
diff --git a/applications/test/PackedList1/PackedListTest1.C b/applications/test/PackedList1/PackedListTest1.C
index 4ee366854b04662ce3738f58abab87ce09a0a00f..e26b08e804738f2cd5a6b6f9209f464a24051aea 100644
--- a/applications/test/PackedList1/PackedListTest1.C
+++ b/applications/test/PackedList1/PackedListTest1.C
@@ -42,42 +42,42 @@ int main(int argc, char *argv[])
 
     Info<< "\ntest allocation with value\n";
     PackedList<3> list1(5,1);
-    list1.print(Info);
+    list1.printInfo(Info, true);
 
     Info<< "\ntest assign uniform value\n";
     list1 = 3;
-    list1.print(Info);
+    list1.printInfo(Info, true);
 
     Info<< "\ntest assign uniform value (with overflow)\n";
     list1 = -1;
-    list1.print(Info);
+    list1.printInfo(Info, true);
 
     Info<< "\ntest zero\n";
     list1 = 0;
-    list1.print(Info);
+    list1.printInfo(Info, true);
 
     Info<< "\ntest set() with default argument (max_value)\n";
     list1.set(1);
     list1.set(3);
-    list1.print(Info);
+    list1.printInfo(Info, true);
 
     Info<< "\ntest unset() with in-range and out-of-range\n";
     list1.unset(3);
     list1.unset(100000);
-    list1.print(Info);
+    list1.printInfo(Info, true);
 
     Info<< "\ntest assign between references\n";
     list1[2] = 3;
     list1[4] = list1[2];
-    list1.print(Info);
+    list1.printInfo(Info, true);
 
     Info<< "\ntest assign between references, with chaining\n";
     list1[0] = list1[4] = 1;
-    list1.print(Info);
+    list1.printInfo(Info, true);
 
     Info<< "\ntest assign between references, with chaining and auto-vivify\n";
     list1[1] = list1[8] = list1[10] = list1[14] = 2;
-    list1.print(Info);
+    list1.printInfo(Info, true);
 
 
     Info<< "\ntest operator== between references\n";
@@ -126,7 +126,7 @@ int main(int argc, char *argv[])
     {
         const PackedList<3>& constLst = list1;
         Info<< "\ntest operator[] const with out-of-range index\n";
-        constLst.print(Info);
+        constLst.printInfo(Info, true);
         if (constLst[20])
         {
             Info<< "[20] is true (unexpected)\n";
@@ -136,7 +136,7 @@ int main(int argc, char *argv[])
             Info<< "[20] is false (expected) list size should be unchanged "
                 << "(const)\n";
         }
-        constLst.print(Info);
+        constLst.printInfo(Info, true);
 
         Info<< "\ntest operator[] non-const with out-of-range index\n";
         if (list1[20])
@@ -148,7 +148,7 @@ int main(int argc, char *argv[])
             Info<< "[20] is false (expected) but list was resized?? "
                 << "(non-const)\n";
         }
-        list1.print(Info);
+        list1.printInfo(Info, true);
     }
 
 
@@ -157,85 +157,85 @@ int main(int argc, char *argv[])
     {
         Info<< "[20] is false, as expected\n";
     }
-    list1.print(Info);
+    list1.printInfo(Info, true);
 
     Info<< "\ntest resize with value (without reallocation)\n";
     list1.resize(8, list1.max_value());
-    list1.print(Info);
+    list1.printInfo(Info, true);
 
     Info<< "\ntest flip() function\n";
     list1.flip();
-    list1.print(Info);
+    list1.printInfo(Info, true);
 
     Info<< "\nre-flip()\n";
     list1.flip();
-    list1.print(Info);
+    list1.printInfo(Info, true);
 
     Info<< "\ntest set() function\n";
     list1.set(1, 5);
-    list1.print(Info);
+    list1.printInfo(Info, true);
 
     Info<< "\ntest assign bool\n";
     list1 = false;
-    list1.print(Info);
+    list1.printInfo(Info, true);
 
     Info<< "\ntest assign bool\n";
     list1 = true;
-    list1.print(Info);
+    list1.printInfo(Info, true);
 
     Info<< "\ntest resize without value (with reallocation)\n";
     list1.resize(12);
-    list1.print(Info);
+    list1.printInfo(Info, true);
 
     Info<< "\ntest resize with value (with reallocation)\n";
     list1.resize(25, list1.max_value());
-    list1.print(Info);
+    list1.printInfo(Info, true);
 
     Info<< "\ntest resize smaller (should not touch allocation)\n";
     list1.resize(8);
-    list1.print(Info);
+    list1.printInfo(Info, true);
 
     Info<< "\ntest append() operation\n";
     list1.append(2);
     list1.append(3);
     list1.append(4);
-    list1.print(Info);
+    list1.printInfo(Info, true);
 
     Info<< "\ntest reserve() operation\n";
     list1.reserve(32);
-    list1.print(Info);
+    list1.printInfo(Info, true);
 
     Info<< "\ntest shrink() operation\n";
     list1.shrink();
-    list1.print(Info);
+    list1.printInfo(Info, true);
 
     Info<< "\ntest setCapacity() operation\n";
     list1.setCapacity(15);
-    list1.print(Info);
+    list1.printInfo(Info, true);
 
     Info<< "\ntest setCapacity() operation\n";
     list1.setCapacity(100);
-    list1.print(Info);
+    list1.printInfo(Info, true);
 
     Info<< "\ntest operator[] assignment\n";
     list1[16] = 5;
-    list1.print(Info);
+    list1.printInfo(Info, true);
 
     Info<< "\ntest operator[] assignment with auto-vivify\n";
     list1[36] = list1.max_value();
-    list1.print(Info);
+    list1.printInfo(Info, true);
 
     Info<< "\ntest setCapacity smaller\n";
     list1.setCapacity(24);
-    list1.print(Info);
+    list1.printInfo(Info, true);
 
     Info<< "\ntest resize much smaller\n";
     list1.resize(150);
-    list1.print(Info);
+    list1.printInfo(Info, true);
 
     Info<< "\ntest trim\n";
     list1.trim();
-    list1.print(Info);
+    list1.printInfo(Info, true);
 
     // add in some misc values
     list1[31] = 1;
@@ -245,40 +245,40 @@ int main(int argc, char *argv[])
     Info<< "\ntest iterator\n";
     PackedList<3>::iterator iter = list1.begin();
     Info<< "begin():";
-    iter.print(Info) << "\n";
+    iter.printInfo(Info) << "\n";
 
     Info<< "iterator:" << iter() << "\n";
     iter() = 5;
-    iter.print(Info);
-    list1.print(Info);
+    iter.printInfo(Info);
+    list1.printInfo(Info, true);
 
     iter = list1[31];
     Info<< "iterator:" << iter() << "\n";
-    iter.print(Info);
+    iter.printInfo(Info);
 
 
     Info<< "\ntest get() method\n";
     Info<< "get(10):" << list1.get(10) << " and list[10]:" << list1[10] << "\n";
-    list1.print(Info);
+    list1.printInfo(Info, true);
 
     Info<< "\ntest iterator indexing\n";
     Info<< "cend() ";
-    list1.cend().print(Info) << "\n";
+    list1.cend().printInfo(Info) << "\n";
 
     {
         Info<< "\ntest assignment of iterator\n";
-        list1.print(Info);
+        list1.printInfo(Info, true);
         Info<< "cend()\n";
-        list1.end().print(Info);
+        list1.end().printInfo(Info);
         PackedList<3>::iterator cit = list1[100];
         Info<< "out-of-range: ";
-        cit.print(Info);
+        cit.printInfo(Info);
         cit = list1[15];
         Info<< "in-range: ";
-        cit.print(Info);
+        cit.printInfo(Info);
         Info<< "out-of-range: ";
         cit = list1[1000];
-        cit.print(Info);
+        cit.printInfo(Info);
     }
 
 
@@ -289,7 +289,7 @@ int main(int argc, char *argv[])
         ++cit
     )
     {
-        cit.print(Info);
+        cit.printInfo(Info);
     }
 
     Info<< "\ntest operator[] auto-vivify\n";
@@ -304,16 +304,16 @@ int main(int argc, char *argv[])
     Info<< "size after write:" << list1.size() << "\n";
     Info<< "list[45]:" << list1[45] << "\n";
     list1[49] = list1[100];
-    list1.print(Info);
+    list1.printInfo(Info, true);
 
 
     Info<< "\ntest copy constructor + append\n";
     PackedList<3> list2(list1);
     list2.append(4);
     Info<< "source list:\n";
-    list1.print(Info);
+    list1.printInfo(Info, true);
     Info<< "destination list:\n";
-    list2.print(Info);
+    list2.printInfo(Info, true);
 
     Info<< "\ntest pattern that fills all bits\n";
     PackedList<4> list3(8, 8);
@@ -323,29 +323,50 @@ int main(int argc, char *argv[])
     list3[pos--] = list3.max_value();
     list3[pos--] = 0;
     list3[pos--] = list3.max_value();
-    list3.print(Info);
+    list3.printInfo(Info, true);
 
     Info<< "removed final value: " << list3.remove() << endl;
-    list3.print(Info);
+    list3.printInfo(Info, true);
 
+    Info<<"list: " << list3 << endl;
 
-    List<bool> list4(4, true);
+
+    List<bool> list4(16, false);
     {
-        const List<bool>& constLst = list4;
+        // fill with some values
+        forAll(list4, i)
+        {
+            list4[i] = i % 3;
+        }
+
+        const UList<bool>& constLst = list4;
         Info<< "\ntest operator[] const with out-of-range index\n";
         Info<< constLst << endl;
-        if (constLst[20])
+        if (constLst[100])
         {
-            Info<< "[20] is true (unexpected)\n";
+            Info<< "[100] is true (unexpected)\n";
         }
         else
         {
-            Info<< "[20] is false (expected) list size should be unchanged "
-                << "(const)\n";
+            Info<< "[100] is false (expected) "
+                << "list size should be unchanged (const)\n";
         }
         Info<< constLst << endl;
     }
 
+
+    PackedBoolList listb(list4);
+
+    Info<< "copied from bool list " << endl;
+    listb.printInfo(Info, true);
+
+    {
+        labelList indices = listb.used();
+
+        Info<< "indices: " << indices << endl;
+    }
+
+
     Info<< "\n\nDone.\n";
 
     return 0;
diff --git a/applications/test/PackedList3/PackedListTest3.C b/applications/test/PackedList3/PackedListTest3.C
index 5ff6ee8644b69c0da56f6d7defeea63e2f3f9bab..7b27ffda09a81c4c7f1faf17a8e7081b65229a2c 100644
--- a/applications/test/PackedList3/PackedListTest3.C
+++ b/applications/test/PackedList3/PackedListTest3.C
@@ -33,7 +33,6 @@ Description
 #include "StaticHashTable.H"
 #include "cpuTime.H"
 #include <vector>
-#include "PackedList.H"
 #include "PackedBoolList.H"
 
 using namespace Foam;
@@ -57,7 +56,7 @@ int main(int argc, char *argv[])
     {
         if ((i % nReport) == 0 && i)
         {
-            Info<< "i:" << i << " in " << timer.cpuTimeIncrement() << " s" 
+            Info<< "i:" << i << " in " << timer.cpuTimeIncrement() << " s"
                 <<endl;
         }
         packed[i] = 1;
diff --git a/applications/test/PackedList4/Make/files b/applications/test/PackedList4/Make/files
new file mode 100644
index 0000000000000000000000000000000000000000..0704f9b826eb283cb3c734dc0cd290154e10d9aa
--- /dev/null
+++ b/applications/test/PackedList4/Make/files
@@ -0,0 +1,3 @@
+PackedListTest4.C
+
+EXE = $(FOAM_USER_APPBIN)/PackedListTest4
diff --git a/applications/test/PackedList4/Make/options b/applications/test/PackedList4/Make/options
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/applications/test/PackedList4/PackedListTest4.C b/applications/test/PackedList4/PackedListTest4.C
new file mode 100644
index 0000000000000000000000000000000000000000..a500de01d36f283481ca92c62ef038d22cfe4e1e
--- /dev/null
+++ b/applications/test/PackedList4/PackedListTest4.C
@@ -0,0 +1,207 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software: you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 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/>.
+
+Application
+
+Description
+
+\*---------------------------------------------------------------------------*/
+
+#include "uLabel.H"
+#include "IOstreams.H"
+#include "PackedBoolList.H"
+#include "IStringStream.H"
+
+using namespace Foam;
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+//  Main program:
+
+int main(int argc, char *argv[])
+{
+    PackedBoolList list1(20);
+    // set every third one on
+    forAll(list1, i)
+    {
+        list1[i] = !(i % 3);
+    }
+
+    Info<< "\nalternating bit pattern\n";
+    list1.printInfo(Info, true);
+
+    PackedBoolList list2 = ~list1;
+
+    Info<< "\ncomplementary bit pattern\n";
+    list2.printBits(Info);
+
+    // set every other on
+    forAll(list2, i)
+    {
+        list2[i] = !(i % 2);
+    }
+
+    Info<< "\nalternating bit pattern\n";
+    list2.printBits(Info);
+
+    list2.resize(28, false);
+    list2.resize(34, true);
+    list2.resize(40, false);
+    for (label i=0; i < 4; ++i)
+    {
+        list2[i] = true;
+    }
+
+    Info<< "\nresized with false, 6 true + 6 false, bottom 4 bits true\n";
+    list2.printInfo(Info, true);
+
+    labelList list2Labels = list2.used();
+
+    Info<< "\noperator|\n";
+
+    list1.printBits(Info);
+    list2.printBits(Info);
+    Info<< "==\n";
+    (list1 | list2).printBits(Info);
+
+    Info<< "\noperator& : does trim\n";
+    (list1 & list2).printBits(Info);
+
+    Info<< "\noperator^\n";
+    (list1 ^ list2).printBits(Info);
+
+
+    Info<< "\noperator|=\n";
+    {
+        PackedBoolList list3 = list1;
+        (list3 |= list2).printBits(Info);
+    }
+
+    Info<< "\noperator|= with UList<label>\n";
+    {
+        PackedBoolList list3 = list1;
+        (list3 |= list2Labels).printBits(Info);
+    }
+
+    Info<< "\noperator&=\n";
+    {
+        PackedBoolList list3 = list1;
+        (list3 &= list2).printBits(Info);
+    }
+
+    Info<< "\noperator+=\n";
+    {
+        PackedBoolList list3 = list1;
+        (list3 += list2).printBits(Info);
+    }
+
+    Info<< "\noperator+= with UList<label>\n";
+    {
+        PackedBoolList list3 = list1;
+        (list3 += list2Labels).printBits(Info);
+    }
+
+    Info<< "\noperator-=\n";
+    {
+        PackedBoolList list3 = list1;
+        (list3 -= list2).printBits(Info);
+    }
+
+    Info<< "\noperator-= with UList<label>\n";
+    {
+        PackedBoolList list3 = list1;
+        (list3 -= list2Labels).printBits(Info);
+    }
+
+    PackedBoolList list4
+    (
+        IStringStream
+        (
+            "(1 n 1 n 1 n 1 1 off 0 0 f f 0 y yes y true y false on t)"
+        )()
+    );
+
+    Info<< "\ntest Istream constructor\n";
+
+    list4.printInfo(Info, true);
+    Info<< list4 << " indices: " << list4.used()() <<endl;
+
+    Info<< "\nassign from labelList\n";
+    list4 = labelList
+    (
+        IStringStream
+        (
+            "(0 1 2 3 12 13 14 19 20 21)"
+        )()
+    );
+
+    list4.printInfo(Info, true);
+    Info<< list4 << " indices: " << list4.used()() <<endl;
+
+    Info<< "\nassign from indices\n";
+    list4.read
+    (
+        IStringStream
+        (
+            "{0 1 2 3 12 13 14 19 20 21}"
+        )()
+    );
+
+
+    list4.printInfo(Info, true);
+    Info<< list4 << " indices: " << list4.used()() <<endl;
+
+    List<bool> boolLst(list4.size());
+    forAll(list4, i)
+    {
+        boolLst[i] = list4[i];
+    }
+
+    Info<< "List<bool>: " << boolLst <<endl;
+
+
+    // check roundabout assignments
+    PackedList<2> pl2
+    (
+        IStringStream
+        (
+            "{(0 3)(1 3)(2 3)(3 3)(12 3)(13 3)(14 3)(19 3)(20 3)(21 3)}"
+        )()
+    );
+
+    Info<< "roundabout assignment: " << pl2 << endl;
+
+    list4.clear();
+    forAll(pl2, i)
+    {
+        list4[i] = pl2[i];
+    }
+
+    list4.write(Info, true) << endl;
+
+    list4.writeEntry("PackedBoolList", Info);
+
+    return 0;
+}
+
+
+// ************************************************************************* //
diff --git a/applications/test/primitivePatch/testPrimitivePatch.C b/applications/test/primitivePatch/testPrimitivePatch.C
index f85b65435b0ccda5943097387784a1ce29d585b9..7a98cf9af2b4cf44378a5938a728e674508d2e8e 100644
--- a/applications/test/primitivePatch/testPrimitivePatch.C
+++ b/applications/test/primitivePatch/testPrimitivePatch.C
@@ -30,7 +30,6 @@ Description
 #include "Time.H"
 #include "polyMesh.H"
 #include "primitivePatch.H"
-#include "faceIOList.H"
 #include "IFstream.H"
 #include "OFstream.H"
 
diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C
index c48abfbc3960fd724e31bbc94a9937d92e34aad9..71af306d33dbba929abe7175657a3ca1c63f555a 100644
--- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C
+++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C
@@ -293,11 +293,13 @@ int main(int argc, char *argv[])
         // From global region number to mesh patch.
         globalToPatch.setSize(surfaces.nRegions(), -1);
 
-        Info<< "Patch\tRegion" << nl
-            << "-----\t------"
+        Info<< "Patch\tType\tRegion" << nl
+            << "-----\t----\t------"
             << endl;
 
         const labelList& surfaceGeometry = surfaces.surfaces();
+        const PtrList<dictionary>& surfacePatchInfo = surfaces.patchInfo();
+
         forAll(surfaceGeometry, surfI)
         {
             label geomI = surfaceGeometry[surfI];
@@ -308,15 +310,34 @@ int main(int argc, char *argv[])
 
             forAll(regNames, i)
             {
-                label patchI = meshRefiner.addMeshedPatch
-                (
-                    regNames[i],
-                    wallPolyPatch::typeName
-                );
-
-                Info<< patchI << '\t' << regNames[i] << nl;
-
-                globalToPatch[surfaces.globalRegion(surfI, i)] = patchI;
+                label globalRegionI = surfaces.globalRegion(surfI, i);
+
+                label patchI;
+
+                if (surfacePatchInfo.set(globalRegionI))
+                {
+                    patchI = meshRefiner.addMeshedPatch
+                    (
+                        regNames[i],
+                        surfacePatchInfo[globalRegionI]
+                    );
+                }
+                else
+                {
+                    dictionary patchInfo;
+                    patchInfo.set("type", wallPolyPatch::typeName);
+
+                    patchI = meshRefiner.addMeshedPatch
+                    (
+                        regNames[i],
+                        patchInfo
+                    );
+                }
+
+                Info<< patchI << '\t' << mesh.boundaryMesh()[patchI].type()
+                    << '\t' << regNames[i] << nl;
+
+                globalToPatch[globalRegionI] = patchI;
             }
 
             Info<< nl;
@@ -431,7 +452,7 @@ int main(int argc, char *argv[])
     {
         cpuTime timer;
 
-        autoLayerDriver layerDriver(meshRefiner);
+        autoLayerDriver layerDriver(meshRefiner, globalToPatch);
 
         // Layer addition parameters
         layerParameters layerParams(layerDict, mesh.boundaryMesh());
diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict
index a15aa483c4fa9fcebb8a47278d7db45b4f104d8f..dbfcbd12d5140425c5d6cce9cf9ebd8f7336bcce 100644
--- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict
+++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict
@@ -343,7 +343,8 @@ meshQualityControls
 
     //- Minimum quality of the tet formed by the face-centre
     //  and variable base point minimum decomposition triangles and
-    //  the cell centre.  Set to very negative number (e.g. -1E30) to
+    //  the cell centre. This has to be a positive number for tracking
+    //  to work. Set to very negative number (e.g. -1E30) to
     //  disable.
     //     <0 = inside out tet,
     //      0 = flat tet
diff --git a/applications/utilities/miscellaneous/foamDebugSwitches/Make/options b/applications/utilities/miscellaneous/foamDebugSwitches/Make/options
index 7207b539275a309d53ea95e21565461d52cc6bfc..b43dc7a7d195ba4a79f22d95a58d14a896a8e409 100644
--- a/applications/utilities/miscellaneous/foamDebugSwitches/Make/options
+++ b/applications/utilities/miscellaneous/foamDebugSwitches/Make/options
@@ -57,4 +57,5 @@ EXE_LIBS = \
     -lthermophysicalFunctions \
     -ltopoChangerFvMesh \
     -ltriSurface \
+    -ltwoPhaseInterfaceProperties \
     -lutilityFunctionObjects
diff --git a/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C b/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C
index 2649cc1e4ecbfdd74199dd635d486420fe66daf7..c340aedb17fe44fd51ecee1f25105ba7a0a632be 100644
--- a/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C
+++ b/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C
@@ -166,10 +166,10 @@ int main(int argc, char *argv[])
         Info<< "Time = " << runTime.timeName() << endl;
 
         // Convert all the standard mesh files
-        writeMeshObject<cellIOList>("cells", meshDir, runTime);
+        writeMeshObject<cellCompactIOList>("cells", meshDir, runTime);
         writeMeshObject<labelIOList>("owner", meshDir, runTime);
         writeMeshObject<labelIOList>("neighbour", meshDir, runTime);
-        writeMeshObject<faceIOList>("faces", meshDir, runTime);
+        writeMeshObject<faceCompactIOList>("faces", meshDir, runTime);
         writeMeshObject<pointIOField>("points", meshDir, runTime);
         writeMeshObject<labelIOList>("pointProcAddressing", meshDir, runTime);
         writeMeshObject<labelIOList>("faceProcAddressing", meshDir, runTime);
diff --git a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C
index 0c72ca7ee72ea09c3ae4dc395da0e061e79c48d0..f7a3a2d39239d6ce64129e719862b80362c5ec0e 100644
--- a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C
+++ b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C
@@ -402,17 +402,17 @@ int main(int argc, char *argv[])
     PtrList< List<SLList<indexedParticle*>*> > cellParticles(cloudDirs.size());
 
     PtrList<PtrList<labelIOField> > lagrangianLabelFields(cloudDirs.size());
-    PtrList<PtrList<labelIOFieldField> > lagrangianLabelFieldFields
+    PtrList<PtrList<labelFieldCompactIOField> > lagrangianLabelFieldFields
     (
         cloudDirs.size()
     );
     PtrList<PtrList<scalarIOField> > lagrangianScalarFields(cloudDirs.size());
-    PtrList<PtrList<scalarIOFieldField> > lagrangianScalarFieldFields
+    PtrList<PtrList<scalarFieldCompactIOField> > lagrangianScalarFieldFields
     (
         cloudDirs.size()
     );
     PtrList<PtrList<vectorIOField> > lagrangianVectorFields(cloudDirs.size());
-    PtrList<PtrList<vectorIOFieldField> > lagrangianVectorFieldFields
+    PtrList<PtrList<vectorFieldCompactIOField> > lagrangianVectorFieldFields
     (
         cloudDirs.size()
     );
@@ -420,13 +420,14 @@ int main(int argc, char *argv[])
     (
         cloudDirs.size()
     );
-    PtrList<PtrList<sphericalTensorIOFieldField> >
+    PtrList<PtrList<sphericalTensorFieldCompactIOField> >
         lagrangianSphericalTensorFieldFields(cloudDirs.size());
     PtrList<PtrList<symmTensorIOField> > lagrangianSymmTensorFields
     (
         cloudDirs.size()
     );
-    PtrList<PtrList<symmTensorIOFieldField> > lagrangianSymmTensorFieldFields
+    PtrList<PtrList<symmTensorFieldCompactIOField> >
+    lagrangianSymmTensorFieldFields
     (
         cloudDirs.size()
     );
@@ -434,7 +435,7 @@ int main(int argc, char *argv[])
     (
         cloudDirs.size()
     );
-    PtrList<PtrList<tensorIOFieldField> > lagrangianTensorFieldFields
+    PtrList<PtrList<tensorFieldCompactIOField> > lagrangianTensorFieldFields
     (
         cloudDirs.size()
     );
diff --git a/applications/utilities/parallelProcessing/decomposePar/lagrangianFieldDecomposer.H b/applications/utilities/parallelProcessing/decomposePar/lagrangianFieldDecomposer.H
index dafd94c34308c4373f03a8ebbbe923e10d5493b5..fe28c184835b274042ebc61f99910b851be50dd5 100644
--- a/applications/utilities/parallelProcessing/decomposePar/lagrangianFieldDecomposer.H
+++ b/applications/utilities/parallelProcessing/decomposePar/lagrangianFieldDecomposer.H
@@ -37,7 +37,7 @@ SourceFiles
 #define lagrangianFieldDecomposer_H
 
 #include "Cloud.H"
-#include "IOFieldField.H"
+#include "CompactIOField.H"
 #include "indexedParticle.H"
 #include "passiveParticle.H"
 
@@ -111,9 +111,9 @@ public:
             const IOobjectList& lagrangianObjects,
             PtrList
             <
-                PtrList<IOFieldField<Field<Type>, Type> >
+                PtrList<CompactIOField<Field<Type>, Type> >
             >& lagrangianFields
-//            PtrList<IOFieldField<Field<Type>, Type > >& lagrangianFields
+//            PtrList<CompactIOField<Field<Type>, Type > >& lagrangianFields
         );
 
 
@@ -126,10 +126,10 @@ public:
         ) const;
 
         template<class Type>
-        tmp<IOFieldField<Field<Type>, Type> > decomposeFieldField
+        tmp<CompactIOField<Field<Type>, Type> > decomposeFieldField
         (
             const word& cloudName,
-            const IOFieldField<Field<Type>, Type>& field
+            const CompactIOField<Field<Type>, Type>& field
         ) const;
 
 
diff --git a/applications/utilities/parallelProcessing/decomposePar/lagrangianFieldDecomposerDecomposeFields.C b/applications/utilities/parallelProcessing/decomposePar/lagrangianFieldDecomposerDecomposeFields.C
index 7e42907fd0ddde6bcef1658535fc2c61a2ea1ec9..50d17f0391ac9ffa057d27fc07004556c22b37a1 100644
--- a/applications/utilities/parallelProcessing/decomposePar/lagrangianFieldDecomposerDecomposeFields.C
+++ b/applications/utilities/parallelProcessing/decomposePar/lagrangianFieldDecomposerDecomposeFields.C
@@ -68,7 +68,7 @@ void Foam::lagrangianFieldDecomposer::readFieldFields
 (
     const label cloudI,
     const IOobjectList& lagrangianObjects,
-    PtrList<PtrList<IOFieldField<Field<Type>, Type> > >& lagrangianFields
+    PtrList<PtrList<CompactIOField<Field<Type>, Type> > >& lagrangianFields
 )
 {
     // Search list of objects for lagrangian fields
@@ -79,13 +79,17 @@ void Foam::lagrangianFieldDecomposer::readFieldFields
 
     IOobjectList lagrangianTypeObjectsB
     (
-        lagrangianObjects.lookupClass(IOFieldField<Field<Type>, Type>::typeName)
+        lagrangianObjects.lookupClass
+        (
+            CompactIOField<Field<Type>,
+            Type>::typeName
+        )
     );
 
     lagrangianFields.set
     (
         cloudI,
-        new PtrList<IOFieldField<Field<Type>, Type> >
+        new PtrList<CompactIOField<Field<Type>, Type> >
         (
             lagrangianTypeObjectsA.size() + lagrangianTypeObjectsB.size()
         )
@@ -98,7 +102,7 @@ void Foam::lagrangianFieldDecomposer::readFieldFields
         lagrangianFields[cloudI].set
         (
             lagrangianFieldi++,
-            new IOFieldField<Field<Type>, Type>(*iter())
+            new CompactIOField<Field<Type>, Type>(*iter())
         );
     }
 
@@ -107,7 +111,7 @@ void Foam::lagrangianFieldDecomposer::readFieldFields
         lagrangianFields[cloudI].set
         (
             lagrangianFieldi++,
-            new IOFieldField<Field<Type>, Type>(*iter())
+            new CompactIOField<Field<Type>, Type>(*iter())
         );
     }
 }
@@ -145,20 +149,20 @@ Foam::lagrangianFieldDecomposer::decomposeField
 
 
 template<class Type>
-Foam::tmp<Foam::IOFieldField<Foam::Field<Type>, Type> >
+Foam::tmp<Foam::CompactIOField<Foam::Field<Type>, Type> >
 Foam::lagrangianFieldDecomposer::decomposeFieldField
 (
     const word& cloudName,
-    const IOFieldField<Field<Type>, Type>& field
+    const CompactIOField<Field<Type>, Type>& field
 ) const
 {
     // Create and map the internal field values
     Field<Field<Type> > procField(field, particleIndices_);
 
     // Create the field for the processor
-    return tmp<IOFieldField<Field<Type>, Type> >
+    return tmp<CompactIOField<Field<Type>, Type> >
     (
-        new IOFieldField<Field<Type>, Type>
+        new CompactIOField<Field<Type>, Type>
         (
             IOobject
             (
diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/files b/applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/files
index 78e39e9df6b48603ae717147a52c6dbff0f34959..44c513a079bdb9707167566ccc85a334e91d4078 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/files
+++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/files
@@ -2,6 +2,5 @@ itoa.C
 ensightMesh.C
 ensightParticlePositions.C
 foamToEnsight.C
-ensightWriteBinary.C
 
 EXE = $(FOAM_APPBIN)/foamToEnsight
diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/cellSets.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/cellSets.H
index 2c9755ef436014b387f35237ec7bdee8f7e12b37..a4447108ab75857adfc042210e86181dd882e8b7 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/cellSets.H
+++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/cellSets.H
@@ -44,15 +44,6 @@ namespace Foam
 
 class cellSets
 {
-    // Private Member Functions
-
-        //- Disallow default bitwise copy construct
-        cellSets(const cellSets&);
-
-        //- Disallow default bitwise assignment
-        void operator=(const cellSets&);
-
-
 public:
 
         label nHexesWedges;
diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightAsciiStream.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightAsciiStream.H
new file mode 100644
index 0000000000000000000000000000000000000000..2230b75b24bb0db43f511290b337dec7000efe39
--- /dev/null
+++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightAsciiStream.H
@@ -0,0 +1,156 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software: you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 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::ensightAsciiStream
+
+Description
+
+SourceFiles
+    ensightAsciiStream.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef ensightAsciiStream_H
+#define ensightAsciiStream_H
+
+#include "ensightStream.H"
+#include "OFstream.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+                         Class ensightAsciiStream Declaration
+\*---------------------------------------------------------------------------*/
+
+class ensightAsciiStream
+:
+    public ensightStream
+{
+    // Private data
+
+        //- Description of data_
+        OFstream str_;
+
+
+    // Private Member Functions
+
+        //- Disallow default bitwise copy construct
+        ensightAsciiStream(const ensightAsciiStream&);
+
+        //- Disallow default bitwise assignment
+        void operator=(const ensightAsciiStream&);
+
+
+public:
+
+    // Constructors
+
+        //- Construct from components
+        ensightAsciiStream(const fileName& f, const Time& runTime)
+        :
+            ensightStream(f),
+            str_
+            (
+                f,
+                runTime.writeFormat(),
+                runTime.writeVersion(),
+                IOstream::UNCOMPRESSED
+            )
+        {
+
+            str_.setf(ios_base::scientific, ios_base::floatfield);
+            str_.precision(5);
+        }
+
+
+    //- Destructor
+    virtual ~ensightAsciiStream()
+    {}
+
+
+    // Member Functions
+
+        virtual void write(const char* c)
+        {
+            str_ << c << nl;
+        }
+
+        virtual void write(const int v)
+        {
+            str_ << setw(10) << v << nl;
+        }
+
+        virtual void write(const scalarField& sf)
+        {
+            forAll(sf, i)
+            {
+                if (mag(sf[i]) >= scalar(floatScalarVSMALL))
+                {
+                    str_ << setw(12) << sf[i] << nl;
+                }
+                else
+                {
+                    str_ << setw(12) << scalar(0) << nl;
+                }
+            }
+        }
+
+        virtual void write(const List<int>& sf)
+        {
+            forAll(sf, i)
+            {
+                str_ << setw(10) << sf[i];
+            }
+            str_<< nl;
+        }
+
+        virtual void writePartHeader(const label partI)
+        {
+            str_<< "part" << nl
+                << setw(10) << partI << nl;
+        }
+
+    // Member Operators
+
+    // Friend Functions
+
+    // Friend Operators
+
+    // IOstream Operators
+
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightBinaryStream.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightBinaryStream.H
new file mode 100644
index 0000000000000000000000000000000000000000..b4f1421e4aff778f7926a6e1f348890c8637b8f4
--- /dev/null
+++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightBinaryStream.H
@@ -0,0 +1,158 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software: you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 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::ensightBinaryStream
+
+Description
+
+SourceFiles
+    ensightBinaryStream.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef ensightBinaryStream_H
+#define ensightBinaryStream_H
+
+#include "ensightStream.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+                         Class ensightBinaryStream Declaration
+\*---------------------------------------------------------------------------*/
+
+class ensightBinaryStream
+:
+    public ensightStream
+{
+    // Private data
+
+        //- Description of data_
+        autoPtr<std::ofstream> str_;
+
+
+    // Private Member Functions
+
+        //- Disallow default bitwise copy construct
+        ensightBinaryStream(const ensightBinaryStream&);
+
+        //- Disallow default bitwise assignment
+        void operator=(const ensightBinaryStream&);
+
+
+public:
+
+    // Constructors
+
+        //- Construct from components
+        ensightBinaryStream(const fileName& f, const Time&)
+        :
+            ensightStream(f),
+            str_
+            (
+                new std::ofstream
+                (
+                    f.c_str(),
+                    ios_base::out | ios_base::binary | ios_base::trunc
+                )
+            )
+        {}
+
+
+    //- Destructor
+    virtual ~ensightBinaryStream()
+    {}
+
+
+    // Member Functions
+
+        virtual void write(const char* val)
+        {
+            char buffer[80] = {0};
+            strcpy(buffer, val);
+            str_().write(buffer, 80*sizeof(char));
+        }
+
+        virtual void write(const int val)
+        {
+            str_().write(reinterpret_cast<const char*>(&val), sizeof(int));
+        }
+
+        virtual void write(const scalarField& sf)
+        {
+            if (sf.size())
+            {
+                List<float> temp(sf.size());
+
+                forAll(sf, i)
+                {
+                    temp[i] = float(sf[i]);
+                }
+
+                str_().write
+                (
+                    reinterpret_cast<const char*>(temp.begin()),
+                    sf.size()*sizeof(float)
+                );
+            }
+        }
+
+        virtual void write(const List<int>& sf)
+        {
+            str_().write
+            (
+                reinterpret_cast<const char*>(sf.begin()),
+                sf.size()*sizeof(int)
+            );
+        }
+
+        virtual void writePartHeader(const label partI)
+        {
+            write("part");
+            write(partI);
+        }
+
+    // Member Operators
+
+    // Friend Functions
+
+    // Friend Operators
+
+    // IOstream Operators
+
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C
index 680d5ff89499649d64c4232c673e6fa49aab9b04..22bd164e92fe8e96bf535e0d9d12a9dbc5d5ad2f 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C
+++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C
@@ -29,28 +29,14 @@ License
 #include "OFstream.H"
 #include "IOmanip.H"
 #include "itoa.H"
-#include "ensightWriteBinary.H"
+#include "volPointInterpolation.H"
+#include "ensightBinaryStream.H"
+#include "ensightAsciiStream.H"
 
 using namespace Foam;
 
 // * * * * * * * * * * * * * * * Global Functions  * * * * * * * * * * * * * //
 
-void writeData(const scalarField& sf, OFstream& ensightFile)
-{
-    forAll(sf, i)
-    {
-        if (mag( sf[i] ) >= scalar(floatScalarVSMALL))
-        {
-            ensightFile << setw(12) << sf[i] << nl;
-        }
-        else
-        {
-            ensightFile << setw(12) << scalar(0) << nl;
-        }
-    }
-}
-
-
 template<class Type>
 scalarField map
 (
@@ -104,64 +90,25 @@ void writeAllData
     const Field<Type>& vf,
     const labelList& prims,
     const label nPrims,
-    OFstream& ensightFile
-)
-{
-    if (nPrims)
-    {
-        if (Pstream::master())
-        {
-            ensightFile << key << nl;
-
-            for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
-            {
-                writeData(map(vf, prims, cmpt), ensightFile);
-
-                for (int slave=1; slave<Pstream::nProcs(); slave++)
-                {
-                    IPstream fromSlave(Pstream::scheduled, slave);
-                    scalarField data(fromSlave);
-                    writeData(data, ensightFile);
-                }
-            }
-        }
-        else
-        {
-            for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
-            {
-                OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
-                toMaster<< map(vf, prims, cmpt);
-            }
-        }
-    }
-}
-
-
-template<class Type>
-void writeAllDataBinary
-(
-    const char* key,
-    const Field<Type>& vf,
-    const labelList& prims,
-    const label nPrims,
-    std::ofstream& ensightFile
+    ensightStream& ensightFile
 )
 {
     if (nPrims)
     {
         if (Pstream::master())
         {
-            writeEnsDataBinary(key,ensightFile);
+            ensightFile.write(key);
 
             for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
             {
-                writeEnsDataBinary(map(vf, prims, cmpt), ensightFile);
+                scalarField masterData(map(vf, prims, cmpt));
+                ensightFile.write(masterData);
 
                 for (int slave=1; slave<Pstream::nProcs(); slave++)
                 {
                     IPstream fromSlave(Pstream::scheduled, slave);
-                    scalarField data(fromSlave);
-                    writeEnsDataBinary(data, ensightFile);
+                    scalarField slaveData(fromSlave);
+                    ensightFile.write(slaveData);
                 }
             }
         }
@@ -184,66 +131,25 @@ void writeAllFaceData
     const labelList& prims,
     const label nPrims,
     const Field<Type>& pf,
-    OFstream& ensightFile
+    ensightStream& ensightFile
 )
 {
     if (nPrims)
     {
         if (Pstream::master())
         {
-            ensightFile << key << nl;
+            ensightFile.write(key);
 
             for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
             {
-                writeData(map(pf, prims, cmpt), ensightFile);
+                ensightFile.write(map(pf, prims, cmpt));
 
                 for (int slave=1; slave<Pstream::nProcs(); slave++)
                 {
                     IPstream fromSlave(Pstream::scheduled, slave);
                     scalarField pf(fromSlave);
 
-                    writeData(pf, ensightFile);
-                }
-            }
-        }
-        else
-        {
-            for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
-            {
-                OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
-                toMaster<< map(pf, prims, cmpt);
-            }
-        }
-    }
-}
-
-
-template<class Type>
-void writeAllFaceDataBinary
-(
-    const char* key,
-    const labelList& prims,
-    const label nPrims,
-    const Field<Type>& pf,
-    std::ofstream& ensightFile
-)
-{
-    if (nPrims)
-    {
-        if (Pstream::master())
-        {
-            writeEnsDataBinary(key,ensightFile);
-
-            for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
-            {
-                writeEnsDataBinary(map(pf, prims, cmpt), ensightFile);
-
-                for (int slave=1; slave<Pstream::nProcs(); slave++)
-                {
-                    IPstream fromSlave(Pstream::scheduled, slave);
-                    scalarField pf(fromSlave);
-
-                    writeEnsDataBinary(pf, ensightFile);
+                    ensightFile.write(pf);
                 }
             }
         }
@@ -267,16 +173,14 @@ bool writePatchField
     const Foam::label ensightPatchI,
     const Foam::faceSets& boundaryFaceSet,
     const Foam::ensightMesh::nFacePrimitives& nfp,
-    Foam::OFstream& ensightFile
+    ensightStream& ensightFile
 )
 {
     if (nfp.nTris || nfp.nQuads || nfp.nPolys)
     {
         if (Pstream::master())
         {
-            ensightFile
-                << "part" << nl
-                << setw(10) << ensightPatchI << nl;
+            ensightFile.writePartHeader(ensightPatchI);
         }
 
         writeAllFaceData
@@ -315,61 +219,6 @@ bool writePatchField
 }
 
 
-template<class Type>
-bool writePatchFieldBinary
-(
-    const Foam::Field<Type>& pf,
-    const Foam::label patchi,
-    const Foam::label ensightPatchI,
-    const Foam::faceSets& boundaryFaceSet,
-    const Foam::ensightMesh::nFacePrimitives& nfp,
-    std::ofstream& ensightFile
-)
-{
-    if (nfp.nTris || nfp.nQuads || nfp.nPolys)
-    {
-        if (Pstream::master())
-        {
-            writeEnsDataBinary("part",ensightFile);
-            writeEnsDataBinary(ensightPatchI,ensightFile);
-        }
-
-        writeAllFaceDataBinary
-        (
-            "tria3",
-            boundaryFaceSet.tris,
-            nfp.nTris,
-            pf,
-            ensightFile
-        );
-
-        writeAllFaceDataBinary
-        (
-            "quad4",
-            boundaryFaceSet.quads,
-            nfp.nQuads,
-            pf,
-            ensightFile
-        );
-
-        writeAllFaceDataBinary
-        (
-            "nsided",
-            boundaryFaceSet.polys,
-            nfp.nPolys,
-            pf,
-            ensightFile
-        );
-
-        return true;
-    }
-    else
-    {
-        return false;
-    }
-}
-
-
 template<class Type>
 void writePatchField
 (
@@ -380,6 +229,7 @@ void writePatchField
     const Foam::fileName& postProcPath,
     const Foam::word& prepend,
     const Foam::label timeIndex,
+    const bool binary,
     Foam::Ostream& ensightCaseFile
 )
 {
@@ -409,7 +259,7 @@ void writePatchField
 
     word timeFile = prepend + itoa(timeIndex);
 
-    OFstream *ensightFilePtr = NULL;
+    ensightStream* ensightFilePtr = NULL;
     if (Pstream::master())
     {
         if (timeIndex == 0)
@@ -426,20 +276,30 @@ void writePatchField
 
         // set the filename of the ensight file
         fileName ensightFileName(timeFile + "." + pfName);
-        ensightFilePtr = new OFstream
-        (
-            postProcPath/ensightFileName,
-            runTime.writeFormat(),
-            runTime.writeVersion(),
-            runTime.writeCompression()
-        );
+
+        if (binary)
+        {
+            ensightFilePtr = new ensightBinaryStream
+            (
+                postProcPath/ensightFileName,
+                runTime
+            );
+        }
+        else
+        {
+            ensightFilePtr = new ensightAsciiStream
+            (
+                postProcPath/ensightFileName,
+                runTime
+            );
+        }
     }
 
-    OFstream& ensightFile = *ensightFilePtr;
+    ensightStream& ensightFile = *ensightFilePtr;
 
     if (Pstream::master())
     {
-        ensightFile << pTraits<Type>::typeName << nl;
+        ensightFile.write(pTraits<Type>::typeName);
     }
 
     if (patchi >= 0)
@@ -477,17 +337,18 @@ void writePatchField
 
 
 template<class Type>
-void ensightFieldAscii
+void ensightField
 (
-    const Foam::IOobject& fieldObject,
+    const GeometricField<Type, fvPatchField, volMesh>& vf,
     const Foam::ensightMesh& eMesh,
     const Foam::fileName& postProcPath,
     const Foam::word& prepend,
     const Foam::label timeIndex,
+    const bool binary,
     Foam::Ostream& ensightCaseFile
 )
 {
-    Info<< "Converting field " << fieldObject.name() << endl;
+    Info<< "Converting field " << vf.name() << endl;
 
     word timeFile = prepend + itoa(timeIndex);
 
@@ -512,23 +373,31 @@ void ensightFieldAscii
     const labelList& hexes = meshCellSets.hexes;
     const labelList& polys = meshCellSets.polys;
 
-    OFstream *ensightFilePtr = NULL;
+    ensightStream* ensightFilePtr = NULL;
     if (Pstream::master())
     {
         // set the filename of the ensight file
-        fileName ensightFileName(timeFile + "." + fieldObject.name());
-        ensightFilePtr = new OFstream
-        (
-            postProcPath/ensightFileName,
-            runTime.writeFormat(),
-            runTime.writeVersion(),
-            IOstream::UNCOMPRESSED
-        );
-    }
+        fileName ensightFileName(timeFile + "." + vf.name());
 
-    OFstream& ensightFile = *ensightFilePtr;
+        if (binary)
+        {
+            ensightFilePtr = new ensightBinaryStream
+            (
+                postProcPath/ensightFileName,
+                runTime
+            );
+        }
+        else
+        {
+            ensightFilePtr = new ensightAsciiStream
+            (
+                postProcPath/ensightFileName,
+                runTime
+            );
+        }
+    }
 
-    GeometricField<Type, fvPatchField, volMesh> vf(fieldObject, mesh);
+    ensightStream& ensightFile = *ensightFilePtr;
 
     if (patchNames.empty())
     {
@@ -548,34 +417,26 @@ void ensightFieldAscii
                     << nl;
             }
 
-            ensightFile
-                << pTraits<Type>::typeName << nl
-                << "part" << nl
-                << setw(10) << 1 << nl;
-
-            ensightFile.setf(ios_base::scientific, ios_base::floatfield);
-            ensightFile.precision(5);
+            ensightFile.write(pTraits<Type>::typeName);
+            ensightFile.writePartHeader(1);
         }
 
         if (meshCellSets.nHexesWedges)
         {
             if (Pstream::master())
             {
-                ensightFile << "hexa8" << nl;
+                ensightFile.write("hexa8");
 
                 for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
                 {
-                    writeData
-                    (
-                        map(vf, hexes, wedges, cmpt),
-                        ensightFile
-                    );
+                    scalarField masterData(map(vf, hexes, wedges, cmpt));
+                    ensightFile.write(masterData);
 
                     for (int slave=1; slave<Pstream::nProcs(); slave++)
                     {
                         IPstream fromSlave(Pstream::scheduled, slave);
                         scalarField data(fromSlave);
-                        writeData(data, ensightFile);
+                        ensightFile.write(data);
                     }
                 }
             }
@@ -727,7 +588,6 @@ void ensightFieldAscii
             }
         }
     }
-
     if (Pstream::master())
     {
         delete ensightFilePtr;
@@ -736,59 +596,48 @@ void ensightFieldAscii
 
 
 template<class Type>
-void ensightFieldBinary
+void ensightPointField
 (
-    const Foam::IOobject& fieldObject,
+    const GeometricField<Type, pointPatchField, pointMesh>& pf,
     const Foam::ensightMesh& eMesh,
     const Foam::fileName& postProcPath,
     const Foam::word& prepend,
     const Foam::label timeIndex,
+    const bool binary,
     Foam::Ostream& ensightCaseFile
 )
 {
-    Info<< "Converting field (binary) " << fieldObject.name() << endl;
+    Info<< "Converting field " << pf.name() << endl;
 
     word timeFile = prepend + itoa(timeIndex);
 
-    const fvMesh& mesh = eMesh.mesh();
-    //const Time& runTime = mesh.time();
-
-    const cellSets& meshCellSets = eMesh.meshCellSets();
-    const List<faceSets>& boundaryFaceSets = eMesh.boundaryFaceSets();
-    const wordList& allPatchNames = eMesh.allPatchNames();
-    const wordHashSet& patchNames = eMesh.patchNames();
-    const HashTable<ensightMesh::nFacePrimitives>&
-        nPatchPrims = eMesh.nPatchPrims();
-    const List<faceSets>& faceZoneFaceSets = eMesh.faceZoneFaceSets();
-    const wordHashSet& faceZoneNames = eMesh.faceZoneNames();
-    const HashTable<ensightMesh::nFacePrimitives>&
-        nFaceZonePrims = eMesh.nFaceZonePrims();
-
-    const labelList& tets = meshCellSets.tets;
-    const labelList& pyrs = meshCellSets.pyrs;
-    const labelList& prisms = meshCellSets.prisms;
-    const labelList& wedges = meshCellSets.wedges;
-    const labelList& hexes = meshCellSets.hexes;
-    const labelList& polys = meshCellSets.polys;
-
-    std::ofstream *ensightFilePtr = NULL;
+    ensightStream* ensightFilePtr = NULL;
     if (Pstream::master())
     {
         // set the filename of the ensight file
-        fileName ensightFileName(timeFile + "." + fieldObject.name());
-        ensightFilePtr = new std::ofstream
-        (
-            (postProcPath/ensightFileName).c_str(),
-            ios_base::out | ios_base::binary | ios_base::trunc
-        );
-        // Check on file opened?
-    }
+        fileName ensightFileName(timeFile + "." + pf.name());
 
-    std::ofstream& ensightFile = *ensightFilePtr;
+        if (binary)
+        {
+            ensightFilePtr = new ensightBinaryStream
+            (
+                postProcPath/ensightFileName,
+                eMesh.mesh().time()
+            );
+        }
+        else
+        {
+            ensightFilePtr = new ensightAsciiStream
+            (
+                postProcPath/ensightFileName,
+                eMesh.mesh().time()
+            );
+        }
+    }
 
-    GeometricField<Type, fvPatchField, volMesh> vf(fieldObject, mesh);
+    ensightStream& ensightFile = *ensightFilePtr;
 
-    if (patchNames.empty())
+    if (eMesh.patchNames().empty())
     {
         eMesh.barrier();
 
@@ -800,192 +649,49 @@ void ensightFieldBinary
 
                 ensightCaseFile
                     << pTraits<Type>::typeName
-                    << " per element:            1       "
-                    << setw(15) << vf.name()
-                    << (' ' + prepend + "***." + vf.name()).c_str()
+                    << " per node:            1       "
+                    << setw(15) << pf.name()
+                    << (' ' + prepend + "***." + pf.name()).c_str()
                     << nl;
             }
 
-            writeEnsDataBinary(pTraits<Type>::typeName,ensightFile);
-            writeEnsDataBinary("part",ensightFile);
-            writeEnsDataBinary(1,ensightFile);
+            ensightFile.write(pTraits<Type>::typeName);
+            ensightFile.write("part");
+            ensightFile.write(1);
         }
 
-        if (meshCellSets.nHexesWedges)
+        if (Pstream::master())
         {
-            if (Pstream::master())
-            {
-                writeEnsDataBinary("hexa8",ensightFile);
+            ensightFile.write("coordinates");
 
-                for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
-                {
-                    writeEnsDataBinary
-                    (
-                        map(vf, hexes, wedges, cmpt),
-                        ensightFile
-                    );
+            Field<Type> uniqueFld(pf.internalField(), eMesh.uniquePointMap());
 
-                    for (int slave=1; slave<Pstream::nProcs(); slave++)
-                    {
-                        IPstream fromSlave(Pstream::scheduled, slave);
-                        scalarField data(fromSlave);
-                        writeEnsDataBinary(data, ensightFile);
-                    }
-                }
-            }
-            else
+            for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
             {
-                for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
+                ensightFile.write(uniqueFld.component(cmpt));
+
+                for (int slave=1; slave<Pstream::nProcs(); slave++)
                 {
-                    OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
-                    toMaster<< map(vf, hexes, wedges, cmpt);
+                    IPstream fromSlave(Pstream::scheduled, slave);
+                    scalarField data(fromSlave);
+                    ensightFile.write(data);
                 }
             }
         }
-
-        writeAllDataBinary
-        (
-            "penta6",
-            vf,
-            prisms,
-            meshCellSets.nPrisms,
-            ensightFile
-        );
-
-        writeAllDataBinary
-        (
-            "pyramid5",
-            vf,
-            pyrs,
-            meshCellSets.nPyrs,
-            ensightFile
-        );
-
-        writeAllDataBinary
-        (
-            "tetra4",
-            vf,
-            tets,
-            meshCellSets.nTets,
-            ensightFile
-        );
-
-        writeAllDataBinary
-        (
-            "nfaced",
-            vf,
-            polys,
-            meshCellSets.nPolys,
-            ensightFile
-        );
-    }
-
-    label ensightPatchI = eMesh.patchPartOffset();
-
-    forAll(allPatchNames, patchi)
-    {
-        const word& patchName = allPatchNames[patchi];
-
-        eMesh.barrier();
-
-        if (patchNames.empty() || patchNames.found(patchName))
-        {
-            if
-            (
-                writePatchFieldBinary
-                (
-                    vf.boundaryField()[patchi],
-                    patchi,
-                    ensightPatchI,
-                    boundaryFaceSets[patchi],
-                    nPatchPrims.find(patchName)(),
-                    ensightFile
-                )
-            )
-            {
-                ensightPatchI++;
-            }
-        }
-
-    }
-
-    // write faceZones, if requested
-    if (faceZoneNames.size())
-    {
-        // Interpolates cell values to faces - needed only when exporting
-        // faceZones...
-        GeometricField<Type, fvsPatchField, surfaceMesh> sf
-        (
-            linearInterpolate(vf)
-        );
-
-        forAllConstIter(wordHashSet, faceZoneNames, iter)
+        else
         {
-            const word& faceZoneName = iter.key();
-
-            eMesh.barrier();
-
-            label zoneID = mesh.faceZones().findZoneID(faceZoneName);
-
-            const faceZone& fz = mesh.faceZones()[zoneID];
-
-            // Prepare data to write
-            label nIncluded = 0;
-            forAll(fz, i)
-            {
-                if (eMesh.faceToBeIncluded(fz[i]))
-                {
-                    ++nIncluded;
-                }
-            }
-
-            Field<Type> values(nIncluded);
-
-            // Loop on the faceZone and store the needed field values
-            label j = 0;
-            forAll(fz, i)
-            {
-                label faceI = fz[i];
-                if (mesh.isInternalFace(faceI))
-                {
-                    values[j] = sf[faceI];
-                    ++j;
-                }
-                else
-                {
-                    if (eMesh.faceToBeIncluded(faceI))
-                    {
-                        label patchI = mesh.boundaryMesh().whichPatch(faceI);
-                        const polyPatch& pp = mesh.boundaryMesh()[patchI];
-                        label patchFaceI = pp.whichFace(faceI);
-                        Type value = sf.boundaryField()[patchI][patchFaceI];
-                        values[j] = value;
-                        ++j;
-                    }
-                }
-            }
-
-            if
-            (
-                writePatchFieldBinary
-                (
-                    values,
-                    zoneID,
-                    ensightPatchI,
-                    faceZoneFaceSets[zoneID],
-                    nFaceZonePrims.find(faceZoneName)(),
-                    ensightFile
-                )
-            )
+            Field<Type> uniqueFld(pf.internalField(), eMesh.uniquePointMap());
+            for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
             {
-                ensightPatchI++;
+                OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
+                toMaster<< uniqueFld.component(cmpt);
             }
         }
     }
 
     if (Pstream::master())
     {
-        ensightFile.close();
+        delete ensightFilePtr;
     }
 }
 
@@ -999,30 +705,42 @@ void ensightField
     const Foam::word& prepend,
     const Foam::label timeIndex,
     const bool binary,
+    const bool nodeValues,
     Foam::Ostream& ensightCaseFile
 )
 {
-    if (binary)
+    // Read field
+    GeometricField<Type, fvPatchField, volMesh> vf(fieldObject, eMesh.mesh());
+
+    if (nodeValues)
     {
-        ensightFieldBinary<Type>
+        tmp<GeometricField<Type, pointPatchField, pointMesh> > pfld
         (
-            fieldObject,
+            volPointInterpolation::New(eMesh.mesh()).interpolate(vf)
+        );
+        pfld().rename(vf.name());
+
+        ensightPointField<Type>
+        (
+            pfld,
             eMesh,
             postProcPath,
             prepend,
             timeIndex,
+            binary,
             ensightCaseFile
         );
     }
     else
     {
-        ensightFieldAscii<Type>
+        ensightField<Type>
         (
-            fieldObject,
+            vf,
             eMesh,
             postProcPath,
             prepend,
             timeIndex,
+            binary,
             ensightCaseFile
         );
     }
diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C
index 00c733890aa4d0c6f7740b821e55a3224c837de1..59c30e34939c78b12cfa3dc355816c85f0a1be2b 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C
+++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C
@@ -23,9 +23,9 @@ License
 
 \*---------------------------------------------------------------------------*/
 
+#include "ensightMesh.H"
 #include "argList.H"
 #include "Time.H"
-#include "ensightMesh.H"
 #include "fvMesh.H"
 #include "globalMeshData.H"
 #include "PstreamCombineReduceOps.H"
@@ -33,38 +33,31 @@ License
 #include "cellModeller.H"
 #include "IOmanip.H"
 #include "itoa.H"
-#include "ensightWriteBinary.H"
 #include "globalIndex.H"
 #include "mapDistribute.H"
 #include "stringListOps.H"
 
+#include "ensightBinaryStream.H"
+#include "ensightAsciiStream.H"
+
 #include <fstream>
 
 // * * * * * * * * * * * * * Private Functions * * * * * * * * * * * * * * //
 
-// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
-
-Foam::ensightMesh::ensightMesh
-(
-    const fvMesh& mesh,
-    const argList& args,
-    const bool binary
-)
-:
-    mesh_(mesh),
-    binary_(binary),
-    patchPartOffset_(2),
-    meshCellSets_(mesh_.nCells()),
-    boundaryFaceSets_(mesh_.boundary().size()),
-    allPatchNames_(0),
-    patchNames_(0),
-    nPatchPrims_(0),
-    faceZoneFaceSets_(mesh_.faceZones().size()),
-    faceZoneNames_(0),
-    nFaceZonePrims_(0),
-    boundaryFaceToBeIncluded_(0)
+void Foam::ensightMesh::correct()
 {
-    const cellShapeList& cellShapes = mesh.cellShapes();
+    patchPartOffset_ = 2;
+    meshCellSets_ = mesh_.nCells();
+    boundaryFaceSets_.setSize(mesh_.boundary().size());
+    allPatchNames_.clear();
+    patchNames_.clear();
+    nPatchPrims_ = 0;
+    faceZoneFaceSets_.setSize(mesh_.faceZones().size());
+    faceZoneNames_.clear();
+    nFaceZonePrims_ = 0;
+    boundaryFaceToBeIncluded_.clear();
+
+    const cellShapeList& cellShapes = mesh_.cellShapes();
 
     const cellModel& tet = *(cellModeller::lookup("tet"));
     const cellModel& pyr = *(cellModeller::lookup("pyr"));
@@ -72,7 +65,7 @@ Foam::ensightMesh::ensightMesh
     const cellModel& wedge = *(cellModeller::lookup("wedge"));
     const cellModel& hex = *(cellModeller::lookup("hex"));
 
-    if (!args.optionFound("noPatches"))
+    if (!noPatches_)
     {
         // Patches are output. Check that they're synced.
         mesh_.boundaryMesh().checkParallelSync(true);
@@ -84,11 +77,9 @@ Foam::ensightMesh::ensightMesh
           - mesh_.globalData().processorPatches().size()
         );
 
-        if (args.optionFound("patches"))
+        if (patches_)
         {
-            wordReList patterns(args.optionLookup("patches")());
-
-            if (patterns.empty())
+            if (patchPatterns_.empty())
             {
                 forAll(allPatchNames_, nameI)
                 {
@@ -101,7 +92,7 @@ Foam::ensightMesh::ensightMesh
                 forAll(allPatchNames_, nameI)
                 {
                     const word& patchName = allPatchNames_[nameI];
-                    if (findStrings(patterns, patchName))
+                    if (findStrings(patchPatterns_, patchName))
                     {
                         patchNames_.insert(patchName);
                     }
@@ -184,15 +175,23 @@ Foam::ensightMesh::ensightMesh
 
         meshCellSets_.nPolys = nPolys;
         reduce(meshCellSets_.nPolys, sumOp<label>());
+
+
+        // Determine parallel shared points
+        globalPointsPtr_ = mesh_.globalData().mergePoints
+        (
+            pointToGlobal_,
+            uniquePointMap_
+        );
     }
 
-    if (!args.optionFound("noPatches"))
+    if (!noPatches_)
     {
-        forAll(mesh.boundary(), patchi)
+        forAll(mesh_.boundary(), patchi)
         {
-            if (mesh.boundary()[patchi].size())
+            if (mesh_.boundary()[patchi].size())
             {
-                const polyPatch& p = mesh.boundaryMesh()[patchi];
+                const polyPatch& p = mesh_.boundaryMesh()[patchi];
 
                 labelList& tris = boundaryFaceSets_[patchi].tris;
                 labelList& quads = boundaryFaceSets_[patchi].quads;
@@ -238,7 +237,7 @@ Foam::ensightMesh::ensightMesh
 
         if (patchNames_.empty() || patchNames_.found(patchName))
         {
-            if (mesh.boundary()[patchi].size())
+            if (mesh_.boundary()[patchi].size())
             {
                 nfp.nTris   = boundaryFaceSets_[patchi].tris.size();
                 nfp.nQuads  = boundaryFaceSets_[patchi].quads.size();
@@ -254,17 +253,15 @@ Foam::ensightMesh::ensightMesh
     }
 
     // faceZones
-    if (args.optionFound("faceZones"))
+    if (faceZones_)
     {
-        wordReList patterns(args.optionLookup("faceZones")());
-
         const wordList faceZoneNamesAll = mesh_.faceZones().names();
 
         // Find faceZone names which match that requested at command-line
         forAll(faceZoneNamesAll, nameI)
         {
             const word& zoneName = faceZoneNamesAll[nameI];
-            if (findStrings(patterns, zoneName))
+            if (findStrings(faceZonePatterns_, zoneName))
             {
                 faceZoneNames_.insert(zoneName);
             }
@@ -300,7 +297,7 @@ Foam::ensightMesh::ensightMesh
         {
             //const word& zoneName = faceZoneNamesAll[zoneI];
 
-            const faceZone& fz = mesh.faceZones()[zoneI];
+            const faceZone& fz = mesh_.faceZones()[zoneI];
 
             if (fz.size())
             {
@@ -380,6 +377,35 @@ Foam::ensightMesh::ensightMesh
 }
 
 
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
+
+Foam::ensightMesh::ensightMesh
+(
+    const fvMesh& mesh,
+    const bool noPatches,
+
+    const bool patches,
+    const wordReList& patchPatterns,
+
+    const bool faceZones,
+    const wordReList& faceZonePatterns,
+
+    const bool binary
+)
+:
+    mesh_(mesh),
+    noPatches_(noPatches),
+    patches_(patches),
+    patchPatterns_(patchPatterns),
+    faceZones_(faceZones),
+    faceZonePatterns_(faceZonePatterns),
+    binary_(binary),
+    meshCellSets_(mesh.nCells())
+{
+    correct();
+}
+
+
 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
 
 Foam::ensightMesh::~ensightMesh()
@@ -412,19 +438,6 @@ void Foam::ensightMesh::barrier()
 }
 
 
-void Foam::ensightMesh::writePoints
-(
-    const scalarField& pointsComponent,
-    OFstream& ensightGeometryFile
-) const
-{
-    forAll(pointsComponent, pointI)
-    {
-        ensightGeometryFile<< setw(12) << float(pointsComponent[pointI]) << nl;
-    }
-}
-
-
 Foam::cellShapeList Foam::ensightMesh::map
 (
     const cellShapeList& cellShapes,
@@ -489,35 +502,10 @@ Foam::cellShapeList Foam::ensightMesh::map
 void Foam::ensightMesh::writePrims
 (
     const cellShapeList& cellShapes,
-    OFstream& ensightGeometryFile
-) const
-{
-    forAll(cellShapes, i)
-    {
-        const cellShape& cellPoints = cellShapes[i];
-
-        forAll(cellPoints, pointI)
-        {
-            ensightGeometryFile
-                << setw(10)
-                << cellPoints[pointI] + 1;
-        }
-        ensightGeometryFile << nl;
-    }
-}
-
-
-void Foam::ensightMesh::writePrimsBinary
-(
-    const cellShapeList& cellShapes,
-    std::ofstream& ensightGeometryFile
+    ensightStream& ensightGeometryFile
 ) const
 {
     // Create a temp int array
-    int numElem;
-
-    numElem = cellShapes.size();
-
     if (cellShapes.size())
     {
         // All the cellShapes have the same number of elements!
@@ -536,12 +524,7 @@ void Foam::ensightMesh::writePrimsBinary
                 n++;
             }
         }
-
-        ensightGeometryFile.write
-        (
-            reinterpret_cast<char*>(temp.begin()),
-            numIntElem*sizeof(int)
-        );
+        ensightGeometryFile.write(temp);
     }
 }
 
@@ -550,13 +533,12 @@ void Foam::ensightMesh::writePolysNFaces
 (
     const labelList& polys,
     const cellList& cellFaces,
-    OFstream& ensightGeometryFile
+    ensightStream& ensightGeometryFile
 ) const
 {
     forAll(polys, i)
     {
-        ensightGeometryFile
-            << setw(10) << cellFaces[polys[i]].size() << nl;
+        ensightGeometryFile.write(cellFaces[polys[i]].size());
     }
 }
 
@@ -566,7 +548,7 @@ void Foam::ensightMesh::writePolysNPointsPerFace
     const labelList& polys,
     const cellList& cellFaces,
     const faceList& faces,
-    OFstream& ensightGeometryFile
+    ensightStream& ensightGeometryFile
 ) const
 {
     forAll(polys, i)
@@ -575,8 +557,7 @@ void Foam::ensightMesh::writePolysNPointsPerFace
 
         forAll(cf, faceI)
         {
-            ensightGeometryFile
-                << setw(10) << faces[cf[faceI]].size() << nl;
+            ensightGeometryFile.write(faces[cf[faceI]].size());
         }
     }
 }
@@ -587,7 +568,7 @@ void Foam::ensightMesh::writePolysPoints
     const labelList& polys,
     const cellList& cellFaces,
     const faceList& faces,
-    OFstream& ensightGeometryFile
+    ensightStream& ensightGeometryFile
 ) const
 {
     forAll(polys, i)
@@ -598,11 +579,12 @@ void Foam::ensightMesh::writePolysPoints
         {
             const face& f = faces[cf[faceI]];
 
+            List<int> temp(f.size());
             forAll(f, pointI)
             {
-                ensightGeometryFile << setw(10) << f[pointI] + 1;
+                temp[pointI] = f[pointI] + 1;
             }
-            ensightGeometryFile << nl;
+            ensightGeometryFile.write(temp);
         }
     }
 }
@@ -611,7 +593,7 @@ void Foam::ensightMesh::writePolysPoints
 void Foam::ensightMesh::writeAllPolys
 (
     const labelList& pointToGlobal,
-    OFstream& ensightGeometryFile
+    ensightStream& ensightGeometryFile
 ) const
 {
     if (meshCellSets_.nPolys)
@@ -626,8 +608,8 @@ void Foam::ensightMesh::writeAllPolys
 
         if (Pstream::master())
         {
-            ensightGeometryFile
-                << "nfaced" << nl << setw(10) << meshCellSets_.nPolys << nl;
+            ensightGeometryFile.write("nfaced");
+            ensightGeometryFile.write(meshCellSets_.nPolys);
         }
 
         // Number of faces for each poly cell
@@ -735,150 +717,156 @@ void Foam::ensightMesh::writeAllPolys
 }
 
 
-void Foam::ensightMesh::writePolysNFacesBinary
+void Foam::ensightMesh::writeAllPrims
 (
-    const labelList& polys,
-    const cellList& cellFaces,
-    std::ofstream& ensightGeometryFile
+    const char* key,
+    const label nPrims,
+    const cellShapeList& cellShapes,
+    ensightStream& ensightGeometryFile
 ) const
 {
-    forAll(polys, i)
+    if (nPrims)
     {
-        writeEnsDataBinary
-        (
-            cellFaces[polys[i]].size(),
-            ensightGeometryFile
-        );
-    }
-}
+        if (Pstream::master())
+        {
+            ensightGeometryFile.write(key);
+            ensightGeometryFile.write(nPrims);
 
+            writePrims(cellShapes, ensightGeometryFile);
 
-void Foam::ensightMesh::writePolysNPointsPerFaceBinary
-(
-    const labelList& polys,
-    const cellList& cellFaces,
-    const faceList& faces,
-    std::ofstream& ensightGeometryFile
-) const
-{
-    forAll(polys, i)
-    {
-        const labelList& cf = cellFaces[polys[i]];
+            for (int slave=1; slave<Pstream::nProcs(); slave++)
+            {
+                IPstream fromSlave(Pstream::scheduled, slave);
+                cellShapeList cellShapes(fromSlave);
 
-        forAll(cf, faceI)
+                writePrims(cellShapes, ensightGeometryFile);
+            }
+        }
+        else
         {
-            writeEnsDataBinary
-            (
-                faces[cf[faceI]].size(),
-                ensightGeometryFile
-            );
+            OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
+            toMaster<< cellShapes;
         }
     }
 }
 
 
-void Foam::ensightMesh::writePolysPointsBinary
+void Foam::ensightMesh::writeFacePrims
 (
-    const labelList& polys,
-    const cellList& cellFaces,
-    const faceList& faces,
-    std::ofstream& ensightGeometryFile
+    const faceList& patchFaces,
+    ensightStream& ensightGeometryFile
 ) const
 {
-    forAll(polys, i)
+    forAll(patchFaces, i)
     {
-        const labelList& cf = cellFaces[polys[i]];
+        const face& patchFace = patchFaces[i];
 
-        forAll(cf, faceI)
+        List<int> temp(patchFace.size());
+        forAll(patchFace, pointI)
         {
-            const face& f = faces[cf[faceI]];
-
-            forAll(f, pointI)
-            {
-                writeEnsDataBinary(f[pointI] + 1,ensightGeometryFile);
-            }
+            temp[pointI] = patchFace[pointI] + 1;
         }
+
+        ensightGeometryFile.write(temp);
     }
 }
 
 
-void Foam::ensightMesh::writeAllPolysBinary
+void Foam::ensightMesh::writeAllFacePrims
 (
-    const labelList& pointToGlobal,
-    std::ofstream& ensightGeometryFile
+    const char* key,
+    const labelList& prims,
+    const label nPrims,
+    const faceList& patchFaces,
+    ensightStream& ensightGeometryFile
 ) const
 {
-    if (meshCellSets_.nPolys)
+    if (nPrims)
     {
-        const cellList& cellFaces = mesh_.cells();
-        // Renumber faces to use global point numbers
-        faceList faces(mesh_.faces());
-        forAll(faces, i)
-        {
-            inplaceRenumber(pointToGlobal, faces[i]);
-        }
-
         if (Pstream::master())
         {
-            writeEnsDataBinary("nfaced",ensightGeometryFile);
-            writeEnsDataBinary(meshCellSets_.nPolys,ensightGeometryFile);
-        }
+            ensightGeometryFile.write(key);
+            ensightGeometryFile.write(nPrims);
 
-        // Number of faces for each poly cell
-        if (Pstream::master())
-        {
-            // Master
-            writePolysNFacesBinary
+            writeFacePrims
             (
-                meshCellSets_.polys,
-                cellFaces,
+                UIndirectList<face>(patchFaces, prims)(),
                 ensightGeometryFile
             );
-            // Slaves
+
             for (int slave=1; slave<Pstream::nProcs(); slave++)
             {
                 IPstream fromSlave(Pstream::scheduled, slave);
-                labelList polys(fromSlave);
-                cellList cellFaces(fromSlave);
+                faceList patchFaces(fromSlave);
 
-                writePolysNFacesBinary
-                (
-                    polys,
-                    cellFaces,
-                    ensightGeometryFile
-                );
+                writeFacePrims(patchFaces, ensightGeometryFile);
             }
         }
         else
         {
             OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
-            toMaster<< meshCellSets_.polys << cellFaces;
+            toMaster<< UIndirectList<face>(patchFaces, prims);
         }
+    }
+}
 
-        // Number of points for each face of the above list
+
+void Foam::ensightMesh::writeNSidedNPointsPerFace
+(
+    const faceList& patchFaces,
+    ensightStream& ensightGeometryFile
+) const
+{
+    forAll(patchFaces, i)
+    {
+        ensightGeometryFile.write(patchFaces[i].size());
+    }
+}
+
+
+void Foam::ensightMesh::writeNSidedPoints
+(
+    const faceList& patchFaces,
+    ensightStream& ensightGeometryFile
+) const
+{
+    writeFacePrims(patchFaces, ensightGeometryFile);
+}
+
+
+void Foam::ensightMesh::writeAllNSided
+(
+    const labelList& prims,
+    const label nPrims,
+    const faceList& patchFaces,
+    ensightStream& ensightGeometryFile
+) const
+{
+    if (nPrims)
+    {
         if (Pstream::master())
         {
-            // Master
-            writePolysNPointsPerFaceBinary
+            ensightGeometryFile.write("nsided");
+            ensightGeometryFile.write(nPrims);
+        }
+
+        // Number of points for each face
+        if (Pstream::master())
+        {
+            writeNSidedNPointsPerFace
             (
-                meshCellSets_.polys,
-                cellFaces,
-                faces,
+                UIndirectList<face>(patchFaces, prims)(),
                 ensightGeometryFile
             );
-            // Slaves
+
             for (int slave=1; slave<Pstream::nProcs(); slave++)
             {
                 IPstream fromSlave(Pstream::scheduled, slave);
-                labelList polys(fromSlave);
-                cellList cellFaces(fromSlave);
-                faceList faces(fromSlave);
+                faceList patchFaces(fromSlave);
 
-                writePolysNPointsPerFaceBinary
+                writeNSidedNPointsPerFace
                 (
-                    polys,
-                    cellFaces,
-                    faces,
+                    patchFaces,
                     ensightGeometryFile
                 );
             }
@@ -886,977 +874,130 @@ void Foam::ensightMesh::writeAllPolysBinary
         else
         {
             OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
-            toMaster<< meshCellSets_.polys << cellFaces << faces;
+            toMaster<< UIndirectList<face>(patchFaces, prims);
         }
 
-        // List of points id for each face of the above list
+        // List of points id for each face
         if (Pstream::master())
         {
-            // Master
-            writePolysPointsBinary
+            writeNSidedPoints
             (
-                meshCellSets_.polys,
-                cellFaces,
-                faces,
+                UIndirectList<face>(patchFaces, prims)(),
                 ensightGeometryFile
             );
-            // Slaves
+
             for (int slave=1; slave<Pstream::nProcs(); slave++)
             {
                 IPstream fromSlave(Pstream::scheduled, slave);
-                labelList polys(fromSlave);
-                cellList cellFaces(fromSlave);
-                faceList faces(fromSlave);
+                faceList patchFaces(fromSlave);
 
-                writePolysPointsBinary
-                (
-                    polys,
-                    cellFaces,
-                    faces,
-                    ensightGeometryFile
-                );
+                writeNSidedPoints(patchFaces, ensightGeometryFile);
             }
         }
         else
         {
             OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
-            toMaster<< meshCellSets_.polys << cellFaces << faces;
+            toMaster<< UIndirectList<face>(patchFaces, prims);
         }
     }
 }
 
 
-void Foam::ensightMesh::writeAllPrims
+void Foam::ensightMesh::writeAllInternalPoints
 (
-    const char* key,
-    const label nPrims,
-    const cellShapeList& cellShapes,
-    OFstream& ensightGeometryFile
+    const pointField& uniquePoints,
+    const label nPoints,
+    ensightStream& ensightGeometryFile
 ) const
 {
-    if (nPrims)
+    barrier();
+
+    if (Pstream::master())
     {
-        if (Pstream::master())
+        ensightGeometryFile.writePartHeader(1);
+        ensightGeometryFile.write("internalMesh");
+        ensightGeometryFile.write("coordinates");
+        ensightGeometryFile.write(nPoints);
+
+        for (direction d=0; d<vector::nComponents; d++)
         {
-            ensightGeometryFile << key << nl << setw(10) << nPrims << nl;
+            ensightGeometryFile.write(uniquePoints.component(d));
 
-            writePrims(cellShapes, ensightGeometryFile);
-
-            for (int slave=1; slave<Pstream::nProcs(); slave++)
-            {
-                IPstream fromSlave(Pstream::scheduled, slave);
-                cellShapeList cellShapes(fromSlave);
-
-                writePrims(cellShapes, ensightGeometryFile);
-            }
-        }
-        else
-        {
-            OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
-            toMaster<< cellShapes;
-        }
-    }
-}
-
-
-void Foam::ensightMesh::writeAllPrimsBinary
-(
-    const char* key,
-    const label nPrims,
-    const cellShapeList& cellShapes,
-    std::ofstream& ensightGeometryFile
-) const
-{
-    if (nPrims)
-    {
-        if (Pstream::master())
-        {
-            writeEnsDataBinary(key,ensightGeometryFile);
-            writeEnsDataBinary(nPrims,ensightGeometryFile);
-
-            writePrimsBinary(cellShapes, ensightGeometryFile);
-
-            for (int slave=1; slave<Pstream::nProcs(); slave++)
-            {
-                IPstream fromSlave(Pstream::scheduled, slave);
-                cellShapeList cellShapes(fromSlave);
-
-                writePrimsBinary(cellShapes, ensightGeometryFile);
-            }
-        }
-        else
-        {
-            OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
-            toMaster<< cellShapes;
-        }
-    }
-}
-
-
-void Foam::ensightMesh::writeFacePrims
-(
-    const faceList& patchFaces,
-    OFstream& ensightGeometryFile
-) const
-{
-    forAll(patchFaces, i)
-    {
-        const face& patchFace = patchFaces[i];
-
-        forAll(patchFace, pointI)
-        {
-            ensightGeometryFile << setw(10) << patchFace[pointI] + 1;
-        }
-        ensightGeometryFile << nl;
-    }
-}
-
-
-void Foam::ensightMesh::writeFacePrimsBinary
-(
-    const faceList& patchFaces,
-    std::ofstream& ensightGeometryFile
-) const
-{
-    forAll(patchFaces, i)
-    {
-        const face& patchFace = patchFaces[i];
-
-        forAll(patchFace, pointI)
-        {
-            writeEnsDataBinary(patchFace[pointI] + 1, ensightGeometryFile);
-        }
-    }
-}
-
-
-void Foam::ensightMesh::writeAllFacePrims
-(
-    const char* key,
-    const labelList& prims,
-    const label nPrims,
-    const faceList& patchFaces,
-    OFstream& ensightGeometryFile
-) const
-{
-    if (nPrims)
-    {
-        if (Pstream::master())
-        {
-            ensightGeometryFile << key << nl << setw(10) << nPrims << nl;
-
-            writeFacePrims
-            (
-                UIndirectList<face>(patchFaces, prims)(),
-                ensightGeometryFile
-            );
-
-            for (int slave=1; slave<Pstream::nProcs(); slave++)
-            {
-                IPstream fromSlave(Pstream::scheduled, slave);
-                faceList patchFaces(fromSlave);
-
-                writeFacePrims(patchFaces, ensightGeometryFile);
-            }
-        }
-        else
-        {
-            OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
-            toMaster<< UIndirectList<face>(patchFaces, prims);
-        }
-    }
-}
-
-
-void Foam::ensightMesh::writeNSidedNPointsPerFace
-(
-    const faceList& patchFaces,
-    OFstream& ensightGeometryFile
-) const
-{
-    forAll(patchFaces, i)
-    {
-        ensightGeometryFile << setw(10) << patchFaces[i].size() << nl;
-    }
-}
-
-
-void Foam::ensightMesh::writeNSidedPoints
-(
-    const faceList& patchFaces,
-    OFstream& ensightGeometryFile
-) const
-{
-    writeFacePrims(patchFaces, ensightGeometryFile);
-}
-
-
-void Foam::ensightMesh::writeAllNSided
-(
-    const labelList& prims,
-    const label nPrims,
-    const faceList& patchFaces,
-    OFstream& ensightGeometryFile
-) const
-{
-    if (nPrims)
-    {
-        if (Pstream::master())
-        {
-            ensightGeometryFile
-                << "nsided" << nl << setw(10) << nPrims << nl;
-        }
-
-        // Number of points for each face
-        if (Pstream::master())
-        {
-            writeNSidedNPointsPerFace
-            (
-                UIndirectList<face>(patchFaces, prims)(),
-                ensightGeometryFile
-            );
-
-            for (int slave=1; slave<Pstream::nProcs(); slave++)
-            {
-                IPstream fromSlave(Pstream::scheduled, slave);
-                faceList patchFaces(fromSlave);
-
-                writeNSidedNPointsPerFace
-                (
-                    patchFaces,
-                    ensightGeometryFile
-                );
-            }
-        }
-        else
-        {
-            OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
-            toMaster<< UIndirectList<face>(patchFaces, prims);
-        }
-
-        // List of points id for each face
-        if (Pstream::master())
-        {
-            writeNSidedPoints
-            (
-                UIndirectList<face>(patchFaces, prims)(),
-                ensightGeometryFile
-            );
-
-            for (int slave=1; slave<Pstream::nProcs(); slave++)
-            {
-                IPstream fromSlave(Pstream::scheduled, slave);
-                faceList patchFaces(fromSlave);
-
-                writeNSidedPoints(patchFaces, ensightGeometryFile);
-            }
-        }
-        else
-        {
-            OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
-            toMaster<< UIndirectList<face>(patchFaces, prims);
-        }
-    }
-}
-
-
-void Foam::ensightMesh::writeNSidedPointsBinary
-(
-    const faceList& patchFaces,
-    std::ofstream& ensightGeometryFile
-) const
-{
-    writeFacePrimsBinary(patchFaces, ensightGeometryFile);
-}
-
-
-void Foam::ensightMesh::writeNSidedNPointsPerFaceBinary
-(
-    const faceList& patchFaces,
-    std::ofstream& ensightGeometryFile
-) const
-{
-    forAll(patchFaces, i)
-    {
-        writeEnsDataBinary(patchFaces[i].size(), ensightGeometryFile);
-    }
-}
-
-
-void Foam::ensightMesh::writeAllNSidedBinary
-(
-    const labelList& prims,
-    const label nPrims,
-    const faceList& patchFaces,
-    std::ofstream& ensightGeometryFile
-) const
-{
-    if (nPrims)
-    {
-        if (Pstream::master())
-        {
-            writeEnsDataBinary("nsided",ensightGeometryFile);
-            writeEnsDataBinary(nPrims,ensightGeometryFile);
-        }
-
-        // Number of points for each face
-        if (Pstream::master())
-        {
-            writeNSidedNPointsPerFaceBinary
-            (
-                UIndirectList<face>(patchFaces, prims)(),
-                ensightGeometryFile
-            );
-
-            for (int slave=1; slave<Pstream::nProcs(); slave++)
-            {
-                IPstream fromSlave(Pstream::scheduled, slave);
-                faceList patchFaces(fromSlave);
-
-                writeNSidedNPointsPerFaceBinary
-                (
-                    patchFaces,
-                    ensightGeometryFile
-                );
-            }
-        }
-        else
-        {
-            OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
-            toMaster<< UIndirectList<face>(patchFaces, prims);
-        }
-
-        // List of points id for each face
-        if (Pstream::master())
-        {
-            writeNSidedPointsBinary
-            (
-                UIndirectList<face>(patchFaces, prims)(),
-                ensightGeometryFile
-            );
-
-            for (int slave=1; slave<Pstream::nProcs(); slave++)
-            {
-                IPstream fromSlave(Pstream::scheduled, slave);
-                faceList patchFaces(fromSlave);
-
-                writeNSidedPointsBinary(patchFaces, ensightGeometryFile);
-            }
-        }
-        else
-        {
-            OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
-            toMaster<< UIndirectList<face>(patchFaces, prims);
-        }
-    }
-}
-
-
-void Foam::ensightMesh::writeAllFacePrimsBinary
-(
-    const char* key,
-    const labelList& prims,
-    const label nPrims,
-    const faceList& patchFaces,
-    std::ofstream& ensightGeometryFile
-) const
-{
-    if (nPrims)
-    {
-        if (Pstream::master())
-        {
-            writeEnsDataBinary(key,ensightGeometryFile);
-            writeEnsDataBinary(nPrims,ensightGeometryFile);
-
-            writeFacePrimsBinary
-            (
-                UIndirectList<face>(patchFaces, prims)(),
-                ensightGeometryFile
-            );
-
-            for (int slave=1; slave<Pstream::nProcs(); slave++)
-            {
-                IPstream fromSlave(Pstream::scheduled, slave);
-                faceList patchFaces(fromSlave);
-
-                writeFacePrimsBinary(patchFaces, ensightGeometryFile);
-            }
-        }
-        else
-        {
-            OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
-            toMaster<< UIndirectList<face>(patchFaces, prims);
-        }
-    }
-}
-
-
-void Foam::ensightMesh::write
-(
-    const fileName& postProcPath,
-    const word& prepend,
-    const label timeIndex,
-    Ostream& ensightCaseFile
-) const
-{
-    // Find global point numbering
-    labelList pointToGlobal;
-    labelList uniquePointMap;
-    autoPtr<globalIndex> globalPoints = mesh_.globalData().mergePoints
-    (
-        pointToGlobal,
-        uniquePointMap
-    );
-
-    const pointField uniquePoints(mesh_.points(), uniquePointMap);
-
-    if (binary_)
-    {
-        writeBinary
-        (
-            postProcPath,
-            prepend,
-            timeIndex,
-            ensightCaseFile,
-            pointToGlobal,
-            uniquePoints,
-            globalPoints()
-        );
-    }
-    else
-    {
-        writeAscii
-        (
-            postProcPath,
-            prepend,
-            timeIndex,
-            ensightCaseFile,
-            pointToGlobal,
-            uniquePoints,
-            globalPoints()
-        );
-    }
-}
-
-void Foam::ensightMesh::writeAllInternalPoints
-(
-    const pointField& uniquePoints,
-    const label nPoints,
-    OFstream& ensightGeometryFile
-) const
-{
-    barrier();
-
-    if (Pstream::master())
-    {
-        ensightGeometryFile
-            << "part" << nl
-            << setw(10) << 1 << nl
-            << "internalMesh" << nl
-            << "coordinates" << nl
-            << setw(10) << nPoints
-            << endl;
-
-        for (direction d=0; d<vector::nComponents; d++)
-        {
-            writePoints(uniquePoints.component(d), ensightGeometryFile);
-
-            for (int slave=1; slave<Pstream::nProcs(); slave++)
-            {
-                IPstream fromSlave(Pstream::scheduled, slave);
-                scalarField pointsComponent(fromSlave);
-                writePoints(pointsComponent, ensightGeometryFile);
-            }
-        }
-    }
-    else
-    {
-        for (direction d=0; d<vector::nComponents; d++)
-        {
-            OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
-            toMaster<< uniquePoints.component(d);
-        }
-    }
-}
-
-void Foam::ensightMesh::writeAllInternalPointsBinary
-(
-    const pointField& uniquePoints,
-    const label nPoints,
-    std::ofstream& ensightGeometryFile
-) const
-{
-    barrier();
-
-    if (Pstream::master())
-    {
-        writeEnsDataBinary("part",ensightGeometryFile);
-        writeEnsDataBinary(1,ensightGeometryFile);
-        writeEnsDataBinary("internalMesh",ensightGeometryFile);
-        writeEnsDataBinary("coordinates",ensightGeometryFile);
-        writeEnsDataBinary(nPoints,ensightGeometryFile);
-
-        for (direction d=0; d<vector::nComponents; d++)
-        {
-            writeEnsDataBinary
-            (
-                uniquePoints.component(d),
-                ensightGeometryFile
-            );
-
-            for (int slave=1; slave<Pstream::nProcs(); slave++)
-            {
-                IPstream fromSlave(Pstream::scheduled, slave);
-                scalarField pointsComponent(fromSlave);
-                writeEnsDataBinary(pointsComponent, ensightGeometryFile);
-            }
-        }
-    }
-    else
-    {
-        for (direction d=0; d<vector::nComponents; d++)
-        {
-            OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
-            toMaster<< uniquePoints.component(d);
-        }
-    }
-}
-
-void Foam::ensightMesh::writeAllPatchPoints
-(
-    const label ensightPatchI,
-    const word& patchName,
-    const pointField& uniquePoints,
-    const label nPoints,
-    OFstream& ensightGeometryFile
-) const
-{
-    barrier();
-
-    if (Pstream::master())
-    {
-        ensightGeometryFile
-            << "part" << nl
-            << setw(10) << ensightPatchI << nl
-            << patchName << nl
-            << "coordinates" << nl
-            << setw(10) << nPoints // globalPointsPtr().size()
-            << endl;
-
-        for (direction d=0; d<vector::nComponents; d++)
-        {
-            writePoints
-            (
-                uniquePoints.component(d),
-                ensightGeometryFile
-            );
-
-            for (int slave=1; slave<Pstream::nProcs(); slave++)
-            {
-                IPstream fromSlave(Pstream::scheduled, slave);
-                scalarField patchPointsComponent(fromSlave);
-
-                writePoints
-                (
-                    patchPointsComponent,
-                    ensightGeometryFile
-                );
-            }
-        }
-    }
-    else
-    {
-        for (direction d=0; d<vector::nComponents; d++)
-        {
-            OPstream toMaster
-            (
-                Pstream::scheduled,
-                Pstream::masterNo()
-            );
-            toMaster<< uniquePoints.component(d);
-        }
-    }
-}
-
-void Foam::ensightMesh::writeAllPatchPointsBinary
-(
-    const label ensightPatchI,
-    const word& patchName,
-    const pointField& uniquePoints,
-    const label nPoints,
-    std::ofstream& ensightGeometryFile
-) const
-{
-    barrier();
-
-    if (Pstream::master())
-    {
-        writeEnsDataBinary("part",ensightGeometryFile);
-        writeEnsDataBinary(ensightPatchI,ensightGeometryFile);
-        //writeEnsDataBinary(patchName.c_str(),ensightGeometryFile);
-        writeEnsDataBinary(patchName.c_str(),ensightGeometryFile);
-        writeEnsDataBinary("coordinates",ensightGeometryFile);
-        writeEnsDataBinary
-        (
-            nPoints, //globalPointsPtr().size(),
-            ensightGeometryFile
-        );
-
-        for (direction d=0; d<vector::nComponents; d++)
-        {
-            //writePointsBinary
-            writeEnsDataBinary
-            (
-                uniquePoints.component(d),
-                ensightGeometryFile
-            );
-
-            for (int slave=1; slave<Pstream::nProcs(); slave++)
-            {
-                IPstream fromSlave(Pstream::scheduled, slave);
-                scalarField patchPointsComponent(fromSlave);
-
-                //writePointsBinary
-                writeEnsDataBinary
-                (
-                    patchPointsComponent,
-                    ensightGeometryFile
-                );
-            }
-        }
-    }
-    else
-    {
-        for (direction d=0; d<vector::nComponents; d++)
-        {
-            OPstream toMaster
-            (
-                Pstream::scheduled,
-                Pstream::masterNo()
-            );
-            toMaster<< uniquePoints.component(d);
-        }
-    }
-}
-
-void Foam::ensightMesh::writeAscii
-(
-    const fileName& postProcPath,
-    const word& prepend,
-    const label timeIndex,
-    Ostream& ensightCaseFile,
-    const labelList& pointToGlobal,
-    const pointField& uniquePoints,
-    const globalIndex& globalPoints
-) const
-{
-    const Time& runTime = mesh_.time();
-    //const pointField& points = mesh_.points();
-    const cellShapeList& cellShapes = mesh_.cellShapes();
-
-
-    word timeFile = prepend;
-
-    if (timeIndex == 0)
-    {
-        timeFile += "000.";
-    }
-    else if (mesh_.moving())
-    {
-        timeFile += itoa(timeIndex) + '.';
-    }
-
-    // set the filename of the ensight file
-    fileName ensightGeometryFileName = timeFile + "mesh";
-
-    OFstream *ensightGeometryFilePtr = NULL;
-    if (Pstream::master())
-    {
-        ensightGeometryFilePtr = new OFstream
-        (
-            postProcPath/ensightGeometryFileName,
-            runTime.writeFormat(),
-            runTime.writeVersion(),
-            IOstream::UNCOMPRESSED
-        );
-    }
-
-    OFstream& ensightGeometryFile = *ensightGeometryFilePtr;
-
-    if (Pstream::master())
-    {
-        // Set Format
-        ensightGeometryFile.setf
-        (
-            ios_base::scientific,
-            ios_base::floatfield
-        );
-        ensightGeometryFile.precision(5);
-
-        ensightGeometryFile
-            << "EnSight Geometry File" << nl
-            << "written by OpenFOAM-" << Foam::FOAMversion << nl
-            << "node id assign" << nl
-            << "element id assign" << nl;
-    }
-
-    if (patchNames_.empty())
-    {
-        label nPoints = globalPoints.size();
-
-        writeAllInternalPoints
-        (
-            uniquePoints,
-            nPoints,
-            ensightGeometryFile
-        );
-
-        writeAllPrims
-        (
-            "hexa8",
-            meshCellSets_.nHexesWedges,
-            map         // Rewrite cellShapes to global numbering
-            (
-                cellShapes,
-                meshCellSets_.hexes,
-                meshCellSets_.wedges,
-                pointToGlobal
-            ),
-            ensightGeometryFile
-        );
-
-        writeAllPrims
-        (
-            "penta6",
-            meshCellSets_.nPrisms,
-            map(cellShapes, meshCellSets_.prisms, pointToGlobal),
-            ensightGeometryFile
-        );
-
-        writeAllPrims
-        (
-            "pyramid5",
-            meshCellSets_.nPyrs,
-            map(cellShapes, meshCellSets_.pyrs, pointToGlobal),
-            ensightGeometryFile
-        );
-
-        writeAllPrims
-        (
-            "tetra4",
-            meshCellSets_.nTets,
-            map(cellShapes, meshCellSets_.tets, pointToGlobal),
-            ensightGeometryFile
-        );
-
-        writeAllPolys
-        (
-            pointToGlobal,
-            ensightGeometryFile
-        );
+            for (int slave=1; slave<Pstream::nProcs(); slave++)
+            {
+                IPstream fromSlave(Pstream::scheduled, slave);
+                scalarField pointsComponent(fromSlave);
+                ensightGeometryFile.write(pointsComponent);
+            }
+        }
+    }
+    else
+    {
+        for (direction d=0; d<vector::nComponents; d++)
+        {
+            OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
+            toMaster<< uniquePoints.component(d);
+        }
     }
+}
 
 
-    label ensightPatchI = patchPartOffset_;
+void Foam::ensightMesh::writeAllPatchPoints
+(
+    const label ensightPatchI,
+    const word& patchName,
+    const pointField& uniquePoints,
+    const label nPoints,
+    ensightStream& ensightGeometryFile
+) const
+{
+    barrier();
 
-    forAll(allPatchNames_, patchi)
+    if (Pstream::master())
     {
-        const word& patchName = allPatchNames_[patchi];
+        ensightGeometryFile.writePartHeader(ensightPatchI);
+        ensightGeometryFile.write(patchName.c_str());
+        ensightGeometryFile.write("coordinates");
+        ensightGeometryFile.write(nPoints);
 
-        if (patchNames_.empty() || patchNames_.found(patchName))
+        for (direction d=0; d<vector::nComponents; d++)
         {
-            const nFacePrimitives& nfp = nPatchPrims_[patchName];
-
-            if (nfp.nTris || nfp.nQuads || nfp.nPolys)
+            ensightGeometryFile.write(uniquePoints.component(d));
+            for (int slave=1; slave<Pstream::nProcs(); slave++)
             {
-                const polyPatch& p = mesh_.boundaryMesh()[patchi];
-                const labelList& tris = boundaryFaceSets_[patchi].tris;
-                const labelList& quads = boundaryFaceSets_[patchi].quads;
-                const labelList& polys = boundaryFaceSets_[patchi].polys;
-
-                // Renumber the patch points/faces into unique points
-                labelList pointToGlobal;
-                labelList uniqueMeshPointLabels;
-                autoPtr<globalIndex> globalPointsPtr =
-                mesh_.globalData().mergePoints
-                (
-                    p.meshPoints(),
-                    p.meshPointMap(),
-                    pointToGlobal,
-                    uniqueMeshPointLabels
-                );
-
-                pointField uniquePoints(mesh_.points(), uniqueMeshPointLabels);
-                // Renumber the patch faces
-                faceList patchFaces(p.localFaces());
-                forAll(patchFaces, i)
-                {
-                    inplaceRenumber(pointToGlobal, patchFaces[i]);
-                }
-
-                writeAllPatchPoints
-                (
-                    ensightPatchI++,
-                    patchName,
-                    uniquePoints,
-                    globalPointsPtr().size(),
-                    ensightGeometryFile
-                );
-
-                writeAllFacePrims
-                (
-                    "tria3",
-                    tris,
-                    nfp.nTris,
-                    patchFaces,
-                    ensightGeometryFile
-                );
-
-                writeAllFacePrims
-                (
-                    "quad4",
-                    quads,
-                    nfp.nQuads,
-                    patchFaces,
-                    ensightGeometryFile
-                );
-
-                writeAllNSided
-                (
-                    polys,
-                    nfp.nPolys,
-                    patchFaces,
-                    ensightGeometryFile
-                );
+                IPstream fromSlave(Pstream::scheduled, slave);
+                scalarField patchPointsComponent(fromSlave);
+                ensightGeometryFile.write(patchPointsComponent);
             }
         }
     }
-
-    // write faceZones, if requested
-    forAllConstIter(wordHashSet, faceZoneNames_, iter)
+    else
     {
-        const word& faceZoneName = iter.key();
-
-        label faceID = mesh_.faceZones().findZoneID(faceZoneName);
-
-        const faceZone& fz = mesh_.faceZones()[faceID];
-
-        const nFacePrimitives& nfp = nFaceZonePrims_[faceZoneName];
-
-        if (nfp.nTris || nfp.nQuads || nfp.nPolys)
+        for (direction d=0; d<vector::nComponents; d++)
         {
-            const labelList& tris = faceZoneFaceSets_[faceID].tris;
-            const labelList& quads = faceZoneFaceSets_[faceID].quads;
-            const labelList& polys = faceZoneFaceSets_[faceID].polys;
-
-            // Renumber the faceZone points/faces into unique points
-            labelList pointToGlobal;
-            labelList uniqueMeshPointLabels;
-            autoPtr<globalIndex> globalPointsPtr =
-            mesh_.globalData().mergePoints
-            (
-                fz().meshPoints(),
-                fz().meshPointMap(),
-                pointToGlobal,
-                uniqueMeshPointLabels
-            );
-
-            pointField uniquePoints(mesh_.points(), uniqueMeshPointLabels);
-
-            // Find the list of master faces belonging to the faceZone,
-            // in loacal numbering
-            faceList faceZoneFaces(fz().localFaces());
-
-            // Count how many master faces belong to the faceZone. Is there
-            // a better way of doing this?
-            label nMasterFaces = 0;
-
-            forAll(fz, faceI)
-            {
-                if (faceToBeIncluded(fz[faceI]))
-                {
-                    ++nMasterFaces;
-                }
-            }
-
-            // Create the faceList for the master faces only and fill it.
-            faceList faceZoneMasterFaces(nMasterFaces);
-
-            label currentFace = 0;
-
-            forAll(fz, faceI)
-            {
-                if (faceToBeIncluded(fz[faceI]))
-                {
-                    faceZoneMasterFaces[currentFace] = faceZoneFaces[faceI];
-                    ++currentFace;
-                }
-            }
-
-            // Renumber the faceZone master faces
-            forAll(faceZoneMasterFaces, i)
-            {
-                inplaceRenumber(pointToGlobal, faceZoneMasterFaces[i]);
-            }
-
-            writeAllPatchPoints
-            (
-                ensightPatchI++,
-                faceZoneName,
-                uniquePoints,
-                globalPointsPtr().size(),
-                ensightGeometryFile
-            );
-
-            writeAllFacePrims
-            (
-                "tria3",
-                tris,
-                nfp.nTris,
-                faceZoneMasterFaces,
-                ensightGeometryFile
-            );
-
-            writeAllFacePrims
-            (
-                "quad4",
-                quads,
-                nfp.nQuads,
-                faceZoneMasterFaces,
-                ensightGeometryFile
-            );
-
-            writeAllNSided
+            OPstream toMaster
             (
-                polys,
-                nfp.nPolys,
-                faceZoneMasterFaces,
-                ensightGeometryFile
+                Pstream::scheduled,
+                Pstream::masterNo()
             );
+            toMaster<< uniquePoints.component(d);
         }
     }
-
-
-    if (Pstream::master())
-    {
-        delete ensightGeometryFilePtr;
-    }
 }
 
 
-void Foam::ensightMesh::writeBinary
+void Foam::ensightMesh::write
 (
     const fileName& postProcPath,
     const word& prepend,
     const label timeIndex,
-    Ostream& ensightCaseFile,
-    const labelList& pointToGlobal,
-    const pointField& uniquePoints,
-    const globalIndex& globalPoints
+    Ostream& ensightCaseFile
 ) const
 {
+    const Time& runTime = mesh_.time();
     const cellShapeList& cellShapes = mesh_.cellShapes();
 
+
     word timeFile = prepend;
 
     if (timeIndex == 0)
@@ -1871,43 +1012,54 @@ void Foam::ensightMesh::writeBinary
     // set the filename of the ensight file
     fileName ensightGeometryFileName = timeFile + "mesh";
 
-    std::ofstream *ensightGeometryFilePtr = NULL;
-
+    ensightStream* ensightGeometryFilePtr = NULL;
     if (Pstream::master())
     {
-        ensightGeometryFilePtr = new std::ofstream
-        (
-            (postProcPath/ensightGeometryFileName).c_str(),
-            ios_base::out | ios_base::binary | ios_base::trunc
-        );
-        // Check on file opened?
+        if (binary_)
+        {
+            ensightGeometryFilePtr = new ensightBinaryStream
+            (
+                postProcPath/ensightGeometryFileName,
+                runTime
+            );
+            ensightGeometryFilePtr->write("C binary");
+        }
+        else
+        {
+            ensightGeometryFilePtr = new ensightAsciiStream
+            (
+                postProcPath/ensightGeometryFileName,
+                runTime
+            );
+        }
     }
 
-    std::ofstream& ensightGeometryFile = *ensightGeometryFilePtr;
+    ensightStream& ensightGeometryFile = *ensightGeometryFilePtr;
 
     if (Pstream::master())
     {
-        string description = string("written by OpenFOAM-") + Foam::FOAMversion;
-        writeEnsDataBinary("C binary", ensightGeometryFile);
-        writeEnsDataBinary("EnSight Geometry File", ensightGeometryFile);
-        writeEnsDataBinary(description.c_str(), ensightGeometryFile);
-        writeEnsDataBinary("node id assign", ensightGeometryFile);
-        writeEnsDataBinary("element id assign", ensightGeometryFile);
-    }
+        string desc = string("written by OpenFOAM-") + Foam::FOAMversion;
 
+        ensightGeometryFile.write("EnSight Geometry File");
+        ensightGeometryFile.write(desc.c_str());
+        ensightGeometryFile.write("node id assign");
+        ensightGeometryFile.write("element id assign");
+    }
 
     if (patchNames_.empty())
     {
-        label nPoints = globalPoints.size();
+        label nPoints = globalPoints().size();
 
-        writeAllInternalPointsBinary
+        const pointField uniquePoints(mesh_.points(), uniquePointMap_);
+
+        writeAllInternalPoints
         (
             uniquePoints,
             nPoints,
             ensightGeometryFile
         );
 
-        writeAllPrimsBinary
+        writeAllPrims
         (
             "hexa8",
             meshCellSets_.nHexesWedges,
@@ -1916,53 +1068,52 @@ void Foam::ensightMesh::writeBinary
                 cellShapes,
                 meshCellSets_.hexes,
                 meshCellSets_.wedges,
-                pointToGlobal
+                pointToGlobal_
             ),
             ensightGeometryFile
         );
 
-        writeAllPrimsBinary
+        writeAllPrims
         (
             "penta6",
             meshCellSets_.nPrisms,
-            map(cellShapes, meshCellSets_.prisms, pointToGlobal),
+            map(cellShapes, meshCellSets_.prisms, pointToGlobal_),
             ensightGeometryFile
         );
 
-        writeAllPrimsBinary
+        writeAllPrims
         (
             "pyramid5",
             meshCellSets_.nPyrs,
-            map(cellShapes, meshCellSets_.pyrs, pointToGlobal),
+            map(cellShapes, meshCellSets_.pyrs, pointToGlobal_),
             ensightGeometryFile
         );
 
-        writeAllPrimsBinary
+        writeAllPrims
         (
             "tetra4",
             meshCellSets_.nTets,
-            map(cellShapes, meshCellSets_.tets, pointToGlobal),
+            map(cellShapes, meshCellSets_.tets, pointToGlobal_),
             ensightGeometryFile
         );
 
-        writeAllPolysBinary
+        writeAllPolys
         (
-            pointToGlobal,
+            pointToGlobal_,
             ensightGeometryFile
         );
     }
 
+
     label ensightPatchI = patchPartOffset_;
-    label iCount = 0;
 
     forAll(allPatchNames_, patchi)
     {
-        iCount ++;
         const word& patchName = allPatchNames_[patchi];
 
         if (patchNames_.empty() || patchNames_.found(patchName))
         {
-            const nFacePrimitives& nfp = nPatchPrims_.find(patchName)();
+            const nFacePrimitives& nfp = nPatchPrims_[patchName];
 
             if (nfp.nTris || nfp.nQuads || nfp.nPolys)
             {
@@ -1982,6 +1133,7 @@ void Foam::ensightMesh::writeBinary
                     pointToGlobal,
                     uniqueMeshPointLabels
                 );
+
                 pointField uniquePoints(mesh_.points(), uniqueMeshPointLabels);
                 // Renumber the patch faces
                 faceList patchFaces(p.localFaces());
@@ -1990,7 +1142,7 @@ void Foam::ensightMesh::writeBinary
                     inplaceRenumber(pointToGlobal, patchFaces[i]);
                 }
 
-                writeAllPatchPointsBinary
+                writeAllPatchPoints
                 (
                     ensightPatchI++,
                     patchName,
@@ -1999,7 +1151,7 @@ void Foam::ensightMesh::writeBinary
                     ensightGeometryFile
                 );
 
-                writeAllFacePrimsBinary
+                writeAllFacePrims
                 (
                     "tria3",
                     tris,
@@ -2008,7 +1160,7 @@ void Foam::ensightMesh::writeBinary
                     ensightGeometryFile
                 );
 
-                writeAllFacePrimsBinary
+                writeAllFacePrims
                 (
                     "quad4",
                     quads,
@@ -2017,7 +1169,7 @@ void Foam::ensightMesh::writeBinary
                     ensightGeometryFile
                 );
 
-                writeAllNSidedBinary
+                writeAllNSided
                 (
                     polys,
                     nfp.nPolys,
@@ -2090,13 +1242,12 @@ void Foam::ensightMesh::writeBinary
             }
 
             // Renumber the faceZone master faces
-
             forAll(faceZoneMasterFaces, i)
             {
                 inplaceRenumber(pointToGlobal, faceZoneMasterFaces[i]);
             }
 
-            writeAllPatchPointsBinary
+            writeAllPatchPoints
             (
                 ensightPatchI++,
                 faceZoneName,
@@ -2105,7 +1256,7 @@ void Foam::ensightMesh::writeBinary
                 ensightGeometryFile
             );
 
-            writeAllFacePrimsBinary
+            writeAllFacePrims
             (
                 "tria3",
                 tris,
@@ -2114,7 +1265,7 @@ void Foam::ensightMesh::writeBinary
                 ensightGeometryFile
             );
 
-            writeAllFacePrimsBinary
+            writeAllFacePrims
             (
                 "quad4",
                 quads,
@@ -2123,7 +1274,7 @@ void Foam::ensightMesh::writeBinary
                 ensightGeometryFile
             );
 
-            writeAllNSidedBinary
+            writeAllNSided
             (
                 polys,
                 nfp.nPolys,
@@ -2133,7 +1284,6 @@ void Foam::ensightMesh::writeBinary
         }
     }
 
-
     if (Pstream::master())
     {
         delete ensightGeometryFilePtr;
diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.H
index 46442efc59992983a7d02a26750a31268a10d95c..f7db81bbc13ca4dfbe05741a21a46d1580cb169a 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.H
+++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.H
@@ -38,10 +38,13 @@ SourceFiles
 #include "faceSets.H"
 #include "HashTable.H"
 #include "HashSet.H"
-#include "fvMesh.H"
-#include "OFstream.H"
-#include <fstream>
 #include "PackedBoolList.H"
+#include "wordReList.H"
+#include "scalarField.H"
+#include "cellShapeList.H"
+#include "cellList.H"
+
+#include <fstream>
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -51,6 +54,7 @@ namespace Foam
 class fvMesh;
 class argList;
 class globalIndex;
+class ensightStream;
 
 /*---------------------------------------------------------------------------*\
                            Class ensightMesh Declaration
@@ -82,8 +86,19 @@ private:
         //- Reference to the OpenFOAM mesh
         const fvMesh& mesh_;
 
+        //- Suppress patches
+        const bool noPatches_;
+
+        //- Output selected patches only
+        const bool patches_;
+        const wordReList patchPatterns_;
+
+        //- Output selected faceZones
+        const bool faceZones_;
+        const wordReList faceZonePatterns_;
+
         //- Set binary file output
-        bool binary_;
+        const bool binary_;
 
         //- The ensight part id for the first patch
         label patchPartOffset_;
@@ -109,6 +124,19 @@ private:
         PackedBoolList boundaryFaceToBeIncluded_;
 
 
+        // Parallel merged points
+
+            //- Global numbering for merged points
+            autoPtr<globalIndex> globalPointsPtr_;
+
+            //- From mesh point to global merged point
+            labelList pointToGlobal_;
+
+            //- Local points that are unique
+            labelList uniquePointMap_;
+
+
+
     // Private Member Functions
 
         //- Disallow default bitwise copy construct
@@ -120,7 +148,7 @@ private:
         void writePoints
         (
             const scalarField& pointsComponent,
-            OFstream& ensightGeometryFile
+            ensightStream& ensightGeometryFile
         ) const;
 
         cellShapeList map
@@ -141,14 +169,14 @@ private:
         void writePrims
         (
             const cellShapeList& cellShapes,
-            OFstream& ensightGeometryFile
+            ensightStream& ensightGeometryFile
         ) const;
 
         void writePolysNFaces
         (
             const labelList& polys,
             const cellList& cellFaces,
-            OFstream& ensightGeometryFile
+            ensightStream& ensightGeometryFile
         ) const;
 
         void writePolysNPointsPerFace
@@ -156,7 +184,7 @@ private:
             const labelList& polys,
             const cellList& cellFaces,
             const faceList& faces,
-            OFstream& ensightGeometryFile
+            ensightStream& ensightGeometryFile
         ) const;
 
         void writePolysPoints
@@ -164,13 +192,13 @@ private:
             const labelList& polys,
             const cellList& cellFaces,
             const faceList& faces,
-            OFstream& ensightGeometryFile
+            ensightStream& ensightGeometryFile
         ) const;
 
         void writeAllPolys
         (
             const labelList& pointToGlobal,
-            OFstream& ensightGeometryFile
+            ensightStream& ensightGeometryFile
         ) const;
 
         void writeAllPrims
@@ -178,13 +206,13 @@ private:
             const char* key,
             const label nPrims,
             const cellShapeList& cellShapes,
-            OFstream& ensightGeometryFile
+            ensightStream& ensightGeometryFile
         ) const;
 
         void writeFacePrims
         (
             const faceList& patchFaces,
-            OFstream& ensightGeometryFile
+            ensightStream& ensightGeometryFile
         ) const;
 
         void writeAllFacePrims
@@ -193,19 +221,19 @@ private:
             const labelList& prims,
             const label nPrims,
             const faceList& patchFaces,
-            OFstream& ensightGeometryFile
+            ensightStream& ensightGeometryFile
         ) const;
 
         void writeNSidedNPointsPerFace
         (
             const faceList& patchFaces,
-            OFstream& ensightGeometryFile
+            ensightStream& ensightGeometryFile
         ) const;
 
         void writeNSidedPoints
         (
             const faceList& patchFaces,
-            OFstream& ensightGeometryFile
+            ensightStream& ensightGeometryFile
         ) const;
 
         void writeAllNSided
@@ -213,14 +241,14 @@ private:
             const labelList& prims,
             const label nPrims,
             const faceList& patchFaces,
-            OFstream& ensightGeometryFile
+            ensightStream& ensightGeometryFile
         ) const;
 
         void writeAllInternalPoints
         (
             const pointField& uniquePoints,
             const label nPoints,
-            OFstream& ensightGeometryFile
+            ensightStream& ensightGeometryFile
         ) const;
 
         void writeAllPatchPoints
@@ -229,123 +257,7 @@ private:
             const word& patchName,
             const pointField& uniquePoints,
             const label nPoints,
-            OFstream& ensightGeometryFile
-        ) const;
-
-        void writeAllInternalPointsBinary
-        (
-            const pointField& uniquePoints,
-            const label nPoints,
-            std::ofstream& ensightGeometryFile
-        ) const;
-
-        void writeAllPatchPointsBinary
-        (
-            label ensightPatchI,
-            const word& patchName,
-            const pointField& uniquePoints,
-            const label nPoints,
-            std::ofstream& ensightGeometryFile
-        ) const;
-
-        void writeAscii
-        (
-            const fileName& postProcPath,
-            const word& prepend,
-            const label timeIndex,
-            Ostream& ensightCaseFile,
-            const labelList& pointToGlobal,
-            const pointField& uniquePoints,
-            const globalIndex& globalPoints
-        ) const;
-
-        void writeBinary
-        (
-            const fileName& postProcPath,
-            const word& prepend,
-            const label timeIndex,
-            Ostream& ensightCaseFile,
-            const labelList& pointToGlobal,
-            const pointField& uniquePoints,
-            const globalIndex& globalPoints
-        ) const;
-
-        void writePrimsBinary
-        (
-            const cellShapeList& cellShapes,
-            std::ofstream& ensightGeometryFile
-        ) const;
-
-        void writeAllPrimsBinary
-        (
-            const char* key,
-            const label nPrims,
-            const cellShapeList& cellShapes,
-            std::ofstream& ensightGeometryFile
-        ) const;
-
-        void writePolysNFacesBinary
-        (
-            const labelList& polys,
-            const cellList& cellFaces,
-            std::ofstream& ensightGeometryFile
-        ) const;
-
-        void writePolysNPointsPerFaceBinary
-        (
-            const labelList& polys,
-            const cellList& cellFaces,
-            const faceList& faces,
-            std::ofstream& ensightGeometryFile
-        ) const;
-
-        void writePolysPointsBinary
-        (
-            const labelList& polys,
-            const cellList& cellFaces,
-            const faceList& faces,
-            std::ofstream& ensightGeometryFile
-        ) const;
-
-        void writeAllPolysBinary
-        (
-            const labelList& pointToGlobal,
-            std::ofstream& ensightGeometryFile
-        ) const;
-
-        void writeAllFacePrimsBinary
-        (
-            const char* key,
-            const labelList& prims,
-            const label nPrims,
-            const faceList& patchFaces,
-            std::ofstream& ensightGeometryFile
-        ) const;
-
-        void writeFacePrimsBinary
-        (
-            const faceList& patchFaces,
-            std::ofstream& ensightGeometryFile
-        ) const;
-
-        void writeNSidedPointsBinary
-        (
-            const faceList& patchFaces,
-            std::ofstream& ensightGeometryFile
-        ) const;
-
-        void writeNSidedNPointsPerFaceBinary
-        (
-            const faceList& patchFaces,
-            std::ofstream& ensightGeometryFile
-        ) const;
-
-        void writeAllNSidedBinary
-        (
-            const labelList& prims,
-            const label nPrims,
-            const faceList& patchFaces,
-            std::ofstream& ensightGeometryFile
+            ensightStream& ensightGeometryFile
         ) const;
 
 public:
@@ -355,8 +267,12 @@ public:
         //- Construct from fvMesh
         ensightMesh
         (
-            const fvMesh&,
-            const argList& args,
+            const fvMesh& mesh,
+            const bool noPatches,
+            const bool patches,
+            const wordReList& patchPatterns,
+            const bool faceZones,
+            const wordReList& faceZonePatterns,
             const bool binary
         );
 
@@ -420,8 +336,35 @@ public:
                 return patchPartOffset_;
             }
 
+
+        // Parallel point merging
+
+            //- Global numbering for merged points
+            const globalIndex& globalPoints() const
+            {
+                return globalPointsPtr_();
+            }
+
+            //- From mesh point to global merged point
+            const labelList& pointToGlobal() const
+            {
+                return pointToGlobal_;
+            }
+
+            //- Local points that are unique
+            const labelList& uniquePointMap() const
+            {
+                return uniquePointMap_;
+            }
+
+
+
+
     // Other
 
+        //- Update for new mesh
+        void correct();
+
         //- When exporting faceZones, check if a given face has to be included
         //  or not (i.e. faces on processor boundaries)
         bool faceToBeIncluded(const label faceI) const;
diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/regionProperties/regionProperties.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightStream.H
similarity index 66%
rename from applications/solvers/heatTransfer/chtMultiRegionFoam/regionProperties/regionProperties.H
rename to applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightStream.H
index fe5a21fe7131c9abfab44e65dd2f6a90678d4149..60be47dcdab822895eb6356e478f0a72e427aa63 100644
--- a/applications/solvers/heatTransfer/chtMultiRegionFoam/regionProperties/regionProperties.H
+++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightStream.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -22,51 +22,45 @@ License
     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 
 Class
-    regionProperties
+    Foam::ensightStream
 
 Description
-    Simple class to hold region information for coupled region simulations
+    Abstract base class for writing Ensight data
 
 SourceFiles
-    regionProperties.C
+    ensightStream.C
 
 \*---------------------------------------------------------------------------*/
 
-#ifndef regionProperties_H
-#define regionProperties_H
+#ifndef ensightStream_H
+#define ensightStream_H
 
-#include "IOdictionary.H"
-#include "Time.H"
+#include "fileName.H"
+#include "scalarField.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 namespace Foam
 {
 
+
 /*---------------------------------------------------------------------------*\
-                       Class regionProperties Declaration
+                         Class ensightStream Declaration
 \*---------------------------------------------------------------------------*/
 
-class regionProperties
-:
-    public IOdictionary
+class ensightStream
 {
     // Private data
 
-        //- List of the fluid region names
-        List<word> fluidRegionNames_;
-
-        //- List of the solid region names
-        List<word> solidRegionNames_;
-
+        const fileName name_;
 
     // Private Member Functions
 
         //- Disallow default bitwise copy construct
-        regionProperties(const regionProperties&);
+        ensightStream(const ensightStream&);
 
         //- Disallow default bitwise assignment
-        void operator=(const regionProperties&);
+        void operator=(const ensightStream&);
 
 
 public:
@@ -74,22 +68,36 @@ public:
     // Constructors
 
         //- Construct from components
-        regionProperties(const Time& runTime);
+        ensightStream(const fileName& f)
+        :
+            name_(f)
+        {}
 
 
     //- Destructor
-    ~regionProperties();
+    virtual ~ensightStream()
+    {}
 
 
     // Member Functions
 
-        // Access
+        const fileName& name() const
+        {
+            return name_;
+        }
+
+        virtual void write(const char*) = 0;
+
+        virtual void write(const int) = 0;
+
+        virtual void write(const scalarField&) = 0;
+
+        virtual void write(const List<int>&) = 0;
+
+        virtual void writePartHeader(const label) = 0;
+
 
-            //- Return const reference to the list of fluid region names
-            const List<word>& fluidRegionNames() const;
 
-            //- Return const reference to the list of solid region names
-            const List<word>& solidRegionNames() const;
 };
 
 
diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/faceSets.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/faceSets.H
index edf25fa34df1242f2f5495b1619c4087989997cd..f5d396b86eb0d78a992b2a39f2a90feb89bdd8fb 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/faceSets.H
+++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/faceSets.H
@@ -44,15 +44,6 @@ namespace Foam
 
 class faceSets
 {
-    // Private Member Functions
-
-        //- Disallow default bitwise copy construct
-        faceSets(const faceSets&);
-
-        //- Disallow default bitwise assignment
-        void operator=(const faceSets&);
-
-
 public:
 
         label nTris;
diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C
index dff5d8b8c8e7902a787ba2fcfd857e9944e65a5a..ba2bfccf9af6ab31ff67bfe0bd3e54136c709791 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C
+++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C
@@ -104,6 +104,11 @@ int main(int argc, char *argv[])
         "write in ASCII format instead of 'C Binary'"
     );
     argList::addBoolOption
+    (
+        "nodeValues",
+        "write values in nodes"
+    );
+    argList::addBoolOption
     (
         "noPatches",
         "suppress writing any patches"
@@ -126,6 +131,7 @@ int main(int argc, char *argv[])
 
     // Check options
     const bool binary = !args.optionFound("ascii");
+    const bool nodeValues = args.optionFound("nodeValues");
 
 #   include "createTime.H"
 
@@ -191,7 +197,29 @@ int main(int argc, char *argv[])
     OFstream& ensightCaseFile = *ensightCaseFilePtr;
 
     // Construct the EnSight mesh
-    ensightMesh eMesh(mesh, args, binary);
+    const bool selectedPatches = args.optionFound("patches");
+    wordReList patchPatterns;
+    if (selectedPatches)
+    {
+        patchPatterns = wordReList(args.optionLookup("patches")());
+    }
+    const bool selectedZones = args.optionFound("faceZones");
+    wordReList zonePatterns;
+    if (selectedZones)
+    {
+        zonePatterns = wordReList(args.optionLookup("faceZones")());
+    }
+
+    ensightMesh eMesh
+    (
+        mesh,
+        args.optionFound("noPatches"),
+        selectedPatches,
+        patchPatterns,
+        selectedZones,
+        zonePatterns,
+        binary
+    );
 
     // Set Time to the last time before looking for the lagrangian objects
     runTime.setTime(Times.last(), Times.size()-1);
@@ -313,6 +341,11 @@ int main(int argc, char *argv[])
 
         polyMesh::readUpdateState meshState = mesh.readUpdate();
 
+        if (meshState != polyMesh::UNCHANGED)
+        {
+            eMesh.correct();
+        }
+
         if (timeIndex == 0 || (meshState != polyMesh::UNCHANGED))
         {
             eMesh.write
@@ -371,6 +404,7 @@ int main(int argc, char *argv[])
                         prepend,
                         timeIndex,
                         binary,
+                        nodeValues,
                         ensightCaseFile
                     );
                 }
@@ -384,6 +418,7 @@ int main(int argc, char *argv[])
                         prepend,
                         timeIndex,
                         binary,
+                        nodeValues,
                         ensightCaseFile
                     );
                 }
@@ -397,6 +432,7 @@ int main(int argc, char *argv[])
                         prepend,
                         timeIndex,
                         binary,
+                        nodeValues,
                         ensightCaseFile
                     );
                 }
@@ -410,6 +446,7 @@ int main(int argc, char *argv[])
                         prepend,
                         timeIndex,
                         binary,
+                        nodeValues,
                         ensightCaseFile
                     );
                 }
@@ -423,6 +460,7 @@ int main(int argc, char *argv[])
                         prepend,
                         timeIndex,
                         binary,
+                        nodeValues,
                         ensightCaseFile
                     );
                 }
diff --git a/applications/utilities/preProcessing/foamUpgradeCyclics/foamUpgradeCyclics.C b/applications/utilities/preProcessing/foamUpgradeCyclics/foamUpgradeCyclics.C
index e615ebe210d49ea877f98a26eeb8f77c8cacc75a..89cf00cd1b10e60911298a56ab7209d7fa655990 100644
--- a/applications/utilities/preProcessing/foamUpgradeCyclics/foamUpgradeCyclics.C
+++ b/applications/utilities/preProcessing/foamUpgradeCyclics/foamUpgradeCyclics.C
@@ -311,7 +311,7 @@ void rewriteField
             {
                 IOWarningIn("rewriteField(..)", patchDict)
                     << "Cyclic patch " << patchName
-                    << " has value entry. Please removed this and rerun."
+                    << " has value entry. Please remove this and rerun."
                     << endl;
             }
 
diff --git a/applications/utilities/preProcessing/mapFields/MapLagrangianFields.H b/applications/utilities/preProcessing/mapFields/MapLagrangianFields.H
index 87b3746484af8fe9d44b960b55f82a329fca5116..5719b69ecb646152173beb87ffe6d0fe93b1d167 100644
--- a/applications/utilities/preProcessing/mapFields/MapLagrangianFields.H
+++ b/applications/utilities/preProcessing/mapFields/MapLagrangianFields.H
@@ -37,7 +37,7 @@ Description
 #include "GeometricField.H"
 #include "meshToMesh.H"
 #include "IOobjectList.H"
-#include "IOFieldField.H"
+#include "CompactIOField.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -106,9 +106,9 @@ void MapLagrangianFields
             // Read field (does not need mesh)
             IOField<Field<Type> > fieldSource(*fieldIter());
 
-            // Map - use IOFieldField to automatically write in
+            // Map - use CompactIOField to automatically write in
             // compact form for binary format.
-            IOFieldField<Field<Type>, Type> fieldTarget
+            CompactIOField<Field<Type>, Type> fieldTarget
             (
                 IOobject
                 (
@@ -135,7 +135,7 @@ void MapLagrangianFields
 
     {
         IOobjectList fieldFields =
-            objects.lookupClass(IOFieldField<Field<Type>, Type>::typeName);
+            objects.lookupClass(CompactIOField<Field<Type>, Type>::typeName);
 
         forAllIter(IOobjectList, fieldFields, fieldIter)
         {
@@ -143,10 +143,10 @@ void MapLagrangianFields
                 << fieldIter()->name() << endl;
 
             // Read field (does not need mesh)
-            IOFieldField<Field<Type>, Type> fieldSource(*fieldIter());
+            CompactIOField<Field<Type>, Type> fieldSource(*fieldIter());
 
             // Map
-            IOFieldField<Field<Type>, Type> fieldTarget
+            CompactIOField<Field<Type>, Type> fieldTarget
             (
                 IOobject
                 (
diff --git a/bin/tools/CleanFunctions b/bin/tools/CleanFunctions
index e40da98d01b4ccb19a02f3ada5521d7cc7c81d14..3256ff4ba65588b553f94fd256d05eb6764ba83d 100644
--- a/bin/tools/CleanFunctions
+++ b/bin/tools/CleanFunctions
@@ -76,6 +76,11 @@ cleanCase()
            sets/streamLines \
            > /dev/null 2>&1
 
+    if [ -e constant/polyMesh/blockMeshDict.m4 ]
+    then
+        rm -f constant/polyMesh/blockMeshDict > /dev/null 2>&1
+    fi
+
     for f in `find . -name "*Dict"`
     do
         sed -e /arguments/d $f > temp.$$
diff --git a/bin/doxyFilt b/bin/tools/doxyFilter
similarity index 89%
rename from bin/doxyFilt
rename to bin/tools/doxyFilter
index 7f337e539c5d6dc56e531b16e70bdd7fa23adf77..c49851a502c18160d27156874977045b7ee24531 100755
--- a/bin/doxyFilt
+++ b/bin/tools/doxyFilter
@@ -23,7 +23,7 @@
 #     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 #
 # Script
-#     doxyFilt
+#     doxyFilter
 #
 # Description
 #     pass-through filter for doxygen
@@ -43,19 +43,19 @@ then
     dirName=${filePath%/[^/]*}
     fileName=${filePath##*/}
 
-    awkScript=$WM_PROJECT_DIR/bin/tools/doxyFilt.awk
+    awkScript=$WM_PROJECT_DIR/bin/tools/doxyFilter.awk
 
     case "$1" in
     */applications/solvers/*.C | */applications/utilities/*.C )
-        awkScript=$WM_PROJECT_DIR/bin/tools/doxyFilt-top.awk
+        awkScript=$WM_PROJECT_DIR/bin/tools/doxyFilter-top.awk
         ;;
 #    */applications/solvers/*.H | */applications/utilities/*.H )
-#        awkScript=$WM_PROJECT_DIR/bin/tools/doxyFilt-ignore.awk
+#        awkScript=$WM_PROJECT_DIR/bin/tools/doxyFilter-ignore.awk
 #        ;;
    esac
 
     awk -f $awkScript $1 | \
-    sed -f $WM_PROJECT_DIR/bin/tools/doxyFilt.sed \
+    sed -f $WM_PROJECT_DIR/bin/tools/doxyFilter.sed \
         -e s@%filePath%@$filePath@g \
         -e s@%fileName%@$fileName@g \
         -e s@%dirName%@$dirName@g
diff --git a/bin/tools/doxyFilt-ignore.awk b/bin/tools/doxyFilter-ignore.awk
similarity index 98%
rename from bin/tools/doxyFilt-ignore.awk
rename to bin/tools/doxyFilter-ignore.awk
index ebbacc7177a5840e05b5324e209aa33dcacd9cea..0d85702b34e907eb6f5ba961077e62cc79107e5d 100644
--- a/bin/tools/doxyFilt-ignore.awk
+++ b/bin/tools/doxyFilter-ignore.awk
@@ -22,7 +22,7 @@
 #     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 #
 # Script
-#     doxyFilt-ignore.awk
+#     doxyFilter-ignore.awk
 #
 # Description
 #     - Prefix file contents with doxygen @file tag and %filePath% tag
diff --git a/bin/tools/doxyFilt-top.awk b/bin/tools/doxyFilter-top.awk
similarity index 98%
rename from bin/tools/doxyFilt-top.awk
rename to bin/tools/doxyFilter-top.awk
index 97b96ff7b46133db1823cf94f53c607cfcbd7752..856e6621d4b4275d7d4817c5821b3c56d639ec1d 100644
--- a/bin/tools/doxyFilt-top.awk
+++ b/bin/tools/doxyFilter-top.awk
@@ -22,7 +22,7 @@
 #     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 #
 # Script
-#     doxyFilt-top.awk
+#     doxyFilter-top.awk
 #
 # Description
 #     Only output the first /* ... */ comment section found in the file
diff --git a/bin/tools/doxyFilt.awk b/bin/tools/doxyFilter.awk
similarity index 99%
rename from bin/tools/doxyFilt.awk
rename to bin/tools/doxyFilter.awk
index da65c3ded70bc070fbbf2df11978963937ba847b..1e37d0e33b46ea92c51d00d80e1ca3c2503bf98b 100644
--- a/bin/tools/doxyFilt.awk
+++ b/bin/tools/doxyFilter.awk
@@ -22,7 +22,7 @@
 #     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 #
 # Script
-#     doxyFilt.awk
+#     doxyFilter.awk
 #
 # Description
 #     Converts cocoon style sentinel strings into doxygen style strings
diff --git a/bin/tools/doxyFilt.sed b/bin/tools/doxyFilter.sed
similarity index 99%
rename from bin/tools/doxyFilt.sed
rename to bin/tools/doxyFilter.sed
index 4aaa7adb0e59a09eb0cf78ea04dcb0914d98ddb4..45a15019e132f41d41b84452bd47e5c46528debc 100644
--- a/bin/tools/doxyFilt.sed
+++ b/bin/tools/doxyFilter.sed
@@ -1,6 +1,6 @@
 # -----------------------------------------------------------------------------
 # Script
-#     doxyFilt.sed
+#     doxyFilter.sed
 #
 # Description
 #     Transform human-readable tags such as 'Description' into the Doxygen
diff --git a/bin/tools/pre-commit-hook b/bin/tools/pre-commit-hook
index 7d41b2e11c8284267345939f7ab9f5974fd87fb1..b0ca86f0202a82db0fa2b32c12ef314ae9bb202a 100755
--- a/bin/tools/pre-commit-hook
+++ b/bin/tools/pre-commit-hook
@@ -45,6 +45,9 @@
 # Note
 #     Using "git commit --no-verify" it is possible to override the hook.
 #
+#     By supplying arguments to the hook, it can also be used to manually
+#     test the specified files/directories for standards conformance.
+#
 #------------------------------------------------------------------------------
 die()
 {
@@ -52,13 +55,14 @@ die()
     echo '-----------------------' 1>&2
     echo '' 1>&2
     echo "$@" 1>&2
+    echo '' 1>&2
     exit 1
 }
 
 #-----------------------------------------------------------------------------
 # Check content that will be added by this commit.
 
-if git rev-parse --verify -q HEAD > /dev/null
+if git rev-parse --verify HEAD > /dev/null 2>&1
 then
     against=HEAD
 else
@@ -66,10 +70,30 @@ else
     against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
 fi
 
-# list of all files
-fileList=$(git diff-index --name-only $against --)
-unset badFiles
+# called manually with arguments for the files/directories to be tested?
+if [ "$#" -gt 0 ]
+then
+    case "$1" in
+    -h | -help)
+        die "interactive usage: supply list of files/directories to check"
+        ;;
+    esac
 
+    # obtain list of all specified files/directories
+    fileList=$(git ls-files -- $@ 2>/dev/null)
+else
+    # list of all files to be committed
+    fileList=$(git diff-index --cached --name-only $against --)
+fi
+
+#
+# no files changed: can skip all the checks
+# this usage can correspond to a 'git commit --amend'
+#
+[ -n "$fileList" ] || exit 0
+
+
+unset badFiles
 # join list of files with this amount of space
 Indent="    "
 
@@ -97,16 +121,18 @@ dieOnBadFiles()
 #
 checkIllegalCode()
 {
+    echo "pre-commit: check bad strings/characters etc ..." 1>&2
+
     reBad="(N""abla|"$'\t'")"
     msgBad="N""abla or <TAB>"
 
     badFiles=$(
     for f in $fileList
     do
-        # parse line numbers from this:
-        #        path/fileName:<lineNr>:   contents
-        lines=$(git grep --cached -n -E -e "$reBad" -- "$f" |
-            sed -e 's@^[^:]*:\([0-9]*\):.*@\1@' |
+        # parse line numbers from grep output:
+        #        <lineNr>:   contents
+        lines=$(git grep --cached -E -hn -e "$reBad" -- "$f" |
+            sed -e 's@:.*@@' |
             tr '\n' ' '
         )
         [ -n "$lines" ] && echo "$Indent$f -- lines: $lines"
@@ -123,18 +149,22 @@ checkIllegalCode()
 checkCopyright()
 {
     year=$(date +%Y)
+    echo "pre-commit: check copyright ..." 1>&2
 
     badFiles=$(
     for f in $fileList
     do
-        # parse line numbers from this:
-        #        path/fileName:<lineNr>:   contents
-        # for Copyright lines without the current year
-        lines=$(git grep --cached -n -e Copyright -- "$f" |
-            sed -n \
-                -e '/OpenCFD/{ ' \
-                -e "/$year/b"   \
-                -e 's@^[^:]*:\([0-9]*\):.*@\1@p }' |
+        # NB: need to have OpenCFD on a separate line to prevent
+        #     this check being caught by itself!
+        #
+        # parse line numbers from grep output:
+        #        <lineNr>:   contents
+        #
+        lines=$(git grep --cached -F -hn -e Copyright \
+            --and -e OpenCFD \
+            --and --not -e "$year" \
+            -- "$f" |
+            sed -e 's@:.*@@' |
             tr '\n' ' '
         )
         [ -n "$lines" ] && echo "$Indent$f -- lines: $lines"
@@ -150,16 +180,18 @@ checkCopyright()
 #
 checkLineLength()
 {
+    echo "pre-commit: check line lengths ..." 1>&2
+
     badFiles=$(
     for f in $fileList
     do
         # limit to *.[CH] files
         case "$f" in
         (*.[CH])
-            # parse line numbers from this:
-            #        path/fileName:<lineNr>:   contents
-            lines=$(git grep --cached -n -e ".\{81,\}" -- "$f" |
-                sed -e 's@^[^:]*:\([0-9]*\):.*@\1@' |
+            # parse line numbers from grep output:
+            #        <lineNr>:   contents
+            lines=$(git grep --cached -hn -e '^.\{81,\}' -- "$f" |
+                sed -e 's@:.*@@' |
                 tr '\n' ' '
             )
             [ -n "$lines" ] && echo "$Indent$f -- lines: $lines"
@@ -177,18 +209,20 @@ checkLineLength()
 #
 checkLineLengthNonComments()
 {
+    echo "pre-commit: check line lengths ..." 1>&2
+
     badFiles=$(
     for f in $fileList
     do
         # limit to *.[CH] files
         case "$f" in
         (*.[CH])
-            # parse line numbers from this (strip comment lines):
-            #        path/fileName:<lineNr>:   contents
-            lines=$(git grep --cached -n -e ".\{81,\}" -- "$f" |
-                sed -n \
-                    -e '\@^[^:]*:[^:]*: *//.*@b' \
-                    -e 's@^[^:]*:\([0-9]*\):.*@\1@p' |
+            # parse line numbers from grep output:
+            #        <lineNr>:   contents
+            lines=$(git grep --cached -hn -e '^.\{81,\}' \
+                --and --not -e "^ *//" \
+                -- "$f" |
+                sed -e 's@:.*@@' |
                 tr '\n' ' '
             )
             [ -n "$lines" ] && echo "$Indent$f -- lines: $lines"
@@ -205,18 +239,20 @@ checkLineLengthNonComments()
 #
 checkLineLengthNonDirective()
 {
+    echo "pre-commit: check line lengths ..." 1>&2
+
     badFiles=$(
     for f in $fileList
     do
         # limit to *.[CH] files
         case "$f" in
         (*.[CH])
-            # parse line numbers from this (strip comment lines):
-            #        path/fileName:<lineNr>:   contents
-            lines=$(git grep --cached -n -e ".\{81,\}" -- "$f" |
-                sed -n \
-                    -e '\@^[^:]*:[^:]*: *#.*@b' \
-                    -e 's@^[^:]*:\([0-9]*\):.*@\1@p' |
+            # parse line numbers from grep output:
+            #        <lineNr>:   contents
+            lines=$(git grep --cached -hn -e '^.\{81,\}' \
+                --and --not -e "^ *#" \
+                -- "$f" |
+                sed -e 's@:.*@@' |
                 tr '\n' ' '
             )
             [ -n "$lines" ] && echo "$Indent$f -- lines: $lines"
diff --git a/doc/Doxygen/Doxyfile b/doc/Doxygen/Doxyfile
index 68ff8430b205ad285cfc0e03936441425d305b3c..79bc3b71cf63254707d46d8c7b5221b48e177ebf 100644
--- a/doc/Doxygen/Doxyfile
+++ b/doc/Doxygen/Doxyfile
@@ -567,7 +567,7 @@ IMAGE_PATH             =
 # to standard output.  If FILTER_PATTERNS is specified, this tag will be
 # ignored.
 
-INPUT_FILTER           = doxyFilt
+INPUT_FILTER           = $(WM_PROJECT_DIR)/bin/tools/doxyFilter
 
 # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
 # basis.  Doxygen will compare the file name with each pattern and apply the
diff --git a/TODO b/doc/changes/TODO
similarity index 82%
rename from TODO
rename to doc/changes/TODO
index aab3581489b42f7039305521c1c0ded91d800a2f..01a120bb9efb032777b36d4deea33358246296be 100644
--- a/TODO
+++ b/doc/changes/TODO
@@ -1,23 +1,8 @@
-- check 
+- check
     new fvMesh
     new fvMeshSubset
 for consistency with createMesh.H
 
-
-
 - Check the following:
 
 doc/changes/inotify.txt
- 
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/changes/splitCyclic.txt b/doc/changes/splitCyclic.txt
index 814dfe0850cd3c4afe0857cbf24c7d1a34f687cc..3d0ffb71cf5e414f24f51731ce7a96ca404ef425 100644
--- a/doc/changes/splitCyclic.txt
+++ b/doc/changes/splitCyclic.txt
@@ -20,7 +20,8 @@ The disadvantages:
 - a patch-wise loop now might need to store data to go to the neighbour half
 since it is no longer handled in a single patch.
 - decomposed cyclics now require overlapping communications so will
-only work in non-blocking mode. Hence the underlying message passing library
+only work in 'nonBlocking' mode or 'blocking' (=buffered) mode but not
+in 'scheduled' mode. The underlying message passing library
 will require overlapping communications with message tags.
 - it is quite a code-change and there might be some oversights.
 - once converted (see foamUpgradeCyclics below) cases are not backwards
@@ -103,19 +104,14 @@ type 'processorCyclic'.
 
 
 - processor patches use overlapping communication using a different message
-tag. This maps straight through into the MPI message tag.
-See processorCyclicPolyPatch::tag(). This needs to be calculated the
-same on both sides so is calculated as
-        Pstream::nProcs()*max(myProcNo, neighbProcNo)
-      + min(myProcNo, neighbProcNo)
-which is
-- unique
-- commutative
-- does not interfere with the default tag (= 1)
+tag. This maps straight through into the MPI message tag. Each processor
+'interface' (processorPolyPatch, processorFvPatch, etc.) has a 'tag()'
+to use for communication.
 
 
 - when constructing a GeometricField from a dictionary it will explicitly
 check for non-existing entries for cyclic patches and exit with an error message
-warning to run foamUpgradeCyclics.
+warning to run foamUpgradeCyclics. (1.7.x will check if you are trying
+to run a case which has split cyclics)
 
 
diff --git a/doc/doxygen/Doxyfile b/doc/doxygen/Doxyfile
index 1b1f98598fc3317b734a46a5d5ca16b585b855fa..1445ad0bc21bfe9eff1be2e6f5fdf04eef92b5ce 100644
--- a/doc/doxygen/Doxyfile
+++ b/doc/doxygen/Doxyfile
@@ -669,7 +669,7 @@ IMAGE_PATH             =
 # If FILTER_PATTERNS is specified, this tag will be
 # ignored.
 
-INPUT_FILTER           = doxyFilt
+INPUT_FILTER           = $(WM_PROJECT_DIR)/bin/tools/doxyFilter
 
 # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
 # basis.
diff --git a/doc/tools/find-trailingspace b/doc/tools/find-trailingspace
new file mode 100755
index 0000000000000000000000000000000000000000..a04ee94d460a1ae21ab90cc6ec56b9e9a84ea3b7
--- /dev/null
+++ b/doc/tools/find-trailingspace
@@ -0,0 +1,17 @@
+#!/bin/bash
+# -----------------------------------------------------------------------------
+# Script
+#     find-trailingspace
+#
+# Description
+#     Search for files with trailing whitesapce
+#
+# -----------------------------------------------------------------------------
+set -x
+cd $WM_PROJECT_DIR || exit 1
+
+tab=$'\t'
+
+git grep -c -E "[ $tab]+"'$' -- $@
+
+#------------------------------------------------------------------ end-of-file
diff --git a/etc/apps/paraview3/bashrc b/etc/apps/paraview3/bashrc
index 51965e47d61340249d1936d48da21787bb7554e9..e160fa59e8fbaf85f91fa4714f024deb8f4f54cb 100644
--- a/etc/apps/paraview3/bashrc
+++ b/etc/apps/paraview3/bashrc
@@ -50,9 +50,9 @@ do
 done
 
 
-# set VERSION and MAJOR (version) variables if not already set
-[ -n "$ParaView_VERSION" ] || ParaView_VERSION=3.8.0
-[ -n "$ParaView_MAJOR" ]   || ParaView_MAJOR=unknown
+# set VERSION and MAJOR (version) variables
+ParaView_VERSION=3.8.0
+ParaView_MAJOR=unknown
 
 # if needed, set MAJOR version to correspond to VERSION
 # ParaView_MAJOR is "<digits>.<digits>" from ParaView_VERSION
@@ -95,4 +95,5 @@ fi
 
 
 unset cleaned cmake paraviewInstDir paraviewPython
+
 # -----------------------------------------------------------------------------
diff --git a/etc/apps/paraview3/cshrc b/etc/apps/paraview3/cshrc
index a69608c9d32a55a88fc4565a2479ec725438d696..cdbe92277a00d566c761f9ba06c9bbead9b4affb 100644
--- a/etc/apps/paraview3/cshrc
+++ b/etc/apps/paraview3/cshrc
@@ -48,9 +48,9 @@ foreach cmake ( cmake-2.8.1 cmake-2.8.0 cmake-2.6.4 )
     endif
 end
 
-# set VERSION and MAJOR (version) variables if not already set
-if ( ! $?ParaView_VERSION ) setenv ParaView_VERSION 3.8.0
-if ( ! $?ParaView_MAJOR ) setenv ParaView_MAJOR unknown
+# set VERSION and MAJOR (version) variables
+setenv ParaView_VERSION 3.8.0
+setenv ParaView_MAJOR unknown
 
 # if needed, set MAJOR version to correspond to VERSION
 # ParaView_MAJOR is "<digits>.<digits>" from ParaView_VERSION
@@ -91,4 +91,5 @@ endif
 
 
 unset cleaned cmake paraviewInstDir paraviewPython
+
 # -----------------------------------------------------------------------------
diff --git a/etc/bashrc b/etc/bashrc
index ad866d049b7d1f4731b2b14ba013244646eb342a..e194bba3d0b665ea25c09034f213dc73c3e2e62f 100644
--- a/etc/bashrc
+++ b/etc/bashrc
@@ -32,7 +32,7 @@
 #------------------------------------------------------------------------------
 
 export WM_PROJECT=OpenFOAM
-[ -z "$WM_PROJECT_VERSION" ] && export WM_PROJECT_VERSION=dev
+export WM_PROJECT_VERSION=dev
 
 ################################################################################
 # USER EDITABLE PART. Note changes made here may be lost with the next upgrade
@@ -131,7 +131,8 @@ unset WM_COMPILER_ARCH WM_COMPILER_LIB_ARCH
 # WM_COMPILE_OPTION = Opt | Debug | Prof
 : ${WM_COMPILE_OPTION:=Opt}; export WM_COMPILE_OPTION
 
-# WM_MPLIB = SYSTEMOPENMPI | OPENMPI | MPICH | MPICH-GM | HPMPI | GAMMA | MPI | QSMPI
+# WM_MPLIB = SYSTEMOPENMPI | OPENMPI | MPICH | MPICH-GM | HPMPI | GAMMA
+#                          | MPI | QSMPI
 : ${WM_MPLIB:=OPENMPI}; export WM_MPLIB
 
 
@@ -241,7 +242,8 @@ foamClean=$WM_PROJECT_DIR/bin/foamCleanPath
 cleaned=`$foamClean "$PATH" "$foamOldDirs"` && PATH="$cleaned"
 
 #- Clean LD_LIBRARY_PATH
-cleaned=`$foamClean "$LD_LIBRARY_PATH" "$foamOldDirs"` && LD_LIBRARY_PATH="$cleaned"
+cleaned=`$foamClean "$LD_LIBRARY_PATH" "$foamOldDirs"` \
+    && LD_LIBRARY_PATH="$cleaned"
 
 #- Clean MANPATH
 cleaned=`$foamClean "$MANPATH" "$foamOldDirs"` && MANPATH="$cleaned"
@@ -257,8 +259,13 @@ _foamSource $WM_PROJECT_DIR/etc/aliases.sh
 
 # Source user setup files for optional packages
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-_foamSource $WM_PROJECT_DIR/etc/apps/paraview3/bashrc
-_foamSource $WM_PROJECT_DIR/etc/apps/ensight/bashrc
+paraview3=`$WM_PROJECT_DIR/bin/foamEtcFile apps/paraview3/bashrc` \
+    && _foamSource $paraview3
+unset paraview3
+
+ensight=`$WM_PROJECT_DIR/bin/foamEtcFile apps/ensight/bashrc` \
+    && _foamSource $ensight
+unset ensight
 
 
 # Clean environment paths again. Only remove duplicates
diff --git a/etc/cellModels b/etc/cellModels
index eb6f1b9507980263a15411bc0ba0b84ed76f9c45..a90eaa94e7227bfce45c83b9cb0995a25decaeab 100644
--- a/etc/cellModels
+++ b/etc/cellModels
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.6                                   |
+|  \\    /   O peration     | Version:  1.7                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/etc/controlDict b/etc/controlDict
index 691e9701243f8512384196967f259417dfd986a2..f989950f269b3a26591d6ecb586540429e011961 100644
--- a/etc/controlDict
+++ b/etc/controlDict
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.6                                   |
+|  \\    /   O peration     | Version:  1.7                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/etc/cshrc b/etc/cshrc
index 9f55d62ab625334f9d5a93dda715b9b6631d0b99..807d38f0425a9a6d1d8814f49a57938d6c0bfe4b 100644
--- a/etc/cshrc
+++ b/etc/cshrc
@@ -31,7 +31,7 @@
 #------------------------------------------------------------------------------
 
 setenv WM_PROJECT OpenFOAM
-if ( ! $?WM_PROJECT_VERSION ) setenv WM_PROJECT_VERSION dev
+setenv WM_PROJECT_VERSION dev
 
 ################################################################################
 # USER EDITABLE PART. Note changes made here may be lost with the next upgrade
@@ -255,8 +255,17 @@ _foamSource $WM_PROJECT_DIR/etc/aliases.csh
 
 # Source user setup files for optional packages
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-_foamSource $WM_PROJECT_DIR/etc/apps/paraview3/cshrc
-# _foamSource $WM_PROJECT_DIR/etc/apps/ensight/cshrc
+set paraview3=`$WM_PROJECT_DIR/bin/foamEtcFile apps/paraview3/cshrc`
+if ( $status == 0 ) then
+    _foamSource $paraview3
+endif
+unset paraview3
+
+set ensight=`$WM_PROJECT_DIR/bin/foamEtcFile apps/ensight/cshrc`
+if ( $status == 0 ) then
+    _foamSource $ensight
+endif
+unset ensight
 
 
 # Clean environment paths again. Only remove duplicates
diff --git a/src/OSspecific/POSIX/regExp.H b/src/OSspecific/POSIX/regExp.H
index edc8ddd6c01f792f80188a031fc0d5669633ba62..cd140fe8522b5a35863be5aadce340e00d2d80b5 100644
--- a/src/OSspecific/POSIX/regExp.H
+++ b/src/OSspecific/POSIX/regExp.H
@@ -157,7 +157,7 @@ public:
         //  The begin-of-line (^) and end-of-line ($) anchors are implicit
         bool match(const string&, List<string>& groups) const;
 
-        //- Return true if the regex was found in within string
+        //- Return true if the regex was found within string
         bool search(const std::string& str) const
         {
             return std::string::npos != find(str);
diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files
index 599d30fa094cbc485f9c9a170c7d4f89a379052f..94bc86f2efeacf8cfc767223e141b8b27c02f058 100644
--- a/src/OpenFOAM/Make/files
+++ b/src/OpenFOAM/Make/files
@@ -52,8 +52,8 @@ $(strings)/word/word.C
 $(strings)/word/wordIO.C
 $(strings)/fileName/fileName.C
 $(strings)/fileName/fileNameIO.C
-$(strings)/keyType/keyTypeIO.C
-$(strings)/wordRe/wordReIO.C
+$(strings)/keyType/keyType.C
+$(strings)/wordRe/wordRe.C
 
 primitives/hashes/Hasher/Hasher.C
 
@@ -66,7 +66,8 @@ primitives/random/Random.C
 containers/HashTables/HashTable/HashTableCore.C
 containers/HashTables/StaticHashTable/StaticHashTableCore.C
 containers/Lists/SortableList/ParSortableListName.C
-containers/Lists/PackedList/PackedListName.C
+containers/Lists/PackedList/PackedListCore.C
+containers/Lists/PackedList/PackedBoolList.C
 containers/Lists/ListOps/ListOps.C
 containers/LinkedLists/linkTypes/SLListBase/SLListBase.C
 containers/LinkedLists/linkTypes/DLListBase/DLListBase.C
@@ -295,6 +296,7 @@ primitiveShapes = meshes/primitiveShapes
 $(primitiveShapes)/line/line.C
 $(primitiveShapes)/plane/plane.C
 $(primitiveShapes)/triangle/intersection.C
+$(primitiveShapes)/objectHit/pointIndexHitIOList.C
 
 meshShapes = meshes/meshShapes
 $(meshShapes)/edge/edge.C
@@ -328,7 +330,7 @@ $(cellShape)/cellShapeEqual.C
 $(cellShape)/cellShapeIO.C
 $(cellShape)/cellShapeIOList.C
 
-meshes/patchIdentifier/patchIdentifier.C
+meshes/Identifiers/patch/patchIdentifier.C
 
 polyMesh = meshes/polyMesh
 
diff --git a/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H b/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H
index 4831b98106b734f93ffa0bb70f6e252d6090b5e7..fdf1a3c931f2cfdb031760143cb9beed86c8eef4 100644
--- a/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H
+++ b/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H
@@ -180,13 +180,22 @@ public:
         // Member Operators
 
             //- Append an element at the end of the list
-            inline void append(const T&);
+            inline DynamicList<T, SizeInc, SizeMult, SizeDiv>& append
+            (
+                const T&
+            );
 
             //- Append a List at the end of this list
-            inline void append(const UList<T>&);
+            inline DynamicList<T, SizeInc, SizeMult, SizeDiv>& append
+            (
+                const UList<T>&
+            );
 
             //- Append a UIndirectList at the end of this list
-            inline void append(const UIndirectList<T>&);
+            inline DynamicList<T, SizeInc, SizeMult, SizeDiv>& append
+            (
+                const UIndirectList<T>&
+            );
 
             //- Remove and return the top element
             inline T remove();
diff --git a/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H b/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H
index f6ff8e99698839b2a33483ec8e405276c28bab53..bbe24d11c29e876b22dbb5bdbea38be7d4053837 100644
--- a/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H
+++ b/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H
@@ -305,7 +305,8 @@ Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::xfer()
 
 
 template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::append
+inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>&
+Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::append
 (
     const T& t
 )
@@ -314,11 +315,13 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::append
     setSize(elemI + 1);
 
     this->operator[](elemI) = t;
+    return *this;
 }
 
 
 template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::append
+inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>&
+Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::append
 (
     const UList<T>& lst
 )
@@ -339,11 +342,13 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::append
     {
         this->operator[](nextFree++) = lst[elemI];
     }
+    return *this;
 }
 
 
 template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::append
+inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>&
+Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::append
 (
     const UIndirectList<T>& lst
 )
@@ -355,6 +360,7 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::append
     {
         this->operator[](nextFree++) = lst[elemI];
     }
+    return *this;
 }
 
 
diff --git a/src/OpenFOAM/containers/Lists/IndirectList/IndirectList.H b/src/OpenFOAM/containers/Lists/IndirectList/IndirectList.H
index 0d41f70c151c0b5e3722e070794e938a32af6f66..ec65a14a1bfb4f4994026069c549676f809fb105 100644
--- a/src/OpenFOAM/containers/Lists/IndirectList/IndirectList.H
+++ b/src/OpenFOAM/containers/Lists/IndirectList/IndirectList.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -25,7 +25,11 @@ Class
     Foam::IndirectList
 
 Description
-    A List with indirect addressing
+    A List with indirect addressing.
+
+SeeAlso
+    Foam::UIndirectList for a version without any allocation for the
+    addressing.
 
 SourceFiles
     IndirectListI.H
@@ -35,7 +39,7 @@ SourceFiles
 #ifndef IndirectList_H
 #define IndirectList_H
 
-#include "List.H"
+#include "UIndirectList.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -43,81 +47,109 @@ namespace Foam
 {
 
 /*---------------------------------------------------------------------------*\
-                        Class IndirectList Declaration
+                   Class IndirectListAddressing Declaration
 \*---------------------------------------------------------------------------*/
 
-template<class T>
-class IndirectList
+//- A helper class for storing addresses.
+class IndirectListAddressing
 {
     // Private data
 
-        UList<T>& completeList_;
+        //- Storage for the list addressing
         List<label> addressing_;
 
 
-public:
+    // Private Member Functions
+
+        //- Disallow default bitwise copy construct
+        IndirectListAddressing(const IndirectListAddressing&);
+
+        //- Disallow default bitwise assignment
+        void operator=(const IndirectListAddressing&);
+
+
+protected:
 
     // Constructors
 
-        //- Construct given the complete list and the addressing array
-        inline IndirectList(const UList<T>&, const UList<label>&);
+        //- Construct by copying the addressing array
+        explicit inline IndirectListAddressing(const UList<label>& addr);
 
-        //- Construct given the complete list and by transferring addressing
-        inline IndirectList(const UList<T>&, const Xfer<List<label> >&);
+        //- Construct by transferring addressing array
+        explicit inline IndirectListAddressing(const Xfer<List<label> >& addr);
 
 
     // Member Functions
 
         // Access
 
-            //- Return the number of elements in the list
-            inline label size() const;
+            //- Return the list addressing
+            inline const List<label>& addressing() const;
 
-            //- Return true if the list is empty (ie, size() is zero).
-            inline bool empty() const;
+        // Edit
 
-            //- Return the first element of the list.
-            inline T& first();
+            //- Reset addressing
+            inline void resetAddressing(const UList<label>&);
+            inline void resetAddressing(const Xfer<List<label> >&);
 
-            //- Return first element of the list.
-            inline const T& first() const;
+};
 
-            //- Return the last element of the list.
-            inline T& last();
 
-            //- Return the last element of the list.
-            inline const T& last() const;
+/*---------------------------------------------------------------------------*\
+                        Class IndirectList Declaration
+\*---------------------------------------------------------------------------*/
 
-            //- Return the complete list
-            inline const UList<T>& completeList() const;
+template<class T>
+class IndirectList
+:
+    private IndirectListAddressing,
+    public  UIndirectList<T>
+{
+    // Private Member Functions
 
-            //- Return the list addressing
-            inline const List<label>& addressing() const;
+        //- Disable default assignment operator
+        void operator=(const IndirectList<T>&);
 
+        //- Disable assignment from UIndirectList
+        void operator=(const UIndirectList<T>&);
 
-        // Edit
 
-            //- Reset addressing
-            inline void resetAddressing(const UList<label>&);
-            inline void resetAddressing(const Xfer<List<label> >&);
+public:
+
+    // Constructors
 
+        //- Construct given the complete list and the addressing array
+        inline IndirectList(const UList<T>&, const UList<label>&);
 
-        // Member Operators
+        //- Construct given the complete list and by transferring addressing
+        inline IndirectList(const UList<T>&, const Xfer<List<label> >&);
 
-            //- Return the addressed elements as a List
-            inline List<T> operator()() const;
+        //- Copy constructor
+        inline IndirectList(const IndirectList<T>&);
 
-            //- Return non-const access to an element
-            inline T& operator[](const label);
+        //- Construct from UIndirectList
+        explicit inline IndirectList(const UIndirectList<T>&);
 
-            //- Return const access to an element
-            inline const T& operator[](const label) const;
 
-            //- Assignment from UList of addressed elements
-            inline void operator=(const UList<T>&);
+    // Member Functions
+
+
+        // Access
+
+            //- Return the list addressing
+            using UIndirectList<T>::addressing;
+
+
+        // Edit
+
+            //- Reset addressing
+            using IndirectListAddressing::resetAddressing;
+
+
+        // Member Operators
 
-            //- Assignment of all entries to the given value
-            inline void operator=(const T&);
+            //- Assignment operator
+            using UIndirectList<T>::operator=;
 };
 
 
diff --git a/src/OpenFOAM/containers/Lists/IndirectList/IndirectListI.H b/src/OpenFOAM/containers/Lists/IndirectList/IndirectListI.H
index dfcc20d537165ac6c5a29e7a5f54fe3c9e519131..0303ba2d5eb9164eef9e428fdc8ddb39e33d05c8 100644
--- a/src/OpenFOAM/containers/Lists/IndirectList/IndirectListI.H
+++ b/src/OpenFOAM/containers/Lists/IndirectList/IndirectListI.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -25,90 +25,97 @@ License
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
-template<class T>
-inline Foam::IndirectList<T>::IndirectList
+
+inline Foam::IndirectListAddressing::IndirectListAddressing
 (
-    const UList<T>& completeList,
     const UList<label>& addr
 )
 :
-    completeList_(const_cast<UList<T>&>(completeList)),
     addressing_(addr)
 {}
 
 
-template<class T>
-inline Foam::IndirectList<T>::IndirectList
+inline Foam::IndirectListAddressing::IndirectListAddressing
 (
-    const UList<T>& completeList,
     const Xfer<List<label> >& addr
 )
 :
-    completeList_(const_cast<UList<T>&>(completeList)),
     addressing_(addr)
 {}
 
 
-// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
-
-template<class T>
-inline Foam::label Foam::IndirectList<T>::size() const
-{
-    return addressing_.size();
-}
-
-
 template<class T>
-inline bool Foam::IndirectList<T>::empty() const
-{
-    return addressing_.empty();
-}
-
-
-template<class T>
-inline T& Foam::IndirectList<T>::first()
-{
-    return completeList_[addressing_.first()];
-}
+inline Foam::IndirectList<T>::IndirectList
+(
+    const UList<T>& completeList,
+    const UList<label>& addr
+)
+:
+    IndirectListAddressing(addr),
+    UIndirectList<T>
+    (
+        completeList,
+        IndirectListAddressing::addressing()
+    )
+{}
 
 
 template<class T>
-inline const T& Foam::IndirectList<T>::first() const
-{
-    return completeList_[addressing_.first()];
-}
+inline Foam::IndirectList<T>::IndirectList
+(
+    const UList<T>& completeList,
+    const Xfer<List<label> >& addr
+)
+:
+    IndirectListAddressing(addr),
+    UIndirectList<T>
+    (
+        completeList,
+        IndirectListAddressing::addressing()
+    )
+{}
 
 
 template<class T>
-inline T& Foam::IndirectList<T>::last()
-{
-    return completeList_[addressing_.last()];
-}
+inline Foam::IndirectList<T>::IndirectList
+(
+    const IndirectList<T>& lst
+)
+:
+    IndirectListAddressing(lst.addressing()),
+    UIndirectList<T>
+    (
+        lst.completeList(),
+        IndirectListAddressing::addressing()
+    )
+{}
 
 
 template<class T>
-inline const T& Foam::IndirectList<T>::last() const
-{
-    return completeList_[addressing_.last()];
-}
-
+inline Foam::IndirectList<T>::IndirectList
+(
+    const UIndirectList<T>& lst
+)
+:
+    IndirectListAddressing(lst.addressing()),
+    UIndirectList<T>
+    (
+        lst.completeList(),
+        IndirectListAddressing::addressing()
+    )
+{}
 
-template<class T>
-inline const Foam::UList<T>& Foam::IndirectList<T>::completeList() const
-{
-    return completeList_;
-}
 
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
-template<class T>
-inline const Foam::List<Foam::label>& Foam::IndirectList<T>::addressing() const
+inline const Foam::List<Foam::label>&
+Foam::IndirectListAddressing::addressing() const
 {
     return addressing_;
 }
 
 
-template<class T>
-inline void Foam::IndirectList<T>::resetAddressing
+inline void Foam::IndirectListAddressing::resetAddressing
 (
     const UList<label>& addr
 )
@@ -117,8 +124,7 @@ inline void Foam::IndirectList<T>::resetAddressing
 }
 
 
-template<class T>
-inline void Foam::IndirectList<T>::resetAddressing
+inline void Foam::IndirectListAddressing::resetAddressing
 (
     const Xfer<List<label> >& addr
 )
@@ -127,63 +133,4 @@ inline void Foam::IndirectList<T>::resetAddressing
 }
 
 
-// * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
-
-template<class T>
-inline Foam::List<T> Foam::IndirectList<T>::operator()() const
-{
-    List<T> result(size());
-
-    forAll(*this, i)
-    {
-        result[i] = operator[](i);
-    }
-
-    return result;
-}
-
-
-template<class T>
-inline T& Foam::IndirectList<T>::operator[](const label i)
-{
-    return completeList_[addressing_[i]];
-}
-
-
-template<class T>
-inline const T& Foam::IndirectList<T>::operator[](const label i) const
-{
-    return completeList_[addressing_[i]];
-}
-
-
-template<class T>
-inline void Foam::IndirectList<T>::operator=(const UList<T>& ae)
-{
-    if (addressing_.size() != ae.size())
-    {
-        FatalErrorIn("IndirectList<T>::operator=(const UList<T>&)")
-            << "Addressing and list of addressed elements "
-               "have different sizes: "
-            << addressing_.size() << " " << ae.size()
-            << abort(FatalError);
-    }
-
-    forAll(addressing_, i)
-    {
-        completeList_[addressing_[i]] = ae[i];
-    }
-}
-
-
-template<class T>
-inline void Foam::IndirectList<T>::operator=(const T& t)
-{
-    forAll(addressing_, i)
-    {
-        completeList_[addressing_[i]] = t;
-    }
-}
-
-
 // ************************************************************************* //
diff --git a/src/OpenFOAM/containers/Lists/List/List.C b/src/OpenFOAM/containers/Lists/List/List.C
index 8a06df242c5621a132ef995764b391d1cd34b40c..ae4a36a805856686cd3d42816d674bbb98154621 100644
--- a/src/OpenFOAM/containers/Lists/List/List.C
+++ b/src/OpenFOAM/containers/Lists/List/List.C
@@ -266,24 +266,6 @@ Foam::List<T>::List(const SLList<T>& lst)
 }
 
 
-// Construct as copy of IndirectList<T>
-template<class T>
-Foam::List<T>::List(const IndirectList<T>& lst)
-:
-    UList<T>(NULL, lst.size())
-{
-    if (this->size_)
-    {
-        this->v_ = new T[this->size_];
-
-        forAll(*this, i)
-        {
-            this->operator[](i) = lst[i];
-        }
-    }
-}
-
-
 // Construct as copy of UIndirectList<T>
 template<class T>
 Foam::List<T>::List(const UIndirectList<T>& lst)
@@ -381,7 +363,7 @@ void Foam::List<T>::setSize(const label newSize)
 template<class T>
 void Foam::List<T>::setSize(const label newSize, const T& a)
 {
-    label oldSize = this->size_;
+    label oldSize = label(this->size_);
     this->setSize(newSize);
 
     if (newSize > oldSize)
@@ -517,25 +499,6 @@ void Foam::List<T>::operator=(const SLList<T>& lst)
 }
 
 
-// Assignment operator. Takes linear time.
-template<class T>
-void Foam::List<T>::operator=(const IndirectList<T>& lst)
-{
-    if (lst.size() != this->size_)
-    {
-        if (this->v_) delete[] this->v_;
-        this->v_ = 0;
-        this->size_ = lst.size();
-        if (this->size_) this->v_ = new T[this->size_];
-    }
-
-    forAll(*this, i)
-    {
-        this->operator[](i) = lst[i];
-    }
-}
-
-
 // Assignment operator. Takes linear time.
 template<class T>
 void Foam::List<T>::operator=(const UIndirectList<T>& lst)
diff --git a/src/OpenFOAM/containers/Lists/List/List.H b/src/OpenFOAM/containers/Lists/List/List.H
index 2999e0886ed5826b974c121b9ce2f8c53ad6f6b6..d51a1f9eefcfeb47d113e2ab8966745dcd579edf 100644
--- a/src/OpenFOAM/containers/Lists/List/List.H
+++ b/src/OpenFOAM/containers/Lists/List/List.H
@@ -131,9 +131,6 @@ public:
         //- Construct as copy of SLList<T>
         explicit List(const SLList<T>&);
 
-        //- Construct as copy of IndirectList<T>
-        explicit List(const IndirectList<T>&);
-
         //- Construct as copy of UIndirectList<T>
         explicit List(const UIndirectList<T>&);
 
@@ -219,9 +216,6 @@ public:
         //- Assignment from SLList operator. Takes linear time.
         void operator=(const SLList<T>&);
 
-        //- Assignment from IndirectList operator. Takes linear time.
-        void operator=(const IndirectList<T>&);
-
         //- Assignment from UIndirectList operator. Takes linear time.
         void operator=(const UIndirectList<T>&);
 
diff --git a/src/OpenFOAM/containers/Lists/List/ListIO.C b/src/OpenFOAM/containers/Lists/List/ListIO.C
index 984971ecc4694557a325373eea0336bb27fcf819..a70cc8f9e6b578d0a2d039ff61687676ff0f9969 100644
--- a/src/OpenFOAM/containers/Lists/List/ListIO.C
+++ b/src/OpenFOAM/containers/Lists/List/ListIO.C
@@ -135,7 +135,7 @@ Foam::Istream& Foam::operator>>(Istream& is, List<T>& L)
                 << exit(FatalIOError);
         }
 
-        // Putback the openning bracket
+        // Putback the opening bracket
         is.putBack(firstToken);
 
         // Now read as a singly-linked list
diff --git a/src/OpenFOAM/containers/Lists/PackedList/PackedBoolList.C b/src/OpenFOAM/containers/Lists/PackedList/PackedBoolList.C
new file mode 100644
index 0000000000000000000000000000000000000000..79a383a685e76556b0e3be9372e913d39b9f117d
--- /dev/null
+++ b/src/OpenFOAM/containers/Lists/PackedList/PackedBoolList.C
@@ -0,0 +1,375 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software: you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 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 "PackedBoolList.H"
+#include "IOstreams.H"
+
+// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+
+bool Foam::PackedBoolList::bitorPrepare
+(
+    const PackedList<1>& lst,
+    label& maxPackLen
+)
+{
+    const StorageList& lhs = this->storage();
+    const StorageList& rhs = lst.storage();
+
+    const label packLen1 = this->packedLength();
+    const label packLen2 = lst.packedLength();
+
+
+    // check how the lists interact and if bit trimming is needed
+    bool needTrim = false;
+    maxPackLen = packLen1;
+
+    if (packLen1 == packLen2)
+    {
+        // identical packed lengths - only resize if absolutely necessary
+        if
+        (
+            this->size() != lst.size()
+         && maxPackLen
+         && rhs[maxPackLen-1] > lhs[maxPackLen-1]
+        )
+        {
+            // second list has a higher bit set
+            // extend addressable area and use trim
+            resize(lst.size());
+            needTrim = true;
+        }
+    }
+    else if (packLen2 < packLen1)
+    {
+        // second list is shorter, this limits the or
+        maxPackLen = packLen2;
+    }
+    else
+    {
+        // second list is longer, find the highest bit set
+        for (label storeI = packLen1; storeI < packLen2; ++storeI)
+        {
+            if (rhs[storeI])
+            {
+                maxPackLen = storeI+1;
+            }
+        }
+
+        // the upper limit moved - resize for full coverage and trim later
+        if (maxPackLen > packLen1)
+        {
+            resize(maxPackLen * packing());
+            needTrim = true;
+        }
+    }
+
+    return needTrim;
+}
+
+
+template<class LabelListType>
+Foam::label Foam::PackedBoolList::setIndices(const LabelListType& indices)
+{
+    // no better information, just guess something about the size
+    reserve(indices.size());
+
+    label cnt = 0;
+    forAll(indices, elemI)
+    {
+        if (set(indices[elemI]))
+        {
+            ++cnt;
+        }
+    }
+
+    return cnt;
+}
+
+
+template<class LabelListType>
+Foam::label Foam::PackedBoolList::unsetIndices(const LabelListType& indices)
+{
+    label cnt = 0;
+    forAll(indices, elemI)
+    {
+        if (unset(indices[elemI]))
+        {
+            ++cnt;
+        }
+    }
+
+    return cnt;
+}
+
+
+template<class LabelListType>
+Foam::label Foam::PackedBoolList::subsetIndices(const LabelListType& indices)
+{
+    // handle trivial case
+    if (empty() || indices.empty())
+    {
+        clear();
+        return 0;
+    }
+
+    // normal case
+    PackedBoolList anded;
+    anded.reserve(size());
+
+    label cnt = 0;
+    forAll(indices, elemI)
+    {
+        const label& index = indices[elemI];
+        if (operator[](index))
+        {
+            anded.set(index);
+            ++cnt;
+        }
+    }
+
+    transfer(anded);
+    return cnt;
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
+
+Foam::PackedBoolList::PackedBoolList(Istream& is)
+:
+    PackedList<1>()
+{
+    is  >> *this;
+}
+
+
+// * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * * //
+
+void Foam::PackedBoolList::set(const PackedList<1>& lst)
+{
+    // extend addressable area if needed, return maximum size possible
+    label len = 0;
+    const bool needTrim = bitorPrepare(lst, len);
+
+    // operate directly with the underlying storage
+    StorageList& lhs = this->storage();
+    const StorageList& rhs = lst.storage();
+
+    for (label i=0; i < len; ++i)
+    {
+        lhs[i] |= rhs[i];
+    }
+
+    if (needTrim)
+    {
+        trim();
+    }
+}
+
+
+Foam::label Foam::PackedBoolList::set(const UList<label>& indices)
+{
+    return setIndices(indices);
+}
+
+
+Foam::label Foam::PackedBoolList::set(const UIndirectList<label>& indices)
+{
+    return setIndices(indices);
+}
+
+
+void Foam::PackedBoolList::unset(const PackedList<1>& lst)
+{
+    // operate directly with the underlying storage
+    StorageList& lhs = this->storage();
+    const StorageList& rhs = lst.storage();
+
+    // overlapping storage size
+    const label len = min(this->packedLength(), lst.packedLength());
+
+    for (label i=0; i < len; ++i)
+    {
+        lhs[i] &= ~rhs[i];
+    }
+}
+
+
+Foam::label Foam::PackedBoolList::unset(const UList<label>& indices)
+{
+    return unsetIndices(indices);
+}
+
+
+Foam::label Foam::PackedBoolList::unset(const UIndirectList<label>& indices)
+{
+    return unsetIndices(indices);
+}
+
+
+void Foam::PackedBoolList::subset(const PackedList<1>& lst)
+{
+    // shrink addressable area if needed
+    if (this->size() > lst.size())
+    {
+        this->resize(lst.size());
+    }
+
+    // operate directly with the underlying storage
+    StorageList& lhs = this->storage();
+    const StorageList& rhs = lst.storage();
+
+    const label len = this->packedLength();
+
+    for (label i=0; i < len; ++i)
+    {
+        lhs[i] &= rhs[i];
+    }
+}
+
+
+Foam::label Foam::PackedBoolList::subset(const UList<label>& indices)
+{
+    return subsetIndices(indices);
+}
+
+
+Foam::label Foam::PackedBoolList::subset(const UIndirectList<label>& indices)
+{
+    return subsetIndices(indices);
+}
+
+
+Foam::Xfer<Foam::labelList> Foam::PackedBoolList::used() const
+{
+    labelList lst(this->count());
+
+    if (lst.size())
+    {
+        label nElem = 0;
+
+        forAll(*this, elemI)
+        {
+            if (get(elemI))
+            {
+                lst[nElem++] = elemI;
+            }
+        }
+
+        lst.setSize(nElem);
+    }
+
+    return lst.xfer();
+}
+
+
+// * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * * //
+
+Foam::PackedBoolList&
+Foam::PackedBoolList::operator=(const UList<bool>& lst)
+{
+    this->setSize(lst.size());
+
+    // overwrite with new true/false values
+    forAll(*this, elemI)
+    {
+        set(elemI, lst[elemI]);
+    }
+
+    return *this;
+}
+
+
+Foam::PackedBoolList&
+Foam::PackedBoolList::operator^=(const PackedList<1>& lst)
+{
+    // extend addressable area if needed, return maximum size possible
+    label len = 0;
+    const bool needTrim = bitorPrepare(lst, len);
+
+    // operate directly with the underlying storage
+    StorageList& lhs = this->storage();
+    const StorageList& rhs = lst.storage();
+
+    for (label i=0; i < len; ++i)
+    {
+        lhs[i] ^= rhs[i];
+    }
+
+    if (needTrim)
+    {
+        trim();
+    }
+
+    return *this;
+}
+
+
+// * * * * * * * * * * * * * *  Global Operators * * * * * * * * * * * * * * //
+
+Foam::PackedBoolList Foam::operator&
+(
+    const PackedBoolList& lst1,
+    const PackedBoolList& lst2
+)
+{
+    PackedBoolList result(lst1);
+    result &= lst2;
+
+    // trim to bits actually used
+    result.trim();
+
+    return result;
+}
+
+
+Foam::PackedBoolList Foam::operator^
+(
+    const PackedBoolList& lst1,
+    const PackedBoolList& lst2
+)
+{
+    PackedBoolList result(lst1);
+    result ^= lst2;
+
+    // trim to bits actually used
+    result.trim();
+
+    return result;
+}
+
+
+Foam::PackedBoolList Foam::operator|
+(
+    const PackedBoolList& lst1,
+    const PackedBoolList& lst2
+)
+{
+    PackedBoolList result(lst1);
+    result |= lst2;
+    return result;
+}
+
+
+// ************************************************************************* //
diff --git a/src/OpenFOAM/containers/Lists/PackedList/PackedBoolList.H b/src/OpenFOAM/containers/Lists/PackedList/PackedBoolList.H
new file mode 100644
index 0000000000000000000000000000000000000000..7e47674b8b78efff001c10fd50e1d53e79cdf946
--- /dev/null
+++ b/src/OpenFOAM/containers/Lists/PackedList/PackedBoolList.H
@@ -0,0 +1,296 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software: you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 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::PackedBoolList
+
+Description
+    A bit-packed bool list.
+
+    In addition to the obvious memory advantage over using a
+    List\<bool\>, this class also provides a number of bit-like
+    operations.
+
+SourceFiles
+    PackedBoolListI.H
+    PackedBoolList.C
+
+SeeAlso
+    Foam::PackedList
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef PackedBoolList_H
+#define PackedBoolList_H
+
+#include "PackedList.H"
+#include "UIndirectList.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+                       Class PackedBoolList Declaration
+\*---------------------------------------------------------------------------*/
+
+class PackedBoolList
+:
+    public PackedList<1>
+{
+    // Private Member Functions
+
+        //- Preparation, resizing before a bitor operation
+        //  returns true if the later result needs trimming
+        bool bitorPrepare(const PackedList<1>& lst, label& maxPackLen);
+
+        //- Set the listed indices. Return number of elements changed.
+        //  Does auto-vivify for non-existent entries.
+        template<class LabelListType>
+        label setIndices(const LabelListType& indices);
+
+        //- Unset the listed indices. Return number of elements changed.
+        //  Never auto-vivify entries.
+        template<class LabelListType>
+        label unsetIndices(const LabelListType& indices);
+
+        //- Subset with the listed indices. Return number of elements subsetted.
+        template<class LabelListType>
+        label subsetIndices(const LabelListType& indices);
+
+
+public:
+
+    // Constructors
+
+        //- Construct null
+        inline PackedBoolList();
+
+        //- Construct from Istream
+        PackedBoolList(Istream&);
+
+        //- Construct with given size, initializes list to 0
+        explicit inline PackedBoolList(const label size);
+
+        //- Construct with given size and value for all elements
+        inline PackedBoolList(const label size, const bool val);
+
+        //- Copy constructor
+        inline PackedBoolList(const PackedBoolList&);
+
+        //- Copy constructor
+        explicit inline PackedBoolList(const PackedList<1>&);
+
+        //- Construct by transferring the parameter contents
+        inline PackedBoolList(const Xfer<PackedBoolList>&);
+
+        //- Construct by transferring the parameter contents
+        inline PackedBoolList(const Xfer<PackedList<1> >&);
+
+        //- Construct from a list of bools
+        explicit inline PackedBoolList(const UList<bool>&);
+
+        //- Construct from a list of labels
+        //  using the labels as indices to indicate which bits are set
+        explicit inline PackedBoolList(const UList<label>& indices);
+
+        //- Construct from a list of labels
+        //  using the labels as indices to indicate which bits are set
+        explicit inline PackedBoolList(const UIndirectList<label>& indices);
+
+        //- Clone
+        inline autoPtr<PackedBoolList> clone() const;
+
+
+    // Member Functions
+
+        // Access
+
+            using PackedList<1>::set;
+            using PackedList<1>::unset;
+
+            //- Set specified bits.
+            void set(const PackedList<1>&);
+
+            //- Set the listed indices. Return number of elements changed.
+            //  Does auto-vivify for non-existent entries.
+            label set(const UList<label>& indices);
+
+            //- Set the listed indices. Return number of elements changed.
+            //  Does auto-vivify for non-existent entries.
+            label set(const UIndirectList<label>& indices);
+
+            //- Unset specified bits.
+            void unset(const PackedList<1>&);
+
+            //- Unset the listed indices. Return number of elements changed.
+            //  Never auto-vivify entries.
+            label unset(const UList<label>& indices);
+
+            //- Unset the listed indices. Return number of elements changed.
+            //  Never auto-vivify entries.
+            label unset(const UIndirectList<label>& indices);
+
+            //- Subset with the specified list.
+            void subset(const PackedList<1>&);
+
+            //- Subset with the listed indices.
+            //  Return number of elements subsetted.
+            label subset(const UList<label>& indices);
+
+            //- Subset with the listed indices.
+            //  Return number of elements subsetted.
+            label subset(const UIndirectList<label>& indices);
+
+
+            //- Return indices of the used (true) elements as a list of labels
+            Xfer<labelList> used() const;
+
+
+        // Edit
+
+            //- Transfer the contents of the argument list into this list
+            //  and annul the argument list.
+            inline void transfer(PackedBoolList&);
+
+            //- Transfer the contents of the argument list into this list
+            //  and annul the argument list.
+            inline void transfer(PackedList<1>&);
+
+            //- Transfer contents to the Xfer container
+            inline Xfer<PackedBoolList> xfer();
+
+
+    // Member Operators
+
+            //- Assignment of all entries to the given value.
+            inline PackedBoolList& operator=(const bool val);
+
+            //- Assignment operator.
+            inline PackedBoolList& operator=(const PackedBoolList&);
+
+            //- Assignment operator.
+            inline PackedBoolList& operator=(const PackedList<1>&);
+
+            //- Assignment operator.
+            PackedBoolList& operator=(const UList<bool>&);
+
+            //- Assignment operator,
+            //  using the labels as indices to indicate which bits are set
+            inline PackedBoolList& operator=(const UList<label>& indices);
+
+            //- Assignment operator,
+            //  using the labels as indices to indicate which bits are set
+            inline PackedBoolList& operator=(const UIndirectList<label>&);
+
+            //- Complement operator
+            inline PackedBoolList operator~() const;
+
+            //- And operator (lists may be dissimilar sizes)
+            inline PackedBoolList& operator&=(const PackedList<1>&);
+
+            //- And operator (lists may be dissimilar sizes)
+            //  using the labels as indices to indicate which bits are set
+            inline PackedBoolList& operator&=(const UList<label>& indices);
+
+            //- And operator (lists may be dissimilar sizes)
+            //  using the labels as indices to indicate which bits are set
+            inline PackedBoolList& operator&=(const UIndirectList<label>&);
+
+            //- Xor operator (lists may be dissimilar sizes)
+            //  Retains unique entries
+            PackedBoolList& operator^=(const PackedList<1>&);
+
+            //- Or operator (lists may be dissimilar sizes)
+            inline PackedBoolList& operator|=(const PackedList<1>&);
+
+            //- Or operator (lists may be dissimilar sizes),
+            //  using the labels as indices to indicate which bits are set
+            inline PackedBoolList& operator|=(const UList<label>& indices);
+
+            //- Or operator (lists may be dissimilar sizes),
+            //  using the labels as indices to indicate which bits are set
+            inline PackedBoolList& operator|=(const UIndirectList<label>&);
+
+
+            //- Add entries to this list, synonymous with the or operator
+            inline PackedBoolList& operator+=(const PackedList<1>&);
+
+            //- Add entries to this list, synonymous with the or operator
+            inline PackedBoolList& operator+=(const UList<label>& indices);
+
+            //- Add entries to this list, synonymous with the or operator
+            inline PackedBoolList& operator+=(const UIndirectList<label>&);
+
+            //- Remove entries from this list - unset the specified bits
+            inline PackedBoolList& operator-=(const PackedList<1>&);
+
+            //- Remove entries from this list - unset the specified bits
+            inline PackedBoolList& operator-=(const UList<label>& indices);
+
+            //- Remove entries from this list - unset the specified bits
+            inline PackedBoolList& operator-=(const UIndirectList<label>&);
+};
+
+
+// Global Operators
+
+//- Intersect lists - the result is trimmed to the smallest intersecting size
+PackedBoolList operator&
+(
+    const PackedBoolList& lst1,
+    const PackedBoolList& lst2
+);
+
+
+//- Combine to form a unique list (xor)
+//  The result is trimmed to the smallest intersecting size
+PackedBoolList operator^
+(
+    const PackedBoolList& lst1,
+    const PackedBoolList& lst2
+);
+
+
+//- Combine lists
+PackedBoolList operator|
+(
+    const PackedBoolList& lst1,
+    const PackedBoolList& lst2
+);
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#include "PackedBoolListI.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/OpenFOAM/containers/Lists/PackedList/PackedBoolListI.H b/src/OpenFOAM/containers/Lists/PackedList/PackedBoolListI.H
new file mode 100644
index 0000000000000000000000000000000000000000..793959e59b3aeb73d955fa272a996e83494f4356
--- /dev/null
+++ b/src/OpenFOAM/containers/Lists/PackedList/PackedBoolListI.H
@@ -0,0 +1,276 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software: you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 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/>.
+
+\*---------------------------------------------------------------------------*/
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
+
+inline Foam::PackedBoolList::PackedBoolList()
+:
+    PackedList<1>()
+{}
+
+
+inline Foam::PackedBoolList::PackedBoolList(const label size)
+:
+    PackedList<1>(size)
+{}
+
+
+inline Foam::PackedBoolList::PackedBoolList
+(
+    const label size,
+    const bool val
+)
+:
+    PackedList<1>(size, (val ? 1u : 0u))
+{}
+
+
+inline Foam::PackedBoolList::PackedBoolList(const PackedBoolList& lst)
+:
+    PackedList<1>(lst)
+{}
+
+
+inline Foam::PackedBoolList::PackedBoolList(const PackedList<1>& lst)
+:
+    PackedList<1>(lst)
+{}
+
+
+inline Foam::PackedBoolList::PackedBoolList(const Xfer<PackedBoolList>& lst)
+:
+    PackedList<1>()
+{
+    transfer(lst());
+}
+
+
+inline Foam::PackedBoolList::PackedBoolList(const Xfer<PackedList<1> >& lst)
+:
+    PackedList<1>(lst)
+{}
+
+
+inline Foam::PackedBoolList::PackedBoolList(const UList<bool>& lst)
+:
+    PackedList<1>()
+{
+    operator=(lst);
+}
+
+
+inline Foam::PackedBoolList::PackedBoolList(const UList<label>& indices)
+:
+    PackedList<1>(indices.size(), 0u)
+{
+    set(indices);
+}
+
+
+inline Foam::PackedBoolList::PackedBoolList(const UIndirectList<label>& indices)
+:
+    PackedList<1>(indices.size(), 0u)
+{
+    set(indices);
+}
+
+
+inline Foam::autoPtr<Foam::PackedBoolList>
+Foam::PackedBoolList::clone() const
+{
+    return autoPtr<PackedBoolList>(new PackedBoolList(*this));
+}
+
+
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
+
+inline void Foam::PackedBoolList::transfer(PackedBoolList& lst)
+{
+    PackedList<1>::transfer(static_cast<PackedList<1>&>(lst));
+}
+
+
+inline void Foam::PackedBoolList::transfer(PackedList<1>& lst)
+{
+    PackedList<1>::transfer(lst);
+}
+
+
+inline Foam::Xfer<Foam::PackedBoolList> Foam::PackedBoolList::xfer()
+{
+    return xferMove(*this);
+}
+
+
+// * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
+
+inline Foam::PackedBoolList&
+Foam::PackedBoolList::operator=(const bool val)
+{
+    PackedList<1>::operator=(val);
+    return *this;
+}
+
+
+inline Foam::PackedBoolList&
+Foam::PackedBoolList::operator=(const PackedBoolList& lst)
+{
+    PackedList<1>::operator=(lst);
+    return *this;
+}
+
+
+inline Foam::PackedBoolList&
+Foam::PackedBoolList::operator=(const PackedList<1>& lst)
+{
+    PackedList<1>::operator=(lst);
+    return *this;
+}
+
+
+inline Foam::PackedBoolList&
+Foam::PackedBoolList::operator=(const UList<label>& indices)
+{
+    clear();
+    set(indices);
+
+    return *this;
+}
+
+
+inline Foam::PackedBoolList&
+Foam::PackedBoolList::operator=(const UIndirectList<label>& indices)
+{
+    clear();
+    set(indices);
+
+    return *this;
+}
+
+
+inline Foam::PackedBoolList
+Foam::PackedBoolList::operator~() const
+{
+    PackedBoolList result(*this);
+    result.flip();
+
+    return result;
+}
+
+
+inline Foam::PackedBoolList&
+Foam::PackedBoolList::operator&=(const PackedList<1>& lst)
+{
+    subset(lst);
+    return *this;
+}
+
+
+inline Foam::PackedBoolList&
+Foam::PackedBoolList::operator&=(const UList<label>& indices)
+{
+    subset(indices);
+    return *this;
+}
+
+
+inline Foam::PackedBoolList&
+Foam::PackedBoolList::operator&=(const UIndirectList<label>& indices)
+{
+    subset(indices);
+    return *this;
+}
+
+
+inline Foam::PackedBoolList&
+Foam::PackedBoolList::operator|=(const PackedList<1>& lst)
+{
+    set(lst);
+    return *this;
+}
+
+
+inline Foam::PackedBoolList&
+Foam::PackedBoolList::operator|=(const UList<label>& indices)
+{
+    set(indices);
+    return *this;
+}
+
+
+inline Foam::PackedBoolList&
+Foam::PackedBoolList::operator|=(const UIndirectList<label>& indices)
+{
+    set(indices);
+    return *this;
+}
+
+
+inline Foam::PackedBoolList&
+Foam::PackedBoolList::operator+=(const PackedList<1>& lst)
+{
+    return operator|=(lst);
+}
+
+
+inline Foam::PackedBoolList&
+Foam::PackedBoolList::operator+=(const UList<label>& indices)
+{
+    return operator|=(indices);
+}
+
+
+inline Foam::PackedBoolList&
+Foam::PackedBoolList::operator+=(const UIndirectList<label>& indices)
+{
+    return operator|=(indices);
+}
+
+
+inline Foam::PackedBoolList&
+Foam::PackedBoolList::operator-=(const PackedList<1>& lst)
+{
+    unset(lst);
+    return *this;
+}
+
+
+inline Foam::PackedBoolList&
+Foam::PackedBoolList::operator-=(const UList<label>& indices)
+{
+    unset(indices);
+    return *this;
+}
+
+
+inline Foam::PackedBoolList&
+Foam::PackedBoolList::operator-=(const UIndirectList<label>& indices)
+{
+    unset(indices);
+    return *this;
+}
+
+
+// ************************************************************************* //
diff --git a/src/OpenFOAM/containers/Lists/PackedList/PackedList.C b/src/OpenFOAM/containers/Lists/PackedList/PackedList.C
index 6bc8d79eada3b2a37b8126829d3d67a8182a2d27..98a6d2740ad13e8aa10072c59533e468ecf9f990 100644
--- a/src/OpenFOAM/containers/Lists/PackedList/PackedList.C
+++ b/src/OpenFOAM/containers/Lists/PackedList/PackedList.C
@@ -24,35 +24,11 @@ License
 \*---------------------------------------------------------------------------*/
 
 #include "PackedList.H"
-
-// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
-
-template<unsigned nBits>
-Foam::PackedList<nBits>::PackedList(const label size, const unsigned int val)
-:
-    StorageList(packedLength(size), 0u),
-    size_(size)
-{
-    operator=(val);
-}
-
-
-template<unsigned nBits>
-Foam::PackedList<nBits>::PackedList(const UList<label>& lst)
-:
-    StorageList(packedLength(lst.size()), 0u),
-    size_(lst.size())
-{
-    forAll(lst, i)
-    {
-        set(i, lst[i]);
-    }
-}
+#include "IOstreams.H"
 
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
-
 #if (UINT_MAX == 0xFFFFFFFF)
 // 32-bit counting, Hamming weight method
 #   define COUNT_PACKEDBITS(sum, x)                                           \
@@ -82,25 +58,10 @@ unsigned int Foam::PackedList<nBits>::count() const
 
     if (size_)
     {
-        // mask value for complete segments
-        unsigned int mask = maskLower(packing());
-
-        const unsigned int endSeg = size_ / packing();
-        const unsigned int endOff = size_ % packing();
-
-        // count bits in complete segments
-        for (unsigned i = 0; i < endSeg; ++i)
-        {
-            register unsigned int bits = StorageList::operator[](i) & mask;
-            COUNT_PACKEDBITS(c, bits);
-        }
-
-        // count bits in partial segment
-        if (endOff)
+        const label packLen = packedLength();
+        for (label i = 0; i < packLen; ++i)
         {
-            mask = maskLower(endOff);
-
-            register unsigned int bits = StorageList::operator[](endSeg) & mask;
+            register unsigned int bits = StorageList::operator[](i);
             COUNT_PACKEDBITS(c, bits);
         }
     }
@@ -117,64 +78,60 @@ bool Foam::PackedList<nBits>::trim()
         return false;
     }
 
-    // mask value for complete segments
-    unsigned int mask = maskLower(packing());
-
-    label currElem = packedLength(size_) - 1;
-    unsigned int endOff = size_ % packing();
-
-    // clear trailing bits on final segment
-    if (endOff)
-    {
-        StorageList::operator[](currElem) &= maskLower(endOff);
-    }
-
-    // test entire segment
-    while (currElem > 0 && !(StorageList::operator[](currElem) &= mask))
+    const label oldSize = size_;
+    for (label storeI = packedLength()-1; storeI >= 0; --storeI)
     {
-        currElem--;
-    }
-
-    // test segment
-    label newsize = (currElem + 1) * packing();
-
-    // mask for the final segment
-    mask = max_value() << (nBits * (packing() - 1));
+        size_ = storeI * packing();
+        unsigned int bits = StorageList::operator[](storeI);
 
-    for (endOff = packing(); endOff >= 1; --endOff, --newsize)
-    {
-        if (StorageList::operator[](currElem) & mask)
+        // found some bits
+        if (bits)
         {
+            while (bits)
+            {
+                bits >>= nBits;
+                ++size_;
+            }
             break;
         }
-
-        mask >>= nBits;
     }
 
-    if (size_ == newsize)
-    {
-        return false;
-    }
-
-    size_ = newsize;
-    return false;
+    return (size_ != oldSize);
 }
 
 
 template<unsigned nBits>
 void Foam::PackedList<nBits>::flip()
 {
-    label packLen = packedLength(size_);
+    if (!size_)
+    {
+        return;
+    }
+
+    // mask value for complete segments
+    const unsigned int mask = maskLower(packing());
 
-    for (label i=0; i < packLen; i++)
+    const label packLen = packedLength();
+    for (label i=0; i < packLen; ++i)
     {
-        StorageList::operator[](i) = ~StorageList::operator[](i);
+        StorageList::operator[](i) = mask & ~StorageList::operator[](i);
+    }
+
+    // mask off the final partial segment
+    {
+        const unsigned int off = size_ % packing();
+        if (off)
+        {
+            const unsigned int seg = size_ / packing();
+
+            StorageList::operator[](seg) &= maskLower(off);
+        }
     }
 }
 
 
 template<unsigned nBits>
-Foam::labelList Foam::PackedList<nBits>::values() const
+Foam::Xfer<Foam::labelList> Foam::PackedList<nBits>::values() const
 {
     labelList elems(size_);
 
@@ -182,12 +139,16 @@ Foam::labelList Foam::PackedList<nBits>::values() const
     {
         elems[i] = get(i);
     }
-    return elems;
+
+    return elems.xfer();
 }
 
 
 template<unsigned nBits>
-Foam::Ostream& Foam::PackedList<nBits>::iteratorBase::print(Ostream& os) const
+Foam::Ostream& Foam::PackedList<nBits>::iteratorBase::printInfo
+(
+    Ostream& os
+) const
 {
     os  << "iterator<"  << label(nBits) << "> ["
         << this->index_ << "]"
@@ -201,78 +162,396 @@ Foam::Ostream& Foam::PackedList<nBits>::iteratorBase::print(Ostream& os) const
 
 
 template<unsigned nBits>
-Foam::Ostream& Foam::PackedList<nBits>::print(Ostream& os) const
+Foam::Ostream& Foam::PackedList<nBits>::printBits
+(
+    Ostream& os,
+    const bool fullOutput
+) const
 {
-    const label packLen = packedLength(size_);
-
-    os  << "PackedList<" << nBits << ">"
-        << " max_value:" << max_value()
-        << " packing:"   << packing() << nl
-        << " count: "     << count() << nl
-        << " size/capacity: " << size_ << "/" << capacity() << nl
-        << " storage/capacity: " << packLen << "/" << StorageList::size()
-        << "\n(\n";
+    const label packLen = packedLength();
 
     // mask value for complete segments
     unsigned int mask = maskLower(packing());
+    const label outputLen = fullOutput ? StorageList::size() : packLen;
 
-    for (label i=0; i < packLen; i++)
+    os  << "(\n";
+    for (label i=0; i < outputLen; ++i)
     {
         const StorageType& rawBits = StorageList::operator[](i);
 
         // the final segment may not be full, modify mask accordingly
-        if (i+1 == packLen)
+        if (i == packLen-1)
         {
-            unsigned int endOff = size_ % packing();
+            const unsigned int off = size_ % packing();
 
-            if (endOff)
-            {
-                mask = maskLower(endOff);
-            }
-            else
+            if (off)
             {
-                continue;
+                mask = maskLower(off);
             }
         }
+        else if (i == packLen)
+        {
+            // no mask for unaddressed bit
+            mask = 0u;
+        }
+
 
         for (unsigned int testBit = (1u << max_bits()); testBit; testBit >>= 1)
         {
             if (mask & testBit)
             {
+                // addressable region
                 if (rawBits & testBit)
                 {
-                    os << '1';
+                    os  << '1';
                 }
                 else
                 {
-                    os << '-';
+                    os  << '-';
                 }
             }
             else
             {
-                os << 'x';
+                if (rawBits & testBit)
+                {
+                    os  << '!';
+                }
+                else
+                {
+                    os  << '.';
+                }
+            }
+        }
+        os  << '\n';
+    }
+    os  << ")\n";
+
+    return os;
+}
+
+
+template<unsigned nBits>
+Foam::Ostream& Foam::PackedList<nBits>::printInfo
+(
+    Ostream& os,
+    const bool fullOutput
+) const
+{
+    os  << "PackedList<" << nBits << ">"
+        << " max_value:" << max_value()
+        << " packing:"   << packing() << nl
+        << " count: "     << count() << nl
+        << " size/capacity: " << size_ << "/" << capacity() << nl
+        << " storage/capacity: "
+        << packedLength() << "/" << StorageList::size()
+        << "\n";
+
+    return printBits(os, fullOutput);
+}
+
+
+template<unsigned nBits>
+Foam::Istream& Foam::PackedList<nBits>::read(Istream& is)
+{
+    PackedList<nBits>& lst = *this;
+
+    lst.clear();
+    is.fatalCheck("PackedList<nBits>::read(Istream&)");
+
+    token firstTok(is);
+    is.fatalCheck
+    (
+        "PackedList<nBits>::read(Istream&) : "
+        "reading first token"
+    );
+
+    if (firstTok.isLabel())
+    {
+        const label sz = firstTok.labelToken();
+
+        // Set list length to that read
+        lst.resize(sz);
+
+        // Read list contents depending on data format
+        if (is.format() == IOstream::ASCII)
+        {
+            // Read beginning of contents
+            const char delimiter = is.readBeginList("PackedList<nBits>");
+
+            if (sz)
+            {
+                if (delimiter == token::BEGIN_LIST)
+                {
+                    for (register label i=0; i<sz; ++i)
+                    {
+                        lst[i] = lst.readValue(is);
+
+                        is.fatalCheck
+                        (
+                            "PackedList<nBits>::read(Istream&) : "
+                            "reading entry"
+                        );
+                    }
+                }
+                else if (delimiter == token::BEGIN_BLOCK)
+                {
+                    // assign for all entries
+                    lst = lst.readValue(is);
+
+                    is.fatalCheck
+                    (
+                        "PackedList<nBits>::read(Istream&) : "
+                        "reading the single entry"
+                    );
+                }
+                else
+                {
+                    FatalIOErrorIn
+                    (
+                        "PackedList<nBits>::read(Istream&)",
+                        is
+                    )
+                        << "incorrect list token, expected '(' or '{', found "
+                        << firstTok.info()
+                        << exit(FatalIOError);
+                }
+            }
+
+            // Read end of contents
+            is.readEndList("PackedList<nBits>");
+        }
+        else
+        {
+            if (sz)
+            {
+                is.read
+                (
+                    reinterpret_cast<char*>(lst.storage().data()),
+                    lst.byteSize()
+                );
+
+                is.fatalCheck
+                (
+                    "PackedList<nBits>::read(Istream&) : "
+                    "reading the binary block"
+                );
+            }
+        }
+    }
+    else if (firstTok.isPunctuation())
+    {
+        if (firstTok.pToken() == token::BEGIN_LIST)
+        {
+            token nextTok(is);
+            is.fatalCheck("PackedList<nBits>::read(Istream&)");
+
+            while
+            (
+                !(   nextTok.isPunctuation()
+                  && nextTok.pToken() == token::END_LIST
+                 )
+            )
+            {
+                is.putBack(nextTok);
+                lst.append(lst.readValue(is));
+
+                is  >> nextTok;
+                is.fatalCheck("PackedList<nBits>::read(Istream&)");
+            }
+        }
+        else if (firstTok.pToken() == token::BEGIN_BLOCK)
+        {
+            token nextTok(is);
+            is.fatalCheck("PackedList<nBits>::read(Istream&)");
+
+            while
+            (
+                !(   nextTok.isPunctuation()
+                  && nextTok.pToken() == token::END_BLOCK
+                 )
+            )
+            {
+                is.putBack(nextTok);
+                lst.setPair(is);
+
+                is  >> nextTok;
+                is.fatalCheck("PackedList<nBits>::read(Istream&)");
             }
         }
-        os << '\n';
+        else
+        {
+            FatalIOErrorIn
+            (
+                "PackedList<nBits>::read(Istream&)",
+                is
+            )
+                << "incorrect first token, expected '(', found "
+                << firstTok.info()
+                << exit(FatalIOError);
+        }
+    }
+    else
+    {
+        FatalIOErrorIn
+        (
+            "PackedList<nBits>::read(Istream&)",
+            is
+        )
+            << "incorrect first token, expected <int>, '(' or '{', found "
+            << firstTok.info()
+            << exit(FatalIOError);
+    }
+
+    return is;
+}
+
+
+template<unsigned nBits>
+Foam::Ostream& Foam::PackedList<nBits>::write
+(
+    Ostream& os,
+    const bool indexedOutput
+) const
+{
+    const PackedList<nBits>& lst = *this;
+    const label sz = lst.size();
+
+    // Write list contents depending on data format
+    if (os.format() == IOstream::ASCII)
+    {
+        bool uniform = false;
+
+        if (sz > 1 && !indexedOutput)
+        {
+            uniform = true;
+
+            forAll(lst, i)
+            {
+                if (lst[i] != lst[0])
+                {
+                    uniform = false;
+                    break;
+                }
+            }
+        }
+
+        if (uniform)
+        {
+            // uniform values:
+            os  << sz << token::BEGIN_BLOCK << lst[0] << token::END_BLOCK;
+        }
+        else if (indexedOutput)
+        {
+            // indexed output
+            os  << nl << token::BEGIN_BLOCK << nl;
+
+            for
+            (
+                typename PackedList<nBits>::const_iterator iter = lst.cbegin();
+                iter != lst.cend();
+                ++iter
+            )
+            {
+                if (iter.writeIfSet(os))
+                {
+                    os  << nl;
+                }
+            }
+
+            os  << token::END_BLOCK << nl;
+        }
+        else if (sz < 11)
+        {
+            // short list:
+            os  << sz << token::BEGIN_LIST;
+            forAll(lst, i)
+            {
+                if (i)
+                {
+                    os  << token::SPACE;
+                }
+                os  << lst[i];
+            }
+            os  << token::END_LIST;
+        }
+        else
+        {
+            // longer list:
+            os  << nl << sz << nl << token::BEGIN_LIST;
+            forAll(lst, i)
+            {
+                os  << nl << lst[i];
+            }
+            os  << nl << token::END_LIST << nl;
+        }
+    }
+    else
+    {
+        os  << nl << sz << nl;
+        if (sz)
+        {
+            os.write
+            (
+                reinterpret_cast<const char*>(lst.storage().cdata()),
+                lst.byteSize()
+            );
+        }
     }
-    os << ")\n";
 
     return os;
 }
 
 
+template<unsigned nBits>
+void Foam::PackedList<nBits>::writeEntry(Ostream& os) const
+{
+    os  << *this;
+}
+
+
+template<unsigned nBits>
+void Foam::PackedList<nBits>::writeEntry
+(
+    const word& keyword,
+    Ostream& os
+) const
+{
+    os.writeKeyword(keyword);
+    writeEntry(os);
+    os  << token::END_STATEMENT << endl;
+}
+
+
 // * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
 
 template<unsigned nBits>
-void Foam::PackedList<nBits>::operator=(const PackedList<nBits>& lst)
+Foam::PackedList<nBits>&
+Foam::PackedList<nBits>::operator=(const PackedList<nBits>& lst)
 {
     StorageList::operator=(lst);
     size_ = lst.size();
+    return *this;
+}
+
+
+template<unsigned nBits>
+Foam::PackedList<nBits>&
+Foam::PackedList<nBits>::operator=(const UList<label>& lst)
+{
+    setCapacity(lst.size());
+    size_ = lst.size();
+
+    forAll(lst, i)
+    {
+        set(i, lst[i]);
+    }
+    return *this;
 }
 
 
 template<unsigned nBits>
-void Foam::PackedList<nBits>::operator=(const UList<label>& lst)
+Foam::PackedList<nBits>&
+Foam::PackedList<nBits>::operator=(const UIndirectList<label>& lst)
 {
     setCapacity(lst.size());
     size_ = lst.size();
@@ -281,19 +560,24 @@ void Foam::PackedList<nBits>::operator=(const UList<label>& lst)
     {
         set(i, lst[i]);
     }
+    return *this;
 }
 
 
-// * * * * * * * * * * * * * * * Ostream Operator *  * * * * * * * * * * * * //
+// * * * * * * * * * * * * * *  Friend Operators * * * * * * * * * * * * * * //
+
+template<unsigned nBits>
+Foam::Istream& Foam::operator>>(Istream& is, PackedList<nBits>& lst)
+{
+    return lst.read(is);
+}
 
-//template<unsigned nBits>
-//Foam::Ostream& ::Foam::operator<<(Ostream& os, const PackedList<nBits>& lst)
-//{
-//    os << lst();
-//    return os;
-//}
 
+template<unsigned nBits>
+Foam::Ostream& Foam::operator<<(Ostream& os, const PackedList<nBits>& lst)
+{
+    return lst.write(os, false);
+}
 
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 // ************************************************************************* //
diff --git a/src/OpenFOAM/containers/Lists/PackedList/PackedList.H b/src/OpenFOAM/containers/Lists/PackedList/PackedList.H
index 76c0e97b80924e905048006b10702faf7c2cd05d..9d970ec05504d29f718b7a2462a5a61d4683bc43 100644
--- a/src/OpenFOAM/containers/Lists/PackedList/PackedList.H
+++ b/src/OpenFOAM/containers/Lists/PackedList/PackedList.H
@@ -72,6 +72,23 @@ Note
         list[8] = 1;
     @endcode
 
+    Also note that all unused internal storage elements are guaranteed to
+    always be bit-wise zero. This property must not be violated by any
+    inheriting classes.
+
+    In addition to the normal output format, PackedList also supports a
+    compact ASCII format that may be convenient for user input in some
+    situations. The general format is a group of index/value pairs:
+    @verbatim
+        { (index1 value1) (index2 value2) (index3 value3) }
+    @endverbatim
+    The bool specialization just uses the indices corresponding to
+    non-zero entries instead of a index/value pair:
+    @verbatim
+        { index1 index2 index3 }
+    @endverbatim
+    In both cases, the supplied indices can be randomly ordered.
+
 SeeAlso
     Foam::DynamicList
 
@@ -85,6 +102,7 @@ SourceFiles
 #define PackedList_H
 
 #include "labelList.H"
+#include "UIndirectList.H"
 #include "StaticAssert.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -92,18 +110,34 @@ SourceFiles
 namespace Foam
 {
 
+// Forward declaration of classes
+class Istream;
+class Ostream;
+
 // Forward declaration of friend functions and operators
 template<unsigned nBits> class PackedList;
 
-// template<unsigned nBits>
-// Ostream& operator<<(Ostream&, const PackedList<nBits>&);
+template<unsigned nBits>
+Istream& operator>>(Istream&, PackedList<nBits>&);
+template<unsigned nBits>
+Ostream& operator<<(Ostream&, const PackedList<nBits>&);
 
 
 /*---------------------------------------------------------------------------*\
-                      Class PackedListName Declaration
+                       Class PackedListCore Declaration
 \*---------------------------------------------------------------------------*/
 
-TemplateName(PackedList);
+//- Template-invariant bits for PackedList
+struct PackedListCore
+{
+    //- Construct null
+    PackedListCore()
+    {}
+
+    //- Define template name and debug
+    ClassName("PackedList");
+};
+
 
 /*---------------------------------------------------------------------------*\
                          Class PackedList Declaration
@@ -112,25 +146,41 @@ TemplateName(PackedList);
 template<unsigned nBits=1>
 class PackedList
 :
+    public PackedListCore,
     private List<unsigned int>
 {
+protected:
+
     typedef unsigned int      StorageType;
     typedef List<StorageType> StorageList;
 
-    //- nBits must be positive (non-zero) and fit within the storage
-    //  For simplicity, assume 8-bit bytes
-    StaticAssert(nBits && nBits < (sizeof(StorageType) << 3));
+    // Protected Member Functions
+
+        //- Calculate the list length when packed
+        inline static label packedLength(const label);
+
+        //- Read a list entry (allows for specialization)
+        inline static unsigned int readValue(Istream&);
+
+        //- Read an index/value pair and set accordingly.
+        //  For bool specialization, read a single index value
+        inline void setPair(Istream&);
+
+
+private:
+
+    //- nBits must be positive (non-zero) and fit within the storage.
+    //  For efficiency, however, require packing at least 2 items otherwise
+    //  it is more efficient to use a normal list.
+    //  Thus max nBits is 1/2 of the base storage size.
+    //  For simplicity, assume 8-bit bytes in the assert.
+    StaticAssert(nBits && nBits <= (sizeof(StorageType) << 2));
 
     // Private data
 
         //- Number of nBits entries
         label size_;
 
-    // Private Member Functions
-
-        //- Calculate the list length when packed
-        inline static label packedLength(const label);
-
 
 public:
 
@@ -163,20 +213,26 @@ public:
         //- Null constructor
         inline PackedList();
 
-        //- Construct with given size, initializes list to 0.
+        //- Construct with given size, initializes list to 0
         explicit inline PackedList(const label size);
 
-        //- Construct with given size and value for all elements.
-        PackedList(const label size, const unsigned val);
+        //- Construct with given size and value for all elements
+        inline PackedList(const label size, const unsigned val);
 
-        //- Copy constructor.
+        //- Construct from Istream
+        inline PackedList(Istream&);
+
+        //- Copy constructor
         inline PackedList(const PackedList<nBits>&);
 
         //- Construct by transferring the parameter contents
         inline PackedList(const Xfer<PackedList<nBits> >&);
 
         //- Construct from a list of labels
-        explicit PackedList(const UList<label>&);
+        explicit inline PackedList(const UList<label>&);
+
+        //- Construct from an indirect list of labels
+        explicit inline PackedList(const UIndirectList<label>&);
 
         //- Clone
         inline autoPtr< PackedList<nBits> > clone() const;
@@ -209,30 +265,52 @@ public:
             inline bool unset(const label);
 
             //- Return the underlying packed storage
+            //  Manipulate with utmost caution
             inline List<unsigned int>& storage();
 
             //- Return the underlying packed storage
             inline const List<unsigned int>& storage() const;
 
+            //- The list length when packed
+            inline label packedLength() const;
+
+            //- Return the binary size in number of characters
+            //  used in the underlying storage
+            inline label byteSize() const;
+
             //- Count number of bits set, O(log(n))
             //  Uses the Hamming weight (population count) method
             //  http://en.wikipedia.org/wiki/Hamming_weight
             unsigned int count() const;
 
-            //- Return the values as a labelList
-            labelList values() const;
+            //- Return the values as a list of labels
+            Xfer<labelList> values() const;
+
+            //- Print bit patterns, optionally output unused elements
+            //
+            // addressable bits:
+            //   on: '1', off: '-'
+            //
+            // non-addressable bits:
+            //   on: '!', off: '.'
+            //
+            Ostream& printBits(Ostream&, const bool fullOutput=false) const;
+
+            //- Print information and bit patterns (with printBits)
+            Ostream& printInfo(Ostream&, const bool fullOutput=false) const;
 
-            //- Print values and information
-            Ostream& print(Ostream&) const;
 
         // Edit
 
             //- Trim any trailing zero elements
             bool trim();
 
-            //- Invert the bits in the addressable region.
+            //- Invert the bits in the addressable region
             void flip();
 
+            //- Clear all bits
+            inline void reset();
+
             //- Alter the size of the underlying storage.
             //  The addressed size will be truncated if needed to fit, but will
             //  remain otherwise untouched.
@@ -240,10 +318,10 @@ public:
 
             //- Reset addressable list size, does not shrink the allocated size.
             //  Optionally specify a value for new elements.
-            inline void resize(const label, const unsigned int& val = 0);
+            inline void resize(const label, const unsigned int& val = 0u);
 
             //- Alias for resize()
-            inline void setSize(const label, const unsigned int& val = 0);
+            inline void setSize(const label, const unsigned int& val = 0u);
 
             //- Reserve allocation space for at least this size.
             //  Never shrinks the allocated size.
@@ -269,10 +347,43 @@ public:
             inline Xfer<PackedList<nBits> > xfer();
 
 
+        // IO
+
+            //- Clear list and read from stream
+            Istream& read(Istream&);
+
+            //- Write, optionally with indexedOutput
+            //
+            // The indexed output may be convenient in some situations.
+            // The general format is a group of index/value pairs:
+            //  @verbatim
+            //      { (index1 value1) (index2 value2) (index3 value3) }
+            // @endverbatim
+            // The bool specialization just uses the indices corresponding to
+            // non-zero entries instead of a index/value pair:
+            // @verbatim
+            //     { index1 index2 index3 }
+            // @endverbatim
+            //
+            // Note the indexed output is only supported for ASCII streams.
+            Ostream& write
+            (
+                Ostream&,
+                const bool indexedOutput=false
+            ) const;
+
+
+            //- Write as a dictionary entry
+            void writeEntry(Ostream&) const;
+
+            //- Write as a dictionary entry with keyword
+            void writeEntry(const word& keyword, Ostream&) const;
+
+
     // Member operators
 
             //- Append a value at the end of the list
-            inline void append(const unsigned int val);
+            inline PackedList<nBits>& append(const unsigned int val);
 
             //- Remove and return the last element
             inline unsigned int remove();
@@ -287,23 +398,16 @@ public:
             inline iteratorBase operator[](const label);
 
             //- Assignment of all entries to the given value. Takes linear time.
-            inline void operator=(const unsigned int val);
-
-            //- Assignment operator. Takes linear time.
-            void operator=(const PackedList<nBits>&);
+            inline PackedList<nBits>& operator=(const unsigned int val);
 
-            //- Assignment operator. Takes linear time.
-            void operator=(const UList<label>&);
+            //- Assignment operator.
+            PackedList<nBits>& operator=(const PackedList<nBits>&);
 
+            //- Assignment operator.
+            PackedList<nBits>& operator=(const UList<label>&);
 
-        // Ostream operator
-
-         // // Write PackedList to Ostream.
-         // friend Ostream& operator<< <nBits>
-         // (
-         //     Ostream&,
-         //     const PackedList<nBits>&
-         // );
+            //- Assignment operator.
+            PackedList<nBits>& operator=(const UIndirectList<label>&);
 
 
     // Iterators and helpers
@@ -347,6 +451,15 @@ public:
 
         public:
 
+            // Member Functions
+
+                //- Return the element index corresponding to the iterator
+                inline label key() const;
+
+                //- Write index/value for a non-zero entry
+                //  The bool specialization writes the index only
+                inline bool writeIfSet(Ostream&) const;
+
             // Member Operators
 
                 //- Compare values (not positions)
@@ -365,8 +478,8 @@ public:
                 //  Never auto-vivify entries.
                 inline operator unsigned int () const;
 
-            //- Print value and information
-            Ostream& print(Ostream&) const;
+            //- Print information and values
+            Ostream& printInfo(Ostream&) const;
         };
 
 
@@ -376,11 +489,12 @@ public:
             public iteratorBase
         {
 
-            //- Disallow copy constructor from const_iterator -
-            //  violates const-ness!
+            //- Disallow copy constructor from const_iterator
+            //  This would violate const-ness!
             iterator(const const_iterator&);
 
-            //- Disallow assignment from const_iterator - violates const-ness!
+            //- Disallow assignment from const_iterator
+            //  This would violate const-ness!
             void operator=(const const_iterator&);
 
 
@@ -497,6 +611,20 @@ public:
         //- const_iterator set to beyond the end of the PackedList
         inline const_iterator end() const;
 
+
+    // IOstream Operators
+
+        friend Istream& operator>> <nBits>
+        (
+            Istream&,
+            PackedList<nBits>&
+        );
+
+        friend Ostream& operator<< <nBits>
+        (
+            Ostream&,
+            const PackedList<nBits>&
+        );
 };
 
 
diff --git a/src/OpenFOAM/containers/Lists/PackedList/PackedListName.C b/src/OpenFOAM/containers/Lists/PackedList/PackedListCore.C
similarity index 91%
rename from src/OpenFOAM/containers/Lists/PackedList/PackedListName.C
rename to src/OpenFOAM/containers/Lists/PackedList/PackedListCore.C
index 11b38eef54a51b514160500683710eee77952cc6..252a0f4008fc6118662eae8f60557d966ab247d2 100644
--- a/src/OpenFOAM/containers/Lists/PackedList/PackedListName.C
+++ b/src/OpenFOAM/containers/Lists/PackedList/PackedListCore.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -27,6 +27,7 @@ License
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
-defineTypeNameAndDebug(Foam::PackedListName, 0);
+defineTypeNameAndDebug(Foam::PackedListCore, 0);
+
 
 // ************************************************************************* //
diff --git a/src/OpenFOAM/containers/Lists/PackedList/PackedListI.H b/src/OpenFOAM/containers/Lists/PackedList/PackedListI.H
index c3059a142fc6c773e77ffe752f0453362040c586..4b2a00d2511661126d0174463222d40e513c6b6a 100644
--- a/src/OpenFOAM/containers/Lists/PackedList/PackedListI.H
+++ b/src/OpenFOAM/containers/Lists/PackedList/PackedListI.H
@@ -21,7 +21,6 @@ License
     You should have received a copy of the GNU General Public License
     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 
-
 \*---------------------------------------------------------------------------*/
 
 #include "error.H"
@@ -67,11 +66,117 @@ inline Foam::label Foam::PackedList<nBits>::packedLength(const label nElem)
 }
 
 
+namespace Foam
+{
+    // Template specialization for bool entries
+    template<>
+    inline unsigned int Foam::PackedList<1>::readValue(Istream& is)
+    {
+        return readBool(is);
+    }
+
+    // Template specialization for bool entries
+    template<>
+    inline void Foam::PackedList<1>::setPair(Istream& is)
+    {
+        set(readLabel(is), true);
+    }
+
+    // Template specialization for bool entries
+    template<>
+    inline bool Foam::PackedList<1>::iteratorBase::writeIfSet(Ostream& os) const
+    {
+        if (this->get())
+        {
+            os  << index_;
+
+            return true;
+        }
+        else
+        {
+            return false;
+        }
+    }
+}
+
+
+template<unsigned nBits>
+inline unsigned int Foam::PackedList<nBits>::readValue(Istream& is)
+{
+    const unsigned int val = readLabel(is);
+
+    if (val > max_value())
+    {
+        FatalIOErrorIn
+        (
+            "PackedList<nBits>::readValue(Istream&)",
+            is
+        )
+            << "Out-of-range value " << val << " for PackedList<" << nBits
+            << ">. Maximum permitted value is " << max_value() << "."
+            << exit(FatalIOError);
+    }
+
+    return val;
+}
+
+
+template<unsigned nBits>
+inline void Foam::PackedList<nBits>::setPair(Istream& is)
+{
+    is.readBegin("Tuple2<label, unsigned int>");
+
+    const label ind = readLabel(is);
+    const unsigned int val = readLabel(is);
+
+    is.readEnd("Tuple2<label, unsigned int>");
+
+    if (val > max_value())
+    {
+        FatalIOErrorIn
+        (
+            "PackedList<nBits>::setPair(Istream&)",
+            is
+        )
+            << "Out-of-range value " << val << " for PackedList<" << nBits
+            << "> at index " << ind
+            << ". Maximum permitted value is " << max_value() << "."
+            << exit(FatalIOError);
+    }
+
+    set(ind, val);
+
+    // Check state of Istream
+    is.check("PackedList<nBits>::setPair(Istream&)");
+}
+
+
+template<unsigned nBits>
+inline bool Foam::PackedList<nBits>::iteratorBase::writeIfSet(Ostream& os) const
+{
+    const label val = this->get();
+
+    if (val)
+    {
+        os  << token::BEGIN_LIST
+            << index_ << token::SPACE << val
+            << token::END_LIST;
+
+        return true;
+    }
+    else
+    {
+        return false;
+    }
+}
+
+
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
 template<unsigned nBits>
 inline Foam::PackedList<nBits>::PackedList()
 :
+    PackedListCore(),
     StorageList(),
     size_(0)
 {}
@@ -80,14 +185,45 @@ inline Foam::PackedList<nBits>::PackedList()
 template<unsigned nBits>
 inline Foam::PackedList<nBits>::PackedList(const label size)
 :
+    PackedListCore(),
     StorageList(packedLength(size), 0u),
     size_(size)
 {}
 
 
+template<unsigned nBits>
+inline Foam::PackedList<nBits>::PackedList
+(
+    const label size,
+    const unsigned int val
+)
+:
+    PackedListCore(),
+    StorageList(packedLength(size), 0u),
+    size_(size)
+{
+    if (val)
+    {
+        operator=(val);
+    }
+}
+
+
+template<unsigned nBits>
+inline Foam::PackedList<nBits>::PackedList(Istream& is)
+:
+    PackedListCore(),
+    StorageList(),
+    size_(0)
+{
+    read(is);
+}
+
+
 template<unsigned nBits>
 inline Foam::PackedList<nBits>::PackedList(const PackedList<nBits>& lst)
 :
+    PackedListCore(),
     StorageList(lst),
     size_(lst.size_)
 {}
@@ -100,6 +236,34 @@ inline Foam::PackedList<nBits>::PackedList(const Xfer<PackedList<nBits> >& lst)
 }
 
 
+template<unsigned nBits>
+inline Foam::PackedList<nBits>::PackedList(const UList<label>& lst)
+:
+    PackedListCore(),
+    StorageList(packedLength(lst.size()), 0u),
+    size_(lst.size())
+{
+    forAll(lst, i)
+    {
+        set(i, lst[i]);
+    }
+}
+
+
+template<unsigned nBits>
+inline Foam::PackedList<nBits>::PackedList(const UIndirectList<label>& lst)
+:
+    PackedListCore(),
+    StorageList(packedLength(lst.size()), 0u),
+    size_(lst.size())
+{
+    forAll(lst, i)
+    {
+        set(i, lst[i]);
+    }
+}
+
+
 template<unsigned nBits>
 inline Foam::autoPtr<Foam::PackedList<nBits> >
 Foam::PackedList<nBits>::clone() const
@@ -151,27 +315,34 @@ Foam::PackedList<nBits>::iteratorBase::set(const unsigned int val)
     const unsigned int seg = index_ / packing();
     const unsigned int off = index_ % packing();
 
+    const unsigned int startBit = nBits * off;
+    const unsigned int mask = max_value() << startBit;
+
     unsigned int& stored = list_->StorageList::operator[](seg);
     const unsigned int prev = stored;
 
-    const unsigned int startBit = nBits * off;
-    const unsigned int maskNew  = max_value() << startBit;
-
-    if (val & ~max_value())
+    if (val >= max_value())
     {
         // overflow is max_value, fill everything
-        stored |= maskNew;
+        stored |= mask;
     }
     else
     {
-        stored &= ~maskNew;
-        stored |= maskNew & (val << startBit);
+        stored &= ~mask;
+        stored |= mask & (val << startBit);
     }
 
     return prev != stored;
 }
 
 
+template<unsigned nBits>
+inline Foam::label Foam::PackedList<nBits>::iteratorBase::key() const
+{
+    return index_;
+}
+
+
 template<unsigned nBits>
 inline bool Foam::PackedList<nBits>::iteratorBase::operator==
 (
@@ -564,24 +735,27 @@ inline bool Foam::PackedList<nBits>::empty() const
 template<unsigned nBits>
 inline void Foam::PackedList<nBits>::resize
 (
-    const label nElem,
+    const label newSize,
     const unsigned int& val
 )
 {
-    reserve(nElem);
+    reserve(newSize);
+
+    const label oldSize = size_;
+    size_ = newSize;
 
-    if (nElem > size_)
+    if (size_ > oldSize)
     {
         // fill new elements or newly exposed elements
-        if (size_)
+        if (val)
         {
             // fill value for complete segments
             unsigned int fill = val;
 
-            if (fill & ~max_value())
+            if (val >= max_value())
             {
-                // overflow is max_value, fill everything
-                fill = ~0u;
+                // fill everything
+                fill = maskLower(packing());
             }
             else
             {
@@ -591,36 +765,64 @@ inline void Foam::PackedList<nBits>::resize
                 }
             }
 
-            unsigned int seg = size_ / packing();
-            unsigned int off = size_ % packing();
-
-            // partial segment, preserve existing value
-            if (off)
+            // fill in complete segments
+            const label oldLen = packedLength(oldSize);
+            const label newLen = packedLength(size_);
+            for (label i=oldLen; i < newLen; ++i)
             {
-                unsigned int maskOld = maskLower(off);
+                StorageList::operator[](i) = fill;
+            }
 
-                StorageList::operator[](seg) &= maskOld;
-                StorageList::operator[](seg) |= ~maskOld & fill;
+            // finish previous partial segment, preserve existing value
+            {
+                const unsigned int off = oldSize % packing();
+                if (off)
+                {
+                    const unsigned int seg = oldSize / packing();
+                    const unsigned int mask = maskLower(off);
 
-                // continue with the next segment
-                seg++;
+                    StorageList::operator[](seg) &= mask;
+                    StorageList::operator[](seg) |= ~mask & fill;
+                }
             }
 
-            unsigned int endSeg = nElem / packing();
-            // fill in complete elements
-            while (seg < endSeg)
+
+            // mask off the (new) final partial segment
             {
-                StorageList::operator[](seg++) = fill;
+                const unsigned int off = size_ % packing();
+                if (off)
+                {
+                    const unsigned int seg = size_ / packing();
+
+                    StorageList::operator[](seg) &= maskLower(off);
+                }
             }
         }
-        else
+    }
+    else if (size_ < oldSize)
+    {
+        // resize shrinking
+        // - clear newly exposed elements
+
+        // fill in complete segments
+        const label oldLen = packedLength(oldSize);
+        const label newLen = packedLength(size_);
+        for (label i=newLen; i < oldLen; ++i)
         {
-            // no original size - simply flood-fill
-            operator=(val);
+            StorageList::operator[](i) = 0u;
         }
-    }
 
-    size_ = nElem;
+        // mask off the final partial segment
+        {
+            const unsigned int off = size_ % packing();
+            if (off)
+            {
+                const unsigned int seg = size_ / packing();
+
+                StorageList::operator[](seg) &= maskLower(off);
+            }
+        }
+    }
 }
 
 
@@ -648,21 +850,27 @@ inline void Foam::PackedList<nBits>::setCapacity(const label nElem)
 {
     StorageList::setSize(packedLength(nElem), 0u);
 
-    // truncate addressed size too?
+    // truncate addressed size too
     if (size_ > nElem)
     {
         size_ = nElem;
+
+        // mask off the final partial segment
+        const unsigned int off = size_ % packing();
+        if (off)
+        {
+            const unsigned int seg = size_ / packing();
+
+            StorageList::operator[](seg) &= maskLower(off);
+        }
     }
 }
 
 
 template<unsigned nBits>
-inline void Foam::PackedList<nBits>::reserve
-(
-    const label nElem
-)
+inline void Foam::PackedList<nBits>::reserve(const label nElem)
 {
-    label len = packedLength(nElem);
+    const label len = packedLength(nElem);
 
     // need more capacity?
     if (len > StorageList::size())
@@ -681,9 +889,17 @@ inline void Foam::PackedList<nBits>::reserve
 }
 
 
+template<unsigned nBits>
+inline void Foam::PackedList<nBits>::reset()
+{
+    StorageList::operator=(0u);
+}
+
+
 template<unsigned nBits>
 inline void Foam::PackedList<nBits>::clear()
 {
+    reset();
     size_ = 0;
 }
 
@@ -699,9 +915,8 @@ inline void Foam::PackedList<nBits>::clearStorage()
 template<unsigned nBits>
 inline void Foam::PackedList<nBits>::shrink()
 {
-    label len = packedLength(size_);
-
-    // we have unused space?
+    // any uneed space allocated?
+    const label len = packedLength();
     if (len < StorageList::size())
     {
         StorageList::setSize(len);
@@ -722,6 +937,20 @@ inline const Foam::List<unsigned int>& Foam::PackedList<nBits>::storage() const
 }
 
 
+template<unsigned nBits>
+inline Foam::label Foam::PackedList<nBits>::packedLength() const
+{
+    return packedLength(size_);
+}
+
+
+template<unsigned nBits>
+inline Foam::label Foam::PackedList<nBits>::byteSize() const
+{
+    return packedLength() * sizeof(StorageType);
+}
+
+
 template<unsigned nBits>
 inline void Foam::PackedList<nBits>::transfer(PackedList<nBits>& lst)
 {
@@ -742,23 +971,14 @@ inline Foam::Xfer<Foam::PackedList<nBits> > Foam::PackedList<nBits>::xfer()
 template<unsigned nBits>
 inline unsigned int Foam::PackedList<nBits>::get(const label i) const
 {
-#   ifdef FULLDEBUG
-    if (i < 0)
-    {
-        FatalErrorIn("PackedList<nBits>::get(const label)")
-            << "negative index " << i << " max=" << size_-1
-            << abort(FatalError);
-    }
-#   endif
-
     // lazy evaluation - return 0 for out-of-range
-    if (i < size_)
+    if (i < 0 || i >= size_)
     {
-        return iteratorBase(this, i).get();
+        return 0;
     }
     else
     {
-        return 0;
+        return iteratorBase(this, i).get();
     }
 }
 
@@ -767,13 +987,13 @@ template<unsigned nBits>
 inline unsigned int Foam::PackedList<nBits>::operator[](const label i) const
 {
     // lazy evaluation - return 0 for out-of-range
-    if (i < size_)
+    if (i < 0 || i >= size_)
     {
-        return iteratorBase(this, i).get();
+        return 0;
     }
     else
     {
-        return 0;
+        return iteratorBase(this, i).get();
     }
 }
 
@@ -785,18 +1005,14 @@ inline bool Foam::PackedList<nBits>::set
     const unsigned int val
 )
 {
-#   ifdef FULLDEBUG
     if (i < 0)
     {
-        FatalErrorIn("PackedList<nBits>::set(const label)")
-            << "negative index " << i << " max=" << size_-1
-            << abort(FatalError);
+        // lazy evaluation - ignore out-of-bounds
+        return false;
     }
-#   endif
-
-    // lazy evaluation - increase size on assigment
-    if (i >= size_)
+    else if (i >= size_)
     {
+        // lazy evaluation - increase size on assigment
         resize(i + 1);
     }
 
@@ -807,24 +1023,28 @@ inline bool Foam::PackedList<nBits>::set
 template<unsigned nBits>
 inline bool Foam::PackedList<nBits>::unset(const label i)
 {
-    // lazy - ignore out-of-bounds
+    // lazy evaluation - ignore out-of-bounds
     if (i < 0 || i >= size_)
     {
         return false;
     }
-
-    return iteratorBase(this, i).set(0u);
+    else
+    {
+        return iteratorBase(this, i).set(0u);
+    }
 }
 
 
 template<unsigned nBits>
-inline void Foam::PackedList<nBits>::append(const unsigned int val)
+inline Foam::PackedList<nBits>&
+Foam::PackedList<nBits>::append(const unsigned int val)
 {
-    label elemI = size_;
+    const label elemI = size_;
     reserve(elemI + 1);
     size_++;
 
     iteratorBase(this, elemI).set(val);
+    return *this;
 }
 
 
@@ -855,35 +1075,20 @@ Foam::PackedList<nBits>::operator[](const label i)
 }
 
 
-namespace Foam
-{
-    // specialization for nBits=1
-    template<>
-    inline void Foam::PackedList<1>::operator=(const unsigned int val)
-    {
-        if (val)
-        {
-            StorageList::operator=(~0u);
-        }
-        else
-        {
-            StorageList::operator=(0u);
-        }
-    }
-}
-
-
 template<unsigned nBits>
-inline void Foam::PackedList<nBits>::operator=(const unsigned int val)
+inline Foam::PackedList<nBits>&
+Foam::PackedList<nBits>::operator=(const unsigned int val)
 {
-    if (val)
+    const label packLen = packedLength();
+
+    if (val && size_)
     {
         unsigned int fill = val;
 
-        if (fill & ~max_value())
+        if (val >= max_value())
         {
-            // treat overflow as max_value
-            fill = ~0u;
+            // fill everything
+            fill = maskLower(packing());
         }
         else
         {
@@ -893,12 +1098,31 @@ inline void Foam::PackedList<nBits>::operator=(const unsigned int val)
             }
         }
 
-        StorageList::operator=(fill);
+        for (label i=0; i < packLen; ++i)
+        {
+            StorageList::operator[](i) = fill;
+        }
+
+        // mask off the final partial segment
+        {
+            const unsigned int off = size_ % packing();
+            if (off)
+            {
+                const unsigned int seg = size_ / packing();
+
+                StorageList::operator[](seg) &= maskLower(off);
+            }
+        }
     }
     else
     {
-        StorageList::operator=(0u);
+        for (label i=0; i < packLen; ++i)
+        {
+            StorageList::operator[](i) = 0u;
+        }
     }
+
+    return *this;
 }
 
 
diff --git a/src/OpenFOAM/db/IOobjects/IOFieldField/IOFieldField.C b/src/OpenFOAM/db/IOobjects/CompactIOField/CompactIOField.C
similarity index 87%
rename from src/OpenFOAM/db/IOobjects/IOFieldField/IOFieldField.C
rename to src/OpenFOAM/db/IOobjects/CompactIOField/CompactIOField.C
index db16414701634b3d004f3821cfe1acac050e5bb1..dcbc1b0f396810373c8cba186cfd7baaab467c7a 100644
--- a/src/OpenFOAM/db/IOobjects/IOFieldField/IOFieldField.C
+++ b/src/OpenFOAM/db/IOobjects/CompactIOField/CompactIOField.C
@@ -23,13 +23,13 @@ License
 
 \*---------------------------------------------------------------------------*/
 
-#include "IOFieldField.H"
+#include "CompactIOField.H"
 #include "labelList.H"
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
 
 template<class T, class BaseType>
-void Foam::IOFieldField<T, BaseType>::readFromStream()
+void Foam::CompactIOField<T, BaseType>::readFromStream()
 {
     Istream& is = readStream(word::null);
 
@@ -47,7 +47,7 @@ void Foam::IOFieldField<T, BaseType>::readFromStream()
     {
         FatalIOErrorIn
         (
-            "IOFieldField<T, BaseType>::readFromStream()",
+            "CompactIOField<T, BaseType>::readFromStream()",
             is
         )   << "unexpected class name " << headerClassName()
             << " expected " << typeName << " or " << IOField<T>::typeName
@@ -61,7 +61,7 @@ void Foam::IOFieldField<T, BaseType>::readFromStream()
 // * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * * //
 
 template<class T, class BaseType>
-Foam::IOFieldField<T, BaseType>::IOFieldField(const IOobject& io)
+Foam::CompactIOField<T, BaseType>::CompactIOField(const IOobject& io)
 :
     regIOobject(io)
 {
@@ -77,7 +77,7 @@ Foam::IOFieldField<T, BaseType>::IOFieldField(const IOobject& io)
 
 
 template<class T, class BaseType>
-Foam::IOFieldField<T, BaseType>::IOFieldField
+Foam::CompactIOField<T, BaseType>::CompactIOField
 (
     const IOobject& io,
     const label size
@@ -101,7 +101,7 @@ Foam::IOFieldField<T, BaseType>::IOFieldField
 
 
 template<class T, class BaseType>
-Foam::IOFieldField<T, BaseType>::IOFieldField
+Foam::CompactIOField<T, BaseType>::CompactIOField
 (
     const IOobject& io,
     const Field<T>& list
@@ -125,7 +125,7 @@ Foam::IOFieldField<T, BaseType>::IOFieldField
 
 
 template<class T, class BaseType>
-Foam::IOFieldField<T, BaseType>::IOFieldField
+Foam::CompactIOField<T, BaseType>::CompactIOField
 (
     const IOobject& io,
     const Xfer<Field<T> >& list
@@ -149,7 +149,7 @@ Foam::IOFieldField<T, BaseType>::IOFieldField
 // * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * * //
 
 template<class T, class BaseType>
-Foam::IOFieldField<T, BaseType>::~IOFieldField()
+Foam::CompactIOField<T, BaseType>::~CompactIOField()
 {}
 
 
@@ -157,7 +157,7 @@ Foam::IOFieldField<T, BaseType>::~IOFieldField()
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
 template<class T, class BaseType>
-bool Foam::IOFieldField<T, BaseType>::writeObject
+bool Foam::CompactIOField<T, BaseType>::writeObject
 (
     IOstream::streamFormat fmt,
     IOstream::versionNumber ver,
@@ -186,7 +186,7 @@ bool Foam::IOFieldField<T, BaseType>::writeObject
 
 
 template<class T, class BaseType>
-bool Foam::IOFieldField<T, BaseType>::writeData(Ostream& os) const
+bool Foam::CompactIOField<T, BaseType>::writeData(Ostream& os) const
 {
     return (os << *this).good();
 }
@@ -195,9 +195,9 @@ bool Foam::IOFieldField<T, BaseType>::writeData(Ostream& os) const
 // * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
 
 template<class T, class BaseType>
-void Foam::IOFieldField<T, BaseType>::operator=
+void Foam::CompactIOField<T, BaseType>::operator=
 (
-    const IOFieldField<T, BaseType>& rhs
+    const CompactIOField<T, BaseType>& rhs
 )
 {
     Field<T>::operator=(rhs);
@@ -205,7 +205,7 @@ void Foam::IOFieldField<T, BaseType>::operator=
 
 
 template<class T, class BaseType>
-void Foam::IOFieldField<T, BaseType>::operator=(const Field<T>& rhs)
+void Foam::CompactIOField<T, BaseType>::operator=(const Field<T>& rhs)
 {
     Field<T>::operator=(rhs);
 }
@@ -217,7 +217,7 @@ template<class T, class BaseType>
 Foam::Istream& Foam::operator>>
 (
     Foam::Istream& is,
-    Foam::IOFieldField<T, BaseType>& L
+    Foam::CompactIOField<T, BaseType>& L
 )
 {
     // Read compact
@@ -248,7 +248,7 @@ template<class T, class BaseType>
 Foam::Ostream& Foam::operator<<
 (
     Foam::Ostream& os,
-    const Foam::IOFieldField<T, BaseType>& L
+    const Foam::CompactIOField<T, BaseType>& L
 )
 {
     // Keep ascii writing same.
diff --git a/src/OpenFOAM/db/IOobjects/IOFieldField/IOFieldField.H b/src/OpenFOAM/db/IOobjects/CompactIOField/CompactIOField.H
similarity index 77%
rename from src/OpenFOAM/db/IOobjects/IOFieldField/IOFieldField.H
rename to src/OpenFOAM/db/IOobjects/CompactIOField/CompactIOField.H
index 2174d2d469879957a82b44d7cc61e5a42eba24a4..f7622cae557d22a280f4351b8aa0275e974c52fc 100644
--- a/src/OpenFOAM/db/IOobjects/IOFieldField/IOFieldField.H
+++ b/src/OpenFOAM/db/IOobjects/CompactIOField/CompactIOField.H
@@ -22,18 +22,22 @@ License
     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 
 Class
-    Foam::IOFieldField
+    Foam::CompactIOField
 
 Description
-    A Field of objects of type \<T\> with automated input and output.
+    A Field of objects of type \<T\> with automated input and output using
+    a compact storage. Behaves like IOField except when binary output in
+    case it writes a CompactListList.
+
+    Useful for fields of small subfields e.g. in lagrangian
 
 SourceFiles
-    IOFieldField.C
+    CompactIOField.C
 
 \*---------------------------------------------------------------------------*/
 
-#ifndef IOFieldField_H
-#define IOFieldField_H
+#ifndef CompactIOField_H
+#define CompactIOField_H
 
 #include "IOField.H"
 #include "regIOobject.H"
@@ -47,25 +51,25 @@ class Istream;
 class Ostream;
 
 // Forward declaration of friend functions and operators
-template<class T, class BaseType> class IOFieldField;
+template<class T, class BaseType> class CompactIOField;
 
 template<class T, class BaseType> Istream& operator>>
 (
     Istream&,
-    IOFieldField<T, BaseType>&
+    CompactIOField<T, BaseType>&
 );
 template<class T, class BaseType> Ostream& operator<<
 (
     Ostream&,
-    const IOFieldField<T, BaseType>&
+    const CompactIOField<T, BaseType>&
 );
 
 /*---------------------------------------------------------------------------*\
-                        Class IOFieldField Declaration
+                        Class CompactIOField Declaration
 \*---------------------------------------------------------------------------*/
 
 template<class T, class BaseType>
-class IOFieldField
+class CompactIOField
 :
     public regIOobject,
     public Field<T>
@@ -84,21 +88,21 @@ public:
     // Constructors
 
         //- Construct from IOobject
-        IOFieldField(const IOobject&);
+        CompactIOField(const IOobject&);
 
-        //- Construct from IOobject and size of IOFieldField
-        IOFieldField(const IOobject&, const label);
+        //- Construct from IOobject and size
+        CompactIOField(const IOobject&, const label);
 
         //- Construct from IOobject and a Field
-        IOFieldField(const IOobject&, const Field<T>&);
+        CompactIOField(const IOobject&, const Field<T>&);
 
         //- Construct by transferring the Field contents
-        IOFieldField(const IOobject&, const Xfer<Field<T> >&);
+        CompactIOField(const IOobject&, const Xfer<Field<T> >&);
 
 
     // Destructor
 
-        virtual ~IOFieldField();
+        virtual ~CompactIOField();
 
 
     // Member functions
@@ -115,7 +119,7 @@ public:
 
     // Member operators
 
-        void operator=(const IOFieldField<T, BaseType>&);
+        void operator=(const CompactIOField<T, BaseType>&);
 
         void operator=(const Field<T>&);
 
@@ -126,14 +130,14 @@ public:
         friend Istream& operator>> <T, BaseType>
         (
             Istream&,
-            IOFieldField<T, BaseType>&
+            CompactIOField<T, BaseType>&
         );
 
         // Write Field to Ostream.
         friend Ostream& operator<< <T, BaseType>
         (
             Ostream&,
-            const IOFieldField<T, BaseType>&
+            const CompactIOField<T, BaseType>&
         );
 };
 
@@ -145,7 +149,7 @@ public:
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 #ifdef NoRepository
-#   include "IOFieldField.C"
+#   include "CompactIOField.C"
 #endif
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/db/IOobjects/IOListList/IOListList.C b/src/OpenFOAM/db/IOobjects/CompactIOList/CompactIOList.C
similarity index 87%
rename from src/OpenFOAM/db/IOobjects/IOListList/IOListList.C
rename to src/OpenFOAM/db/IOobjects/CompactIOList/CompactIOList.C
index 0f1b320195dfc3171c9ca6ba05e5ade6647371f0..ac21a5e4c55447c7b0a1d21834cf674724f85845 100644
--- a/src/OpenFOAM/db/IOobjects/IOListList/IOListList.C
+++ b/src/OpenFOAM/db/IOobjects/CompactIOList/CompactIOList.C
@@ -23,13 +23,13 @@ License
 
 \*---------------------------------------------------------------------------*/
 
-#include "IOListList.H"
+#include "CompactIOList.H"
 #include "labelList.H"
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
 
 template<class T, class BaseType>
-void Foam::IOListList<T, BaseType>::readFromStream()
+void Foam::CompactIOList<T, BaseType>::readFromStream()
 {
     Istream& is = readStream(word::null);
 
@@ -47,7 +47,7 @@ void Foam::IOListList<T, BaseType>::readFromStream()
     {
         FatalIOErrorIn
         (
-            "IOListList<T, BaseType>::readFromStream()",
+            "CompactIOList<T, BaseType>::readFromStream()",
             is
         )   << "unexpected class name " << headerClassName()
             << " expected " << typeName << " or " << IOList<T>::typeName
@@ -61,7 +61,7 @@ void Foam::IOListList<T, BaseType>::readFromStream()
 // * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * * //
 
 template<class T, class BaseType>
-Foam::IOListList<T, BaseType>::IOListList(const IOobject& io)
+Foam::CompactIOList<T, BaseType>::CompactIOList(const IOobject& io)
 :
     regIOobject(io)
 {
@@ -77,7 +77,11 @@ Foam::IOListList<T, BaseType>::IOListList(const IOobject& io)
 
 
 template<class T, class BaseType>
-Foam::IOListList<T, BaseType>::IOListList(const IOobject& io, const label size)
+Foam::CompactIOList<T, BaseType>::CompactIOList
+(
+    const IOobject& io,
+    const label size
+)
 :
     regIOobject(io)
 {
@@ -97,7 +101,7 @@ Foam::IOListList<T, BaseType>::IOListList(const IOobject& io, const label size)
 
 
 template<class T, class BaseType>
-Foam::IOListList<T, BaseType>::IOListList
+Foam::CompactIOList<T, BaseType>::CompactIOList
 (
     const IOobject& io,
     const List<T>& list
@@ -121,7 +125,7 @@ Foam::IOListList<T, BaseType>::IOListList
 
 
 template<class T, class BaseType>
-Foam::IOListList<T, BaseType>::IOListList
+Foam::CompactIOList<T, BaseType>::CompactIOList
 (
     const IOobject& io,
     const Xfer<List<T> >& list
@@ -145,7 +149,7 @@ Foam::IOListList<T, BaseType>::IOListList
 // * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * * //
 
 template<class T, class BaseType>
-Foam::IOListList<T, BaseType>::~IOListList()
+Foam::CompactIOList<T, BaseType>::~CompactIOList()
 {}
 
 
@@ -153,7 +157,7 @@ Foam::IOListList<T, BaseType>::~IOListList()
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
 template<class T, class BaseType>
-bool Foam::IOListList<T, BaseType>::writeObject
+bool Foam::CompactIOList<T, BaseType>::writeObject
 (
     IOstream::streamFormat fmt,
     IOstream::versionNumber ver,
@@ -182,7 +186,7 @@ bool Foam::IOListList<T, BaseType>::writeObject
 
 
 template<class T, class BaseType>
-bool Foam::IOListList<T, BaseType>::writeData(Ostream& os) const
+bool Foam::CompactIOList<T, BaseType>::writeData(Ostream& os) const
 {
     return (os << *this).good();
 }
@@ -191,9 +195,9 @@ bool Foam::IOListList<T, BaseType>::writeData(Ostream& os) const
 // * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
 
 template<class T, class BaseType>
-void Foam::IOListList<T, BaseType>::operator=
+void Foam::CompactIOList<T, BaseType>::operator=
 (
-    const IOListList<T, BaseType>& rhs
+    const CompactIOList<T, BaseType>& rhs
 )
 {
     List<T>::operator=(rhs);
@@ -201,7 +205,7 @@ void Foam::IOListList<T, BaseType>::operator=
 
 
 template<class T, class BaseType>
-void Foam::IOListList<T, BaseType>::operator=(const List<T>& rhs)
+void Foam::CompactIOList<T, BaseType>::operator=(const List<T>& rhs)
 {
     List<T>::operator=(rhs);
 }
@@ -213,7 +217,7 @@ template<class T, class BaseType>
 Foam::Istream& Foam::operator>>
 (
     Foam::Istream& is,
-    Foam::IOListList<T, BaseType>& L
+    Foam::CompactIOList<T, BaseType>& L
 )
 {
     // Read compact
@@ -244,7 +248,7 @@ template<class T, class BaseType>
 Foam::Ostream& Foam::operator<<
 (
     Foam::Ostream& os,
-    const Foam::IOListList<T, BaseType>& L
+    const Foam::CompactIOList<T, BaseType>& L
 )
 {
     // Keep ascii writing same.
diff --git a/src/OpenFOAM/db/IOobjects/IOListList/IOListList.H b/src/OpenFOAM/db/IOobjects/CompactIOList/CompactIOList.H
similarity index 76%
rename from src/OpenFOAM/db/IOobjects/IOListList/IOListList.H
rename to src/OpenFOAM/db/IOobjects/CompactIOList/CompactIOList.H
index b5bd10318395cd00da89bff852073eb69debe5fa..e4a85ef118e67342cd0cb27e5dabc66a90faa9b9 100644
--- a/src/OpenFOAM/db/IOobjects/IOListList/IOListList.H
+++ b/src/OpenFOAM/db/IOobjects/CompactIOList/CompactIOList.H
@@ -22,18 +22,22 @@ License
     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 
 Class
-    Foam::IOListList
+    Foam::CompactIOList
 
 Description
-    A List of objects of type \<T\> with automated input and output.
+    A List of objects of type \<T\> with automated input and output using
+    a compact storage. Behaves like IOList except when binary output in
+    case it writes a CompactListList.
+
+    Useful for lists of small sublists e.g. faceList, cellList.
 
 SourceFiles
-    IOListList.C
+    CompactIOList.C
 
 \*---------------------------------------------------------------------------*/
 
-#ifndef IOListList_H
-#define IOListList_H
+#ifndef CompactIOList_H
+#define CompactIOList_H
 
 #include "IOList.H"
 #include "regIOobject.H"
@@ -47,25 +51,25 @@ class Istream;
 class Ostream;
 
 // Forward declaration of friend functions and operators
-template<class T, class BaseType> class IOListList;
+template<class T, class BaseType> class CompactIOList;
 
 template<class T, class BaseType> Istream& operator>>
 (
     Istream&,
-    IOListList<T, BaseType>&
+    CompactIOList<T, BaseType>&
 );
 template<class T, class BaseType> Ostream& operator<<
 (
     Ostream&,
-    const IOListList<T, BaseType>&
+    const CompactIOList<T, BaseType>&
 );
 
 /*---------------------------------------------------------------------------*\
-                           Class IOListList Declaration
+                           Class CompactIOList Declaration
 \*---------------------------------------------------------------------------*/
 
 template<class T, class BaseType>
-class IOListList
+class CompactIOList
 :
     public regIOobject,
     public List<T>
@@ -78,27 +82,27 @@ class IOListList
 public:
 
     //- Runtime type information
-    TypeName("ListList");
+    TypeName("CompactList");
 
 
     // Constructors
 
         //- Construct from IOobject
-        IOListList(const IOobject&);
+        CompactIOList(const IOobject&);
 
-        //- Construct from IOobject and size of IOListList
-        IOListList(const IOobject&, const label);
+        //- Construct from IOobject and size of CompactIOList
+        CompactIOList(const IOobject&, const label);
 
         //- Construct from IOobject and a List
-        IOListList(const IOobject&, const List<T>&);
+        CompactIOList(const IOobject&, const List<T>&);
 
         //- Construct by transferring the List contents
-        IOListList(const IOobject&, const Xfer<List<T> >&);
+        CompactIOList(const IOobject&, const Xfer<List<T> >&);
 
 
     // Destructor
 
-        virtual ~IOListList();
+        virtual ~CompactIOList();
 
 
     // Member functions
@@ -115,7 +119,7 @@ public:
 
     // Member operators
 
-        void operator=(const IOListList<T, BaseType>&);
+        void operator=(const CompactIOList<T, BaseType>&);
 
         void operator=(const List<T>&);
 
@@ -126,14 +130,14 @@ public:
         friend Istream& operator>> <T, BaseType>
         (
             Istream&,
-            IOListList<T, BaseType>&
+            CompactIOList<T, BaseType>&
         );
 
         // Write List to Ostream.
         friend Ostream& operator<< <T, BaseType>
         (
             Ostream&,
-            const IOListList<T, BaseType>&
+            const CompactIOList<T, BaseType>&
         );
 };
 
@@ -145,7 +149,7 @@ public:
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 #ifdef NoRepository
-#   include "IOListList.C"
+#   include "CompactIOList.C"
 #endif
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C b/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C
index 2a786c111dd5c5136ceda60e86c914903faa6e2e..aa16d17ad8dffe911b6367ad1ae6488f478eb46f 100644
--- a/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C
+++ b/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C
@@ -252,7 +252,7 @@ Foam::Istream& Foam::ISstream::read(token& t)
                 }
                 else
                 {
-                    char *endptr;
+                    char *endptr = NULL;
 
                     if (asLabel)
                     {
@@ -260,7 +260,7 @@ Foam::Istream& Foam::ISstream::read(token& t)
                         t = label(longVal);
 
                         // return as a scalar if doesn't fit in a label
-                        if (t.labelToken() != longVal)
+                        if (*endptr || t.labelToken() != longVal)
                         {
                             t = scalar(strtod(buf, &endptr));
                         }
diff --git a/src/OpenFOAM/db/IOstreams/Sstreams/readHexLabel.C b/src/OpenFOAM/db/IOstreams/Sstreams/readHexLabel.C
index 4cf39c34a7f8baf3b8f2925ea8a58e05295c9bbc..432ab8ac1718d96efb0ada3533ea28232ba72e3a 100644
--- a/src/OpenFOAM/db/IOstreams/Sstreams/readHexLabel.C
+++ b/src/OpenFOAM/db/IOstreams/Sstreams/readHexLabel.C
@@ -22,11 +22,12 @@ License
     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 
 Description
-    Read of a non-delimited hex label
+    Read a non-delimited hex label
 
 \*---------------------------------------------------------------------------*/
 
 #include "readHexLabel.H"
+#include <cctype>
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -55,7 +56,7 @@ Foam::label Foam::readHexLabel(ISstream& is)
                 << exit(FatalIOError);
         }
 
-        result *= 16;
+        result <<= 4;
 
         if (isdigit(c))
         {
diff --git a/src/OpenFOAM/fields/Fields/diagTensorField/diagTensorFieldIOField.C b/src/OpenFOAM/fields/Fields/diagTensorField/diagTensorFieldIOField.C
index 219201dbbba1d01d796c273de696fda988ec5f5b..7d9e5c7c48f53e112ebed1291a81646013fddadd 100644
--- a/src/OpenFOAM/fields/Fields/diagTensorField/diagTensorFieldIOField.C
+++ b/src/OpenFOAM/fields/Fields/diagTensorField/diagTensorFieldIOField.C
@@ -41,8 +41,8 @@ namespace Foam
 
     defineTemplateTypeNameAndDebugWithName
     (
-        diagTensorIOFieldField,
-        "diagTensorCompactFieldField",
+        diagTensorFieldCompactIOField,
+        "diagTensorFieldCompactField",
         0
     );
 }
diff --git a/src/OpenFOAM/fields/Fields/diagTensorField/diagTensorFieldIOField.H b/src/OpenFOAM/fields/Fields/diagTensorField/diagTensorFieldIOField.H
index bca26c2b68fcd8e51129ee8fe06562a93bc38555..075e73886f499cd92351fe55a5ea6c55f36adbaa 100644
--- a/src/OpenFOAM/fields/Fields/diagTensorField/diagTensorFieldIOField.H
+++ b/src/OpenFOAM/fields/Fields/diagTensorField/diagTensorFieldIOField.H
@@ -33,15 +33,15 @@ Description
 #define diagTensorFieldIOField_H
 
 #include "diagTensorField.H"
-#include "IOField.H"
-#include "IOFieldField.H"
+#include "CompactIOField.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 namespace Foam
 {
     typedef IOField<diagTensorField> diagTensorFieldIOField;
-    typedef IOFieldField<diagTensorField, diagTensor> diagTensorIOFieldField;
+    typedef CompactIOField<diagTensorField, diagTensor>
+    diagTensorFieldCompactIOField;
 }
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/fields/Fields/labelField/labelFieldIOField.C b/src/OpenFOAM/fields/Fields/labelField/labelFieldIOField.C
index 5c76bec0c3b6fcf1222e2f0bd15c1cd87195cae9..aea2310d1da672a8423f30e48cfcd97649f83eea 100644
--- a/src/OpenFOAM/fields/Fields/labelField/labelFieldIOField.C
+++ b/src/OpenFOAM/fields/Fields/labelField/labelFieldIOField.C
@@ -41,8 +41,8 @@ namespace Foam
 
     defineTemplateTypeNameAndDebugWithName
     (
-        labelIOFieldField,
-        "labelCompactFieldField",
+        labelFieldCompactIOField,
+        "labelFieldCompactField",
         0
     );
 }
diff --git a/src/OpenFOAM/fields/Fields/labelField/labelFieldIOField.H b/src/OpenFOAM/fields/Fields/labelField/labelFieldIOField.H
index 6b626ada9e2e4c3b64cda4efe347cd94df605eba..daac00e8043f80921c4091818ad70271e91a639f 100644
--- a/src/OpenFOAM/fields/Fields/labelField/labelFieldIOField.H
+++ b/src/OpenFOAM/fields/Fields/labelField/labelFieldIOField.H
@@ -34,14 +34,14 @@ Description
 
 #include "labelField.H"
 #include "IOField.H"
-#include "IOFieldField.H"
+#include "CompactIOField.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 namespace Foam
 {
     typedef IOField<labelField> labelFieldIOField;
-    typedef IOFieldField<labelField, label> labelIOFieldField;
+    typedef CompactIOField<labelField, label> labelFieldCompactIOField;
 }
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/fields/Fields/scalarField/scalarFieldIOField.C b/src/OpenFOAM/fields/Fields/scalarField/scalarFieldIOField.C
index 2477f3b72876a18ab41507fbb8d8053b7e1186b0..60e5167ba8583d593330f8d37a5b8954c6536b8d 100644
--- a/src/OpenFOAM/fields/Fields/scalarField/scalarFieldIOField.C
+++ b/src/OpenFOAM/fields/Fields/scalarField/scalarFieldIOField.C
@@ -41,8 +41,8 @@ namespace Foam
 
     defineTemplateTypeNameAndDebugWithName
     (
-        scalarIOFieldField,
-        "scalarCompactFieldField",
+        scalarFieldCompactIOField,
+        "scalarFieldCompactField",
         0
     );
 }
diff --git a/src/OpenFOAM/fields/Fields/scalarField/scalarFieldIOField.H b/src/OpenFOAM/fields/Fields/scalarField/scalarFieldIOField.H
index 5dbad94dfeba6b6b1a3e48316e885ecf3ea85271..226a559aff3a76d3111080412ab6ee9c8e5d765b 100644
--- a/src/OpenFOAM/fields/Fields/scalarField/scalarFieldIOField.H
+++ b/src/OpenFOAM/fields/Fields/scalarField/scalarFieldIOField.H
@@ -33,15 +33,14 @@ Description
 #define scalarFieldIOField_H
 
 #include "scalarField.H"
-#include "IOField.H"
-#include "IOFieldField.H"
+#include "CompactIOField.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 namespace Foam
 {
     typedef IOField<scalarField> scalarFieldIOField;
-    typedef IOFieldField<scalarField, scalar> scalarIOFieldField;
+    typedef CompactIOField<scalarField, scalar> scalarFieldCompactIOField;
 }
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/fields/Fields/sphericalTensorField/sphericalTensorFieldIOField.C b/src/OpenFOAM/fields/Fields/sphericalTensorField/sphericalTensorFieldIOField.C
index 71473742e5a3ff616a6723cd2edfcd4102e0b3ad..e323374ed328f2ec2c34ea2069f6af7b1865a1eb 100644
--- a/src/OpenFOAM/fields/Fields/sphericalTensorField/sphericalTensorFieldIOField.C
+++ b/src/OpenFOAM/fields/Fields/sphericalTensorField/sphericalTensorFieldIOField.C
@@ -41,8 +41,8 @@ namespace Foam
 
     defineTemplateTypeNameAndDebugWithName
     (
-        sphericalTensorIOFieldField,
-        "sphericalTensorCompactFieldField",
+        sphericalTensorFieldCompactIOField,
+        "sphericalTensorFieldCompactField",
         0
     );
 }
diff --git a/src/OpenFOAM/fields/Fields/sphericalTensorField/sphericalTensorFieldIOField.H b/src/OpenFOAM/fields/Fields/sphericalTensorField/sphericalTensorFieldIOField.H
index 59d8e611439b044c47f3e2ae8ad6d00abf01a4d8..8756d2b3e46cddcbd1a6f8351f9d23e061cff54b 100644
--- a/src/OpenFOAM/fields/Fields/sphericalTensorField/sphericalTensorFieldIOField.H
+++ b/src/OpenFOAM/fields/Fields/sphericalTensorField/sphericalTensorFieldIOField.H
@@ -33,8 +33,7 @@ Description
 #define sphericalTensorFieldIOField_H
 
 #include "sphericalTensorField.H"
-#include "IOField.H"
-#include "IOFieldField.H"
+#include "CompactIOField.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -42,8 +41,8 @@ namespace Foam
 {
     typedef IOField<sphericalTensorField> sphericalTensorFieldIOField;
 
-    typedef IOFieldField<sphericalTensorField, sphericalTensor>
-    sphericalTensorIOFieldField;
+    typedef CompactIOField<sphericalTensorField, sphericalTensor>
+    sphericalTensorFieldCompactIOField;
 }
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/fields/Fields/symmTensorField/symmTensorFieldIOField.C b/src/OpenFOAM/fields/Fields/symmTensorField/symmTensorFieldIOField.C
index 13105766a70ba3751da545fae3da0bb8a029cd89..e231bf4d2bd26cbd49d87616eb23094e2e4190b0 100644
--- a/src/OpenFOAM/fields/Fields/symmTensorField/symmTensorFieldIOField.C
+++ b/src/OpenFOAM/fields/Fields/symmTensorField/symmTensorFieldIOField.C
@@ -41,8 +41,8 @@ namespace Foam
 
     defineTemplateTypeNameAndDebugWithName
     (
-        symmTensorIOFieldField,
-        "symmTensorCompactFieldField",
+        symmTensorFieldCompactIOField,
+        "symmTensorFieldCompactField",
         0
     );
 }
diff --git a/src/OpenFOAM/fields/Fields/symmTensorField/symmTensorFieldIOField.H b/src/OpenFOAM/fields/Fields/symmTensorField/symmTensorFieldIOField.H
index eb688b33a7ed9ecd772189d51129772ef036f15c..c08c93c4b1c627830cfde1a9986601fb4682fdea 100644
--- a/src/OpenFOAM/fields/Fields/symmTensorField/symmTensorFieldIOField.H
+++ b/src/OpenFOAM/fields/Fields/symmTensorField/symmTensorFieldIOField.H
@@ -33,15 +33,15 @@ Description
 #define symmTensorFieldIOField_H
 
 #include "symmTensorField.H"
-#include "IOField.H"
-#include "IOFieldField.H"
+#include "CompactIOField.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 namespace Foam
 {
     typedef IOField<symmTensorField> symmTensorFieldIOField;
-    typedef IOFieldField<symmTensorField, symmTensor> symmTensorIOFieldField;
+    typedef CompactIOField<symmTensorField, symmTensor>
+    symmTensorFieldCompactIOField;
 }
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/fields/Fields/tensorField/tensorFieldIOField.C b/src/OpenFOAM/fields/Fields/tensorField/tensorFieldIOField.C
index 63c33df2ad274b0005a94c7b4bd707024e804b7b..a4c4d8fbb2bf7e5a55423005165dd4a576e06b4f 100644
--- a/src/OpenFOAM/fields/Fields/tensorField/tensorFieldIOField.C
+++ b/src/OpenFOAM/fields/Fields/tensorField/tensorFieldIOField.C
@@ -41,8 +41,8 @@ namespace Foam
 
     defineTemplateTypeNameAndDebugWithName
     (
-        tensorIOFieldField,
-        "tensorCompactFieldField",
+        tensorFieldCompactIOField,
+        "tensorFieldCompactField",
         0
     );
 }
diff --git a/src/OpenFOAM/fields/Fields/tensorField/tensorFieldIOField.H b/src/OpenFOAM/fields/Fields/tensorField/tensorFieldIOField.H
index 48fbabf881763567f3d0cea85811c4495ab420a0..8accb107110832b9b3b3c67f7035acbed2d45fb4 100644
--- a/src/OpenFOAM/fields/Fields/tensorField/tensorFieldIOField.H
+++ b/src/OpenFOAM/fields/Fields/tensorField/tensorFieldIOField.H
@@ -33,15 +33,14 @@ Description
 #define tensorFieldIOField_H
 
 #include "tensorField.H"
-#include "IOField.H"
-#include "IOFieldField.H"
+#include "CompactIOField.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 namespace Foam
 {
     typedef IOField<tensorField> tensorFieldIOField;
-    typedef IOFieldField<tensorField, tensor> tensorIOFieldField;
+    typedef CompactIOField<tensorField, tensor> tensorFieldCompactIOField;
 }
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/fields/Fields/vector2DField/vector2DFieldIOField.C b/src/OpenFOAM/fields/Fields/vector2DField/vector2DFieldIOField.C
index 510f6f67f013b5e1d15a9f5da1830db74c0d7a34..05fe916191118bff7ad3d0757abc217cee6f89d1 100644
--- a/src/OpenFOAM/fields/Fields/vector2DField/vector2DFieldIOField.C
+++ b/src/OpenFOAM/fields/Fields/vector2DField/vector2DFieldIOField.C
@@ -41,8 +41,8 @@ namespace Foam
 
     defineTemplateTypeNameAndDebugWithName
     (
-        vector2DIOFieldField,
-        "vector2DCompactFieldField",
+        vector2DFieldCompactIOField,
+        "vector2DFieldCompactField",
         0
     );
 }
diff --git a/src/OpenFOAM/fields/Fields/vector2DField/vector2DFieldIOField.H b/src/OpenFOAM/fields/Fields/vector2DField/vector2DFieldIOField.H
index 9640e38a0192c918e242ce56539db5b8e85e1b12..e3e1e489ffb7da7f4fd564cf414876b291c90253 100644
--- a/src/OpenFOAM/fields/Fields/vector2DField/vector2DFieldIOField.H
+++ b/src/OpenFOAM/fields/Fields/vector2DField/vector2DFieldIOField.H
@@ -33,15 +33,14 @@ Description
 #define vector2DFieldIOField_H
 
 #include "vector2DField.H"
-#include "IOField.H"
-#include "IOFieldField.H"
+#include "CompactIOField.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 namespace Foam
 {
     typedef IOField<vector2DField> vector2DFieldIOField;
-    typedef IOFieldField<vector2DField, vector2D> vector2DIOFieldField;
+    typedef CompactIOField<vector2DField, vector2D> vector2DFieldCompactIOField;
 }
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/fields/Fields/vectorField/vectorFieldIOField.C b/src/OpenFOAM/fields/Fields/vectorField/vectorFieldIOField.C
index 9ba26b2d6ebca9bf8fbda8ff818e491591599cf0..1783bfcfeee4f23bc5670f2158c7492894ada94e 100644
--- a/src/OpenFOAM/fields/Fields/vectorField/vectorFieldIOField.C
+++ b/src/OpenFOAM/fields/Fields/vectorField/vectorFieldIOField.C
@@ -41,8 +41,8 @@ namespace Foam
 
     defineTemplateTypeNameAndDebugWithName
     (
-        vectorIOFieldField,
-        "vectorCompactFieldField",
+        vectorFieldCompactIOField,
+        "vectorFieldCompactField",
         0
     );
 }
diff --git a/src/OpenFOAM/fields/Fields/vectorField/vectorFieldIOField.H b/src/OpenFOAM/fields/Fields/vectorField/vectorFieldIOField.H
index b46b55b3fa05b84fe3b57a8c28762da5152c0fbd..2d46114514abd836896f039accf1e15d05cb7391 100644
--- a/src/OpenFOAM/fields/Fields/vectorField/vectorFieldIOField.H
+++ b/src/OpenFOAM/fields/Fields/vectorField/vectorFieldIOField.H
@@ -33,15 +33,14 @@ Description
 #define vectorFieldIOField_H
 
 #include "vectorField.H"
-#include "IOField.H"
-#include "IOFieldField.H"
+#include "CompactIOField.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 namespace Foam
 {
     typedef IOField<vectorField> vectorFieldIOField;
-    typedef IOFieldField<vectorField, vector> vectorIOFieldField;
+    typedef CompactIOField<vectorField, vector> vectorFieldCompactIOField;
 }
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/meshes/polyMesh/zones/ZoneID/ZoneID.H b/src/OpenFOAM/meshes/Identifiers/DynamicID/DynamicID.H
similarity index 59%
rename from src/OpenFOAM/meshes/polyMesh/zones/ZoneID/ZoneID.H
rename to src/OpenFOAM/meshes/Identifiers/DynamicID/DynamicID.H
index 6191a6d6d8f27c6821e9c8a34fea3a324e427b97..286049ed558d77ca02ccf3801b587c0977c08876 100644
--- a/src/OpenFOAM/meshes/polyMesh/zones/ZoneID/ZoneID.H
+++ b/src/OpenFOAM/meshes/Identifiers/DynamicID/DynamicID.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -22,51 +22,48 @@ License
     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 
 Class
-    Foam::ZoneID
+    Foam::DynamicID
 
 Description
-    A class that holds the data needed to identify a zone in a dynamic mesh.
+    A class that holds the data needed to identify things (zones, patches)
+    in a dynamic mesh.
 
-    The zone is identified by name.
-    Its index in the zoneMesh is updated if the mesh has changed.
+    The thing is identified by name.
+    Its indices are updated if the mesh has changed.
 
 \*---------------------------------------------------------------------------*/
 
-#ifndef ZoneID_H
-#define ZoneID_H
+#ifndef DynamicID_H
+#define DynamicID_H
 
-#include "label.H"
-#include "word.H"
-#include "polyMesh.H"
+#include "keyType.H"
+#include "labelList.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 namespace Foam
 {
 
-template<class ZoneType, class MeshType> class ZoneMesh;
-
 // Forward declaration of friend functions and operators
+template<class> class DynamicID;
 
-template<class ZoneType> class ZoneID;
-
-template<class ZoneType>
-Ostream& operator<<(Ostream&, const ZoneID<ZoneType>&);
+template<class ObjectType>
+Ostream& operator<<(Ostream&, const DynamicID<ObjectType>&);
 
 /*---------------------------------------------------------------------------*\
-                           Class ZoneID Declaration
+                          Class DynamicID Declaration
 \*---------------------------------------------------------------------------*/
 
-template<class ZoneType>
-class ZoneID
+template<class ObjectType>
+class DynamicID
 {
     // Private data
 
         //- Zone name
-        word name_;
+        keyType key_;
 
-        //- Zone index
-        label index_;
+        //- Zone indices
+        labelList indices_;
 
 
 public:
@@ -74,17 +71,17 @@ public:
     // Constructors
 
         //- Construct from name
-        ZoneID(const word& name, const ZoneMesh<ZoneType, polyMesh>& zm)
+        DynamicID(const keyType& key, const ObjectType& obj)
         :
-            name_(name),
-            index_(zm.findZoneID(name))
+            key_(key),
+            indices_(obj.findIndices(key_))
         {}
 
         //- Construct from Istream
-        ZoneID(Istream& is, const ZoneMesh<ZoneType, polyMesh>& zm)
+        DynamicID(Istream& is, const ObjectType& obj)
         :
-            name_(is),
-            index_(zm.findZoneID(name_))
+            key_(is),
+            indices_(obj.findIndices(key_))
         {}
 
 
@@ -96,57 +93,57 @@ public:
         // Access
 
             //- Return name
-            const word& name() const
+            const keyType& name() const
+            {
+                return key_;
+            }
+
+            //- Return indices of matching zones
+            const labelList& indices() const
             {
-                return name_;
+                return indices_;
             }
 
-            //- Return index
+            //- Return index of first matching zone
             label index() const
             {
-                return index_;
+                return indices_.empty() ? -1 : indices_[0];
             }
 
             //- Has the zone been found
             bool active() const
             {
-                return index_ > -1;
+                return !indices_.empty();
             }
 
 
         // Edit
 
             //- Update
-            void update(const ZoneMesh<ZoneType, polyMesh>& zm)
+            void update(const ObjectType& obj)
             {
-                index_ = zm.findZoneID(name_);
+                indices_ = obj.findIndices(key_);
             }
 
 
     // IOstream Operators
 
-        friend Ostream& operator<< <ZoneType>
-        (
-            Ostream& os, const ZoneID<ZoneType>& p
-        );
+        friend Ostream& operator<< <ObjectType>
+        (Ostream&, const DynamicID<ObjectType>&);
 };
 
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-template<class ZoneType>
-Ostream& operator<<
-(
-    Ostream& os, const ZoneID<ZoneType>& p
-)
+template<class ObjectType>
+Ostream& operator<<(Ostream& os, const DynamicID<ObjectType>& dynId)
 {
     os  << token::BEGIN_LIST
-        << p.name_ << token::SPACE
-        << p.index_
+        << dynId.name() << token::SPACE << dynId.index()
         << token::END_LIST;
 
     // Check state of Ostream
-    os.check("Ostream& operator<<(Ostream&, const ZoneID<ZoneType>&)");
+    os.check("Ostream& operator<<(Ostream&, const DynamicID<ObjectType>&)");
 
     return os;
 }
diff --git a/src/OpenFOAM/meshes/patchIdentifier/patchIdentifier.C b/src/OpenFOAM/meshes/Identifiers/patch/patchIdentifier.C
similarity index 100%
rename from src/OpenFOAM/meshes/patchIdentifier/patchIdentifier.C
rename to src/OpenFOAM/meshes/Identifiers/patch/patchIdentifier.C
diff --git a/src/OpenFOAM/meshes/patchIdentifier/patchIdentifier.H b/src/OpenFOAM/meshes/Identifiers/patch/patchIdentifier.H
similarity index 100%
rename from src/OpenFOAM/meshes/patchIdentifier/patchIdentifier.H
rename to src/OpenFOAM/meshes/Identifiers/patch/patchIdentifier.H
diff --git a/src/OpenFOAM/primitives/Lists/PackedBoolList.H b/src/OpenFOAM/meshes/Identifiers/patch/polyPatchID.H
similarity index 83%
rename from src/OpenFOAM/primitives/Lists/PackedBoolList.H
rename to src/OpenFOAM/meshes/Identifiers/patch/polyPatchID.H
index 7dd2c81b7c70cb1a47917b5bcaeb1324ed3324ed..eaa7423601e881ca92d7b29e80c91c468d694524 100644
--- a/src/OpenFOAM/primitives/Lists/PackedBoolList.H
+++ b/src/OpenFOAM/meshes/Identifiers/patch/polyPatchID.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -21,25 +21,20 @@ License
     You should have received a copy of the GNU General Public License
     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 
-Typedef
-    Foam::PackedBoolList
-
-Description
-    A bit-packed bool list
-
 \*---------------------------------------------------------------------------*/
 
-#ifndef PackedBoolList_H
-#define PackedBoolList_H
+#ifndef polyPatchID_H
+#define polyPatchID_H
 
-#include "bool.H"
-#include "PackedList.H"
+#include "DynamicID.H"
+#include "polyBoundaryMesh.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 namespace Foam
 {
-    typedef PackedList<> PackedBoolList;
+    //- Foam::polyPatchID
+    typedef DynamicID<polyBoundaryMesh> polyPatchID;
 }
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/meshes/polyMesh/zones/ZoneID/ZoneIDs.H b/src/OpenFOAM/meshes/Identifiers/zones/ZoneIDs.H
similarity index 81%
rename from src/OpenFOAM/meshes/polyMesh/zones/ZoneID/ZoneIDs.H
rename to src/OpenFOAM/meshes/Identifiers/zones/ZoneIDs.H
index 0dc0a43c99db5a487585e0176e41474070dc0399..9b7a6415f2a92290a226ef5239b6ab1726921c88 100644
--- a/src/OpenFOAM/meshes/polyMesh/zones/ZoneID/ZoneIDs.H
+++ b/src/OpenFOAM/meshes/Identifiers/zones/ZoneIDs.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -26,21 +26,26 @@ License
 #ifndef ZoneIDs_H
 #define ZoneIDs_H
 
-#include "ZoneID.H"
-#include "pointZone.H"
-#include "faceZone.H"
-#include "cellZone.H"
+#include "DynamicID.H"
+
+#include "cellZoneMeshFwd.H"
+#include "faceZoneMeshFwd.H"
+#include "pointZoneMeshFwd.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 namespace Foam
 {
-    //- Foam::pointZoneID
-    typedef ZoneID<pointZone> pointZoneID;
-    //- Foam::faceZoneID
-    typedef ZoneID<faceZone> faceZoneID;
+
     //- Foam::cellZoneID
-    typedef ZoneID<cellZone> cellZoneID;
+    typedef DynamicID<cellZoneMesh> cellZoneID;
+
+    //- Foam::faceZoneID
+    typedef DynamicID<faceZoneMesh> faceZoneID;
+
+    //- Foam::pointZoneID
+    typedef DynamicID<pointZoneMesh> pointZoneID;
+
 }
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/meshes/meshShapes/cell/cellIOList.C b/src/OpenFOAM/meshes/meshShapes/cell/cellIOList.C
index 6a6aa29de2eb8fde2b3ad93bb8fb60589abe5e10..46203004a67eb777b7904552e0c2dc3b5a3f25d6 100644
--- a/src/OpenFOAM/meshes/meshShapes/cell/cellIOList.C
+++ b/src/OpenFOAM/meshes/meshShapes/cell/cellIOList.C
@@ -35,7 +35,8 @@ namespace Foam
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
-    defineTemplateTypeNameAndDebugWithName(cellIOList, "cellList", 0);
+defineTemplateTypeNameAndDebugWithName(cellIOList, "cellList", 0);
+defineTemplateTypeNameAndDebugWithName(cellCompactIOList, "cellCompactList", 0);
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/meshes/meshShapes/cell/cellIOList.H b/src/OpenFOAM/meshes/meshShapes/cell/cellIOList.H
index 194c682482793eeaed8a8d42ffd933dd27482b7b..9db59238d2d3efbe201d0429e613cde4bbc46609 100644
--- a/src/OpenFOAM/meshes/meshShapes/cell/cellIOList.H
+++ b/src/OpenFOAM/meshes/meshShapes/cell/cellIOList.H
@@ -33,13 +33,14 @@ Description
 #define cellIOList_H
 
 #include "cell.H"
-#include "IOList.H"
+#include "CompactIOList.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 namespace Foam
 {
     typedef IOList<cell> cellIOList;
+    typedef CompactIOList<cell, label> cellCompactIOList;
 }
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/meshes/meshShapes/edge/edgeIOList.C b/src/OpenFOAM/meshes/meshShapes/edge/edgeIOList.C
index 4dd508f0ee3ae1bad9fa564bb716d381707b2be1..a4fc4e91fcc424b0feccdde1966e8f08818aaf7b 100644
--- a/src/OpenFOAM/meshes/meshShapes/edge/edgeIOList.C
+++ b/src/OpenFOAM/meshes/meshShapes/edge/edgeIOList.C
@@ -33,10 +33,14 @@ Description
 
 namespace Foam
 {
-    defineCompoundTypeName(List<edge>, edgeList);
-    addCompoundToRunTimeSelectionTable(List<edge>, edgeList);
 
-    defineTemplateTypeNameAndDebugWithName(edgeIOList, "edgeList", 0);
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+defineCompoundTypeName(List<edge>, edgeList);
+addCompoundToRunTimeSelectionTable(List<edge>, edgeList);
+
+defineTemplateTypeNameAndDebugWithName(edgeIOList, "edgeList", 0);
+defineTemplateTypeNameAndDebugWithName(edgeCompactIOList, "edgeCompactList", 0);
 }
 
 // ************************************************************************* //
diff --git a/src/OpenFOAM/meshes/meshShapes/edge/edgeIOList.H b/src/OpenFOAM/meshes/meshShapes/edge/edgeIOList.H
index 6c4d1f9287edfc574c04cc029d7a8eb3c943ad76..fa3659913f596d7b10baa34301aee72e61c7d810 100644
--- a/src/OpenFOAM/meshes/meshShapes/edge/edgeIOList.H
+++ b/src/OpenFOAM/meshes/meshShapes/edge/edgeIOList.H
@@ -33,13 +33,14 @@ Description
 #define edgeIOList_H
 
 #include "edge.H"
-#include "IOList.H"
+#include "CompactIOList.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 namespace Foam
 {
     typedef IOList<edge> edgeIOList;
+    typedef CompactIOList<edge, label> edgeCompactIOList;
 }
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/meshes/meshShapes/face/face.H b/src/OpenFOAM/meshes/meshShapes/face/face.H
index 81ce90d8a9d537d2021ab3393bfb50235094f93c..dd5fc4a832b4265e0cd9aa0dd5842c224c13ba22 100644
--- a/src/OpenFOAM/meshes/meshShapes/face/face.H
+++ b/src/OpenFOAM/meshes/meshShapes/face/face.H
@@ -126,6 +126,14 @@ class face
 
 public:
 
+    //- Return types for classify
+    enum proxType
+    {
+        NONE,
+        POINT,  // Close to point
+        EDGE    // Close to edge
+    };
+
     // Static data members
 
         static const char* const typeName;
@@ -249,6 +257,20 @@ public:
             const pointField& meshPoints
         ) const;
 
+        //- Return nearest point to face and classify it:
+        //  + near point (nearType=POINT, nearLabel=0, 1, 2)
+        //  + near edge (nearType=EDGE, nearLabel=0, 1, 2)
+        //    Note: edges are counted from starting vertex so
+        //    e.g. edge n is from f[n] to f[0], where the face has n + 1
+        //    points
+        pointHit nearestPointClassify
+        (
+            const point& p,
+            const pointField& meshPoints,
+            label& nearType,
+            label& nearLabel
+        ) const;
+
         //- Return contact sphere diameter
         scalar contactSphereDiameter
         (
diff --git a/src/OpenFOAM/meshes/meshShapes/face/faceIOList.C b/src/OpenFOAM/meshes/meshShapes/face/faceIOList.C
index 5ce764bd14f43dfabea488b8b64bbe2c861d60c2..212ac9ca179d2e4b95e01eb4b9ec5ded7fff0139 100644
--- a/src/OpenFOAM/meshes/meshShapes/face/faceIOList.C
+++ b/src/OpenFOAM/meshes/meshShapes/face/faceIOList.C
@@ -36,6 +36,12 @@ namespace Foam
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
 defineTemplateTypeNameAndDebugWithName(faceIOList, "faceList", 0);
+defineTemplateTypeNameAndDebugWithName
+(
+    faceCompactIOList,
+    "faceCompactList",
+    0
+);
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/meshes/meshShapes/face/faceIOList.H b/src/OpenFOAM/meshes/meshShapes/face/faceIOList.H
index 58874198a0ba9f32e68ee66149a0ef4b03f16cb9..0422f5247079aa9109e1b0253498db4e56dd1cae 100644
--- a/src/OpenFOAM/meshes/meshShapes/face/faceIOList.H
+++ b/src/OpenFOAM/meshes/meshShapes/face/faceIOList.H
@@ -33,13 +33,14 @@ Description
 #define faceIOList_H
 
 #include "face.H"
-#include "IOList.H"
+#include "CompactIOList.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 namespace Foam
 {
     typedef IOList<face> faceIOList;
+    typedef CompactIOList<face, label> faceCompactIOList;
 }
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/meshes/meshShapes/face/faceIntersection.C b/src/OpenFOAM/meshes/meshShapes/face/faceIntersection.C
index d4184e766aa6a3dd225942da99c4d1e964330e83..f9f02eb61293307a29975ff878f75ffaef138ec0 100644
--- a/src/OpenFOAM/meshes/meshShapes/face/faceIntersection.C
+++ b/src/OpenFOAM/meshes/meshShapes/face/faceIntersection.C
@@ -181,6 +181,22 @@ Foam::pointHit Foam::face::nearestPoint
     const point& p,
     const pointField& meshPoints
 ) const
+{
+    // Dummy labels
+    label nearType = -1;
+    label nearLabel = -1;
+
+    return nearestPointClassify(p, meshPoints, nearType, nearLabel);
+}
+
+
+Foam::pointHit Foam::face::nearestPointClassify
+(
+    const point& p,
+    const pointField& meshPoints,
+    label& nearType,
+    label& nearLabel
+) const
 {
     const face& f = *this;
     point ctr = centre(meshPoints);
@@ -188,6 +204,9 @@ Foam::pointHit Foam::face::nearestPoint
     // Initialize to miss, distance=GREAT
     pointHit nearest(p);
 
+    nearType = -1;
+    nearLabel = -1;
+
     label nPoints = f.size();
 
     point nextPoint = ctr;
@@ -196,8 +215,10 @@ Foam::pointHit Foam::face::nearestPoint
     {
         nextPoint = meshPoints[f[fcIndex(pI)]];
 
+        label tmpNearType = -1;
+        label tmpNearLabel = -1;
+
         // Note: for best accuracy, centre point always comes last
-        //
         triPointRef tri
         (
             meshPoints[f[pI]],
@@ -205,12 +226,42 @@ Foam::pointHit Foam::face::nearestPoint
             ctr
         );
 
-        pointHit curHit = tri.nearestPoint(p);
+        pointHit curHit = tri.nearestPointClassify
+        (
+            p,
+            tmpNearType,
+            tmpNearLabel
+        );
 
         if (Foam::mag(curHit.distance()) < Foam::mag(nearest.distance()))
         {
             nearest.setDistance(curHit.distance());
 
+            // Assume at first that the near type is NONE on the
+            // triangle (i.e. on the face of the triangle) then it is
+            // therefore also for the face.
+
+            nearType = NONE;
+
+            if (tmpNearType == triPointRef::EDGE && tmpNearLabel == 0)
+            {
+                // If the triangle edge label is 0, then this is also
+                // an edge of the face, if not, it is on the face
+
+                nearType = EDGE;
+
+                nearLabel = pI;
+            }
+            else if (tmpNearType == triPointRef::POINT && tmpNearLabel < 2)
+            {
+                // If the triangle point label is 0 or 1, then this is
+                // also a point of the face, if not, it is on the face
+
+                nearType = POINT;
+
+                nearLabel = pI + tmpNearLabel;
+            }
+
             if (curHit.hit())
             {
                 nearest.setHit();
diff --git a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C
index 91fbbca6174f0bd0a9ee7f4615e440a417451766..c11b9056bdc01db6689b2a141ee36a0ed9aae4ed 100644
--- a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C
+++ b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C
@@ -31,6 +31,7 @@ License
 #include "PstreamBuffers.H"
 #include "lduSchedule.H"
 #include "globalMeshData.H"
+#include "stringListOps.H"
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
@@ -413,6 +414,66 @@ Foam::wordList Foam::polyBoundaryMesh::physicalTypes() const
 }
 
 
+Foam::labelList Foam::polyBoundaryMesh::findIndices(const keyType& key) const
+{
+    labelList indices;
+
+    if (!key.empty())
+    {
+        if (key.isPattern())
+        {
+            indices = findStrings(key, this->names());
+        }
+        else
+        {
+            indices.setSize(this->size());
+            label nFound = 0;
+            forAll(*this, i)
+            {
+                if (key == operator[](i).name())
+                {
+                    indices[nFound++] = i;
+                }
+            }
+            indices.setSize(nFound);
+        }
+    }
+
+    return indices;
+}
+
+
+Foam::label Foam::polyBoundaryMesh::findIndex(const keyType& key) const
+{
+    if (!key.empty())
+    {
+        if (key.isPattern())
+        {
+            labelList indices = this->findIndices(key);
+
+            // return first element
+            if (!indices.empty())
+            {
+                return indices[0];
+            }
+        }
+        else
+        {
+            forAll(*this, i)
+            {
+                if (key == operator[](i).name())
+                {
+                    return i;
+                }
+            }
+        }
+    }
+
+    // not found
+    return -1;
+}
+
+
 Foam::label Foam::polyBoundaryMesh::findPatchID(const word& patchName) const
 {
     const polyPatchList& patches = *this;
@@ -444,7 +505,11 @@ Foam::label Foam::polyBoundaryMesh::whichPatch(const label faceIndex) const
     // with patch start labels.
     // If the face is internal, return -1;
     // if it is off the end of the list, abort
-    if (faceIndex >= mesh().nFaces())
+    if (faceIndex < mesh().nInternalFaces())
+    {
+        return -1;
+    }
+    else if (faceIndex >= mesh().nFaces())
     {
         FatalErrorIn
         (
@@ -453,10 +518,6 @@ Foam::label Foam::polyBoundaryMesh::whichPatch(const label faceIndex) const
             << abort(FatalError);
     }
 
-    if (faceIndex < mesh().nInternalFaces())
-    {
-        return -1;
-    }
 
     forAll(*this, patchI)
     {
@@ -578,7 +639,7 @@ bool Foam::polyBoundaryMesh::checkParallelSync(const bool report) const
 
     // Have every processor check but only master print error.
 
-    for (label procI = 1; procI < allNames.size(); procI++)
+    for (label procI = 1; procI < allNames.size(); ++procI)
     {
         if
         (
diff --git a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H
index 5469c6b8b8226acfa195e73bc89bf66d53cca6cc..89bd78a17ae0b16fce0c5f2f7fbbd58ed2c8dbea 100644
--- a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H
+++ b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H
@@ -38,6 +38,7 @@ SourceFiles
 #include "polyPatchList.H"
 #include "regIOobject.H"
 #include "labelPair.H"
+#include "HashSet.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -151,6 +152,12 @@ public:
         //- Return a list of physical types
         wordList physicalTypes() const;
 
+        //- Return patch indices for all matches
+        labelList findIndices(const keyType&) const;
+
+        //- Return patch index for the first match, return -1 if not found
+        label findIndex(const keyType&) const;
+
         //- Find patch index given a name
         label findPatchID(const word& patchName) const;
 
diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMesh.C
index 668320e1d6dd368334c0934de33ab7b9e209c5fb..ab72d6d44639cb6e9700bfac6c0b78ef6de0ef1f 100644
--- a/src/OpenFOAM/meshes/polyMesh/polyMesh.C
+++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.C
@@ -272,7 +272,7 @@ Foam::polyMesh::polyMesh(const IOobject& io)
     }
     else
     {
-        cellIOList cLst
+        cellCompactIOList cLst
         (
             IOobject
             (
diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.H b/src/OpenFOAM/meshes/polyMesh/polyMesh.H
index a100a358e158a18f3da364087a37ed9c742437cd..62df97511ca5b5fbe6cdfc9eb7766cd188c5f306 100644
--- a/src/OpenFOAM/meshes/polyMesh/polyMesh.H
+++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.H
@@ -101,7 +101,7 @@ private:
             pointIOField points_;
 
             //- Faces
-            faceIOList faces_;
+            faceCompactIOList faces_;
 
             //- Face owner
             labelIOList owner_;
diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshIO.C b/src/OpenFOAM/meshes/polyMesh/polyMeshIO.C
index 757f17458876e5a2016ce6cb14d58d9857aefb66..8e50f8033e8b0a301065d30612af8ddd594642e8 100644
--- a/src/OpenFOAM/meshes/polyMesh/polyMeshIO.C
+++ b/src/OpenFOAM/meshes/polyMesh/polyMeshIO.C
@@ -112,7 +112,7 @@ Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate()
             )
         );
 
-        faces_ = faceIOList
+        faces_ = faceCompactIOList
         (
             IOobject
             (
@@ -238,7 +238,7 @@ Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate()
         }
         else
         {
-            cellIOList cells
+            cellCompactIOList cells
             (
                 IOobject
                 (
diff --git a/src/OpenFOAM/meshes/polyMesh/zones/ZoneID/polyPatchID.H b/src/OpenFOAM/meshes/polyMesh/zones/ZoneID/polyPatchID.H
deleted file mode 100644
index 58c7ff4c1542e7075d54969986f36a8d6704f517..0000000000000000000000000000000000000000
--- a/src/OpenFOAM/meshes/polyMesh/zones/ZoneID/polyPatchID.H
+++ /dev/null
@@ -1,142 +0,0 @@
-/*---------------------------------------------------------------------------*\
-  =========                 |
-  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-   \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
-     \\/     M anipulation  |
--------------------------------------------------------------------------------
-License
-    This file is part of OpenFOAM.
-
-    OpenFOAM is free software: you can redistribute it and/or modify it
-    under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 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::polyPatchID
-
-Description
-    A class holds the data needed to identify a patch in a dynamic mesh.
-
-    The patch is identified by name and its index in the boundary mesh
-    is updated if the mesh has changed.
-
-\*---------------------------------------------------------------------------*/
-
-#ifndef polyPatchID_H
-#define polyPatchID_H
-
-#include "polyBoundaryMesh.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace Foam
-{
-
-// Forward declaration of friend functions and operators
-
-class polyPatchID;
-Ostream& operator<<(Ostream& os, const polyPatchID& p);
-
-
-/*---------------------------------------------------------------------------*\
-                           Class polyPatchID Declaration
-\*---------------------------------------------------------------------------*/
-
-class polyPatchID
-{
-    // Private data
-
-        //- Patch name
-        word name_;
-
-        //- Patch index
-        label index_;
-
-
-public:
-
-    // Constructors
-
-        //- Construct from name
-        polyPatchID(const word& name, const polyBoundaryMesh& bm)
-        :
-            name_(name),
-            index_(bm.findPatchID(name))
-        {}
-
-        //- Construct from Istream
-        polyPatchID(Istream& is, const polyBoundaryMesh& bm)
-        :
-            name_(is),
-            index_(bm.findPatchID(name_))
-        {}
-
-
-    // Member Functions
-
-        // Access
-
-            //- Return name
-            const word& name() const
-            {
-                return name_;
-            }
-
-            //- Return index
-            label index() const
-            {
-                return index_;
-            }
-
-            //- Has the patch been found
-            bool active() const
-            {
-                return index_ > -1;
-            }
-
-
-        // Edit
-
-            //- Update
-            void update(const polyBoundaryMesh& bm)
-            {
-                index_ = bm.findPatchID(name_);
-            }
-
-
-    // Ostream Operator
-
-        friend Ostream& operator<<(Ostream& os, const polyPatchID& p)
-        {
-            os  << token::BEGIN_LIST
-                << p.name_ << token::SPACE
-                << p.index_
-                << token::END_LIST;
-
-            // Check state of Ostream
-            os.check("Ostream& operator<<(Ostream&, const polyPatchID&)");
-
-            return os;
-        }
-};
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace Foam
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-#endif
-
-// ************************************************************************* //
diff --git a/src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C b/src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C
index 3b3ad474b77ba1eb0fab86781d7c99418ce8cba0..2be9064526d30bd9820e0efbbedf6621e6196ed1 100644
--- a/src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C
+++ b/src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C
@@ -250,23 +250,27 @@ Foam::labelList Foam::ZoneMesh<ZoneType, MeshType>::findIndices
 ) const
 {
     labelList indices;
-    if (key.isPattern())
-    {
-        indices = findStrings(key, this->names());
-    }
-    else
+
+    if (!key.empty())
     {
-        indices.setSize(this->size());
-        label nFound = 0;
-        forAll(*this, i)
+        if (key.isPattern())
         {
-            if (key == operator[](i).name())
+            indices = findStrings(key, this->names());
+        }
+        else
+        {
+            indices.setSize(this->size());
+            label nFound = 0;
+            forAll(*this, i)
             {
-                indices[nFound++] = i;
+                if (key == operator[](i).name())
+                {
+                    indices[nFound++] = i;
+                }
             }
+            indices.setSize(nFound);
         }
-        indices.setSize(nFound);
-     }
+    }
 
     return indices;
 }
@@ -278,22 +282,26 @@ Foam::label Foam::ZoneMesh<ZoneType, MeshType>::findIndex
     const keyType& key
 ) const
 {
-    if (key.isPattern())
+    if (!key.empty())
     {
-        labelList indices = this->findIndices(key);
-        // return first element
-        if (!indices.empty())
+        if (key.isPattern())
         {
-            return indices[0];
+            labelList indices = this->findIndices(key);
+
+            // return first element
+            if (!indices.empty())
+            {
+                return indices[0];
+            }
         }
-    }
-    else
-    {
-        forAll(*this, i)
+        else
         {
-            if (key == operator[](i).name())
+            forAll(*this, i)
             {
-                return i;
+                if (key == operator[](i).name())
+                {
+                    return i;
+                }
             }
         }
     }
@@ -332,6 +340,24 @@ Foam::label Foam::ZoneMesh<ZoneType, MeshType>::findZoneID
 }
 
 
+template<class ZoneType, class MeshType>
+Foam::PackedBoolList Foam::ZoneMesh<ZoneType, MeshType>::findMatching
+(
+    const keyType& key
+) const
+{
+    PackedBoolList lst;
+
+    const labelList indices = this->findIndices(key);
+    forAll(indices, i)
+    {
+        lst |= static_cast<const labelList&>(this->operator[](indices[i]));
+    }
+
+    return lst;
+}
+
+
 template<class ZoneType, class MeshType>
 void Foam::ZoneMesh<ZoneType, MeshType>::clearAddressing()
 {
diff --git a/src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.H b/src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.H
index 15f715df5c8bc7a91f54cc44c602e5447d140b7d..c825d483da3e9c00faedd704374f1389a34ca78e 100644
--- a/src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.H
+++ b/src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.H
@@ -25,7 +25,7 @@ Class
     Foam::ZoneMesh
 
 Description
-    List of mesh zones
+    A list of mesh zones.
 
 SourceFiles
     ZoneMesh.C
@@ -37,8 +37,9 @@ SourceFiles
 
 #include "List.H"
 #include "regIOobject.H"
-#include "HashSet.H"
 #include "pointFieldsFwd.H"
+#include "Map.H"
+#include "PackedBoolList.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -131,15 +132,18 @@ public:
         //- Return a list of zone names
         wordList names() const;
 
-        //- Find zone index given a name
-        label findZoneID(const word& zoneName) const;
-
         //- Return zone indices for all matches
         labelList findIndices(const keyType&) const;
 
         //- Return zone index for the first match, return -1 if not found
         label findIndex(const keyType&) const;
 
+        //- Find zone index given a name
+        label findZoneID(const word& zoneName) const;
+
+        //- Mark cells that match the zone specification
+        PackedBoolList findMatching(const keyType&) const;
+
         //- Clear addressing
         void clearAddressing();
 
diff --git a/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZone.C b/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZone.C
index 6e76afc1c5367e2ed1ebfce7ad8282a44d0e29b2..2464e980471b713a390d7599c530a0fdc9d19e76 100644
--- a/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZone.C
+++ b/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZone.C
@@ -47,7 +47,7 @@ const char * const Foam::cellZone::labelsName = "cellLabels";
 Foam::cellZone::cellZone
 (
     const word& name,
-    const labelList& addr,
+    const unallocLabelList& addr,
     const label index,
     const cellZoneMesh& zm
 )
@@ -86,7 +86,7 @@ Foam::cellZone::cellZone
 Foam::cellZone::cellZone
 (
     const cellZone& cz,
-    const labelList& addr,
+    const unallocLabelList& addr,
     const label index,
     const cellZoneMesh& zm
 )
@@ -154,7 +154,14 @@ void Foam::cellZone::operator=(const cellZone& zn)
 }
 
 
-void Foam::cellZone::operator=(const labelList& addr)
+void Foam::cellZone::operator=(const unallocLabelList& addr)
+{
+    clearAddressing();
+    labelList::operator=(addr);
+}
+
+
+void Foam::cellZone::operator=(const Xfer<labelList>& addr)
 {
     clearAddressing();
     labelList::operator=(addr);
diff --git a/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZone.H b/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZone.H
index 54b5ba9eb01debfa9c50fade5a3043ebf0066dce..71d686339f4e0fdff9dce627063b9864776c3828 100644
--- a/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZone.H
+++ b/src/OpenFOAM/meshes/polyMesh/zones/cellZone/cellZone.H
@@ -113,7 +113,7 @@ public:
         cellZone
         (
             const word& name,
-            const labelList& addr,
+            const unallocLabelList& addr,
             const label index,
             const cellZoneMesh&
         );
@@ -141,7 +141,7 @@ public:
         cellZone
         (
             const cellZone&,
-            const labelList& addr,
+            const unallocLabelList& addr,
             const label index,
             const cellZoneMesh&
         );
@@ -169,7 +169,7 @@ public:
         //  and zone mesh
         virtual autoPtr<cellZone> clone
         (
-            const labelList& addr,
+            const unallocLabelList& addr,
             const label index,
             const cellZoneMesh& zm
         ) const
@@ -222,11 +222,14 @@ public:
 
     // Member Operators
 
-        //- Assign to zone clearing demand-driven data
+        //- Assign to zone, clearing demand-driven data
         void operator=(const cellZone&);
 
-        //- Assign addressing clearing demand-driven data
-        void operator=(const labelList&);
+        //- Assign addressing, clearing demand-driven data
+        void operator=(const unallocLabelList&);
+
+        //- Assign addressing, clearing demand-driven data
+        void operator=(const Xfer<labelList>&);
 
 
     // I-O
diff --git a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C
index 4bd7874649fdc34400c087048388bedfa8ea0a85..47b61806da80cb5f993262e9bf0e7031908d2f4c 100644
--- a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C
+++ b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C
@@ -180,7 +180,7 @@ void Foam::faceZone::checkAddressing() const
 Foam::faceZone::faceZone
 (
     const word& name,
-    const labelList& addr,
+    const unallocLabelList& addr,
     const boolList& fm,
     const label index,
     const faceZoneMesh& zm
@@ -242,7 +242,7 @@ Foam::faceZone::faceZone
 Foam::faceZone::faceZone
 (
     const faceZone& fz,
-    const labelList& addr,
+    const unallocLabelList& addr,
     const boolList& fm,
     const label index,
     const faceZoneMesh& zm
@@ -392,7 +392,7 @@ void Foam::faceZone::clearAddressing()
 
 void Foam::faceZone::resetAddressing
 (
-    const labelList& addr,
+    const unallocLabelList& addr,
     const boolList& flipMap
 )
 {
@@ -414,7 +414,7 @@ void Foam::faceZone::updateMesh(const mapPolyMesh& mpm)
 
     forAll(*this, i)
     {
-        label faceI = operator[](i);
+        const label faceI = operator[](i);
 
         if (faceMap[faceI] >= 0)
         {
@@ -454,7 +454,7 @@ bool Foam::faceZone::checkParallelSync(const bool report) const
         boolList neiZoneFlip(mesh.nFaces()-mesh.nInternalFaces(), false);
         forAll(*this, i)
         {
-            label faceI = operator[](i);
+            const label faceI = operator[](i);
 
             if (!mesh.isInternalFace(faceI))
             {
@@ -469,13 +469,12 @@ bool Foam::faceZone::checkParallelSync(const bool report) const
 
         forAll(*this, i)
         {
-            label faceI = operator[](i);
-
-            label patchI = bm.whichPatch(faceI);
+            const label faceI = operator[](i);
+            const label patchI = bm.whichPatch(faceI);
 
             if (patchI != -1 && bm[patchI].coupled())
             {
-                label bFaceI = faceI-mesh.nInternalFaces();
+                const label bFaceI = faceI-mesh.nInternalFaces();
 
                 // Check face in zone on both sides
                 if (myZoneFace[bFaceI] != neiZoneFace[bFaceI])
diff --git a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.H b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.H
index b8d617232d490f95128c0a2f94b65485bbf0470d..19c6cf7ab1adab9996a0d0ffa96be7d3dc54e2bc 100644
--- a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.H
+++ b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.H
@@ -154,7 +154,7 @@ public:
         faceZone
         (
             const word& name,
-            const labelList& addr,
+            const unallocLabelList& addr,
             const boolList& fm,
             const label index,
             const faceZoneMesh& zm
@@ -184,7 +184,7 @@ public:
         faceZone
         (
             const faceZone&,
-            const labelList& addr,
+            const unallocLabelList& addr,
             const boolList& fm,
             const label index,
             const faceZoneMesh&
@@ -214,7 +214,7 @@ public:
         //  and zone mesh
         virtual autoPtr<faceZone> clone
         (
-            const labelList& addr,
+            const unallocLabelList& addr,
             const boolList& fm,
             const label index,
             const faceZoneMesh& zm
@@ -279,7 +279,7 @@ public:
         virtual void clearAddressing();
 
         //- Reset addressing and flip map (clearing demand-driven data)
-        virtual void resetAddressing(const labelList&, const boolList&);
+        virtual void resetAddressing(const unallocLabelList&, const boolList&);
 
         //- Check zone definition. Return true if in error.
         virtual bool checkDefinition(const bool report = false) const;
diff --git a/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZone.C b/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZone.C
index a37a786ae2b9c52f85e6460c8e7cfea440e170b0..071387bd8ddcf232ec874e6660f1cee4c1eac9c6 100644
--- a/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZone.C
+++ b/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZone.C
@@ -47,7 +47,7 @@ const char* const Foam::pointZone::labelsName = "pointLabels";
 Foam::pointZone::pointZone
 (
     const word& name,
-    const labelList& addr,
+    const unallocLabelList& addr,
     const label index,
     const pointZoneMesh& zm
 )
@@ -86,7 +86,7 @@ Foam::pointZone::pointZone
 Foam::pointZone::pointZone
 (
     const pointZone& pz,
-    const labelList& addr,
+    const unallocLabelList& addr,
     const label index,
     const pointZoneMesh& zm
 )
@@ -198,7 +198,14 @@ void Foam::pointZone::operator=(const pointZone& zn)
 }
 
 
-void Foam::pointZone::operator=(const labelList& addr)
+void Foam::pointZone::operator=(const unallocLabelList& addr)
+{
+    clearAddressing();
+    labelList::operator=(addr);
+}
+
+
+void Foam::pointZone::operator=(const Xfer<labelList>& addr)
 {
     clearAddressing();
     labelList::operator=(addr);
diff --git a/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZone.H b/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZone.H
index 22079a9407cf46706fc59a36640c1e5a7e6d5c9c..858dae3a95cf31fdb61491c5b711d67e0cafcfdf 100644
--- a/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZone.H
+++ b/src/OpenFOAM/meshes/polyMesh/zones/pointZone/pointZone.H
@@ -112,7 +112,7 @@ public:
         pointZone
         (
             const word& name,
-            const labelList& addr,
+            const unallocLabelList& addr,
             const label index,
             const pointZoneMesh&
         );
@@ -140,7 +140,7 @@ public:
         pointZone
         (
             const pointZone&,
-            const labelList& addr,
+            const unallocLabelList& addr,
             const label index,
             const pointZoneMesh&
         );
@@ -170,7 +170,7 @@ public:
         (
             const pointZoneMesh& zm,
             const label index,
-            const labelList& addr
+            const unallocLabelList& addr
         ) const
         {
             return autoPtr<pointZone>
@@ -222,11 +222,14 @@ public:
 
     // Member Operators
 
-        //- Assign to zone clearing demand-driven data
+        //- Assign to zone, clearing demand-driven data
         void operator=(const pointZone&);
 
-        //- Assign addressing clearing demand-driven data
-        void operator=(const labelList&);
+        //- Assign addressing, clearing demand-driven data
+        void operator=(const unallocLabelList&);
+
+        //- Assign addressing, clearing demand-driven data
+        void operator=(const Xfer<labelList>&);
 
 
     // I-O
diff --git a/src/OpenFOAM/meshes/polyMesh/zones/zone/zone.C b/src/OpenFOAM/meshes/polyMesh/zones/zone/zone.C
index b97e28c937f3778272908cc0489f379d5cc93e1c..31af839b084d28ec77fa1011b42f01bc74a3328a 100644
--- a/src/OpenFOAM/meshes/polyMesh/zones/zone/zone.C
+++ b/src/OpenFOAM/meshes/polyMesh/zones/zone/zone.C
@@ -85,7 +85,7 @@ void Foam::zone::calcLookupMap() const
 Foam::zone::zone
 (
     const word& name,
-    const labelList& addr,
+    const unallocLabelList& addr,
     const label index
 )
 :
@@ -128,7 +128,7 @@ Foam::zone::zone
 Foam::zone::zone
 (
     const zone& z,
-    const labelList& addr,
+    const unallocLabelList& addr,
     const label index
 )
 :
diff --git a/src/OpenFOAM/meshes/polyMesh/zones/zone/zone.H b/src/OpenFOAM/meshes/polyMesh/zones/zone/zone.H
index 9bec4b6cdb8f8aefb00bb971b24c6ed26966466f..e7f3a920b15053a702e38ba7b244661a3dedea7c 100644
--- a/src/OpenFOAM/meshes/polyMesh/zones/zone/zone.H
+++ b/src/OpenFOAM/meshes/polyMesh/zones/zone/zone.H
@@ -101,7 +101,7 @@ public:
         zone
         (
             const word& name,
-            const labelList& addr,
+            const unallocLabelList& addr,
             const label index
         );
 
@@ -127,7 +127,7 @@ public:
         zone
         (
             const zone&,
-            const labelList& addr,
+            const unallocLabelList& addr,
             const label index
         );
 
diff --git a/src/meshTools/octree/PointIndexHit.H b/src/OpenFOAM/meshes/primitiveShapes/objectHit/PointIndexHit.H
similarity index 100%
rename from src/meshTools/octree/PointIndexHit.H
rename to src/OpenFOAM/meshes/primitiveShapes/objectHit/PointIndexHit.H
diff --git a/src/meshTools/octree/pointHitSort.H b/src/OpenFOAM/meshes/primitiveShapes/objectHit/pointHitSort.H
similarity index 100%
rename from src/meshTools/octree/pointHitSort.H
rename to src/OpenFOAM/meshes/primitiveShapes/objectHit/pointHitSort.H
diff --git a/src/meshTools/octree/pointIndexHit.H b/src/OpenFOAM/meshes/primitiveShapes/objectHit/pointIndexHit.H
similarity index 100%
rename from src/meshTools/octree/pointIndexHit.H
rename to src/OpenFOAM/meshes/primitiveShapes/objectHit/pointIndexHit.H
diff --git a/src/meshTools/octree/pointIndexHitIOList.C b/src/OpenFOAM/meshes/primitiveShapes/objectHit/pointIndexHitIOList.C
similarity index 100%
rename from src/meshTools/octree/pointIndexHitIOList.C
rename to src/OpenFOAM/meshes/primitiveShapes/objectHit/pointIndexHitIOList.C
diff --git a/src/meshTools/octree/pointIndexHitIOList.H b/src/OpenFOAM/meshes/primitiveShapes/objectHit/pointIndexHitIOList.H
similarity index 100%
rename from src/meshTools/octree/pointIndexHitIOList.H
rename to src/OpenFOAM/meshes/primitiveShapes/objectHit/pointIndexHitIOList.H
diff --git a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangle.H b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangle.H
index 64d9318306fa0322ac3626fccf89bc5f46cc8be6..abb5d7d8e426ea94438536986ff92d9c731e3be0 100644
--- a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangle.H
+++ b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangle.H
@@ -79,21 +79,6 @@ class triangle
 
         PointRef a_, b_, c_;
 
-    // Private Member Functions
-
-        //- Fast distance to triangle calculation. From
-        //  "Distance Between Point and Trangle in 3D"
-        //  David Eberly, Magic Software Inc. Aug. 2002.
-        //  Works on function Q giving distance to point and tries to
-        //  minimize this.
-        static pointHit nearestPoint
-        (
-            const Point& baseVertex,
-            const vector& E0,
-            const vector& E1,
-            const point& P
-        );
-
 
 public:
 
@@ -202,24 +187,27 @@ public:
                 const scalar tol = 0.0
             ) const;
 
-            //- Return nearest point to p on triangle
-            inline pointHit nearestPoint
+            //- Find the nearest point to p on the triangle and classify it:
+            //  + near point (nearType=POINT, nearLabel=0, 1, 2)
+            //  + near edge (nearType=EDGE, nearLabel=0, 1, 2)
+            //    Note: edges are counted from starting
+            //    vertex so e.g. edge 2 is from f[2] to f[0]
+            pointHit nearestPointClassify
             (
-                const point& p
+                const point& p,
+                label& nearType,
+                label& nearLabel
             ) const;
 
-            //- Classify point in triangle plane w.r.t. triangle edges.
-            //  - inside (true returned)/outside (false returned)
-            //  - near point (nearType=POINT, nearLabel=0, 1, 2)
-            //  - near edge (nearType=EDGE, nearLabel=0, 1, 2)
-            //    Note: edges are counted from starting
-            //    vertex so e.g. edge 2 is from f[2] to f[0]
-            //  tol is fraction to account for truncation error. Is only used
-            //  when comparing normalized (0..1) numbers.
+            //- Return nearest point to p on triangle
+            inline pointHit nearestPoint(const point& p) const;
+
+            //- Classify nearest point to p in triangle plane
+            //  w.r.t. triangle edges and points.  Returns inside
+            //  (true)/outside (false).
             bool classify
             (
                 const point& p,
-                const scalar tol,
                 label& nearType,
                 label& nearLabel
             ) const;
diff --git a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H
index 10267a923f720824e5f50a7606f31ae62089fb07..7840d8ee7b4762c7e69c08b5238cb536a486a5a4 100644
--- a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H
+++ b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H
@@ -32,158 +32,6 @@ License
 namespace Foam
 {
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
-
-template<class Point, class PointRef>
-pointHit triangle<Point, PointRef>::nearestPoint
-(
-    const Point& baseVertex,
-    const vector& E0,
-    const vector& E1,
-    const point& P
-)
-{
-    // Distance vector
-    const vector D(baseVertex - P);
-
-    // Some geometrical factors
-    const scalar a = E0 & E0;
-    const scalar b = E0 & E1;
-    const scalar c = E1 & E1;
-
-    // Precalculate distance factors
-    const scalar d = E0 & D;
-    const scalar e = E1 & D;
-    const scalar f = D & D;
-
-    // Do classification
-    const scalar det = a*c - b*b;
-    scalar s = b*e - c*d;
-    scalar t = b*d - a*e;
-
-    bool inside = false;
-
-    if (s+t < det)
-    {
-        if (s < 0)
-        {
-            if (t < 0)
-            {
-                // Region 4
-                if (e > 0)
-                {
-                    // min on edge t = 0
-                    t = 0;
-                    s = (d >= 0 ? 0 : (-d >= a ? 1 : -d/a));
-                }
-                else
-                {
-                    // min on edge s=0
-                    s = 0;
-                    t = (e >= 0 ? 0 : (-e >= c ? 1 : -e/c));
-                }
-            }
-            else
-            {
-                // Region 3. Min on edge s = 0
-                s = 0;
-                t = (e >= 0 ? 0 : (-e >= c ? 1 : -e/c));
-            }
-        }
-        else if (t < 0)
-        {
-            // Region 5
-            t = 0;
-            s = (d >= 0 ? 0 : (-d >= a ? 1 : -d/a));
-        }
-        else
-        {
-            // Region 0
-            const scalar invDet = 1/det;
-            s *= invDet;
-            t *= invDet;
-
-            inside = true;
-        }
-    }
-    else
-    {
-        if (s < 0)
-        {
-            // Region 2
-            const scalar tmp0 = b + d;
-            const scalar tmp1 = c + e;
-            if (tmp1 > tmp0)
-            {
-                // min on edge s+t=1
-                const scalar numer = tmp1 - tmp0;
-                const scalar denom = a-2*b+c;
-                s = (numer >= denom ? 1 : numer/denom);
-                t = 1 - s;
-            }
-            else
-            {
-                // min on edge s=0
-                s = 0;
-                t = (tmp1 <= 0 ? 1 : (e >= 0 ? 0 : - e/c));
-            }
-        }
-        else if (t < 0)
-        {
-            // Region 6
-            const scalar tmp0 = b + d;
-            const scalar tmp1 = c + e;
-            if (tmp1 > tmp0)
-            {
-                // min on edge s+t=1
-                const scalar numer = tmp1 - tmp0;
-                const scalar denom = a-2*b+c;
-                s = (numer >= denom ? 1 : numer/denom);
-                t = 1 - s;
-            }
-            else
-            {
-                // min on edge t=0
-                t = 0;
-                s = (tmp1 <= 0 ? 1 : (d >= 0 ? 0 : - d/a));
-            }
-        }
-        else
-        {
-            // Region 1
-            const scalar numer = c+e-(b+d);
-            if (numer <= 0)
-            {
-                s = 0;
-            }
-            else
-            {
-                const scalar denom = a-2*b+c;
-                s = (numer >= denom ? 1 : numer/denom);
-            }
-        }
-
-        t = 1 - s;
-    }
-
-    // Calculate distance.
-    // Note: Foam::mag used since truncation error causes negative distances
-    // with points very close to one of the triangle vertices.
-    // (Up to -2.77556e-14 seen). Could use +SMALL but that not large enough.
-
-    return pointHit
-    (
-        inside,
-        baseVertex + s*E0 + t*E1,
-        Foam::sqrt
-        (
-            Foam::mag(a*s*s + 2*b*s*t + c*t*t + 2*d*s + 2*e*t + f)
-        ),
-        !inside
-    );
-}
-
-
 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
 
 template<class Point, class PointRef>
@@ -247,7 +95,7 @@ inline Point triangle<Point, PointRef>::centre() const
 template<class Point, class PointRef>
 inline scalar triangle<Point, PointRef>::mag() const
 {
-    return ::Foam::mag(normal());
+    return Foam::mag(normal());
 }
 
 
@@ -536,7 +384,7 @@ inline pointHit triangle<Point, PointRef>::ray
         inter.setMiss(eligible);
 
         // The miss point is the nearest point on the triangle
-        inter.setPoint(nearestPoint(a_, E0, E1, p).rawPoint());
+        inter.setPoint(nearestPoint(p).rawPoint());
 
         // The distance to the miss is the distance between the
         // original point and plane of intersection
@@ -634,177 +482,143 @@ inline pointHit triangle<Point, PointRef>::intersection
 
 
 template<class Point, class PointRef>
-inline pointHit triangle<Point, PointRef>::nearestPoint
-(
-    const point& p
-) const
-{
-    // Express triangle in terms of baseVertex (point a_) and
-    // two edge vectors
-    vector E0 = b_ - a_;
-    vector E1 = c_ - a_;
-
-    return nearestPoint(a_, E0, E1, p);
-}
-
-
-template<class Point, class PointRef>
-inline bool triangle<Point, PointRef>::classify
+pointHit triangle<Point, PointRef>::nearestPointClassify
 (
     const point& p,
-    const scalar tol,
     label& nearType,
     label& nearLabel
 ) const
 {
-    const vector E0 = b_ - a_;
-    const vector E1 = c_ - a_;
-    const vector n = 0.5*(E0 ^ E1);
-
-    // Get largest component of normal
-    scalar magX = Foam::mag(n.x());
-    scalar magY = Foam::mag(n.y());
-    scalar magZ = Foam::mag(n.z());
-
-    label i0 = -1;
-    if ((magX >= magY) && (magX >= magZ))
-    {
-        i0 = 0;
-    }
-    else if ((magY >= magX) && (magY >= magZ))
-    {
-        i0 = 1;
-    }
-    else
-    {
-        i0 = 2;
-    }
+    // Adapted from:
+    // Real-time collision detection, Christer Ericson, 2005, 136-142
 
-    // Get other components
-    label i1 = (i0 + 1) % 3;
-    label i2 = (i1 + 1) % 3;
+    // Check if P in vertex region outside A
+    vector ab = b_ - a_;
+    vector ac = c_ - a_;
+    vector ap = p - a_;
 
+    scalar d1 = ab & ap;
+    scalar d2 = ac & ap;
 
-    scalar u1 = E0[i1];
-    scalar v1 = E0[i2];
+    if (d1 <= 0.0 && d2 <= 0.0)
+    {
+        // barycentric coordinates (1, 0, 0)
 
-    scalar u2 = E1[i1];
-    scalar v2 = E1[i2];
+        nearType = POINT;
+        nearLabel = 0;
+        return pointHit(false, a_, Foam::mag(a_ - p), true);
+    }
 
-    scalar det = v2*u1 - u2*v1;
+    // Check if P in vertex region outside B
+    vector bp = p - b_;
+    scalar d3 = ab & bp;
+    scalar d4 = ac & bp;
 
-    scalar u0 = p[i1] - a_[i1];
-    scalar v0 = p[i2] - a_[i2];
+    if (d3 >= 0.0 && d4 <= d3)
+    {
+        // barycentric coordinates (0, 1, 0)
 
-    scalar alpha = 0;
-    scalar beta = 0;
+        nearType = POINT;
+        nearLabel = 1;
+        return pointHit(false, b_, Foam::mag(b_ - p), true);
+    }
 
-    bool hit = false;
+    // Check if P in edge region of AB, if so return projection of P onto AB
+    scalar vc = d1*d4 - d3*d2;
 
-    if (Foam::mag(u1) < ROOTVSMALL)
+    if (vc <= 0.0 && d1 >= 0.0 && d3 <= 0.0)
     {
-        beta = u0/u2;
-
-        alpha = (v0 - beta*v2)/v1;
+        // barycentric coordinates (1-v, v, 0)
+        scalar v = d1/(d1 - d3);
 
-        hit = ((alpha >= 0) && ((alpha + beta) <= 1));
+        point nearPt =  a_ + v*ab;
+        nearType = EDGE;
+        nearLabel = 0;
+        return pointHit(false, nearPt, Foam::mag(nearPt - p), true);
     }
-    else
-    {
-        beta = (v0*u1 - u0*v1)/det;
 
-        alpha = (u0 - beta*u2)/u1;
+    // Check if P in vertex region outside C
+    vector cp = p - c_;
+    scalar d5 = ab & cp;
+    scalar d6 = ac & cp;
 
-        hit = ((alpha >= 0) && ((alpha + beta) <= 1));
-    }
+    if (d6 >= 0.0 && d5 <= d6)
+    {
+        // barycentric coordinates (0, 0, 1)
 
-    //
-    // Now alpha, beta are the coordinates in the triangle local coordinate
-    // system E0, E1
-    //
+        nearType = POINT;
+        nearLabel = 2;
+        return pointHit(false, c_, Foam::mag(c_ - p), true);
+    }
 
-    //Pout<< "alpha:" << alpha << endl;
-    //Pout<< "beta:" << beta << endl;
-    //Pout<< "hit:" << hit << endl;
-    //Pout<< "tol:" << tol << endl;
+    // Check if P in edge region of AC, if so return projection of P onto AC
+    scalar vb = d5*d2 - d1*d6;
 
-    if (hit)
+    if (vb <= 0.0 && d2 >= 0.0 && d6 <= 0.0)
     {
-        // alpha,beta might get negative due to precision errors
-        alpha = max(0.0, min(1.0, alpha));
-        beta = max(0.0, min(1.0, beta));
+        // barycentric coordinates (1-w, 0, w)
+        scalar w = d2/(d2 - d6);
+
+        point nearPt = a_ + w*ac;
+        nearType = EDGE;
+        nearLabel = 2;
+        return pointHit(false, nearPt, Foam::mag(nearPt - p), true);
     }
 
-    nearType = NONE;
-    nearLabel = -1;
+    // Check if P in edge region of BC, if so return projection of P onto BC
+    scalar va = d3*d6 - d5*d4;
 
-    if (Foam::mag(alpha+beta-1) <= tol)
+    if (va <= 0.0 && (d4 - d3) >= 0.0 && (d5 - d6) >= 0.0)
     {
-        // On edge between vert 1-2 (=edge 1)
+        // barycentric coordinates (0, 1-w, w)
+        scalar w = (d4 - d3)/((d4 - d3) + (d5 - d6));
 
-        if (Foam::mag(alpha) <= tol)
-        {
-            nearType = POINT;
-            nearLabel = 2;
-        }
-        else if (Foam::mag(beta) <= tol)
-        {
-            nearType = POINT;
-            nearLabel = 1;
-        }
-        else if ((alpha >= 0) && (alpha <= 1) && (beta >= 0) && (beta <= 1))
-        {
-            nearType = EDGE;
-            nearLabel = 1;
-        }
+        point nearPt = b_ + w*(c_ - b_);
+        nearType = EDGE;
+        nearLabel = 1;
+        return pointHit(false, nearPt, Foam::mag(nearPt - p), true);
     }
-    else if (Foam::mag(alpha) <= tol)
-    {
-        // On edge between vert 2-0 (=edge 2)
 
-        if (Foam::mag(beta) <= tol)
-        {
-            nearType = POINT;
-            nearLabel = 0;
-        }
-        else if (Foam::mag(beta-1) <= tol)
-        {
-            nearType = POINT;
-            nearLabel = 2;
-        }
-        else if ((beta >= 0) && (beta <= 1))
-        {
-            nearType = EDGE;
-            nearLabel = 2;
-        }
-    }
-    else if (Foam::mag(beta) <= tol)
-    {
-        // On edge between vert 0-1 (= edge 0)
+    // P inside face region. Compute Q through its barycentric
+    // coordinates (u, v, w)
+    scalar denom = 1.0/(va + vb + vc);
+    scalar v = vb * denom;
+    scalar w = vc * denom;
 
-        if (Foam::mag(alpha) <= tol)
-        {
-            nearType = POINT;
-            nearLabel = 0;
-        }
-        else if (Foam::mag(alpha-1) <= tol)
-        {
-            nearType = POINT;
-            nearLabel = 1;
-        }
-        else if ((alpha >= 0) && (alpha <= 1))
-        {
-            nearType = EDGE;
-            nearLabel = 0;
-        }
-    }
+    // = u*a + v*b + w*c, u = va*denom = 1.0 - v - w
 
-    return hit;
+    point nearPt = a_ + ab*v + ac*w;
+    nearType = NONE,
+    nearLabel = -1;
+    return pointHit(true, nearPt, Foam::mag(nearPt - p), false);
 }
 
 
+template<class Point, class PointRef>
+inline pointHit triangle<Point, PointRef>::nearestPoint
+(
+    const point& p
+) const
+{
+    // Dummy labels
+    label nearType = -1;
+    label nearLabel = -1;
+
+    return nearestPointClassify(p, nearType, nearLabel);
+}
 
 
+template<class Point, class PointRef>
+inline bool triangle<Point, PointRef>::classify
+(
+    const point& p,
+    label& nearType,
+    label& nearLabel
+) const
+{
+    return nearestPointClassify(p, nearType, nearLabel).hit();
+}
+
 
 // * * * * * * * * * * * * * * * Ostream Operator  * * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/primitives/Lists/labelListIOList.C b/src/OpenFOAM/primitives/Lists/labelListIOList.C
index 72ebc515880d970657d6cbda3e41061697eb1bfb..0e131a3b0a9d9eab7df8e5479e6d391a0e73d64e 100644
--- a/src/OpenFOAM/primitives/Lists/labelListIOList.C
+++ b/src/OpenFOAM/primitives/Lists/labelListIOList.C
@@ -21,10 +21,6 @@ License
     You should have received a copy of the GNU General Public License
     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 
-Description
-    Declaration of IOList and IOListList ClassNames for IOListLists that
-    do not have .C files.
-
 \*---------------------------------------------------------------------------*/
 
 #include "labelListIOList.H"
@@ -38,8 +34,8 @@ namespace Foam
 
     defineTemplateTypeNameAndDebugWithName
     (
-        labelIOListList,
-        "labelCompactListList",
+        labelListCompactIOList,
+        "labelListCompactList",
         0
     );
 }
diff --git a/src/OpenFOAM/primitives/Lists/labelListIOList.H b/src/OpenFOAM/primitives/Lists/labelListIOList.H
index aebd4fc4aa8588487b7f34f0ee61434f1e1dc966..90cd61e2380393d3622153a23d54a47d0c660963 100644
--- a/src/OpenFOAM/primitives/Lists/labelListIOList.H
+++ b/src/OpenFOAM/primitives/Lists/labelListIOList.H
@@ -33,15 +33,14 @@ Description
 #define labelListIOList_H
 
 #include "labelList.H"
-#include "IOList.H"
-#include "IOListList.H"
+#include "CompactIOList.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 namespace Foam
 {
     typedef IOList<labelList> labelListIOList;
-    typedef IOListList<labelList, label> labelIOListList;
+    typedef CompactIOList<labelList, label> labelListCompactIOList;
 }
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/primitives/Lists/scalarListIOList.C b/src/OpenFOAM/primitives/Lists/scalarListIOList.C
index effb61127e105df56845ebfbf0ed6b1132f53711..84df4520cc1fc20abe4b08dd8277effe12b10958 100644
--- a/src/OpenFOAM/primitives/Lists/scalarListIOList.C
+++ b/src/OpenFOAM/primitives/Lists/scalarListIOList.C
@@ -21,10 +21,6 @@ License
     You should have received a copy of the GNU General Public License
     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 
-Description
-    Declaration of IOList and IOListList ClassNames for IOListLists that
-    do not have .C files.
-
 \*---------------------------------------------------------------------------*/
 
 #include "scalarListIOList.H"
@@ -43,8 +39,8 @@ namespace Foam
 
     defineTemplateTypeNameAndDebugWithName
     (
-        scalarIOListList,
-        "scalarCompactListList",
+        scalarListCompactIOList,
+        "scalarListCompactList",
         0
     );
 }
diff --git a/src/OpenFOAM/primitives/Lists/scalarListIOList.H b/src/OpenFOAM/primitives/Lists/scalarListIOList.H
index 24dc8e13fb9a40bc3d191f6f42d67f48e3738c45..99e2fdf69aaec37100368c9e5fa8d0335c7b8b1b 100644
--- a/src/OpenFOAM/primitives/Lists/scalarListIOList.H
+++ b/src/OpenFOAM/primitives/Lists/scalarListIOList.H
@@ -33,15 +33,14 @@ Description
 #define scalarListIOList_H
 
 #include "scalarList.H"
-#include "IOList.H"
-#include "IOListList.H"
+#include "CompactIOList.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 namespace Foam
 {
     typedef IOList<scalarList> scalarListIOList;
-    typedef IOListList<scalarList, scalar> scalarIOListList;
+    typedef CompactIOList<scalarList, scalar> scalarListCompactIOList;
 }
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/primitives/Lists/vectorListIOList.C b/src/OpenFOAM/primitives/Lists/vectorListIOList.C
index 661f729410af333eefe7c5a13e790075d7c8dfbf..fa73bde4d58e426c9fb8cf3cdaea38b23568dc50 100644
--- a/src/OpenFOAM/primitives/Lists/vectorListIOList.C
+++ b/src/OpenFOAM/primitives/Lists/vectorListIOList.C
@@ -21,10 +21,6 @@ License
     You should have received a copy of the GNU General Public License
     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 
-Description
-    Declaration of IOList and IOListList ClassNames for IOListLists that
-    do not have .C files.
-
 \*---------------------------------------------------------------------------*/
 
 #include "vectorListIOList.H"
@@ -43,8 +39,8 @@ namespace Foam
 
     defineTemplateTypeNameAndDebugWithName
     (
-        vectorIOListList,
-        "vectorCompactListList",
+        vectorListCompactIOList,
+        "vectorListCompactList",
         0
     );
 }
diff --git a/src/OpenFOAM/primitives/Lists/vectorListIOList.H b/src/OpenFOAM/primitives/Lists/vectorListIOList.H
index 53acf8afb01e3b71925f50baa71ec1a7da07e2a9..299882f5b558f88b52f75879956144ceac3e3274 100644
--- a/src/OpenFOAM/primitives/Lists/vectorListIOList.H
+++ b/src/OpenFOAM/primitives/Lists/vectorListIOList.H
@@ -25,7 +25,7 @@ Typedef
     Foam::vectorListIOList
 
 Description
-    Scalar container classes
+    Lists of vectors container class
 
 \*---------------------------------------------------------------------------*/
 
@@ -33,15 +33,14 @@ Description
 #define vectorListIOList_H
 
 #include "vectorList.H"
-#include "IOList.H"
-#include "IOListList.H"
+#include "CompactIOList.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 namespace Foam
 {
     typedef IOList<vectorList> vectorListIOList;
-    typedef IOListList<vectorList, vector> vectorIOListList;
+    typedef CompactIOList<vectorList, vector> vectorListCompactIOList;
 }
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/primitives/bools/Switch/Switch.C b/src/OpenFOAM/primitives/bools/Switch/Switch.C
index 0b87ca6e2764648ded5bc6113dde8fc88f9687cc..3a227f99b4a42fd69466a8d73e795ebb1bc7466c 100644
--- a/src/OpenFOAM/primitives/bools/Switch/Switch.C
+++ b/src/OpenFOAM/primitives/bools/Switch/Switch.C
@@ -37,6 +37,7 @@ const char* Foam::Switch::names[Foam::Switch::INVALID+1] =
     "off",   "on",
     "no",    "yes",
     "n",     "y",
+    "f",     "t",
     "none",  "true",  // is there a reasonable counterpart to "none"?
     "invalid"
 };
@@ -54,18 +55,39 @@ Foam::Switch::switchType Foam::Switch::asEnum
     {
         if (str == names[sw])
         {
-            // convert n/y to no/yes - perhaps should deprecate y/n
-            if (sw == Switch::NO_1 || sw == Switch::NONE)
+            // handle aliases
+            switch (sw)
             {
-                return Switch::NO;
-            }
-            else if (sw == Switch::YES_1)
-            {
-                return Switch::YES;
-            }
-            else
-            {
-                return switchType(sw);
+                case Switch::NO_1:
+                case Switch::NONE:
+                {
+                    return Switch::NO;
+                    break;
+                }
+
+                case Switch::YES_1:
+                {
+                    return Switch::YES;
+                    break;
+                }
+
+                case Switch::FALSE_1:
+                {
+                    return Switch::FALSE;
+                    break;
+                }
+
+                case Switch::TRUE_1:
+                {
+                    return Switch::TRUE;
+                    break;
+                }
+
+                default:
+                {
+                    return switchType(sw);
+                    break;
+                }
             }
         }
     }
diff --git a/src/OpenFOAM/primitives/bools/Switch/Switch.H b/src/OpenFOAM/primitives/bools/Switch/Switch.H
index e68be1a2de8db66503617be0dcc6d2308dfcf3af..027d313a0aa68258c728359a1907e0863bb7e2fd 100644
--- a/src/OpenFOAM/primitives/bools/Switch/Switch.H
+++ b/src/OpenFOAM/primitives/bools/Switch/Switch.H
@@ -26,7 +26,7 @@ Class
 
 Description
     A simple wrapper around bool so that it can be read as a word:
-    true/false, on/off, yes/no or y/n or none.
+    true/false, on/off, yes/no, y/n, t/f, or none.
 
 SourceFiles
     Switch.C
@@ -78,6 +78,8 @@ public:
         #undef YES
         #undef NO_1
         #undef YES_1
+        #undef FALSE_1
+        #undef TRUE_1
         #undef NONE
         #undef PLACEHOLDER
         #undef INVALID
@@ -86,11 +88,12 @@ public:
         //  These also correspond to the entries in names.
         enum switchType
         {
-            FALSE = 0,  TRUE  = 1,
-            OFF   = 2,  ON    = 3,
-            NO    = 4,  YES   = 5,
-            NO_1  = 6,  YES_1 = 7,
-            NONE  = 8,  PLACEHOLDER = 9,
+            FALSE   = 0,  TRUE   = 1,
+            OFF     = 2,  ON     = 3,
+            NO      = 4,  YES    = 5,
+            NO_1    = 6,  YES_1  = 7,
+            FALSE_1 = 8,  TRUE_1 = 9,
+            NONE    = 10, PLACEHOLDER = 11,
             INVALID
         };
 
diff --git a/src/OpenFOAM/primitives/strings/fileName/fileName.H b/src/OpenFOAM/primitives/strings/fileName/fileName.H
index dce6d6a90730e871073990a75a4ad782ed507642..8eae249c52ceba16c67bbf61481ac52332aeb3aa 100644
--- a/src/OpenFOAM/primitives/strings/fileName/fileName.H
+++ b/src/OpenFOAM/primitives/strings/fileName/fileName.H
@@ -93,6 +93,8 @@ public:
 
         static const char* const typeName;
         static int debug;
+
+        //- An empty fileName
         static const fileName null;
 
 
diff --git a/src/OpenFOAM/primitives/strings/keyType/keyTypeIO.C b/src/OpenFOAM/primitives/strings/keyType/keyType.C
similarity index 67%
rename from src/OpenFOAM/primitives/strings/keyType/keyTypeIO.C
rename to src/OpenFOAM/primitives/strings/keyType/keyType.C
index 9ba61ee510db713dd77080e3e24655cbe0cf361e..5f8c6956b748e117c08d7ac10fc372365bb606b2 100644
--- a/src/OpenFOAM/primitives/strings/keyType/keyTypeIO.C
+++ b/src/OpenFOAM/primitives/strings/keyType/keyType.C
@@ -22,24 +22,54 @@ License
     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 
 Description
-    Istream constructor and IOstream operators for word.
+    Istream constructor and IOstream operators for keyType.
 
 \*---------------------------------------------------------------------------*/
 
 #include "keyType.H"
+#include "regExp.H"
 #include "IOstreams.H"
 
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+const Foam::keyType Foam::keyType::null;
+
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
 Foam::keyType::keyType(Istream& is)
 :
-    word()
+    word(),
+    isPattern_(false)
+{
+    is  >> *this;
+}
+
+
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
+
+bool Foam::keyType::match
+(
+    const std::string& str,
+    bool literalMatch
+) const
 {
-    is >> *this;
+    if (literalMatch || !isPattern_)
+    {
+        // check as string
+        return (str == *this);
+    }
+    else
+    {
+        // check as regex
+        return regExp(*this).match(str);
+    }
 }
 
 
-Foam::Istream& Foam::operator>>(Istream& is, keyType& w)
+// * * * * * * * * * * * * * * * IOstream Operators  * * * * * * * * * * * * //
+
+Foam::Istream& Foam::operator>>(Istream& is, keyType& kw)
 {
     token t(is);
 
@@ -51,15 +81,16 @@ Foam::Istream& Foam::operator>>(Istream& is, keyType& w)
 
     if (t.isWord())
     {
-        w = t.wordToken();
+        kw = t.wordToken();
     }
     else if (t.isString())
     {
-        // Assign from string. Sets regular expression.
-        w = t.stringToken();
+        // Assign from string. Set as regular expression.
+        kw = t.stringToken();
+        kw.isPattern_ = true;
 
         // flag empty strings as an error
-        if (w.empty())
+        if (kw.empty())
         {
             is.setBad();
             FatalIOErrorIn("operator>>(Istream&, keyType&)", is)
@@ -86,9 +117,9 @@ Foam::Istream& Foam::operator>>(Istream& is, keyType& w)
 }
 
 
-Foam::Ostream& Foam::operator<<(Ostream& os, const keyType& w)
+Foam::Ostream& Foam::operator<<(Ostream& os, const keyType& kw)
 {
-    os.write(w);
+    os.write(kw);
     os.check("Ostream& operator<<(Ostream&, const keyType&)");
     return os;
 }
diff --git a/src/OpenFOAM/primitives/strings/keyType/keyType.H b/src/OpenFOAM/primitives/strings/keyType/keyType.H
index 8cf22f9473b8832be0d4397a926b22ae2c14262c..964044150fcaf45c81c125118b1f6e35463f5c0f 100644
--- a/src/OpenFOAM/primitives/strings/keyType/keyType.H
+++ b/src/OpenFOAM/primitives/strings/keyType/keyType.H
@@ -32,7 +32,6 @@ Description
 
 SourceFiles
     keyType.C
-    keyTypeIO.C
 
 \*---------------------------------------------------------------------------*/
 
@@ -52,14 +51,14 @@ class Ostream;
 
 
 /*---------------------------------------------------------------------------*\
-                          Class keyType Declaration
+                           Class keyType Declaration
 \*---------------------------------------------------------------------------*/
 
 class keyType
 :
     public word
 {
-    // Private member data
+    // Private data
 
         //- Is the keyType a pattern (regular expression)
         bool isPattern_;
@@ -71,6 +70,11 @@ class keyType
 
 public:
 
+    // Static data members
+
+        //- An empty keyType
+        static const keyType null;
+
 
     // Constructors
 
@@ -80,19 +84,21 @@ public:
         //- Construct as copy
         inline keyType(const keyType&);
 
-        //- Construct as copy of word
+        //- Construct as copy of word. Not treated as a regular expression
         inline keyType(const word&);
 
-        //- Construct as copy of string. Expect it to be regular expression.
+        //- Construct as copy of string. Treat as regular expression.
         inline keyType(const string&);
 
-        //- Construct as copy of character array
+        //- Construct as copy of character array.
+        //  Not treated as a regular expression
         inline keyType(const char*);
 
-        //- Construct as copy of std::string
+        //- Construct as copy of std::string with specified treatment
         inline keyType(const std::string&, const bool isPattern);
 
         //- Construct from Istream
+        //  Treat as regular expression if surrounded by quotation marks.
         keyType(Istream&);
 
 
@@ -101,15 +107,24 @@ public:
         //- Should be treated as a match rather than a literal string
         inline bool isPattern() const;
 
+        //- Smart match as regular expression or as a string
+        //  Optionally force a literal match only
+        bool match(const std::string&, bool literalMatch=false) const;
+
     // Member operators
 
         // Assignment
 
+            //- Assignment operator
             inline const keyType& operator=(const keyType&);
+
+            //- Assign as word, not as non regular expression
             inline const keyType& operator=(const word&);
 
-            //- Assign from regular expression.
+            //- Assign as regular expression
             inline const keyType& operator=(const string&);
+
+            //- Assign as word, not as non regular expression
             inline const keyType& operator=(const char*);
 
 
diff --git a/src/OpenFOAM/primitives/strings/keyType/keyTypeI.H b/src/OpenFOAM/primitives/strings/keyType/keyTypeI.H
index 653ea8786ef4deceaec95196dfe9135ab623b20f..72752f3ddd34dc79174db2951fdba472febcf168 100644
--- a/src/OpenFOAM/primitives/strings/keyType/keyTypeI.H
+++ b/src/OpenFOAM/primitives/strings/keyType/keyTypeI.H
@@ -23,10 +23,6 @@ License
 
 \*---------------------------------------------------------------------------*/
 
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
 inline Foam::keyType::keyType()
@@ -50,7 +46,6 @@ inline Foam::keyType::keyType(const word& s)
 {}
 
 
-// Construct as copy of string. Expect it to be regular expression
 inline Foam::keyType::keyType(const string& s)
 :
     word(s, false),
@@ -58,7 +53,6 @@ inline Foam::keyType::keyType(const string& s)
 {}
 
 
-// Construct as copy of character array
 inline Foam::keyType::keyType(const char* s)
 :
     word(s, false),
@@ -66,7 +60,6 @@ inline Foam::keyType::keyType(const char* s)
 {}
 
 
-//- Construct as copy of std::string
 inline Foam::keyType::keyType
 (
     const std::string& s,
diff --git a/src/OpenFOAM/primitives/strings/string/string.H b/src/OpenFOAM/primitives/strings/string/string.H
index fe50c5b530f12f9042cbeb00d961b82b26ba549f..254ffbba0f9e608ff77a610148b27c30c0dea9f5 100644
--- a/src/OpenFOAM/primitives/strings/string/string.H
+++ b/src/OpenFOAM/primitives/strings/string/string.H
@@ -82,6 +82,8 @@ public:
 
         static const char* const typeName;
         static int debug;
+
+        //- An empty string
         static const string null;
 
 
@@ -143,6 +145,9 @@ public:
         template<class String>
         static inline string quotemeta(const string&, const char quote='\\');
 
+        //- True when strings match literally
+        inline bool match(const std::string&) const;
+
         //- Avoid masking the normal std::string replace
         using std::string::replace;
 
diff --git a/src/OpenFOAM/primitives/strings/string/stringI.H b/src/OpenFOAM/primitives/strings/string/stringI.H
index 70a8b6f972d8e52cc6cb34d3c813269107c1922a..83f4ed0c45bdc036db5650bf8349e54cdb706242 100644
--- a/src/OpenFOAM/primitives/strings/string/stringI.H
+++ b/src/OpenFOAM/primitives/strings/string/stringI.H
@@ -176,6 +176,12 @@ inline String Foam::string::validate(const string& str)
     return ss;
 }
 
+inline bool Foam::string::match(const std::string& str) const
+{
+    // check as string
+    return (str == *this);
+}
+
 
 // * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/primitives/strings/word/word.H b/src/OpenFOAM/primitives/strings/word/word.H
index a30eb10d1bccf315e00fae1588eb25dc77036412..032803084dca6644a2c2df3ee215ce5212325474 100644
--- a/src/OpenFOAM/primitives/strings/word/word.H
+++ b/src/OpenFOAM/primitives/strings/word/word.H
@@ -73,6 +73,8 @@ public:
 
         static const char* const typeName;
         static int debug;
+
+        //- An empty word
         static const word null;
 
 
diff --git a/src/OpenFOAM/primitives/strings/wordRe/wordReIO.C b/src/OpenFOAM/primitives/strings/wordRe/wordRe.C
similarity index 91%
rename from src/OpenFOAM/primitives/strings/wordRe/wordReIO.C
rename to src/OpenFOAM/primitives/strings/wordRe/wordRe.C
index eff08be77b0ac93d0afb18f1aede40073cd0fb17..693ae0535dbffb97ed6c5eb1499584a75a58b679 100644
--- a/src/OpenFOAM/primitives/strings/wordRe/wordReIO.C
+++ b/src/OpenFOAM/primitives/strings/wordRe/wordRe.C
@@ -27,7 +27,12 @@ License
 #include "IOstreams.H"
 #include "InfoProxy.H"
 
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+const Foam::wordRe Foam::wordRe::null;
+
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
 Foam::wordRe::wordRe(Istream& is)
 :
@@ -38,6 +43,8 @@ Foam::wordRe::wordRe(Istream& is)
 }
 
 
+// * * * * * * * * * * * * * * * IOstream Operators  * * * * * * * * * * * * //
+
 Foam::Istream& Foam::operator>>(Istream& is, wordRe& w)
 {
     token t(is);
diff --git a/src/OpenFOAM/primitives/strings/wordRe/wordRe.H b/src/OpenFOAM/primitives/strings/wordRe/wordRe.H
index 99bfb1188a39672eac85e3fb112f3ac3ed16a165..16d86b7fcfccc2ab66f761a51143e3e8ceea48a4 100644
--- a/src/OpenFOAM/primitives/strings/wordRe/wordRe.H
+++ b/src/OpenFOAM/primitives/strings/wordRe/wordRe.H
@@ -44,7 +44,6 @@ Note
 
 SourceFiles
     wordRe.C
-    wordReIO.C
 
 \*---------------------------------------------------------------------------*/
 
@@ -84,6 +83,12 @@ class wordRe
 
 public:
 
+    // Static data members
+
+        //- An empty wordRe
+        static const wordRe null;
+
+
     // Public data types
 
         //- Enumeration with compile options
@@ -168,7 +173,7 @@ public:
     //- Searching
 
         //- Smart match as regular expression or as a string
-        //  Optionally specify a literal match only
+        //  Optionally force a literal match only
         inline bool match(const std::string&, bool literalMatch=false) const;
 
     //- Miscellaneous
diff --git a/src/finiteVolume/cfdTools/general/porousMedia/PorousZones.C b/src/finiteVolume/cfdTools/general/porousMedia/PorousZones.C
index 1bb5a0954a88bc3aba2744cce28224b0dfa7326c..aea310c4e27b8de6254fa4e268a413f18e39e886 100644
--- a/src/finiteVolume/cfdTools/general/porousMedia/PorousZones.C
+++ b/src/finiteVolume/cfdTools/general/porousMedia/PorousZones.C
@@ -143,7 +143,7 @@ void Foam::PorousZones<ZoneType>::addResistance
 ) const
 {
     // addResistance for each zone, delaying the correction of the
-    // precessor BCs of AU
+    // processor BCs of AU
     forAll(*this, i)
     {
         this->operator[](i).addResistance(UEqn, AU, false);
diff --git a/src/finiteVolume/cfdTools/general/porousMedia/porousZone.C b/src/finiteVolume/cfdTools/general/porousMedia/porousZone.C
index 4e1020a4f10d6c464662c5b1267d0db62d07e460..e973971fcbd52ccf21f834a82368fe4f8c2c5053 100644
--- a/src/finiteVolume/cfdTools/general/porousMedia/porousZone.C
+++ b/src/finiteVolume/cfdTools/general/porousMedia/porousZone.C
@@ -27,7 +27,6 @@ License
 #include "fvMesh.H"
 #include "fvMatrices.H"
 #include "geometricOneField.H"
-#include "stringListOps.H"
 
 // * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * //
 
diff --git a/src/finiteVolume/cfdTools/general/porousMedia/porousZoneTemplates.C b/src/finiteVolume/cfdTools/general/porousMedia/porousZoneTemplates.C
index 4e72859f8005338cd0bd7b148a9284e0a89267d2..28bb7523494f7f4d8c29c0965705b0ff6e9d3a62 100644
--- a/src/finiteVolume/cfdTools/general/porousMedia/porousZoneTemplates.C
+++ b/src/finiteVolume/cfdTools/general/porousMedia/porousZoneTemplates.C
@@ -66,7 +66,7 @@ void Foam::porousZone::addPowerLawResistance
         forAll(cells, i)
         {
             Udiag[cells[i]] +=
-            V[cells[i]]*rho[cells[i]]*C0*pow(magSqr(U[cells[i]]), C1m1b2);
+                V[cells[i]]*rho[cells[i]]*C0*pow(magSqr(U[cells[i]]), C1m1b2);
         }
     }
 }
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C
index 2dde78acc0e2fe6a1b293ff1ad2730c12457ced9..17fa6f71fb093b1b6fcc72eaed4c93577cf95c2e 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C
@@ -66,16 +66,16 @@ directMappedVelocityFluxFixedValueFvPatchField
         FatalErrorIn
         (
             "directMappedVelocityFluxFixedValueFvPatchField::"
-            "directMappedVelocityFluxFixedValueFvPatchField\n"
-            "(\n"
-            "    const directMappedVelocityFluxFixedValueFvPatchField&,\n"
-            "    const fvPatch&,\n"
-            "    const DimensionedField<vector, volMesh>&,\n"
-            "    const fvPatchFieldMapper&\n"
-            ")\n"
-        )   << "\n    patch type '" << p.type()
+            "directMappedVelocityFluxFixedValueFvPatchField"
+            "("
+                "const directMappedVelocityFluxFixedValueFvPatchField&, "
+                "const fvPatch&, "
+                "const DimensionedField<vector, volMesh>&, "
+                "const fvPatchFieldMapper&"
+            ")"
+        )   << "Patch type '" << p.type()
             << "' not type '" << directMappedPatchBase::typeName << "'"
-            << "\n    for patch " << p.name()
+            << " for patch " << p.name()
             << " of field " << dimensionedInternalField().name()
             << " in file " << dimensionedInternalField().objectPath()
             << exit(FatalError);
@@ -102,23 +102,16 @@ directMappedVelocityFluxFixedValueFvPatchField
             "directMappedVelocityFluxFixedValueFvPatchField"
             "("
                 "const fvPatch&, "
-                "const DimensionedField<vector, volMesh>& iF, "
+                "const DimensionedField<vector, volMesh>&, "
                 "const dictionary&"
             ")"
-        )   << "patch type '" << p.type()
+        )   << "Patch type '" << p.type()
             << "' not type '" << directMappedPatchBase::typeName << "'"
             << " for patch " << p.name()
             << " of field " << dimensionedInternalField().name()
             << " in file " << dimensionedInternalField().objectPath()
             << exit(FatalError);
     }
-
-    // Force calculation of schedule (uses parallel comms)
-    const directMappedPolyPatch& mpp = refCast<const directMappedPolyPatch>
-    (
-        this->patch().patch()
-    );
-    (void)mpp.map().schedule();
 }
 
 
@@ -191,8 +184,8 @@ void directMappedVelocityFluxFixedValueFvPatchField::updateCoeffs()
 
                 forAll(Upf, faceI)
                 {
-                    allUValues[faceStart++] = Upf[faceI];
-                    allPhiValues[faceStart] = phipf[faceI];
+                    allUValues[faceStart + faceI] = Upf[faceI];
+                    allPhiValues[faceStart + faceI] = phipf[faceI];
                 }
             }
 
@@ -205,7 +198,7 @@ void directMappedVelocityFluxFixedValueFvPatchField::updateCoeffs()
                 distMap.constructMap(),
                 allUValues
             );
-            newUValues = patch().patchSlice(newUValues);
+            newUValues = patch().patchSlice(allUValues);
 
             mapDistribute::distribute
             (
@@ -214,9 +207,9 @@ void directMappedVelocityFluxFixedValueFvPatchField::updateCoeffs()
                 distMap.constructSize(),
                 distMap.subMap(),
                 distMap.constructMap(),
-                newPhiValues
+                allPhiValues
             );
-            newPhiValues = patch().patchSlice(newPhiValues);
+            newPhiValues = patch().patchSlice(allPhiValues);
 
             break;
         }
@@ -257,9 +250,10 @@ void directMappedVelocityFluxFixedValueFvPatchField::updateCoeffs()
         {
             FatalErrorIn
             (
-                "directMappedVelocityFluxFixedValueFvPatchField::updateCoeffs()"
-            )<< "patch can only be used in NEARESTPATCHFACE or NEARESTFACE "
-             << "mode" << nl << abort(FatalError);
+                "directMappedVelocityFluxFixedValueFvPatchField::"
+                "updateCoeffs()"
+            )   << "patch can only be used in NEARESTPATCHFACE or NEARESTFACE "
+                << "mode" << nl << abort(FatalError);
         }
     }
 
diff --git a/src/finiteVolume/fvMesh/fvMeshSubset/fvMeshSubset.C b/src/finiteVolume/fvMesh/fvMeshSubset/fvMeshSubset.C
index 1170068a077339806efae6b9a22a3eb61f51f775..1f07107afa6968301f79ad04cee2596ea3681353 100644
--- a/src/finiteVolume/fvMesh/fvMeshSubset/fvMeshSubset.C
+++ b/src/finiteVolume/fvMesh/fvMeshSubset/fvMeshSubset.C
@@ -675,6 +675,8 @@ void Foam::fvMeshSubset::setCellSubset
     }
 
 
+    // Delete any old mesh
+    fvMeshSubsetPtr_.clear();
     // Make a new mesh
     fvMeshSubsetPtr_.reset
     (
@@ -1169,11 +1171,15 @@ void Foam::fvMeshSubset::setLargeCellSubset
     }
 
 
+    // Delete any old one
+    fvMeshSubsetPtr_.clear();
+
     // Make a new mesh
     // Note that mesh gets registered with same name as original mesh. This is
     // not proper but cannot be avoided since otherwise surfaceInterpolation
     // cannot find its fvSchemes (it will try to read e.g.
     // system/region0SubSet/fvSchemes)
+    // Make a new mesh
     fvMeshSubsetPtr_.reset
     (
         new fvMesh
diff --git a/src/finiteVolume/fvMesh/singleCellFvMesh/singleCellFvMesh.C b/src/finiteVolume/fvMesh/singleCellFvMesh/singleCellFvMesh.C
index 4955f49007d6236fc0a8a7dfccd1f781c8dc3f39..8eaf3559f582002812642e58e3d0c789218ced0b 100644
--- a/src/finiteVolume/fvMesh/singleCellFvMesh/singleCellFvMesh.C
+++ b/src/finiteVolume/fvMesh/singleCellFvMesh/singleCellFvMesh.C
@@ -42,24 +42,26 @@ void Foam::singleCellFvMesh::agglomerateMesh
     const polyBoundaryMesh& oldPatches = mesh.boundaryMesh();
 
     // Check agglomeration within patch face range and continuous
-    labelList nAgglom(oldPatches.size());
+    labelList nAgglom(oldPatches.size(), 0);
 
     forAll(oldPatches, patchI)
     {
         const polyPatch& pp = oldPatches[patchI];
-
-        nAgglom[patchI] = max(agglom[patchI])+1;
-
-        forAll(pp, i)
+        if (pp.size() > 0)
         {
-            if (agglom[patchI][i] < 0  || agglom[patchI][i] >= pp.size())
+            nAgglom[patchI] = max(agglom[patchI])+1;
+
+            forAll(pp, i)
             {
-                FatalErrorIn
-                (
-                    "singleCellFvMesh::agglomerateMesh(..)"
-                )   << "agglomeration on patch " << patchI
-                    << " is out of range 0.." << pp.size()-1
-                    << exit(FatalError);
+                if (agglom[patchI][i] < 0  || agglom[patchI][i] >= pp.size())
+                {
+                    FatalErrorIn
+                    (
+                        "singleCellFvMesh::agglomerateMesh(..)"
+                    )   << "agglomeration on patch " << patchI
+                        << " is out of range 0.." << pp.size()-1
+                        << exit(FatalError);
+                }
             }
         }
     }
@@ -155,6 +157,8 @@ void Foam::singleCellFvMesh::agglomerateMesh
 
     forAll(oldPatches, patchI)
     {
+        patchStarts[patchI] = coarseI;
+
         const polyPatch& pp = oldPatches[patchI];
 
         if (pp.size() > 0)
@@ -170,8 +174,6 @@ void Foam::singleCellFvMesh::agglomerateMesh
             // From agglomeration to compact patch face
             labelList agglomToFace(nAgglom[patchI], -1);
 
-            patchStarts[patchI] = coarseI;
-
             forAll(pp, i)
             {
                 label myAgglom = agglom[patchI][i];
@@ -223,9 +225,9 @@ void Foam::singleCellFvMesh::agglomerateMesh
                     );
                 }
             }
-
-            patchSizes[patchI] = coarseI-patchStarts[patchI];
         }
+
+        patchSizes[patchI] = coarseI-patchStarts[patchI];
     }
 
     //Pout<< "patchStarts:" << patchStarts << endl;
diff --git a/src/lagrangian/basic/Cloud/Cloud.H b/src/lagrangian/basic/Cloud/Cloud.H
index 0c9b32ebac5b02638b1589c5f99917a614ab3b41..1868b9c881559307c91eaaa8a9cba618aa1c5bf2 100644
--- a/src/lagrangian/basic/Cloud/Cloud.H
+++ b/src/lagrangian/basic/Cloud/Cloud.H
@@ -38,7 +38,7 @@ SourceFiles
 #include "cloud.H"
 #include "IDLList.H"
 #include "IOField.H"
-#include "IOFieldField.H"
+#include "CompactIOField.H"
 #include "polyMesh.H"
 #include "indexedOctree.H"
 #include "treeDataCell.H"
@@ -350,7 +350,7 @@ public:
             void checkFieldFieldIOobject
             (
                 const Cloud<ParticleType>& c,
-                const IOFieldField<Field<DataType>, DataType>& data
+                const CompactIOField<Field<DataType>, DataType>& data
             ) const;
 
             //- Read the field data for the cloud of particles. Dummy at
diff --git a/src/lagrangian/basic/Cloud/CloudIO.C b/src/lagrangian/basic/Cloud/CloudIO.C
index c12d12d6a517cdaf807eefd7edf148337731f893..87b23e45382efbb976268efcffd4fded58a9c451 100644
--- a/src/lagrangian/basic/Cloud/CloudIO.C
+++ b/src/lagrangian/basic/Cloud/CloudIO.C
@@ -121,12 +121,16 @@ void Foam::Cloud<ParticleType>::initCloud(const bool checkClass)
     }
     else
     {
-        WarningIn("Cloud<ParticleType>::initCloud(const bool checkClass)")
-            << "Cannot read particle positions file " << nl
+        Pout<< "Cannot read particle positions file " << nl
             << "    " << ioP.path() << nl
             << "    assuming the initial cloud contains 0 particles." << endl;
     }
 
+    // Ask for the tetBasePtIs to trigger all processors to build
+    // them, otherwise, if some processors have no particles then
+    // there is a comms mismatch.
+    polyMesh_.tetBasePtIs();
+
     forAllIter(typename Cloud<ParticleType>, *this, pIter)
     {
         ParticleType& p = pIter();
@@ -225,7 +229,7 @@ template<class DataType>
 void Foam::Cloud<ParticleType>::checkFieldFieldIOobject
 (
     const Cloud<ParticleType>& c,
-    const IOFieldField<Field<DataType>, DataType>& data
+    const CompactIOField<Field<DataType>, DataType>& data
 ) const
 {
     if (data.size() != c.size())
@@ -235,7 +239,7 @@ void Foam::Cloud<ParticleType>::checkFieldFieldIOobject
             "void Cloud<ParticleType>::checkFieldFieldIOobject"
             "("
                 "const Cloud<ParticleType>&, "
-                "const IOFieldField<Field<DataType>, DataType>&"
+                "const CompactIOField<Field<DataType>, DataType>&"
             ") const"
         )   << "Size of " << data.name()
             << " field " << data.size()
diff --git a/src/lagrangian/basic/InteractionLists/globalIndexAndTransform/globalIndexAndTransform.C b/src/lagrangian/basic/InteractionLists/globalIndexAndTransform/globalIndexAndTransform.C
index 3bcd500d04cdab78995873cd180db3b7d9508448..e1328495980191aa44fba0f6512325245659d686 100644
--- a/src/lagrangian/basic/InteractionLists/globalIndexAndTransform/globalIndexAndTransform.C
+++ b/src/lagrangian/basic/InteractionLists/globalIndexAndTransform/globalIndexAndTransform.C
@@ -34,15 +34,16 @@ const Foam::label Foam::globalIndexAndTransform::base_ = 32;
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
 
-bool Foam::globalIndexAndTransform::matchTransform
+Foam::label Foam::globalIndexAndTransform::matchTransform
 (
     const List<vectorTensorTransform>& refTransforms,
+    label& matchedRefTransformI,
     const vectorTensorTransform& testTransform,
     scalar tolerance,
-    bool bothSigns
+    bool checkBothSigns
 ) const
 {
-    // return min(mag(transforms_ - sepVec)) > tol
+    matchedRefTransformI = -1;
 
     forAll(refTransforms, i)
     {
@@ -82,10 +83,12 @@ bool Foam::globalIndexAndTransform::matchTransform
 
         if (vectorDiff < 1 && tensorDiff < 1)
         {
-            return true;
+            matchedRefTransformI = i;
+
+            return +1;
         }
 
-        if (bothSigns)
+        if (checkBothSigns)
         {
             // Test the inverse transform differences too
 
@@ -106,12 +109,14 @@ bool Foam::globalIndexAndTransform::matchTransform
 
             if (vectorDiff < 1 && tensorDiff < 1)
             {
-                return true;
+                matchedRefTransformI = i;
+
+                return -1;
             }
         }
     }
 
-    return false;
+    return 0;
 }
 
 
@@ -123,6 +128,8 @@ void Foam::globalIndexAndTransform::determineTransforms()
 
     label nextTrans = 0;
 
+    label dummyMatch = -1;
+
     forAll(patches, patchI)
     {
         const polyPatch& pp = patches[patchI];
@@ -145,7 +152,17 @@ void Foam::globalIndexAndTransform::determineTransforms()
 
                         vectorTensorTransform transform(sepVec);
 
-                        if (!matchTransform(transforms_, transform, tol, false))
+                        if
+                        (
+                            matchTransform
+                            (
+                                transforms_,
+                                dummyMatch,
+                                transform,
+                                tol,
+                                false
+                            ) == 0
+                        )
                         {
                             transforms_[nextTrans++] = transform;
                         }
@@ -166,7 +183,7 @@ void Foam::globalIndexAndTransform::determineTransforms()
             }
             else if (!cpp.parallel())
             {
-                const tensorField& transTensors = cpp.forwardT();
+                const tensorField& transTensors = cpp.reverseT();
 
                 forAll(transTensors, tTI)
                 {
@@ -178,7 +195,17 @@ void Foam::globalIndexAndTransform::determineTransforms()
 
                         vectorTensorTransform transform(transT);
 
-                        if (!matchTransform(transforms_, transform, tol, false))
+                        if
+                        (
+                            matchTransform
+                            (
+                                transforms_,
+                                dummyMatch,
+                                transform,
+                                tol,
+                                false
+                            ) == 0
+                        )
                         {
                             transforms_[nextTrans++] = transform;
                         }
@@ -225,7 +252,17 @@ void Foam::globalIndexAndTransform::determineTransforms()
                 {
                     scalar tol = coupledPolyPatch::matchTol;
 
-                    if (!matchTransform(transforms_, transform, tol, true))
+                    if
+                    (
+                        matchTransform
+                        (
+                            transforms_,
+                            dummyMatch,
+                            transform,
+                            tol,
+                            true
+                        ) ==  0
+                    )
                     {
                         transforms_[nextTrans++] = transform;
                     }
@@ -290,6 +327,123 @@ void Foam::globalIndexAndTransform::determineTransformPermutations()
 }
 
 
+void Foam::globalIndexAndTransform::determinePatchTransformSign()
+{
+    const polyBoundaryMesh& patches = mesh_.boundaryMesh();
+
+    patchTransformSign_.setSize(patches.size(), Pair<label>(-1, 0));
+
+    label matchTransI = -1;
+
+    forAll(patches, patchI)
+    {
+        const polyPatch& pp = patches[patchI];
+
+        // Pout<< nl << patchI << " " << pp.name() << endl;
+
+        if (isA<coupledPolyPatch>(pp))
+        {
+            const coupledPolyPatch& cpp =
+            refCast<const coupledPolyPatch>(pp);
+
+            if (cpp.separated())
+            {
+                const vectorField& sepVecs = cpp.separation();
+
+                // Pout<< "sepVecs " << sepVecs << endl;
+
+                // This loop is implicitly expecting only a single
+                // value for separation()
+                forAll(sepVecs, sVI)
+                {
+                    const vector& sepVec = sepVecs[sVI];
+
+                    if (mag(sepVec) > SMALL)
+                    {
+                        scalar tol = coupledPolyPatch::matchTol;
+
+                        vectorTensorTransform t(sepVec);
+
+                        label sign = matchTransform
+                        (
+                            transforms_,
+                            matchTransI,
+                            t,
+                            tol,
+                            true
+                        );
+
+                        // Pout<< sign << " " << matchTransI << endl;
+
+                        // List<label> permutation(transforms_.size(), 0);
+
+                        // permutation[matchTransI] = sign;
+
+                        // Pout<< encodeTransformIndex(permutation) << nl
+                        //     << transformPermutations_
+                        //        [
+                        //            encodeTransformIndex(permutation)
+                        //        ]
+                        //     << endl;
+
+                        patchTransformSign_[patchI] =
+                            Pair<label>(matchTransI, sign);
+                    }
+                }
+
+            }
+            else if (!cpp.parallel())
+            {
+                const tensorField& transTensors = cpp.reverseT();
+
+                // Pout<< "transTensors " << transTensors << endl;
+
+                // This loop is implicitly expecting only a single
+                // value for reverseT()
+                forAll(transTensors, tTI)
+                {
+                    const tensor& transT = transTensors[tTI];
+
+                    if (mag(transT - I) > SMALL)
+                    {
+                        scalar tol = coupledPolyPatch::matchTol;
+
+                        vectorTensorTransform t(transT);
+
+                        label sign = matchTransform
+                        (
+                            transforms_,
+                            matchTransI,
+                            t,
+                            tol,
+                            true
+                        );
+
+                        // Pout<< sign << " " << matchTransI << endl;
+
+                        // List<label> permutation(transforms_.size(), 0);
+
+                        // permutation[matchTransI] = sign;
+
+                        // Pout<< encodeTransformIndex(permutation) << nl
+                        //     << transformPermutations_
+                        //        [
+                        //            encodeTransformIndex(permutation)
+                        //        ]
+                        //     << endl;
+
+                        patchTransformSign_[patchI] =
+                            Pair<label>(matchTransI, sign);
+                    }
+                }
+            }
+        }
+    }
+
+    // Pout<< patchTransformSign_ << endl;
+}
+
+
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
 Foam::globalIndexAndTransform::globalIndexAndTransform
@@ -297,11 +451,16 @@ Foam::globalIndexAndTransform::globalIndexAndTransform
     const polyMesh& mesh
 )
 :
-    mesh_(mesh)
+    mesh_(mesh),
+    transforms_(),
+    transformPermutations_(),
+    patchTransformSign_()
 {
     determineTransforms();
 
     determineTransformPermutations();
+
+    determinePatchTransformSign();
 }
 
 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
diff --git a/src/lagrangian/basic/InteractionLists/globalIndexAndTransform/globalIndexAndTransform.H b/src/lagrangian/basic/InteractionLists/globalIndexAndTransform/globalIndexAndTransform.H
index 4983fb4c16ea9c2847de07eaa5441cecdf4b1b7e..cba4bc59eb76cd2101c93fedc358c4c00c2e3509 100644
--- a/src/lagrangian/basic/InteractionLists/globalIndexAndTransform/globalIndexAndTransform.H
+++ b/src/lagrangian/basic/InteractionLists/globalIndexAndTransform/globalIndexAndTransform.H
@@ -82,6 +82,11 @@ class globalIndexAndTransform
         //  transform.
         List<vectorTensorTransform> transformPermutations_;
 
+        //- Mapping from patch index to which transform it matches (or
+        //  -1 for none) (.first()) and what sign to us for it,
+        //  i.e. +/- 1 (.second()).
+        List<Pair<label> > patchTransformSign_;
+
 
     // Private static data
 
@@ -97,13 +102,20 @@ class globalIndexAndTransform
         //- Generate all of the transformation permutations
         void determineTransformPermutations();
 
-        //- Test a list of reference transforms to see if the test transform
-        bool matchTransform
+        //- Determine which patch uses which transform (if any) and which
+        //- sign to use
+        void determinePatchTransformSign();
+
+        //- Test a list of reference transforms to see if the test
+        //  transform matches one.  Return +1 or -1 depending on the
+        //  sign of the match, or 0 if none matches.
+        label matchTransform
         (
             const List<vectorTensorTransform>& refTransforms,
+            label& matchedRefTransformI,
             const vectorTensorTransform& testTransform,
             scalar tolerance,
-            bool bothSigns
+            bool checkBothSigns
         ) const;
 
         //- Disallow default bitwise copy construct
@@ -171,12 +183,33 @@ public:
             inline const List<vectorTensorTransform>&
             transformPermutations() const;
 
+            //- Return access to the per-patch transform-sign pairs
+            inline const List<Pair<label> >& patchTransformSign() const;
+
             //- Access the overall (permuted) transform corresponding
             //  to the transformIndex
             inline const vectorTensorTransform& transform
             (
                 label transformIndex
             ) const;
+
+            //- Access the all of the indices of the transform
+            //  permutations corresponding the transforms of the
+            //  listed patch indices
+            inline labelList transformIndicesForPatches
+            (
+                const labelHashSet& patchIs
+            ) const;
+
+            //- Apply all of the transform permutations
+            //  corresponding the transforms of the listed patch
+            //  indices to the supplied point
+            inline pointField transformPatches
+            (
+                const labelHashSet& patchIs,
+                const point& pt
+            ) const;
+
 };
 
 
diff --git a/src/lagrangian/basic/InteractionLists/globalIndexAndTransform/globalIndexAndTransformI.H b/src/lagrangian/basic/InteractionLists/globalIndexAndTransform/globalIndexAndTransformI.H
index fe2a6034a7ca94db4126b52ddbb0c8c01b399d4b..f2928899f255c1aa809f8298e9021d47f4b51fed 100644
--- a/src/lagrangian/basic/InteractionLists/globalIndexAndTransform/globalIndexAndTransformI.H
+++ b/src/lagrangian/basic/InteractionLists/globalIndexAndTransform/globalIndexAndTransformI.H
@@ -180,6 +180,13 @@ Foam::globalIndexAndTransform::transformPermutations() const
 }
 
 
+const Foam::List<Foam::Pair<Foam::label> >&
+Foam::globalIndexAndTransform::patchTransformSign() const
+{
+    return patchTransformSign_;
+}
+
+
 const Foam::vectorTensorTransform& Foam::globalIndexAndTransform::transform
 (
     label transformIndex
@@ -189,4 +196,214 @@ const Foam::vectorTensorTransform& Foam::globalIndexAndTransform::transform
 }
 
 
+Foam::labelList Foam::globalIndexAndTransform::transformIndicesForPatches
+(
+    const labelHashSet& patchIs
+) const
+{
+    List<label> permutation(transforms_.size(), 0);
+
+    labelList selectedTransformIs(0);
+
+    if (patchIs.empty() || transforms_.empty())
+    {
+        return selectedTransformIs;
+    }
+
+    forAllConstIter(labelHashSet, patchIs, iter)
+    {
+        label patchI = iter.key();
+
+        const Pair<label>& transSign = patchTransformSign_[patchI];
+
+        label matchTransI = transSign.first();
+
+        if (matchTransI > -1)
+        {
+            label sign = transSign.second();
+
+            // If this transform been found already by a patch?
+            if (permutation[matchTransI] != 0)
+            {
+                // If so, if they have opposite signs, then this is
+                // considered an error.  They are allowed to be the
+                // same sign, but this only results in a single
+                // transform.
+                if (permutation[matchTransI] != sign)
+                {
+                    FatalErrorIn
+                    (
+                        "const Foam::List<Foam::vectorTensorTransform>& "
+                        "Foam::globalIndexAndTransform::transformsForPatches"
+                        "("
+                            "const labelList& patchIs"
+                        ") const"
+                    )
+                        << "More than one patch accessing the same transform "
+                        << "but not of the same sign."
+                        << exit(FatalError);
+                }
+            }
+            else
+            {
+                permutation[matchTransI] = sign;
+            }
+        }
+    }
+
+    label nUsedTrans = sum(mag(permutation));
+
+    if (nUsedTrans == 0)
+    {
+        return selectedTransformIs;
+    }
+
+    // Number of selected transformations
+    label nSelTrans = pow(2, nUsedTrans) - 1;
+
+    // Pout<< nl << permutation << nl << endl;
+
+    selectedTransformIs.setSize(nSelTrans);
+
+    switch (nUsedTrans)
+    {
+        case 1:
+        {
+            selectedTransformIs[0] = encodeTransformIndex(permutation);
+
+            break;
+        }
+        case 2:
+        {
+            List<label> tempPermutation = permutation;
+
+            label a = 0;
+            label b = 1;
+
+            // When there are two selected transforms out of three, we
+            // need to choose which of them are being permuted
+            if (transforms_.size() > nUsedTrans)
+            {
+                if (permutation[0] == 0)
+                {
+                    a = 1;
+                    b = 2;
+                }
+                else if (permutation[1] == 0)
+                {
+                    a = 0;
+                    b = 2;
+                }
+                else if (permutation[2] == 0)
+                {
+                    a = 0;
+                    b = 1;
+                }
+            }
+
+            tempPermutation[a] = a;
+            tempPermutation[b] = permutation[b];
+
+            selectedTransformIs[0] = encodeTransformIndex(tempPermutation);
+
+            tempPermutation[a] = permutation[a];
+            tempPermutation[b] = a;
+
+            selectedTransformIs[1] = encodeTransformIndex(tempPermutation);
+
+            tempPermutation[a] = permutation[a];
+            tempPermutation[b] = permutation[b];
+
+            selectedTransformIs[2] = encodeTransformIndex(tempPermutation);
+
+            break;
+        }
+        case 3:
+        {
+            List<label> tempPermutation = permutation;
+
+            tempPermutation[0] = 0;
+            tempPermutation[1] = 0;
+            tempPermutation[2] = permutation[2];
+
+            selectedTransformIs[0] = encodeTransformIndex(tempPermutation);
+
+            tempPermutation[0] = 0;
+            tempPermutation[1] = permutation[1];
+            tempPermutation[2] = 0;
+
+            selectedTransformIs[1] = encodeTransformIndex(tempPermutation);
+
+            tempPermutation[0] = 0;
+            tempPermutation[1] = permutation[1];
+            tempPermutation[2] = permutation[2];
+
+            selectedTransformIs[2] = encodeTransformIndex(tempPermutation);
+
+            tempPermutation[0] = permutation[0];
+            tempPermutation[1] = 0;
+            tempPermutation[2] = 0;
+
+            selectedTransformIs[3] = encodeTransformIndex(tempPermutation);
+
+            tempPermutation[0] = permutation[0];
+            tempPermutation[1] = 0;
+            tempPermutation[2] = permutation[2];
+
+            selectedTransformIs[4] = encodeTransformIndex(tempPermutation);
+
+            tempPermutation[0] = permutation[0];
+            tempPermutation[1] = permutation[1];
+            tempPermutation[2] = 0;
+
+            selectedTransformIs[5] = encodeTransformIndex(tempPermutation);
+
+            tempPermutation[0] = permutation[0];
+            tempPermutation[1] = permutation[1];
+            tempPermutation[2] = permutation[2];
+
+            selectedTransformIs[6] = encodeTransformIndex(tempPermutation);
+
+            break;
+        }
+        default:
+        {
+            FatalErrorIn
+            (
+                "const Foam::List<Foam::vectorTensorTransform>& "
+                "Foam::globalIndexAndTransform::transformsForPatches"
+                "("
+                    "const labelList& patchIs"
+                ") const"
+            )
+                << "Only 1-3 transforms are possible."
+                << exit(FatalError);
+        }
+    }
+
+    return selectedTransformIs;
+}
+
+
+Foam::pointField Foam::globalIndexAndTransform::transformPatches
+(
+    const labelHashSet& patchIs,
+    const point& pt
+) const
+{
+    labelList transIs = transformIndicesForPatches(patchIs);
+
+    // Pout<< patchIs << nl << transIs << endl;
+
+    pointField transPts(transIs.size());
+
+    forAll(transIs, tII)
+    {
+        transPts[tII] = transformPermutations_[transIs[tII]].transform(pt);
+    }
+
+    return transPts;
+}
+
+
 // ************************************************************************* //
diff --git a/src/lagrangian/basic/InteractionLists/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransformI.H b/src/lagrangian/basic/InteractionLists/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransformI.H
index 028d64f694c043e054d55a612210d8c9418a72d5..f322fc786fb709bc1bb8001461df116b2788d574 100644
--- a/src/lagrangian/basic/InteractionLists/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransformI.H
+++ b/src/lagrangian/basic/InteractionLists/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransformI.H
@@ -32,6 +32,7 @@ inline Foam::vectorTensorTransform::vectorTensorTransform()
     hasR_(false)
 {}
 
+
 inline Foam::vectorTensorTransform::vectorTensorTransform
 (
     const vector& t,
@@ -44,6 +45,7 @@ inline Foam::vectorTensorTransform::vectorTensorTransform
     hasR_(hasR)
 {}
 
+
 inline Foam::vectorTensorTransform::vectorTensorTransform(const vector& t)
 :
     t_(t),
@@ -51,6 +53,7 @@ inline Foam::vectorTensorTransform::vectorTensorTransform(const vector& t)
     hasR_(false)
 {}
 
+
 inline Foam::vectorTensorTransform::vectorTensorTransform(const tensor& R)
 :
     t_(vector::zero),
diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H
index 4a76cb0173c634584c2f9b6ee7ce480843c8b592..7ff71216d80d2905b317e1dc9c98fa1a0da7d939 100644
--- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H
+++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H
@@ -62,8 +62,8 @@ namespace Foam
 {
 
 typedef CollisionRecordList<vector, vector> collisionRecordList;
-typedef vectorIOFieldField pairDataIOFieldField;
-typedef vectorIOFieldField wallDataIOFieldField;
+typedef vectorFieldCompactIOField pairDataFieldCompactIOField;
+typedef vectorFieldCompactIOField wallDataFieldCompactIOField;
 
 template<class ParcelType>
 class KinematicParcel;
diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelIO.C b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelIO.C
index 8f1645db60622d0fe9b053c19d49446eeb87dc7d..ca46547cc224d5fd3d872bdb834a4c6d8a74a7e4 100644
--- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelIO.C
+++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelIO.C
@@ -181,13 +181,13 @@ void Foam::KinematicParcel<ParcelType>::readFields(Cloud<ParcelType>& c)
     IOField<vector> UTurb(c.fieldIOobject("UTurb", IOobject::MUST_READ));
     c.checkFieldIOobject(c, UTurb);
 
-    labelIOFieldField collisionRecordsPairAccessed
+    labelFieldCompactIOField collisionRecordsPairAccessed
     (
         c.fieldIOobject("collisionRecordsPairAccessed", IOobject::MUST_READ)
     );
     c.checkFieldFieldIOobject(c, collisionRecordsPairAccessed);
 
-    labelIOFieldField collisionRecordsPairOrigProcOfOther
+    labelFieldCompactIOField collisionRecordsPairOrigProcOfOther
     (
         c.fieldIOobject
         (
@@ -197,7 +197,7 @@ void Foam::KinematicParcel<ParcelType>::readFields(Cloud<ParcelType>& c)
     );
     c.checkFieldFieldIOobject(c, collisionRecordsPairOrigProcOfOther);
 
-    labelIOFieldField collisionRecordsPairOrigIdOfOther
+    labelFieldCompactIOField collisionRecordsPairOrigIdOfOther
     (
         c.fieldIOobject
         (
@@ -207,25 +207,25 @@ void Foam::KinematicParcel<ParcelType>::readFields(Cloud<ParcelType>& c)
     );
     c.checkFieldFieldIOobject(c, collisionRecordsPairOrigProcOfOther);
 
-    pairDataIOFieldField collisionRecordsPairData
+    pairDataFieldCompactIOField collisionRecordsPairData
     (
         c.fieldIOobject("collisionRecordsPairData", IOobject::MUST_READ)
     );
     c.checkFieldFieldIOobject(c, collisionRecordsPairData);
 
-    labelIOFieldField collisionRecordsWallAccessed
+    labelFieldCompactIOField collisionRecordsWallAccessed
     (
         c.fieldIOobject("collisionRecordsWallAccessed", IOobject::MUST_READ)
     );
     c.checkFieldFieldIOobject(c, collisionRecordsWallAccessed);
 
-    vectorIOFieldField collisionRecordsWallPRel
+    vectorFieldCompactIOField collisionRecordsWallPRel
     (
         c.fieldIOobject("collisionRecordsWallPRel", IOobject::MUST_READ)
     );
     c.checkFieldFieldIOobject(c, collisionRecordsWallPRel);
 
-    wallDataIOFieldField collisionRecordsWallData
+    wallDataFieldCompactIOField collisionRecordsWallData
     (
         c.fieldIOobject("collisionRecordsWallData", IOobject::MUST_READ)
     );
@@ -292,12 +292,12 @@ void Foam::KinematicParcel<ParcelType>::writeFields(const Cloud<ParcelType>& c)
     IOField<scalar> tTurb(c.fieldIOobject("tTurb", IOobject::NO_READ), np);
     IOField<vector> UTurb(c.fieldIOobject("UTurb", IOobject::NO_READ), np);
 
-    labelIOFieldField collisionRecordsPairAccessed
+    labelFieldCompactIOField collisionRecordsPairAccessed
     (
         c.fieldIOobject("collisionRecordsPairAccessed", IOobject::NO_READ),
         np
     );
-    labelIOFieldField collisionRecordsPairOrigProcOfOther
+    labelFieldCompactIOField collisionRecordsPairOrigProcOfOther
     (
         c.fieldIOobject
         (
@@ -306,27 +306,27 @@ void Foam::KinematicParcel<ParcelType>::writeFields(const Cloud<ParcelType>& c)
         ),
         np
     );
-    labelIOFieldField collisionRecordsPairOrigIdOfOther
+    labelFieldCompactIOField collisionRecordsPairOrigIdOfOther
     (
         c.fieldIOobject("collisionRecordsPairOrigIdOfOther", IOobject::NO_READ),
         np
     );
-    pairDataIOFieldField collisionRecordsPairData
+    pairDataFieldCompactIOField collisionRecordsPairData
     (
         c.fieldIOobject("collisionRecordsPairData", IOobject::NO_READ),
         np
     );
-    labelIOFieldField collisionRecordsWallAccessed
+    labelFieldCompactIOField collisionRecordsWallAccessed
     (
         c.fieldIOobject("collisionRecordsWallAccessed", IOobject::NO_READ),
         np
     );
-    vectorIOFieldField collisionRecordsWallPRel
+    vectorFieldCompactIOField collisionRecordsWallPRel
     (
         c.fieldIOobject("collisionRecordsWallPRel", IOobject::NO_READ),
         np
     );
-    wallDataIOFieldField collisionRecordsWallData
+    wallDataFieldCompactIOField collisionRecordsWallData
     (
         c.fieldIOobject("collisionRecordsWallData", IOobject::NO_READ),
         np
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.C
index e1d3bd6d3ddd641d3729ec499c22b8b7c842037b..c46d5efc7709cb81532991e1436638721fb59ea4 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.C
+++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -26,7 +26,6 @@ License
 #include "InflationInjection.H"
 #include "mathematicalConstants.H"
 #include "PackedBoolList.H"
-#include "Switch.H"
 #include "cellSet.H"
 #include "ListListOps.H"
 
@@ -127,7 +126,7 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject
 
         if (cellOccupancy[cI].empty())
         {
-            if (!cellCentresUsed.found(cI))
+            if (selfSeed_ && !cellCentresUsed.found(cI))
             {
                 scalar dNew = parcelPDF_().sample();
 
@@ -136,7 +135,7 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject
                     vectorPairScalarPair
                     (
                         Pair<vector>(mesh.cellCentres()[cI], vector::zero),
-                        Pair<scalar>(dNew, dNew)
+                        Pair<scalar>(dSeed_, dNew)
                     )
                 );
 
@@ -340,6 +339,8 @@ Foam::InflationInjection<CloudType>::InflationInjection
     newParticles_(),
     volumeAccumulator_(0.0),
     fraction_(1.0),
+    selfSeed_(this->coeffDict().lookupOrDefault("selfSeed", false)),
+    dSeed_(SMALL),
     parcelPDF_
     (
         pdfs::pdf::New
@@ -349,6 +350,11 @@ Foam::InflationInjection<CloudType>::InflationInjection
         )
     )
 {
+    if (selfSeed_)
+    {
+        dSeed_ = readScalar(this->coeffDict().lookup("dSeed"));
+    }
+
     cellSet generationCells(this->owner().mesh(), generationSetName_);
 
     generationCells_ = generationCells.toc();
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.H
index 70724124300621dba60e09c7a256e1aec9567af2..45a54774d30ae3d7b2baa20b5a2c3778a9a4cf0f 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.H
+++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -40,6 +40,7 @@ SourceFiles
 
 #include "InjectionModel.H"
 #include "pdf.H"
+#include "Switch.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -99,6 +100,13 @@ class InflationInjection
         //- Fraction of injection controlled by this processor
         scalar fraction_;
 
+        //- Switch to control whether or not the injector is allowed
+        //  to create new particles in empty cells
+        Switch selfSeed_;
+
+        //- Diameter with which to create new seed particles
+        scalar dSeed_;
+
         //- Parcel size PDF model
         const autoPtr<pdfs::pdf> parcelPDF_;
 
diff --git a/src/mesh/autoMesh/Make/files b/src/mesh/autoMesh/Make/files
index fecec5db5dbd2b8c85870cb0d0a7721397112cff..ec877c5f94e1091c300bdd10845e7e4b0ad9522e 100644
--- a/src/mesh/autoMesh/Make/files
+++ b/src/mesh/autoMesh/Make/files
@@ -5,7 +5,6 @@ $(autoHexMeshDriver)/autoLayerDriver.C
 $(autoHexMeshDriver)/autoLayerDriverShrink.C
 $(autoHexMeshDriver)/autoSnapDriver.C
 $(autoHexMeshDriver)/autoRefineDriver.C
-$(autoHexMeshDriver)/autoHexMeshDriver.C
 
 $(autoHexMeshDriver)/layerParameters/layerParameters.C
 $(autoHexMeshDriver)/refinementParameters/refinementParameters.C
diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.C
deleted file mode 100644
index 2d12064c97287a27eec0aecb0e0830380be16eba..0000000000000000000000000000000000000000
--- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.C
+++ /dev/null
@@ -1,548 +0,0 @@
-/*---------------------------------------------------------------------------*\
-  =========                 |
-  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-   \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
-     \\/     M anipulation  |
--------------------------------------------------------------------------------
-License
-    This file is part of OpenFOAM.
-
-    OpenFOAM is free software: you can redistribute it and/or modify it
-    under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 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 "autoHexMeshDriver.H"
-#include "fvMesh.H"
-#include "Time.H"
-#include "boundBox.H"
-#include "wallPolyPatch.H"
-#include "cellSet.H"
-#include "syncTools.H"
-#include "refinementParameters.H"
-#include "snapParameters.H"
-#include "layerParameters.H"
-#include "autoRefineDriver.H"
-#include "autoSnapDriver.H"
-#include "autoLayerDriver.H"
-#include "triSurfaceMesh.H"
-
-// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
-
-namespace Foam
-{
-    defineTypeNameAndDebug(autoHexMeshDriver, 0);
-}
-
-
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
-
-// Check writing tolerance before doing any serious work
-Foam::scalar Foam::autoHexMeshDriver::getMergeDistance(const scalar mergeTol)
- const
-{
-    const boundBox& meshBb = mesh_.bounds();
-    scalar mergeDist = mergeTol * meshBb.mag();
-    scalar writeTol = std::pow
-    (
-        scalar(10.0),
-       -scalar(IOstream::defaultPrecision())
-    );
-
-    Info<< nl
-        << "Overall mesh bounding box  : " << meshBb << nl
-        << "Relative tolerance         : " << mergeTol << nl
-        << "Absolute matching distance : " << mergeDist << nl
-        << endl;
-
-    if (mesh_.time().writeFormat() == IOstream::ASCII && mergeTol < writeTol)
-    {
-        FatalErrorIn("autoHexMeshDriver::getMergeDistance(const scalar) const")
-            << "Your current settings specify ASCII writing with "
-            << IOstream::defaultPrecision() << " digits precision." << endl
-            << "Your merging tolerance (" << mergeTol << ") is finer than this."
-            << endl
-            << "Please change your writeFormat to binary"
-            << " or increase the writePrecision" << endl
-            << "or adjust the merge tolerance (-mergeTol)."
-            << exit(FatalError);
-    }
-
-    return mergeDist;
-}
-
-
-//// Specifically orient using a calculated point outside
-//void Foam::autoHexMeshDriver::orientOutside
-//(
-//    PtrList<searchableSurface>& shells
-//)
-//{
-//    // Determine outside point.
-//    boundBox overallBb = boundBox::invertedBox;
-//
-//    bool hasSurface = false;
-//
-//    forAll(shells, shellI)
-//    {
-//        if (isA<triSurfaceMesh>(shells[shellI]))
-//        {
-//            const triSurfaceMesh& shell =
-//                refCast<const triSurfaceMesh>(shells[shellI]);
-//
-//            hasSurface = true;
-//
-//            boundBox shellBb(shell.localPoints(), false);
-//
-//            overallBb.min() = min(overallBb.min(), shellBb.min());
-//            overallBb.max() = max(overallBb.max(), shellBb.max());
-//        }
-//    }
-//
-//    if (hasSurface)
-//    {
-//        const point outsidePt = 2 * overallBb.span();
-//
-//        //Info<< "Using point " << outsidePt << " to orient shells" << endl;
-//
-//        forAll(shells, shellI)
-//        {
-//            if (isA<triSurfaceMesh>(shells[shellI]))
-//            {
-//                triSurfaceMesh& shell =
-//                  refCast<triSurfaceMesh>(shells[shellI]);
-//
-//                if (!refinementSurfaces::isSurfaceClosed(shell))
-//                {
-//                    FatalErrorIn("orientOutside(PtrList<searchableSurface>&)")
-//                        << "Refinement shell "
-//                        << shell.searchableSurface::name()
-//                        << " is not closed." << exit(FatalError);
-//                }
-//
-//                refinementSurfaces::orientSurface(outsidePt, shell);
-//            }
-//        }
-//    }
-//}
-
-
-// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
-
-// Construct from components
-Foam::autoHexMeshDriver::autoHexMeshDriver
-(
-    fvMesh& mesh,
-    const bool overwrite,
-    const dictionary& dict,
-    const dictionary& decomposeDict
-)
-:
-    mesh_(mesh),
-    dict_(dict),
-    debug_(readLabel(dict_.lookup("debug"))),
-    mergeDist_(getMergeDistance(readScalar(dict_.lookup("mergeTolerance"))))
-{
-    if (debug_ > 0)
-    {
-        meshRefinement::debug = debug_;
-        autoHexMeshDriver::debug = debug_;
-        autoRefineDriver::debug = debug;
-        autoSnapDriver::debug = debug;
-        autoLayerDriver::debug = debug;
-    }
-
-    refinementParameters refineParams(dict, 1);
-
-    Info<< "Overall cell limit                         : "
-        << refineParams.maxGlobalCells() << endl;
-    Info<< "Per processor cell limit                   : "
-        << refineParams.maxLocalCells() << endl;
-    Info<< "Minimum number of cells to refine          : "
-        << refineParams.minRefineCells() << endl;
-    Info<< "Curvature                                  : "
-        << refineParams.curvature() << nl << endl;
-    Info<< "Layers between different refinement levels : "
-        << refineParams.nBufferLayers() << endl;
-
-    PtrList<dictionary> shellDicts(dict_.lookup("refinementShells"));
-
-    PtrList<dictionary> surfaceDicts(dict_.lookup("surfaces"));
-
-
-    // Read geometry
-    // ~~~~~~~~~~~~~
-
-    {
-        Info<< "Reading all geometry." << endl;
-
-        // Construct dictionary with all shells and all refinement surfaces
-        dictionary geometryDict;
-
-        forAll(shellDicts, shellI)
-        {
-            dictionary shellDict = shellDicts[shellI];
-            const word name(shellDict.lookup("name"));
-            shellDict.remove("name");
-            shellDict.remove("level");
-            shellDict.remove("refineInside");
-            geometryDict.add(name, shellDict);
-        }
-
-        forAll(surfaceDicts, surfI)
-        {
-            dictionary surfDict = surfaceDicts[surfI];
-            const word name(string::validate<word>(surfDict.lookup("file")));
-            surfDict.remove("file");
-            surfDict.remove("regions");
-            if (!surfDict.found("name"))
-            {
-                surfDict.add("name", name);
-            }
-            surfDict.add("type", triSurfaceMesh::typeName);
-            geometryDict.add(name, surfDict);
-        }
-
-        allGeometryPtr_.reset
-        (
-            new searchableSurfaces
-            (
-                IOobject
-                (
-                    "abc",                                      // dummy name
-                    //mesh_.time().findInstance("triSurface", word::null),
-                                                                // instance
-                    mesh_.time().constant(),                    // instance
-                    "triSurface",                               // local
-                    mesh_.time(),                               // registry
-                    IOobject::MUST_READ,
-                    IOobject::NO_WRITE
-                ),
-                geometryDict
-            )
-        );
-
-        Info<< "Read geometry in = "
-            << mesh_.time().cpuTimeIncrement() << " s" << endl;
-    }
-
-
-    // Read refinement surfaces
-    // ~~~~~~~~~~~~~~~~~~~~~~~~
-
-    {
-        Info<< "Reading surfaces and constructing search trees." << endl;
-
-        surfacesPtr_.reset
-        (
-            new refinementSurfaces
-            (
-                allGeometryPtr_(),
-                surfaceDicts
-            )
-        );
-        Info<< "Read surfaces in = "
-            << mesh_.time().cpuTimeIncrement() << " s" << endl;
-    }
-
-    // Read refinement shells
-    // ~~~~~~~~~~~~~~~~~~~~~~
-
-    {
-        Info<< "Reading refinement shells." << endl;
-        shellsPtr_.reset
-        (
-            new shellSurfaces
-            (
-                allGeometryPtr_(),
-                shellDicts
-            )
-        );
-        Info<< "Read refinement shells in = "
-            << mesh_.time().cpuTimeIncrement() << " s" << endl;
-
-        //// Orient shell surfaces before any searching is done.
-        //Info<< "Orienting triSurface shells so point far away is outside."
-        //    << endl;
-        //orientOutside(shells_);
-        //Info<< "Oriented shells in = "
-        //    << mesh_.time().cpuTimeIncrement() << " s" << endl;
-
-        Info<< "Setting refinement level of surface to be consistent"
-            << " with shells." << endl;
-        surfacesPtr_().setMinLevelFields(shells());
-        Info<< "Checked shell refinement in = "
-            << mesh_.time().cpuTimeIncrement() << " s" << endl;
-    }
-
-
-    // Check faceZones are synchronised
-    meshRefinement::checkCoupledFaceZones(mesh_);
-
-
-    // Refinement engine
-    // ~~~~~~~~~~~~~~~~~
-
-    {
-        Info<< nl
-            << "Determining initial surface intersections" << nl
-            << "-----------------------------------------" << nl
-            << endl;
-
-        // Main refinement engine
-        meshRefinerPtr_.reset
-        (
-            new meshRefinement
-            (
-                mesh,
-                mergeDist_,         // tolerance used in sorting coordinates
-                overwrite,
-                surfaces(),
-                shells()
-            )
-        );
-        Info<< "Calculated surface intersections in = "
-            << mesh_.time().cpuTimeIncrement() << " s" << endl;
-
-        // Some stats
-        meshRefinerPtr_().printMeshInfo(debug_, "Initial mesh");
-
-        meshRefinerPtr_().write
-        (
-            debug_&meshRefinement::OBJINTERSECTIONS,
-            mesh_.time().path()/meshRefinerPtr_().timeName()
-        );
-    }
-
-
-    // Add all the surface regions as patches
-    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-    {
-        Info<< nl
-            << "Adding patches for surface regions" << nl
-            << "----------------------------------" << nl
-            << endl;
-
-        // From global region number to mesh patch.
-        globalToPatch_.setSize(surfaces().nRegions(), -1);
-
-        Info<< "Patch\tRegion" << nl
-            << "-----\t------"
-            << endl;
-
-        const labelList& surfaceGeometry = surfaces().surfaces();
-        forAll(surfaceGeometry, surfI)
-        {
-            label geomI = surfaceGeometry[surfI];
-
-            const wordList& regNames = allGeometryPtr_().regionNames()[geomI];
-
-            Info<< surfaces().names()[surfI] << ':' << nl << nl;
-
-            forAll(regNames, i)
-            {
-                label patchI = meshRefinerPtr_().addMeshedPatch
-                (
-                    regNames[i],
-                    wallPolyPatch::typeName
-                );
-
-                Info<< patchI << '\t' << regNames[i] << nl;
-
-                globalToPatch_[surfaces().globalRegion(surfI, i)] = patchI;
-            }
-
-            Info<< nl;
-        }
-        Info<< "Added patches in = "
-            << mesh_.time().cpuTimeIncrement() << " s" << nl << endl;
-    }
-
-
-    //// Add cyclics for any named faceZones
-    //// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-    //// (these cyclics are used later on to temporarily put the faceZones
-    ////  in when snapping)
-    //
-    //labelList namedSurfaces(surfaces().getNamedSurfaces());
-    //if (namedSurfaces.size())
-    //{
-    //    Info<< nl
-    //        << "Introducing cyclics for faceZones" << nl
-    //        << "---------------------------------" << nl
-    //        << endl;
-    //
-    //    // From surface to cyclic patch
-    //    surfaceToCyclicPatch_.setSize(surfaces().size(), -1);
-    //
-    //    Info<< "Patch\tZone" << nl
-    //        << "----\t-----"
-    //        << endl;
-    //
-    //    forAll(namedSurfaces, i)
-    //    {
-    //        label surfI = namedSurfaces[i];
-    //
-    //        surfaceToCyclicPatch_[surfI] = meshRefinement::addPatch
-    //        (
-    //            mesh,
-    //            surfaces().faceZoneNames()[surfI],
-    //            cyclicPolyPatch::typeName
-    //        );
-    //
-    //        Info<< surfaceToCyclicPatch_[surfI] << '\t'
-    //            << surfaces().faceZoneNames()[surfI] << nl << endl;
-    //    }
-    //    Info<< "Added cyclic patches in = "
-    //        << mesh_.time().cpuTimeIncrement() << " s" << endl;
-    //}
-
-
-    // Parallel
-    // ~~~~~~~~
-
-    {
-        // Decomposition
-        decomposerPtr_ = decompositionMethod::New(decomposeDict);
-        decompositionMethod& decomposer = decomposerPtr_();
-
-
-        if (Pstream::parRun() && !decomposer.parallelAware())
-        {
-            FatalErrorIn("autoHexMeshDriver::autoHexMeshDriver"
-                "(const IOobject&, fvMesh&)")
-                << "You have selected decomposition method "
-                << decomposer.typeName
-                << " which is not parallel aware." << endl
-                << "Please select one that is (hierarchical, ptscotch)"
-                << exit(FatalError);
-        }
-
-        // Mesh distribution engine (uses tolerance to reconstruct meshes)
-        distributorPtr_.reset(new fvMeshDistribute(mesh_, mergeDist_));
-    }
-}
-
-
-// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
-
-void Foam::autoHexMeshDriver::writeMesh(const string& msg) const
-{
-    const meshRefinement& meshRefiner = meshRefinerPtr_();
-
-    meshRefiner.printMeshInfo(debug_, msg);
-    Info<< "Writing mesh to time " << meshRefiner.timeName() << endl;
-
-    meshRefiner.write(meshRefinement::MESH|meshRefinement::SCALARLEVELS, "");
-    if (debug_ & meshRefinement::OBJINTERSECTIONS)
-    {
-        meshRefiner.write
-        (
-            meshRefinement::OBJINTERSECTIONS,
-            mesh_.time().path()/meshRefiner.timeName()
-        );
-    }
-    Info<< "Wrote mesh in = "
-        << mesh_.time().cpuTimeIncrement() << " s." << endl;
-}
-
-
-void Foam::autoHexMeshDriver::doMesh()
-{
-    const Switch wantRefine(dict_.lookup("doRefine"));
-    const Switch wantSnap(dict_.lookup("doSnap"));
-    const Switch wantLayers(dict_.lookup("doLayers"));
-
-    Info<< "Do refinement : " << wantRefine << nl
-        << "Do snapping   : " << wantSnap << nl
-        << "Do layers     : " << wantLayers << nl
-        << endl;
-
-    if (wantRefine)
-    {
-        const dictionary& motionDict = dict_.subDict("motionDict");
-
-        autoRefineDriver refineDriver
-        (
-            meshRefinerPtr_(),
-            decomposerPtr_(),
-            distributorPtr_(),
-            globalToPatch_
-        );
-
-        // Get all the refinement specific params
-        refinementParameters refineParams(dict_, 1);
-
-        refineDriver.doRefine(dict_, refineParams, wantSnap, motionDict);
-
-        // Write mesh
-        writeMesh("Refined mesh");
-    }
-
-    if (wantSnap)
-    {
-        const dictionary& snapDict = dict_.subDict("snapDict");
-        const dictionary& motionDict = dict_.subDict("motionDict");
-
-        autoSnapDriver snapDriver
-        (
-            meshRefinerPtr_(),
-            globalToPatch_
-        );
-
-        // Get all the snapping specific params
-        snapParameters snapParams(snapDict, 1);
-
-        snapDriver.doSnap(snapDict, motionDict, snapParams);
-
-        // Write mesh.
-        writeMesh("Snapped mesh");
-    }
-
-    if (wantLayers)
-    {
-        const dictionary& motionDict = dict_.subDict("motionDict");
-        const dictionary& shrinkDict = dict_.subDict("shrinkDict");
-        PtrList<dictionary> surfaceDicts(dict_.lookup("surfaces"));
-
-        autoLayerDriver layerDriver(meshRefinerPtr_());
-
-        // Get all the layer specific params
-        layerParameters layerParams
-        (
-            surfaceDicts,
-            surfacesPtr_(),
-            globalToPatch_,
-            shrinkDict,
-            mesh_.boundaryMesh()
-        );
-
-        layerDriver.doLayers
-        (
-            shrinkDict,
-            motionDict,
-            layerParams,
-            true,                   // pre-balance
-            decomposerPtr_(),
-            distributorPtr_()
-        );
-
-        // Write mesh.
-        writeMesh("Layer mesh");
-    }
-}
-
-
-// ************************************************************************* //
diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.H b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.H
deleted file mode 100644
index 5637fe966b6e9654351ee9a7819701686b3dd0fe..0000000000000000000000000000000000000000
--- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.H
+++ /dev/null
@@ -1,232 +0,0 @@
-/*---------------------------------------------------------------------------*\
-  =========                 |
-  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-   \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
-     \\/     M anipulation  |
--------------------------------------------------------------------------------
-License
-    This file is part of OpenFOAM.
-
-    OpenFOAM is free software: you can redistribute it and/or modify it
-    under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 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::autoHexMeshDriver
-
-Description
-    main meshing driver.
-
-SourceFiles
-    autoHexMeshDriver.C
-
-\*---------------------------------------------------------------------------*/
-
-#ifndef autoHexMeshDriver_H
-#define autoHexMeshDriver_H
-
-#include "autoPtr.H"
-#include "dictionary.H"
-#include "searchableSurfaces.H"
-#include "refinementSurfaces.H"
-#include "shellSurfaces.H"
-#include "meshRefinement.H"
-#include "decompositionMethod.H"
-#include "fvMeshDistribute.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace Foam
-{
-
-// Class forward declarations
-class fvMesh;
-
-/*---------------------------------------------------------------------------*\
-                           Class autoHexMeshDriver Declaration
-\*---------------------------------------------------------------------------*/
-
-class autoHexMeshDriver
-{
-    // Static data members
-
-        //- Extrusion controls
-        enum extrudeMode
-        {
-            NOEXTRUDE,      /*!< Do not extrude. No layers added. */
-            EXTRUDE,        /*!< Extrude */
-            EXTRUDEREMOVE   /*!< Extrude but afterwards remove added */
-                            /*!< faces locally */
-        };
-
-
-    // Private classes
-
-        //- Combine operator class for equalizing displacements.
-        class minMagEqOp
-        {
-        public:
-
-            void operator()(vector& x, const vector& y) const
-            {
-                if (magSqr(y) < magSqr(x))
-                {
-                    x = y;
-                }
-            }
-        };
-
-        //- Combine operator class to combine normal with other normal.
-        class nomalsCombine
-        {
-        public:
-
-            void operator()(vector& x, const vector& y) const
-            {
-                if (y != point::max)
-                {
-                    if (x == point::max)
-                    {
-                        x = y;
-                    }
-                    else
-                    {
-                        x *= (x&y);
-                    }
-                }
-            }
-        };
-
-
-
-    // Private data
-
-        //- Reference to mesh
-        fvMesh& mesh_;
-
-        //- Input dictionary
-        const dictionary dict_;
-
-        //- Debug level
-        const label debug_;
-
-        //- Merge distance
-        const scalar mergeDist_;
-
-
-        //- All surface based geometry
-        autoPtr<searchableSurfaces> allGeometryPtr_;
-
-        //- Shells (geometry for inside/outside refinement)
-        autoPtr<shellSurfaces> shellsPtr_;
-
-        //- Surfaces (geometry for intersection based refinement)
-        autoPtr<refinementSurfaces> surfacesPtr_;
-
-        //- Per refinement surface region the patch
-        labelList globalToPatch_;
-
-        //- Mesh refinement engine
-        autoPtr<meshRefinement> meshRefinerPtr_;
-
-        //- Decomposition engine
-        autoPtr<decompositionMethod> decomposerPtr_;
-
-        //- Mesh distribution engine
-        autoPtr<fvMeshDistribute> distributorPtr_;
-
-
-
-    // Private Member Functions
-
-        //- Calculate merge distance. Check against writing tolerance.
-        scalar getMergeDistance(const scalar mergeTol) const;
-
-        //static void orientOutside(PtrList<searchableSurface>&);
-
-        //- Disallow default bitwise copy construct
-        autoHexMeshDriver(const autoHexMeshDriver&);
-
-        //- Disallow default bitwise assignment
-        void operator=(const autoHexMeshDriver&);
-
-public:
-
-    //- Runtime type information
-    ClassName("autoHexMeshDriver");
-
-
-    // Constructors
-
-        //- Construct from dictionary and mesh to modify
-        autoHexMeshDriver
-        (
-            fvMesh& mesh,
-            const bool overwrite,
-            const dictionary& meshDict,
-            const dictionary& decomposeDict
-        );
-
-
-    // Member Functions
-
-        // Access
-
-            //- reference to mesh
-            const fvMesh& mesh() const
-            {
-                return mesh_;
-            }
-            fvMesh& mesh()
-            {
-                return mesh_;
-            }
-
-            //- Surfaces to base refinement on
-            const refinementSurfaces& surfaces() const
-            {
-                return surfacesPtr_();
-            }
-
-            //- Surfaces to volume refinement on
-            const shellSurfaces& shells() const
-            {
-                return shellsPtr_();
-            }
-
-            //- Per refinementsurface, per region the patch
-            const labelList& globalToPatch() const
-            {
-                return globalToPatch_;
-            }
-
-
-        // Meshing
-
-            //- Write mesh
-            void writeMesh(const string&) const;
-
-            //- Do all : refine, snap, layers
-            void doMesh();
-};
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace Foam
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-#endif
-
-// ************************************************************************* //
diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C
index be138e9d9055fa50895db557516c6c0beca180b0..1d3219972c94e7a83022c0df6f6403a1d711827e 100644
--- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C
+++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C
@@ -193,13 +193,13 @@ Foam::label Foam::autoLayerDriver::mergePatchFacesUndo
                 errorFaces
             );
 
-            // if (checkEdgeConnectivity)
-            // {
+            //if (checkEdgeConnectivity)
+            //{
             //    Info<< "Checking edge-face connectivity (duplicate faces"
             //        << " or non-consecutive shared vertices)" << endl;
-
+            //
             //    label nOldSize = errorFaces.size();
-
+            //
             //    hasErrors =
             //        mesh.checkFaceFaces
             //        (
@@ -207,7 +207,7 @@ Foam::label Foam::autoLayerDriver::mergePatchFacesUndo
             //            &errorFaces
             //        )
             //     || hasErrors;
-
+            //
             //    Info<< "Detected additional "
             //        <<  returnReduce
             //            (
@@ -216,7 +216,7 @@ Foam::label Foam::autoLayerDriver::mergePatchFacesUndo
             //            )
             //        << " faces with illegal face-face connectivity"
             //        << endl;
-            // }
+            //}
 
             if (!hasErrors)
             {
@@ -2344,6 +2344,7 @@ Foam::label Foam::autoLayerDriver::checkAndUnmark
 (
     const addPatchCellLayer& addLayer,
     const dictionary& meshQualityDict,
+    const List<labelPair>& baffles,
     const indirectPrimitivePatch& pp,
     const fvMesh& newMesh,
 
@@ -2355,7 +2356,15 @@ Foam::label Foam::autoLayerDriver::checkAndUnmark
     // Check the resulting mesh for errors
     Info<< nl << "Checking mesh with layer ..." << endl;
     faceSet wrongFaces(newMesh, "wrongFaces", newMesh.nFaces()/1000);
-    motionSmoother::checkMesh(false, newMesh, meshQualityDict, wrongFaces);
+    motionSmoother::checkMesh
+    (
+        false,
+        newMesh,
+        meshQualityDict,
+        identity(newMesh.nFaces()),
+        baffles,
+        wrongFaces
+    );
     Info<< "Detected " << returnReduce(wrongFaces.size(), sumOp<label>())
         << " illegal faces"
         << " (concave, zero area or negative cell pyramid volume)"
@@ -2484,9 +2493,14 @@ void Foam::autoLayerDriver::getLayerCellsFaces
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
-Foam::autoLayerDriver::autoLayerDriver(meshRefinement& meshRefiner)
+Foam::autoLayerDriver::autoLayerDriver
+(
+    meshRefinement& meshRefiner,
+    const labelList& globalToPatch
+)
 :
-    meshRefiner_(meshRefiner)
+    meshRefiner_(meshRefiner),
+    globalToPatch_(globalToPatch)
 {}
 
 
@@ -2536,6 +2550,20 @@ void Foam::autoLayerDriver::addLayers
 {
     fvMesh& mesh = meshRefiner_.mesh();
 
+    // Create baffles (pairs of faces that share the same points)
+    // Baffles stored as owner and neighbour face that have been created.
+    List<labelPair> baffles;
+    meshRefiner_.createZoneBaffles(globalToPatch_, baffles);
+
+
+    if (debug)
+    {
+        const_cast<Time&>(mesh.time())++;
+        Info<< "Writing baffled mesh to " << meshRefiner_.timeName() << endl;
+        mesh.write();
+    }
+
+
     autoPtr<indirectPrimitivePatch> pp
     (
         meshRefinement::makePatch
@@ -2920,6 +2948,7 @@ void Foam::autoLayerDriver::addLayers
             (
                 meshMover(),
                 meshQualityDict,
+                baffles,
 
                 layerParams.nSmoothThickness(),
                 layerParams.maxThicknessToMedialRatio(),
@@ -3086,6 +3115,15 @@ void Foam::autoLayerDriver::addLayers
             identity(pp().nPoints())
         );
 
+        // Update numbering of baffles
+        List<labelPair> newMeshBaffles(baffles.size());
+        forAll(baffles, i)
+        {
+            const labelPair& p = baffles[i];
+            newMeshBaffles[i][0] = map().reverseFaceMap()[p[0]];
+            newMeshBaffles[i][1] = map().reverseFaceMap()[p[1]];
+        }
+
         // Collect layer faces and cells for outside loop.
         getLayerCellsFaces
         (
@@ -3130,6 +3168,7 @@ void Foam::autoLayerDriver::addLayers
         (
             addLayer,
             meshQualityDict,
+            newMeshBaffles,
             pp(),
             newMesh,
 
@@ -3198,6 +3237,34 @@ void Foam::autoLayerDriver::addLayers
     meshRefiner_.updateMesh(map, labelList(0));
 
 
+    // Update numbering on baffles
+    forAll(baffles, i)
+    {
+        labelPair& p = baffles[i];
+        p[0] = map().reverseFaceMap()[p[0]];
+        p[1] = map().reverseFaceMap()[p[1]];
+    }
+
+
+    label nBaffles = returnReduce(baffles.size(), sumOp<label>());
+    if (nBaffles > 0)
+    {
+        // Merge any baffles
+        Info<< "Converting " << nBaffles
+            << " baffles back into zoned faces ..."
+            << endl;
+
+        autoPtr<mapPolyMesh> map = meshRefiner_.mergeBaffles(baffles);
+
+        inplaceReorder(map().reverseCellMap(), flaggedCells);
+        inplaceReorder(map().reverseFaceMap(), flaggedFaces);
+
+        Info<< "Converted baffles in = "
+            << meshRefiner_.mesh().time().cpuTimeIncrement()
+            << " s\n" << nl << endl;
+    }
+
+
     // Do final balancing
     // ~~~~~~~~~~~~~~~~~~
 
@@ -3280,8 +3347,19 @@ void Foam::autoLayerDriver::doLayers
     {
         if (numLayers[patchI] > 0)
         {
-            patchIDs.append(patchI);
-            nFacesWithLayers += mesh.boundaryMesh()[patchI].size();
+            const polyPatch& pp = mesh.boundaryMesh()[patchI];
+
+            if (!polyPatch::constraintType(pp.type()))
+            {
+                patchIDs.append(patchI);
+                nFacesWithLayers += mesh.boundaryMesh()[patchI].size();
+            }
+            else
+            {
+                WarningIn("autoLayerDriver::doLayers(..)")
+                    << "Ignoring layers on constraint patch " << pp.name()
+                    << endl;
+            }
         }
     }
     patchIDs.shrink();
@@ -3331,28 +3409,17 @@ void Foam::autoLayerDriver::doLayers
                 }
             }
 
-            // Balance mesh (and meshRefinement). No restriction on face zones
-            // and baffles.
+            // Balance mesh (and meshRefinement). Restrict faceZones to
+            // be on internal faces only since they will be converted into
+            // baffles.
             autoPtr<mapDistributePolyMesh> map = meshRefiner_.balance
             (
-                false,
+                true,   //false,    // keepZoneFaces
                 false,
                 cellWeights,
                 decomposer,
                 distributor
             );
-
-            //{
-            //    globalIndex globalCells(mesh.nCells());
-            //
-            //    Info<< "** Distribution after balancing:" << endl;
-            //    for (label procI = 0; procI < Pstream::nProcs(); procI++)
-            //    {
-            //        Info<< "    " << procI << '\t'
-            //            << globalCells.localSize(procI) << endl;
-            //    }
-            //    Info<< endl;
-            //}
         }
 
 
diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.H b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.H
index 64268bd69efe0ba1eaa2f14b3f839c43ce6191f5..969868e05693974323af6a738e055deaea8baed7 100644
--- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.H
+++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.H
@@ -98,6 +98,9 @@ class autoLayerDriver
         //- Mesh+surface
         meshRefinement& meshRefiner_;
 
+        //- From surface region to patch
+        const labelList globalToPatch_;
+
 
 
     // Private Member Functions
@@ -333,6 +336,7 @@ class autoLayerDriver
                 (
                     const addPatchCellLayer& addLayer,
                     const dictionary& motionDict,
+                    const List<labelPair>& baffles,
                     const indirectPrimitivePatch& pp,
                     const fvMesh&,
 
@@ -468,6 +472,7 @@ class autoLayerDriver
                 (
                     motionSmoother& meshMover,
                     const dictionary& meshQualityDict,
+                    const List<labelPair>& baffles,
                     const label nSmoothThickness,
                     const scalar maxThicknessToMedialRatio,
                     const label nAllowableErrors,
@@ -503,7 +508,11 @@ public:
     // Constructors
 
         //- Construct from components
-        autoLayerDriver(meshRefinement& meshRefiner);
+        autoLayerDriver
+        (
+            meshRefinement& meshRefiner,
+            const labelList& globalToPatch
+        );
 
 
     // Member Functions
diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C
index d8eb6832acdcf62957c6c94c4e3a2b36751bf023..292ec5d1421f1b7f31074b82cac6ed926329d52f 100644
--- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C
+++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C
@@ -945,6 +945,7 @@ void Foam::autoLayerDriver::shrinkMeshMedialDistance
 (
     motionSmoother& meshMover,
     const dictionary& meshQualityDict,
+    const List<labelPair>& baffles,
     const label nSmoothThickness,
     const scalar maxThicknessToMedialRatio,
     const label nAllowableErrors,
@@ -1135,7 +1136,7 @@ void Foam::autoLayerDriver::shrinkMeshMedialDistance
             meshMover.scaleMesh
             (
                 checkFaces,
-                List<labelPair>(0),
+                baffles,
                 meshMover.paramDict(),
                 meshQualityDict,
                 true,
diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.C
index 1808db7f453e4791f024dcbc61e29cc7ddc03962..0ab7e65c4ff99603e2f616d8785779252907b181 100644
--- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.C
+++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.C
@@ -844,10 +844,10 @@ void Foam::autoRefineDriver::doRefine
             << "---------------------" << nl
             << endl;
 
-        if (debug)
-        {
-            const_cast<Time&>(mesh.time())++;
-        }
+        //if (debug)
+        //{
+        //    const_cast<Time&>(mesh.time())++;
+        //}
 
         // Do final balancing. Keep zoned faces on one processor since the
         // snap phase will convert them to baffles and this only works for
diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C
index b41c1b631d018c8ddcd57963356f751af85cd3c3..c1c19fa1734db1114947976ee03753c1a0fbf4f3 100644
--- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C
+++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C
@@ -46,74 +46,15 @@ Description
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
-defineTypeNameAndDebug(Foam::autoSnapDriver, 0);
-
-
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
-
-// Get faces to repatch. Returns map from face to patch.
-Foam::Map<Foam::label> Foam::autoSnapDriver::getZoneBafflePatches
-(
-    const bool allowBoundary
-) const
+namespace Foam
 {
-    const fvMesh& mesh = meshRefiner_.mesh();
-    const refinementSurfaces& surfaces = meshRefiner_.surfaces();
 
-    Map<label> bafflePatch(mesh.nFaces()/1000);
+defineTypeNameAndDebug(autoSnapDriver, 0);
 
-    const wordList& faceZoneNames = surfaces.faceZoneNames();
-    const faceZoneMesh& fZones = mesh.faceZones();
+} // End namespace Foam
 
-    forAll(faceZoneNames, surfI)
-    {
-        if (faceZoneNames[surfI].size())
-        {
-            // Get zone
-            const faceZone& fZone = fZones[faceZoneNames[surfI]];
-
-            //// Get patch allocated for zone
-            //label patchI = surfaceToCyclicPatch_[surfI];
-            // Get patch of (first region) of surface
-            label patchI = globalToPatch_[surfaces.globalRegion(surfI, 0)];
-
-            Info<< "For surface "
-                << surfaces.names()[surfI]
-                << " found faceZone " << fZone.name()
-                << " and patch " << mesh.boundaryMesh()[patchI].name()
-                << endl;
-
-
-            forAll(fZone, i)
-            {
-                label faceI = fZone[i];
-
-                if (allowBoundary || mesh.isInternalFace(faceI))
-                {
-                    if (!bafflePatch.insert(faceI, patchI))
-                    {
-                        label oldPatchI = bafflePatch[faceI];
-
-                        if (oldPatchI != patchI)
-                        {
-                            FatalErrorIn("getZoneBafflePatches(const bool)")
-                                << "Face " << faceI
-                                << " fc:" << mesh.faceCentres()[faceI]
-                                << " in zone " << fZone.name()
-                                << " is in patch "
-                                << mesh.boundaryMesh()[oldPatchI].name()
-                                << " and in patch "
-                                << mesh.boundaryMesh()[patchI].name()
-                                << abort(FatalError);
-                        }
-                    }
-                }
-            }
-        }
-    }
-    return bafflePatch;
-}
 
+// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
 
 // Calculate geometrically collocated points, Requires PackedList to be
 // sized and initalised!
@@ -647,91 +588,6 @@ Foam::autoSnapDriver::autoSnapDriver
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
-Foam::autoPtr<Foam::mapPolyMesh> Foam::autoSnapDriver::createZoneBaffles
-(
-    List<labelPair>& baffles
-)
-{
-    labelList zonedSurfaces = meshRefiner_.surfaces().getNamedSurfaces();
-
-    autoPtr<mapPolyMesh> map;
-
-    // No need to sync; all processors will have all same zonedSurfaces.
-    if (zonedSurfaces.size())
-    {
-        fvMesh& mesh = meshRefiner_.mesh();
-
-        // Split internal faces on interface surfaces
-        Info<< "Converting zoned faces into baffles ..." << endl;
-
-        // Get faces (internal only) to be baffled. Map from face to patch
-        // label.
-        Map<label> faceToPatch(getZoneBafflePatches(false));
-
-        label nZoneFaces = returnReduce(faceToPatch.size(), sumOp<label>());
-        if (nZoneFaces > 0)
-        {
-            // Convert into labelLists
-            labelList ownPatch(mesh.nFaces(), -1);
-            forAllConstIter(Map<label>, faceToPatch, iter)
-            {
-                ownPatch[iter.key()] = iter();
-            }
-
-            // Create baffles. both sides same patch.
-            map = meshRefiner_.createBaffles(ownPatch, ownPatch);
-
-            // Get pairs of faces created.
-            // Just loop over faceMap and store baffle if we encounter a slave
-            // face.
-
-            baffles.setSize(faceToPatch.size());
-            label baffleI = 0;
-
-            const labelList& faceMap = map().faceMap();
-            const labelList& reverseFaceMap = map().reverseFaceMap();
-
-            forAll(faceMap, faceI)
-            {
-                label oldFaceI = faceMap[faceI];
-
-                // Does face originate from face-to-patch
-                Map<label>::const_iterator iter = faceToPatch.find(oldFaceI);
-
-                if (iter != faceToPatch.end())
-                {
-                    label masterFaceI = reverseFaceMap[oldFaceI];
-                    if (faceI != masterFaceI)
-                    {
-                        baffles[baffleI++] = labelPair(masterFaceI, faceI);
-                    }
-                }
-            }
-
-            if (baffleI != faceToPatch.size())
-            {
-                FatalErrorIn("autoSnapDriver::createZoneBaffles(..)")
-                    << "Had " << faceToPatch.size() << " patches to create "
-                    << " but encountered " << baffleI
-                    << " slave faces originating from patcheable faces."
-                    << abort(FatalError);
-            }
-
-            if (debug)
-            {
-                const_cast<Time&>(mesh.time())++;
-                Pout<< "Writing baffled mesh to time "
-                    << meshRefiner_.timeName() << endl;
-                mesh.write();
-            }
-        }
-        Info<< "Created " << nZoneFaces << " baffles in = "
-            << mesh.time().cpuTimeIncrement() << " s\n" << nl << endl;
-    }
-    return map;
-}
-
-
 Foam::autoPtr<Foam::mapPolyMesh> Foam::autoSnapDriver::mergeZoneBaffles
 (
     const List<labelPair>& baffles
@@ -1419,7 +1275,7 @@ void Foam::autoSnapDriver::doSnap
     // Create baffles (pairs of faces that share the same points)
     // Baffles stored as owner and neighbour face that have been created.
     List<labelPair> baffles;
-    createZoneBaffles(baffles);
+    meshRefiner_.createZoneBaffles(globalToPatch_, baffles);
 
     {
         autoPtr<indirectPrimitivePatch> ppPtr
diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.H b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.H
index 5e103b81921c92f6c89cb2eb0cafd1ba8a46e619..b57c465bb99c2a5358c2d0e9e292cf0b510f4136 100644
--- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.H
+++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.H
@@ -83,9 +83,6 @@ class autoSnapDriver
 
         // Snapping
 
-            //- Get faces to repatch. Returns map from face to patch.
-            Map<label> getZoneBafflePatches(const bool allowBoundary) const;
-
             //- Calculates (geometric) shared points
             static label getCollocatedPoints
             (
@@ -155,10 +152,6 @@ public:
 
         // Snapping
 
-            //- Create baffles for faces straddling zoned surfaces. Return
-            //  baffles.
-            autoPtr<mapPolyMesh> createZoneBaffles(List<labelPair>&);
-
             //- Merge baffles.
             autoPtr<mapPolyMesh> mergeZoneBaffles(const List<labelPair>&);
 
diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/layerParameters/layerParameters.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/layerParameters/layerParameters.C
index 5da9e316e186abe82355a2c241f1e8c4a818c5ed..6470e7fec6a60c6edeae8c0885b62854176907c9 100644
--- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/layerParameters/layerParameters.C
+++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/layerParameters/layerParameters.C
@@ -364,7 +364,8 @@ Foam::layerParameters::layerParameters
         {
             IOWarningIn("layerParameters::layerParameters(..)", layersDict)
                 << "Wildcard layer specification for " << wildCards[i]
-                << " does not match any patch." << endl;
+                << " does not match any patch." << endl
+                << "Valid patches are " << boundaryMesh.names() << endl;
         }
     }
 
@@ -376,7 +377,8 @@ Foam::layerParameters::layerParameters
         {
             IOWarningIn("layerParameters::layerParameters(..)", layersDict)
                 << "Layer specification for " << nonWildCards[i]
-                << " does not match any patch." << endl;
+                << " does not match any patch." << endl
+                << "Valid patches are " << boundaryMesh.names() << endl;
         }
     }
 }
diff --git a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C
index d43beaa856efca3fb26ca74849fac0da5155a219..3c124b59f308ee680a6b5120ce0c55eab2f14c10 100644
--- a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C
+++ b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C
@@ -1127,6 +1127,7 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::meshRefinement::balance
 
                 const wordList& fzNames = surfaces().faceZoneNames();
                 const faceZoneMesh& fZones = mesh_.faceZones();
+                const polyBoundaryMesh& pbm = mesh_.boundaryMesh();
 
                 // Get faces whose owner and neighbour should stay together,
                 // i.e. they are not 'blocked'.
@@ -1140,10 +1141,18 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::meshRefinement::balance
 
                         forAll(fZone, i)
                         {
-                            if (blockedFace[fZone[i]])
+                            label faceI = fZone[i];
+                            if (blockedFace[faceI])
                             {
-                                blockedFace[fZone[i]] = false;
-                                nUnblocked++;
+                                if
+                                (
+                                    mesh_.isInternalFace(faceI)
+                                 || pbm[pbm.whichPatch(faceI)].coupled()
+                                )
+                                {
+                                    blockedFace[faceI] = false;
+                                    nUnblocked++;
+                                }
                             }
                         }
                     }
@@ -1550,7 +1559,7 @@ Foam::label Foam::meshRefinement::addPatch
 (
     fvMesh& mesh,
     const word& patchName,
-    const word& patchType
+    const dictionary& patchInfo
 )
 {
     polyBoundaryMesh& polyPatches =
@@ -1559,21 +1568,8 @@ Foam::label Foam::meshRefinement::addPatch
     const label patchI = polyPatches.findPatchID(patchName);
     if (patchI != -1)
     {
-        if (polyPatches[patchI].type() == patchType)
-        {
-            // Already there
-            return patchI;
-        }
-        //else
-        //{
-        //    FatalErrorIn
-        //    (
-        //        "meshRefinement::addPatch(fvMesh&, const word&, const word&)"
-        //    )   << "Patch " << patchName << " already exists but with type "
-        //        << patchType << nl
-        //        << "Current patch names:" << polyPatches.names()
-        //        << exit(FatalError);
-        //}
+        // Already there
+        return patchI;
     }
 
 
@@ -1603,6 +1599,10 @@ Foam::label Foam::meshRefinement::addPatch
 
     fvBoundaryMesh& fvPatches = const_cast<fvBoundaryMesh&>(mesh.boundary());
 
+    dictionary patchDict(patchInfo);
+    patchDict.set("nFaces", 0);
+    patchDict.set("startFace", startFaceI);
+
     // Add polyPatch at the end
     polyPatches.setSize(sz+1);
     polyPatches.set
@@ -1610,10 +1610,8 @@ Foam::label Foam::meshRefinement::addPatch
         sz,
         polyPatch::New
         (
-            patchType,
             patchName,
-            0,              // size
-            startFaceI,
+            patchDict,
             insertPatchI,
             polyPatches
         )
@@ -1720,7 +1718,7 @@ Foam::label Foam::meshRefinement::addPatch
 Foam::label Foam::meshRefinement::addMeshedPatch
 (
     const word& name,
-    const word& type
+    const dictionary& patchInfo
 )
 {
     label meshedI = findIndex(meshedPatches_, name);
@@ -1733,7 +1731,7 @@ Foam::label Foam::meshRefinement::addMeshedPatch
     else
     {
         // Add patch
-        label patchI = addPatch(mesh_, name, type);
+        label patchI = addPatch(mesh_, name, patchInfo);
 
         // Store
         label sz = meshedPatches_.size();
@@ -1747,17 +1745,24 @@ Foam::label Foam::meshRefinement::addMeshedPatch
 
 Foam::labelList Foam::meshRefinement::meshedPatches() const
 {
-    labelList patchIDs(meshedPatches_.size());
+    const polyBoundaryMesh& patches = mesh_.boundaryMesh();
+
+    DynamicList<label> patchIDs(meshedPatches_.size());
     forAll(meshedPatches_, i)
     {
-        patchIDs[i] = mesh_.boundaryMesh().findPatchID(meshedPatches_[i]);
+        label patchI = patches.findPatchID(meshedPatches_[i]);
 
-        if (patchIDs[i] == -1)
+        if (patchI == -1)
         {
             FatalErrorIn("meshRefinement::meshedPatches() const")
                 << "Problem : did not find patch " << meshedPatches_[i]
+                << endl << "Valid patches are " << patches.names()
                 << abort(FatalError);
         }
+        if (!polyPatch::constraintType(patches[patchI].type()))
+        {
+            patchIDs.append(patchI);
+        }
     }
 
     return patchIDs;
diff --git a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinement.H b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinement.H
index 29b0f43bb031b03665fe3c7b1248c24795c5c67c..2d8362d413ce4855bb3f2d8b59d8ef9c754fb866 100644
--- a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinement.H
+++ b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinement.H
@@ -325,6 +325,13 @@ private:
 
         // Baffle handling
 
+            //- Get faces to repatch. Returns map from face to patch.
+            Map<label> getZoneBafflePatches
+            (
+                const bool allowBoundary,
+                const labelList& globalToPatch
+            ) const;
+
             //- Determine patches for baffles
             void getBafflePatches
             (
@@ -713,6 +720,14 @@ public:
                 const labelList& neiPatch
             );
 
+            //- Create baffles for faces straddling zoned surfaces. Return
+            //  baffles.
+            autoPtr<mapPolyMesh> createZoneBaffles
+            (
+                const labelList& globalToPatch,
+                List<labelPair>&
+            );
+
             //- Return a list of coupled face pairs, i.e. faces that
             //  use the same vertices.
             List<labelPair> getDuplicateFaces(const labelList& testFaces) const;
@@ -734,10 +749,10 @@ public:
 
             //- Helper:add patch to mesh. Update all registered fields.
             //  Use addMeshedPatch to add patches originating from surfaces.
-            static label addPatch(fvMesh&, const word& name, const word& type);
+            static label addPatch(fvMesh&, const word& name, const dictionary&);
 
             //- Add patch originating from meshing. Update meshedPatches_.
-            label addMeshedPatch(const word& name, const word& type);
+            label addMeshedPatch(const word& name, const dictionary&);
 
             //- Get patchIDs for patches added in addMeshedPatch.
             labelList meshedPatches() const;
diff --git a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C
index 6c78a67f0d38bb747800f24f455dd3133a68e17c..a445ebf699028303d20ced90b49b33d5b72095f3 100644
--- a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C
+++ b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C
@@ -216,7 +216,7 @@ Foam::label Foam::meshRefinement::getBafflePatch
 }
 
 
-// Determine patches for baffles.
+// Determine patches for baffles on all intersected unnamed faces
 void Foam::meshRefinement::getBafflePatches
 (
     const labelList& globalToPatch,
@@ -359,6 +359,70 @@ void Foam::meshRefinement::getBafflePatches
 }
 
 
+// Get faces to repatch. Returns map from face to patch.
+Foam::Map<Foam::label> Foam::meshRefinement::getZoneBafflePatches
+(
+    const bool allowBoundary,
+    const labelList& globalToPatch
+) const
+{
+    Map<label> bafflePatch(mesh_.nFaces()/1000);
+
+    const wordList& faceZoneNames = surfaces_.faceZoneNames();
+    const faceZoneMesh& fZones = mesh_.faceZones();
+
+    forAll(faceZoneNames, surfI)
+    {
+        if (faceZoneNames[surfI].size())
+        {
+            // Get zone
+            label zoneI = fZones.findZoneID(faceZoneNames[surfI]);
+
+            const faceZone& fZone = fZones[zoneI];
+
+            //// Get patch allocated for zone
+            //label patchI = surfaceToCyclicPatch_[surfI];
+            // Get patch of (first region) of surface
+            label patchI = globalToPatch[surfaces_.globalRegion(surfI, 0)];
+
+            Info<< "For surface "
+                << surfaces_.names()[surfI]
+                << " found faceZone " << fZone.name()
+                << " and patch " << mesh_.boundaryMesh()[patchI].name()
+                << endl;
+
+
+            forAll(fZone, i)
+            {
+                label faceI = fZone[i];
+
+                if (allowBoundary || mesh_.isInternalFace(faceI))
+                {
+                    if (!bafflePatch.insert(faceI, patchI))
+                    {
+                        label oldPatchI = bafflePatch[faceI];
+
+                        if (oldPatchI != patchI)
+                        {
+                            FatalErrorIn("getZoneBafflePatches(const bool)")
+                                << "Face " << faceI
+                                << " fc:" << mesh_.faceCentres()[faceI]
+                                << " in zone " << fZone.name()
+                                << " is in patch "
+                                << mesh_.boundaryMesh()[oldPatchI].name()
+                                << " and in patch "
+                                << mesh_.boundaryMesh()[patchI].name()
+                                << abort(FatalError);
+                        }
+                    }
+                }
+            }
+        }
+    }
+    return bafflePatch;
+}
+
+
 // Create baffle for every face where ownPatch != -1
 Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::createBaffles
 (
@@ -586,6 +650,90 @@ Foam::List<Foam::labelPair> Foam::meshRefinement::getDuplicateFaces
 }
 
 
+Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::createZoneBaffles
+(
+    const labelList& globalToPatch,
+    List<labelPair>& baffles
+)
+{
+    labelList zonedSurfaces = surfaces_.getNamedSurfaces();
+
+    autoPtr<mapPolyMesh> map;
+
+    // No need to sync; all processors will have all same zonedSurfaces.
+    if (zonedSurfaces.size())
+    {
+        // Split internal faces on interface surfaces
+        Info<< "Converting zoned faces into baffles ..." << endl;
+
+        // Get faces (internal only) to be baffled. Map from face to patch
+        // label.
+        Map<label> faceToPatch(getZoneBafflePatches(false, globalToPatch));
+
+        label nZoneFaces = returnReduce(faceToPatch.size(), sumOp<label>());
+        if (nZoneFaces > 0)
+        {
+            // Convert into labelLists
+            labelList ownPatch(mesh_.nFaces(), -1);
+            forAllConstIter(Map<label>, faceToPatch, iter)
+            {
+                ownPatch[iter.key()] = iter();
+            }
+
+            // Create baffles. both sides same patch.
+            map = createBaffles(ownPatch, ownPatch);
+
+            // Get pairs of faces created.
+            // Just loop over faceMap and store baffle if we encounter a slave
+            // face.
+
+            baffles.setSize(faceToPatch.size());
+            label baffleI = 0;
+
+            const labelList& faceMap = map().faceMap();
+            const labelList& reverseFaceMap = map().reverseFaceMap();
+
+            forAll(faceMap, faceI)
+            {
+                label oldFaceI = faceMap[faceI];
+
+                // Does face originate from face-to-patch
+                Map<label>::const_iterator iter = faceToPatch.find(oldFaceI);
+
+                if (iter != faceToPatch.end())
+                {
+                    label masterFaceI = reverseFaceMap[oldFaceI];
+                    if (faceI != masterFaceI)
+                    {
+                        baffles[baffleI++] = labelPair(masterFaceI, faceI);
+                    }
+                }
+            }
+
+            if (baffleI != faceToPatch.size())
+            {
+                FatalErrorIn("meshRefinement::createZoneBaffles(..)")
+                    << "Had " << faceToPatch.size() << " patches to create "
+                    << " but encountered " << baffleI
+                    << " slave faces originating from patcheable faces."
+                    << abort(FatalError);
+            }
+
+            if (debug)
+            {
+                const_cast<Time&>(mesh_.time())++;
+                Pout<< "Writing baffled mesh to time "
+                    << mesh_.time().timeName() << endl;
+                mesh_.write();
+            }
+        }
+        Info<< "Created " << nZoneFaces << " baffles in = "
+            << mesh_.time().cpuTimeIncrement() << " s\n" << nl << endl;
+    }
+    return map;
+}
+
+
 // Extract those baffles (duplicate) faces that are on the edge of a baffle
 // region. These are candidates for merging.
 // Done by counting the number of baffles faces per mesh edge. If edge
diff --git a/src/mesh/autoMesh/autoHexMesh/refinementSurfaces/refinementSurfaces.C b/src/mesh/autoMesh/autoHexMesh/refinementSurfaces/refinementSurfaces.C
index 8bbc0bd52e574f288b806580c2fc549c80ee746a..ecb0542578b92c591d2d35741f6206aee992da8a 100644
--- a/src/mesh/autoMesh/autoHexMesh/refinementSurfaces/refinementSurfaces.C
+++ b/src/mesh/autoMesh/autoHexMesh/refinementSurfaces/refinementSurfaces.C
@@ -50,268 +50,6 @@ const Foam::NamedEnum<Foam::refinementSurfaces::areaSelectionAlgo, 4>
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
-// Construct from components
-Foam::refinementSurfaces::refinementSurfaces
-(
-    const searchableSurfaces& allGeometry,
-    const PtrList<dictionary>& surfaceDicts
-)
-:
-    allGeometry_(allGeometry),
-    surfaces_(surfaceDicts.size()),
-    names_(surfaceDicts.size()),
-    faceZoneNames_(surfaceDicts.size()),
-    cellZoneNames_(surfaceDicts.size()),
-    zoneInside_(surfaceDicts.size(), NONE),
-    zoneInsidePoints_(surfaceDicts.size()),
-    regionOffset_(surfaceDicts.size())
-{
-    labelList globalMinLevel(surfaceDicts.size(), 0);
-    labelList globalMaxLevel(surfaceDicts.size(), 0);
-    scalarField globalAngle(surfaceDicts.size(), -GREAT);
-    List<Map<label> > regionMinLevel(surfaceDicts.size());
-    List<Map<label> > regionMaxLevel(surfaceDicts.size());
-    List<Map<scalar> > regionAngle(surfaceDicts.size());
-
-    //wordList globalPatchType(surfaceDicts.size());
-    //List<HashTable<word> > regionPatchType(surfaceDicts.size());
-    //List<HashTable<word> > regionPatchName(surfaceDicts.size());
-
-    forAll(surfaceDicts, surfI)
-    {
-        const dictionary& dict = surfaceDicts[surfI];
-
-        dict.lookup("name") >> names_[surfI];
-
-        surfaces_[surfI] = allGeometry_.findSurfaceID(names_[surfI]);
-
-        // Global refinement level
-        globalMinLevel[surfI] = readLabel(dict.lookup("minRefinementLevel"));
-        globalMaxLevel[surfI] = readLabel(dict.lookup("maxRefinementLevel"));
-
-        // Global zone names per surface
-        if (dict.readIfPresent("faceZone", faceZoneNames_[surfI]))
-        {
-            // Read optional entry to determine inside of faceZone
-
-            word method;
-            bool hasSide = dict.readIfPresent("cellZoneInside", method);
-            if (hasSide)
-            {
-                zoneInside_[surfI] = areaSelectionAlgoNames[method];
-                if (zoneInside_[surfI] == INSIDEPOINT)
-                {
-                    dict.lookup("insidePoint") >> zoneInsidePoints_[surfI];
-                }
-            }
-            else
-            {
-                // Check old syntax
-                bool inside;
-                if (dict.readIfPresent("zoneInside", inside))
-                {
-                    hasSide = true;
-                    zoneInside_[surfI] = (inside ? INSIDE : OUTSIDE);
-                }
-            }
-
-            // Read optional cellZone name
-
-            if (dict.readIfPresent("cellZone", cellZoneNames_[surfI]))
-            {
-                if
-                (
-                    (
-                        zoneInside_[surfI] == INSIDE
-                     || zoneInside_[surfI] == OUTSIDE
-                    )
-                 && !allGeometry_[surfaces_[surfI]].hasVolumeType()
-                )
-                {
-                    IOWarningIn
-                    (
-                        "refinementSurfaces::refinementSurfaces(..)",
-                        dict
-                    )   << "Illegal entry zoneInside "
-                        << areaSelectionAlgoNames[zoneInside_[surfI]]
-                        << " for faceZone "
-                        << faceZoneNames_[surfI]
-                        << " since surface " << names_[surfI]
-                        << " is not closed." << endl;
-                }
-            }
-            else if (hasSide)
-            {
-                IOWarningIn("refinementSurfaces::refinementSurfaces(..)", dict)
-                    << "Unused entry zoneInside for faceZone "
-                    << faceZoneNames_[surfI]
-                    << " since no cellZone specified."
-                    << endl;
-            }
-        }
-
-        // Global perpendicular angle
-        dict.readIfPresent("perpendicularAngle", globalAngle[surfI]);
-
-        //// Global patch name per surface
-        //dict.readIfPresent("patchType", globalPatchType[surfI]);
-
-        if (dict.found("regions"))
-        {
-            PtrList<dictionary> regionDicts(dict.lookup("regions"));
-
-            const wordList& regionNames =
-                allGeometry_[surfaces_[surfI]].regions();
-
-            forAll(regionDicts, dictI)
-            {
-                const dictionary& regionDict = regionDicts[dictI];
-
-                const word regionName(regionDict.lookup("name"));
-
-                label regionI = findIndex(regionNames, regionName);
-
-                if (regionI == -1)
-                {
-                    FatalErrorIn
-                    (
-                        "refinementSurfaces::refinementSurfaces"
-                        "(const IOobject&, const PtrList<dictionary>&)"
-                    )   << "No region called " << regionName << " on surface "
-                        << allGeometry_[surfaces_[surfI]].name() << endl
-                        << "Valid regions are " << regionNames
-                        << exit(FatalError);
-                }
-
-
-                label min = readLabel(regionDict.lookup("minRefinementLevel"));
-                label max = readLabel(regionDict.lookup("maxRefinementLevel"));
-
-                bool hasInserted = regionMinLevel[surfI].insert(regionI, min);
-                if (!hasInserted)
-                {
-                    FatalErrorIn
-                    (
-                        "refinementSurfaces::refinementSurfaces"
-                        "(const IOobject&, const PtrList<dictionary>&)"
-                    )   << "Duplicate region name " << regionName
-                        << " on surface " << names_[surfI]
-                        << exit(FatalError);
-                }
-                regionMaxLevel[surfI].insert(regionI, max);
-
-                if (regionDict.found("perpendicularAngle"))
-                {
-                    regionAngle[surfI].insert
-                    (
-                        regionI,
-                        readScalar(regionDict.lookup("perpendicularAngle"))
-                    );
-                }
-            }
-        }
-    }
-
-
-    // Check for duplicate surface names
-    {
-        HashTable<label> surfaceNames(names_.size());
-
-        forAll(names_, surfI)
-        {
-            if (!surfaceNames.insert(names_[surfI], surfI))
-            {
-                FatalErrorIn
-                (
-                    "refinementSurfaces::refinementSurfaces"
-                    "(const IOobject&, const PtrList<dictionary>&)"
-                )   << "Duplicate surface name " << names_[surfI] << endl
-                    << "Previous occurrence of name at surface "
-                    << surfaceNames[names_[surfI]]
-                    << exit(FatalError);
-            }
-        }
-    }
-
-    // Calculate local to global region offset
-    label nRegions = 0;
-
-    forAll(surfaceDicts, surfI)
-    {
-        regionOffset_[surfI] = nRegions;
-
-        nRegions += allGeometry_[surfaces_[surfI]].regions().size();
-    }
-
-    // Rework surface specific information into information per global region
-    minLevel_.setSize(nRegions);
-    minLevel_ = 0;
-    maxLevel_.setSize(nRegions);
-    maxLevel_ = 0;
-    perpendicularAngle_.setSize(nRegions);
-    perpendicularAngle_ = -GREAT;
-    //patchName_.setSize(nRegions);
-    //patchType_.setSize(nRegions);
-
-    forAll(surfaceDicts, surfI)
-    {
-        label nRegions = allGeometry_[surfaces_[surfI]].regions().size();
-
-        // Initialise to global (i.e. per surface)
-        for (label i = 0; i < nRegions; i++)
-        {
-            minLevel_[regionOffset_[surfI] + i] = globalMinLevel[surfI];
-            maxLevel_[regionOffset_[surfI] + i] = globalMaxLevel[surfI];
-            perpendicularAngle_[regionOffset_[surfI] + i] = globalAngle[surfI];
-        }
-
-        // Overwrite with region specific information
-        forAllConstIter(Map<label>, regionMinLevel[surfI], iter)
-        {
-            label globalRegionI = regionOffset_[surfI] + iter.key();
-
-            minLevel_[globalRegionI] = iter();
-            maxLevel_[globalRegionI] = regionMaxLevel[surfI][iter.key()];
-
-            // Check validity
-            if
-            (
-                minLevel_[globalRegionI] < 0
-             || maxLevel_[globalRegionI] < minLevel_[globalRegionI]
-            )
-            {
-                FatalErrorIn
-                (
-                    "refinementSurfaces::refinementSurfaces"
-                    "(const IOobject&, const PtrList<dictionary>&)"
-                )   << "Illegal level or layer specification for surface "
-                    << names_[surfI]
-                    << " : minLevel:" << minLevel_[globalRegionI]
-                    << " maxLevel:" << maxLevel_[globalRegionI]
-                    << exit(FatalError);
-            }
-        }
-        forAllConstIter(Map<scalar>, regionAngle[surfI], iter)
-        {
-            label globalRegionI = regionOffset_[surfI] + iter.key();
-
-            perpendicularAngle_[globalRegionI] = regionAngle[surfI][iter.key()];
-        }
-
-
-        //// Optional patch names and patch types
-        //forAllConstIter(HashTable<word>, regionPatchName[surfI], iter)
-        //{
-        //    label regionI = findIndex(regionNames, iter.key());
-        //    label globalRegionI = regionOffset_[surfI] + regionI;
-        //
-        //    patchName_[globalRegionI] = iter();
-        //    patchType_[globalRegionI] = regionPatchType[surfI][iter.key()];
-        //}
-    }
-}
-
-
 Foam::refinementSurfaces::refinementSurfaces
 (
     const searchableSurfaces& allGeometry,
@@ -353,9 +91,11 @@ Foam::refinementSurfaces::refinementSurfaces
     labelList globalMinLevel(surfI, 0);
     labelList globalMaxLevel(surfI, 0);
     scalarField globalAngle(surfI, -GREAT);
+    PtrList<dictionary> globalPatchInfo(surfI);
     List<Map<label> > regionMinLevel(surfI);
     List<Map<label> > regionMaxLevel(surfI);
     List<Map<scalar> > regionAngle(surfI);
+    List<Map<autoPtr<dictionary> > > regionPatchInfo(surfI);
 
     surfI = 0;
     forAll(allGeometry.names(), geomI)
@@ -439,6 +179,14 @@ Foam::refinementSurfaces::refinementSurfaces
             }
 
             // Global perpendicular angle
+            if (dict.found("patchInfo"))
+            {
+                globalPatchInfo.set
+                (
+                    surfI,
+                    dict.subDict("patchInfo").clone()
+                );
+            }
             dict.readIfPresent("perpendicularAngle", globalAngle[surfI]);
 
             if (dict.found("regions"))
@@ -473,6 +221,15 @@ Foam::refinementSurfaces::refinementSurfaces
                                 )
                             );
                         }
+
+                        if (regionDict.found("patchInfo"))
+                        {
+                            regionPatchInfo[surfI].insert
+                            (
+                                regionI,
+                                regionDict.subDict("patchInfo").clone()
+                            );
+                        }
                     }
                 }
             }
@@ -496,6 +253,7 @@ Foam::refinementSurfaces::refinementSurfaces
     maxLevel_ = 0;
     perpendicularAngle_.setSize(nRegions);
     perpendicularAngle_ = -GREAT;
+    patchInfo_.setSize(nRegions);
 
 
     forAll(globalMinLevel, surfI)
@@ -505,9 +263,18 @@ Foam::refinementSurfaces::refinementSurfaces
         // Initialise to global (i.e. per surface)
         for (label i = 0; i < nRegions; i++)
         {
-            minLevel_[regionOffset_[surfI] + i] = globalMinLevel[surfI];
-            maxLevel_[regionOffset_[surfI] + i] = globalMaxLevel[surfI];
-            perpendicularAngle_[regionOffset_[surfI] + i] = globalAngle[surfI];
+            label globalRegionI = regionOffset_[surfI] + i;
+            minLevel_[globalRegionI] = globalMinLevel[surfI];
+            maxLevel_[globalRegionI] = globalMaxLevel[surfI];
+            perpendicularAngle_[globalRegionI] = globalAngle[surfI];
+            if (globalPatchInfo.set(surfI))
+            {
+                patchInfo_.set
+                (
+                    globalRegionI,
+                    globalPatchInfo[surfI].clone()
+                );
+            }
         }
 
         // Overwrite with region specific information
@@ -542,6 +309,14 @@ Foam::refinementSurfaces::refinementSurfaces
 
             perpendicularAngle_[globalRegionI] = regionAngle[surfI][iter.key()];
         }
+
+        const Map<autoPtr<dictionary> >& localInfo = regionPatchInfo[surfI];
+        forAllConstIter(Map<autoPtr<dictionary> >, localInfo, iter)
+        {
+            label globalRegionI = regionOffset_[surfI] + iter.key();
+
+            patchInfo_.set(globalRegionI, iter()().clone());
+        }
     }
 }
 
@@ -1166,7 +941,7 @@ void Foam::refinementSurfaces::findNearestRegion
 (
     const labelList& surfacesToTest,
     const pointField& samples,
-    const  scalarField& nearestDistSqr,
+    const scalarField& nearestDistSqr,
     labelList& hitSurface,
     labelList& hitRegion
 ) const
diff --git a/src/mesh/autoMesh/autoHexMesh/refinementSurfaces/refinementSurfaces.H b/src/mesh/autoMesh/autoHexMesh/refinementSurfaces/refinementSurfaces.H
index 8191f8cc428ca479e85f701e7fd0b23f94a22fab..ad854da16f39cd9ee7994499864debae1cec13dd 100644
--- a/src/mesh/autoMesh/autoHexMesh/refinementSurfaces/refinementSurfaces.H
+++ b/src/mesh/autoMesh/autoHexMesh/refinementSurfaces/refinementSurfaces.H
@@ -109,6 +109,9 @@ private:
         //- From global region number to perpendicular angle
         scalarField perpendicularAngle_;
 
+        //- From global region number to patchType
+        PtrList<dictionary> patchInfo_;
+
 
     // Private Member Functions
 
@@ -123,13 +126,6 @@ public:
 
     // Constructors
 
-        //- Construct from surfaces and dictionaries
-        refinementSurfaces
-        (
-            const searchableSurfaces& allGeometry,
-            const PtrList<dictionary>&
-        );
-
         //- Construct from surfaces and dictionary
         refinementSurfaces
         (
@@ -215,6 +211,12 @@ public:
                 return perpendicularAngle_;
             }
 
+            //- From global region number to patch type
+            const PtrList<dictionary>& patchInfo() const
+            {
+                return patchInfo_;
+            }
+
 
         // Helper
 
diff --git a/src/meshTools/Make/files b/src/meshTools/Make/files
index 14e561fcbab7221adc85de4628a2beb592841680..2c9f81195d082b75e3b08a62ede15f2a8ec37d85 100644
--- a/src/meshTools/Make/files
+++ b/src/meshTools/Make/files
@@ -44,7 +44,6 @@ octree/octreeDataFace.C
 octree/treeBoundBox.C
 octree/treeNodeName.C
 octree/treeLeafName.C
-octree/pointIndexHitIOList.C
 
 indexedOctree/indexedOctreeName.C
 indexedOctree/treeDataCell.C
diff --git a/src/meshTools/indexedOctree/indexedOctree.C b/src/meshTools/indexedOctree/indexedOctree.C
index 2f1e13648bca18f1bc684e5ea74e6ac74429b33a..9971bd97b4020119e2c7323ec817abe174573ff4 100644
--- a/src/meshTools/indexedOctree/indexedOctree.C
+++ b/src/meshTools/indexedOctree/indexedOctree.C
@@ -2056,6 +2056,180 @@ void Foam::indexedOctree<Type>::findBox
 }
 
 
+template <class Type>
+template <class CompareOp>
+void Foam::indexedOctree<Type>::findNear
+(
+    const scalar nearDist,
+    const bool okOrder,
+    const indexedOctree<Type>& tree1,
+    const labelBits index1,
+    const treeBoundBox& bb1,
+    const indexedOctree<Type>& tree2,
+    const labelBits index2,
+    const treeBoundBox& bb2,
+    CompareOp& cop
+)
+{
+    const vector nearSpan(nearDist, nearDist, nearDist);
+
+    if (tree1.isNode(index1))
+    {
+        const node& nod1 = tree1.nodes()[tree1.getNode(index1)];
+        const treeBoundBox searchBox
+        (
+            bb1.min()-nearSpan,
+            bb1.max()+nearSpan
+        );
+
+        if (tree2.isNode(index2))
+        {
+            if (bb2.overlaps(searchBox))
+            {
+                const node& nod2 = tree2.nodes()[tree2.getNode(index2)];
+
+                for (direction i2 = 0; i2 < nod2.subNodes_.size(); i2++)
+                {
+                    labelBits subIndex2 = nod2.subNodes_[i2];
+                    const treeBoundBox subBb2
+                    (
+                        tree2.isNode(subIndex2)
+                      ? tree2.nodes()[tree2.getNode(subIndex2)].bb_
+                      : bb2.subBbox(i2)
+                    );
+
+                    findNear
+                    (
+                        nearDist,
+                        !okOrder,
+                        tree2,
+                        subIndex2,
+                        subBb2,
+                        tree1,
+                        index1,
+                        bb1,
+                        cop
+                    );
+                }
+            }
+        }
+        else if (tree2.isContent(index2))
+        {
+            // index2 is leaf, index1 not yet.
+            for (direction i1 = 0; i1 < nod1.subNodes_.size(); i1++)
+            {
+                labelBits subIndex1 = nod1.subNodes_[i1];
+                const treeBoundBox subBb1
+                (
+                    tree1.isNode(subIndex1)
+                  ? tree1.nodes()[tree1.getNode(subIndex1)].bb_
+                  : bb1.subBbox(i1)
+                );
+
+                findNear
+                (
+                    nearDist,
+                    !okOrder,
+                    tree2,
+                    index2,
+                    bb2,
+                    tree1,
+                    subIndex1,
+                    subBb1,
+                    cop
+                );
+            }
+        }
+    }
+    else if (tree1.isContent(index1))
+    {
+        const treeBoundBox searchBox
+        (
+            bb1.min()-nearSpan,
+            bb1.max()+nearSpan
+        );
+
+        if (tree2.isNode(index2))
+        {
+            const node& nod2 =
+                tree2.nodes()[tree2.getNode(index2)];
+
+            if (bb2.overlaps(searchBox))
+            {
+                for (direction i2 = 0; i2 < nod2.subNodes_.size(); i2++)
+                {
+                    labelBits subIndex2 = nod2.subNodes_[i2];
+                    const treeBoundBox subBb2
+                    (
+                        tree2.isNode(subIndex2)
+                      ? tree2.nodes()[tree2.getNode(subIndex2)].bb_
+                      : bb2.subBbox(i2)
+                    );
+
+                    findNear
+                    (
+                        nearDist,
+                        !okOrder,
+                        tree2,
+                        subIndex2,
+                        subBb2,
+                        tree1,
+                        index1,
+                        bb1,
+                        cop
+                    );
+                }
+            }
+        }
+        else if (tree2.isContent(index2))
+        {
+            // Both are leaves. Check n^2.
+
+            const labelList& indices1 =
+                tree1.contents()[tree1.getContent(index1)];
+            const labelList& indices2 =
+                tree2.contents()[tree2.getContent(index2)];
+
+            forAll(indices1, i)
+            {
+                label shape1 = indices1[i];
+
+                forAll(indices2, j)
+                {
+                    label shape2 = indices2[j];
+
+                    if ((&tree1 != &tree2) || (shape1 != shape2))
+                    {
+                        if (okOrder)
+                        {
+                            cop
+                            (
+                                nearDist,
+                                tree1.shapes(),
+                                shape1,
+                                tree2.shapes(),
+                                shape2
+                            );
+                        }
+                        else
+                        {
+                            cop
+                            (
+                                nearDist,
+                                tree2.shapes(),
+                                shape2,
+                                tree1.shapes(),
+                                shape1
+                            );
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
+
+
 // Number of elements in node.
 template <class Type>
 Foam::label Foam::indexedOctree<Type>::countElements
@@ -2620,6 +2794,30 @@ Foam::indexedOctree<Type>::getVolumeType
 }
 
 
+template <class Type>
+template <class CompareOp>
+void Foam::indexedOctree<Type>::findNear
+(
+    const scalar nearDist,
+    const indexedOctree<Type>& tree2,
+    CompareOp& cop
+) const
+{
+    findNear
+    (
+        nearDist,
+        true,
+        *this,
+        nodePlusOctant(0, 0),
+        bb(),
+        tree2,
+        nodePlusOctant(0, 0),
+        tree2.bb(),
+        cop
+    );
+}
+
+
 // Print contents of nodeI
 template <class Type>
 void Foam::indexedOctree<Type>::print
diff --git a/src/meshTools/indexedOctree/indexedOctree.H b/src/meshTools/indexedOctree/indexedOctree.H
index 6d7f42517693e59451720fe768eafb6a51ce463c..980cb346f8ae57800be5a60b5c38fdcd4d7ea31c 100644
--- a/src/meshTools/indexedOctree/indexedOctree.H
+++ b/src/meshTools/indexedOctree/indexedOctree.H
@@ -164,8 +164,8 @@ private:
 
         // Construction
 
-            //- Split list of indices into 8 bins according to where they are in
-            //  relation to mid.
+            //- Split list of indices into 8 bins
+            //  according to where they are in relation to mid.
             void divide
             (
                 const labelList& indices,
@@ -173,8 +173,8 @@ private:
                 labelListList& result
             ) const;
 
-            //- Subdivide the contents node at position contentI. Appends to
-            //  contents.
+            //- Subdivide the contents node at position contentI.
+            //  Appends to contents.
             node divide
             (
                 const treeBoundBox& bb,
@@ -336,6 +336,22 @@ private:
                 labelHashSet& elements
             ) const;
 
+
+            template <class CompareOp>
+            static void findNear
+            (
+                const scalar nearDist,
+                const bool okOrder,
+                const indexedOctree<Type>& tree1,
+                const labelBits index1,
+                const treeBoundBox& bb1,
+                const indexedOctree<Type>& tree2,
+                const labelBits index2,
+                const treeBoundBox& bb2,
+                CompareOp& cop
+            );
+
+
         // Other
 
             //- Count number of elements on this and sublevels
@@ -581,6 +597,16 @@ public:
                 const point& sample
             );
 
+            //- Find near pairs and apply CompareOp to them.
+            //  tree2 can be *this or different tree.
+            template <class CompareOp>
+            void findNear
+            (
+                const scalar nearDist,
+                const indexedOctree<Type>& tree2,
+                CompareOp& cop
+            ) const;
+
 
         // Write
 
diff --git a/src/meshTools/indexedOctree/treeDataCell.C b/src/meshTools/indexedOctree/treeDataCell.C
index 87b5dde12388bde1b1fa3c120c266792f8ed016f..8492f59c4f8cfe7436a05c42c05c4e9d18d4cdda 100644
--- a/src/meshTools/indexedOctree/treeDataCell.C
+++ b/src/meshTools/indexedOctree/treeDataCell.C
@@ -64,29 +64,49 @@ Foam::treeBoundBox Foam::treeDataCell::calcCellBb(const label cellI) const
 }
 
 
+void Foam::treeDataCell::update()
+{
+    if (cacheBb_)
+    {
+        bbs_.setSize(cellLabels_.size());
+
+        forAll(cellLabels_, i)
+        {
+            bbs_[i] = calcCellBb(cellLabels_[i]);
+        }
+    }
+}
+
+
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
-// Construct from components
 Foam::treeDataCell::treeDataCell
 (
     const bool cacheBb,
     const primitiveMesh& mesh,
-    const labelList& cellLabels
+    const unallocLabelList& cellLabels
 )
 :
     mesh_(mesh),
     cellLabels_(cellLabels),
     cacheBb_(cacheBb)
 {
-    if (cacheBb_)
-    {
-        bbs_.setSize(cellLabels_.size());
+    update();
+}
 
-        forAll(cellLabels_, i)
-        {
-            bbs_[i] = calcCellBb(cellLabels_[i]);
-        }
-    }
+
+Foam::treeDataCell::treeDataCell
+(
+    const bool cacheBb,
+    const primitiveMesh& mesh,
+    const Xfer<labelList>& cellLabels
+)
+:
+    mesh_(mesh),
+    cellLabels_(cellLabels),
+    cacheBb_(cacheBb)
+{
+    update();
 }
 
 
@@ -100,15 +120,7 @@ Foam::treeDataCell::treeDataCell
     cellLabels_(identity(mesh_.nCells())),
     cacheBb_(cacheBb)
 {
-    if (cacheBb_)
-    {
-        bbs_.setSize(cellLabels_.size());
-
-        forAll(cellLabels_, i)
-        {
-            bbs_[i] = calcCellBb(cellLabels_[i]);
-        }
-    }
+    update();
 }
 
 
@@ -159,7 +171,7 @@ bool Foam::treeDataCell::contains
 // nearestPoint.
 void Foam::treeDataCell::findNearest
 (
-    const labelList& indices,
+    const unallocLabelList& indices,
     const point& sample,
 
     scalar& nearestDistSqr,
diff --git a/src/meshTools/indexedOctree/treeDataCell.H b/src/meshTools/indexedOctree/treeDataCell.H
index 7e42a6d9066a3e0dcc4b092674d92c9620a5fb07..4bf5ddb5c2379d33f23610a53bd23afa73754075 100644
--- a/src/meshTools/indexedOctree/treeDataCell.H
+++ b/src/meshTools/indexedOctree/treeDataCell.H
@@ -48,7 +48,7 @@ class primitiveMesh;
 template<class Type> class indexedOctree;
 
 /*---------------------------------------------------------------------------*\
-                           Class treeDataCell Declaration
+                        Class treeDataCell Declaration
 \*---------------------------------------------------------------------------*/
 
 class treeDataCell
@@ -72,6 +72,9 @@ class treeDataCell
         //- Calculate cell bounding box
         treeBoundBox calcCellBb(const label cellI) const;
 
+        //- Initialise all member data
+        void update();
+
 public:
 
     // Declare name of the class and its debug switch
@@ -85,7 +88,15 @@ public:
         (
             const bool cacheBb,
             const primitiveMesh&,
-            const labelList&
+            const unallocLabelList&
+        );
+
+        //- Construct from mesh and subset of cells, transferring contents
+        treeDataCell
+        (
+            const bool cacheBb,
+            const primitiveMesh&,
+            const Xfer<labelList>&
         );
 
         //- Construct from mesh. Uses all cells in mesh.
@@ -96,18 +107,18 @@ public:
 
         // Access
 
-            const labelList& cellLabels() const
+            inline const labelList& cellLabels() const
             {
                 return cellLabels_;
             }
 
-            const primitiveMesh& mesh() const
+            inline const primitiveMesh& mesh() const
             {
                 return mesh_;
             }
 
 
-            label size() const
+            inline label size() const
             {
                 return cellLabels_.size();
             }
@@ -153,7 +164,7 @@ public:
             //  Returns actual point and distance (squared)
             void findNearest
             (
-                const labelList& indices,
+                const unallocLabelList& indices,
                 const point& sample,
 
                 scalar& nearestDistSqr,
@@ -165,7 +176,7 @@ public:
             //  Returns point and distance (squared)
             void findNearest
             (
-                const labelList& indices,
+                const unallocLabelList& indices,
                 const linePointRef& ln,
 
                 treeBoundBox& tightest,
@@ -177,7 +188,7 @@ public:
                 notImplemented
                 (
                     "treeDataCell::findNearest"
-                    "(const labelList&, const linePointRef&, ..)"
+                    "(const unallocLabelList&, const linePointRef&, ..)"
                 );
             }
 
diff --git a/src/meshTools/indexedOctree/treeDataEdge.C b/src/meshTools/indexedOctree/treeDataEdge.C
index 0adc3b781cc097098c7368cb0370a35a60a3d5e4..0a65f8ece811c654f65dc1685ada1ee25208e6d1 100644
--- a/src/meshTools/indexedOctree/treeDataEdge.C
+++ b/src/meshTools/indexedOctree/treeDataEdge.C
@@ -43,15 +43,28 @@ Foam::treeBoundBox Foam::treeDataEdge::calcBb(const label edgeI) const
 }
 
 
+void Foam::treeDataEdge::update()
+{
+    if (cacheBb_)
+    {
+        bbs_.setSize(edgeLabels_.size());
+
+        forAll(edgeLabels_, i)
+        {
+            bbs_[i] = calcBb(edgeLabels_[i]);
+        }
+    }
+}
+
+
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
-// Construct from components
 Foam::treeDataEdge::treeDataEdge
 (
     const bool cacheBb,
     const edgeList& edges,
     const pointField& points,
-    const labelList& edgeLabels
+    const unallocLabelList& edgeLabels
 )
 :
     edges_(edges),
@@ -59,15 +72,24 @@ Foam::treeDataEdge::treeDataEdge
     edgeLabels_(edgeLabels),
     cacheBb_(cacheBb)
 {
-    if (cacheBb_)
-    {
-        bbs_.setSize(edgeLabels_.size());
+    update();
+}
 
-        forAll(edgeLabels_, i)
-        {
-            bbs_[i] = calcBb(edgeLabels_[i]);
-        }
-    }
+
+Foam::treeDataEdge::treeDataEdge
+(
+    const bool cacheBb,
+    const edgeList& edges,
+    const pointField& points,
+    const Xfer<labelList>& edgeLabels
+)
+:
+    edges_(edges),
+    points_(points),
+    edgeLabels_(edgeLabels),
+    cacheBb_(cacheBb)
+{
+    update();
 }
 
 
@@ -121,7 +143,7 @@ bool Foam::treeDataEdge::overlaps
 // nearestPoint.
 void Foam::treeDataEdge::findNearest
 (
-    const labelList& indices,
+    const unallocLabelList& indices,
     const point& sample,
 
     scalar& nearestDistSqr,
@@ -131,7 +153,7 @@ void Foam::treeDataEdge::findNearest
 {
     forAll(indices, i)
     {
-        label index = indices[i];
+        const label index = indices[i];
 
         const edge& e = edges_[edgeLabels_[index]];
 
@@ -153,7 +175,7 @@ void Foam::treeDataEdge::findNearest
 //  Returns point and distance (squared)
 void Foam::treeDataEdge::findNearest
 (
-    const labelList& indices,
+    const unallocLabelList& indices,
     const linePointRef& ln,
 
     treeBoundBox& tightest,
@@ -167,7 +189,7 @@ void Foam::treeDataEdge::findNearest
 
     forAll(indices, i)
     {
-        label index = indices[i];
+        const label index = indices[i];
 
         const edge& e = edges_[edgeLabels_[index]];
 
diff --git a/src/meshTools/indexedOctree/treeDataEdge.H b/src/meshTools/indexedOctree/treeDataEdge.H
index 68f3a5924a3602900dfd2fafd735c05b329ee453..8b7e54879fad4f58a0a0013c6e64de273ccc5dca 100644
--- a/src/meshTools/indexedOctree/treeDataEdge.H
+++ b/src/meshTools/indexedOctree/treeDataEdge.H
@@ -81,6 +81,9 @@ class treeDataEdge
         //- Calculate edge bounding box
         treeBoundBox calcBb(const label edgeI) const;
 
+        //- Initialise all member data
+        void update();
+
 public:
 
     // Declare name of the class and its debug switch
@@ -95,7 +98,17 @@ public:
             const bool cacheBb,
             const edgeList& edges,
             const pointField& points,
-            const labelList& edgeLabels
+            const unallocLabelList& edgeLabels
+        );
+
+        //- Construct from selected edges, transferring contents.
+        // !Holds references to edges and points
+        treeDataEdge
+        (
+            const bool cacheBb,
+            const edgeList& edges,
+            const pointField& points,
+            const Xfer<labelList>& edgeLabels
         );
 
 
@@ -139,7 +152,7 @@ public:
             //  Returns actual point and distance (squared)
             void findNearest
             (
-                const labelList& indices,
+                const unallocLabelList& indices,
                 const point& sample,
 
                 scalar& nearestDistSqr,
@@ -151,7 +164,7 @@ public:
             //  Returns point and distance (squared)
             void findNearest
             (
-                const labelList& indices,
+                const unallocLabelList& indices,
                 const linePointRef& ln,
 
                 treeBoundBox& tightest,
diff --git a/src/meshTools/indexedOctree/treeDataFace.C b/src/meshTools/indexedOctree/treeDataFace.C
index bf2bd722e5bc51d8e70ab79355061ce9b6f40710..f8273bec03a5fb0220bf01e9381d109365332f7b 100644
--- a/src/meshTools/indexedOctree/treeDataFace.C
+++ b/src/meshTools/indexedOctree/treeDataFace.C
@@ -76,12 +76,27 @@ void Foam::treeDataFace::update()
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
-// Construct from components
 Foam::treeDataFace::treeDataFace
 (
     const bool cacheBb,
     const primitiveMesh& mesh,
-    const labelList& faceLabels
+    const unallocLabelList& faceLabels
+)
+:
+    mesh_(mesh),
+    faceLabels_(faceLabels),
+    isTreeFace_(mesh.nFaces(), 0),
+    cacheBb_(cacheBb)
+{
+    update();
+}
+
+
+Foam::treeDataFace::treeDataFace
+(
+    const bool cacheBb,
+    const primitiveMesh& mesh,
+    const Xfer<labelList>& faceLabels
 )
 :
     mesh_(mesh),
@@ -467,7 +482,7 @@ bool Foam::treeDataFace::overlaps
 // nearestPoint.
 void Foam::treeDataFace::findNearest
 (
-    const labelList& indices,
+    const unallocLabelList& indices,
     const point& sample,
 
     scalar& nearestDistSqr,
@@ -477,7 +492,7 @@ void Foam::treeDataFace::findNearest
 {
     forAll(indices, i)
     {
-        label index = indices[i];
+        const label index = indices[i];
 
         const face& f = mesh_.faces()[faceLabels_[index]];
 
@@ -514,7 +529,7 @@ bool Foam::treeDataFace::intersects
         }
     }
 
-    label faceI = faceLabels_[index];
+    const label faceI = faceLabels_[index];
 
     const vector dir(end - start);
 
diff --git a/src/meshTools/indexedOctree/treeDataFace.H b/src/meshTools/indexedOctree/treeDataFace.H
index 4337f1b78d24ecd72ee3942a6f34aa9b81576b6d..6dbb881dbb5b70715d80a7c854f1f02fda84da94 100644
--- a/src/meshTools/indexedOctree/treeDataFace.H
+++ b/src/meshTools/indexedOctree/treeDataFace.H
@@ -51,7 +51,7 @@ class primitiveMesh;
 class polyPatch;
 
 /*---------------------------------------------------------------------------*\
-                           Class treeDataFace Declaration
+                        Class treeDataFace Declaration
 \*---------------------------------------------------------------------------*/
 
 class treeDataFace
@@ -101,7 +101,15 @@ public:
         (
             const bool cacheBb,
             const primitiveMesh&,
-            const labelList&
+            const unallocLabelList&
+        );
+
+        //- Construct from mesh and subset of faces, transferring contents
+        treeDataFace
+        (
+            const bool cacheBb,
+            const primitiveMesh&,
+            const Xfer<labelList>&
         );
 
         //- Construct from mesh. Uses all faces in mesh.
@@ -115,17 +123,17 @@ public:
 
         // Access
 
-            const labelList& faceLabels() const
+            inline const labelList& faceLabels() const
             {
                 return faceLabels_;
             }
 
-            const primitiveMesh& mesh() const
+            inline const primitiveMesh& mesh() const
             {
                 return mesh_;
             }
 
-            label size() const
+            inline label size() const
             {
                 return faceLabels_.size();
             }
@@ -156,7 +164,7 @@ public:
             //  Returns actual point and distance (squared)
             void findNearest
             (
-                const labelList& indices,
+                const unallocLabelList& indices,
                 const point& sample,
 
                 scalar& nearestDistSqr,
@@ -168,7 +176,7 @@ public:
             //  Returns point and distance (squared)
             void findNearest
             (
-                const labelList& indices,
+                const unallocLabelList& indices,
                 const linePointRef& ln,
 
                 treeBoundBox& tightest,
@@ -180,7 +188,7 @@ public:
                 notImplemented
                 (
                     "treeDataFace::findNearest"
-                    "(const labelList&, const linePointRef&, ..)"
+                    "(const unallocLabelList&, const linePointRef&, ..)"
                 );
             }
 
diff --git a/src/meshTools/indexedOctree/treeDataPoint.C b/src/meshTools/indexedOctree/treeDataPoint.C
index db5f61e00105498d94c2f1eced81464cac87d3a9..ffdbfdd4e091b0777aa5be7fc38cd5ce842a51e5 100644
--- a/src/meshTools/indexedOctree/treeDataPoint.C
+++ b/src/meshTools/indexedOctree/treeDataPoint.C
@@ -36,7 +36,6 @@ defineTypeNameAndDebug(Foam::treeDataPoint, 0);
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
-// Construct from components
 Foam::treeDataPoint::treeDataPoint(const pointField& points)
 :
     points_(points)
@@ -78,7 +77,7 @@ bool Foam::treeDataPoint::overlaps
 // nearestPoint.
 void Foam::treeDataPoint::findNearest
 (
-    const labelList& indices,
+    const unallocLabelList& indices,
     const point& sample,
 
     scalar& nearestDistSqr,
@@ -88,7 +87,7 @@ void Foam::treeDataPoint::findNearest
 {
     forAll(indices, i)
     {
-        label index = indices[i];
+        const label index = indices[i];
 
         const point& pt = points_[index];
 
@@ -108,7 +107,7 @@ void Foam::treeDataPoint::findNearest
 //  Returns point and distance (squared)
 void Foam::treeDataPoint::findNearest
 (
-    const labelList& indices,
+    const unallocLabelList& indices,
     const linePointRef& ln,
 
     treeBoundBox& tightest,
@@ -122,7 +121,7 @@ void Foam::treeDataPoint::findNearest
 
     forAll(indices, i)
     {
-        label index = indices[i];
+        const label index = indices[i];
 
         const point& shapePt = points_[index];
 
diff --git a/src/meshTools/indexedOctree/treeDataPoint.H b/src/meshTools/indexedOctree/treeDataPoint.H
index c2522120f7c1302d30b9006ed4dcbd8d910f2dd9..236f8139b8dd38f457b2e8408e645b3f9f3e6386 100644
--- a/src/meshTools/indexedOctree/treeDataPoint.H
+++ b/src/meshTools/indexedOctree/treeDataPoint.H
@@ -69,14 +69,14 @@ public:
     // Constructors
 
         //- Construct from components. Holds reference to points!
-        treeDataPoint(const pointField& points);
+        treeDataPoint(const pointField&);
 
 
     // Member Functions
 
         // Access
 
-            label size() const
+            inline label size() const
             {
                 return points_.size();
             }
@@ -107,7 +107,7 @@ public:
             //  Returns actual point and distance (squared)
             void findNearest
             (
-                const labelList& indices,
+                const unallocLabelList& indices,
                 const point& sample,
 
                 scalar& nearestDistSqr,
@@ -119,7 +119,7 @@ public:
             //  Returns point and distance (squared)
             void findNearest
             (
-                const labelList& indices,
+                const unallocLabelList& indices,
                 const linePointRef& ln,
 
                 treeBoundBox& tightest,
diff --git a/src/meshTools/indexedOctree/treeDataPrimitivePatch.C b/src/meshTools/indexedOctree/treeDataPrimitivePatch.C
index ec4bcb543749faca214b7ab973fff7b2ae7c0d21..8fc75b77c500f168f206b89c2942b3d6d09f7bb5 100644
--- a/src/meshTools/indexedOctree/treeDataPrimitivePatch.C
+++ b/src/meshTools/indexedOctree/treeDataPrimitivePatch.C
@@ -477,7 +477,7 @@ void
 Foam::treeDataPrimitivePatch<Face, FaceList, PointField, PointType>::
 findNearest
 (
-    const labelList& indices,
+    const unallocLabelList& indices,
     const point& sample,
 
     scalar& nearestDistSqr,
@@ -489,7 +489,7 @@ findNearest
 
     forAll(indices, i)
     {
-        label index = indices[i];
+        const label index = indices[i];
 
         const face& f = patch_[index];
 
diff --git a/src/meshTools/indexedOctree/treeDataPrimitivePatch.H b/src/meshTools/indexedOctree/treeDataPrimitivePatch.H
index cf7b0cb1eb8342b535516a7e074128a777b81bac..7c3757504b63cf07c8a4460fd72bd50027ee68d9 100644
--- a/src/meshTools/indexedOctree/treeDataPrimitivePatch.H
+++ b/src/meshTools/indexedOctree/treeDataPrimitivePatch.H
@@ -56,7 +56,7 @@ TemplateName(treeDataPrimitivePatch);
 
 
 /*---------------------------------------------------------------------------*\
-                           Class treeDataPrimitivePatch Declaration
+                   Class treeDataPrimitivePatch Declaration
 \*---------------------------------------------------------------------------*/
 
 template
@@ -151,7 +151,7 @@ public:
             //  Returns actual point and distance (squared)
             void findNearest
             (
-                const labelList& indices,
+                const unallocLabelList& indices,
                 const point& sample,
 
                 scalar& nearestDistSqr,
@@ -163,7 +163,7 @@ public:
             //  Returns point and distance (squared)
             void findNearest
             (
-                const labelList& indices,
+                const unallocLabelList& indices,
                 const linePointRef& ln,
 
                 treeBoundBox& tightest,
@@ -175,7 +175,7 @@ public:
                 notImplemented
                 (
                     "treeDataPrimitivePatch::findNearest"
-                    "(const labelList&, const linePointRef&, ..)"
+                    "(const unallocLabelList&, const linePointRef&, ..)"
                 );
             }
 
diff --git a/src/meshTools/indexedOctree/treeDataTriSurface.C b/src/meshTools/indexedOctree/treeDataTriSurface.C
index e0afe06906adc7e5544491dd2f0357efbf8e7d11..f380167174481939ae61a056bae233485239d815 100644
--- a/src/meshTools/indexedOctree/treeDataTriSurface.C
+++ b/src/meshTools/indexedOctree/treeDataTriSurface.C
@@ -35,145 +35,145 @@ defineTypeNameAndDebug(Foam::treeDataTriSurface, 0);
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
 
-// Fast distance to triangle calculation. From
-// "Distance Between Point and Trangle in 3D"
-// David Eberly, Magic Software Inc. Aug. 2003.
-// Works on function Q giving distance to point and tries to minimize this.
-Foam::scalar Foam::treeDataTriSurface::nearestCoords
-(
-    const point& base,
-    const point& E0,
-    const point& E1,
-    const scalar a,
-    const scalar b,
-    const scalar c,
-    const point& P,
-    scalar& s,
-    scalar& t
-)
-{
-    // distance vector
-    const vector D(base - P);
-
-    // Precalculate distance factors.
-    const scalar d = E0 & D;
-    const scalar e = E1 & D;
-
-    // Do classification
-    const scalar det = a*c - b*b;
-
-    s = b*e - c*d;
-    t = b*d - a*e;
-
-    if (s+t < det)
-    {
-        if (s < 0)
-        {
-            if (t < 0)
-            {
-                //region 4
-                if (e > 0)
-                {
-                    //min on edge t = 0
-                    t = 0;
-                    s = (d >= 0 ? 0 : (-d >= a ? 1 : -d/a));
-                }
-                else
-                {
-                    //min on edge s=0
-                    s = 0;
-                    t = (e >= 0 ? 0 : (-e >= c ? 1 : -e/c));
-                }
-            }
-            else
-            {
-                //region 3. Min on edge s = 0
-                s = 0;
-                t = (e >= 0 ? 0 : (-e >= c ? 1 : -e/c));
-            }
-        }
-        else if (t < 0)
-        {
-            //region 5
-            t = 0;
-            s = (d >= 0 ? 0 : (-d >= a ? 1 : -d/a));
-        }
-        else
-        {
-            //region 0
-            const scalar invDet = 1/det;
-            s *= invDet;
-            t *= invDet;
-        }
-    }
-    else
-    {
-        if (s < 0)
-        {
-            //region 2
-            const scalar tmp0 = b + d;
-            const scalar tmp1 = c + e;
-            if (tmp1 > tmp0)
-            {
-                //min on edge s+t=1
-                const scalar numer = tmp1 - tmp0;
-                const scalar denom = a-2*b+c;
-                s = (numer >= denom ? 1 : numer/denom);
-                t = 1 - s;
-            }
-            else
-            {
-                //min on edge s=0
-                s = 0;
-                t = (tmp1 <= 0 ? 1 : (e >= 0 ? 0 : - e/c));
-            }
-        }
-        else if (t < 0)
-        {
-            //region 6
-            const scalar tmp0 = b + d;
-            const scalar tmp1 = c + e;
-            if (tmp1 > tmp0)
-            {
-                //min on edge s+t=1
-                const scalar numer = tmp1 - tmp0;
-                const scalar denom = a-2*b+c;
-                s = (numer >= denom ? 1 : numer/denom);
-                t = 1 - s;
-            }
-            else
-            {
-                //min on edge t=0
-                t = 0;
-                s = (tmp1 <= 0 ? 1 : (d >= 0 ? 0 : - d/a));
-            }
-        }
-        else
-        {
-            //region 1
-            const scalar numer = c+e-(b+d);
-            if (numer <= 0)
-            {
-                s = 0;
-            }
-            else
-            {
-                const scalar denom = a-2*b+c;
-                s = (numer >= denom ? 1 : numer/denom);
-            }
-        }
-        t = 1 - s;
-    }
-
-
-    // Calculate distance.
-    // Note: abs should not be needed but truncation error causes problems
-    // with points very close to one of the triangle vertices.
-    // (seen up to -9e-15). Alternatively add some small value.
-
-    const scalar f = D & D;
-    return Foam::mag(a*s*s + 2*b*s*t + c*t*t + 2*d*s + 2*e*t + f);
-}
+// // Fast distance to triangle calculation. From
+// // "Distance Between Point and Triangle in 3D"
+// // David Eberly, Magic Software Inc. Aug. 2003.
+// // Works on function Q giving distance to point and tries to minimize this.
+// Foam::scalar Foam::treeDataTriSurface::nearestCoords
+// (
+//     const point& base,
+//     const point& E0,
+//     const point& E1,
+//     const scalar a,
+//     const scalar b,
+//     const scalar c,
+//     const point& P,
+//     scalar& s,
+//     scalar& t
+// )
+// {
+//     // distance vector
+//     const vector D(base - P);
+
+//     // Precalculate distance factors.
+//     const scalar d = E0 & D;
+//     const scalar e = E1 & D;
+
+//     // Do classification
+//     const scalar det = a*c - b*b;
+
+//     s = b*e - c*d;
+//     t = b*d - a*e;
+
+//     if (s+t < det)
+//     {
+//         if (s < 0)
+//         {
+//             if (t < 0)
+//             {
+//                 //region 4
+//                 if (e > 0)
+//                 {
+//                     //min on edge t = 0
+//                     t = 0;
+//                     s = (d >= 0 ? 0 : (-d >= a ? 1 : -d/a));
+//                 }
+//                 else
+//                 {
+//                     //min on edge s=0
+//                     s = 0;
+//                     t = (e >= 0 ? 0 : (-e >= c ? 1 : -e/c));
+//                 }
+//             }
+//             else
+//             {
+//                 //region 3. Min on edge s = 0
+//                 s = 0;
+//                 t = (e >= 0 ? 0 : (-e >= c ? 1 : -e/c));
+//             }
+//         }
+//         else if (t < 0)
+//         {
+//             //region 5
+//             t = 0;
+//             s = (d >= 0 ? 0 : (-d >= a ? 1 : -d/a));
+//         }
+//         else
+//         {
+//             //region 0
+//             const scalar invDet = 1/det;
+//             s *= invDet;
+//             t *= invDet;
+//         }
+//     }
+//     else
+//     {
+//         if (s < 0)
+//         {
+//             //region 2
+//             const scalar tmp0 = b + d;
+//             const scalar tmp1 = c + e;
+//             if (tmp1 > tmp0)
+//             {
+//                 //min on edge s+t=1
+//                 const scalar numer = tmp1 - tmp0;
+//                 const scalar denom = a-2*b+c;
+//                 s = (numer >= denom ? 1 : numer/denom);
+//                 t = 1 - s;
+//             }
+//             else
+//             {
+//                 //min on edge s=0
+//                 s = 0;
+//                 t = (tmp1 <= 0 ? 1 : (e >= 0 ? 0 : - e/c));
+//             }
+//         }
+//         else if (t < 0)
+//         {
+//             //region 6
+//             const scalar tmp0 = b + d;
+//             const scalar tmp1 = c + e;
+//             if (tmp1 > tmp0)
+//             {
+//                 //min on edge s+t=1
+//                 const scalar numer = tmp1 - tmp0;
+//                 const scalar denom = a-2*b+c;
+//                 s = (numer >= denom ? 1 : numer/denom);
+//                 t = 1 - s;
+//             }
+//             else
+//             {
+//                 //min on edge t=0
+//                 t = 0;
+//                 s = (tmp1 <= 0 ? 1 : (d >= 0 ? 0 : - d/a));
+//             }
+//         }
+//         else
+//         {
+//             //region 1
+//             const scalar numer = c+e-(b+d);
+//             if (numer <= 0)
+//             {
+//                 s = 0;
+//             }
+//             else
+//             {
+//                 const scalar denom = a-2*b+c;
+//                 s = (numer >= denom ? 1 : numer/denom);
+//             }
+//         }
+//         t = 1 - s;
+//     }
+
+
+//     // Calculate distance.
+//     // Note: abs should not be needed but truncation error causes problems
+//     // with points very close to one of the triangle vertices.
+//     // (seen up to -9e-15). Alternatively add some small value.
+
+//     const scalar f = D & D;
+//     return Foam::mag(a*s*s + 2*b*s*t + c*t*t + 2*d*s + 2*e*t + f);
+// }
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
@@ -234,9 +234,7 @@ Foam::label Foam::treeDataTriSurface::getVolumeType
     (
         surface_,
         sample,
-        pHit.index(),
-        pHit.hitPoint(),
-        indexedOctree<treeDataTriSurface>::perturbTol()
+        pHit.index()
     );
 
     if (t == triSurfaceTools::UNKNOWN)
@@ -313,7 +311,7 @@ bool Foam::treeDataTriSurface::overlaps
 // nearestPoint.
 void Foam::treeDataTriSurface::findNearest
 (
-    const labelList& indices,
+    const unallocLabelList& indices,
     const point& sample,
 
     scalar& nearestDistSqr,
@@ -353,39 +351,43 @@ void Foam::treeDataTriSurface::findNearest
         //    )
         //)
         {
-            // Get spanning vectors of triangle
-            vector base(p1);
-            vector E0(p0 - p1);
-            vector E1(p2 - p1);
-
-            scalar a(E0& E0);
-            scalar b(E0& E1);
-            scalar c(E1& E1);
-
-            // Get nearest point in s,t coordinates (s is along E0, t is along
-            // E1)
-            scalar s;
-            scalar t;
-
-            scalar distSqr = nearestCoords
-            (
-                base,
-                E0,
-                E1,
-                a,
-                b,
-                c,
-                sample,
-
-                s,
-                t
-            );
+            // // Get spanning vectors of triangle
+            // vector base(p1);
+            // vector E0(p0 - p1);
+            // vector E1(p2 - p1);
+
+            // scalar a(E0& E0);
+            // scalar b(E0& E1);
+            // scalar c(E1& E1);
+
+            // // Get nearest point in s,t coordinates (s is along E0, t
+            // // is along E1)
+            // scalar s;
+            // scalar t;
+
+            // scalar distSqr = nearestCoords
+            // (
+            //     base,
+            //     E0,
+            //     E1,
+            //     a,
+            //     b,
+            //     c,
+            //     sample,
+
+            //     s,
+            //     t
+            // );
+
+            pointHit pHit = triPointRef(p0, p1, p2).nearestPoint(sample);
+
+            scalar distSqr = sqr(pHit.distance());
 
             if (distSqr < nearestDistSqr)
             {
                 nearestDistSqr = distSqr;
                 minIndex = index;
-                nearestPoint = base + s*E0 + t*E1;
+                nearestPoint = pHit.rawPoint();
             }
         }
     }
@@ -396,7 +398,7 @@ void Foam::treeDataTriSurface::findNearest
 // nearestPoint.
 void Foam::treeDataTriSurface::findNearest
 (
-    const labelList& indices,
+    const unallocLabelList& indices,
     const linePointRef& ln,
 
     treeBoundBox& tightest,
@@ -407,7 +409,7 @@ void Foam::treeDataTriSurface::findNearest
 {
     notImplemented
     (
-        "treeDataTriSurface::findNearest(const labelList&"
+        "treeDataTriSurface::findNearest(const unallocLabelList&"
         ", const linePointRef&, treeBoundBox&, label&, point&, point&) const"
     );
 }
diff --git a/src/meshTools/indexedOctree/treeDataTriSurface.H b/src/meshTools/indexedOctree/treeDataTriSurface.H
index 88f92c0ba4e35d8d411cd68f4e4ee997a14bef08..dc959f78ff69ec71bb0f201d5fe9366f9afcc5a1 100644
--- a/src/meshTools/indexedOctree/treeDataTriSurface.H
+++ b/src/meshTools/indexedOctree/treeDataTriSurface.H
@@ -60,20 +60,20 @@ class treeDataTriSurface
 
     // Private Member Functions
 
-        //- fast triangle nearest point calculation. Returns point in E0, E1
-        //  coordinate system:  base + s*E0 + t*E1
-        static scalar nearestCoords
-        (
-            const point& base,
-            const point& E0,
-            const point& E1,
-            const scalar a,
-            const scalar b,
-            const scalar c,
-            const point& P,
-            scalar& s,
-            scalar& t
-        );
+        // //- fast triangle nearest point calculation. Returns point in E0, E1
+        // //  coordinate system:  base + s*E0 + t*E1
+        // static scalar nearestCoords
+        // (
+        //     const point& base,
+        //     const point& E0,
+        //     const point& E1,
+        //     const scalar a,
+        //     const scalar b,
+        //     const scalar c,
+        //     const point& P,
+        //     scalar& s,
+        //     scalar& t
+        // );
 
 public:
 
@@ -91,12 +91,12 @@ public:
 
         // Access
 
-            const triSurface& surface() const
+            inline const triSurface& surface() const
             {
                 return surface_;
             }
 
-            label size() const
+            inline label size() const
             {
                 return surface_.size();
             }
@@ -127,7 +127,7 @@ public:
             //  Returns actual point and distance (squared)
             void findNearest
             (
-                const labelList& indices,
+                const unallocLabelList& indices,
                 const point& sample,
 
                 scalar& nearestDistSqr,
@@ -139,7 +139,7 @@ public:
             //  Returns point and distance (squared)
             void findNearest
             (
-                const labelList& indices,
+                const unallocLabelList& indices,
                 const linePointRef& ln,
 
                 treeBoundBox& tightest,
diff --git a/src/meshTools/triSurface/booleanOps/surfaceIntersection/edgeIntersections.C b/src/meshTools/triSurface/booleanOps/surfaceIntersection/edgeIntersections.C
index 110f9dcd66161da1e9a66a3be1c711f718106bdb..c8955f747091e3b79bd7bbb8d0a30d8be4753b6f 100644
--- a/src/meshTools/triSurface/booleanOps/surfaceIntersection/edgeIntersections.C
+++ b/src/meshTools/triSurface/booleanOps/surfaceIntersection/edgeIntersections.C
@@ -430,10 +430,7 @@ bool Foam::edgeIntersections::offsetPerturb
 
         point ctr = tri.centre();
 
-        // Get measure for tolerance.
-        scalar tolDim = 0.001*mag(tri.a() - ctr);
-
-        tri.classify(pHit.hitPoint(), tolDim, nearType, nearLabel);
+        tri.classify(pHit.hitPoint(), nearType, nearLabel);
 
         if (nearType == triPointRef::POINT || nearType == triPointRef::EDGE)
         {
diff --git a/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.C b/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.C
index 6602fbcf430385f0018ae9368381c946571cdd1f..58c206aa75069667f64c5f55a738f452599084b8 100644
--- a/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.C
+++ b/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.C
@@ -315,7 +315,7 @@ void Foam::surfaceIntersection::classifyHit
         surf2Pts[f2[0]],
         surf2Pts[f2[1]],
         surf2Pts[f2[2]]
-    ).classify(pHit.hitPoint(), tolDim, nearType, nearLabel);
+    ).classify(pHit.hitPoint(), nearType, nearLabel);
 
     // Classify points on edge of surface1
     label edgeEnd =
diff --git a/src/meshTools/triSurface/octreeData/octreeDataTriSurface.C b/src/meshTools/triSurface/octreeData/octreeDataTriSurface.C
index c80991819ea2244fc4c1a1159f5a2e1836db30a8..55e60a3111cd5bd5c698a592edd70b5753ae603e 100644
--- a/src/meshTools/triSurface/octreeData/octreeDataTriSurface.C
+++ b/src/meshTools/triSurface/octreeData/octreeDataTriSurface.C
@@ -43,7 +43,7 @@ Foam::scalar Foam::octreeDataTriSurface::tol(1E-6);
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
 
 // Fast distance to triangle calculation. From
-// "Distance Between Point and Trangle in 3D"
+// "Distance Between Point and Triangle in 3D"
 // David Eberly, Magic Software Inc. Aug. 2003.
 // Works on function Q giving distance to point and tries to minimize this.
 void Foam::octreeDataTriSurface::nearestCoords
diff --git a/src/meshTools/triSurface/orientedSurface/orientedSurface.C b/src/meshTools/triSurface/orientedSurface/orientedSurface.C
index 6462df4cb31ec2e08f197c5ddf1de6b6284597c3..38a7afd4b8ed5ad7524dcdc223a303695d672c2f 100644
--- a/src/meshTools/triSurface/orientedSurface/orientedSurface.C
+++ b/src/meshTools/triSurface/orientedSurface/orientedSurface.C
@@ -234,9 +234,7 @@ void Foam::orientedSurface::propagateOrientation
     (
         s,
         samplePoint,
-        nearestFaceI,
-        nearestPt,
-        10*SMALL
+        nearestFaceI
     );
 
     if (side == triSurfaceTools::UNKNOWN)
diff --git a/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.C b/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.C
index 5a0cc0362340e7a36b5149a3ec721d09882653e2..af30b3bcc8954ad5e86916ff97d9d62e04c113cf 100644
--- a/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.C
+++ b/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.C
@@ -2121,12 +2121,13 @@ Foam::vector Foam::triSurfaceTools::surfaceNormal
 
     label nearType;
     label nearLabel;
+
     triPointRef
     (
         points[f[0]],
         points[f[1]],
         points[f[2]]
-    ).classify(nearestPt, 1E-6, nearType, nearLabel);
+    ).classify(nearestPt, nearType, nearLabel);
 
     if (nearType == triPointRef::NONE)
     {
@@ -2199,28 +2200,61 @@ Foam::triSurfaceTools::sideType Foam::triSurfaceTools::surfaceSide
 (
     const triSurface& surf,
     const point& sample,
-    const label nearestFaceI,   // nearest face
-    const point& nearestPoint,  // nearest point on nearest face
-    const scalar tol
+    const label nearestFaceI
 )
 {
     const labelledTri& f = surf[nearestFaceI];
     const pointField& points = surf.points();
 
-    // Find where point is on triangle. Note tolerance needed. Is relative
-    // one (used in comparing normalized [0..1] triangle coordinates).
+    // Find where point is on triangle.
     label nearType, nearLabel;
-    triPointRef
+
+    pointHit pHit = triPointRef
     (
         points[f[0]],
         points[f[1]],
         points[f[2]]
-    ).classify(nearestPoint, tol, nearType, nearLabel);
+    ).nearestPointClassify(sample, nearType, nearLabel);
+
+    const point& nearestPoint(pHit.rawPoint());
 
     if (nearType == triPointRef::NONE)
     {
+        vector sampleNearestVec = (sample - nearestPoint);
+
         // Nearest to face interior. Use faceNormal to determine side
-        scalar c = (sample - nearestPoint) & surf.faceNormals()[nearestFaceI];
+        scalar c = sampleNearestVec & surf.faceNormals()[nearestFaceI];
+
+        // // If the sample is essentially on the face, do not check for
+        // // it being perpendicular.
+
+        // scalar magSampleNearestVec = mag(sampleNearestVec);
+
+        // if (magSampleNearestVec > SMALL)
+        // {
+        //     c /= magSampleNearestVec*mag(surf.faceNormals()[nearestFaceI]);
+
+        //     if (mag(c) < 0.99)
+        //     {
+        //         FatalErrorIn("triSurfaceTools::surfaceSide")
+        //             << "nearestPoint identified as being on triangle face "
+        //             << "but vector from nearestPoint to sample is not "
+        //             << "perpendicular to the normal." << nl
+        //             << "sample: " << sample << nl
+        //             << "nearestPoint: " << nearestPoint << nl
+        //             << "sample - nearestPoint: "
+        //             << sample - nearestPoint << nl
+        //             << "normal: " << surf.faceNormals()[nearestFaceI] << nl
+        //             << "mag(sample - nearestPoint): "
+        //             << mag(sample - nearestPoint) << nl
+        //             << "normalised dot product: " << c << nl
+        //             << "triangle vertices: " << nl
+        //             << "    " << points[f[0]] << nl
+        //             << "    " << points[f[1]] << nl
+        //             << "    " << points[f[2]] << nl
+        //             << abort(FatalError);
+        //     }
+        // }
 
         if (c > 0)
         {
@@ -2239,13 +2273,13 @@ Foam::triSurfaceTools::sideType Foam::triSurfaceTools::surfaceSide
         // Get the edge. Assume order of faceEdges same as face vertices.
         label edgeI = surf.faceEdges()[nearestFaceI][nearLabel];
 
-        //if (debug)
-        //{
+        // if (debug)
+        // {
         //    // Check order of faceEdges same as face vertices.
         //    const edge& e = surf.edges()[edgeI];
         //    const labelList& meshPoints = surf.meshPoints();
         //    const edge meshEdge(meshPoints[e[0]], meshPoints[e[1]]);
-        //
+
         //    if
         //    (
         //        meshEdge
@@ -2259,7 +2293,7 @@ Foam::triSurfaceTools::sideType Foam::triSurfaceTools::surfaceSide
         //            << " in face " << f
         //            << abort(FatalError);
         //    }
-        //}
+        // }
 
         return edgeSide(surf, sample, nearestPoint, edgeI);
     }
@@ -2717,7 +2751,14 @@ void Foam::triSurfaceTools::calcInterpolationWeights
 
             triPointRef tri(f.tri(points));
 
-            pointHit nearest = tri.nearestPoint(samplePt);
+            label nearType, nearLabel;
+
+            pointHit nearest = tri.nearestPointClassify
+            (
+                samplePt,
+                nearType,
+                nearLabel
+            );
 
             if (nearest.hit())
             {
@@ -2741,14 +2782,6 @@ void Foam::triSurfaceTools::calcInterpolationWeights
                 minDistance = nearest.distance();
 
                 // Outside triangle. Store nearest.
-                label nearType, nearLabel;
-                tri.classify
-                (
-                    nearest.rawPoint(),
-                    1E-6,               // relative tolerance
-                    nearType,
-                    nearLabel
-                );
 
                 if (nearType == triPointRef::POINT)
                 {
@@ -2779,12 +2812,12 @@ void Foam::triSurfaceTools::calcInterpolationWeights
                         max
                         (
                             0,
-                            mag(nearest.rawPoint()-p0)/mag(p1-p0)
+                            mag(nearest.rawPoint() - p0)/mag(p1 - p0)
                         )
                     );
 
                     // Interpolate
-                    weights[0] = 1-s;
+                    weights[0] = 1 - s;
                     weights[1] = s;
                     weights[2] = -GREAT;
 
@@ -2830,7 +2863,6 @@ Foam::surfaceLocation Foam::triSurfaceTools::classify
     triPointRef(s[triI].tri(s.points())).classify
     (
         trianglePoint,
-        1E-6,
         elemType,
         index
     );
diff --git a/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.H b/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.H
index 62d66d031f02e5eb9e8723c8ef0f42b7d7bd0b87..744a12217d372adab1f4a6915d7c8fb3e7bfed29 100644
--- a/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.H
+++ b/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.H
@@ -458,9 +458,7 @@ public:
         (
             const triSurface& surf,
             const point& sample,
-            const label nearestFaceI,   // nearest face
-            const point& nearestPt,     // nearest point on nearest face
-            const scalar tol            // tolerance for nearness test.
+            const label nearestFaceI
         );
 
     // Triangulation of faces
diff --git a/src/parallel/decompose/ptscotchDecomp/Make/options b/src/parallel/decompose/ptscotchDecomp/Make/options
index b2b76fce059d37a68efcf4981896688c994ac2cf..488f5ef3bb46e3f4d6442264ce571cca8f4bc0f6 100644
--- a/src/parallel/decompose/ptscotchDecomp/Make/options
+++ b/src/parallel/decompose/ptscotchDecomp/Make/options
@@ -8,4 +8,4 @@ EXE_INC = \
     -I../decompositionMethods/lnInclude
 
 LIB_LIBS = \
-    -L$(FOAM_MPI_LIBBIN) -lptscotch -lptscotcherrexit
+    -L$(FOAM_MPI_LIBBIN) -lptscotch -lptscotcherrexit -lrt
diff --git a/src/parallel/decompose/scotchDecomp/Make/options b/src/parallel/decompose/scotchDecomp/Make/options
index 96b64b8fdd1671bc56ed25d1c5632f067e73fd8f..2f01188ac6f6b08d684f4a3f9d4c953857d04c5f 100644
--- a/src/parallel/decompose/scotchDecomp/Make/options
+++ b/src/parallel/decompose/scotchDecomp/Make/options
@@ -4,4 +4,4 @@ EXE_INC = \
     -I../decompositionMethods/lnInclude
 
 LIB_LIBS = \
-    -lscotch -lscotcherrexit
+    -lscotch -lscotcherrexit -lrt
diff --git a/src/parallel/reconstruct/reconstruct/reconstructLagrangian.H b/src/parallel/reconstruct/reconstruct/reconstructLagrangian.H
index 95cda63b60c01b81f0f9854f6225a53b0ba1f792..6107e9f3694df76df5bb7a8d81512a070b4efcba 100644
--- a/src/parallel/reconstruct/reconstruct/reconstructLagrangian.H
+++ b/src/parallel/reconstruct/reconstruct/reconstructLagrangian.H
@@ -38,7 +38,7 @@ SourceFiles
 #include "cloud.H"
 #include "polyMesh.H"
 #include "IOobjectList.H"
-#include "IOFieldField.H"
+#include "CompactIOField.H"
 #include "fvMesh.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -69,7 +69,7 @@ tmp<IOField<Type> > reconstructLagrangianField
 
 
 template<class Type>
-tmp<IOFieldField<Field<Type>, Type> > reconstructLagrangianFieldField
+tmp<CompactIOField<Field<Type>, Type> > reconstructLagrangianFieldField
 (
     const word& cloudName,
     const polyMesh& mesh,
diff --git a/src/parallel/reconstruct/reconstruct/reconstructLagrangianFields.C b/src/parallel/reconstruct/reconstruct/reconstructLagrangianFields.C
index 6642a5d9cc0102e7ba033d7316d35ca50757a708..9fa92b8cedcd010ab322415f3d9f8a02e58ffc51 100644
--- a/src/parallel/reconstruct/reconstruct/reconstructLagrangianFields.C
+++ b/src/parallel/reconstruct/reconstruct/reconstructLagrangianFields.C
@@ -24,7 +24,7 @@ License
 \*---------------------------------------------------------------------------*/
 
 #include "IOField.H"
-#include "IOFieldField.H"
+#include "CompactIOField.H"
 #include "Time.H"
 
 // * * * * * * * * * * * * * * * Global Functions  * * * * * * * * * * * * * //
@@ -89,7 +89,7 @@ Foam::tmp<Foam::IOField<Type> > Foam::reconstructLagrangianField
 
 
 template<class Type>
-Foam::tmp<Foam::IOFieldField<Foam::Field<Type>, Type> >
+Foam::tmp<Foam::CompactIOField<Foam::Field<Type>, Type> >
 Foam::reconstructLagrangianFieldField
 (
     const word& cloudName,
@@ -99,9 +99,9 @@ Foam::reconstructLagrangianFieldField
 )
 {
     // Construct empty field on mesh
-    tmp<IOFieldField<Field<Type>, Type > > tfield
+    tmp<CompactIOField<Field<Type>, Type > > tfield
     (
-        new IOFieldField<Field<Type>, Type>
+        new CompactIOField<Field<Type>, Type>
         (
             IOobject
             (
@@ -132,7 +132,7 @@ Foam::reconstructLagrangianFieldField
 
         if (localIOobject.headerOk())
         {
-            IOFieldField<Field<Type>, Type> fieldi(localIOobject);
+            CompactIOField<Field<Type>, Type> fieldi(localIOobject);
 
             label offset = field.size();
             field.setSize(offset + fieldi.size());
@@ -194,7 +194,7 @@ void Foam::reconstructLagrangianFieldFields
 )
 {
     {
-        const word fieldClassName(IOFieldField<Field<Type>, Type>::typeName);
+        const word fieldClassName(CompactIOField<Field<Type>, Type>::typeName);
 
         IOobjectList fields = objects.lookupClass(fieldClassName);
 
diff --git a/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C b/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C
index 78478222cb52c88e93e03e5806ed9c612fda08d3..56b05c88caf9b1f39c3ebf21f79258629363ce7f 100644
--- a/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C
+++ b/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C
@@ -157,7 +157,9 @@ bool Foam::streamLineParticle::move(streamLineParticle::trackData& td)
     td.switchProcessor = false;
     td.keepParticle = true;
 
-    scalar deltaT = GREAT;  //cloud().pMesh().time().deltaTValue();
+    // Set very large dt. Note: cannot use GREAT since 1/GREAT is SMALL
+    // which is a trigger value for the tracking...
+    scalar deltaT = Foam::sqrt(GREAT);  //cloud().pMesh().time().deltaTValue();
     scalar tEnd = (1.0 - stepFraction())*deltaT;
     scalar dtMax = tEnd;
 
@@ -166,9 +168,11 @@ bool Foam::streamLineParticle::move(streamLineParticle::trackData& td)
         td.keepParticle
     && !td.switchProcessor
     && lifeTime_ > 0
-    && tEnd > ROOTVSMALL
     )
     {
+        // TBD: implement subcycling so step through cells in more than
+        //      one step.
+
         // set the lagrangian time-step
         scalar dt = min(dtMax, tEnd);
 
@@ -186,6 +190,12 @@ bool Foam::streamLineParticle::move(streamLineParticle::trackData& td)
 
         tEnd -= dt;
         stepFraction() = 1.0 - tEnd/deltaT;
+
+        if (tEnd <= ROOTVSMALL)
+        {
+            // Force removal
+            lifeTime_ = 0;
+        }
     }
 
     if (!td.keepParticle || lifeTime_ == 0)
diff --git a/src/sampling/sampledSurface/distanceSurface/distanceSurface.C b/src/sampling/sampledSurface/distanceSurface/distanceSurface.C
index a3fe57cb4a9d4ee7e32708b6e6426a446aacdc36..4a4c9219d690dcb106b3b409f6994f535d5d65f1 100644
--- a/src/sampling/sampledSurface/distanceSurface/distanceSurface.C
+++ b/src/sampling/sampledSurface/distanceSurface/distanceSurface.C
@@ -89,20 +89,29 @@ void Foam::distanceSurface::createGeometry()
 
         if (signed_)
         {
-            vectorField normal;
-            surfPtr_().getNormal(nearest, normal);
+            List<searchableSurface::volumeType> volType;
 
-            forAll(nearest, i)
+            surfPtr_().getVolumeType(cc, volType);
+
+            forAll(volType, i)
             {
-                vector d(cc[i]-nearest[i].hitPoint());
+                searchableSurface::volumeType vT = volType[i];
 
-                if ((d&normal[i]) > 0)
+                if (vT == searchableSurface::OUTSIDE)
                 {
-                    fld[i] = Foam::mag(d);
+                    fld[i] = Foam::mag(cc[i] - nearest[i].hitPoint());
+                }
+                else if (vT == searchableSurface::INSIDE)
+                {
+                    fld[i] = -Foam::mag(cc[i] - nearest[i].hitPoint());
                 }
                 else
                 {
-                    fld[i] = -Foam::mag(d);
+                    FatalErrorIn
+                    (
+                        "void Foam::distanceSurface::createGeometry()"
+                    )   << "getVolumeType failure, neither INSIDE or OUTSIDE"
+                        << exit(FatalError);
                 }
             }
         }
@@ -132,20 +141,30 @@ void Foam::distanceSurface::createGeometry()
 
             if (signed_)
             {
-                vectorField normal;
-                surfPtr_().getNormal(nearest, normal);
+                List<searchableSurface::volumeType> volType;
 
-                forAll(nearest, i)
+                surfPtr_().getVolumeType(cc, volType);
+
+                forAll(volType, i)
                 {
-                    vector d(cc[i]-nearest[i].hitPoint());
+                    searchableSurface::volumeType vT = volType[i];
 
-                    if ((d&normal[i]) > 0)
+                    if (vT == searchableSurface::OUTSIDE)
                     {
-                        fld[i] = Foam::mag(d);
+                        fld[i] = Foam::mag(cc[i] - nearest[i].hitPoint());
+                    }
+                    else if (vT == searchableSurface::INSIDE)
+                    {
+                        fld[i] = -Foam::mag(cc[i] - nearest[i].hitPoint());
                     }
                     else
                     {
-                        fld[i] = -Foam::mag(d);
+                        FatalErrorIn
+                        (
+                            "void Foam::distanceSurface::createGeometry()"
+                        )   << "getVolumeType failure, "
+                            << "neither INSIDE or OUTSIDE"
+                            << exit(FatalError);
                     }
                 }
             }
@@ -179,20 +198,31 @@ void Foam::distanceSurface::createGeometry()
 
         if (signed_)
         {
-            vectorField normal;
-            surfPtr_().getNormal(nearest, normal);
+            List<searchableSurface::volumeType> volType;
 
-            forAll(nearest, i)
+            surfPtr_().getVolumeType(pts, volType);
+
+            forAll(volType, i)
             {
-                vector d(pts[i]-nearest[i].hitPoint());
+                searchableSurface::volumeType vT = volType[i];
 
-                if ((d&normal[i]) > 0)
+                if (vT == searchableSurface::OUTSIDE)
+                {
+                    pointDistance_[i] =
+                        Foam::mag(pts[i] - nearest[i].hitPoint());
+                }
+                else if (vT == searchableSurface::INSIDE)
                 {
-                    pointDistance_[i] = Foam::mag(d);
+                    pointDistance_[i] =
+                        -Foam::mag(pts[i] - nearest[i].hitPoint());
                 }
                 else
                 {
-                    pointDistance_[i] = -Foam::mag(d);
+                    FatalErrorIn
+                    (
+                        "void Foam::distanceSurface::createGeometry()"
+                    )   << "getVolumeType failure, neither INSIDE or OUTSIDE"
+                        << exit(FatalError);
                 }
             }
         }
@@ -290,20 +320,17 @@ Foam::distanceSurface::distanceSurface
     signed_(readBool(dict.lookup("signed"))),
     regularise_(dict.lookupOrDefault("regularise", true)),
     average_(dict.lookupOrDefault("average", false)),
-    zoneName_(word::null),
+    zoneKey_(keyType::null),
     needsUpdate_(true),
     isoSurfPtr_(NULL),
     facesPtr_(NULL)
 {
-//    dict.readIfPresent("zone", zoneName_);
+//    dict.readIfPresent("zone", zoneKey_);
 //
-//    if (debug && zoneName_.size())
+//    if (debug && zoneKey_.size() && mesh.cellZones().findZoneID(zoneKey_) < 0)
 //    {
-//        if (mesh.cellZones().findZoneID(zoneName_) < 0)
-//        {
-//            Info<< "cellZone \"" << zoneName_
-//                << "\" not found - using entire mesh" << endl;
-//        }
+//        Info<< "cellZone " << zoneKey_
+//            << " not found - using entire mesh" << endl;
 //    }
 }
 
diff --git a/src/sampling/sampledSurface/distanceSurface/distanceSurface.H b/src/sampling/sampledSurface/distanceSurface/distanceSurface.H
index a5b7fe8bda5959ad63e1c9c72304a657adf1d66c..5f777cbacfd01fc091a09189b13d8fd64190e45f 100644
--- a/src/sampling/sampledSurface/distanceSurface/distanceSurface.H
+++ b/src/sampling/sampledSurface/distanceSurface/distanceSurface.H
@@ -70,8 +70,8 @@ class distanceSurface
         //- Whether to recalculate cell values as average of point values
         const Switch average_;
 
-        //- zone name (if restricted to zones)
-        word zoneName_;
+        //- If restricted to zones, name of this zone or a regular expression
+        keyType zoneKey_;
 
         //- Track if the surface needs an update
         mutable bool needsUpdate_;
diff --git a/src/sampling/sampledSurface/isoSurface/sampledIsoSurfaceCell.C b/src/sampling/sampledSurface/isoSurface/sampledIsoSurfaceCell.C
index e77d6f74c799f28d7224398f7459414bb5bace68..155e12bbd225213dc706d71acaa1d423b8da2d60 100644
--- a/src/sampling/sampledSurface/isoSurface/sampledIsoSurfaceCell.C
+++ b/src/sampling/sampledSurface/isoSurface/sampledIsoSurfaceCell.C
@@ -205,20 +205,17 @@ Foam::sampledIsoSurfaceCell::sampledIsoSurfaceCell
     isoVal_(readScalar(dict.lookup("isoValue"))),
     regularise_(dict.lookupOrDefault("regularise", true)),
     average_(dict.lookupOrDefault("average", true)),
-    zoneName_(word::null),
+    zoneKey_(keyType::null),
     facesPtr_(NULL),
     prevTimeIndex_(-1),
     meshCells_(0)
 {
-//    dict.readIfPresent("zone", zoneName_);
+//    dict.readIfPresent("zone", zoneKey_);
 //
-//    if (debug && zoneName_.size())
+//    if (debug && zoneKey_.size() && mesh.cellZones().findZoneID(zoneKey_) < 0)
 //    {
-//        if (mesh.cellZones().findZoneID(zoneName_) < 0)
-//        {
-//            Info<< "cellZone \"" << zoneName_
-//                << "\" not found - using entire mesh" << endl;
-//        }
+//        Info<< "cellZone " << zoneKey_
+//            << " not found - using entire mesh" << endl;
 //    }
 }
 
diff --git a/src/sampling/sampledSurface/isoSurface/sampledIsoSurfaceCell.H b/src/sampling/sampledSurface/isoSurface/sampledIsoSurfaceCell.H
index b779b65e0358f52016652c32e500aff1204ac950..837b3bab76d6569655e752112f2d2ecf3f1b4ef1 100644
--- a/src/sampling/sampledSurface/isoSurface/sampledIsoSurfaceCell.H
+++ b/src/sampling/sampledSurface/isoSurface/sampledIsoSurfaceCell.H
@@ -68,8 +68,8 @@ class sampledIsoSurfaceCell
         //- Whether to recalculate cell values as average of point values
         const Switch average_;
 
-        //- zone name (if restricted to zones)
-        word zoneName_;
+        //- If restricted to zones, name of this zone or a regular expression
+        keyType zoneKey_;
 
         //- triangles converted to faceList
         mutable autoPtr<faceList> facesPtr_;
diff --git a/src/sampling/sampledSurface/sampledPlane/sampledPlane.C b/src/sampling/sampledSurface/sampledPlane/sampledPlane.C
index 3fb02e57c4b6ef62c0be02420c368106b0ce32b3..6c8e0f91a7a0ecd4cf90c08f830c20782cfea183 100644
--- a/src/sampling/sampledSurface/sampledPlane/sampledPlane.C
+++ b/src/sampling/sampledSurface/sampledPlane/sampledPlane.C
@@ -45,21 +45,18 @@ Foam::sampledPlane::sampledPlane
     const word& name,
     const polyMesh& mesh,
     const plane& planeDesc,
-    const word& zoneName
+    const keyType& zoneKey
 )
 :
     sampledSurface(name, mesh),
     cuttingPlane(planeDesc),
-    zoneName_(zoneName),
+    zoneKey_(zoneKey),
     needsUpdate_(true)
 {
-    if (debug && zoneName_.size())
+    if (debug && zoneKey_.size() && mesh.cellZones().findIndex(zoneKey_) < 0)
     {
-        if (mesh.cellZones().findZoneID(zoneName_) < 0)
-        {
-            Info<< "cellZone \"" << zoneName_
-                << "\" not found - using entire mesh" << endl;
-        }
+        Info<< "cellZone " << zoneKey_
+            << " not found - using entire mesh" << endl;
     }
 }
 
@@ -73,7 +70,7 @@ Foam::sampledPlane::sampledPlane
 :
     sampledSurface(name, mesh, dict),
     cuttingPlane(plane(dict.lookup("basePoint"), dict.lookup("normalVector"))),
-    zoneName_(word::null),
+    zoneKey_(keyType::null),
     needsUpdate_(true)
 {
     // make plane relative to the coordinateSystem (Cartesian)
@@ -89,17 +86,13 @@ Foam::sampledPlane::sampledPlane
         static_cast<plane&>(*this) = plane(base, norm);
     }
 
-    dict.readIfPresent("zone", zoneName_);
+    dict.readIfPresent("zone", zoneKey_);
 
-    if (debug && zoneName_.size())
+    if (debug && zoneKey_.size() && mesh.cellZones().findIndex(zoneKey_) < 0)
     {
-        if (mesh.cellZones().findZoneID(zoneName_) < 0)
-        {
-            Info<< "cellZone \"" << zoneName_
-                << "\" not found - using entire mesh" << endl;
-        }
+        Info<< "cellZone " << zoneKey_
+            << " not found - using entire mesh" << endl;
     }
-
 }
 
 
@@ -141,19 +134,15 @@ bool Foam::sampledPlane::update()
 
     sampledSurface::clearGeom();
 
-    label zoneId = -1;
-    if (zoneName_.size())
-    {
-        zoneId = mesh().cellZones().findZoneID(zoneName_);
-    }
+    labelList selectedCells = mesh().cellZones().findMatching(zoneKey_).used();
 
-    if (zoneId < 0)
+    if (selectedCells.empty())
     {
         reCut(mesh(), true);    // always triangulate. Note:Make option?
     }
     else
     {
-        reCut(mesh(), true, mesh().cellZones()[zoneId]);
+        reCut(mesh(), true, selectedCells);
     }
 
     if (debug)
diff --git a/src/sampling/sampledSurface/sampledPlane/sampledPlane.H b/src/sampling/sampledSurface/sampledPlane/sampledPlane.H
index ec530c0a2c355f3f73c1d02367331d29cd633652..f63c6d0bb1794fb62f123657cbf5f9496334441a 100644
--- a/src/sampling/sampledSurface/sampledPlane/sampledPlane.H
+++ b/src/sampling/sampledSurface/sampledPlane/sampledPlane.H
@@ -47,7 +47,7 @@ namespace Foam
 {
 
 /*---------------------------------------------------------------------------*\
-                       Class sampledPlane Declaration
+                        Class sampledPlane Declaration
 \*---------------------------------------------------------------------------*/
 
 class sampledPlane
@@ -57,8 +57,8 @@ class sampledPlane
 {
     // Private data
 
-        //- zone name (if restricted to zones)
-        word zoneName_;
+        //- If restricted to zones, name of this zone or a regular expression
+        keyType zoneKey_;
 
         //- Track if the surface needs an update
         mutable bool needsUpdate_;
@@ -92,7 +92,7 @@ public:
             const word& name,
             const polyMesh& mesh,
             const plane& planeDesc,
-            const word& zoneName = word::null
+            const keyType& zoneKey = word::null
         );
 
         //- Construct from dictionary
diff --git a/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.C b/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.C
index 20da502550bf6cc44734e8b4cf651198cfb0ebb1..3c2d6b1b1c91d8d7d3ea469d0bac96b788d44a5a 100644
--- a/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.C
+++ b/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.C
@@ -154,7 +154,7 @@ Foam::sampledThresholdCellFaces::sampledThresholdCellFaces
     fieldName_(dict.lookup("field")),
     lowerThreshold_(dict.lookupOrDefault<scalar>("lowerLimit", -VGREAT)),
     upperThreshold_(dict.lookupOrDefault<scalar>("upperLimit", VGREAT)),
-    zoneName_(word::null),
+    zoneKey_(keyType::null),
     triangulate_(dict.lookupOrDefault("triangulate", false)),
     prevTimeIndex_(-1),
     meshCells_(0)
@@ -169,16 +169,12 @@ Foam::sampledThresholdCellFaces::sampledThresholdCellFaces
             << abort(FatalError);
     }
 
-
-//    dict.readIfPresent("zone", zoneName_);
+//    dict.readIfPresent("zone", zoneKey_);
 //
-//    if (debug && zoneName_.size())
+//    if (debug && zoneKey_.size() && mesh.cellZones().findZoneID(zoneKey_) < 0)
 //    {
-//        if (mesh.cellZones().findZoneID(zoneName_) < 0)
-//        {
-//            Info<< "cellZone \"" << zoneName_
-//                << "\" not found - using entire mesh" << endl;
-//        }
+//        Info<< "cellZone " << zoneKey_
+//            << " not found - using entire mesh" << endl;
 //    }
 }
 
diff --git a/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.H b/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.H
index def4f084f7064e874d1ef7e9a87d95bef7dbbfea..47204a856de1b81d368e7b11a02c465d58f36eab 100644
--- a/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.H
+++ b/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.H
@@ -67,8 +67,8 @@ class sampledThresholdCellFaces
         //- Threshold value
         const scalar upperThreshold_;
 
-        //- zone name (if restricted to zones)
-        word zoneName_;
+        //- If restricted to zones, name of this zone or a regular expression
+        keyType zoneKey_;
 
         //- Triangulated faces or keep faces as is
         bool triangulate_;
diff --git a/src/surfMesh/MeshedSurfaceAllocator/MeshedSurfaceIOAllocator.H b/src/surfMesh/MeshedSurfaceAllocator/MeshedSurfaceIOAllocator.H
index bf97ae0501efbc9c4771b0a3cf9441a86df0622d..716d0c88e710d085f5e56c68bdeb7eafb4051c7d 100644
--- a/src/surfMesh/MeshedSurfaceAllocator/MeshedSurfaceIOAllocator.H
+++ b/src/surfMesh/MeshedSurfaceAllocator/MeshedSurfaceIOAllocator.H
@@ -56,7 +56,7 @@ class MeshedSurfaceIOAllocator
         pointIOField points_;
 
         //- Faces
-        faceIOList faces_;
+        faceCompactIOList faces_;
 
         //- Surface zones
         surfZoneIOList zones_;
@@ -117,7 +117,7 @@ public:
             }
 
             //- Non-const access to the faces
-            faceIOList& storedIOFaces()
+            faceCompactIOList& storedIOFaces()
             {
                 return faces_;
             }
@@ -135,7 +135,7 @@ public:
             }
 
             //- Const access to the faces
-            const faceIOList& storedIOFaces() const
+            const faceCompactIOList& storedIOFaces() const
             {
                 return faces_;
             }
diff --git a/src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxy.C b/src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxy.C
index efe336e79294ec6593fd500637aff90f7b0ad1c0..b2cf9e26cdd1910433cf381950300641d0348c9c 100644
--- a/src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxy.C
+++ b/src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxy.C
@@ -150,7 +150,7 @@ void Foam::MeshedSurfaceProxy<Face>::write
 
     // write surfMesh/faces
     {
-        faceIOList io
+        faceCompactIOList io
         (
             IOobject
             (
diff --git a/src/surfMesh/surfMesh/surfMesh.C b/src/surfMesh/surfMesh/surfMesh.C
index bd2f355c2ffa7bae90803c2e147eeb39d446bb10..b07673305ccac1c19ef14dfef64de6592baed007 100644
--- a/src/surfMesh/surfMesh/surfMesh.C
+++ b/src/surfMesh/surfMesh/surfMesh.C
@@ -27,8 +27,6 @@ License
 #include "MeshedSurfaceProxy.H"
 
 #include "Time.H"
-#include "cellIOList.H"
-#include "SubList.H"
 #include "OSspecific.H"
 #include "MeshedSurface.H"
 #include "demandDrivenData.H"
diff --git a/src/surfMesh/surfMesh/surfMeshIO.C b/src/surfMesh/surfMesh/surfMeshIO.C
index e0581d52d34d121435702ff630e5032174f21bff..b581951bebb2ba136889292f9ff81446ab01b047 100644
--- a/src/surfMesh/surfMesh/surfMeshIO.C
+++ b/src/surfMesh/surfMesh/surfMeshIO.C
@@ -98,7 +98,7 @@ Foam::surfMesh::readUpdateState Foam::surfMesh::readUpdate()
             )
         );
 
-        storedFaces() = faceIOList
+        storedFaces() = faceCompactIOList
         (
             IOobject
             (
diff --git a/src/transportModels/Allwmake b/src/transportModels/Allwmake
index 7272653e0dfd6df078e8f9a115a33a4d13fca6ac..138f265357ee6d27655f1140e247ccb3f7c7b5d1 100755
--- a/src/transportModels/Allwmake
+++ b/src/transportModels/Allwmake
@@ -4,6 +4,7 @@ set -x
 
 wmake libso incompressible
 wmake libso interfaceProperties
+wmake libso twoPhaseInterfaceProperties
 # wmake libso compressible
 
 # ----------------------------------------------------------------- end-of-file
diff --git a/src/transportModels/interfaceProperties/Make/files b/src/transportModels/interfaceProperties/Make/files
index a62008cee873bef20e833be5c2cb8972e76213be..35c9a52b3d370a8128f489a5e563b2552ed89c70 100644
--- a/src/transportModels/interfaceProperties/Make/files
+++ b/src/transportModels/interfaceProperties/Make/files
@@ -1,11 +1,4 @@
 interfaceProperties.C
 interfaceCompression/interfaceCompression.C
 
-alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C
-alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C
-alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C
-alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C
-
-alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C
-
 LIB = $(FOAM_LIBBIN)/libinterfaceProperties
diff --git a/src/transportModels/interfaceProperties/Make/options b/src/transportModels/interfaceProperties/Make/options
index 9595455d96f06369402f70a7d705055a6b8156b4..d8c038aad0cd10357720a95d41b13553cffe687d 100644
--- a/src/transportModels/interfaceProperties/Make/options
+++ b/src/transportModels/interfaceProperties/Make/options
@@ -1,4 +1,5 @@
 EXE_INC = \
+    -I$(LIB_SRC)/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/alphaContactAngle \
     -I$(LIB_SRC)/finiteVolume/lnInclude
 
 LIB_LIBS = -lfiniteVolume
diff --git a/src/transportModels/interfaceProperties/interfaceProperties.C b/src/transportModels/interfaceProperties/interfaceProperties.C
index df8ef91624d1f58e42da9c2d297ead0050ee4e0b..a68ce1d5992b7aecaa9fdd0ef8bef01f73dc1054 100644
--- a/src/transportModels/interfaceProperties/interfaceProperties.C
+++ b/src/transportModels/interfaceProperties/interfaceProperties.C
@@ -47,25 +47,31 @@ const Foam::scalar Foam::interfaceProperties::convertToRad =
 
 void Foam::interfaceProperties::correctContactAngle
 (
-    surfaceVectorField::GeometricBoundaryField& nHatb
+    surfaceVectorField::GeometricBoundaryField& nHatb,
+    surfaceVectorField::GeometricBoundaryField& gradAlphaf
 ) const
 {
     const fvMesh& mesh = alpha1_.mesh();
-    const volScalarField::GeometricBoundaryField& gbf = alpha1_.boundaryField();
+    const volScalarField::GeometricBoundaryField& abf = alpha1_.boundaryField();
 
     const fvBoundaryMesh& boundary = mesh.boundary();
 
     forAll(boundary, patchi)
     {
-        if (isA<alphaContactAngleFvPatchScalarField>(gbf[patchi]))
+        if (isA<alphaContactAngleFvPatchScalarField>(abf[patchi]))
         {
-            const alphaContactAngleFvPatchScalarField& gcap =
-                refCast<const alphaContactAngleFvPatchScalarField>
-                (gbf[patchi]);
+            alphaContactAngleFvPatchScalarField& acap =
+                const_cast<alphaContactAngleFvPatchScalarField&>
+                (
+                    refCast<const alphaContactAngleFvPatchScalarField>
+                    (
+                        abf[patchi]
+                    )
+                );
 
             fvsPatchVectorField& nHatp = nHatb[patchi];
             scalarField theta =
-                convertToRad*gcap.theta(U_.boundaryField()[patchi], nHatp);
+                convertToRad*acap.theta(U_.boundaryField()[patchi], nHatp);
 
             vectorField nf = boundary[patchi].nf();
 
@@ -90,6 +96,8 @@ void Foam::interfaceProperties::correctContactAngle
             nHatp = a*nf + b*nHatp;
 
             nHatp /= (mag(nHatp) + deltaN_.value());
+
+            acap.gradient() = (nf & nHatp)*mag(gradAlphaf[patchi]);
         }
     }
 }
@@ -111,7 +119,7 @@ void Foam::interfaceProperties::calculateK()
 
     // Face unit interface normal
     surfaceVectorField nHatfv = gradAlphaf/(mag(gradAlphaf) + deltaN_);
-    correctContactAngle(nHatfv.boundaryField());
+    correctContactAngle(nHatfv.boundaryField(), gradAlphaf.boundaryField());
 
     // Face unit interface normal flux
     nHatf_ = nHatfv & Sf;
diff --git a/src/transportModels/interfaceProperties/interfaceProperties.H b/src/transportModels/interfaceProperties/interfaceProperties.H
index 6cf4d9ecef9e25a00454360086aad4074dbad88d..c91359e1b492df0baf6ae921d44e04b0371f86bc 100644
--- a/src/transportModels/interfaceProperties/interfaceProperties.H
+++ b/src/transportModels/interfaceProperties/interfaceProperties.H
@@ -85,7 +85,8 @@ class interfaceProperties
         //  calculated from the component of U parallel to the wall
         void correctContactAngle
         (
-            surfaceVectorField::GeometricBoundaryField& nHat
+            surfaceVectorField::GeometricBoundaryField& nHat,
+            surfaceVectorField::GeometricBoundaryField& gradAlphaf
         ) const;
 
         //- Re-calculate the interface curvature
diff --git a/src/transportModels/twoPhaseInterfaceProperties/Make/files b/src/transportModels/twoPhaseInterfaceProperties/Make/files
new file mode 100644
index 0000000000000000000000000000000000000000..647a00e2ba05d7a9b005fe9fcb0f9a917fe00349
--- /dev/null
+++ b/src/transportModels/twoPhaseInterfaceProperties/Make/files
@@ -0,0 +1,7 @@
+alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C
+alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C
+alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C
+alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C
+alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C
+
+LIB = $(FOAM_LIBBIN)/libtwoPhaseInterfaceProperties
diff --git a/src/transportModels/twoPhaseInterfaceProperties/Make/options b/src/transportModels/twoPhaseInterfaceProperties/Make/options
new file mode 100644
index 0000000000000000000000000000000000000000..95f34b2845f31aade5b2f758d49704934b1afde4
--- /dev/null
+++ b/src/transportModels/twoPhaseInterfaceProperties/Make/options
@@ -0,0 +1,7 @@
+EXE_INC = \
+    -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
+    -I$(LIB_SRC)/finiteVolume/lnInclude
+
+LIB_LIBS = \
+    -linterfaceProperties \
+    -lfiniteVolume
diff --git a/src/transportModels/interfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C b/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C
similarity index 52%
rename from src/transportModels/interfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C
rename to src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C
index c97d5d038395efe71f2d13d25edf2fe39e9c87f3..1d030286cf989c2d48256fd86dfbc7bd1a8213da 100644
--- a/src/transportModels/interfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C
+++ b/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C
@@ -35,6 +35,25 @@ namespace Foam
     defineTypeNameAndDebug(alphaContactAngleFvPatchScalarField, 0);
 }
 
+template<>
+const char* Foam::NamedEnum
+<
+    Foam::alphaContactAngleFvPatchScalarField::limitControls,
+    4
+>::names[] =
+{
+    "none",
+    "gradient",
+    "zeroGradient",
+    "alpha"
+};
+
+const Foam::NamedEnum
+<
+    Foam::alphaContactAngleFvPatchScalarField::limitControls,
+    4
+> Foam::alphaContactAngleFvPatchScalarField::limitControlNames_;
+
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
@@ -44,19 +63,21 @@ Foam::alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
     const DimensionedField<scalar, volMesh>& iF
 )
 :
-    zeroGradientFvPatchScalarField(p, iF)
+    fixedGradientFvPatchScalarField(p, iF),
+    limit_(lcZeroGradient)
 {}
 
 
 Foam::alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
 (
-    const alphaContactAngleFvPatchScalarField& gcpsf,
+    const alphaContactAngleFvPatchScalarField& acpsf,
     const fvPatch& p,
     const DimensionedField<scalar, volMesh>& iF,
     const fvPatchFieldMapper& mapper
 )
 :
-    zeroGradientFvPatchScalarField(gcpsf, p, iF, mapper)
+    fixedGradientFvPatchScalarField(acpsf, p, iF, mapper),
+    limit_(acpsf.limit_)
 {}
 
 
@@ -67,29 +88,86 @@ Foam::alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
     const dictionary& dict
 )
 :
-    zeroGradientFvPatchScalarField(p, iF)
+    fixedGradientFvPatchScalarField(p, iF),
+    limit_(limitControlNames_.read(dict.lookup("limit")))
 {
-    evaluate();
+    if (dict.found("gradient"))
+    {
+        gradient() = scalarField("gradient", dict, p.size());
+        fixedGradientFvPatchScalarField::updateCoeffs();
+        fixedGradientFvPatchScalarField::evaluate();
+    }
+    else
+    {
+        fvPatchField<scalar>::operator=(patchInternalField());
+        gradient() = 0.0;
+    }
 }
 
 
 Foam::alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
 (
-    const alphaContactAngleFvPatchScalarField& gcpsf
+    const alphaContactAngleFvPatchScalarField& acpsf
 )
 :
-    zeroGradientFvPatchScalarField(gcpsf)
+    fixedGradientFvPatchScalarField(acpsf),
+    limit_(acpsf.limit_)
 {}
 
 
 Foam::alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
 (
-    const alphaContactAngleFvPatchScalarField& gcpsf,
+    const alphaContactAngleFvPatchScalarField& acpsf,
     const DimensionedField<scalar, volMesh>& iF
 )
 :
-    zeroGradientFvPatchScalarField(gcpsf, iF)
+    fixedGradientFvPatchScalarField(acpsf, iF),
+    limit_(acpsf.limit_)
 {}
 
 
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
+
+void Foam::alphaContactAngleFvPatchScalarField::evaluate
+(
+    const Pstream::commsTypes
+)
+{
+    if (limit_ == lcGradient)
+    {
+        gradient() =
+        patch().deltaCoeffs()
+       *(
+           max(min
+           (
+               *this + gradient()/patch().deltaCoeffs(),
+               scalar(1)), scalar(0)
+           ) - *this
+       );
+    }
+    else if (limit_ == lcZeroGradient)
+    {
+        gradient() = 0.0;
+    }
+
+    fixedGradientFvPatchScalarField::evaluate();
+
+    if (limit_ == lcAlpha)
+    {
+        scalarField::operator=(max(min(*this, scalar(1)), scalar(0)));
+    }
+}
+
+
+void Foam::alphaContactAngleFvPatchScalarField::write
+(
+    Ostream& os
+) const
+{
+    fixedGradientFvPatchScalarField::write(os);
+    os.writeKeyword("limit")
+        << limitControlNames_[limit_] << token::END_STATEMENT << nl;
+}
+
+
 // ************************************************************************* //
diff --git a/src/transportModels/interfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.H b/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.H
similarity index 72%
rename from src/transportModels/interfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.H
rename to src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.H
index 91a13c2d0a157dda5e429334568adbcbd621bd60..6e2c5720bee3de2cf4df70f47783e04e54aac547 100644
--- a/src/transportModels/interfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.H
+++ b/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.H
@@ -30,6 +30,31 @@ Description
     Derived classes must implement the theta() fuction which returns the
     wall contact angle field.
 
+    The essential entry "limit" controls the gradient of alpha1 on the wall:
+
+    limit none;         // Calculate the gradient from the contact-angle without
+                        // limiter
+
+    limit gradient;     // Limit the wall-gradient such that alpha1 remains
+                        // bounded on the wall
+
+    limit alpha;        // Bound the calculated alpha1 on the wall
+
+    limit zeroGradient; // Set the gradient of alpha1 to 0 on the wall
+                        // i.e. reproduce previous behaviour
+
+    Note that if any of the first three options are used the boundary condition
+    on p_rgh must set to guarantee that the flux is corrected to be zero at the
+    wall e.g.
+
+        walls
+        {
+            type            fixedFluxPressure;
+            adjoint         no;
+        }
+
+    If "limit zeroGradient;" is used the pressure BCs can be left as before.
+
 SourceFiles
     alphaContactAngleFvPatchScalarField.C
 
@@ -38,7 +63,7 @@ SourceFiles
 #ifndef alphaContactAngleFvPatchScalarField_H
 #define alphaContactAngleFvPatchScalarField_H
 
-#include "zeroGradientFvPatchFields.H"
+#include "fixedGradientFvPatchFields.H"
 #include "fvsPatchFields.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -52,7 +77,7 @@ namespace Foam
 
 class alphaContactAngleFvPatchScalarField
 :
-    public zeroGradientFvPatchScalarField
+    public fixedGradientFvPatchScalarField
 {
 
 public:
@@ -60,6 +85,17 @@ public:
     //- Runtime type information
     TypeName("alphaContactAngle");
 
+    //- Alpha limit options
+    enum limitControls
+    {
+        lcNone,
+        lcGradient,
+        lcZeroGradient,
+        lcAlpha
+    };
+
+    static const NamedEnum<limitControls, 4> limitControlNames_;
+    limitControls limit_;
 
     // Constructors
 
@@ -110,6 +146,15 @@ public:
             const fvPatchVectorField& Up,
             const fvsPatchVectorField& nHat
         ) const = 0;
+
+        //- Evaluate the patch field
+        virtual void evaluate
+        (
+            const Pstream::commsTypes commsType=Pstream::blocking
+        );
+
+        //- Write
+        virtual void write(Ostream&) const;
 };
 
 
diff --git a/src/transportModels/interfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C b/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C
similarity index 97%
rename from src/transportModels/interfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C
rename to src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C
index abe03fcc440322f06d871e29fa897e710f70168d..c2917b3b6a6934379924b724b1225c4fdefb3c33 100644
--- a/src/transportModels/interfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C
+++ b/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C
@@ -64,7 +64,7 @@ constantAlphaContactAngleFvPatchScalarField
     const dictionary& dict
 )
 :
-    alphaContactAngleFvPatchScalarField(p, iF),
+    alphaContactAngleFvPatchScalarField(p, iF, dict),
     theta0_(readScalar(dict.lookup("theta0")))
 {
     evaluate();
@@ -112,7 +112,7 @@ void Foam::constantAlphaContactAngleFvPatchScalarField::write
     Ostream& os
 ) const
 {
-    fvPatchScalarField::write(os);
+    alphaContactAngleFvPatchScalarField::write(os);
     os.writeKeyword("theta0") << theta0_ << token::END_STATEMENT << nl;
     writeEntry("value", os);
 }
diff --git a/src/transportModels/interfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.H b/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.H
similarity index 100%
rename from src/transportModels/interfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.H
rename to src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.H
diff --git a/src/transportModels/interfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C b/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C
similarity index 97%
rename from src/transportModels/interfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C
rename to src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C
index 37d7e1d138051d8ef24a24ffaee5a77f4fab0b40..eaeba4174e0a3a54336eaf9275d2bbe3301d2b70 100644
--- a/src/transportModels/interfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C
+++ b/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C
@@ -70,7 +70,7 @@ dynamicAlphaContactAngleFvPatchScalarField
     const dictionary& dict
 )
 :
-    alphaContactAngleFvPatchScalarField(p, iF),
+    alphaContactAngleFvPatchScalarField(p, iF, dict),
     theta0_(readScalar(dict.lookup("theta0"))),
     uTheta_(readScalar(dict.lookup("uTheta"))),
     thetaA_(readScalar(dict.lookup("thetaA"))),
@@ -145,7 +145,7 @@ Foam::dynamicAlphaContactAngleFvPatchScalarField::theta
 
 void Foam::dynamicAlphaContactAngleFvPatchScalarField::write(Ostream& os) const
 {
-    fvPatchScalarField::write(os);
+    alphaContactAngleFvPatchScalarField::write(os);
     os.writeKeyword("theta0") << theta0_ << token::END_STATEMENT << nl;
     os.writeKeyword("uTheta") << uTheta_ << token::END_STATEMENT << nl;
     os.writeKeyword("thetaA") << thetaA_ << token::END_STATEMENT << nl;
diff --git a/src/transportModels/interfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.H b/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.H
similarity index 100%
rename from src/transportModels/interfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.H
rename to src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.H
diff --git a/src/transportModels/interfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C b/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C
similarity index 97%
rename from src/transportModels/interfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C
rename to src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C
index fb6af3d28bb4f995d2a7703571a2bf9015246a6b..a4b55a7345432ad062217720a0e16c1e9c253bf1 100644
--- a/src/transportModels/interfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C
+++ b/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C
@@ -71,7 +71,7 @@ timeVaryingAlphaContactAngleFvPatchScalarField
     const dictionary& dict
 )
 :
-    alphaContactAngleFvPatchScalarField(p, iF),
+    alphaContactAngleFvPatchScalarField(p, iF, dict),
     t0_(readScalar(dict.lookup("t0"))),
     thetaT0_(readScalar(dict.lookup("thetaT0"))),
     te_(readScalar(dict.lookup("te"))),
@@ -130,7 +130,7 @@ void Foam::timeVaryingAlphaContactAngleFvPatchScalarField::write
     Ostream& os
 ) const
 {
-    fvPatchScalarField::write(os);
+    alphaContactAngleFvPatchScalarField::write(os);
     os.writeKeyword("t0") << t0_ << token::END_STATEMENT << nl;
     os.writeKeyword("thetaT0") << thetaT0_ << token::END_STATEMENT << nl;
     os.writeKeyword("te") << te_ << token::END_STATEMENT << nl;
diff --git a/src/transportModels/interfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.H b/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.H
similarity index 99%
rename from src/transportModels/interfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.H
rename to src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.H
index d131a4e2c46544f7dc36c427283d42169640cc5e..2a0b8a945b05086518afc806c548145d20d0fdad 100644
--- a/src/transportModels/interfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.H
+++ b/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.H
@@ -84,8 +84,7 @@ public:
         );
 
         //- Construct by mapping given
-        //  timeVaryingAlphaContactAngleFvPatchScalarField onto a new
-        //  patch
+        //  timeVaryingAlphaContactAngleFvPatchScalarField onto a new patch
         timeVaryingAlphaContactAngleFvPatchScalarField
         (
             const timeVaryingAlphaContactAngleFvPatchScalarField&,
diff --git a/src/transportModels/interfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C b/src/transportModels/twoPhaseInterfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C
similarity index 100%
rename from src/transportModels/interfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C
rename to src/transportModels/twoPhaseInterfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C
diff --git a/src/transportModels/interfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.H b/src/transportModels/twoPhaseInterfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.H
similarity index 100%
rename from src/transportModels/interfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.H
rename to src/transportModels/twoPhaseInterfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.H
diff --git a/src/turbulenceModels/incompressible/RAS/Make/files b/src/turbulenceModels/incompressible/RAS/Make/files
index 3712d227bd8ef5db22d301bd83f70513304540be..f18b124e06ccb21f20f0de1c3027a0db3f4baf0e 100644
--- a/src/turbulenceModels/incompressible/RAS/Make/files
+++ b/src/turbulenceModels/incompressible/RAS/Make/files
@@ -38,6 +38,9 @@ $(omegaWallFunctions)/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C
 kqRWallFunctions = $(wallFunctions)/kqRWallFunctions
 $(kqRWallFunctions)/kqRWallFunction/kqRWallFunctionFvPatchFields.C
 
+kappatWallFunctions = $(wallFunctions)/kappatWallFunctions
+$(kappatWallFunctions)/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.C
+
 
 /* Patch fields */
 derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C
diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.C
new file mode 100644
index 0000000000000000000000000000000000000000..6efef7364b00f0003e72bd7238f46a11a06a99a1
--- /dev/null
+++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.C
@@ -0,0 +1,276 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software: you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 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 "kappatJayatillekeWallFunctionFvPatchScalarField.H"
+#include "RASModel.H"
+#include "fvPatchFieldMapper.H"
+#include "volFields.H"
+#include "wallFvPatch.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace incompressible
+{
+namespace RASModels
+{
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+scalar kappatJayatillekeWallFunctionFvPatchScalarField::tolerance_ = 0.01;
+label kappatJayatillekeWallFunctionFvPatchScalarField::maxIters_ = 10;
+
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
+
+void kappatJayatillekeWallFunctionFvPatchScalarField::checkType()
+{
+    if (!isA<wallFvPatch>(patch()))
+    {
+        FatalErrorIn
+        (
+            "kappatJayatillekeWallFunctionFvPatchScalarField::checkType()"
+        )   << "Invalid wall function specification" << nl
+            << "    Patch type for patch " << patch().name()
+            << " must be wall" << nl
+            << "    Current patch type is " << patch().type() << nl << endl
+            << abort(FatalError);
+    }
+}
+
+
+scalar kappatJayatillekeWallFunctionFvPatchScalarField::Psmooth
+(
+    const scalar Prat
+) const
+{
+    return 9.24*(pow(Prat, 0.75) - 1.0)*(1.0 + 0.28*exp(-0.007*Prat));
+}
+
+
+scalar kappatJayatillekeWallFunctionFvPatchScalarField::yPlusTherm
+(
+    const scalar P,
+    const scalar Prat
+) const
+{
+    scalar ypt = 11.0;
+
+    for (int i=0; i<maxIters_; i++)
+    {
+        scalar f = ypt - (log(E_*ypt)/kappa_ + P)/Prat;
+        scalar df = 1.0 - 1.0/(ypt*kappa_*Prat);
+        scalar yptNew = ypt - f/df;
+
+        if (yptNew < VSMALL)
+        {
+            return 0;
+        }
+        else if (mag(yptNew - ypt) < tolerance_)
+        {
+            return yptNew;
+        }
+        else
+        {
+            ypt = yptNew;
+        }
+     }
+
+    return ypt;
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
+
+kappatJayatillekeWallFunctionFvPatchScalarField::
+kappatJayatillekeWallFunctionFvPatchScalarField
+(
+    const fvPatch& p,
+    const DimensionedField<scalar, volMesh>& iF
+)
+:
+    fixedValueFvPatchScalarField(p, iF),
+    Prt_(0.85),
+    Cmu_(0.09),
+    kappa_(0.41),
+    E_(9.8)
+{
+    checkType();
+}
+
+
+kappatJayatillekeWallFunctionFvPatchScalarField::
+kappatJayatillekeWallFunctionFvPatchScalarField
+(
+    const kappatJayatillekeWallFunctionFvPatchScalarField& ptf,
+    const fvPatch& p,
+    const DimensionedField<scalar, volMesh>& iF,
+    const fvPatchFieldMapper& mapper
+)
+:
+    fixedValueFvPatchScalarField(ptf, p, iF, mapper),
+    Prt_(ptf.Prt_),
+    Cmu_(ptf.Cmu_),
+    kappa_(ptf.kappa_),
+    E_(ptf.E_)
+{
+    checkType();
+}
+
+
+kappatJayatillekeWallFunctionFvPatchScalarField::
+kappatJayatillekeWallFunctionFvPatchScalarField
+(
+    const fvPatch& p,
+    const DimensionedField<scalar, volMesh>& iF,
+    const dictionary& dict
+)
+:
+    fixedValueFvPatchScalarField(p, iF, dict),
+    Prt_(readScalar(dict.lookup("Prt"))), // force read to avoid ambiguity
+    Cmu_(dict.lookupOrDefault<scalar>("Cmu", 0.09)),
+    kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
+    E_(dict.lookupOrDefault<scalar>("E", 9.8))
+{
+    checkType();
+}
+
+
+kappatJayatillekeWallFunctionFvPatchScalarField::
+kappatJayatillekeWallFunctionFvPatchScalarField
+(
+    const kappatJayatillekeWallFunctionFvPatchScalarField& wfpsf
+)
+:
+    fixedValueFvPatchScalarField(wfpsf),
+    Prt_(wfpsf.Prt_),
+    Cmu_(wfpsf.Cmu_),
+    kappa_(wfpsf.kappa_),
+    E_(wfpsf.E_)
+{
+    checkType();
+}
+
+
+kappatJayatillekeWallFunctionFvPatchScalarField::
+kappatJayatillekeWallFunctionFvPatchScalarField
+(
+    const kappatJayatillekeWallFunctionFvPatchScalarField& wfpsf,
+    const DimensionedField<scalar, volMesh>& iF
+)
+:
+    fixedValueFvPatchScalarField(wfpsf, iF),
+    Prt_(wfpsf.Prt_),
+    Cmu_(wfpsf.Cmu_),
+    kappa_(wfpsf.kappa_),
+    E_(wfpsf.E_)
+{
+    checkType();
+}
+
+
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
+
+void kappatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs()
+{
+    if (updated())
+    {
+        return;
+    }
+
+    const label patchI = patch().index();
+
+    // Retrieve turbulence properties from model
+    const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
+    const scalar Cmu25 = pow(Cmu_, 0.25);
+    const scalarField& y = rasModel.y()[patchI];
+    const scalarField& nuw = rasModel.nu().boundaryField()[patchI];
+    const tmp<volScalarField> tk = rasModel.k();
+    const volScalarField& k = tk();
+
+    // Molecular Prandtl number
+    const scalar
+        Pr(dimensionedScalar(rasModel.transport().lookup("Pr")).value());
+
+    // Populate boundary values
+    scalarField& kappatw = *this;
+    forAll(kappatw, faceI)
+    {
+        label faceCellI = patch().faceCells()[faceI];
+
+        // y+
+        scalar yPlus = Cmu25*sqrt(k[faceCellI])*y[faceI]/nuw[faceI];
+
+        // Molecular-to-turbulent Prandtl number ratio
+        scalar Prat = Pr/Prt_;
+
+        // Thermal sublayer thickness
+        scalar P = Psmooth(Prat);
+        scalar yPlusTherm = this->yPlusTherm(P, Prat);
+
+        // Update turbulent thermal conductivity
+        if (yPlus > yPlusTherm)
+        {
+            scalar nu = nuw[faceI];
+            scalar kt = nu*(yPlus/(Prt_/kappa_*log(E_*yPlusTherm) + P) - 1/Pr);
+            kappatw[faceI] = max(0.0, kt);
+        }
+        else
+        {
+            kappatw[faceI] = 0.0;
+        }
+    }
+
+    fixedValueFvPatchField<scalar>::updateCoeffs();
+}
+
+
+void kappatJayatillekeWallFunctionFvPatchScalarField::write(Ostream& os) const
+{
+    fvPatchField<scalar>::write(os);
+    os.writeKeyword("Prt") << Prt_ << token::END_STATEMENT << nl;
+    os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl;
+    os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl;
+    os.writeKeyword("E") << E_ << token::END_STATEMENT << nl;
+    writeEntry("value", os);
+}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+makePatchTypeField
+(
+    fvPatchScalarField,
+    kappatJayatillekeWallFunctionFvPatchScalarField
+);
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace RASModels
+} // End namespace incompressible
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.H
new file mode 100644
index 0000000000000000000000000000000000000000..185ab9f22149c6c40a3032794b32302ee13859f6
--- /dev/null
+++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.H
@@ -0,0 +1,194 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software: you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 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::incompressible::RASModels::
+    kappatJayatillekeWallFunctionFvPatchScalarField
+
+Description
+    Boundary condition for (kinematic) turbulent thermal conductivity when
+    using wall functions, using Jayatilleke P function.
+
+    Units of m2/s
+
+SourceFiles
+    kappatJayatillekeWallFunctionFvPatchScalarField.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef kappatJayatillekeWallFunctionFvPatchScalarField_H
+#define kappatJayatillekeWallFunctionFvPatchScalarField_H
+
+#include "fixedValueFvPatchFields.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace incompressible
+{
+namespace RASModels
+{
+
+/*---------------------------------------------------------------------------*\
+       Class kappatJayatillekeWallFunctionFvPatchScalarField Declaration
+\*---------------------------------------------------------------------------*/
+
+class kappatJayatillekeWallFunctionFvPatchScalarField
+:
+    public fixedValueFvPatchScalarField
+{
+protected:
+
+    // Protected data
+
+        //- Turbulent Prandtl number
+        scalar Prt_;
+
+        //- Cmu coefficient
+        scalar Cmu_;
+
+        //- Von Karman constant
+        scalar kappa_;
+
+        //- E coefficient
+        scalar E_;
+
+
+        // Solution parameters
+
+            static scalar tolerance_;
+            static label maxIters_;
+
+
+    // Protected member functions
+
+        //- Check the type of the patch
+        virtual void checkType();
+
+        //- `P' function
+        scalar Psmooth(const scalar Prat) const;
+
+        //- Calculate y+ at the edge of the thermal laminar sublayer
+        scalar yPlusTherm
+        (
+            const scalar P,
+            const scalar Prat
+        ) const;
+
+
+public:
+
+    //- Runtime type information
+    TypeName("kappatJayatillekeWallFunction");
+
+
+    // Constructors
+
+        //- Construct from patch and internal field
+        kappatJayatillekeWallFunctionFvPatchScalarField
+        (
+            const fvPatch&,
+            const DimensionedField<scalar, volMesh>&
+        );
+
+        //- Construct from patch, internal field and dictionary
+        kappatJayatillekeWallFunctionFvPatchScalarField
+        (
+            const fvPatch&,
+            const DimensionedField<scalar, volMesh>&,
+            const dictionary&
+        );
+
+        //- Construct by mapping given
+        //  kappatJayatillekeWallFunctionFvPatchScalarField
+        //  onto a new patch
+        kappatJayatillekeWallFunctionFvPatchScalarField
+        (
+            const kappatJayatillekeWallFunctionFvPatchScalarField&,
+            const fvPatch&,
+            const DimensionedField<scalar, volMesh>&,
+            const fvPatchFieldMapper&
+        );
+
+        //- Construct as copy
+        kappatJayatillekeWallFunctionFvPatchScalarField
+        (
+            const kappatJayatillekeWallFunctionFvPatchScalarField&
+        );
+
+        //- Construct and return a clone
+        virtual tmp<fvPatchScalarField> clone() const
+        {
+            return tmp<fvPatchScalarField>
+            (
+                new kappatJayatillekeWallFunctionFvPatchScalarField(*this)
+            );
+        }
+
+        //- Construct as copy setting internal field reference
+        kappatJayatillekeWallFunctionFvPatchScalarField
+        (
+            const kappatJayatillekeWallFunctionFvPatchScalarField&,
+            const DimensionedField<scalar, volMesh>&
+        );
+
+        //- Construct and return a clone setting internal field reference
+        virtual tmp<fvPatchScalarField> clone
+        (
+            const DimensionedField<scalar, volMesh>& iF
+        ) const
+        {
+            return tmp<fvPatchScalarField>
+            (
+                new kappatJayatillekeWallFunctionFvPatchScalarField(*this, iF)
+            );
+        }
+
+
+    // Member functions
+
+        // Evaluation functions
+
+            //- Update the coefficients associated with the patch field
+            virtual void updateCoeffs();
+
+
+        // I-O
+
+            //- Write
+            virtual void write(Ostream&) const;
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace RASModels
+} // End namespace incompressible
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C.new b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C.new
new file mode 100644
index 0000000000000000000000000000000000000000..7e16d9d0b8c99f59d56cc36737aad1cddaea56ba
--- /dev/null
+++ b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C.new
@@ -0,0 +1,422 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software: you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 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 "kOmegaSST.H"
+#include "addToRunTimeSelectionTable.H"
+
+#include "backwardsCompatibilityWallFunctions.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace incompressible
+{
+namespace RASModels
+{
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+defineTypeNameAndDebug(kOmegaSST, 0);
+addToRunTimeSelectionTable(RASModel, kOmegaSST, dictionary);
+
+// * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * * //
+
+tmp<volScalarField> kOmegaSST::F1(const volScalarField& CDkOmega) const
+{
+    volScalarField CDkOmegaPlus = max
+    (
+        CDkOmega,
+        dimensionedScalar("1.0e-10", dimless/sqr(dimTime), 1.0e-10)
+    );
+
+    volScalarField arg1 = min
+    (
+        min
+        (
+            max
+            (
+                (scalar(1)/betaStar_)*sqrt(k_)/(omega_*y_),
+                scalar(500)*nu()/(sqr(y_)*omega_)
+            ),
+            (4*alphaOmega2_)*k_/(CDkOmegaPlus*sqr(y_))
+        ),
+        scalar(10)
+    );
+
+    return tanh(pow4(arg1));
+}
+
+tmp<volScalarField> kOmegaSST::F2() const
+{
+    volScalarField arg2 = min
+    (
+        max
+        (
+            (scalar(2)/betaStar_)*sqrt(k_)/(omega_*y_),
+            scalar(500)*nu()/(sqr(y_)*omega_)
+        ),
+        scalar(100)
+    );
+
+    return tanh(sqr(arg2));
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
+
+kOmegaSST::kOmegaSST
+(
+    const volVectorField& U,
+    const surfaceScalarField& phi,
+    transportModel& lamTransportModel
+)
+:
+    RASModel(typeName, U, phi, lamTransportModel),
+
+    alphaK1_
+    (
+        dimensioned<scalar>::lookupOrAddToDict
+        (
+            "alphaK1",
+            coeffDict_,
+            0.85034
+        )
+    ),
+    alphaK2_
+    (
+        dimensioned<scalar>::lookupOrAddToDict
+        (
+            "alphaK2",
+            coeffDict_,
+            1.0
+        )
+    ),
+    alphaOmega1_
+    (
+        dimensioned<scalar>::lookupOrAddToDict
+        (
+            "alphaOmega1",
+            coeffDict_,
+            0.5
+        )
+    ),
+    alphaOmega2_
+    (
+        dimensioned<scalar>::lookupOrAddToDict
+        (
+            "alphaOmega2",
+            coeffDict_,
+            0.85616
+        )
+    ),
+    gamma1_
+    (
+        dimensioned<scalar>::lookupOrAddToDict
+        (
+            "gamma1",
+            coeffDict_,
+            0.5532
+        )
+    ),
+    gamma2_
+    (
+        dimensioned<scalar>::lookupOrAddToDict
+        (
+            "gamma2",
+            coeffDict_,
+            0.4403
+        )
+    ),
+    beta1_
+    (
+        dimensioned<scalar>::lookupOrAddToDict
+        (
+            "beta1",
+            coeffDict_,
+            0.075
+        )
+    ),
+    beta2_
+    (
+        dimensioned<scalar>::lookupOrAddToDict
+        (
+            "beta2",
+            coeffDict_,
+            0.0828
+        )
+    ),
+    betaStar_
+    (
+        dimensioned<scalar>::lookupOrAddToDict
+        (
+            "betaStar",
+            coeffDict_,
+            0.09
+        )
+    ),
+    a1_
+    (
+        dimensioned<scalar>::lookupOrAddToDict
+        (
+            "a1",
+            coeffDict_,
+            0.31
+        )
+    ),
+    c1_
+    (
+        dimensioned<scalar>::lookupOrAddToDict
+        (
+            "c1",
+            coeffDict_,
+            10.0
+        )
+    ),
+
+    y_(mesh_),
+
+    k_
+    (
+        IOobject
+        (
+            "k",
+            runTime_.timeName(),
+            mesh_,
+            IOobject::NO_READ,
+            IOobject::AUTO_WRITE
+        ),
+        autoCreateK("k", mesh_)
+    ),
+    omega_
+    (
+        IOobject
+        (
+            "omega",
+            runTime_.timeName(),
+            mesh_,
+            IOobject::NO_READ,
+            IOobject::AUTO_WRITE
+        ),
+        autoCreateOmega("omega", mesh_)
+    ),
+    nut_
+    (
+        IOobject
+        (
+            "nut",
+            runTime_.timeName(),
+            mesh_,
+            IOobject::NO_READ,
+            IOobject::AUTO_WRITE
+        ),
+        autoCreateNut("nut", mesh_)
+    )
+{
+    nut_ =
+        a1_*k_
+       /max
+        (
+            a1_*(omega_ + omegaSmall_),
+            F2()*mag(symm(fvc::grad(U_)))
+        );
+    nut_.correctBoundaryConditions();
+
+    printCoeffs();
+}
+
+
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
+
+tmp<volSymmTensorField> kOmegaSST::R() const
+{
+    return tmp<volSymmTensorField>
+    (
+        new volSymmTensorField
+        (
+            IOobject
+            (
+                "R",
+                runTime_.timeName(),
+                mesh_,
+                IOobject::NO_READ,
+                IOobject::NO_WRITE
+            ),
+            ((2.0/3.0)*I)*k_ - nut_*twoSymm(fvc::grad(U_)),
+            k_.boundaryField().types()
+        )
+    );
+}
+
+
+tmp<volSymmTensorField> kOmegaSST::devReff() const
+{
+    return tmp<volSymmTensorField>
+    (
+        new volSymmTensorField
+        (
+            IOobject
+            (
+                "devRhoReff",
+                runTime_.timeName(),
+                mesh_,
+                IOobject::NO_READ,
+                IOobject::NO_WRITE
+            ),
+           -nuEff()*dev(twoSymm(fvc::grad(U_)))
+        )
+    );
+}
+
+
+tmp<fvVectorMatrix> kOmegaSST::divDevReff(volVectorField& U) const
+{
+    return
+    (
+      - fvm::laplacian(nuEff(), U)
+      - fvc::div(nuEff()*dev(fvc::grad(U)().T()))
+    );
+}
+
+
+bool kOmegaSST::read()
+{
+    if (RASModel::read())
+    {
+        alphaK1_.readIfPresent(coeffDict());
+        alphaK2_.readIfPresent(coeffDict());
+        alphaOmega1_.readIfPresent(coeffDict());
+        alphaOmega2_.readIfPresent(coeffDict());
+        gamma1_.readIfPresent(coeffDict());
+        gamma2_.readIfPresent(coeffDict());
+        beta1_.readIfPresent(coeffDict());
+        beta2_.readIfPresent(coeffDict());
+        betaStar_.readIfPresent(coeffDict());
+        a1_.readIfPresent(coeffDict());
+        c1_.readIfPresent(coeffDict());
+
+        return true;
+    }
+    else
+    {
+        return false;
+    }
+}
+
+
+void kOmegaSST::correct()
+{
+    RASModel::correct();
+
+    if (!turbulence_)
+    {
+        return;
+    }
+
+    if (mesh_.changing())
+    {
+        y_.correct();
+    }
+
+    volScalarField S2 = magSqr(symm(fvc::grad(U_)));
+    volScalarField G("RASModel::G", nut_*2*S2);
+
+    // Update omega and G at the wall
+    omega_.boundaryField().updateCoeffs();
+
+    volScalarField F1 = this->F1
+    (
+        (2*alphaOmega2_)*(fvc::grad(k_) & fvc::grad(omega_))/omega_
+    );
+
+    // Epsilon diffusion correction
+    surfaceScalarField CDkPhiOmega
+    (
+        "CDkPhiOmega",
+        (2*alphaOmega2_)
+       *fvc::interpolate(F1 - scalar(1))
+       /fvc::interpolate(omega_)
+       *fvc::snGrad(k_)*mesh_.magSf()
+    );
+
+    forAll (CDkPhiOmega.boundaryField(), patchi)
+    {
+        if (!CDkPhiOmega.boundaryField()[patchi].coupled())
+        {
+            CDkPhiOmega.boundaryField()[patchi] = 0.0;
+        }
+    }
+
+    // Turbulent frequency equation
+    tmp<fvScalarMatrix> omegaEqn
+    (
+        fvm::ddt(omega_)
+      + fvm::div(phi_, omega_)
+      - fvm::Sp(fvc::div(phi_), omega_)
+      - fvm::laplacian(DomegaEff(F1), omega_)
+      + fvm::div(CDkPhiOmega, omega_)
+      - fvm::Sp(fvc::div(CDkPhiOmega), omega_)
+     ==
+        gamma(F1)*2*S2
+      - fvm::Sp(beta(F1)*omega_, omega_)
+    );
+
+    omegaEqn().relax();
+
+    omegaEqn().boundaryManipulate(omega_.boundaryField());
+
+    solve(omegaEqn);
+    bound(omega_, omega0_);
+
+    // Turbulent kinetic energy equation
+    tmp<fvScalarMatrix> kEqn
+    (
+        fvm::ddt(k_)
+      + fvm::div(phi_, k_)
+      - fvm::Sp(fvc::div(phi_), k_)
+      - fvm::laplacian(DkEff(F1), k_)
+     ==
+        min(G, c1_*betaStar_*k_*omega_)
+      - fvm::Sp(betaStar_*omega_, k_)
+    );
+
+    kEqn().relax();
+    solve(kEqn);
+    bound(k_, k0_);
+
+
+    // Re-calculate viscosity
+    nut_ = a1_*k_/max(a1_*omega_, F2()*sqrt(S2));
+    nut_.correctBoundaryConditions();
+}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace RASModels
+} // End namespace incompressible
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/tutorials/combustion/dieselFoam/aachenBomb/constant/sprayProperties b/tutorials/combustion/dieselFoam/aachenBomb/constant/sprayProperties
index 878439295f1d1812fb922c567ef144ae7b0fff36..c8cfa62f0baba43e7f4be54d912d246d17fac9db 100644
--- a/tutorials/combustion/dieselFoam/aachenBomb/constant/sprayProperties
+++ b/tutorials/combustion/dieselFoam/aachenBomb/constant/sprayProperties
@@ -127,8 +127,8 @@ hollowConeInjectorCoeffs
         {
             minValue        1e-06;
             maxValue        0.00015;
-            d               ( 0.00015 );
-            n               ( 3 );
+            d               0.00015;
+            n               3;
         }
 
         exponentialPDF
diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire2D/system/fvSolution b/tutorials/combustion/fireFoam/les/smallPoolFire2D/system/fvSolution
index e71c1e85dbac4fac2d6a973c39257f041cb69518..e97f1de618ffea9debc8d767d64ac70b9b4f3057 100644
--- a/tutorials/combustion/fireFoam/les/smallPoolFire2D/system/fvSolution
+++ b/tutorials/combustion/fireFoam/les/smallPoolFire2D/system/fvSolution
@@ -20,10 +20,17 @@ solvers
 {
     rho
     {
-        solver          PCG;
-        preconditioner  DIC;
-        tolerance       0;
-        relTol          0;
+        solver              PCG;
+        preconditioner      DIC;
+        tolerance           1e-7;
+        relTol              0.1;
+    };
+
+    rhoFinal
+    {
+        $rho;
+        tolerance           1e-7;
+        relTol              0;
     };
 
     p
@@ -40,37 +47,13 @@ solvers
 
     pFinal
     {
-        solver              GAMG;
+        $p;
         tolerance           1e-7;
         relTol              0;
-        smoother            GaussSeidel;
-        cacheAgglomeration  true;
-        nCellsInCoarsestLevel 10;
-        agglomerator     faceAreaPair;
-        mergeLevels      1;
-    };
-
-
-    ft
-    {
-        solver          smoothSolver;
-        smoother        GaussSeidel;
-        tolerance       1e-7;
-        relTol          0;
-        nSweeps         1;
-    };
-
-    fu
-    {
-        solver          smoothSolver;
-        smoother        GaussSeidel;
-        tolerance       1e-7;
-        relTol          0;
-        nSweeps         1;
     };
 
 
-    U
+    "(U|ft|fu|k|hs)"
     {
         solver          smoothSolver;
         smoother        GaussSeidel;
@@ -79,31 +62,13 @@ solvers
         nSweeps         1;
     };
 
-    UFinal
-    {
-        solver          smoothSolver;
-        smoother        GaussSeidel;
-        tolerance       1e-7;
-        relTol          0;
-        nSweeps         1;
-    };
-
-    k
+    "(U|ft|fu|k|hs)Final"
     {
-        solver          smoothSolver;
-        smoother        GaussSeidel;
+        $U;
         tolerance       1e-7;
         relTol          0;
-        nSweeps         1;
     };
 
-    hs
-    {
-        solver          PBiCG;
-        preconditioner  DILU;
-        tolerance       1e-7;
-        relTol          0;
-    };
 
     Ii
     {
diff --git a/tutorials/combustion/reactingFoam/ras/counterFlowFlame2D/system/fvSolution b/tutorials/combustion/reactingFoam/ras/counterFlowFlame2D/system/fvSolution
index ad29357a948b796ebb157bd1a4738915d2b78aa7..38b8f5dbcc3a9ae2ecb1fa0852d1c3b66e4d0619 100755
--- a/tutorials/combustion/reactingFoam/ras/counterFlowFlame2D/system/fvSolution
+++ b/tutorials/combustion/reactingFoam/ras/counterFlowFlame2D/system/fvSolution
@@ -32,7 +32,7 @@ solvers
         relTol           0.0;
     }
 
-    "(U|Yi|h|k|epsilon)"
+    "(U|Yi|hs|k|epsilon)"
     {
         solver          PBiCG;
         preconditioner  DILU;
diff --git a/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/constant/thermophysicalProperties b/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/constant/thermophysicalProperties
index 04ef086ac62f675ceedc4c63a75f4153ee524dec..e30c05b865fe7c4aa99d8dbe92141769a8c2c228 100644
--- a/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/constant/thermophysicalProperties
+++ b/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/constant/thermophysicalProperties
@@ -15,11 +15,16 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-Pr              Pr [ 0 0 0 0 0 0 0 ] 0.72;
+Pr              0.72;
 
 thermoType      ePsiThermo<pureMixture<sutherlandTransport<specieThermo<janafThermo<perfectGas>>>>>;
 
-mixture         N2 1 28.01348 100 10000 1000 2.9525407 0.0013968838 -4.9262577e-07 7.8600091e-11 -4.6074978e-15 -923.93753 5.8718221 3.5309628 -0.0001236595 -5.0299339e-07 2.4352768e-09 -1.4087954e-12 -1046.9637 2.9674391 1.458e-06 110;
+mixture         N2
+     1 28.01348
+     100 10000 1000
+     2.9525407 0.0013968838 -4.9262577e-07 7.8600091e-11 -4.6074978e-15 -923.93753 5.8718221
+     3.5309628 -0.0001236595 -5.0299339e-07 2.4352768e-09 -1.4087954e-12 -1046.9637 2.9674391
+     1.458e-06 110;
 
 
 // ************************************************************************* //
diff --git a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/constant/polyMesh/blockMeshDict b/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/constant/polyMesh/blockMeshDict
deleted file mode 100644
index 0922303da33f01fd52960b00160c0dc787f5d9d4..0000000000000000000000000000000000000000
--- a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/constant/polyMesh/blockMeshDict
+++ /dev/null
@@ -1,123 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    format      ascii;
-    class       dictionary;
-    object      blockMeshDict;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// block definition for a porosity with an angled inlet/outlet
-// the porosity is not aligned with the main axes
-//
-                             
-convertToMeters 0.001;
-
-vertices
-(
-    // inlet region
-    ( -150  0  -25 )  // pt 0 (in1b) 
-    ( -150 35.35533906  -25 ) // pt 1 (in2b) 
-    ( -150  0  25 )  // pt 2 (in1f) 
-    ( -150 35.35533906  25 ) // pt 3 (in2f) 
-
-    // join inlet->outlet
-    (  0 0  -25 )    // pt 4 (join1b) 
-    ( -35.35533906   35.35533906  -25 ) // pt 5 (join2b) 
-    (  0 0  25 )    // pt 6 (join1f) 
-    ( -35.35533906   35.35533906  25 ) // pt 7 (join2f) 
-
-    // porosity ends ->outlet
-    ( 70.71067812 70.71067812  -25 )  // pt 8 (poro1b) 
-    ( 35.35533906 106.06601718  -25 )  // pt 9 (poro2b) 
-    ( 70.71067812 70.71067812  25 )  // pt 10 (poro1f) 
-    ( 35.35533906 106.06601718  25 )  // pt 11 (poro2f) 
-
-    // outlet
-    ( 141.42135624 141.42135624 -25 ) // pt 12 (out1b) 
-    ( 106.06601718 176.7766953 -25 ) // pt 13 (out2b) 
-    ( 141.42135624 141.42135624 25 ) // pt 14 (out1f) 
-    ( 106.06601718 176.7766953 25 ) // pt 15 (out2f) 
-);
-
-blocks
-(
-    // inlet block
-    hex (0 4 5 1 2 6 7 3)
-    inlet ( 15 20 20 ) simpleGrading (1 1 1)
-
-    // porosity block
-    hex (4 8 9 5 6 10 11 7)
-    porosity ( 20 20 20 ) simpleGrading (1 1 1)
-
-    // outlet block
-    hex (8 12 13 9 10 14 15 11)
-    outlet ( 20 20 20 )  simpleGrading (1 1 1)
-);
-
-edges
-(
-);
-
-patches
-(
-    // is there no way of defining all my 'defaultFaces' to be 'wall'?
-    wall front
-    (
-    // inlet block
-    (2 6 7 3)
-    // outlet block
-    (10 14 15 11)
-    )
-
-    wall back
-    (
-    // inlet block
-    (1 5 4 0)
-    // outlet block
-    (9 13 12 8)
-    )
-
-    wall wall
-    (
-    // inlet block
-    (2 0 4 6)
-    (7 5 1 3)
-    // outlet block
-    (10 8 12 14)
-    (15 13 9 11)
-    )
-
-    wall porosityWall
-    (
-    // porosity block
-    (6 10 11 7)
-    // porosity block
-    (5 9 8 4)
-    // porosity block
-    (6 4 8 10)
-    (11 9 5 7)
-    )
-
-    patch inlet
-    (
-    (3 1 0 2)
-    )
-
-    patch outlet
-    (
-    (15 13 12 14)
-    )
-);
-
-mergePatchPairs
-(
-);
-
-// ************************************************************************* //
diff --git a/tutorials/compressible/rhoPorousMRFPimpleFoam/mixerVessel2D/constant/polyMesh/blockMeshDict b/tutorials/compressible/rhoPorousMRFPimpleFoam/mixerVessel2D/constant/polyMesh/blockMeshDict
deleted file mode 100644
index 5a0740c3491935ebc792cf2f64ef413a56a7c89a..0000000000000000000000000000000000000000
--- a/tutorials/compressible/rhoPorousMRFPimpleFoam/mixerVessel2D/constant/polyMesh/blockMeshDict
+++ /dev/null
@@ -1,834 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    format      ascii;
-    class       dictionary;
-    object      blockMeshDict;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// General macros to create 2D/extruded-2D meshes
-
-
-
-
-
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-convertToMeters 0.1;
-
-// Hub radius
-
-
-// Impeller-tip radius
-
-
-// Baffle-tip radius
-
-
-// Tank radius
-
-
-// MRF region radius
-
-
-// Thickness of 2D slab
-
-
-// Base z
-
-
-// Top z
-
-
-// Number of cells radially between hub and impeller tip
-
-
-// Number of cells radially in each of the two regions between
-// impeller and baffle tips
-
-
-// Number of cells radially between baffle tip and tank
-
-
-// Number of cells azimuthally in each of the 8 blocks
-
-
-// Number of cells in the thickness of the slab
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-vertices
-(
-    (0.2 0 0) // Vertex r0b = 0 
-    (0.2 0 0) // Vertex r0sb = 1 
-    (0.141421356364228 -0.141421356110391 0) // Vertex r1b = 2 
-    (3.58979347393082e-10 -0.2 0) // Vertex r2b = 3 
-    (3.58979347393082e-10 -0.2 0) // Vertex r2sb = 4 
-    (-0.141421355856554 -0.141421356618065 0) // Vertex r3b = 5 
-    (-0.2 7.17958694786164e-10 0) // Vertex r4b = 6 
-    (-0.2 7.17958694786164e-10 0) // Vertex r4sb = 7 
-    (-0.141421355856554 0.141421356618065 0) // Vertex r5b = 8 
-    (3.58979347393082e-10 0.2 0) // Vertex r6b = 9 
-    (3.58979347393082e-10 0.2 0) // Vertex r6sb = 10 
-    (0.141421356364228 0.141421356110391 0) // Vertex r7b = 11 
-
-    (0.5 0 0) // Vertex rb0b = 12 
-    (0.353553390910569 -0.353553390275978 0) // Vertex rb1b = 13 
-    (8.97448368482705e-10 -0.5 0) // Vertex rb2b = 14 
-    (-0.353553389641386 -0.353553391545162 0) // Vertex rb3b = 15 
-    (-0.5 1.79489673696541e-09 0) // Vertex rb4b = 16 
-    (-0.353553389641386 0.353553391545162 0) // Vertex rb5b = 17 
-    (8.97448368482705e-10 0.5 0) // Vertex rb6b = 18 
-    (0.353553390910569 0.353553390275978 0) // Vertex rb7b = 19 
-
-    (0.6 0 0) // Vertex ri0b = 20 
-    (0.424264069092683 -0.424264068331174 0) // Vertex ri1b = 21 
-    (1.07693804217925e-09 -0.6 0) // Vertex ri2b = 22 
-    (-0.424264067569663 -0.424264069854194 0) // Vertex ri3b = 23 
-    (-0.6 2.15387608435849e-09 0) // Vertex ri4b = 24 
-    (-0.424264067569663 0.424264069854194 0) // Vertex ri5b = 25 
-    (1.07693804217925e-09 0.6 0) // Vertex ri6b = 26 
-    (0.424264069092683 0.424264068331174 0) // Vertex ri7b = 27 
-
-    (0.7 0 0) // Vertex Rb0b = 28 
-    (0.494974747274797 -0.494974746386369 0) // Vertex Rb1b = 29 
-    (1.25642771587579e-09 -0.7 0) // Vertex Rb2b = 30 
-    (-0.49497474549794 -0.494974748163226 0) // Vertex Rb3b = 31 
-    (-0.7 2.51285543175157e-09 0) // Vertex Rb4b = 32 
-    (-0.49497474549794 0.494974748163226 0) // Vertex Rb5b = 33 
-    (1.25642771587579e-09 0.7 0) // Vertex Rb6b = 34 
-    (0.494974747274797 0.494974746386369 0) // Vertex Rb7b = 35 
-
-    (1 0 0) // Vertex R0b = 36 
-    (0.707106781821139 -0.707106780551956 0) // Vertex R1b = 37 
-    (0.707106781821139 -0.707106780551956 0) // Vertex R1sb = 38 
-    (1.79489673696541e-09 -1 0) // Vertex R2b = 39 
-    (-0.707106779282772 -0.707106783090323 0) // Vertex R3b = 40 
-    (-0.707106779282772 -0.707106783090323 0) // Vertex R3sb = 41 
-    (-1 3.58979347393082e-09 0) // Vertex R4b = 42 
-    (-0.707106779282772 0.707106783090323 0) // Vertex R5b = 43 
-    (-0.707106779282772 0.707106783090323 0) // Vertex R5sb = 44 
-    (1.79489673696541e-09 1 0) // Vertex R6b = 45 
-    (0.707106781821139 0.707106780551956 0) // Vertex R7b = 46 
-    (0.707106781821139 0.707106780551956 0) // Vertex R7sb = 47 
-
-    (0.2 0 0.1) // Vertex r0t = 48 
-    (0.2 0 0.1) // Vertex r0st = 49 
-    (0.141421356364228 -0.141421356110391 0.1) // Vertex r1t = 50 
-    (3.58979347393082e-10 -0.2 0.1) // Vertex r2t = 51 
-    (3.58979347393082e-10 -0.2 0.1) // Vertex r2st = 52 
-    (-0.141421355856554 -0.141421356618065 0.1) // Vertex r3t = 53 
-    (-0.2 7.17958694786164e-10 0.1) // Vertex r4t = 54 
-    (-0.2 7.17958694786164e-10 0.1) // Vertex r4st = 55 
-    (-0.141421355856554 0.141421356618065 0.1) // Vertex r5t = 56 
-    (3.58979347393082e-10 0.2 0.1) // Vertex r6t = 57 
-    (3.58979347393082e-10 0.2 0.1) // Vertex r6st = 58 
-    (0.141421356364228 0.141421356110391 0.1) // Vertex r7t = 59 
-
-    (0.5 0 0.1) // Vertex rb0t = 60 
-    (0.353553390910569 -0.353553390275978 0.1) // Vertex rb1t = 61 
-    (8.97448368482705e-10 -0.5 0.1) // Vertex rb2t = 62 
-    (-0.353553389641386 -0.353553391545162 0.1) // Vertex rb3t = 63 
-    (-0.5 1.79489673696541e-09 0.1) // Vertex rb4t = 64 
-    (-0.353553389641386 0.353553391545162 0.1) // Vertex rb5t = 65 
-    (8.97448368482705e-10 0.5 0.1) // Vertex rb6t = 66 
-    (0.353553390910569 0.353553390275978 0.1) // Vertex rb7t = 67 
-
-    (0.6 0 0.1) // Vertex ri0t = 68 
-    (0.424264069092683 -0.424264068331174 0.1) // Vertex ri1t = 69 
-    (1.07693804217925e-09 -0.6 0.1) // Vertex ri2t = 70 
-    (-0.424264067569663 -0.424264069854194 0.1) // Vertex ri3t = 71 
-    (-0.6 2.15387608435849e-09 0.1) // Vertex ri4t = 72 
-    (-0.424264067569663 0.424264069854194 0.1) // Vertex ri5t = 73 
-    (1.07693804217925e-09 0.6 0.1) // Vertex ri6t = 74 
-    (0.424264069092683 0.424264068331174 0.1) // Vertex ri7t = 75 
-
-    (0.7 0 0.1) // Vertex Rb0t = 76 
-    (0.494974747274797 -0.494974746386369 0.1) // Vertex Rb1t = 77 
-    (1.25642771587579e-09 -0.7 0.1) // Vertex Rb2t = 78 
-    (-0.49497474549794 -0.494974748163226 0.1) // Vertex Rb3t = 79 
-    (-0.7 2.51285543175157e-09 0.1) // Vertex Rb4t = 80 
-    (-0.49497474549794 0.494974748163226 0.1) // Vertex Rb5t = 81 
-    (1.25642771587579e-09 0.7 0.1) // Vertex Rb6t = 82 
-    (0.494974747274797 0.494974746386369 0.1) // Vertex Rb7t = 83 
-
-    (1 0 0.1) // Vertex R0t = 84 
-    (0.707106781821139 -0.707106780551956 0.1) // Vertex R1t = 85 
-    (0.707106781821139 -0.707106780551956 0.1) // Vertex R1st = 86 
-    (1.79489673696541e-09 -1 0.1) // Vertex R2t = 87 
-    (-0.707106779282772 -0.707106783090323 0.1) // Vertex R3t = 88 
-    (-0.707106779282772 -0.707106783090323 0.1) // Vertex R3st = 89 
-    (-1 3.58979347393082e-09 0.1) // Vertex R4t = 90 
-    (-0.707106779282772 0.707106783090323 0.1) // Vertex R5t = 91 
-    (-0.707106779282772 0.707106783090323 0.1) // Vertex R5st = 92 
-    (1.79489673696541e-09 1 0.1) // Vertex R6t = 93 
-    (0.707106781821139 0.707106780551956 0.1) // Vertex R7t = 94 
-    (0.707106781821139 0.707106780551956 0.1) // Vertex R7st = 95 
-);
-
-blocks
-(
-    // block0
-    hex (0 2 13 12 48 50 61 60)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (2 4 14 13 50 52 62 61)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (3 5 15 14 51 53 63 62)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block3
-    hex (5 7 16 15 53 55 64 63)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block4
-    hex (6 8 17 16 54 56 65 64)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block5
-    hex (8 10 18 17 56 58 66 65)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block6
-    hex (9 11 19 18 57 59 67 66)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block7
-    hex (11 1 12 19 59 49 60 67)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block0
-    hex (12 13 21 20 60 61 69 68)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (13 14 22 21 61 62 70 69)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (14 15 23 22 62 63 71 70)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block3
-    hex (15 16 24 23 63 64 72 71)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block4
-    hex (16 17 25 24 64 65 73 72)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block5
-    hex (17 18 26 25 65 66 74 73)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block6
-    hex (18 19 27 26 66 67 75 74)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block7
-    hex (19 12 20 27 67 60 68 75)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block0
-    hex (20 21 29 28 68 69 77 76)
-    stator
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (21 22 30 29 69 70 78 77)
-    stator
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (22 23 31 30 70 71 79 78)
-    stator
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block3
-    hex (23 24 32 31 71 72 80 79)
-    stator
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block4
-    hex (24 25 33 32 72 73 81 80)
-    stator
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block5
-    hex (25 26 34 33 73 74 82 81)
-    stator
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block6
-    hex (26 27 35 34 74 75 83 82)
-    stator
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block7
-    hex (27 20 28 35 75 68 76 83)
-    stator
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block0
-    hex (28 29 38 36 76 77 86 84)
-    stator
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (29 30 39 37 77 78 87 85)
-    stator
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (30 31 41 39 78 79 89 87)
-    stator
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block3
-    hex (31 32 42 40 79 80 90 88)
-    stator
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block4
-    hex (32 33 44 42 80 81 92 90)
-    stator
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block5
-    hex (33 34 45 43 81 82 93 91)
-    stator
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block6
-    hex (34 35 47 45 82 83 95 93)
-    stator
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block7
-    hex (35 28 36 46 83 76 84 94)
-    stator
-    (12 12 1)
-    simpleGrading (1 1 1)
-);
-
-edges
-(
-    arc 0 2 (0.184775906536601 -0.0765366863901046 0)
-    arc 2 4 (0.0765366867217582 -0.184775906399226 0)
-    arc 3 5 (-0.0765366860584508 -0.184775906673977 0)
-    arc 5 7 (-0.18477590626185 -0.0765366870534118 0)
-    arc 6 8 (-0.18477590626185 0.0765366870534118 0)
-    arc 8 10 (-0.0765366860584508 0.184775906673977 0)
-    arc 9 11 (0.0765366867217582 0.184775906399226 0)
-    arc 11 1 (0.184775906536601 0.0765366863901046 0)
-
-    arc 12 13 (0.461939766341503 -0.191341715975262 0)
-    arc 13 14 (0.191341716804395 -0.461939765998065 0)
-    arc 14 15 (-0.191341715146127 -0.461939766684942 0)
-    arc 15 16 (-0.461939765654626 -0.19134171763353 0)
-    arc 16 17 (-0.461939765654626 0.19134171763353 0)
-    arc 17 18 (-0.191341715146127 0.461939766684942 0)
-    arc 18 19 (0.191341716804395 0.461939765998065 0)
-    arc 19 12 (0.461939766341503 0.191341715975262 0)
-
-    arc 20 21 (0.554327719609804 -0.229610059170314 0)
-    arc 21 22 (0.229610060165275 -0.554327719197677 0)
-    arc 22 23 (-0.229610058175352 -0.55432772002193 0)
-    arc 23 24 (-0.554327718785551 -0.229610061160235 0)
-    arc 24 25 (-0.554327718785551 0.229610061160235 0)
-    arc 25 26 (-0.229610058175352 0.55432772002193 0)
-    arc 26 27 (0.229610060165275 0.554327719197677 0)
-    arc 27 20 (0.554327719609804 0.229610059170314 0)
-
-    arc 28 29 (0.646715672878104 -0.267878402365366 0)
-    arc 29 30 (0.267878403526154 -0.64671567239729 0)
-    arc 30 31 (-0.267878401204578 -0.646715673358918 0)
-    arc 31 32 (-0.646715671916476 -0.267878404686941 0)
-    arc 32 33 (-0.646715671916476 0.267878404686941 0)
-    arc 33 34 (-0.267878401204578 0.646715673358918 0)
-    arc 34 35 (0.267878403526154 0.64671567239729 0)
-    arc 35 28 (0.646715672878104 0.267878402365366 0)
-
-    arc 36 38 (0.923879532683006 -0.382683431950523 0)
-    arc 37 39 (0.382683433608791 -0.923879531996129 0)
-    arc 39 41 (-0.382683430292254 -0.923879533369883 0)
-    arc 40 42 (-0.923879531309252 -0.382683435267059 0)
-    arc 42 44 (-0.923879531309252 0.382683435267059 0)
-    arc 43 45 (-0.382683430292254 0.923879533369883 0)
-    arc 45 47 (0.382683433608791 0.923879531996129 0)
-    arc 46 36 (0.923879532683006 0.382683431950523 0)
-
-    arc 48 50 (0.184775906536601 -0.0765366863901046 0.1)
-    arc 50 52 (0.0765366867217582 -0.184775906399226 0.1)
-    arc 51 53 (-0.0765366860584508 -0.184775906673977 0.1)
-    arc 53 55 (-0.18477590626185 -0.0765366870534118 0.1)
-    arc 54 56 (-0.18477590626185 0.0765366870534118 0.1)
-    arc 56 58 (-0.0765366860584508 0.184775906673977 0.1)
-    arc 57 59 (0.0765366867217582 0.184775906399226 0.1)
-    arc 59 49 (0.184775906536601 0.0765366863901046 0.1)
-
-    arc 60 61 (0.461939766341503 -0.191341715975262 0.1)
-    arc 61 62 (0.191341716804395 -0.461939765998065 0.1)
-    arc 62 63 (-0.191341715146127 -0.461939766684942 0.1)
-    arc 63 64 (-0.461939765654626 -0.19134171763353 0.1)
-    arc 64 65 (-0.461939765654626 0.19134171763353 0.1)
-    arc 65 66 (-0.191341715146127 0.461939766684942 0.1)
-    arc 66 67 (0.191341716804395 0.461939765998065 0.1)
-    arc 67 60 (0.461939766341503 0.191341715975262 0.1)
-
-    arc 68 69 (0.554327719609804 -0.229610059170314 0.1)
-    arc 69 70 (0.229610060165275 -0.554327719197677 0.1)
-    arc 70 71 (-0.229610058175352 -0.55432772002193 0.1)
-    arc 71 72 (-0.554327718785551 -0.229610061160235 0.1)
-    arc 72 73 (-0.554327718785551 0.229610061160235 0.1)
-    arc 73 74 (-0.229610058175352 0.55432772002193 0.1)
-    arc 74 75 (0.229610060165275 0.554327719197677 0.1)
-    arc 75 68 (0.554327719609804 0.229610059170314 0.1)
-
-    arc 76 77 (0.646715672878104 -0.267878402365366 0.1)
-    arc 77 78 (0.267878403526154 -0.64671567239729 0.1)
-    arc 78 79 (-0.267878401204578 -0.646715673358918 0.1)
-    arc 79 80 (-0.646715671916476 -0.267878404686941 0.1)
-    arc 80 81 (-0.646715671916476 0.267878404686941 0.1)
-    arc 81 82 (-0.267878401204578 0.646715673358918 0.1)
-    arc 82 83 (0.267878403526154 0.64671567239729 0.1)
-    arc 83 76 (0.646715672878104 0.267878402365366 0.1)
-
-    arc 84 86 (0.923879532683006 -0.382683431950523 0.1)
-    arc 85 87 (0.382683433608791 -0.923879531996129 0.1)
-    arc 87 89 (-0.382683430292254 -0.923879533369883 0.1)
-    arc 88 90 (-0.923879531309252 -0.382683435267059 0.1)
-    arc 90 92 (-0.923879531309252 0.382683435267059 0.1)
-    arc 91 93 (-0.382683430292254 0.923879533369883 0.1)
-    arc 93 95 (0.382683433608791 0.923879531996129 0.1)
-    arc 94 84 (0.923879532683006 0.382683431950523 0.1)
-);
-
-patches
-(
-    wall rotor
-    (
-        (0 2 50 48)
-        (2 4 52 50)
-        (3 5 53 51)
-        (5 7 55 53)
-        (6 8 56 54)
-        (8 10 58 56)
-        (9 11 59 57)
-        (11 1 49 59)
-
-        (0 12 60 48)
-        (1 12 60 49)
-
-        (3 14 62 51)
-        (4 14 62 52)
-
-        (6 16 64 54)
-        (7 16 64 55)
-
-        (9 18 66 57)
-        (10 18 66 58)
-    )
-
-    wall stator
-    (
-        (36 38 86 84)
-        (37 39 87 85)
-        (39 41 89 87)
-        (40 42 90 88)
-        (42 44 92 90)
-        (43 45 93 91)
-        (45 47 95 93)
-        (46 36 84 94)
-
-        (37 29 77 85)
-        (38 29 77 86)
-
-        (40 31 79 88)
-        (41 31 79 89)
-
-        (43 33 81 91)
-        (44 33 81 92)
-
-        (46 35 83 94)
-        (47 35 83 95)
-    )
-
-    empty front
-    (
-        (48 50 61 60)
-        (50 52 62 61)
-        (51 53 63 62)
-        (53 55 64 63)
-        (54 56 65 64)
-        (56 58 66 65)
-        (57 59 67 66)
-        (59 49 60 67)
-        (60 61 69 68)
-        (61 62 70 69)
-        (62 63 71 70)
-        (63 64 72 71)
-        (64 65 73 72)
-        (65 66 74 73)
-        (66 67 75 74)
-        (67 60 68 75)
-        (68 69 77 76)
-        (69 70 78 77)
-        (70 71 79 78)
-        (71 72 80 79)
-        (72 73 81 80)
-        (73 74 82 81)
-        (74 75 83 82)
-        (75 68 76 83)
-        (76 77 86 84)
-        (77 78 87 85)
-        (78 79 89 87)
-        (79 80 90 88)
-        (80 81 92 90)
-        (81 82 93 91)
-        (82 83 95 93)
-        (83 76 84 94)
-    )
-
-    empty back
-    (
-        (0 12 13 2)
-        (2 13 14 4)
-        (3 14 15 5)
-        (5 15 16 7)
-        (6 16 17 8)
-        (8 17 18 10)
-        (9 18 19 11)
-        (11 19 12 1)
-        (12 20 21 13)
-        (13 21 22 14)
-        (14 22 23 15)
-        (15 23 24 16)
-        (16 24 25 17)
-        (17 25 26 18)
-        (18 26 27 19)
-        (19 27 20 12)
-        (20 28 29 21)
-        (21 29 30 22)
-        (22 30 31 23)
-        (23 31 32 24)
-        (24 32 33 25)
-        (25 33 34 26)
-        (26 34 35 27)
-        (27 35 28 20)
-        (28 36 38 29)
-        (29 37 39 30)
-        (30 39 41 31)
-        (31 40 42 32)
-        (32 42 44 33)
-        (33 43 45 34)
-        (34 45 47 35)
-        (35 46 36 28)
-    )
-);
-
-// ************************************************************************* //
diff --git a/tutorials/compressible/rhoPorousMRFPimpleFoam/mixerVessel2D/system/fvSolution b/tutorials/compressible/rhoPorousMRFPimpleFoam/mixerVessel2D/system/fvSolution
index 4ebcefc07df4a52be92b5eed071d07dba80abde7..2e74c6af29ae26f3a75575fb96a5decf757c5a2e 100644
--- a/tutorials/compressible/rhoPorousMRFPimpleFoam/mixerVessel2D/system/fvSolution
+++ b/tutorials/compressible/rhoPorousMRFPimpleFoam/mixerVessel2D/system/fvSolution
@@ -22,6 +22,13 @@ solvers
         solver          PCG;
         preconditioner  DIC;
         tolerance       1e-5;
+        relTol          0.1;
+    }
+
+    rhoFinal
+    {
+        $rho;
+        tolerance       1e-5;
         relTol          0;
     }
 
@@ -65,7 +72,7 @@ solvers
         mergeLevels     1;
     }
 
-    h
+    "(U|h|k|epsilon)"
     {
         solver          PBiCG;
         preconditioner  DILU;
@@ -73,26 +80,9 @@ solvers
         relTol          0.1;
     }
 
-    hFinal
+    "(U|h|k|epsilon)Final"
     {
-        solver          PBiCG;
-        preconditioner  DILU;
-        tolerance       1e-5;
-        relTol          0;
-    }
-
-    k
-    {
-        solver          PBiCG;
-        preconditioner  DILU;
-        tolerance       1e-5;
-        relTol          0;
-    }
-
-    epsilon
-    {
-        solver          PBiCG;
-        preconditioner  DILU;
+        $U;
         tolerance       1e-5;
         relTol          0;
     }
diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict
deleted file mode 100644
index 0922303da33f01fd52960b00160c0dc787f5d9d4..0000000000000000000000000000000000000000
--- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict
+++ /dev/null
@@ -1,123 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    format      ascii;
-    class       dictionary;
-    object      blockMeshDict;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// block definition for a porosity with an angled inlet/outlet
-// the porosity is not aligned with the main axes
-//
-                             
-convertToMeters 0.001;
-
-vertices
-(
-    // inlet region
-    ( -150  0  -25 )  // pt 0 (in1b) 
-    ( -150 35.35533906  -25 ) // pt 1 (in2b) 
-    ( -150  0  25 )  // pt 2 (in1f) 
-    ( -150 35.35533906  25 ) // pt 3 (in2f) 
-
-    // join inlet->outlet
-    (  0 0  -25 )    // pt 4 (join1b) 
-    ( -35.35533906   35.35533906  -25 ) // pt 5 (join2b) 
-    (  0 0  25 )    // pt 6 (join1f) 
-    ( -35.35533906   35.35533906  25 ) // pt 7 (join2f) 
-
-    // porosity ends ->outlet
-    ( 70.71067812 70.71067812  -25 )  // pt 8 (poro1b) 
-    ( 35.35533906 106.06601718  -25 )  // pt 9 (poro2b) 
-    ( 70.71067812 70.71067812  25 )  // pt 10 (poro1f) 
-    ( 35.35533906 106.06601718  25 )  // pt 11 (poro2f) 
-
-    // outlet
-    ( 141.42135624 141.42135624 -25 ) // pt 12 (out1b) 
-    ( 106.06601718 176.7766953 -25 ) // pt 13 (out2b) 
-    ( 141.42135624 141.42135624 25 ) // pt 14 (out1f) 
-    ( 106.06601718 176.7766953 25 ) // pt 15 (out2f) 
-);
-
-blocks
-(
-    // inlet block
-    hex (0 4 5 1 2 6 7 3)
-    inlet ( 15 20 20 ) simpleGrading (1 1 1)
-
-    // porosity block
-    hex (4 8 9 5 6 10 11 7)
-    porosity ( 20 20 20 ) simpleGrading (1 1 1)
-
-    // outlet block
-    hex (8 12 13 9 10 14 15 11)
-    outlet ( 20 20 20 )  simpleGrading (1 1 1)
-);
-
-edges
-(
-);
-
-patches
-(
-    // is there no way of defining all my 'defaultFaces' to be 'wall'?
-    wall front
-    (
-    // inlet block
-    (2 6 7 3)
-    // outlet block
-    (10 14 15 11)
-    )
-
-    wall back
-    (
-    // inlet block
-    (1 5 4 0)
-    // outlet block
-    (9 13 12 8)
-    )
-
-    wall wall
-    (
-    // inlet block
-    (2 0 4 6)
-    (7 5 1 3)
-    // outlet block
-    (10 8 12 14)
-    (15 13 9 11)
-    )
-
-    wall porosityWall
-    (
-    // porosity block
-    (6 10 11 7)
-    // porosity block
-    (5 9 8 4)
-    // porosity block
-    (6 4 8 10)
-    (11 9 5 7)
-    )
-
-    patch inlet
-    (
-    (3 1 0 2)
-    )
-
-    patch outlet
-    (
-    (15 13 12 14)
-    )
-);
-
-mergePatchPairs
-(
-);
-
-// ************************************************************************* //
diff --git a/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/0/T.org b/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/0/T.org
index 98cc191af7c9e6234287f45ebeab0cdea6ab8b62..77b58a1a00e6421c4d9c3f72a36b3d190e41ef7f 100644
--- a/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/0/T.org
+++ b/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/0/T.org
@@ -23,411 +23,7 @@ boundaryField
     floor
     {
         type            fixedValue;
-        value           nonuniform List<scalar> 
-400
-(
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-600
-600
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-600
-600
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-)
-;
+        value           uniform 300; 
     }
     ceiling
     {
diff --git a/tutorials/multiphase/interFoam/ras/damBreak/0/mut b/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/0/kappat
similarity index 72%
rename from tutorials/multiphase/interFoam/ras/damBreak/0/mut
rename to tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/0/kappat
index 9370a88efe42eefb0880f023351d2f0b2e8aa343..60ef341d5562f4a78ae0c40c6d2f64fde3367c6c 100644
--- a/tutorials/multiphase/interFoam/ras/damBreak/0/mut
+++ b/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/0/kappat
@@ -11,44 +11,34 @@ FoamFile
     format      ascii;
     class       volScalarField;
     location    "0";
-    object      mut;
+    object      kappat;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-dimensions      [ 1 -1 -1 0 0 0 0 ];
+dimensions      [0 2 -1 0 0 0 0];
 
 internalField   uniform 0;
 
 boundaryField
 {
-    leftWall
+    floor
     {
-        type            mutkWallFunction;
+        type            kappatJayatillekeWallFunction;
+        Prt             0.85;
         value           uniform 0;
     }
-
-    rightWall
+    ceiling
     {
-        type            mutkWallFunction;
+        type            kappatJayatillekeWallFunction;
+        Prt             0.85;
         value           uniform 0;
     }
-
-    lowerWall
+    fixedWalls
     {
-        type            mutkWallFunction;
+        type            kappatJayatillekeWallFunction;
+        Prt             0.85;
         value           uniform 0;
     }
-
-    atmosphere
-    {
-        type            calculated;
-        value           uniform 0;
-    }
-
-    defaultFaces
-    {
-        type            empty;
-    }
 }
 
 
diff --git a/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/0/p b/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/0/p
index b247cdcbaf97dc148fad58ea63f67e45e15d6d72..ed297deb8eed1122515449b3984ffe2cc178e15c 100644
--- a/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/0/p
+++ b/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/0/p
@@ -22,23 +22,20 @@ boundaryField
 {
     floor
     {
-        type            buoyantPressure;
-        rho             rhok;
-        value           uniform 0;
+        type            calculated;
+        value           $internalField;
     }
 
     ceiling
     {
-        type            buoyantPressure;
-        rho             rhok;
-        value           uniform 0;
+        type            calculated;
+        value           $internalField;
     }
 
     fixedWalls
     {
-        type            buoyantPressure;
-        rho             rhok;
-        value           uniform 0;
+        type            calculated;
+        value           $internalField;
     }
 }
 
diff --git a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0/p b/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/0/p_rgh
similarity index 77%
rename from tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0/p
rename to tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/0/p_rgh
index 775cd5b893ea19cbfc37a742d2957a8e896666fd..270f01455806dd8d9937dc89b463b5e082fe41c9 100644
--- a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0/p
+++ b/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/0/p_rgh
@@ -10,37 +10,34 @@ FoamFile
     version     2.0;
     format      ascii;
     class       volScalarField;
-    object      p;
+    object      p_rgh;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-dimensions      [1 -1 -2 0 0 0 0];
+dimensions      [0 2 -2 0 0 0 0];
 
 internalField   uniform 0;
 
 boundaryField
 {
-    walls
+    floor
     {
         type            buoyantPressure;
+        rho             rhok;
         value           uniform 0;
     }
 
-    obstacle
+    ceiling
     {
         type            buoyantPressure;
+        rho             rhok;
         value           uniform 0;
     }
 
-    atmosphere
+    fixedWalls
     {
-        type            totalPressure;
-        p0              uniform 0;
-        U               U;
-        phi             phi;
-        rho             rho;
-        psi             none;
-        gamma           1;
+        type            buoyantPressure;
+        rho             rhok;
         value           uniform 0;
     }
 }
diff --git a/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/Allclean b/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/Allclean
index 25243dd42f8aff1c422994b6303af87d894424c3..fcc6e9c9cd8501447ff8d319f904432911616575 100755
--- a/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/Allclean
+++ b/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/Allclean
@@ -5,6 +5,6 @@ cd ${0%/*} || exit 1    # run from this directory
 . $WM_PROJECT_DIR/bin/tools/CleanFunctions
 
 cleanCase
-cp 0/T.org 0/T
+rm -f 0/T
 
 # ----------------------------------------------------------------- end-of-file
diff --git a/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/Allrun b/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/Allrun
index cb0be1e6e06e5244e2bddc492b8cb56b1ca04acd..800bb5731994d0f3a70b9f5ff7865f9659c1e4f7 100755
--- a/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/Allrun
+++ b/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/Allrun
@@ -8,6 +8,7 @@ application=`getApplication`
 
 compileApplication ../../buoyantPimpleFoam/hotRoom/setHotRoom
 runApplication blockMesh
+cp 0/T.org 0/T
 runApplication setHotRoom
 runApplication $application
 
diff --git a/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/system/fvSchemes b/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/system/fvSchemes
index fef36c6b1496b2039f68515cb96bd1a7667d41ad..764772f38ec2e85d1b5ed6c80bb02bad97ec37e6 100644
--- a/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/system/fvSchemes
+++ b/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/system/fvSchemes
@@ -40,12 +40,12 @@ divSchemes
 laplacianSchemes
 {
     default         none;
-    laplacian(nuEff,U) Gauss linear corrected;
-    laplacian((1|A(U)),p) Gauss linear corrected;
-    laplacian(kappaEff,T) Gauss linear corrected;
-    laplacian(DkEff,k) Gauss linear corrected;
-    laplacian(DepsilonEff,epsilon) Gauss linear corrected;
-    laplacian(DREff,R) Gauss linear corrected;
+    laplacian(nuEff,U) Gauss linear uncorrected;
+    laplacian((1|A(U)),p_rgh) Gauss linear uncorrected;
+    laplacian(kappaEff,T) Gauss linear uncorrected;
+    laplacian(DkEff,k) Gauss linear uncorrected;
+    laplacian(DepsilonEff,epsilon) Gauss linear uncorrected;
+    laplacian(DREff,R) Gauss linear uncorrected;
 }
 
 interpolationSchemes
@@ -55,13 +55,13 @@ interpolationSchemes
 
 snGradSchemes
 {
-    default         corrected;
+    default         uncorrected;
 }
 
 fluxRequired
 {
     default         no;
-    p               ;
+    p_rgh;
 }
 
 
diff --git a/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/system/fvSolution b/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/system/fvSolution
index 4c0b29ac70ad13ef23ad10f3daf5c0a46cb10d88..dccd8e082d3693f9f1ffeb6421104fc5fcb6996f 100644
--- a/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/system/fvSolution
+++ b/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/system/fvSolution
@@ -17,17 +17,17 @@ FoamFile
 
 solvers
 {
-    p
+    p_rgh
     {
         solver          PCG;
         preconditioner  DIC;
         tolerance       1e-8;
-        relTol          0.1;
+        relTol          0.01;
     }
 
-    pFinal
+    p_rghFinal
     {
-        $p;
+        $p_rgh;
         relTol          0;
     }
 
diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/kappat b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/kappat
new file mode 100644
index 0000000000000000000000000000000000000000..60ef341d5562f4a78ae0c40c6d2f64fde3367c6c
--- /dev/null
+++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/kappat
@@ -0,0 +1,45 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       volScalarField;
+    location    "0";
+    object      kappat;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions      [0 2 -1 0 0 0 0];
+
+internalField   uniform 0;
+
+boundaryField
+{
+    floor
+    {
+        type            kappatJayatillekeWallFunction;
+        Prt             0.85;
+        value           uniform 0;
+    }
+    ceiling
+    {
+        type            kappatJayatillekeWallFunction;
+        Prt             0.85;
+        value           uniform 0;
+    }
+    fixedWalls
+    {
+        type            kappatJayatillekeWallFunction;
+        Prt             0.85;
+        value           uniform 0;
+    }
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/p b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/p
index b247cdcbaf97dc148fad58ea63f67e45e15d6d72..ed297deb8eed1122515449b3984ffe2cc178e15c 100644
--- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/p
+++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/p
@@ -22,23 +22,20 @@ boundaryField
 {
     floor
     {
-        type            buoyantPressure;
-        rho             rhok;
-        value           uniform 0;
+        type            calculated;
+        value           $internalField;
     }
 
     ceiling
     {
-        type            buoyantPressure;
-        rho             rhok;
-        value           uniform 0;
+        type            calculated;
+        value           $internalField;
     }
 
     fixedWalls
     {
-        type            buoyantPressure;
-        rho             rhok;
-        value           uniform 0;
+        type            calculated;
+        value           $internalField;
     }
 }
 
diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/p_rgh b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/p_rgh
new file mode 100644
index 0000000000000000000000000000000000000000..270f01455806dd8d9937dc89b463b5e082fe41c9
--- /dev/null
+++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/p_rgh
@@ -0,0 +1,45 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       volScalarField;
+    object      p_rgh;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions      [0 2 -2 0 0 0 0];
+
+internalField   uniform 0;
+
+boundaryField
+{
+    floor
+    {
+        type            buoyantPressure;
+        rho             rhok;
+        value           uniform 0;
+    }
+
+    ceiling
+    {
+        type            buoyantPressure;
+        rho             rhok;
+        value           uniform 0;
+    }
+
+    fixedWalls
+    {
+        type            buoyantPressure;
+        rho             rhok;
+        value           uniform 0;
+    }
+}
+
+// ************************************************************************* //
diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/Allclean b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/Allclean
index 25243dd42f8aff1c422994b6303af87d894424c3..fcc6e9c9cd8501447ff8d319f904432911616575 100755
--- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/Allclean
+++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/Allclean
@@ -5,6 +5,6 @@ cd ${0%/*} || exit 1    # run from this directory
 . $WM_PROJECT_DIR/bin/tools/CleanFunctions
 
 cleanCase
-cp 0/T.org 0/T
+rm -f 0/T
 
 # ----------------------------------------------------------------- end-of-file
diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/Allrun b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/Allrun
index cb0be1e6e06e5244e2bddc492b8cb56b1ca04acd..800bb5731994d0f3a70b9f5ff7865f9659c1e4f7 100755
--- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/Allrun
+++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/Allrun
@@ -8,6 +8,7 @@ application=`getApplication`
 
 compileApplication ../../buoyantPimpleFoam/hotRoom/setHotRoom
 runApplication blockMesh
+cp 0/T.org 0/T
 runApplication setHotRoom
 runApplication $application
 
diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/system/controlDict b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/system/controlDict
index dc6fb2083038ddd652546158951f808baa343ac6..820670013786a49ad59768fc77430307f6b2c088 100644
--- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/system/controlDict
+++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/system/controlDict
@@ -45,5 +45,25 @@ timePrecision   6;
 
 runTimeModifiable true;
 
+functions
+{
+    residualControl1
+    {
+        type            residualControl;
+        functionObjectLibs ( "libjobControl.so" );
+        outputControl   timeStep;
+        outputInterval  1;
+
+        maxResiduals
+        {
+            p_rgh   1e-2;
+            U       1e-4;
+            T       1e-3;
+
+            // possibly check turbulence fields
+            "(k|epsilon|omega)" 1e-3;
+        }
+    }
+}
 
 // ************************************************************************* //
diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/system/fvSolution b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/system/fvSolution
index 68da3948e5ca1d13e30c97424ef5ef1a1eb8c1cf..c51949b80579958618776e4c7ce21eae0171eb65 100644
--- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/system/fvSolution
+++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/system/fvSolution
@@ -37,17 +37,15 @@ solvers
 SIMPLE
 {
     nNonOrthogonalCorrectors 0;
-    p_rghRefCell    0;
-    p_rghRefValue   0;
+    pRefCell        0;
     pRefValue       0;
 }
 
 relaxationFactors
 {
-    rho             1;
     p_rgh           0.7;
     U               0.2;
-    T               0.7;
+    T               0.5;
     "(k|epsilon|R)" 0.7;
 }
 
diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/kappat b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/kappat
new file mode 100644
index 0000000000000000000000000000000000000000..1bea15c9c21b5f5608846e6ad72234b69ee0b8e2
--- /dev/null
+++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/kappat
@@ -0,0 +1,54 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       volScalarField;
+    location    "0";
+    object      kappat;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions      [0 2 -1 0 0 0 0];
+
+internalField   uniform 0;
+
+boundaryField
+{
+    ground
+    {
+        type            kappatJayatillekeWallFunction;
+        Prt             0.85;
+        value           uniform 0;
+    }
+
+    igloo_region0
+    {
+        type            kappatJayatillekeWallFunction;
+        Prt             0.85;
+        value           uniform 0;
+    }
+
+    twoFridgeFreezers_seal_0
+    {
+        type            kappatJayatillekeWallFunction;
+        Prt             0.85;
+        value           uniform 0;
+    }
+
+    twoFridgeFreezers_herring_1
+    {
+        type            kappatJayatillekeWallFunction;
+        Prt             0.85;
+        value           uniform 0;
+    }
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/p b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/p
index 5486bbf9fcedf55174c7dc3c9f25ed67ccdc7e4b..3f7a67aa5e3d7442ddeeb510a4298b05deeea011 100644
--- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/p
+++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/p
@@ -22,30 +22,26 @@ boundaryField
 {
     ground
     {
-        type            buoyantPressure;
-        rho             rhok;
-        value           uniform 0;
+        type            calculated;
+        value           $internalField;
     }
 
     igloo_region0
     {
-        type            buoyantPressure;
-        rho             rhok;
-        value           uniform 0;
+        type            calculated;
+        value           $internalField;
     }
 
     twoFridgeFreezers_seal_0
     {
-        type            buoyantPressure;
-        rho             rhok;
-        value           uniform 0;
+        type            calculated;
+        value           $internalField;
     }
 
     twoFridgeFreezers_herring_1
     {
-        type            buoyantPressure;
-        rho             rhok;
-        value           uniform 0;
+        type            calculated;
+        value           $internalField;
     }
 }
 
diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/p_rgh b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/p_rgh
new file mode 100644
index 0000000000000000000000000000000000000000..396cc60de4fc08e7618320bb9f5ebefb563c7da9
--- /dev/null
+++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/p_rgh
@@ -0,0 +1,52 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       volScalarField;
+    object      p_rgh;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions      [0 2 -2 0 0 0 0];
+
+internalField   uniform 0;
+
+boundaryField
+{
+    ground
+    {
+        type            buoyantPressure;
+        rho             rhok;
+        value           uniform 0;
+    }
+
+    igloo_region0
+    {
+        type            buoyantPressure;
+        rho             rhok;
+        value           uniform 0;
+    }
+
+    twoFridgeFreezers_seal_0
+    {
+        type            buoyantPressure;
+        rho             rhok;
+        value           uniform 0;
+    }
+
+    twoFridgeFreezers_herring_1
+    {
+        type            buoyantPressure;
+        rho             rhok;
+        value           uniform 0;
+    }
+}
+
+// ************************************************************************* //
diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/constant/polyMesh/boundary b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/constant/polyMesh/boundary
index e3e3c88c206fc91de134a934be1f72721a804725..2876f3adad56b802155c54691fe41731d7fe90d3 100644
--- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/constant/polyMesh/boundary
+++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/constant/polyMesh/boundary
@@ -21,55 +21,55 @@ FoamFile
     {
         type            empty;
         nFaces          0;
-        startFace       60456;
+        startFace       60336;
     }
     minX
     {
         type            empty;
         nFaces          0;
-        startFace       60456;
+        startFace       60336;
     }
     maxX
     {
         type            empty;
         nFaces          0;
-        startFace       60456;
+        startFace       60336;
     }
     minY
     {
         type            empty;
         nFaces          0;
-        startFace       60456;
+        startFace       60336;
     }
     ground
     {
         type            wall;
         nFaces          590;
-        startFace       60456;
+        startFace       60336;
     }
     maxZ
     {
         type            empty;
         nFaces          0;
-        startFace       61046;
+        startFace       60926;
     }
     igloo_region0
     {
         type            wall;
         nFaces          2260;
-        startFace       61046;
+        startFace       60926;
     }
     twoFridgeFreezers_seal_0
     {
         type            wall;
         nFaces          1344;
-        startFace       63306;
+        startFace       63186;
     }
     twoFridgeFreezers_herring_1
     {
         type            wall;
         nFaces          1116;
-        startFace       64650;
+        startFace       64530;
     }
 )
 
diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/controlDict b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/controlDict
index 73cfe8ada43473f1bb82beb55a0584a57aae0025..bf11b4f154badfe3e89c5fa7ff6f674294b40800 100644
--- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/controlDict
+++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/controlDict
@@ -45,5 +45,25 @@ timePrecision   6;
 
 runTimeModifiable true;
 
+functions
+{
+    residualControl1
+    {
+        type            residualControl;
+        functionObjectLibs ( "libjobControl.so" );
+        outputControl   timeStep;
+        outputInterval  1;
+
+        maxResiduals
+        {
+            p_rgh   1e-2;
+            U       1e-4;
+            T       1e-3;
+
+            // possibly check turbulence fields
+            "(k|epsilon|omega)" 1e-3;
+        }
+    }
+}
 
 // ************************************************************************* //
diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/fvSolution b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/fvSolution
index 8df126a48366dc10aea3e57600f533461b45a65d..edea946f9ac02addf005716ef56d84c750cf2b06 100644
--- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/fvSolution
+++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/fvSolution
@@ -37,16 +37,15 @@ solvers
 SIMPLE
 {
     nNonOrthogonalCorrectors 0;
-    p_rghRefCell    0;
-    p_rghRefValue   0;
+    pRefCell        0;
     pRefValue       0;
 }
 
 relaxationFactors
 {
-    p_rgh           0.8;
+    p_rgh           0.7;
     U               0.2;
-    T               0.7;
+    T               0.5;
     "(k|epsilon)"   0.7;
 }
 
diff --git a/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/0/p b/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/0/p
index 9854db7add58f4a75054fe9cff734f99d9304e8c..d6ab24211f697f7dfee98b8bfc5f8359c5bed1ef 100644
--- a/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/0/p
+++ b/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/0/p
@@ -22,20 +22,20 @@ boundaryField
 {
     floor
     {
-        type            buoyantPressure;
-        value           uniform 1e5;
+        type            calculated;
+        value           $internalField;
     }
 
     ceiling
     {
-        type            buoyantPressure;
-        value           uniform 1e5;
+        type            calculated;
+        value           $internalField;
     }
 
     fixedWalls
     {
-        type            buoyantPressure;
-        value           uniform 1e5;
+        type            calculated;
+        value           $internalField;
     }
 }
 
diff --git a/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/0/p_rgh b/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/0/p_rgh
new file mode 100644
index 0000000000000000000000000000000000000000..371d93c38aace14c5187b795c88f08d8f9f36bfa
--- /dev/null
+++ b/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/0/p_rgh
@@ -0,0 +1,42 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       volScalarField;
+    object      p_rgh;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions      [1 -1 -2 0 0 0 0];
+
+internalField   uniform 1e5;
+
+boundaryField
+{
+    floor
+    {
+        type            buoyantPressure;
+        value           uniform 1e5;
+    }
+
+    ceiling
+    {
+        type            buoyantPressure;
+        value           uniform 1e5;
+    }
+
+    fixedWalls
+    {
+        type            buoyantPressure;
+        value           uniform 1e5;
+    }
+}
+
+// ************************************************************************* //
diff --git a/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/system/fvSchemes b/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/system/fvSchemes
index 8caf680281b70920a18d0744a606c78262c44e3d..b238c08e08add804d21bb294586ad8a118c9cd8d 100644
--- a/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/system/fvSchemes
+++ b/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/system/fvSchemes
@@ -42,7 +42,7 @@ laplacianSchemes
 {
     default         none;
     laplacian(muEff,U) Gauss linear corrected;
-    laplacian((rho*(1|A(U))),p) Gauss linear corrected;
+    laplacian((rho*(1|A(U))),p_rgh) Gauss linear corrected;
     laplacian(alphaEff,h) Gauss linear corrected;
     laplacian(DkEff,k) Gauss linear corrected;
     laplacian(DepsilonEff,epsilon) Gauss linear corrected;
@@ -62,7 +62,7 @@ snGradSchemes
 fluxRequired
 {
     default         no;
-    p               ;
+    p_rgh;
 }
 
 
diff --git a/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/system/fvSolution b/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/system/fvSolution
index 9ad9aaa4ceaa48d329158cb6eeeb993a71e22214..0473bd2bf3b60c51713f03f3f70c26156b6933d3 100644
--- a/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/system/fvSolution
+++ b/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/system/fvSolution
@@ -25,17 +25,17 @@ solvers
         relTol          0;
     }
 
-    p
+    p_rgh
     {
         solver          PCG;
         preconditioner  DIC;
         tolerance       1e-8;
-        relTol          0.1;
+        relTol          0.01;
     }
 
-    pFinal
+    p_rghFinal
     {
-        $p;
+        $p_rgh;
         relTol          0;
     }
 
@@ -44,7 +44,7 @@ solvers
         solver          PBiCG;
         preconditioner  DILU;
         tolerance       1e-6;
-        relTol          0;
+        relTol          0.1;
     }
 
     "(U|h|k|epsilon|R)Final"
@@ -56,7 +56,7 @@ solvers
 
 PIMPLE
 {
-    momentumPredictor no;
+    momentumPredictor yes;
     nOuterCorrectors 1;
     nCorrectors     2;
     nNonOrthogonalCorrectors 0;
diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/0/p b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/0/p
index 0961828a5b013e1a4ef3778d971a1b10656fcc3f..9d710bdf49ee77f16275c99e13aa7727ecb93a51 100644
--- a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/0/p
+++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/0/p
@@ -23,26 +23,26 @@ boundaryField
 {
     frontAndBack 
     {
-        type            buoyantPressure;
-        value           uniform 1e5;
+        type            calculated;
+        value           $internalField;
     }
 
     topAndBottom
     {
-        type            buoyantPressure;
-        value           uniform 1e5;
+        type            calculated;
+        value           $internalField;
     }
 
     hot
     {
-        type            buoyantPressure;
-        value           uniform 1e5;
+        type            calculated;
+        value           $internalField;
     }
 
     cold
     {
-        type            buoyantPressure;
-        value           uniform 1e5;
+        type            calculated;
+        value           $internalField;
     }
 }
 
diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/0/p_rgh b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/0/p_rgh
new file mode 100644
index 0000000000000000000000000000000000000000..68d0387e4898ebf414ee7f4730b2015bda0946ce
--- /dev/null
+++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/0/p_rgh
@@ -0,0 +1,50 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       volScalarField;
+    location    "0";
+    object      p_rgh;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions      [1 -1 -2 0 0 0 0];
+
+internalField   uniform 1e5;
+
+boundaryField
+{
+    frontAndBack
+    {
+        type            buoyantPressure;
+        value           uniform 1e5;
+    }
+
+    topAndBottom
+    {
+        type            buoyantPressure;
+        value           uniform 1e5;
+    }
+
+    hot
+    {
+        type            buoyantPressure;
+        value           uniform 1e5;
+    }
+
+    cold
+    {
+        type            buoyantPressure;
+        value           uniform 1e5;
+    }
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/controlDict b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/controlDict
index 8ca46687fba9ebfce54d100a24d5b415d7dd4e91..599204b449e686d742d5b57fd479705514e8930d 100644
--- a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/controlDict
+++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/controlDict
@@ -44,5 +44,25 @@ timePrecision   6;
 
 runTimeModifiable true;
 
+functions
+{
+    residualControl1
+    {
+        type            residualControl;
+        functionObjectLibs ( "libjobControl.so" );
+        outputControl   timeStep;
+        outputInterval  1;
+
+        maxResiduals
+        {
+            p_rgh   1e-2;
+            U       1e-4;
+            T       1e-3;
+
+            // possibly check turbulence fields
+            "(k|epsilon|omega)" 1e-3;
+        }
+    }
+}
 
 // ************************************************************************* //
diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/fvSolution b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/fvSolution
index 992508c411d48ac26bc83378a684c3205bb2cfb4..c453b27d81419a3accdc50084dcf14be08be2cbb 100644
--- a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/fvSolution
+++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/fvSolution
@@ -44,17 +44,16 @@ SIMPLE
 {
     momentumPredictor yes;
     nNonOrthogonalCorrectors 0;
-    p_rghRefCell    0;
-    p_rghRefValue   100000;
-    pRefValue       100000;
-    convergence     1e-04;
+    pRefCell        0;
+    pRefValue       0;
 }
 
 relaxationFactors
 {
-    p_rgh           0.9;
+    rho             1.0;
+    p_rgh           0.7;
     U               0.3;
-    h               0.7;
+    h               0.3;
     "(k|epsilon|omega)" 0.7;
 }
 
diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/0/T b/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/0/T
index 98cc191af7c9e6234287f45ebeab0cdea6ab8b62..77b58a1a00e6421c4d9c3f72a36b3d190e41ef7f 100644
--- a/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/0/T
+++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/0/T
@@ -23,411 +23,7 @@ boundaryField
     floor
     {
         type            fixedValue;
-        value           nonuniform List<scalar> 
-400
-(
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-600
-600
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-600
-600
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-)
-;
+        value           uniform 300; 
     }
     ceiling
     {
diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/0/T.org b/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/0/T.org
index 98cc191af7c9e6234287f45ebeab0cdea6ab8b62..77b58a1a00e6421c4d9c3f72a36b3d190e41ef7f 100644
--- a/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/0/T.org
+++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/0/T.org
@@ -23,411 +23,7 @@ boundaryField
     floor
     {
         type            fixedValue;
-        value           nonuniform List<scalar> 
-400
-(
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-600
-600
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-600
-600
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-300
-)
-;
+        value           uniform 300; 
     }
     ceiling
     {
diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/0/p b/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/0/p
index 9854db7add58f4a75054fe9cff734f99d9304e8c..d6ab24211f697f7dfee98b8bfc5f8359c5bed1ef 100644
--- a/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/0/p
+++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/0/p
@@ -22,20 +22,20 @@ boundaryField
 {
     floor
     {
-        type            buoyantPressure;
-        value           uniform 1e5;
+        type            calculated;
+        value           $internalField;
     }
 
     ceiling
     {
-        type            buoyantPressure;
-        value           uniform 1e5;
+        type            calculated;
+        value           $internalField;
     }
 
     fixedWalls
     {
-        type            buoyantPressure;
-        value           uniform 1e5;
+        type            calculated;
+        value           $internalField;
     }
 }
 
diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/0/p_rgh b/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/0/p_rgh
new file mode 100644
index 0000000000000000000000000000000000000000..371d93c38aace14c5187b795c88f08d8f9f36bfa
--- /dev/null
+++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/0/p_rgh
@@ -0,0 +1,42 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       volScalarField;
+    object      p_rgh;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions      [1 -1 -2 0 0 0 0];
+
+internalField   uniform 1e5;
+
+boundaryField
+{
+    floor
+    {
+        type            buoyantPressure;
+        value           uniform 1e5;
+    }
+
+    ceiling
+    {
+        type            buoyantPressure;
+        value           uniform 1e5;
+    }
+
+    fixedWalls
+    {
+        type            buoyantPressure;
+        value           uniform 1e5;
+    }
+}
+
+// ************************************************************************* //
diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/system/controlDict b/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/system/controlDict
index f9d959e2dc8b1c2493a4b0e826157c7d4d34e8df..242675a288a20edab069535d3aba9bc598a47f83 100644
--- a/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/system/controlDict
+++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/system/controlDict
@@ -45,5 +45,25 @@ timePrecision   6;
 
 runTimeModifiable true;
 
+functions
+{
+    residualControl1
+    {
+        type            residualControl;
+        functionObjectLibs ( "libjobControl.so" );
+        outputControl   timeStep;
+        outputInterval  1;
+
+        maxResiduals
+        {
+            p_rgh   1e-2;
+            U       1e-4;
+            T       1e-3;
+
+            // possibly check turbulence fields
+            "(k|epsilon|omega)" 1e-3;
+        }
+    }
+}
 
 // ************************************************************************* //
diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/system/fvSchemes b/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/system/fvSchemes
index 328bd3ed59418bf59f3a1fad1e6aebee33ef49ce..ab84aca2c4ab2ac7d880eefbb91b2ebf1b99d40a 100644
--- a/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/system/fvSchemes
+++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/system/fvSchemes
@@ -40,12 +40,12 @@ divSchemes
 laplacianSchemes
 {
     default         none;
-    laplacian(muEff,U) Gauss linear corrected;
-    laplacian((rho*(1|A(U))),p) Gauss linear corrected;
-    laplacian(alphaEff,h) Gauss linear corrected;
-    laplacian(DkEff,k) Gauss linear corrected;
-    laplacian(DepsilonEff,epsilon) Gauss linear corrected;
-    laplacian(DREff,R) Gauss linear corrected;
+    laplacian(muEff,U) Gauss linear uncorrected;
+    laplacian((rho*(1|A(U))),p_rgh) Gauss linear uncorrected;
+    laplacian(alphaEff,h) Gauss linear uncorrected;
+    laplacian(DkEff,k) Gauss linear uncorrected;
+    laplacian(DepsilonEff,epsilon) Gauss linear uncorrected;
+    laplacian(DREff,R) Gauss linear uncorrected;
 }
 
 interpolationSchemes
@@ -61,7 +61,7 @@ snGradSchemes
 fluxRequired
 {
     default         no;
-    p               ;
+    p_rgh;
 }
 
 
diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/system/fvSolution b/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/system/fvSolution
index c9a423a0631042e51b594d56419b28bb1d66bd85..aa535a28eb93c623863c7191fa7c33ccbb26fe2e 100644
--- a/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/system/fvSolution
+++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/system/fvSolution
@@ -17,12 +17,12 @@ FoamFile
 
 solvers
 {
-    p
+    p_rgh
     {
         solver          PCG;
         preconditioner  DIC;
         tolerance       1e-08;
-        relTol          0;
+        relTol          0.01;
     }
 
     "(U|h|k|epsilon|R)"
@@ -30,7 +30,7 @@ solvers
         solver          PBiCG;
         preconditioner  DILU;
         tolerance       1e-05;
-        relTol          0;
+        relTol          0.1;
     }
 }
 
@@ -38,16 +38,16 @@ SIMPLE
 {
     nNonOrthogonalCorrectors 0;
     pRefCell        0;
-    pRefValue       100000;
+    pRefValue       0;
 }
 
 relaxationFactors
 {
-    rho             1;
-    p               0.7;
+    rho             1.0;
+    p_rgh           0.7;
     U               0.2;
-    h               0.7;
-    "(k|epsilon|R)" 0.7;
+    h               0.2;
+    "(k|epsilon|R)" 0.5;
 }
 
 
diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/G b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/G
index d49a1b712b778f241fd43b9bf23c315b3d772fc3..928afaeb56586af05a00b38f3c6c33ffbec6cf1b 100644
--- a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/G
+++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/G
@@ -25,7 +25,7 @@ boundaryField
         type            MarshakRadiation;
         T               T;
         emissivity      1;
-        value           uniform 0;
+//        value           uniform 0;
     }
 
     fixedWalls
@@ -33,7 +33,7 @@ boundaryField
         type            MarshakRadiation;
         T               T;
         emissivity      1;
-        value           uniform 0;
+//        value           uniform 0;
     }
 
     ceiling
@@ -41,7 +41,7 @@ boundaryField
         type            MarshakRadiation;
         T               T;
         emissivity      1;
-        value           uniform 0;
+ //       value           uniform 0;
     }
 
     box
@@ -49,7 +49,7 @@ boundaryField
         type            MarshakRadiation;
         T               T;
         emissivity      1;
-        value           uniform 0;
+//        value           uniform 0;
     }
 }
 
diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/p b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/p
index a1da943200cf2bd68718b4eb8f1252e550968663..fb9be497bfd16e3bb979bd490191158bbc635d74 100644
--- a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/p
+++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/p
@@ -22,26 +22,26 @@ boundaryField
 {
     floor
     {
-        type            buoyantPressure;
-        value           uniform 100000;
+        type            calculated;
+        value           $internalField;
     }
 
     ceiling
     {
-        type            buoyantPressure;
-        value           uniform 100000;
+        type            calculated;
+        value           $internalField;
     }
 
     fixedWalls
     {
-        type            buoyantPressure;
-        value           uniform 100000;
+        type            calculated;
+        value           $internalField;
     }
 
     box
     {
-        type            buoyantPressure;
-        value           uniform 100000;
+        type            calculated;
+        value           $internalField;
     }
 }
 
diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/p_rgh b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/p_rgh
new file mode 100644
index 0000000000000000000000000000000000000000..87dd59413431afaeed37d495039e21fcbddaf000
--- /dev/null
+++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/p_rgh
@@ -0,0 +1,48 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       volScalarField;
+    object      p_rgh;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions      [1 -1 -2 0 0 0 0];
+
+internalField   uniform 100000;
+
+boundaryField
+{
+    floor
+    {
+        type            buoyantPressure;
+        value           uniform 100000;
+    }
+
+    ceiling
+    {
+        type            buoyantPressure;
+        value           uniform 100000;
+    }
+
+    fixedWalls
+    {
+        type            buoyantPressure;
+        value           uniform 100000;
+    }
+
+    box
+    {
+        type            buoyantPressure;
+        value           uniform 100000;
+    }
+}
+
+// ************************************************************************* //
diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/system/controlDict b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/system/controlDict
index 25a67762b362324fe7617c9716cc0fb200611ba4..80041f81dc9b7cc6e5ca7e51bc58c76f3534103e 100644
--- a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/system/controlDict
+++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/system/controlDict
@@ -45,5 +45,25 @@ timePrecision   6;
 
 runTimeModifiable true;
 
+functions
+{
+    residualControl1
+    {
+        type            residualControl;
+        functionObjectLibs ( "libjobControl.so" );
+        outputControl   timeStep;
+        outputInterval  1;
+
+        maxResiduals
+        {
+            p_rgh   1e-2;
+            U       1e-4;
+            T       1e-3;
+
+            // possibly check turbulence fields
+            "(k|epsilon|omega)" 1e-3;
+        }
+    }
+}
 
 // ************************************************************************* //
diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/system/fvSchemes b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/system/fvSchemes
index 8d30fa0a3790c1431883202074d0c266a8b74b36..2dfb6798b87c78561c73b8f93271895718f7403b 100644
--- a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/system/fvSchemes
+++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/system/fvSchemes
@@ -41,7 +41,7 @@ laplacianSchemes
 {
     default         none;
     laplacian(muEff,U) Gauss linear corrected;
-    laplacian((rho*(1|A(U))),p) Gauss linear corrected;
+    laplacian((rho*(1|A(U))),p_rgh) Gauss linear corrected;
     laplacian(alphaEff,h) Gauss linear corrected;
     laplacian(DkEff,k) Gauss linear corrected;
     laplacian(DepsilonEff,epsilon) Gauss linear corrected;
@@ -62,7 +62,7 @@ snGradSchemes
 fluxRequired
 {
     default         no;
-    p;
+    p_rgh;
 }
 
 
diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/system/fvSolution b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/system/fvSolution
index c490be6e8f4f101d157ad2dd9dd71219ef9137b0..fa8d3d533976867e6584d6a9e8df8f0b12d8c776 100644
--- a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/system/fvSolution
+++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/system/fvSolution
@@ -17,7 +17,7 @@ FoamFile
 
 solvers
 {
-    p
+    p_rgh
     {
         solver          PCG;
         preconditioner  DIC;
@@ -35,7 +35,7 @@ solvers
 
     G
     {
-        $p;
+        $p_rgh;
         tolerance       1e-05;
         relTol          0.1;
     }
@@ -50,11 +50,11 @@ SIMPLE
 
 relaxationFactors
 {
-    rho             1;
-    p               0.3;
-    U               0.7;
-    h               0.7;
-    "(k|epsilon)"   0.7;
+    rho             1.0;
+    p_rgh           0.7;
+    U               0.2;
+    h               0.2;
+    "(k|epsilon|R)" 0.5;
     G               0.7;
 }
 
diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/IDefault b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/IDefault
index 3bee6a9b107a580ac654fc8574bd487d17655a9a..94f365296e9262ca775182d6bba125ae7bd39c16 100644
--- a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/IDefault
+++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/IDefault
@@ -24,7 +24,7 @@ boundaryField
     {
         type            greyDiffusiveRadiation;
         T               T;
-        emissivity      0.5;
+        emissivity      1.0;
         value           uniform 0;
     }
 }
diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/p b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/p
index a1da943200cf2bd68718b4eb8f1252e550968663..48fe8a009fd10c7b86b76f7de6160ccb31d5045c 100644
--- a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/p
+++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/p
@@ -22,25 +22,25 @@ boundaryField
 {
     floor
     {
-        type            buoyantPressure;
+        type            calculated;
         value           uniform 100000;
     }
 
     ceiling
     {
-        type            buoyantPressure;
+        type            calculated;
         value           uniform 100000;
     }
 
     fixedWalls
     {
-        type            buoyantPressure;
+        type            calculated;
         value           uniform 100000;
     }
 
     box
     {
-        type            buoyantPressure;
+        type            calculated;
         value           uniform 100000;
     }
 }
diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/p_rgh b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/p_rgh
new file mode 100644
index 0000000000000000000000000000000000000000..87dd59413431afaeed37d495039e21fcbddaf000
--- /dev/null
+++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/p_rgh
@@ -0,0 +1,48 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       volScalarField;
+    object      p_rgh;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions      [1 -1 -2 0 0 0 0];
+
+internalField   uniform 100000;
+
+boundaryField
+{
+    floor
+    {
+        type            buoyantPressure;
+        value           uniform 100000;
+    }
+
+    ceiling
+    {
+        type            buoyantPressure;
+        value           uniform 100000;
+    }
+
+    fixedWalls
+    {
+        type            buoyantPressure;
+        value           uniform 100000;
+    }
+
+    box
+    {
+        type            buoyantPressure;
+        value           uniform 100000;
+    }
+}
+
+// ************************************************************************* //
diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/controlDict b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/controlDict
index 1cca62ded7f545918bfa54e88eb08c241fbeaba5..64496570c2a733a336e0b21789310937b7b0e857 100644
--- a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/controlDict
+++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/controlDict
@@ -45,5 +45,25 @@ timePrecision   6;
 
 runTimeModifiable true;
 
+functions
+{
+    residualControl1
+    {
+        type            residualControl;
+        functionObjectLibs ( "libjobControl.so" );
+        outputControl   timeStep;
+        outputInterval  1;
+
+        maxResiduals
+        {
+            p_rgh   1e-2;
+            U       1e-4;
+            T       1e-3;
+
+            // possibly check turbulence fields
+            "(k|epsilon|omega)" 1e-3;
+        }
+    }
+}
 
 // ************************************************************************* //
diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSchemes b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSchemes
index 58fe62417e93f0e2cc0fa7c802c471f3aa200e66..c9900e695fcb668a7fd7f64cc89c1d7c3080aedf 100644
--- a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSchemes
+++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSchemes
@@ -42,7 +42,7 @@ laplacianSchemes
 {
     default         none;
     laplacian(muEff,U) Gauss linear corrected;
-    laplacian((rho*(1|A(U))),p) Gauss linear corrected;
+    laplacian((rho*(1|A(U))),p_rgh) Gauss linear corrected;
     laplacian(alphaEff,h) Gauss linear corrected;
     laplacian(DkEff,k) Gauss linear corrected;
     laplacian(DepsilonEff,epsilon) Gauss linear corrected;
@@ -63,7 +63,7 @@ snGradSchemes
 fluxRequired
 {
     default         no;
-    p;
+    p_rgh;
 }
 
 
diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSolution b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSolution
index c219a76e03fea5e0e6ed24f300a4da969c3c71fc..daa2528426bab6d94d3859b6323754407f9fb261 100644
--- a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSolution
+++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSolution
@@ -17,7 +17,7 @@ FoamFile
 
 solvers
 {
-    p
+    p_rgh
     {
         solver          GAMG;
         tolerance       1e-06;
@@ -47,11 +47,12 @@ SIMPLE
 
 relaxationFactors
 {
-    rho             1;
-    p               0.3;
+    rho             1.0;
+    p_rgh           0.3;
     U               0.7;
     h               0.7;
-    "(k|epsilon)"   0.7;
+    k               0.7;
+    epsilon         0.7;
     "ILambda.*"     0.7;
 }
 
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/0/epsilon b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/0/epsilon
index 6034a1d7bfc3f328fece0218588466e1deb72932..f4e27ad95fb84fff1121e59c121f6d2c844d1b43 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/0/epsilon
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/0/epsilon
@@ -10,7 +10,6 @@ FoamFile
     version     2.0;
     format      ascii;
     class       volScalarField;
-    location    "0.001";
     object      epsilon;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/0/k b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/0/k
index eb1abac09b21d07f72329ef894699f330741de42..b2509f967076c366a4ab4e410f070916983536e4 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/0/k
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/0/k
@@ -10,7 +10,6 @@ FoamFile
     version     2.0;
     format      ascii;
     class       volScalarField;
-    location    "0.001";
     object      k;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/0/p.org b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/0/p_rgh
similarity index 89%
rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/0/p.org
rename to tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/0/p_rgh
index 1e85650d62436c21e0d288f6fffc1513bce90737..638c8c7d7cd472cf343b4fc5091d9a8f1bf038ae 100644
--- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/0/p.org
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/0/p_rgh
@@ -10,19 +10,19 @@ FoamFile
     version     2.0;
     format      ascii;
     class       volScalarField;
-    object      p.org;
+    object      p_rgh;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 dimensions      [1 -1 -2 0 0 0 0];
 
-internalField   uniform 0;
+internalField   uniform 1e5;
 
 boundaryField
 {
-    walls
+    ".*"
     {
-        type            zeroGradient;
+        type            calculated;
     }
 }
 
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/Allrun b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/Allrun
index da52a21b6f4cecc413cd9786ec72f11b6798d65c..e4c900d174421e78db004ae7013197172dcdb4d9 100755
--- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/Allrun
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/Allrun
@@ -23,7 +23,7 @@ done
 
 for i in bottomAir topAir heater leftSolid rightSolid
 do
-   changeDictionary -region $i >& log.changeDictionary.$i
+   changeDictionary -region $i > log.changeDictionary.$i 2>&1
 done
 
 
@@ -33,7 +33,7 @@ done
 # Decompose
 for i in bottomAir topAir heater leftSolid rightSolid
 do
-   decomposePar -region $i >& log.decomposePar.$i
+   decomposePar -region $i > log.decomposePar.$i 2>&1
 done
 
 # Run
@@ -42,7 +42,7 @@ runParallel chtMultiRegionFoam 4
 # Reconstruct
 for i in bottomAir topAir heater leftSolid rightSolid
 do
-   reconstructPar -region $i >& log.reconstructPar.$i
+   reconstructPar -region $i > log.reconstructPar.$i2 >&1
 done
 
 
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/changeDictionaryDict
index c36ea6b8039bbf390c437d1875aa6eebe84cf63f..6faab27ee56705411dc2abcf18838952a6f25fa1 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/changeDictionaryDict
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/changeDictionaryDict
@@ -92,16 +92,30 @@ dictionaryReplacement
         }
     }
 
-    p
+    p_rgh
     {
-        internalField   uniform 100000;
+        internalField   uniform 1e5;
 
         boundaryField
         {
             ".*"
             {
                 type            buoyantPressure;
-                value           1e5;
+                value           uniform 1e5;
+            }
+        }
+    }
+
+    p
+    {
+        internalField   uniform 1e5;
+
+        boundaryField
+        {
+            ".*"
+            {
+                type            calculated;
+                value           uniform 1e5;
             }
         }
     }
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/fvSchemes b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/fvSchemes
index 90364fcbf2309c83fb6dbf1002215f43b97d23d5..7d3e57864ac0660fb7bd646e2850a67eafb1d49d 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/fvSchemes
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/fvSchemes
@@ -17,13 +17,11 @@ FoamFile
 ddtSchemes
 {
     default Euler;
-    //default CoEuler phi rho 0.1;
 }
 
 gradSchemes
 {
     default         Gauss linear;
-//    grad(U)         cellLimited Gauss linear 1;
 }
 
 divSchemes
@@ -43,7 +41,7 @@ laplacianSchemes
 {
     default         none;
     laplacian(muEff,U) Gauss linear limited 0.333;
-    laplacian((rho*(1|A(U))),p) Gauss linear limited 0.333;
+    laplacian((rho*(1|A(U))),p_rgh) Gauss linear limited 0.333;
     laplacian(alphaEff,h) Gauss linear limited 0.333;
     laplacian(DkEff,k) Gauss linear limited 0.333;
     laplacian(DepsilonEff,epsilon) Gauss linear limited 0.333;
@@ -63,7 +61,7 @@ snGradSchemes
 fluxRequired
 {
     default         no;
-    p;
+    p_rgh;
 }
 
 // ************************************************************************* //
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/fvSolution b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/fvSolution
index 16665b05a12a2e01e1211ecd4534473e4d42960b..1e968f0aea32e538282ed8a628684928be7acdfc 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/fvSolution
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/fvSolution
@@ -24,7 +24,7 @@ solvers
         relTol          0;
     }
 
-    p
+    p_rgh
     {
         solver           GAMG;
         tolerance        1e-8;
@@ -38,31 +38,26 @@ solvers
         mergeLevels      1;
     }
 
-    pFinal
+    p_rghFinal
     {
-        $p;
+        $p_rgh;
         tolerance        1e-8;
         relTol           0;
     }
 
-    U
+    "(U|h|k|epsilon|R)"
     {
         solver           PBiCG;
         preconditioner   DILU;
         tolerance        1e-08;
-        relTol           0;
-    }
-
-    h
-    {
-        $U;
-        tolerance        1e-08;
         relTol           0.1;
     }
 
-    "(hFinal|k|epsilon|R)"
+    "(U|h|k|epsilon|R)Final"
     {
         $U;
+        tolerance        1e-08;
+        relTol           0;
     }
 }
 
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/controlDict b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/controlDict
index ec9f3455bd051faa1da52f6088d977381ec873b1..590a47c55a6124c258398c7e6ce82f659aed0aea 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/controlDict
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/controlDict
@@ -35,9 +35,9 @@ writeInterval   50;
 
 purgeWrite      0;
 
-writeFormat     ascii;
+writeFormat     binary;
 
-writePrecision  7;
+writePrecision  8;
 
 writeCompression off;
 
@@ -45,11 +45,12 @@ timeFormat      general;
 
 timePrecision   6;
 
-runTimeModifiable true;
+runTimeModifiable yes;
 
 maxCo           0.3;
 
-maxDi          10.0;
+// Maximum diffusion number
+maxDi           10.0;
 
 adjustTimeStep  yes;
 
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/heater/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/heater/decomposeParDict
index e53a523c9d58e8314f6eeea8b310d284b54f6cd0..8f6ced4ac38fc5f058b8c4370ed4002c036d61f6 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/heater/decomposeParDict
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/heater/decomposeParDict
@@ -76,7 +76,7 @@ manualCoeffs
 //// Is the case distributed
 //distributed     yes;
 //// Per slave (so nProcs-1 entries) the directory above the case.
-//roots           
+//roots
 //(
 //    "/tmp"
 //    "/tmp"
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/heater/fvSolution b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/heater/fvSolution
index b773399f729bcb6ee8fc6b7c458c3d82e9ea2a8f..7c00e466f4b508dc216b21874718108befe65e16 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/heater/fvSolution
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/heater/fvSolution
@@ -21,6 +21,12 @@ solvers
         solver           PCG;
         preconditioner   DIC;
         tolerance        1E-06;
+        relTol           0.1;
+    }
+    TFinal
+    {
+        $T;
+        tolerance        1E-06;
         relTol           0;
     }
 }
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/leftSolid/fvSolution b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/leftSolid/fvSolution
index b773399f729bcb6ee8fc6b7c458c3d82e9ea2a8f..7c00e466f4b508dc216b21874718108befe65e16 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/leftSolid/fvSolution
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/leftSolid/fvSolution
@@ -21,6 +21,12 @@ solvers
         solver           PCG;
         preconditioner   DIC;
         tolerance        1E-06;
+        relTol           0.1;
+    }
+    TFinal
+    {
+        $T;
+        tolerance        1E-06;
         relTol           0;
     }
 }
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/rightSolid/fvSolution b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/rightSolid/fvSolution
index b773399f729bcb6ee8fc6b7c458c3d82e9ea2a8f..7c00e466f4b508dc216b21874718108befe65e16 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/rightSolid/fvSolution
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/rightSolid/fvSolution
@@ -21,6 +21,12 @@ solvers
         solver           PCG;
         preconditioner   DIC;
         tolerance        1E-06;
+        relTol           0.1;
+    }
+    TFinal
+    {
+        $T;
+        tolerance        1E-06;
         relTol           0;
     }
 }
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/topAir/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/topAir/changeDictionaryDict
index 71114003ec106a4a9af29c5abfa86f94cf185c56..ff4ba100119b83b40959e27389c224519da39a2e 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/topAir/changeDictionaryDict
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/topAir/changeDictionaryDict
@@ -18,7 +18,7 @@ dictionaryReplacement
 {
     U
     {
-        internalField   uniform (0.01 0 0);
+        internalField   uniform (0.1 0 0);
 
         boundaryField
         {
@@ -30,13 +30,13 @@ dictionaryReplacement
             minX
             {
                 type            fixedValue;
-                value           uniform ( 0.01 0 0 );
+                value           uniform ( 0.1 0 0 );
             }
             maxX
             {
                 type            inletOutlet;
                 inletValue      uniform ( 0 0 0 );
-                value           uniform ( 0 0 0 );
+                value           uniform ( 0.1 0 0 );
             }
         }
     }
@@ -127,25 +127,42 @@ dictionaryReplacement
         }
     }
 
-    p
+    p_rgh
     {
-        internalField   uniform 100000;
+        internalField   uniform 1e5;
 
         boundaryField
         {
             ".*"
             {
                 type            buoyantPressure;
-                value           1e5;
+                value           uniform 1e5;
+            }
+
+            maxX
+            {
+                type            fixedValue;
+                value           uniform 1e5;
+            }
+        }
+    }
+
+    p
+    {
+        internalField   uniform 1e5;
+
+        boundaryField
+        {
+            ".*"
+            {
+                type            calculated;
+                value           uniform 1e5;
             }
 
             maxX
             {
-                type            waveTransmissive;
-                gamma           1.4;
-                fieldInf        100000;
-                lInf            0.4;
-                value           uniform 100000;
+                type            calculated;
+                value           uniform 1e5;
             }
         }
     }
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/topAir/fvSchemes b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/topAir/fvSchemes
index 90364fcbf2309c83fb6dbf1002215f43b97d23d5..7d3e57864ac0660fb7bd646e2850a67eafb1d49d 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/topAir/fvSchemes
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/topAir/fvSchemes
@@ -17,13 +17,11 @@ FoamFile
 ddtSchemes
 {
     default Euler;
-    //default CoEuler phi rho 0.1;
 }
 
 gradSchemes
 {
     default         Gauss linear;
-//    grad(U)         cellLimited Gauss linear 1;
 }
 
 divSchemes
@@ -43,7 +41,7 @@ laplacianSchemes
 {
     default         none;
     laplacian(muEff,U) Gauss linear limited 0.333;
-    laplacian((rho*(1|A(U))),p) Gauss linear limited 0.333;
+    laplacian((rho*(1|A(U))),p_rgh) Gauss linear limited 0.333;
     laplacian(alphaEff,h) Gauss linear limited 0.333;
     laplacian(DkEff,k) Gauss linear limited 0.333;
     laplacian(DepsilonEff,epsilon) Gauss linear limited 0.333;
@@ -63,7 +61,7 @@ snGradSchemes
 fluxRequired
 {
     default         no;
-    p;
+    p_rgh;
 }
 
 // ************************************************************************* //
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/topAir/fvSolution b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/topAir/fvSolution
index 28c1a63b7aa3986ac043fd9eea7b5975e68d7c5d..d2d44df4fc5f85c3a91d97b0f5402c4649e7102f 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/topAir/fvSolution
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/topAir/fvSolution
@@ -20,14 +20,14 @@ solvers
     {
         solver          PCG
         preconditioner  DIC;
-        tolerance       1e-8;
+        tolerance       1e-7;
         relTol          0;
     }
 
-    p
+    p_rgh
     {
         solver           GAMG;
-        tolerance        1e-8;
+        tolerance        1e-7;
         relTol           0.01;
 
         smoother         GaussSeidel;
@@ -36,47 +36,43 @@ solvers
         nCellsInCoarsestLevel 10;
         agglomerator     faceAreaPair;
         mergeLevels      1;
+
+        maxIter          100;
     }
 
-    pFinal
+    p_rghFinal
     {
-        $p;
-        tolerance        1e-8;
+        $p_rgh;
+        tolerance        1e-7;
         relTol           0;
     }
 
-    U
+    "(U|h|k|epsilon|R)"
     {
         solver           PBiCG;
         preconditioner   DILU;
-        tolerance        1e-08;
-        relTol           0;
-    }
-
-    h
-    {
-        $U;
-        tolerance        1e-08;
+        tolerance        1e-7;
         relTol           0.1;
     }
 
-    "(hFinal|k|epsilon|R)"
+    "(U|h|k|epsilon|R)Final"
     {
         $U;
+        tolerance        1e-07;
+        relTol           0;
     }
 }
 
 PISO
 {
-    momentumPredictor   off;
+    momentumPredictor    off;
     nOuterCorrectors     1;
-    nCorrectors     2;
+    nCorrectors          2;
     nNonOrthogonalCorrectors 1;
-    pRefPoint       (-0.081 -0.0257 8.01);
-    pRefValue       1e5;
+    pRefPoint            (-0.081 -0.0257 8.01);
+    pRefValue            1e5;
 }
 
-
 PIMPLE
 {
     momentumPredictor   on;
@@ -84,11 +80,10 @@ PIMPLE
     nNonOrthogonalCorrectors 0;
 }
 
-
 relaxationFactors
 {
-//    h               0.9;
-//    U               0.9;
+    h               1;
+    U               1;
 }
 
 // ************************************************************************* //
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/0/alphat b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/0/alphat
index 5afdd3b3cc00a9e5b503e967ee5c0685f489464b..5dba622286ec20e5ed7cf843857f7587026841fc 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/0/alphat
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/0/alphat
@@ -10,7 +10,6 @@ FoamFile
     version     2.0;
     format      ascii;
     class       volScalarField;
-    location    "0.001";
     object      alphat;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/0/epsilon b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/0/epsilon
index 6034a1d7bfc3f328fece0218588466e1deb72932..f4e27ad95fb84fff1121e59c121f6d2c844d1b43 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/0/epsilon
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/0/epsilon
@@ -10,7 +10,6 @@ FoamFile
     version     2.0;
     format      ascii;
     class       volScalarField;
-    location    "0.001";
     object      epsilon;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/0/k b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/0/k
index eb1abac09b21d07f72329ef894699f330741de42..b2509f967076c366a4ab4e410f070916983536e4 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/0/k
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/0/k
@@ -10,7 +10,6 @@ FoamFile
     version     2.0;
     format      ascii;
     class       volScalarField;
-    location    "0.001";
     object      k;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/0/p_rgh b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/0/p_rgh
new file mode 100644
index 0000000000000000000000000000000000000000..638c8c7d7cd472cf343b4fc5091d9a8f1bf038ae
--- /dev/null
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/0/p_rgh
@@ -0,0 +1,29 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       volScalarField;
+    object      p_rgh;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions      [1 -1 -2 0 0 0 0];
+
+internalField   uniform 1e5;
+
+boundaryField
+{
+    ".*"
+    {
+        type            calculated;
+    }
+}
+
+// ************************************************************************* //
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/Allrun b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/Allrun
index 1bb6bd8b53aaedddaeb174778b8503936e45fdb4..2031e121e39e789d633e865a41c194feb8cccc64 100755
--- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/Allrun
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/Allrun
@@ -25,7 +25,7 @@ done
 
 for i in bottomAir topAir heater leftSolid rightSolid
 do
-   changeDictionary -region $i >& log.changeDictionary.$i
+   changeDictionary -region $i > log.changeDictionary.$i 2>&1
 done
 
 
@@ -36,7 +36,7 @@ runApplication chtMultiRegionFoam
 ## Decompose
 #for i in bottomAir topAir heater leftSolid rightSolid
 #do
-#   decomposePar -region $i >& log.decomposePar.$i
+#   decomposePar -region $i > log.decomposePar.$i 2>&1
 #done
 #
 ## Run
@@ -45,7 +45,7 @@ runApplication chtMultiRegionFoam
 ## Reconstruct
 #for i in bottomAir topAir heater leftSolid rightSolid
 #do
-#   reconstructPar -region $i >& log.reconstructPar.$i
+#   reconstructPar -region $i > log.reconstructPar.$i 2>&1
 #done
 
 
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/bottomAir/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/bottomAir/changeDictionaryDict
index 1e2a7dd206395a389f4621e82d7cd22813dbbaea..fc51ab1ad718189e9d837a7d71fd329a12f39a47 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/bottomAir/changeDictionaryDict
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/bottomAir/changeDictionaryDict
@@ -94,16 +94,30 @@ dictionaryReplacement
         }
     }
 
-    p
+    p_rgh
     {
-        internalField   uniform 100000;
+        internalField   uniform 1e5;
 
         boundaryField
         {
             ".*"
             {
                 type            buoyantPressure;
-                value           1e5;
+                value           uniform 1e5;
+            }
+        }
+    }
+
+    p
+    {
+        internalField   uniform 1e5;
+
+        boundaryField
+        {
+            ".*"
+            {
+                type            calculated;
+                value           uniform 1e5;
             }
         }
     }
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/bottomAir/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/bottomAir/decomposeParDict
index e53a523c9d58e8314f6eeea8b310d284b54f6cd0..8f6ced4ac38fc5f058b8c4370ed4002c036d61f6 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/bottomAir/decomposeParDict
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/bottomAir/decomposeParDict
@@ -76,7 +76,7 @@ manualCoeffs
 //// Is the case distributed
 //distributed     yes;
 //// Per slave (so nProcs-1 entries) the directory above the case.
-//roots           
+//roots
 //(
 //    "/tmp"
 //    "/tmp"
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/bottomAir/fvSchemes b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/bottomAir/fvSchemes
index 90364fcbf2309c83fb6dbf1002215f43b97d23d5..7d3e57864ac0660fb7bd646e2850a67eafb1d49d 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/bottomAir/fvSchemes
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/bottomAir/fvSchemes
@@ -17,13 +17,11 @@ FoamFile
 ddtSchemes
 {
     default Euler;
-    //default CoEuler phi rho 0.1;
 }
 
 gradSchemes
 {
     default         Gauss linear;
-//    grad(U)         cellLimited Gauss linear 1;
 }
 
 divSchemes
@@ -43,7 +41,7 @@ laplacianSchemes
 {
     default         none;
     laplacian(muEff,U) Gauss linear limited 0.333;
-    laplacian((rho*(1|A(U))),p) Gauss linear limited 0.333;
+    laplacian((rho*(1|A(U))),p_rgh) Gauss linear limited 0.333;
     laplacian(alphaEff,h) Gauss linear limited 0.333;
     laplacian(DkEff,k) Gauss linear limited 0.333;
     laplacian(DepsilonEff,epsilon) Gauss linear limited 0.333;
@@ -63,7 +61,7 @@ snGradSchemes
 fluxRequired
 {
     default         no;
-    p;
+    p_rgh;
 }
 
 // ************************************************************************* //
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/bottomAir/fvSolution b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/bottomAir/fvSolution
index ad1f5492fb46f3751c4eaef9ee2665b31fef1e0f..ed5885da9a3aeebf717fead8cd15050bb82fdd23 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/bottomAir/fvSolution
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/bottomAir/fvSolution
@@ -20,14 +20,14 @@ solvers
     {
         solver          PCG
         preconditioner  DIC;
-        tolerance       1e-8;
+        tolerance       1e-7;
         relTol          0;
     }
 
-    p
+    p_rgh
     {
         solver           GAMG;
-        tolerance        1e-8;
+        tolerance        1e-7;
         relTol           0.01;
 
         smoother         GaussSeidel;
@@ -38,46 +38,39 @@ solvers
         mergeLevels      1;
     }
 
-    pFinal
+    p_rghFinal
     {
-        $p;
-        tolerance        1e-8;
+        $p_rgh;
+        tolerance        1e-7;
         relTol           0;
     }
 
-    U
+    "(U|h|k|epsilon|R)"
     {
         solver           PBiCG;
         preconditioner   DILU;
-        tolerance        1e-08;
-        relTol           0;
-    }
-
-    h
-    {
-        $U;
-        tolerance        1e-08;
+        tolerance        1e-7;
         relTol           0.1;
     }
 
-
-    "(hFinal|k|epsilon|R)"
+    "(U|h|k|epsilon|R)Final"
     {
         $U;
+        tolerance        1e-07;
+        relTol           0;
     }
 }
 
 PISO
 {
-    momentumPredictor   off;
+    momentumPredictor    off;
     nOuterCorrectors     1;
-    nCorrectors     2;
+    nCorrectors          2;
     nNonOrthogonalCorrectors 1;
-    pRefPoint       (-0.081 -0.0257 8.01);
-    pRefValue       1e5;
+    pRefPoint            (-0.081 -0.0257 8.01);
+    pRefValue            1e5;
 }
 
-
 PIMPLE
 {
     momentumPredictor   on;
@@ -85,11 +78,10 @@ PIMPLE
     nNonOrthogonalCorrectors 0;
 }
 
-
 relaxationFactors
 {
-//    h               0.9;
-//    U               0.9;
+    h               1;
+    U               1;
 }
 
 // ************************************************************************* //
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/heater/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/heater/decomposeParDict
index e53a523c9d58e8314f6eeea8b310d284b54f6cd0..8f6ced4ac38fc5f058b8c4370ed4002c036d61f6 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/heater/decomposeParDict
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/heater/decomposeParDict
@@ -76,7 +76,7 @@ manualCoeffs
 //// Is the case distributed
 //distributed     yes;
 //// Per slave (so nProcs-1 entries) the directory above the case.
-//roots           
+//roots
 //(
 //    "/tmp"
 //    "/tmp"
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/heater/fvSolution b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/heater/fvSolution
index b773399f729bcb6ee8fc6b7c458c3d82e9ea2a8f..7c00e466f4b508dc216b21874718108befe65e16 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/heater/fvSolution
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/heater/fvSolution
@@ -21,6 +21,12 @@ solvers
         solver           PCG;
         preconditioner   DIC;
         tolerance        1E-06;
+        relTol           0.1;
+    }
+    TFinal
+    {
+        $T;
+        tolerance        1E-06;
         relTol           0;
     }
 }
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/leftSolid/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/leftSolid/decomposeParDict
index e53a523c9d58e8314f6eeea8b310d284b54f6cd0..8f6ced4ac38fc5f058b8c4370ed4002c036d61f6 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/leftSolid/decomposeParDict
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/leftSolid/decomposeParDict
@@ -76,7 +76,7 @@ manualCoeffs
 //// Is the case distributed
 //distributed     yes;
 //// Per slave (so nProcs-1 entries) the directory above the case.
-//roots           
+//roots
 //(
 //    "/tmp"
 //    "/tmp"
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/leftSolid/fvSolution b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/leftSolid/fvSolution
index b773399f729bcb6ee8fc6b7c458c3d82e9ea2a8f..18b2ebb7ebf2761aad98a3b88bb550724bbd8a1e 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/leftSolid/fvSolution
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/leftSolid/fvSolution
@@ -21,6 +21,13 @@ solvers
         solver           PCG;
         preconditioner   DIC;
         tolerance        1E-06;
+        relTol           0.1;
+    }
+
+    TFinal
+    {
+        $T;
+        tolerance        1E-06;
         relTol           0;
     }
 }
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/rightSolid/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/rightSolid/decomposeParDict
index e53a523c9d58e8314f6eeea8b310d284b54f6cd0..8f6ced4ac38fc5f058b8c4370ed4002c036d61f6 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/rightSolid/decomposeParDict
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/rightSolid/decomposeParDict
@@ -76,7 +76,7 @@ manualCoeffs
 //// Is the case distributed
 //distributed     yes;
 //// Per slave (so nProcs-1 entries) the directory above the case.
-//roots           
+//roots
 //(
 //    "/tmp"
 //    "/tmp"
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/rightSolid/fvSolution b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/rightSolid/fvSolution
index b773399f729bcb6ee8fc6b7c458c3d82e9ea2a8f..18b2ebb7ebf2761aad98a3b88bb550724bbd8a1e 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/rightSolid/fvSolution
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/rightSolid/fvSolution
@@ -21,6 +21,13 @@ solvers
         solver           PCG;
         preconditioner   DIC;
         tolerance        1E-06;
+        relTol           0.1;
+    }
+
+    TFinal
+    {
+        $T;
+        tolerance        1E-06;
         relTol           0;
     }
 }
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/topAir/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/topAir/changeDictionaryDict
index 71114003ec106a4a9af29c5abfa86f94cf185c56..ff4ba100119b83b40959e27389c224519da39a2e 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/topAir/changeDictionaryDict
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/topAir/changeDictionaryDict
@@ -18,7 +18,7 @@ dictionaryReplacement
 {
     U
     {
-        internalField   uniform (0.01 0 0);
+        internalField   uniform (0.1 0 0);
 
         boundaryField
         {
@@ -30,13 +30,13 @@ dictionaryReplacement
             minX
             {
                 type            fixedValue;
-                value           uniform ( 0.01 0 0 );
+                value           uniform ( 0.1 0 0 );
             }
             maxX
             {
                 type            inletOutlet;
                 inletValue      uniform ( 0 0 0 );
-                value           uniform ( 0 0 0 );
+                value           uniform ( 0.1 0 0 );
             }
         }
     }
@@ -127,25 +127,42 @@ dictionaryReplacement
         }
     }
 
-    p
+    p_rgh
     {
-        internalField   uniform 100000;
+        internalField   uniform 1e5;
 
         boundaryField
         {
             ".*"
             {
                 type            buoyantPressure;
-                value           1e5;
+                value           uniform 1e5;
+            }
+
+            maxX
+            {
+                type            fixedValue;
+                value           uniform 1e5;
+            }
+        }
+    }
+
+    p
+    {
+        internalField   uniform 1e5;
+
+        boundaryField
+        {
+            ".*"
+            {
+                type            calculated;
+                value           uniform 1e5;
             }
 
             maxX
             {
-                type            waveTransmissive;
-                gamma           1.4;
-                fieldInf        100000;
-                lInf            0.4;
-                value           uniform 100000;
+                type            calculated;
+                value           uniform 1e5;
             }
         }
     }
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/topAir/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/topAir/decomposeParDict
index e53a523c9d58e8314f6eeea8b310d284b54f6cd0..8f6ced4ac38fc5f058b8c4370ed4002c036d61f6 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/topAir/decomposeParDict
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/topAir/decomposeParDict
@@ -76,7 +76,7 @@ manualCoeffs
 //// Is the case distributed
 //distributed     yes;
 //// Per slave (so nProcs-1 entries) the directory above the case.
-//roots           
+//roots
 //(
 //    "/tmp"
 //    "/tmp"
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/topAir/fvSchemes b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/topAir/fvSchemes
index 90364fcbf2309c83fb6dbf1002215f43b97d23d5..7d3e57864ac0660fb7bd646e2850a67eafb1d49d 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/topAir/fvSchemes
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/topAir/fvSchemes
@@ -17,13 +17,11 @@ FoamFile
 ddtSchemes
 {
     default Euler;
-    //default CoEuler phi rho 0.1;
 }
 
 gradSchemes
 {
     default         Gauss linear;
-//    grad(U)         cellLimited Gauss linear 1;
 }
 
 divSchemes
@@ -43,7 +41,7 @@ laplacianSchemes
 {
     default         none;
     laplacian(muEff,U) Gauss linear limited 0.333;
-    laplacian((rho*(1|A(U))),p) Gauss linear limited 0.333;
+    laplacian((rho*(1|A(U))),p_rgh) Gauss linear limited 0.333;
     laplacian(alphaEff,h) Gauss linear limited 0.333;
     laplacian(DkEff,k) Gauss linear limited 0.333;
     laplacian(DepsilonEff,epsilon) Gauss linear limited 0.333;
@@ -63,7 +61,7 @@ snGradSchemes
 fluxRequired
 {
     default         no;
-    p;
+    p_rgh;
 }
 
 // ************************************************************************* //
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/topAir/fvSolution b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/topAir/fvSolution
index 28c1a63b7aa3986ac043fd9eea7b5975e68d7c5d..d2d44df4fc5f85c3a91d97b0f5402c4649e7102f 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/topAir/fvSolution
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/topAir/fvSolution
@@ -20,14 +20,14 @@ solvers
     {
         solver          PCG
         preconditioner  DIC;
-        tolerance       1e-8;
+        tolerance       1e-7;
         relTol          0;
     }
 
-    p
+    p_rgh
     {
         solver           GAMG;
-        tolerance        1e-8;
+        tolerance        1e-7;
         relTol           0.01;
 
         smoother         GaussSeidel;
@@ -36,47 +36,43 @@ solvers
         nCellsInCoarsestLevel 10;
         agglomerator     faceAreaPair;
         mergeLevels      1;
+
+        maxIter          100;
     }
 
-    pFinal
+    p_rghFinal
     {
-        $p;
-        tolerance        1e-8;
+        $p_rgh;
+        tolerance        1e-7;
         relTol           0;
     }
 
-    U
+    "(U|h|k|epsilon|R)"
     {
         solver           PBiCG;
         preconditioner   DILU;
-        tolerance        1e-08;
-        relTol           0;
-    }
-
-    h
-    {
-        $U;
-        tolerance        1e-08;
+        tolerance        1e-7;
         relTol           0.1;
     }
 
-    "(hFinal|k|epsilon|R)"
+    "(U|h|k|epsilon|R)Final"
     {
         $U;
+        tolerance        1e-07;
+        relTol           0;
     }
 }
 
 PISO
 {
-    momentumPredictor   off;
+    momentumPredictor    off;
     nOuterCorrectors     1;
-    nCorrectors     2;
+    nCorrectors          2;
     nNonOrthogonalCorrectors 1;
-    pRefPoint       (-0.081 -0.0257 8.01);
-    pRefValue       1e5;
+    pRefPoint            (-0.081 -0.0257 8.01);
+    pRefValue            1e5;
 }
 
-
 PIMPLE
 {
     momentumPredictor   on;
@@ -84,11 +80,10 @@ PIMPLE
     nNonOrthogonalCorrectors 0;
 }
 
-
 relaxationFactors
 {
-//    h               0.9;
-//    U               0.9;
+    h               1;
+    U               1;
 }
 
 // ************************************************************************* //
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/U b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/U
index 62058ec7acf331fb2b61fa165da191f4776f7eee..8e47fbcddf8a6d77315c7deb728c6eb1215eb68e 100644
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/U
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/U
@@ -16,7 +16,7 @@ FoamFile
 
 dimensions      [0 1 -1 0 0 0 0];
 
-internalField   uniform (0.01 0 0);
+internalField   uniform (0.1 0 0);
 
 boundaryField
 {
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/epsilon b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/epsilon
index 6034a1d7bfc3f328fece0218588466e1deb72932..f4e27ad95fb84fff1121e59c121f6d2c844d1b43 100644
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/epsilon
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/epsilon
@@ -10,7 +10,6 @@ FoamFile
     version     2.0;
     format      ascii;
     class       volScalarField;
-    location    "0.001";
     object      epsilon;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/k b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/k
index eb1abac09b21d07f72329ef894699f330741de42..b2509f967076c366a4ab4e410f070916983536e4 100644
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/k
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/k
@@ -10,7 +10,6 @@ FoamFile
     version     2.0;
     format      ascii;
     class       volScalarField;
-    location    "0.001";
     object      k;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/p_rgh b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/p_rgh
new file mode 100644
index 0000000000000000000000000000000000000000..638c8c7d7cd472cf343b4fc5091d9a8f1bf038ae
--- /dev/null
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/p_rgh
@@ -0,0 +1,29 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       volScalarField;
+    object      p_rgh;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions      [1 -1 -2 0 0 0 0];
+
+internalField   uniform 1e5;
+
+boundaryField
+{
+    ".*"
+    {
+        type            calculated;
+    }
+}
+
+// ************************************************************************* //
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/Allrun b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/Allrun
index 0ba7339dbc20d28a0601f3ecdb0d70edab2f3d61..719642b9ac8fd97ff7e3e5b714daac56b6e2a8b0 100755
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/Allrun
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/Allrun
@@ -23,7 +23,7 @@ done
 
 for i in bottomAir topAir heater leftSolid rightSolid
 do
-   changeDictionary -region $i >& log.changeDictionary.$i
+   changeDictionary -region $i > log.changeDictionary.$i 2>&1
 done
 
 
@@ -33,7 +33,7 @@ runApplication chtMultiRegionSimpleFoam
 ## Decompose
 #for i in bottomAir topAir heater leftSolid rightSolid
 #do
-#   decomposePar -region $i >& log.decomposePar.$i
+#   decomposePar -region $i > log.decomposePar.$i 2>&1
 #done
 #
 ## Run
@@ -42,7 +42,7 @@ runApplication chtMultiRegionSimpleFoam
 ## Reconstruct
 #for i in bottomAir topAir heater leftSolid rightSolid
 #do
-#   reconstructPar -region $i >& log.reconstructPar.$i
+#   reconstructPar -region $i > log.reconstructPar.$i 2>&1
 #done
 
 
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/changeDictionaryDict
index c36ea6b8039bbf390c437d1875aa6eebe84cf63f..6faab27ee56705411dc2abcf18838952a6f25fa1 100644
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/changeDictionaryDict
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/changeDictionaryDict
@@ -92,16 +92,30 @@ dictionaryReplacement
         }
     }
 
-    p
+    p_rgh
     {
-        internalField   uniform 100000;
+        internalField   uniform 1e5;
 
         boundaryField
         {
             ".*"
             {
                 type            buoyantPressure;
-                value           1e5;
+                value           uniform 1e5;
+            }
+        }
+    }
+
+    p
+    {
+        internalField   uniform 1e5;
+
+        boundaryField
+        {
+            ".*"
+            {
+                type            calculated;
+                value           uniform 1e5;
             }
         }
     }
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/decomposeParDict
index e53a523c9d58e8314f6eeea8b310d284b54f6cd0..8f6ced4ac38fc5f058b8c4370ed4002c036d61f6 100644
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/decomposeParDict
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/decomposeParDict
@@ -76,7 +76,7 @@ manualCoeffs
 //// Is the case distributed
 //distributed     yes;
 //// Per slave (so nProcs-1 entries) the directory above the case.
-//roots           
+//roots
 //(
 //    "/tmp"
 //    "/tmp"
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/fvSchemes b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/fvSchemes
index a06836c2b3bcf34f7c2d7df8a6bb39f7f0b3f5a0..c136ffea3116ad29d3f67eb00de18abd99b3ef5b 100644
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/fvSchemes
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/fvSchemes
@@ -28,7 +28,7 @@ divSchemes
 {
     default         none;
     div(phi,U)      Gauss upwind;
-    div(phiU,p)     Gauss linear;
+    div(U,p)        Gauss linear;
     div(phi,h)      Gauss upwind;
     div(phi,k)      Gauss upwind;
     div(phi,epsilon) Gauss upwind;
@@ -41,7 +41,7 @@ laplacianSchemes
 {
     default         none;
     laplacian(muEff,U) Gauss linear limited 0.333;
-    laplacian((rho*(1|A(U))),p) Gauss linear limited 0.333;
+    laplacian((rho*(1|A(U))),p_rgh) Gauss linear limited 0.333;
     laplacian(alphaEff,h) Gauss linear limited 0.333;
     laplacian(DkEff,k) Gauss linear limited 0.333;
     laplacian(DepsilonEff,epsilon) Gauss linear limited 0.333;
@@ -61,7 +61,7 @@ snGradSchemes
 fluxRequired
 {
     default         no;
-    p;
+    p_rgh;
 }
 
 // ************************************************************************* //
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/fvSolution b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/fvSolution
index 842419ac72ba1d61e74173ee300cafd9fb171ee5..eff94d930fcb9875b4853c30e7592634920cd851 100644
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/fvSolution
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/fvSolution
@@ -20,14 +20,14 @@ solvers
     {
         solver          PCG
         preconditioner  DIC;
-        tolerance       1e-8;
+        tolerance       1e-7;
         relTol          0;
     }
 
-    p
+    p_rgh
     {
         solver           GAMG;
-        tolerance        1e-8;
+        tolerance        1e-7;
         relTol           0.01;
 
         smoother         GaussSeidel;
@@ -42,22 +42,25 @@ solvers
     {
         solver           PBiCG;
         preconditioner   DILU;
-        tolerance        1e-08;
+        tolerance        1e-7;
         relTol           0.1;
     }
 }
 
 SIMPLE
 {
+    momentumPredictor on;
     nNonOrthogonalCorrectors 0;
     pRefCell                0;
     pRefValue               100000;
+    rhoMin      rhoMin [1 -3 0 0 0] 0.2;
+    rhoMax      rhoMax [1 -3 0 0 0] 2;
 }
 
 relaxationFactors
 {
     rho         1;
-    p           0.7;
+    p_rgh       0.7;
     U           0.3;
     h           0.7;
     nuTilda     0.7;
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/controlDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/controlDict
index 0c78e811c64e188c09e6d22ea16aa332c7024503..32e60a1dd1db695e64f63501af2c5e5de42616cc 100644
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/controlDict
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/controlDict
@@ -17,7 +17,7 @@ FoamFile
 
 libs            ("libcompressibleTurbulenceModel.so" "libcompressibleRASModels.so");
 
-application     chtMultiRegionFoam;
+application     chtMultiRegionSimpleFoam;
 
 startFrom       startTime;
 
@@ -25,14 +25,15 @@ startTime       0;
 
 stopAt          endTime;
 
-endTime         1000;
+endTime         2000;
 
 deltaT          1;
 
 writeControl    timeStep;
+
 writeInterval   100;
 
-purgeWrite      0;
+purgeWrite      5;
 
 writeFormat     ascii;
 
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/decomposeParDict
index e53a523c9d58e8314f6eeea8b310d284b54f6cd0..8f6ced4ac38fc5f058b8c4370ed4002c036d61f6 100644
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/decomposeParDict
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/decomposeParDict
@@ -76,7 +76,7 @@ manualCoeffs
 //// Is the case distributed
 //distributed     yes;
 //// Per slave (so nProcs-1 entries) the directory above the case.
-//roots           
+//roots
 //(
 //    "/tmp"
 //    "/tmp"
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/heater/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/heater/decomposeParDict
index e53a523c9d58e8314f6eeea8b310d284b54f6cd0..8f6ced4ac38fc5f058b8c4370ed4002c036d61f6 100644
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/heater/decomposeParDict
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/heater/decomposeParDict
@@ -76,7 +76,7 @@ manualCoeffs
 //// Is the case distributed
 //distributed     yes;
 //// Per slave (so nProcs-1 entries) the directory above the case.
-//roots           
+//roots
 //(
 //    "/tmp"
 //    "/tmp"
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/leftSolid/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/leftSolid/decomposeParDict
index e53a523c9d58e8314f6eeea8b310d284b54f6cd0..8f6ced4ac38fc5f058b8c4370ed4002c036d61f6 100644
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/leftSolid/decomposeParDict
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/leftSolid/decomposeParDict
@@ -76,7 +76,7 @@ manualCoeffs
 //// Is the case distributed
 //distributed     yes;
 //// Per slave (so nProcs-1 entries) the directory above the case.
-//roots           
+//roots
 //(
 //    "/tmp"
 //    "/tmp"
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/rightSolid/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/rightSolid/decomposeParDict
index e53a523c9d58e8314f6eeea8b310d284b54f6cd0..8f6ced4ac38fc5f058b8c4370ed4002c036d61f6 100644
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/rightSolid/decomposeParDict
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/rightSolid/decomposeParDict
@@ -76,7 +76,7 @@ manualCoeffs
 //// Is the case distributed
 //distributed     yes;
 //// Per slave (so nProcs-1 entries) the directory above the case.
-//roots           
+//roots
 //(
 //    "/tmp"
 //    "/tmp"
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/changeDictionaryDict
index cf0e2f131c205d67073d5777a4cd6f6f500677a4..ff4ba100119b83b40959e27389c224519da39a2e 100644
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/changeDictionaryDict
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/changeDictionaryDict
@@ -18,7 +18,7 @@ dictionaryReplacement
 {
     U
     {
-        internalField   uniform (0.01 0 0);
+        internalField   uniform (0.1 0 0);
 
         boundaryField
         {
@@ -30,13 +30,13 @@ dictionaryReplacement
             minX
             {
                 type            fixedValue;
-                value           uniform ( 0.01 0 0 );
+                value           uniform ( 0.1 0 0 );
             }
             maxX
             {
                 type            inletOutlet;
                 inletValue      uniform ( 0 0 0 );
-                value           uniform ( 0 0 0 );
+                value           uniform ( 0.1 0 0 );
             }
         }
     }
@@ -127,22 +127,42 @@ dictionaryReplacement
         }
     }
 
-    p
+    p_rgh
     {
-        internalField   uniform 100000;
+        internalField   uniform 1e5;
 
         boundaryField
         {
             ".*"
             {
                 type            buoyantPressure;
-                value           1e5;
+                value           uniform 1e5;
             }
 
             maxX
             {
                 type            fixedValue;
-                value           uniform 100000;
+                value           uniform 1e5;
+            }
+        }
+    }
+
+    p
+    {
+        internalField   uniform 1e5;
+
+        boundaryField
+        {
+            ".*"
+            {
+                type            calculated;
+                value           uniform 1e5;
+            }
+
+            maxX
+            {
+                type            calculated;
+                value           uniform 1e5;
             }
         }
     }
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/decomposeParDict
index e53a523c9d58e8314f6eeea8b310d284b54f6cd0..8f6ced4ac38fc5f058b8c4370ed4002c036d61f6 100644
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/decomposeParDict
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/decomposeParDict
@@ -76,7 +76,7 @@ manualCoeffs
 //// Is the case distributed
 //distributed     yes;
 //// Per slave (so nProcs-1 entries) the directory above the case.
-//roots           
+//roots
 //(
 //    "/tmp"
 //    "/tmp"
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/fvSchemes b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/fvSchemes
index a06836c2b3bcf34f7c2d7df8a6bb39f7f0b3f5a0..c136ffea3116ad29d3f67eb00de18abd99b3ef5b 100644
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/fvSchemes
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/fvSchemes
@@ -28,7 +28,7 @@ divSchemes
 {
     default         none;
     div(phi,U)      Gauss upwind;
-    div(phiU,p)     Gauss linear;
+    div(U,p)        Gauss linear;
     div(phi,h)      Gauss upwind;
     div(phi,k)      Gauss upwind;
     div(phi,epsilon) Gauss upwind;
@@ -41,7 +41,7 @@ laplacianSchemes
 {
     default         none;
     laplacian(muEff,U) Gauss linear limited 0.333;
-    laplacian((rho*(1|A(U))),p) Gauss linear limited 0.333;
+    laplacian((rho*(1|A(U))),p_rgh) Gauss linear limited 0.333;
     laplacian(alphaEff,h) Gauss linear limited 0.333;
     laplacian(DkEff,k) Gauss linear limited 0.333;
     laplacian(DepsilonEff,epsilon) Gauss linear limited 0.333;
@@ -61,7 +61,7 @@ snGradSchemes
 fluxRequired
 {
     default         no;
-    p;
+    p_rgh;
 }
 
 // ************************************************************************* //
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/fvSolution b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/fvSolution
index 842419ac72ba1d61e74173ee300cafd9fb171ee5..6e31656bb367a276b1ca28c2b355e60e10725968 100644
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/fvSolution
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/fvSolution
@@ -20,14 +20,14 @@ solvers
     {
         solver          PCG
         preconditioner  DIC;
-        tolerance       1e-8;
+        tolerance       1e-7;
         relTol          0;
     }
 
-    p
+    p_rgh
     {
         solver           GAMG;
-        tolerance        1e-8;
+        tolerance        1e-7;
         relTol           0.01;
 
         smoother         GaussSeidel;
@@ -36,28 +36,33 @@ solvers
         nCellsInCoarsestLevel 10;
         agglomerator     faceAreaPair;
         mergeLevels      1;
+
+        maxIter          100;
     }
 
     "(U|h|k|epsilon)"
     {
         solver           PBiCG;
         preconditioner   DILU;
-        tolerance        1e-08;
+        tolerance        1e-7;
         relTol           0.1;
     }
 }
 
 SIMPLE
 {
+    momentumPredictor on;
     nNonOrthogonalCorrectors 0;
     pRefCell                0;
     pRefValue               100000;
+    rhoMin      rhoMin [1 -3 0 0 0] 0.2;
+    rhoMax      rhoMax [1 -3 0 0 0] 2;
 }
 
 relaxationFactors
 {
     rho         1;
-    p           0.7;
+    p_rgh       0.7;
     U           0.3;
     h           0.7;
     nuTilda     0.7;
diff --git a/tutorials/incompressible/MRFSimpleFoam/mixerVessel2D/constant/polyMesh/blockMeshDict b/tutorials/incompressible/MRFSimpleFoam/mixerVessel2D/constant/polyMesh/blockMeshDict
deleted file mode 100644
index 97fcef9e025a8177b94cf7d48a67d153062932fc..0000000000000000000000000000000000000000
--- a/tutorials/incompressible/MRFSimpleFoam/mixerVessel2D/constant/polyMesh/blockMeshDict
+++ /dev/null
@@ -1,818 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    format      ascii;
-    class       dictionary;
-    object      blockMeshDict;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// General macros to create 2D/extruded-2D meshes
-
-
-
-
-
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-convertToMeters 0.1;
-
-// Hub radius
-
-
-// Impeller-tip radius
-
-
-// Baffle-tip radius
-
-
-// Tank radius
-
-
-// MRF region radius
-
-
-// Thickness of 2D slab
-
-
-// Base z
-
-
-// Top z
-
-
-// Number of cells radially between hub and impeller tip
-
-
-// Number of cells radially in each of the two regions between
-// impeller and baffle tips
-
-
-// Number of cells radially between baffle tip and tank
-
-
-// Number of cells azimuthally in each of the 8 blocks
-
-
-// Number of cells in the thickness of the slab
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-vertices
-(
-    (0.2 0 0) // Vertex r0b = 0 
-    (0.2 0 0) // Vertex r0sb = 1 
-    (0.141421356364228 -0.141421356110391 0) // Vertex r1b = 2 
-    (3.58979347393082e-10 -0.2 0) // Vertex r2b = 3 
-    (3.58979347393082e-10 -0.2 0) // Vertex r2sb = 4 
-    (-0.141421355856554 -0.141421356618065 0) // Vertex r3b = 5 
-    (-0.2 7.17958694786164e-10 0) // Vertex r4b = 6 
-    (-0.2 7.17958694786164e-10 0) // Vertex r4sb = 7 
-    (-0.141421355856554 0.141421356618065 0) // Vertex r5b = 8 
-    (3.58979347393082e-10 0.2 0) // Vertex r6b = 9 
-    (3.58979347393082e-10 0.2 0) // Vertex r6sb = 10 
-    (0.141421356364228 0.141421356110391 0) // Vertex r7b = 11 
-
-    (0.5 0 0) // Vertex rb0b = 12 
-    (0.353553390910569 -0.353553390275978 0) // Vertex rb1b = 13 
-    (8.97448368482705e-10 -0.5 0) // Vertex rb2b = 14 
-    (-0.353553389641386 -0.353553391545162 0) // Vertex rb3b = 15 
-    (-0.5 1.79489673696541e-09 0) // Vertex rb4b = 16 
-    (-0.353553389641386 0.353553391545162 0) // Vertex rb5b = 17 
-    (8.97448368482705e-10 0.5 0) // Vertex rb6b = 18 
-    (0.353553390910569 0.353553390275978 0) // Vertex rb7b = 19 
-
-    (0.6 0 0) // Vertex ri0b = 20 
-    (0.424264069092683 -0.424264068331174 0) // Vertex ri1b = 21 
-    (1.07693804217925e-09 -0.6 0) // Vertex ri2b = 22 
-    (-0.424264067569663 -0.424264069854194 0) // Vertex ri3b = 23 
-    (-0.6 2.15387608435849e-09 0) // Vertex ri4b = 24 
-    (-0.424264067569663 0.424264069854194 0) // Vertex ri5b = 25 
-    (1.07693804217925e-09 0.6 0) // Vertex ri6b = 26 
-    (0.424264069092683 0.424264068331174 0) // Vertex ri7b = 27 
-
-    (0.7 0 0) // Vertex Rb0b = 28 
-    (0.494974747274797 -0.494974746386369 0) // Vertex Rb1b = 29 
-    (1.25642771587579e-09 -0.7 0) // Vertex Rb2b = 30 
-    (-0.49497474549794 -0.494974748163226 0) // Vertex Rb3b = 31 
-    (-0.7 2.51285543175157e-09 0) // Vertex Rb4b = 32 
-    (-0.49497474549794 0.494974748163226 0) // Vertex Rb5b = 33 
-    (1.25642771587579e-09 0.7 0) // Vertex Rb6b = 34 
-    (0.494974747274797 0.494974746386369 0) // Vertex Rb7b = 35 
-
-    (1 0 0) // Vertex R0b = 36 
-    (0.707106781821139 -0.707106780551956 0) // Vertex R1b = 37 
-    (0.707106781821139 -0.707106780551956 0) // Vertex R1sb = 38 
-    (1.79489673696541e-09 -1 0) // Vertex R2b = 39 
-    (-0.707106779282772 -0.707106783090323 0) // Vertex R3b = 40 
-    (-0.707106779282772 -0.707106783090323 0) // Vertex R3sb = 41 
-    (-1 3.58979347393082e-09 0) // Vertex R4b = 42 
-    (-0.707106779282772 0.707106783090323 0) // Vertex R5b = 43 
-    (-0.707106779282772 0.707106783090323 0) // Vertex R5sb = 44 
-    (1.79489673696541e-09 1 0) // Vertex R6b = 45 
-    (0.707106781821139 0.707106780551956 0) // Vertex R7b = 46 
-    (0.707106781821139 0.707106780551956 0) // Vertex R7sb = 47 
-
-    (0.2 0 0.1) // Vertex r0t = 48 
-    (0.2 0 0.1) // Vertex r0st = 49 
-    (0.141421356364228 -0.141421356110391 0.1) // Vertex r1t = 50 
-    (3.58979347393082e-10 -0.2 0.1) // Vertex r2t = 51 
-    (3.58979347393082e-10 -0.2 0.1) // Vertex r2st = 52 
-    (-0.141421355856554 -0.141421356618065 0.1) // Vertex r3t = 53 
-    (-0.2 7.17958694786164e-10 0.1) // Vertex r4t = 54 
-    (-0.2 7.17958694786164e-10 0.1) // Vertex r4st = 55 
-    (-0.141421355856554 0.141421356618065 0.1) // Vertex r5t = 56 
-    (3.58979347393082e-10 0.2 0.1) // Vertex r6t = 57 
-    (3.58979347393082e-10 0.2 0.1) // Vertex r6st = 58 
-    (0.141421356364228 0.141421356110391 0.1) // Vertex r7t = 59 
-
-    (0.5 0 0.1) // Vertex rb0t = 60 
-    (0.353553390910569 -0.353553390275978 0.1) // Vertex rb1t = 61 
-    (8.97448368482705e-10 -0.5 0.1) // Vertex rb2t = 62 
-    (-0.353553389641386 -0.353553391545162 0.1) // Vertex rb3t = 63 
-    (-0.5 1.79489673696541e-09 0.1) // Vertex rb4t = 64 
-    (-0.353553389641386 0.353553391545162 0.1) // Vertex rb5t = 65 
-    (8.97448368482705e-10 0.5 0.1) // Vertex rb6t = 66 
-    (0.353553390910569 0.353553390275978 0.1) // Vertex rb7t = 67 
-
-    (0.6 0 0.1) // Vertex ri0t = 68 
-    (0.424264069092683 -0.424264068331174 0.1) // Vertex ri1t = 69 
-    (1.07693804217925e-09 -0.6 0.1) // Vertex ri2t = 70 
-    (-0.424264067569663 -0.424264069854194 0.1) // Vertex ri3t = 71 
-    (-0.6 2.15387608435849e-09 0.1) // Vertex ri4t = 72 
-    (-0.424264067569663 0.424264069854194 0.1) // Vertex ri5t = 73 
-    (1.07693804217925e-09 0.6 0.1) // Vertex ri6t = 74 
-    (0.424264069092683 0.424264068331174 0.1) // Vertex ri7t = 75 
-
-    (0.7 0 0.1) // Vertex Rb0t = 76 
-    (0.494974747274797 -0.494974746386369 0.1) // Vertex Rb1t = 77 
-    (1.25642771587579e-09 -0.7 0.1) // Vertex Rb2t = 78 
-    (-0.49497474549794 -0.494974748163226 0.1) // Vertex Rb3t = 79 
-    (-0.7 2.51285543175157e-09 0.1) // Vertex Rb4t = 80 
-    (-0.49497474549794 0.494974748163226 0.1) // Vertex Rb5t = 81 
-    (1.25642771587579e-09 0.7 0.1) // Vertex Rb6t = 82 
-    (0.494974747274797 0.494974746386369 0.1) // Vertex Rb7t = 83 
-
-    (1 0 0.1) // Vertex R0t = 84 
-    (0.707106781821139 -0.707106780551956 0.1) // Vertex R1t = 85 
-    (0.707106781821139 -0.707106780551956 0.1) // Vertex R1st = 86 
-    (1.79489673696541e-09 -1 0.1) // Vertex R2t = 87 
-    (-0.707106779282772 -0.707106783090323 0.1) // Vertex R3t = 88 
-    (-0.707106779282772 -0.707106783090323 0.1) // Vertex R3st = 89 
-    (-1 3.58979347393082e-09 0.1) // Vertex R4t = 90 
-    (-0.707106779282772 0.707106783090323 0.1) // Vertex R5t = 91 
-    (-0.707106779282772 0.707106783090323 0.1) // Vertex R5st = 92 
-    (1.79489673696541e-09 1 0.1) // Vertex R6t = 93 
-    (0.707106781821139 0.707106780551956 0.1) // Vertex R7t = 94 
-    (0.707106781821139 0.707106780551956 0.1) // Vertex R7st = 95 
-);
-
-blocks
-(
-    // block0
-    hex (0 2 13 12 48 50 61 60)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (2 4 14 13 50 52 62 61)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (3 5 15 14 51 53 63 62)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block3
-    hex (5 7 16 15 53 55 64 63)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block4
-    hex (6 8 17 16 54 56 65 64)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block5
-    hex (8 10 18 17 56 58 66 65)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block6
-    hex (9 11 19 18 57 59 67 66)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block7
-    hex (11 1 12 19 59 49 60 67)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block0
-    hex (12 13 21 20 60 61 69 68)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (13 14 22 21 61 62 70 69)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (14 15 23 22 62 63 71 70)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block3
-    hex (15 16 24 23 63 64 72 71)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block4
-    hex (16 17 25 24 64 65 73 72)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block5
-    hex (17 18 26 25 65 66 74 73)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block6
-    hex (18 19 27 26 66 67 75 74)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block7
-    hex (19 12 20 27 67 60 68 75)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block0
-    hex (20 21 29 28 68 69 77 76)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (21 22 30 29 69 70 78 77)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (22 23 31 30 70 71 79 78)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block3
-    hex (23 24 32 31 71 72 80 79)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block4
-    hex (24 25 33 32 72 73 81 80)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block5
-    hex (25 26 34 33 73 74 82 81)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block6
-    hex (26 27 35 34 74 75 83 82)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block7
-    hex (27 20 28 35 75 68 76 83)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block0
-    hex (28 29 38 36 76 77 86 84)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (29 30 39 37 77 78 87 85)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (30 31 41 39 78 79 89 87)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block3
-    hex (31 32 42 40 79 80 90 88)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block4
-    hex (32 33 44 42 80 81 92 90)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block5
-    hex (33 34 45 43 81 82 93 91)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block6
-    hex (34 35 47 45 82 83 95 93)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block7
-    hex (35 28 36 46 83 76 84 94)
-    (12 12 1)
-    simpleGrading (1 1 1)
-);
-
-edges
-(
-    arc 0 2 (0.184775906536601 -0.0765366863901046 0)
-    arc 2 4 (0.0765366867217582 -0.184775906399226 0)
-    arc 3 5 (-0.0765366860584508 -0.184775906673977 0)
-    arc 5 7 (-0.18477590626185 -0.0765366870534118 0)
-    arc 6 8 (-0.18477590626185 0.0765366870534118 0)
-    arc 8 10 (-0.0765366860584508 0.184775906673977 0)
-    arc 9 11 (0.0765366867217582 0.184775906399226 0)
-    arc 11 1 (0.184775906536601 0.0765366863901046 0)
-
-    arc 12 13 (0.461939766341503 -0.191341715975262 0)
-    arc 13 14 (0.191341716804395 -0.461939765998065 0)
-    arc 14 15 (-0.191341715146127 -0.461939766684942 0)
-    arc 15 16 (-0.461939765654626 -0.19134171763353 0)
-    arc 16 17 (-0.461939765654626 0.19134171763353 0)
-    arc 17 18 (-0.191341715146127 0.461939766684942 0)
-    arc 18 19 (0.191341716804395 0.461939765998065 0)
-    arc 19 12 (0.461939766341503 0.191341715975262 0)
-
-    arc 20 21 (0.554327719609804 -0.229610059170314 0)
-    arc 21 22 (0.229610060165275 -0.554327719197677 0)
-    arc 22 23 (-0.229610058175352 -0.55432772002193 0)
-    arc 23 24 (-0.554327718785551 -0.229610061160235 0)
-    arc 24 25 (-0.554327718785551 0.229610061160235 0)
-    arc 25 26 (-0.229610058175352 0.55432772002193 0)
-    arc 26 27 (0.229610060165275 0.554327719197677 0)
-    arc 27 20 (0.554327719609804 0.229610059170314 0)
-
-    arc 28 29 (0.646715672878104 -0.267878402365366 0)
-    arc 29 30 (0.267878403526154 -0.64671567239729 0)
-    arc 30 31 (-0.267878401204578 -0.646715673358918 0)
-    arc 31 32 (-0.646715671916476 -0.267878404686941 0)
-    arc 32 33 (-0.646715671916476 0.267878404686941 0)
-    arc 33 34 (-0.267878401204578 0.646715673358918 0)
-    arc 34 35 (0.267878403526154 0.64671567239729 0)
-    arc 35 28 (0.646715672878104 0.267878402365366 0)
-
-    arc 36 38 (0.923879532683006 -0.382683431950523 0)
-    arc 37 39 (0.382683433608791 -0.923879531996129 0)
-    arc 39 41 (-0.382683430292254 -0.923879533369883 0)
-    arc 40 42 (-0.923879531309252 -0.382683435267059 0)
-    arc 42 44 (-0.923879531309252 0.382683435267059 0)
-    arc 43 45 (-0.382683430292254 0.923879533369883 0)
-    arc 45 47 (0.382683433608791 0.923879531996129 0)
-    arc 46 36 (0.923879532683006 0.382683431950523 0)
-
-    arc 48 50 (0.184775906536601 -0.0765366863901046 0.1)
-    arc 50 52 (0.0765366867217582 -0.184775906399226 0.1)
-    arc 51 53 (-0.0765366860584508 -0.184775906673977 0.1)
-    arc 53 55 (-0.18477590626185 -0.0765366870534118 0.1)
-    arc 54 56 (-0.18477590626185 0.0765366870534118 0.1)
-    arc 56 58 (-0.0765366860584508 0.184775906673977 0.1)
-    arc 57 59 (0.0765366867217582 0.184775906399226 0.1)
-    arc 59 49 (0.184775906536601 0.0765366863901046 0.1)
-
-    arc 60 61 (0.461939766341503 -0.191341715975262 0.1)
-    arc 61 62 (0.191341716804395 -0.461939765998065 0.1)
-    arc 62 63 (-0.191341715146127 -0.461939766684942 0.1)
-    arc 63 64 (-0.461939765654626 -0.19134171763353 0.1)
-    arc 64 65 (-0.461939765654626 0.19134171763353 0.1)
-    arc 65 66 (-0.191341715146127 0.461939766684942 0.1)
-    arc 66 67 (0.191341716804395 0.461939765998065 0.1)
-    arc 67 60 (0.461939766341503 0.191341715975262 0.1)
-
-    arc 68 69 (0.554327719609804 -0.229610059170314 0.1)
-    arc 69 70 (0.229610060165275 -0.554327719197677 0.1)
-    arc 70 71 (-0.229610058175352 -0.55432772002193 0.1)
-    arc 71 72 (-0.554327718785551 -0.229610061160235 0.1)
-    arc 72 73 (-0.554327718785551 0.229610061160235 0.1)
-    arc 73 74 (-0.229610058175352 0.55432772002193 0.1)
-    arc 74 75 (0.229610060165275 0.554327719197677 0.1)
-    arc 75 68 (0.554327719609804 0.229610059170314 0.1)
-
-    arc 76 77 (0.646715672878104 -0.267878402365366 0.1)
-    arc 77 78 (0.267878403526154 -0.64671567239729 0.1)
-    arc 78 79 (-0.267878401204578 -0.646715673358918 0.1)
-    arc 79 80 (-0.646715671916476 -0.267878404686941 0.1)
-    arc 80 81 (-0.646715671916476 0.267878404686941 0.1)
-    arc 81 82 (-0.267878401204578 0.646715673358918 0.1)
-    arc 82 83 (0.267878403526154 0.64671567239729 0.1)
-    arc 83 76 (0.646715672878104 0.267878402365366 0.1)
-
-    arc 84 86 (0.923879532683006 -0.382683431950523 0.1)
-    arc 85 87 (0.382683433608791 -0.923879531996129 0.1)
-    arc 87 89 (-0.382683430292254 -0.923879533369883 0.1)
-    arc 88 90 (-0.923879531309252 -0.382683435267059 0.1)
-    arc 90 92 (-0.923879531309252 0.382683435267059 0.1)
-    arc 91 93 (-0.382683430292254 0.923879533369883 0.1)
-    arc 93 95 (0.382683433608791 0.923879531996129 0.1)
-    arc 94 84 (0.923879532683006 0.382683431950523 0.1)
-);
-
-patches
-(
-    wall rotor
-    (
-        (0 2 50 48)
-        (2 4 52 50)
-        (3 5 53 51)
-        (5 7 55 53)
-        (6 8 56 54)
-        (8 10 58 56)
-        (9 11 59 57)
-        (11 1 49 59)
-
-        (0 12 60 48)
-        (1 12 60 49)
-
-        (3 14 62 51)
-        (4 14 62 52)
-
-        (6 16 64 54)
-        (7 16 64 55)
-
-        (9 18 66 57)
-        (10 18 66 58)
-    )
-
-    wall stator
-    (
-        (36 38 86 84)
-        (37 39 87 85)
-        (39 41 89 87)
-        (40 42 90 88)
-        (42 44 92 90)
-        (43 45 93 91)
-        (45 47 95 93)
-        (46 36 84 94)
-
-        (37 29 77 85)
-        (38 29 77 86)
-
-        (40 31 79 88)
-        (41 31 79 89)
-
-        (43 33 81 91)
-        (44 33 81 92)
-
-        (46 35 83 94)
-        (47 35 83 95)
-    )
-
-    empty front
-    (
-        (48 50 61 60)
-        (50 52 62 61)
-        (51 53 63 62)
-        (53 55 64 63)
-        (54 56 65 64)
-        (56 58 66 65)
-        (57 59 67 66)
-        (59 49 60 67)
-        (60 61 69 68)
-        (61 62 70 69)
-        (62 63 71 70)
-        (63 64 72 71)
-        (64 65 73 72)
-        (65 66 74 73)
-        (66 67 75 74)
-        (67 60 68 75)
-        (68 69 77 76)
-        (69 70 78 77)
-        (70 71 79 78)
-        (71 72 80 79)
-        (72 73 81 80)
-        (73 74 82 81)
-        (74 75 83 82)
-        (75 68 76 83)
-        (76 77 86 84)
-        (77 78 87 85)
-        (78 79 89 87)
-        (79 80 90 88)
-        (80 81 92 90)
-        (81 82 93 91)
-        (82 83 95 93)
-        (83 76 84 94)
-    )
-
-    empty back
-    (
-        (0 12 13 2)
-        (2 13 14 4)
-        (3 14 15 5)
-        (5 15 16 7)
-        (6 16 17 8)
-        (8 17 18 10)
-        (9 18 19 11)
-        (11 19 12 1)
-        (12 20 21 13)
-        (13 21 22 14)
-        (14 22 23 15)
-        (15 23 24 16)
-        (16 24 25 17)
-        (17 25 26 18)
-        (18 26 27 19)
-        (19 27 20 12)
-        (20 28 29 21)
-        (21 29 30 22)
-        (22 30 31 23)
-        (23 31 32 24)
-        (24 32 33 25)
-        (25 33 34 26)
-        (26 34 35 27)
-        (27 35 28 20)
-        (28 36 38 29)
-        (29 37 39 30)
-        (30 39 41 31)
-        (31 40 42 32)
-        (32 42 44 33)
-        (33 43 45 34)
-        (34 45 47 35)
-        (35 46 36 28)
-    )
-);
-
-// ************************************************************************* //
diff --git a/tutorials/incompressible/pimpleFoam/t-junction-with-fan/system/fvSolution b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/system/fvSolution
index 1b7fb06c4d6bfb6957a8ddabdc4c0d74148ce031..637611c63f451002f3fab2255be9f4091387b470 100644
--- a/tutorials/incompressible/pimpleFoam/t-junction-with-fan/system/fvSolution
+++ b/tutorials/incompressible/pimpleFoam/t-junction-with-fan/system/fvSolution
@@ -41,7 +41,7 @@ solvers
         mergeLevels     1;
     }
 
-    U
+    "(U|k|epsilon)"
     {
         solver          PBiCG;
         preconditioner  DILU;
@@ -49,26 +49,9 @@ solvers
         relTol          0.1;
     }
 
-    UFinal
+    "(U|k|epsilon)Final"
     {
-        solver          PBiCG;
-        preconditioner  DILU;
-        tolerance       1e-05;
-        relTol          0;
-    }
-
-    k
-    {
-        solver          PBiCG;
-        preconditioner  DILU;
-        tolerance       1e-05;
-        relTol          0;
-    }
-
-    epsilon
-    {
-        solver          PBiCG;
-        preconditioner  DILU;
+        $U;
         tolerance       1e-05;
         relTol          0;
     }
diff --git a/tutorials/incompressible/pimpleFoam/t-junction/system/fvSolution b/tutorials/incompressible/pimpleFoam/t-junction/system/fvSolution
index 1b7fb06c4d6bfb6957a8ddabdc4c0d74148ce031..637611c63f451002f3fab2255be9f4091387b470 100644
--- a/tutorials/incompressible/pimpleFoam/t-junction/system/fvSolution
+++ b/tutorials/incompressible/pimpleFoam/t-junction/system/fvSolution
@@ -41,7 +41,7 @@ solvers
         mergeLevels     1;
     }
 
-    U
+    "(U|k|epsilon)"
     {
         solver          PBiCG;
         preconditioner  DILU;
@@ -49,26 +49,9 @@ solvers
         relTol          0.1;
     }
 
-    UFinal
+    "(U|k|epsilon)Final"
     {
-        solver          PBiCG;
-        preconditioner  DILU;
-        tolerance       1e-05;
-        relTol          0;
-    }
-
-    k
-    {
-        solver          PBiCG;
-        preconditioner  DILU;
-        tolerance       1e-05;
-        relTol          0;
-    }
-
-    epsilon
-    {
-        solver          PBiCG;
-        preconditioner  DILU;
+        $U;
         tolerance       1e-05;
         relTol          0;
     }
diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict
deleted file mode 100644
index 0922303da33f01fd52960b00160c0dc787f5d9d4..0000000000000000000000000000000000000000
--- a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict
+++ /dev/null
@@ -1,123 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    format      ascii;
-    class       dictionary;
-    object      blockMeshDict;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// block definition for a porosity with an angled inlet/outlet
-// the porosity is not aligned with the main axes
-//
-                             
-convertToMeters 0.001;
-
-vertices
-(
-    // inlet region
-    ( -150  0  -25 )  // pt 0 (in1b) 
-    ( -150 35.35533906  -25 ) // pt 1 (in2b) 
-    ( -150  0  25 )  // pt 2 (in1f) 
-    ( -150 35.35533906  25 ) // pt 3 (in2f) 
-
-    // join inlet->outlet
-    (  0 0  -25 )    // pt 4 (join1b) 
-    ( -35.35533906   35.35533906  -25 ) // pt 5 (join2b) 
-    (  0 0  25 )    // pt 6 (join1f) 
-    ( -35.35533906   35.35533906  25 ) // pt 7 (join2f) 
-
-    // porosity ends ->outlet
-    ( 70.71067812 70.71067812  -25 )  // pt 8 (poro1b) 
-    ( 35.35533906 106.06601718  -25 )  // pt 9 (poro2b) 
-    ( 70.71067812 70.71067812  25 )  // pt 10 (poro1f) 
-    ( 35.35533906 106.06601718  25 )  // pt 11 (poro2f) 
-
-    // outlet
-    ( 141.42135624 141.42135624 -25 ) // pt 12 (out1b) 
-    ( 106.06601718 176.7766953 -25 ) // pt 13 (out2b) 
-    ( 141.42135624 141.42135624 25 ) // pt 14 (out1f) 
-    ( 106.06601718 176.7766953 25 ) // pt 15 (out2f) 
-);
-
-blocks
-(
-    // inlet block
-    hex (0 4 5 1 2 6 7 3)
-    inlet ( 15 20 20 ) simpleGrading (1 1 1)
-
-    // porosity block
-    hex (4 8 9 5 6 10 11 7)
-    porosity ( 20 20 20 ) simpleGrading (1 1 1)
-
-    // outlet block
-    hex (8 12 13 9 10 14 15 11)
-    outlet ( 20 20 20 )  simpleGrading (1 1 1)
-);
-
-edges
-(
-);
-
-patches
-(
-    // is there no way of defining all my 'defaultFaces' to be 'wall'?
-    wall front
-    (
-    // inlet block
-    (2 6 7 3)
-    // outlet block
-    (10 14 15 11)
-    )
-
-    wall back
-    (
-    // inlet block
-    (1 5 4 0)
-    // outlet block
-    (9 13 12 8)
-    )
-
-    wall wall
-    (
-    // inlet block
-    (2 0 4 6)
-    (7 5 1 3)
-    // outlet block
-    (10 8 12 14)
-    (15 13 9 11)
-    )
-
-    wall porosityWall
-    (
-    // porosity block
-    (6 10 11 7)
-    // porosity block
-    (5 9 8 4)
-    // porosity block
-    (6 4 8 10)
-    (11 9 5 7)
-    )
-
-    patch inlet
-    (
-    (3 1 0 2)
-    )
-
-    patch outlet
-    (
-    (15 13 12 14)
-    )
-);
-
-mergePatchPairs
-(
-);
-
-// ************************************************************************* //
diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict.m4 b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict.m4
deleted file mode 100644
index fb67da75dadc3bff07ef6a1043acfd66b2c49011..0000000000000000000000000000000000000000
--- a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict.m4
+++ /dev/null
@@ -1,165 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    `format'      ascii;
-    class       dictionary;
-    object      blockMeshDict;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// block definition for a porosity with an angled inlet/outlet
-// the porosity is not aligned with the main axes
-//
-dnl> -----------------------------------------------------------------
-dnl> <STANDARD DEFINTIONS>
-dnl>
-changecom(//)changequote([,]) dnl>
-define(calc, [esyscmd(perl -e 'print ($1)')]) dnl>
-define(VCOUNT, 0)  dnl>
-define(vlabel, [[// ]pt VCOUNT ($1) define($1, VCOUNT)define([VCOUNT], incr(VCOUNT))])  dnl>
-dnl>
-define(hex2D, hex ($1b $2b $3b $4b $1f $2f $3f $4f)) dnl>
-define(quad2D, ($1f $1b $2b $2f))  dnl>
-define(frontQuad, ($1f $2f $3f $4f)) dnl>
-define(backQuad, ($4b $3b $2b $1b)) dnl>
-dnl>
-dnl> </STANDARD DEFINTIONS>
-dnl> -----------------------------------------------------------------
-dnl>
-define(ncells, 20) dnl>
-define(ninlet, 15) dnl>
-define(nporo, 20) dnl>
-define(noutlet, 20) dnl>
-dnl>
-define(x0,0) dnl>
-define(y0,0) dnl>
-define(y0,0) dnl>
-define(Cos,0.7071067812) dnl>   == cos(45)
-define(Sin,0.7071067812) dnl>   == sin(45)
-dnl>
-define(width,50) dnl>
-define(zBack,calc(-width/2)) dnl>
-define(zFront,calc(width/2)) dnl>
-define(leninlet,150)dnl>
-define(lenporo,100)dnl>
-define(lenoutlet,100)dnl>
-dnl>
-define(xhyp,calc(Sin*width)) dnl>
-define(yhyp,calc(Cos*width)) dnl>
-define(xinlet,leninlet)dnl>
-define(xporo,calc(Cos*lenporo)) dnl>
-define(yporo,calc(Sin*lenporo)) dnl>
-define(xoutlet,calc(xporo + Cos*lenoutlet)) dnl>
-define(youtlet,calc(yporo + Sin*lenoutlet)) dnl>
-dnl>
-
-convertToMeters 0.001;
-
-vertices
-(
-    // inlet region
-    ( -xinlet  y0  zBack )  vlabel(in1b)
-    ( -xinlet yhyp  zBack ) vlabel(in2b)
-    ( -xinlet  y0  zFront )  vlabel(in1f)
-    ( -xinlet yhyp  zFront ) vlabel(in2f)
-
-    // join inlet->outlet
-    (  x0 y0  zBack )    vlabel(join1b)
-    ( -xhyp   yhyp  zBack ) vlabel(join2b)
-    (  x0 y0  zFront )    vlabel(join1f)
-    ( -xhyp   yhyp  zFront ) vlabel(join2f)
-
-    // porosity ends ->outlet
-    ( xporo yporo  zBack )  vlabel(poro1b)
-    ( calc(xporo - xhyp) calc(yporo + yhyp)  zBack )  vlabel(poro2b)
-    ( xporo yporo  zFront )  vlabel(poro1f)
-    ( calc(xporo - xhyp) calc(yporo + yhyp)  zFront )  vlabel(poro2f)
-
-    // outlet
-    ( xoutlet youtlet zBack ) vlabel(out1b)
-    ( calc(xoutlet - xhyp) calc(youtlet + yhyp) zBack ) vlabel(out2b)
-    ( xoutlet youtlet zFront ) vlabel(out1f)
-    ( calc(xoutlet - xhyp) calc(youtlet + yhyp) zFront ) vlabel(out2f)
-);
-
-blocks
-(
-    // inlet block
-    hex2D(in1, join1, join2, in2)
-    inlet ( ninlet ncells ncells ) simpleGrading (1 1 1)
-
-    // porosity block
-    hex2D(join1, poro1, poro2, join2)
-    porosity ( nporo ncells ncells ) simpleGrading (1 1 1)
-
-    // outlet block
-    hex2D(poro1, out1, out2, poro2)
-    outlet ( noutlet ncells ncells )  simpleGrading (1 1 1)
-);
-
-edges
-(
-);
-
-patches
-(
-    // is there no way of defining all my 'defaultFaces' to be 'wall'?
-    wall front
-    (
-    // inlet block
-    frontQuad(in1, join1, join2, in2)
-    // outlet block
-    frontQuad(poro1, out1, out2, poro2)
-    )
-
-    wall back
-    (
-    // inlet block
-    backQuad(in1, join1, join2, in2)
-    // outlet block
-    backQuad(poro1, out1, out2, poro2)
-    )
-
-    wall wall
-    (
-    // inlet block
-    quad2D(in1, join1)
-    quad2D(join2, in2)
-    // outlet block
-    quad2D(poro1, out1)
-    quad2D(out2, poro2)
-    )
-
-    wall porosityWall
-    (
-    // porosity block
-    frontQuad(join1, poro1, poro2, join2)
-    // porosity block
-    backQuad(join1, poro1, poro2, join2)
-    // porosity block
-    quad2D(join1, poro1)
-    quad2D(poro2, join2)
-    )
-
-    patch inlet
-    (
-    quad2D(in2, in1)
-    )
-
-    patch outlet
-    (
-    quad2D(out2, out1)
-    )
-);
-
-mergePatchPairs
-(
-);
-
-// ************************************************************************* //
diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/fvSolution b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/fvSolution
index ffb16df0c05fe6dd38f95767d1c61394d9e6ee5e..20d0f46217e1973dfbbd865690490858e97a2ef1 100644
--- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/fvSolution
+++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/fvSolution
@@ -22,6 +22,13 @@ solvers
         solver          PCG;
         preconditioner  DIC;
         tolerance       1e-05;
+        relTol          0.1;
+    }
+
+   "(rho|G)Final"
+    {
+        $rho;
+        tolerance       1e-05;
         relTol          0;
     }
 
@@ -30,6 +37,13 @@ solvers
         solver          PBiCG;
         preconditioner  DILU;
         tolerance       1e-06;
+        relTol          0.1;
+    }
+
+    pFinal
+    {
+        $p;
+        tolerance       1e-06;
         relTol          0;
     }
 
@@ -38,6 +52,13 @@ solvers
         solver          PBiCG;
         preconditioner  DILU;
         tolerance       1e-05;
+        relTol          0.1;
+    }
+
+    "(U|hs|R|k|epsilon)Final"
+    {
+        $U;
+        tolerance       1e-05;
         relTol          0;
     }
 
@@ -46,6 +67,14 @@ solvers
         solver          PBiCG;
         preconditioner  DILU;
         tolerance       1e-06;
+        relTol          0.1;
+    }
+
+    "(Yi|CO2|O2|N2|CH4|H2|H2O|CO)Final"
+    {
+        $Yi;
+        preconditioner  DILU;
+        tolerance       1e-06;
         relTol          0;
     }
 }
diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/Allrun b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/Allrun
index 2fee29a1301c29041a33ec68e71f332ee580b21a..cbb64d4d0752a37d5c46112a800b437d8e681d8e 100755
--- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/Allrun
+++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/Allrun
@@ -10,17 +10,17 @@ application=`getApplication`
 runApplication blockMesh
 
 # create sets
-setSet -batch system/sets.setSet >& log.setSet1
+setSet -batch system/sets.setSet > log.setSet1 2>&1
 
 # convert sets to zones
-setsToZones -noFlipMap >& log.setsToZones
+setsToZones -noFlipMap > log.setsToZones 2>&1
 
 # create the first cyclic - lhs of porous zone
 unset FOAM_SETNAN
-createBaffles cycLeft '(cycLeft_half0 cycLeft_half1)' -overwrite >& log.createBaffles1
+createBaffles cycLeft '(cycLeft_half0 cycLeft_half1)' -overwrite > log.createBaffles1 2>&1
 
 # create the second cyclic - rhs of porous zone
-createBaffles cycRight '(cycRight_half0 cycRight_half1)' -overwrite >& log.createBaffles2
+createBaffles cycRight '(cycRight_half0 cycRight_half1)' -overwrite > log.createBaffles2 2>&1
 
 runApplication $application
 
diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0.org/alphat b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0.org/alphat
index 51edd139e7aed891905cdadb0f713f1f09ee1476..f1d9b942b3a2d7191a91eaf91024581dace6f377 100644
--- a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0.org/alphat
+++ b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0.org/alphat
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0.org/epsilon b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0.org/epsilon
index 2f05a9be403b980845bc7f3cea8ee0db3754aa8e..f1a9afb1b4a7d02f5c227e6473244df0a551f05a 100644
--- a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0.org/epsilon
+++ b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0.org/epsilon
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0.org/htcConv b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0.org/htcConv
index 372f9728b0acc4aee78c5379cdb563921fd4115e..337f26a66f851c95ebd931901cd1b431c5d1e68e 100644
--- a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0.org/htcConv
+++ b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0.org/htcConv
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0.org/k b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0.org/k
index 73a28dd66dd35fdc787d95ade0a13966f7c6a6e6..092c9639ca896b8be33a5b054d1c748760497c53 100644
--- a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0.org/k
+++ b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0.org/k
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0.org/mut b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0.org/mut
index 8b027d9e3ca95fae8e237614528cc0cf03d8e0a4..f638389f10976552c87c9867e0a4dcc04cf92425 100644
--- a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0.org/mut
+++ b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0.org/mut
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0/alphat b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0/alphat
index 51edd139e7aed891905cdadb0f713f1f09ee1476..f1d9b942b3a2d7191a91eaf91024581dace6f377 100644
--- a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0/alphat
+++ b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0/alphat
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0/epsilon b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0/epsilon
index 2f05a9be403b980845bc7f3cea8ee0db3754aa8e..f1a9afb1b4a7d02f5c227e6473244df0a551f05a 100644
--- a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0/epsilon
+++ b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0/epsilon
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0/htcConv b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0/htcConv
index 372f9728b0acc4aee78c5379cdb563921fd4115e..337f26a66f851c95ebd931901cd1b431c5d1e68e 100644
--- a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0/htcConv
+++ b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0/htcConv
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0/k b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0/k
index 73a28dd66dd35fdc787d95ade0a13966f7c6a6e6..092c9639ca896b8be33a5b054d1c748760497c53 100644
--- a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0/k
+++ b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0/k
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0/mut b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0/mut
index 8b027d9e3ca95fae8e237614528cc0cf03d8e0a4..f638389f10976552c87c9867e0a4dcc04cf92425 100644
--- a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0/mut
+++ b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/0/mut
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/constant/polyMesh/blockMeshDict b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/constant/polyMesh/blockMeshDict
index f295e7dcadd10835ffbbbecbcdb450964bd9915e..6354465fad28d5c7a2beddc31ce52e5264aa245c 100644
--- a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/constant/polyMesh/blockMeshDict
+++ b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/constant/polyMesh/blockMeshDict
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      http://www.OpenFOAM.org               |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/system/controlDict b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/system/controlDict
index 2e84d85b10565b63e68995ef8c038c3050575a8a..7188fff84351344173187c33336cb766c62bd641 100644
--- a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/system/controlDict
+++ b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/system/controlDict
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/system/changeDictionaryDict b/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/system/changeDictionaryDict
index 03380cd507b00da8a8c3a471fbbe3b967ce59333..055c1549d075d99025082e6271ca5d7f751dc47c 100644
--- a/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/system/changeDictionaryDict
+++ b/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/system/changeDictionaryDict
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                   |
+|  \\    /   O peration     | Version:  dev                                     |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/panel/constant/surfaceFilmProperties b/tutorials/lagrangian/reactingParcelFilmFoam/panel/constant/surfaceFilmProperties
index 9ff37a7d558778ad107096cf81e33d56ac139249..73c1c06c67370546b8df94494b2a69c92887ea4e 100644
--- a/tutorials/lagrangian/reactingParcelFilmFoam/panel/constant/surfaceFilmProperties
+++ b/tutorials/lagrangian/reactingParcelFilmFoam/panel/constant/surfaceFilmProperties
@@ -16,7 +16,6 @@ FoamFile
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 surfaceFilmModel kinematicSingleLayer;
-//surfaceFilmModel thermoSingleLayer;
 
 filmRegionName  wallFilmRegion;
 
@@ -24,30 +23,13 @@ active          true;
 
 kinematicSingleLayerCoeffs
 {
-    deltaStable deltaStable [0 1 0 0 0] 0;
+    thermoModel constant;
     Cf          0.005;
 
-    rho         rho [1 -3 0 0 0] 1000;
-    mu          mu [1 -1 -1 0 0] 1e-3;
-    sigma       sigma [1 0 -2 0 0] 0.07;
+    rho0        rho0 [1 -3 0 0 0] 1000;
+    mu0         mu0 [1 -1 -1 0 0] 1e-3;
+    sigma0      sigma0 [1 0 -2 0 0] 0.07;
 
     injectionModel none;
 }
 
-
-thermoSingleLayerCoeffs
-{
-    deltaStable deltaStable [0 1 0 0 0] 0;
-    Cf          0.005;
-    htcw        htcw [1 0 -3 -1 0] 1e-8; // 0.0;
-    htcs        htcs [1 0 -3 -1 0] 1e-8; // 0.0;
-
-    rho         rho [1 -3 0 0 0] 1000;
-    mu          mu [1 -1 -1 0 0] 1e-3;
-    sigma       sigma [1 0 -2 0 0] 0.07;
-    cp          cp [0 2 -2 -1 0] 4187;
-
-    injectionModel none;
-
-    phaseChangeModel none;
-}
diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/panel/constant/thermophysicalProperties b/tutorials/lagrangian/reactingParcelFilmFoam/panel/constant/thermophysicalProperties
index acfbe00bcea125abcf24f0a993155be4985adec8..e57087805d98fa0c19a0c6241b3ed663abeab818 100644
--- a/tutorials/lagrangian/reactingParcelFilmFoam/panel/constant/thermophysicalProperties
+++ b/tutorials/lagrangian/reactingParcelFilmFoam/panel/constant/thermophysicalProperties
@@ -23,17 +23,25 @@ foamChemistryFile "$FOAM_CASE/chemkin/foam.inp";
 
 foamChemistryThermoFile "$FOAM_CASE/chemkin/foam.dat";
 
-liquidComponents
-(
-    H2O
-);
+inertSpecie     N2;
 
-solidComponents
-();
+liquids
+{
+    liquidComponents
+    (
+        H2O
+    );
+
+    H2O             H2O defaultCoeffs;
+}
+
+solids
+{
+    solidComponents
+    ();
+}
 
-inertSpecie     N2;
 
-H2O             H2O defaultCoeffs;
 
 
 // ************************************************************************* //
diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/panel/system/wallFilmRegion/fvSchemes b/tutorials/lagrangian/reactingParcelFilmFoam/panel/system/wallFilmRegion/fvSchemes
index b6a31afe89a89a0c2bf0f5b1834f0cbc503d516c..0471d1d8f938c41f7627d4e6cddd5f4dbf11d8a6 100644
--- a/tutorials/lagrangian/reactingParcelFilmFoam/panel/system/wallFilmRegion/fvSchemes
+++ b/tutorials/lagrangian/reactingParcelFilmFoam/panel/system/wallFilmRegion/fvSchemes
@@ -36,6 +36,7 @@ gradSchemes
 {
     default none;
     grad(pL) Gauss linear;
+    grad(sigmaf) Gauss linear;
     snGradCorr(deltaf) Gauss linear;
     snGradCorr(pp) Gauss linear;
     snGradCorr(pu) Gauss linear;
diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/0/U b/tutorials/multiphase/MRFInterFoam/mixerVessel2D/0/U
similarity index 100%
rename from tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/0/U
rename to tutorials/multiphase/MRFInterFoam/mixerVessel2D/0/U
diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/0/alpha1 b/tutorials/multiphase/MRFInterFoam/mixerVessel2D/0/alpha1
similarity index 99%
rename from tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/0/alpha1
rename to tutorials/multiphase/MRFInterFoam/mixerVessel2D/0/alpha1
index f248abbc5768c1680b4640c74023a6ffab130e7f..f2611b5721c8e639ec0ade05e8c51175ae0d05d1 100644
--- a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/0/alpha1
+++ b/tutorials/multiphase/MRFInterFoam/mixerVessel2D/0/alpha1
@@ -17,7 +17,7 @@ FoamFile
 
 dimensions      [0 0 0 0 0 0 0];
 
-internalField   nonuniform List<scalar> 
+internalField   nonuniform List<scalar>
 3072
 (
 0
diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/0/alpha1.org b/tutorials/multiphase/MRFInterFoam/mixerVessel2D/0/alpha1.org
similarity index 100%
rename from tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/0/alpha1.org
rename to tutorials/multiphase/MRFInterFoam/mixerVessel2D/0/alpha1.org
diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/0/p b/tutorials/multiphase/MRFInterFoam/mixerVessel2D/0/p_rgh
similarity index 97%
rename from tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/0/p
rename to tutorials/multiphase/MRFInterFoam/mixerVessel2D/0/p_rgh
index 17c0b239f03df8d8bdc18b922e15c6ace5a56d32..ec3ced07493af94af8b9d18d5cfcbcb35592d4c0 100644
--- a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/0/p
+++ b/tutorials/multiphase/MRFInterFoam/mixerVessel2D/0/p_rgh
@@ -10,7 +10,7 @@ FoamFile
     version     2.0;
     format      ascii;
     class       volScalarField;
-    object      p;
+    object      p_rgh;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/Allrun b/tutorials/multiphase/MRFInterFoam/mixerVessel2D/Allrun
similarity index 100%
rename from tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/Allrun
rename to tutorials/multiphase/MRFInterFoam/mixerVessel2D/Allrun
diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/MRFZones b/tutorials/multiphase/MRFInterFoam/mixerVessel2D/constant/MRFZones
similarity index 100%
rename from tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/MRFZones
rename to tutorials/multiphase/MRFInterFoam/mixerVessel2D/constant/MRFZones
diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/g b/tutorials/multiphase/MRFInterFoam/mixerVessel2D/constant/g
similarity index 100%
rename from tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/g
rename to tutorials/multiphase/MRFInterFoam/mixerVessel2D/constant/g
diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/polyMesh/blockMeshDict.m4 b/tutorials/multiphase/MRFInterFoam/mixerVessel2D/constant/polyMesh/blockMeshDict.m4
similarity index 100%
rename from tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/polyMesh/blockMeshDict.m4
rename to tutorials/multiphase/MRFInterFoam/mixerVessel2D/constant/polyMesh/blockMeshDict.m4
diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/polyMesh/boundary b/tutorials/multiphase/MRFInterFoam/mixerVessel2D/constant/polyMesh/boundary
similarity index 100%
rename from tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/polyMesh/boundary
rename to tutorials/multiphase/MRFInterFoam/mixerVessel2D/constant/polyMesh/boundary
diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/transportProperties b/tutorials/multiphase/MRFInterFoam/mixerVessel2D/constant/transportProperties
similarity index 100%
rename from tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/transportProperties
rename to tutorials/multiphase/MRFInterFoam/mixerVessel2D/constant/transportProperties
diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/turbulenceProperties b/tutorials/multiphase/MRFInterFoam/mixerVessel2D/constant/turbulenceProperties
similarity index 100%
rename from tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/turbulenceProperties
rename to tutorials/multiphase/MRFInterFoam/mixerVessel2D/constant/turbulenceProperties
diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/makeMesh b/tutorials/multiphase/MRFInterFoam/mixerVessel2D/makeMesh
similarity index 100%
rename from tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/makeMesh
rename to tutorials/multiphase/MRFInterFoam/mixerVessel2D/makeMesh
diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/controlDict b/tutorials/multiphase/MRFInterFoam/mixerVessel2D/system/controlDict
similarity index 92%
rename from tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/controlDict
rename to tutorials/multiphase/MRFInterFoam/mixerVessel2D/system/controlDict
index 5fee1e5b71fc93b3d88e9b5f8ce6ad828eff881f..8cc03461257fd909a9c50c01349f161463472789 100644
--- a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/controlDict
+++ b/tutorials/multiphase/MRFInterFoam/mixerVessel2D/system/controlDict
@@ -15,7 +15,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-application     interFoam;
+application     MRFInterFoam;
 
 startFrom       startTime;
 
@@ -37,17 +37,18 @@ writeFormat     ascii;
 
 writePrecision  6;
 
-writeCompression off;
+writeCompression uncompressed;
 
 timeFormat      general;
 
 timePrecision   6;
 
-runTimeModifiable true;
+runTimeModifiable yes;
 
 adjustTimeStep  yes;
 
 maxCo           0.5;
+maxAlphaCo      0.5;
 
 maxDeltaT       1;
 
diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/fvSchemes b/tutorials/multiphase/MRFInterFoam/mixerVessel2D/system/fvSchemes
similarity index 98%
rename from tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/fvSchemes
rename to tutorials/multiphase/MRFInterFoam/mixerVessel2D/system/fvSchemes
index 75ff5e81527f878197a5e91f3d448a9ace3ab778..c707510c9be0b1eeae83c7f7fe534039ca4dbc53 100644
--- a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/fvSchemes
+++ b/tutorials/multiphase/MRFInterFoam/mixerVessel2D/system/fvSchemes
@@ -50,7 +50,7 @@ snGradSchemes
 fluxRequired
 {
     default         no;
-    p               ;
+    p_rgh           ;
     pcorr           ;
     alpha1          ;
 }
diff --git a/tutorials/multiphase/MRFInterFoam/mixerVessel2D/system/fvSolution b/tutorials/multiphase/MRFInterFoam/mixerVessel2D/system/fvSolution
new file mode 100644
index 0000000000000000000000000000000000000000..de207b274a797524a804cba7b6f285530bb0bf09
--- /dev/null
+++ b/tutorials/multiphase/MRFInterFoam/mixerVessel2D/system/fvSolution
@@ -0,0 +1,66 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       dictionary;
+    location    "system";
+    object      fvSolution;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+solvers
+{
+    pcorr
+    {
+        solver          PCG;
+        preconditioner  DIC;
+        tolerance       1e-10;
+        relTol          0;
+    }
+
+    p_rgh
+    {
+        solver          PCG;
+        preconditioner  DIC;
+        tolerance       1e-07;
+        relTol          0.05;
+    }
+
+    p_rghFinal
+    {
+        solver          PCG;
+        preconditioner  DIC;
+        tolerance       1e-07;
+        relTol          0;
+    }
+
+    U
+    {
+        solver          PBiCG;
+        preconditioner  DILU;
+        tolerance       1e-06;
+        relTol          0;
+    }
+}
+
+PISO
+{
+    momentumPredictor no;
+    nCorrectors     3;
+    nNonOrthogonalCorrectors 0;
+    nAlphaCorr      1;
+    nAlphaSubCycles 2;
+    cAlpha          1;
+    pRefCell        0;
+    pRefValue       0;
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/setFieldsDict b/tutorials/multiphase/MRFInterFoam/mixerVessel2D/system/setFieldsDict
similarity index 100%
rename from tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/setFieldsDict
rename to tutorials/multiphase/MRFInterFoam/mixerVessel2D/system/setFieldsDict
diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/topoSetDict b/tutorials/multiphase/MRFInterFoam/mixerVessel2D/system/topoSetDict
similarity index 87%
rename from tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/topoSetDict
rename to tutorials/multiphase/MRFInterFoam/mixerVessel2D/system/topoSetDict
index 5eb16f9c5fd1dbe14f8f174d993c63fb8637d5d4..8ffd2980bf96b035d80897bdbf2ee24261b1f58b 100644
--- a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/topoSetDict
+++ b/tutorials/multiphase/MRFInterFoam/mixerVessel2D/system/topoSetDict
@@ -15,14 +15,13 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-
 actions
 (
     {
-        name            rotor;
-        type            cellSet;
-        action          new;
-        source          zoneToCell;
+        name    rotor;
+        type    cellSet;
+        action  new;
+        source  zoneToCell;
         sourceInfo
         {
             name rotor;
@@ -30,5 +29,4 @@ actions
     }
 );
 
-
 // ************************************************************************* //
diff --git a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0.org/U b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0.org/U
new file mode 100644
index 0000000000000000000000000000000000000000..db40c3524be99ad22819b153684093cf924401fe
--- /dev/null
+++ b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0.org/U
@@ -0,0 +1,45 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       volVectorField;
+    location    "0";
+    object      U;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions      [0 1 -1 0 0 0 0];
+
+internalField   uniform (0 0 0);
+
+boundaryField
+{
+    rotor
+    {
+        type            fixedValue;
+        value           uniform (0 0 0);
+    }
+    stator
+    {
+        type            fixedValue;
+        value           uniform (0 0 0);
+    }
+    front
+    {
+        type            empty;
+    }
+    back
+    {
+        type            empty;
+    }
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0/alpha1.org b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0.org/alphaair
similarity index 86%
rename from tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0/alpha1.org
rename to tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0.org/alphaair
index 929e2045d8d742503bbe3307e201153c64c1217c..9107162c4d957e6c86376de2a84930b618ee238d 100644
--- a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0/alpha1.org
+++ b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0.org/alphaair
@@ -20,21 +20,24 @@ internalField   uniform 0;
 
 boundaryField
 {
-    walls        
+    rotor
     {
         type            zeroGradient;
     }
 
-    obstacle       
+    stator
     {
         type            zeroGradient;
     }
 
-    atmosphere      
+    front
     {
-        type            inletOutlet;
-        inletValue      uniform 0;
-        value           uniform 0;
+        type            empty;
+    }
+
+    back
+    {
+        type            empty;
     }
 }
 
diff --git a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0.org/alphamercury b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0.org/alphamercury
new file mode 100644
index 0000000000000000000000000000000000000000..9107162c4d957e6c86376de2a84930b618ee238d
--- /dev/null
+++ b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0.org/alphamercury
@@ -0,0 +1,44 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       volScalarField;
+    object      alpha1;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions      [0 0 0 0 0 0 0];
+
+internalField   uniform 0;
+
+boundaryField
+{
+    rotor
+    {
+        type            zeroGradient;
+    }
+
+    stator
+    {
+        type            zeroGradient;
+    }
+
+    front
+    {
+        type            empty;
+    }
+
+    back
+    {
+        type            empty;
+    }
+}
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0.org/alphaoil b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0.org/alphaoil
new file mode 100644
index 0000000000000000000000000000000000000000..9107162c4d957e6c86376de2a84930b618ee238d
--- /dev/null
+++ b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0.org/alphaoil
@@ -0,0 +1,44 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       volScalarField;
+    object      alpha1;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions      [0 0 0 0 0 0 0];
+
+internalField   uniform 0;
+
+boundaryField
+{
+    rotor
+    {
+        type            zeroGradient;
+    }
+
+    stator
+    {
+        type            zeroGradient;
+    }
+
+    front
+    {
+        type            empty;
+    }
+
+    back
+    {
+        type            empty;
+    }
+}
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0.org/alphas b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0.org/alphas
new file mode 100644
index 0000000000000000000000000000000000000000..9107162c4d957e6c86376de2a84930b618ee238d
--- /dev/null
+++ b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0.org/alphas
@@ -0,0 +1,44 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       volScalarField;
+    object      alpha1;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions      [0 0 0 0 0 0 0];
+
+internalField   uniform 0;
+
+boundaryField
+{
+    rotor
+    {
+        type            zeroGradient;
+    }
+
+    stator
+    {
+        type            zeroGradient;
+    }
+
+    front
+    {
+        type            empty;
+    }
+
+    back
+    {
+        type            empty;
+    }
+}
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0.org/alphawater b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0.org/alphawater
new file mode 100644
index 0000000000000000000000000000000000000000..9107162c4d957e6c86376de2a84930b618ee238d
--- /dev/null
+++ b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0.org/alphawater
@@ -0,0 +1,44 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       volScalarField;
+    object      alpha1;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions      [0 0 0 0 0 0 0];
+
+internalField   uniform 0;
+
+boundaryField
+{
+    rotor
+    {
+        type            zeroGradient;
+    }
+
+    stator
+    {
+        type            zeroGradient;
+    }
+
+    front
+    {
+        type            empty;
+    }
+
+    back
+    {
+        type            empty;
+    }
+}
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0.org/p_rgh b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0.org/p_rgh
new file mode 100644
index 0000000000000000000000000000000000000000..ec3ced07493af94af8b9d18d5cfcbcb35592d4c0
--- /dev/null
+++ b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0.org/p_rgh
@@ -0,0 +1,44 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       volScalarField;
+    object      p_rgh;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions      [1 -1 -2 0 0 0 0];
+
+internalField   uniform 0;
+
+boundaryField
+{
+    rotor
+    {
+        type            zeroGradient;
+    }
+
+    stator
+    {
+        type            zeroGradient;
+    }
+
+    front
+    {
+        type            empty;
+    }
+
+    back
+    {
+        type            empty;
+    }
+}
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0/U b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0/U
new file mode 100644
index 0000000000000000000000000000000000000000..db40c3524be99ad22819b153684093cf924401fe
--- /dev/null
+++ b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0/U
@@ -0,0 +1,45 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       volVectorField;
+    location    "0";
+    object      U;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions      [0 1 -1 0 0 0 0];
+
+internalField   uniform (0 0 0);
+
+boundaryField
+{
+    rotor
+    {
+        type            fixedValue;
+        value           uniform (0 0 0);
+    }
+    stator
+    {
+        type            fixedValue;
+        value           uniform (0 0 0);
+    }
+    front
+    {
+        type            empty;
+    }
+    back
+    {
+        type            empty;
+    }
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0/alphaair b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0/alphaair
new file mode 100644
index 0000000000000000000000000000000000000000..04ac6f69587ba476f3cbd287874b576f9b8852ee
--- /dev/null
+++ b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0/alphaair
@@ -0,0 +1,3119 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       volScalarField;
+    location    "0";
+    object      alphaair;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions      [0 0 0 0 0 0 0];
+
+internalField   nonuniform List<scalar>
+3072
+(
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+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+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+)
+;
+
+boundaryField
+{
+    rotor
+    {
+        type            zeroGradient;
+    }
+    stator
+    {
+        type            zeroGradient;
+    }
+    front
+    {
+        type            empty;
+    }
+    back
+    {
+        type            empty;
+    }
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0/alphamercury b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0/alphamercury
new file mode 100644
index 0000000000000000000000000000000000000000..02b45588beaea60d3907c6596a35c7bb77bcbb2a
--- /dev/null
+++ b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0/alphamercury
@@ -0,0 +1,3119 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       volScalarField;
+    location    "0";
+    object      alphamercury;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions      [0 0 0 0 0 0 0];
+
+internalField   nonuniform List<scalar>
+3072
+(
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0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        type            zeroGradient;
+    }
+    stator
+    {
+        type            zeroGradient;
+    }
+    front
+    {
+        type            empty;
+    }
+    back
+    {
+        type            empty;
+    }
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0/alphaoil b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0/alphaoil
new file mode 100644
index 0000000000000000000000000000000000000000..ce79d8dd6915f4b43964a432f886ca81f15ebe21
--- /dev/null
+++ b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0/alphaoil
@@ -0,0 +1,3119 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       volScalarField;
+    location    "0";
+    object      alphaoil;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions      [0 0 0 0 0 0 0];
+
+internalField   nonuniform List<scalar>
+3072
+(
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+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+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+)
+;
+
+boundaryField
+{
+    rotor
+    {
+        type            zeroGradient;
+    }
+    stator
+    {
+        type            zeroGradient;
+    }
+    front
+    {
+        type            empty;
+    }
+    back
+    {
+        type            empty;
+    }
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0/alphawater b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0/alphawater
new file mode 100644
index 0000000000000000000000000000000000000000..3a6f06133aac7adab63e59d20a7a5938fde685d3
--- /dev/null
+++ b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0/alphawater
@@ -0,0 +1,3119 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       volScalarField;
+    location    "0";
+    object      alphawater;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions      [0 0 0 0 0 0 0];
+
+internalField   nonuniform List<scalar>
+3072
+(
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0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1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+)
+;
+
+boundaryField
+{
+    rotor
+    {
+        type            zeroGradient;
+    }
+    stator
+    {
+        type            zeroGradient;
+    }
+    front
+    {
+        type            empty;
+    }
+    back
+    {
+        type            empty;
+    }
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0/p_rgh b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0/p_rgh
new file mode 100644
index 0000000000000000000000000000000000000000..ec3ced07493af94af8b9d18d5cfcbcb35592d4c0
--- /dev/null
+++ b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0/p_rgh
@@ -0,0 +1,44 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       volScalarField;
+    object      p_rgh;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions      [1 -1 -2 0 0 0 0];
+
+internalField   uniform 0;
+
+boundaryField
+{
+    rotor
+    {
+        type            zeroGradient;
+    }
+
+    stator
+    {
+        type            zeroGradient;
+    }
+
+    front
+    {
+        type            empty;
+    }
+
+    back
+    {
+        type            empty;
+    }
+}
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/Allclean b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/Allclean
new file mode 100755
index 0000000000000000000000000000000000000000..f3d1d6f14235e61bc3bfacf39b30049f8f5fd709
--- /dev/null
+++ b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/Allclean
@@ -0,0 +1,10 @@
+#!/bin/sh
+cd ${0%/*} || exit 1    # run from this directory
+
+# Source tutorial clean functions
+. $WM_PROJECT_DIR/bin/tools/CleanFunctions
+
+cleanCase
+rm 0/alphas > /dev/null 2>&1
+
+# ----------------------------------------------------------------- end-of-file
diff --git a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/Allrun b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/Allrun
new file mode 100755
index 0000000000000000000000000000000000000000..a718eaf7e662bad616179bd183caa9fd72de8b79
--- /dev/null
+++ b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/Allrun
@@ -0,0 +1,12 @@
+#!/bin/sh
+cd ${0%/*} || exit 1    # run from this directory
+
+# Source tutorial run functions
+. $WM_PROJECT_DIR/bin/tools/RunFunctions
+
+application=`getApplication`
+
+runApplication ./makeMesh
+runApplication $application
+
+# ----------------------------------------------------------------- end-of-file
diff --git a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/constant/MRFZones b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/constant/MRFZones
new file mode 100644
index 0000000000000000000000000000000000000000..4a5f7975975339d016fc14210d70cc3878ac8772
--- /dev/null
+++ b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/constant/MRFZones
@@ -0,0 +1,31 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       dictionary;
+    location    "constant";
+    object      MRFZones;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+1
+(
+    rotor
+    {
+        // Fixed patches (by default they 'move' with the MRF zone)
+        nonRotatingPatches ();
+
+        origin    origin [0 1 0 0 0 0 0]  (0 0 0);
+        axis      axis   [0 0 0 0 0 0 0]  (0 0 1);
+        omega     omega  [0 0 -1 0 0 0 0] 6.2831853;
+    }
+)
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/constant/g b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/constant/g
new file mode 100644
index 0000000000000000000000000000000000000000..137232c3b4a9ff1ab0ad36e10a30dde72fca4aaf
--- /dev/null
+++ b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/constant/g
@@ -0,0 +1,21 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       uniformDimensionedVectorField;
+    location    "constant";
+    object      g;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions      [0 1 -2 0 0 0 0];
+value           (0 0 0);
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/constant/polyMesh/blockMeshDict.m4 b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/constant/polyMesh/blockMeshDict.m4
new file mode 100644
index 0000000000000000000000000000000000000000..ce70bd9cfa3db03060b21f610aee806d51141d2a
--- /dev/null
+++ b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/constant/polyMesh/blockMeshDict.m4
@@ -0,0 +1,818 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    `format'      ascii;
+    class       dictionary;
+    object      blockMeshDict;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+// General macros to create 2D/extruded-2D meshes
+
+changecom(//)changequote([,])
+define(calc, [esyscmd(perl -e 'print ($1)')])
+define(VCOUNT, 0)
+define(vlabel, [[// ]Vertex $1 = VCOUNT define($1, VCOUNT)define([VCOUNT], incr(VCOUNT))])
+define(pi, 3.14159265)
+
+define(hex2D, hex ($1b $2b $3b $4b $1t $2t $3t $4t))
+define(quad2D, ($1b $2b $2t $1t))
+define(frontQuad, ($1t $2t $3t $4t))
+define(backQuad, ($1b $4b $3b $2b))
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+convertToMeters 0.1;
+
+// Hub radius
+define(r, 0.2)
+
+// Impeller-tip radius
+define(rb, 0.5)
+
+// Baffle-tip radius
+define(Rb, 0.7)
+
+// Tank radius
+define(R, 1)
+
+// MRF region radius
+define(ri, calc(0.5*(rb + Rb)))
+
+// Thickness of 2D slab
+define(z, 0.1)
+
+// Base z
+define(Zb, 0)
+
+// Top z
+define(Zt, calc(Zb + z))
+
+// Number of cells radially between hub and impeller tip
+define(Nr, 12)
+
+// Number of cells radially in each of the two regions between
+// impeller and baffle tips
+define(Ni, 4)
+
+// Number of cells radially between baffle tip and tank
+define(NR, 12)
+
+// Number of cells azimuthally in each of the 8 blocks
+define(Na, 12)
+
+// Number of cells in the thickness of the slab
+define(Nz, 1)
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+define(vert, (x$1$2 y$1$2 $3))
+define(evert, (ex$1$2 ey$1$2 $3))
+
+define(a0, 0)
+define(a1, -45)
+define(a2, -90)
+define(a3, -135)
+define(a4, 180)
+define(a5, 135)
+define(a6, 90)
+define(a7, 45)
+
+define(ea0, -22.5)
+define(ea1, -67.5)
+define(ea2, -112.5)
+define(ea3, -157.5)
+define(ea4, 157.5)
+define(ea5, 112.5)
+define(ea6, 67.5)
+define(ea7, 22.5)
+
+define(ca0, calc(cos((pi/180)*a0)))
+define(ca1, calc(cos((pi/180)*a1)))
+define(ca2, calc(cos((pi/180)*a2)))
+define(ca3, calc(cos((pi/180)*a3)))
+define(ca4, calc(cos((pi/180)*a4)))
+define(ca5, calc(cos((pi/180)*a5)))
+define(ca6, calc(cos((pi/180)*a6)))
+define(ca7, calc(cos((pi/180)*a7)))
+
+define(sa0, calc(sin((pi/180)*a0)))
+define(sa1, calc(sin((pi/180)*a1)))
+define(sa2, calc(sin((pi/180)*a2)))
+define(sa3, calc(sin((pi/180)*a3)))
+define(sa4, calc(sin((pi/180)*a4)))
+define(sa5, calc(sin((pi/180)*a5)))
+define(sa6, calc(sin((pi/180)*a6)))
+define(sa7, calc(sin((pi/180)*a7)))
+
+define(cea0, calc(cos((pi/180)*ea0)))
+define(cea1, calc(cos((pi/180)*ea1)))
+define(cea2, calc(cos((pi/180)*ea2)))
+define(cea3, calc(cos((pi/180)*ea3)))
+define(cea4, calc(cos((pi/180)*ea4)))
+define(cea5, calc(cos((pi/180)*ea5)))
+define(cea6, calc(cos((pi/180)*ea6)))
+define(cea7, calc(cos((pi/180)*ea7)))
+
+define(sea0, calc(sin((pi/180)*ea0)))
+define(sea1, calc(sin((pi/180)*ea1)))
+define(sea2, calc(sin((pi/180)*ea2)))
+define(sea3, calc(sin((pi/180)*ea3)))
+define(sea4, calc(sin((pi/180)*ea4)))
+define(sea5, calc(sin((pi/180)*ea5)))
+define(sea6, calc(sin((pi/180)*ea6)))
+define(sea7, calc(sin((pi/180)*ea7)))
+
+define(x00, calc(r*ca0))
+define(x01, calc(r*ca1))
+define(x02, calc(r*ca2))
+define(x03, calc(r*ca3))
+define(x04, calc(r*ca4))
+define(x05, calc(r*ca5))
+define(x06, calc(r*ca6))
+define(x07, calc(r*ca7))
+
+define(x10, calc(rb*ca0))
+define(x11, calc(rb*ca1))
+define(x12, calc(rb*ca2))
+define(x13, calc(rb*ca3))
+define(x14, calc(rb*ca4))
+define(x15, calc(rb*ca5))
+define(x16, calc(rb*ca6))
+define(x17, calc(rb*ca7))
+
+define(x20, calc(ri*ca0))
+define(x21, calc(ri*ca1))
+define(x22, calc(ri*ca2))
+define(x23, calc(ri*ca3))
+define(x24, calc(ri*ca4))
+define(x25, calc(ri*ca5))
+define(x26, calc(ri*ca6))
+define(x27, calc(ri*ca7))
+
+define(x30, calc(Rb*ca0))
+define(x31, calc(Rb*ca1))
+define(x32, calc(Rb*ca2))
+define(x33, calc(Rb*ca3))
+define(x34, calc(Rb*ca4))
+define(x35, calc(Rb*ca5))
+define(x36, calc(Rb*ca6))
+define(x37, calc(Rb*ca7))
+
+define(x40, calc(R*ca0))
+define(x41, calc(R*ca1))
+define(x42, calc(R*ca2))
+define(x43, calc(R*ca3))
+define(x44, calc(R*ca4))
+define(x45, calc(R*ca5))
+define(x46, calc(R*ca6))
+define(x47, calc(R*ca7))
+
+define(y00, calc(r*sa0))
+define(y01, calc(r*sa1))
+define(y02, calc(r*sa2))
+define(y03, calc(r*sa3))
+define(y04, calc(r*sa4))
+define(y05, calc(r*sa5))
+define(y06, calc(r*sa6))
+define(y07, calc(r*sa7))
+
+define(y10, calc(rb*sa0))
+define(y11, calc(rb*sa1))
+define(y12, calc(rb*sa2))
+define(y13, calc(rb*sa3))
+define(y14, calc(rb*sa4))
+define(y15, calc(rb*sa5))
+define(y16, calc(rb*sa6))
+define(y17, calc(rb*sa7))
+
+define(y20, calc(ri*sa0))
+define(y21, calc(ri*sa1))
+define(y22, calc(ri*sa2))
+define(y23, calc(ri*sa3))
+define(y24, calc(ri*sa4))
+define(y25, calc(ri*sa5))
+define(y26, calc(ri*sa6))
+define(y27, calc(ri*sa7))
+
+define(y30, calc(Rb*sa0))
+define(y31, calc(Rb*sa1))
+define(y32, calc(Rb*sa2))
+define(y33, calc(Rb*sa3))
+define(y34, calc(Rb*sa4))
+define(y35, calc(Rb*sa5))
+define(y36, calc(Rb*sa6))
+define(y37, calc(Rb*sa7))
+
+define(y40, calc(R*sa0))
+define(y41, calc(R*sa1))
+define(y42, calc(R*sa2))
+define(y43, calc(R*sa3))
+define(y44, calc(R*sa4))
+define(y45, calc(R*sa5))
+define(y46, calc(R*sa6))
+define(y47, calc(R*sa7))
+
+define(ex00, calc(r*cea0))
+define(ex01, calc(r*cea1))
+define(ex02, calc(r*cea2))
+define(ex03, calc(r*cea3))
+define(ex04, calc(r*cea4))
+define(ex05, calc(r*cea5))
+define(ex06, calc(r*cea6))
+define(ex07, calc(r*cea7))
+
+define(ex10, calc(rb*cea0))
+define(ex11, calc(rb*cea1))
+define(ex12, calc(rb*cea2))
+define(ex13, calc(rb*cea3))
+define(ex14, calc(rb*cea4))
+define(ex15, calc(rb*cea5))
+define(ex16, calc(rb*cea6))
+define(ex17, calc(rb*cea7))
+
+define(ex20, calc(ri*cea0))
+define(ex21, calc(ri*cea1))
+define(ex22, calc(ri*cea2))
+define(ex23, calc(ri*cea3))
+define(ex24, calc(ri*cea4))
+define(ex25, calc(ri*cea5))
+define(ex26, calc(ri*cea6))
+define(ex27, calc(ri*cea7))
+
+define(ex30, calc(Rb*cea0))
+define(ex31, calc(Rb*cea1))
+define(ex32, calc(Rb*cea2))
+define(ex33, calc(Rb*cea3))
+define(ex34, calc(Rb*cea4))
+define(ex35, calc(Rb*cea5))
+define(ex36, calc(Rb*cea6))
+define(ex37, calc(Rb*cea7))
+
+define(ex40, calc(R*cea0))
+define(ex41, calc(R*cea1))
+define(ex42, calc(R*cea2))
+define(ex43, calc(R*cea3))
+define(ex44, calc(R*cea4))
+define(ex45, calc(R*cea5))
+define(ex46, calc(R*cea6))
+define(ex47, calc(R*cea7))
+
+define(ey00, calc(r*sea0))
+define(ey01, calc(r*sea1))
+define(ey02, calc(r*sea2))
+define(ey03, calc(r*sea3))
+define(ey04, calc(r*sea4))
+define(ey05, calc(r*sea5))
+define(ey06, calc(r*sea6))
+define(ey07, calc(r*sea7))
+
+define(ey10, calc(rb*sea0))
+define(ey11, calc(rb*sea1))
+define(ey12, calc(rb*sea2))
+define(ey13, calc(rb*sea3))
+define(ey14, calc(rb*sea4))
+define(ey15, calc(rb*sea5))
+define(ey16, calc(rb*sea6))
+define(ey17, calc(rb*sea7))
+
+define(ey20, calc(ri*sea0))
+define(ey21, calc(ri*sea1))
+define(ey22, calc(ri*sea2))
+define(ey23, calc(ri*sea3))
+define(ey24, calc(ri*sea4))
+define(ey25, calc(ri*sea5))
+define(ey26, calc(ri*sea6))
+define(ey27, calc(ri*sea7))
+
+define(ey30, calc(Rb*sea0))
+define(ey31, calc(Rb*sea1))
+define(ey32, calc(Rb*sea2))
+define(ey33, calc(Rb*sea3))
+define(ey34, calc(Rb*sea4))
+define(ey35, calc(Rb*sea5))
+define(ey36, calc(Rb*sea6))
+define(ey37, calc(Rb*sea7))
+
+define(ey40, calc(R*sea0))
+define(ey41, calc(R*sea1))
+define(ey42, calc(R*sea2))
+define(ey43, calc(R*sea3))
+define(ey44, calc(R*sea4))
+define(ey45, calc(R*sea5))
+define(ey46, calc(R*sea6))
+define(ey47, calc(R*sea7))
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+vertices
+(
+    vert(0, 0, Zb) vlabel(r0b)
+    vert(0, 0, Zb) vlabel(r0sb)
+    vert(0, 1, Zb) vlabel(r1b)
+    vert(0, 2, Zb) vlabel(r2b)
+    vert(0, 2, Zb) vlabel(r2sb)
+    vert(0, 3, Zb) vlabel(r3b)
+    vert(0, 4, Zb) vlabel(r4b)
+    vert(0, 4, Zb) vlabel(r4sb)
+    vert(0, 5, Zb) vlabel(r5b)
+    vert(0, 6, Zb) vlabel(r6b)
+    vert(0, 6, Zb) vlabel(r6sb)
+    vert(0, 7, Zb) vlabel(r7b)
+
+    vert(1, 0, Zb) vlabel(rb0b)
+    vert(1, 1, Zb) vlabel(rb1b)
+    vert(1, 2, Zb) vlabel(rb2b)
+    vert(1, 3, Zb) vlabel(rb3b)
+    vert(1, 4, Zb) vlabel(rb4b)
+    vert(1, 5, Zb) vlabel(rb5b)
+    vert(1, 6, Zb) vlabel(rb6b)
+    vert(1, 7, Zb) vlabel(rb7b)
+
+    vert(2, 0, Zb) vlabel(ri0b)
+    vert(2, 1, Zb) vlabel(ri1b)
+    vert(2, 2, Zb) vlabel(ri2b)
+    vert(2, 3, Zb) vlabel(ri3b)
+    vert(2, 4, Zb) vlabel(ri4b)
+    vert(2, 5, Zb) vlabel(ri5b)
+    vert(2, 6, Zb) vlabel(ri6b)
+    vert(2, 7, Zb) vlabel(ri7b)
+
+    vert(3, 0, Zb) vlabel(Rb0b)
+    vert(3, 1, Zb) vlabel(Rb1b)
+    vert(3, 2, Zb) vlabel(Rb2b)
+    vert(3, 3, Zb) vlabel(Rb3b)
+    vert(3, 4, Zb) vlabel(Rb4b)
+    vert(3, 5, Zb) vlabel(Rb5b)
+    vert(3, 6, Zb) vlabel(Rb6b)
+    vert(3, 7, Zb) vlabel(Rb7b)
+
+    vert(4, 0, Zb) vlabel(R0b)
+    vert(4, 1, Zb) vlabel(R1b)
+    vert(4, 1, Zb) vlabel(R1sb)
+    vert(4, 2, Zb) vlabel(R2b)
+    vert(4, 3, Zb) vlabel(R3b)
+    vert(4, 3, Zb) vlabel(R3sb)
+    vert(4, 4, Zb) vlabel(R4b)
+    vert(4, 5, Zb) vlabel(R5b)
+    vert(4, 5, Zb) vlabel(R5sb)
+    vert(4, 6, Zb) vlabel(R6b)
+    vert(4, 7, Zb) vlabel(R7b)
+    vert(4, 7, Zb) vlabel(R7sb)
+
+    vert(0, 0, Zt) vlabel(r0t)
+    vert(0, 0, Zt) vlabel(r0st)
+    vert(0, 1, Zt) vlabel(r1t)
+    vert(0, 2, Zt) vlabel(r2t)
+    vert(0, 2, Zt) vlabel(r2st)
+    vert(0, 3, Zt) vlabel(r3t)
+    vert(0, 4, Zt) vlabel(r4t)
+    vert(0, 4, Zt) vlabel(r4st)
+    vert(0, 5, Zt) vlabel(r5t)
+    vert(0, 6, Zt) vlabel(r6t)
+    vert(0, 6, Zt) vlabel(r6st)
+    vert(0, 7, Zt) vlabel(r7t)
+
+    vert(1, 0, Zt) vlabel(rb0t)
+    vert(1, 1, Zt) vlabel(rb1t)
+    vert(1, 2, Zt) vlabel(rb2t)
+    vert(1, 3, Zt) vlabel(rb3t)
+    vert(1, 4, Zt) vlabel(rb4t)
+    vert(1, 5, Zt) vlabel(rb5t)
+    vert(1, 6, Zt) vlabel(rb6t)
+    vert(1, 7, Zt) vlabel(rb7t)
+
+    vert(2, 0, Zt) vlabel(ri0t)
+    vert(2, 1, Zt) vlabel(ri1t)
+    vert(2, 2, Zt) vlabel(ri2t)
+    vert(2, 3, Zt) vlabel(ri3t)
+    vert(2, 4, Zt) vlabel(ri4t)
+    vert(2, 5, Zt) vlabel(ri5t)
+    vert(2, 6, Zt) vlabel(ri6t)
+    vert(2, 7, Zt) vlabel(ri7t)
+
+    vert(3, 0, Zt) vlabel(Rb0t)
+    vert(3, 1, Zt) vlabel(Rb1t)
+    vert(3, 2, Zt) vlabel(Rb2t)
+    vert(3, 3, Zt) vlabel(Rb3t)
+    vert(3, 4, Zt) vlabel(Rb4t)
+    vert(3, 5, Zt) vlabel(Rb5t)
+    vert(3, 6, Zt) vlabel(Rb6t)
+    vert(3, 7, Zt) vlabel(Rb7t)
+
+    vert(4, 0, Zt) vlabel(R0t)
+    vert(4, 1, Zt) vlabel(R1t)
+    vert(4, 1, Zt) vlabel(R1st)
+    vert(4, 2, Zt) vlabel(R2t)
+    vert(4, 3, Zt) vlabel(R3t)
+    vert(4, 3, Zt) vlabel(R3st)
+    vert(4, 4, Zt) vlabel(R4t)
+    vert(4, 5, Zt) vlabel(R5t)
+    vert(4, 5, Zt) vlabel(R5st)
+    vert(4, 6, Zt) vlabel(R6t)
+    vert(4, 7, Zt) vlabel(R7t)
+    vert(4, 7, Zt) vlabel(R7st)
+);
+
+blocks
+(
+    // block0
+    hex2D(r0, r1, rb1, rb0)
+    rotor
+    (Na Nr Nz)
+    simpleGrading (1 1 1)
+
+    // block1
+    hex2D(r1, r2s, rb2, rb1)
+    rotor
+    (Na Nr Nz)
+    simpleGrading (1 1 1)
+
+    // block2
+    hex2D(r2, r3, rb3, rb2)
+    rotor
+    (Na Nr Nz)
+    simpleGrading (1 1 1)
+
+    // block3
+    hex2D(r3, r4s, rb4, rb3)
+    rotor
+    (Na Nr Nz)
+    simpleGrading (1 1 1)
+
+    // block4
+    hex2D(r4, r5, rb5, rb4)
+    rotor
+    (Na Nr Nz)
+    simpleGrading (1 1 1)
+
+    // block5
+    hex2D(r5, r6s, rb6, rb5)
+    rotor
+    (Na Nr Nz)
+    simpleGrading (1 1 1)
+
+    // block6
+    hex2D(r6, r7, rb7, rb6)
+    rotor
+    (Na Nr Nz)
+    simpleGrading (1 1 1)
+
+    // block7
+    hex2D(r7, r0s, rb0, rb7)
+    rotor
+    (Na Nr Nz)
+    simpleGrading (1 1 1)
+
+    // block0
+    hex2D(rb0, rb1, ri1, ri0)
+    rotor
+    (Na Ni Nz)
+    simpleGrading (1 1 1)
+
+    // block1
+    hex2D(rb1, rb2, ri2, ri1)
+    rotor
+    (Na Ni Nz)
+    simpleGrading (1 1 1)
+
+    // block2
+    hex2D(rb2, rb3, ri3, ri2)
+    rotor
+    (Na Ni Nz)
+    simpleGrading (1 1 1)
+
+    // block3
+    hex2D(rb3, rb4, ri4, ri3)
+    rotor
+    (Na Ni Nz)
+    simpleGrading (1 1 1)
+
+    // block4
+    hex2D(rb4, rb5, ri5, ri4)
+    rotor
+    (Na Ni Nz)
+    simpleGrading (1 1 1)
+
+    // block5
+    hex2D(rb5, rb6, ri6, ri5)
+    rotor
+    (Na Ni Nz)
+    simpleGrading (1 1 1)
+
+    // block6
+    hex2D(rb6, rb7, ri7, ri6)
+    rotor
+    (Na Ni Nz)
+    simpleGrading (1 1 1)
+
+    // block7
+    hex2D(rb7, rb0, ri0, ri7)
+    rotor
+    (Na Ni Nz)
+    simpleGrading (1 1 1)
+
+    // block0
+    hex2D(ri0, ri1, Rb1, Rb0)
+    (Na Ni Nz)
+    simpleGrading (1 1 1)
+
+    // block1
+    hex2D(ri1, ri2, Rb2, Rb1)
+    (Na Ni Nz)
+    simpleGrading (1 1 1)
+
+    // block2
+    hex2D(ri2, ri3, Rb3, Rb2)
+    (Na Ni Nz)
+    simpleGrading (1 1 1)
+
+    // block3
+    hex2D(ri3, ri4, Rb4, Rb3)
+    (Na Ni Nz)
+    simpleGrading (1 1 1)
+
+    // block4
+    hex2D(ri4, ri5, Rb5, Rb4)
+    (Na Ni Nz)
+    simpleGrading (1 1 1)
+
+    // block5
+    hex2D(ri5, ri6, Rb6, Rb5)
+    (Na Ni Nz)
+    simpleGrading (1 1 1)
+
+    // block6
+    hex2D(ri6, ri7, Rb7, Rb6)
+    (Na Ni Nz)
+    simpleGrading (1 1 1)
+
+    // block7
+    hex2D(ri7, ri0, Rb0, Rb7)
+    (Na Ni Nz)
+    simpleGrading (1 1 1)
+
+    // block0
+    hex2D(Rb0, Rb1, R1s, R0)
+    (Na NR Nz)
+    simpleGrading (1 1 1)
+
+    // block1
+    hex2D(Rb1, Rb2, R2, R1)
+    (Na NR Nz)
+    simpleGrading (1 1 1)
+
+    // block2
+    hex2D(Rb2, Rb3, R3s, R2)
+    (Na NR Nz)
+    simpleGrading (1 1 1)
+
+    // block3
+    hex2D(Rb3, Rb4, R4, R3)
+    (Na NR Nz)
+    simpleGrading (1 1 1)
+
+    // block4
+    hex2D(Rb4, Rb5, R5s, R4)
+    (Na NR Nz)
+    simpleGrading (1 1 1)
+
+    // block5
+    hex2D(Rb5, Rb6, R6, R5)
+    (Na NR Nz)
+    simpleGrading (1 1 1)
+
+    // block6
+    hex2D(Rb6, Rb7, R7s, R6)
+    (Na NR Nz)
+    simpleGrading (1 1 1)
+
+    // block7
+    hex2D(Rb7, Rb0, R0, R7)
+    (Na NR Nz)
+    simpleGrading (1 1 1)
+);
+
+edges
+(
+    arc r0b r1b evert(0, 0, Zb)
+    arc r1b r2sb evert(0, 1, Zb)
+    arc r2b r3b evert(0, 2, Zb)
+    arc r3b r4sb evert(0, 3, Zb)
+    arc r4b r5b evert(0, 4, Zb)
+    arc r5b r6sb evert(0, 5, Zb)
+    arc r6b r7b evert(0, 6, Zb)
+    arc r7b r0sb evert(0, 7, Zb)
+
+    arc rb0b rb1b evert(1, 0, Zb)
+    arc rb1b rb2b evert(1, 1, Zb)
+    arc rb2b rb3b evert(1, 2, Zb)
+    arc rb3b rb4b evert(1, 3, Zb)
+    arc rb4b rb5b evert(1, 4, Zb)
+    arc rb5b rb6b evert(1, 5, Zb)
+    arc rb6b rb7b evert(1, 6, Zb)
+    arc rb7b rb0b evert(1, 7, Zb)
+
+    arc ri0b ri1b evert(2, 0, Zb)
+    arc ri1b ri2b evert(2, 1, Zb)
+    arc ri2b ri3b evert(2, 2, Zb)
+    arc ri3b ri4b evert(2, 3, Zb)
+    arc ri4b ri5b evert(2, 4, Zb)
+    arc ri5b ri6b evert(2, 5, Zb)
+    arc ri6b ri7b evert(2, 6, Zb)
+    arc ri7b ri0b evert(2, 7, Zb)
+
+    arc Rb0b Rb1b evert(3, 0, Zb)
+    arc Rb1b Rb2b evert(3, 1, Zb)
+    arc Rb2b Rb3b evert(3, 2, Zb)
+    arc Rb3b Rb4b evert(3, 3, Zb)
+    arc Rb4b Rb5b evert(3, 4, Zb)
+    arc Rb5b Rb6b evert(3, 5, Zb)
+    arc Rb6b Rb7b evert(3, 6, Zb)
+    arc Rb7b Rb0b evert(3, 7, Zb)
+
+    arc R0b R1sb evert(4, 0, Zb)
+    arc R1b R2b evert(4, 1, Zb)
+    arc R2b R3sb evert(4, 2, Zb)
+    arc R3b R4b evert(4, 3, Zb)
+    arc R4b R5sb evert(4, 4, Zb)
+    arc R5b R6b evert(4, 5, Zb)
+    arc R6b R7sb evert(4, 6, Zb)
+    arc R7b R0b evert(4, 7, Zb)
+
+    arc r0t r1t evert(0, 0, Zt)
+    arc r1t r2st evert(0, 1, Zt)
+    arc r2t r3t evert(0, 2, Zt)
+    arc r3t r4st evert(0, 3, Zt)
+    arc r4t r5t evert(0, 4, Zt)
+    arc r5t r6st evert(0, 5, Zt)
+    arc r6t r7t evert(0, 6, Zt)
+    arc r7t r0st evert(0, 7, Zt)
+
+    arc rb0t rb1t evert(1, 0, Zt)
+    arc rb1t rb2t evert(1, 1, Zt)
+    arc rb2t rb3t evert(1, 2, Zt)
+    arc rb3t rb4t evert(1, 3, Zt)
+    arc rb4t rb5t evert(1, 4, Zt)
+    arc rb5t rb6t evert(1, 5, Zt)
+    arc rb6t rb7t evert(1, 6, Zt)
+    arc rb7t rb0t evert(1, 7, Zt)
+
+    arc ri0t ri1t evert(2, 0, Zt)
+    arc ri1t ri2t evert(2, 1, Zt)
+    arc ri2t ri3t evert(2, 2, Zt)
+    arc ri3t ri4t evert(2, 3, Zt)
+    arc ri4t ri5t evert(2, 4, Zt)
+    arc ri5t ri6t evert(2, 5, Zt)
+    arc ri6t ri7t evert(2, 6, Zt)
+    arc ri7t ri0t evert(2, 7, Zt)
+
+    arc Rb0t Rb1t evert(3, 0, Zt)
+    arc Rb1t Rb2t evert(3, 1, Zt)
+    arc Rb2t Rb3t evert(3, 2, Zt)
+    arc Rb3t Rb4t evert(3, 3, Zt)
+    arc Rb4t Rb5t evert(3, 4, Zt)
+    arc Rb5t Rb6t evert(3, 5, Zt)
+    arc Rb6t Rb7t evert(3, 6, Zt)
+    arc Rb7t Rb0t evert(3, 7, Zt)
+
+    arc R0t R1st evert(4, 0, Zt)
+    arc R1t R2t evert(4, 1, Zt)
+    arc R2t R3st evert(4, 2, Zt)
+    arc R3t R4t evert(4, 3, Zt)
+    arc R4t R5st evert(4, 4, Zt)
+    arc R5t R6t evert(4, 5, Zt)
+    arc R6t R7st evert(4, 6, Zt)
+    arc R7t R0t evert(4, 7, Zt)
+);
+
+patches
+(
+    wall rotor
+    (
+        quad2D(r0, r1)
+        quad2D(r1, r2s)
+        quad2D(r2, r3)
+        quad2D(r3, r4s)
+        quad2D(r4, r5)
+        quad2D(r5, r6s)
+        quad2D(r6, r7)
+        quad2D(r7, r0s)
+
+        quad2D(r0, rb0)
+        quad2D(r0s, rb0)
+
+        quad2D(r2, rb2)
+        quad2D(r2s, rb2)
+
+        quad2D(r4, rb4)
+        quad2D(r4s, rb4)
+
+        quad2D(r6, rb6)
+        quad2D(r6s, rb6)
+    )
+
+    wall stator
+    (
+        quad2D(R0, R1s)
+        quad2D(R1, R2)
+        quad2D(R2, R3s)
+        quad2D(R3, R4)
+        quad2D(R4, R5s)
+        quad2D(R5, R6)
+        quad2D(R6, R7s)
+        quad2D(R7, R0)
+
+        quad2D(R1, Rb1)
+        quad2D(R1s, Rb1)
+
+        quad2D(R3, Rb3)
+        quad2D(R3s, Rb3)
+
+        quad2D(R5, Rb5)
+        quad2D(R5s, Rb5)
+
+        quad2D(R7, Rb7)
+        quad2D(R7s, Rb7)
+    )
+
+    empty front
+    (
+        frontQuad(r0, r1, rb1, rb0)
+        frontQuad(r1, r2s, rb2, rb1)
+        frontQuad(r2, r3, rb3, rb2)
+        frontQuad(r3, r4s, rb4, rb3)
+        frontQuad(r4, r5, rb5, rb4)
+        frontQuad(r5, r6s, rb6, rb5)
+        frontQuad(r6, r7, rb7, rb6)
+        frontQuad(r7, r0s, rb0, rb7)
+        frontQuad(rb0, rb1, ri1, ri0)
+        frontQuad(rb1, rb2, ri2, ri1)
+        frontQuad(rb2, rb3, ri3, ri2)
+        frontQuad(rb3, rb4, ri4, ri3)
+        frontQuad(rb4, rb5, ri5, ri4)
+        frontQuad(rb5, rb6, ri6, ri5)
+        frontQuad(rb6, rb7, ri7, ri6)
+        frontQuad(rb7, rb0, ri0, ri7)
+        frontQuad(ri0, ri1, Rb1, Rb0)
+        frontQuad(ri1, ri2, Rb2, Rb1)
+        frontQuad(ri2, ri3, Rb3, Rb2)
+        frontQuad(ri3, ri4, Rb4, Rb3)
+        frontQuad(ri4, ri5, Rb5, Rb4)
+        frontQuad(ri5, ri6, Rb6, Rb5)
+        frontQuad(ri6, ri7, Rb7, Rb6)
+        frontQuad(ri7, ri0, Rb0, Rb7)
+        frontQuad(Rb0, Rb1, R1s, R0)
+        frontQuad(Rb1, Rb2, R2, R1)
+        frontQuad(Rb2, Rb3, R3s, R2)
+        frontQuad(Rb3, Rb4, R4, R3)
+        frontQuad(Rb4, Rb5, R5s, R4)
+        frontQuad(Rb5, Rb6, R6, R5)
+        frontQuad(Rb6, Rb7, R7s, R6)
+        frontQuad(Rb7, Rb0, R0, R7)
+    )
+
+    empty back
+    (
+        backQuad(r0, r1, rb1, rb0)
+        backQuad(r1, r2s, rb2, rb1)
+        backQuad(r2, r3, rb3, rb2)
+        backQuad(r3, r4s, rb4, rb3)
+        backQuad(r4, r5, rb5, rb4)
+        backQuad(r5, r6s, rb6, rb5)
+        backQuad(r6, r7, rb7, rb6)
+        backQuad(r7, r0s, rb0, rb7)
+        backQuad(rb0, rb1, ri1, ri0)
+        backQuad(rb1, rb2, ri2, ri1)
+        backQuad(rb2, rb3, ri3, ri2)
+        backQuad(rb3, rb4, ri4, ri3)
+        backQuad(rb4, rb5, ri5, ri4)
+        backQuad(rb5, rb6, ri6, ri5)
+        backQuad(rb6, rb7, ri7, ri6)
+        backQuad(rb7, rb0, ri0, ri7)
+        backQuad(ri0, ri1, Rb1, Rb0)
+        backQuad(ri1, ri2, Rb2, Rb1)
+        backQuad(ri2, ri3, Rb3, Rb2)
+        backQuad(ri3, ri4, Rb4, Rb3)
+        backQuad(ri4, ri5, Rb5, Rb4)
+        backQuad(ri5, ri6, Rb6, Rb5)
+        backQuad(ri6, ri7, Rb7, Rb6)
+        backQuad(ri7, ri0, Rb0, Rb7)
+        backQuad(Rb0, Rb1, R1s, R0)
+        backQuad(Rb1, Rb2, R2, R1)
+        backQuad(Rb2, Rb3, R3s, R2)
+        backQuad(Rb3, Rb4, R4, R3)
+        backQuad(Rb4, Rb5, R5s, R4)
+        backQuad(Rb5, Rb6, R6, R5)
+        backQuad(Rb6, Rb7, R7s, R6)
+        backQuad(Rb7, Rb0, R0, R7)
+    )
+);
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/constant/polyMesh/boundary b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/constant/polyMesh/boundary
new file mode 100644
index 0000000000000000000000000000000000000000..95db810428a928fdaf647449a8daa21fa4ccbbae
--- /dev/null
+++ b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/constant/polyMesh/boundary
@@ -0,0 +1,46 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       polyBoundaryMesh;
+    location    "constant/polyMesh";
+    object      boundary;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+4
+(
+    rotor
+    {
+        type            wall;
+        nFaces          192;
+        startFace       5952;
+    }
+    stator
+    {
+        type            wall;
+        nFaces          192;
+        startFace       6144;
+    }
+    front
+    {
+        type            empty;
+        nFaces          3072;
+        startFace       6336;
+    }
+    back
+    {
+        type            empty;
+        nFaces          3072;
+        startFace       9408;
+    }
+)
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/constant/transportProperties b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/constant/transportProperties
new file mode 100644
index 0000000000000000000000000000000000000000..b9f39d0fdf32e2a4955b2e92683d21b5c00a148b
--- /dev/null
+++ b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/constant/transportProperties
@@ -0,0 +1,62 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       dictionary;
+    location    "constant";
+    object      transportProperties;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+phases
+(
+     water
+     {
+         transportModel Newtonian;
+         nu nu [ 0 2 -1 0 0 0 0 ] 1e-06;
+         rho rho [ 1 -3 0 0 0 0 0 ] 1000;
+     }
+
+     oil
+     {
+         transportModel Newtonian;
+         nu nu [ 0 2 -1 0 0 0 0 ] 1e-06;
+         rho rho [ 1 -3 0 0 0 0 0 ] 500;
+     }
+
+     mercury
+     {
+         transportModel Newtonian;
+         nu nu [ 0 2 -1 0 0 0 0 ] 1.125e-07;
+         rho rho [ 1 -3 0 0 0 0 0 ] 13529;
+     }
+
+     air
+     {
+         transportModel Newtonian;
+         nu nu [ 0 2 -1 0 0 0 0 ] 1.48e-05;
+         rho rho [ 1 -3 0 0 0 0 0 ] 1;
+     }
+);
+
+refPhase        air;
+
+sigmas
+(
+    (air water) 0.07
+    (air oil) 0.07
+    (air mercury) 0.07
+    (water oil) 0.07
+    (water mercury) 0.07
+    (oil mercury) 0.07
+);
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/constant/turbulenceProperties b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/constant/turbulenceProperties
new file mode 100644
index 0000000000000000000000000000000000000000..d0a0998654c0e013d16bc1b9e58e51ff26d40edc
--- /dev/null
+++ b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/constant/turbulenceProperties
@@ -0,0 +1,21 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       dictionary;
+    location    "constant";
+    object      turbulenceProperties;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+simulationType  laminar;
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/makeMesh b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/makeMesh
new file mode 100755
index 0000000000000000000000000000000000000000..8ef4993fdebc0faac8bb6c69426059aba4b3faac
--- /dev/null
+++ b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/makeMesh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+m4 < constant/polyMesh/blockMeshDict.m4 > constant/polyMesh/blockMeshDict
+blockMesh
+topoSet
+setsToZones -noFlipMap
diff --git a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/system/controlDict b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/system/controlDict
new file mode 100644
index 0000000000000000000000000000000000000000..4c8aef9522c9a9c7afe18309e922e1fb1a6d6126
--- /dev/null
+++ b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/system/controlDict
@@ -0,0 +1,56 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       dictionary;
+    location    "system";
+    object      controlDict;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+application     MRFMultiphaseInterFoam;
+
+startFrom       startTime;
+
+startTime       0;
+
+stopAt          endTime;
+
+endTime         4;
+
+deltaT          1e-3;
+
+writeControl    adjustableRunTime;
+
+writeInterval   0.125;
+
+purgeWrite      0;
+
+writeFormat     ascii;
+
+writePrecision  6;
+
+writeCompression uncompressed;
+
+timeFormat      general;
+
+timePrecision   6;
+
+runTimeModifiable yes;
+
+adjustTimeStep  yes;
+
+maxCo           0.5;
+maxAlphaCo      0.5;
+
+maxDeltaT       1;
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/system/fvSchemes b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/system/fvSchemes
new file mode 100644
index 0000000000000000000000000000000000000000..bff3afbcc5440ec1630f4b6a403331b0366dd564
--- /dev/null
+++ b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/system/fvSchemes
@@ -0,0 +1,59 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       dictionary;
+    location    "system";
+    object      fvSchemes;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+ddtSchemes
+{
+    default         Euler;
+}
+
+gradSchemes
+{
+    default         Gauss linear;
+}
+
+divSchemes
+{
+    div(rho*phi,U)  Gauss limitedLinearV 1;
+    div(phi,alpha)  Gauss vanLeer;
+    div(phirb,alpha) Gauss interfaceCompression;
+}
+
+laplacianSchemes
+{
+    default         Gauss linear corrected;
+}
+
+interpolationSchemes
+{
+    default         linear;
+}
+
+snGradSchemes
+{
+    default         corrected;
+}
+
+fluxRequired
+{
+    default         no;
+    pcorr;
+    p_rgh;
+    "alpha.*";
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/system/fvSolution b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/system/fvSolution
new file mode 100644
index 0000000000000000000000000000000000000000..40a896ac8a67a0c262a979d742f71506e1638bcf
--- /dev/null
+++ b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/system/fvSolution
@@ -0,0 +1,71 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       dictionary;
+    location    "system";
+    object      fvSolution;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+solvers
+{
+    pcorr
+    {
+        solver          PCG;
+        preconditioner  DIC;
+        tolerance       1e-10;
+        relTol          0;
+    }
+
+    p_rgh
+    {
+        solver          PCG;
+        preconditioner  DIC;
+        tolerance       1e-07;
+        relTol          0.05;
+    }
+
+    p_rghFinal
+    {
+        solver          PCG;
+        preconditioner  DIC;
+        tolerance       1e-07;
+        relTol          0;
+    }
+
+    "(U|alpha)"
+    {
+        solver          PBiCG;
+        preconditioner  DILU;
+        tolerance       1e-06;
+        relTol          0;
+    }
+}
+
+PISO
+{
+    momentumPredictor no;
+    nCorrectors     4;
+    nNonOrthogonalCorrectors 0;
+    nAlphaCorr      4;
+    nAlphaSubCycles 4;
+    cycleAlpha      yes;
+    cAlpha          2;
+    pRefCell        0;
+    pRefValue       0;
+}
+
+relaxationFactors
+{
+    U 1;
+}
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/system/setFieldsDict b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/system/setFieldsDict
new file mode 100644
index 0000000000000000000000000000000000000000..ab58790aac39e709e3688a33511339e5b3f990e2
--- /dev/null
+++ b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/system/setFieldsDict
@@ -0,0 +1,64 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       dictionary;
+    location    "system";
+    object      setFieldsDict;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+defaultFieldValues
+(
+    volScalarFieldValue alphaair 1
+    volScalarFieldValue alphawater 0
+    volScalarFieldValue alphaoil 0
+    volScalarFieldValue alphamercury 0
+);
+
+regions
+(
+    boxToCell
+    {
+        box (0 0 -1) (1 1 1);
+        fieldValues
+        (
+            volScalarFieldValue alphawater 1
+            volScalarFieldValue alphaoil 0
+            volScalarFieldValue alphamercury 0
+            volScalarFieldValue alphaair 0
+        );
+    }
+    boxToCell
+    {
+        box (0 -1 -1) (1 0 1);
+        fieldValues
+        (
+            volScalarFieldValue alphawater 0
+            volScalarFieldValue alphaoil 1
+            volScalarFieldValue alphamercury 0
+            volScalarFieldValue alphaair 0
+        );
+    }
+    boxToCell
+    {
+        box (-1 -1 -1) (0 0 1);
+        fieldValues
+        (
+            volScalarFieldValue alphawater 0
+            volScalarFieldValue alphaoil 0
+            volScalarFieldValue alphamercury 1
+            volScalarFieldValue alphaair 0
+        );
+    }
+);
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/topoSetDict b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/system/topoSetDict
similarity index 87%
rename from tutorials/multiphase/interFoam/les/nozzleFlow2D/system/topoSetDict
rename to tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/system/topoSetDict
index d6b1cfddc1f7f1b31f3906bc90947e6cced68946..8ffd2980bf96b035d80897bdbf2ee24261b1f58b 100644
--- a/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/topoSetDict
+++ b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/system/topoSetDict
@@ -11,23 +11,22 @@ FoamFile
     format      ascii;
     class       dictionary;
     location    "system";
-    object      topoSetDict.2;
+    object      topoSetDict;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 actions
 (
     {
-        name    c0;
+        name    rotor;
         type    cellSet;
         action  new;
-        source  boxToCell;
+        source  zoneToCell;
         sourceInfo
         {
-            box ( 0 0 -2e-05 ) ( 0.0036 0.0003 2e-05 );
+            name rotor;
         }
     }
 );
 
-
 // ************************************************************************* //
diff --git a/tutorials/multiphase/bubbleFoam/bubbleColumn/system/controlDict b/tutorials/multiphase/bubbleFoam/bubbleColumn/system/controlDict
index 3e4896371bf51602407ffebfdcfd374223a10955..9e8d5de69dc8e5cea5b1c331e296c1ec59fed867 100644
--- a/tutorials/multiphase/bubbleFoam/bubbleColumn/system/controlDict
+++ b/tutorials/multiphase/bubbleFoam/bubbleColumn/system/controlDict
@@ -37,13 +37,13 @@ writeFormat     ascii;
 
 writePrecision  6;
 
-writeCompression off;
+writeCompression uncompressed;
 
 timeFormat      general;
 
 timePrecision   6;
 
-runTimeModifiable true;
+runTimeModifiable yes;
 
 
 // ************************************************************************* //
diff --git a/tutorials/multiphase/cavitatingFoam/les/Allrun b/tutorials/multiphase/cavitatingFoam/les/Allrun
index 2cf6a091a2f8b0f7ba1449ce22397946414ab3e6..9fe67390bd4ae381c0129a7085c5b58367efcf7c 100755
--- a/tutorials/multiphase/cavitatingFoam/les/Allrun
+++ b/tutorials/multiphase/cavitatingFoam/les/Allrun
@@ -40,7 +40,7 @@ refineMeshByCellSet()
     refineMeshByCellSet 1 2 3
 
     echo "mapping fields from 2D throttle case"
-    mapFields ../throttle -sourceTime latestTime >& log.mapFields
+    mapFields ../throttle -sourceTime latestTime > log.mapFields 2>&1
 
     runApplication decomposePar
     runParallel $application 4
diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle/system/controlDict b/tutorials/multiphase/cavitatingFoam/les/throttle/system/controlDict
index d7b0b4d0d5d64dee2faada18ac5171cf517191d0..5e0a946e3b241275465adca8264c42d579815e64 100644
--- a/tutorials/multiphase/cavitatingFoam/les/throttle/system/controlDict
+++ b/tutorials/multiphase/cavitatingFoam/les/throttle/system/controlDict
@@ -37,13 +37,13 @@ writeFormat     binary;
 
 writePrecision  6;
 
-writeCompression off;
+writeCompression compressed;
 
 timeFormat      general;
 
-runTimeModifiable true;
+runTimeModifiable yes;
 
-adjustTimeStep  yes;
+adjustTimeStep  on;
 
 maxCo           0.5;
 
@@ -57,7 +57,6 @@ functions
         functionObjectLibs ( "libfieldFunctionObjects.so" );
         enabled         false;
         outputControl   outputTime;
-
         fields
         (
             U
@@ -84,4 +83,5 @@ functions
     }
 }
 
+
 // ************************************************************************* //
diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle/system/topoSetDict.1 b/tutorials/multiphase/cavitatingFoam/les/throttle/system/topoSetDict.1
index 5ee41b5fd08950fde3c89f3e1e6bdc01214a77f1..26a7d17f9c28e6c326dd549ac9787e5c1bdd5ada 100644
--- a/tutorials/multiphase/cavitatingFoam/les/throttle/system/topoSetDict.1
+++ b/tutorials/multiphase/cavitatingFoam/les/throttle/system/topoSetDict.1
@@ -18,10 +18,10 @@ FoamFile
 actions
 (
     {
-        name            c0;
-        type            cellSet;
-        action          new;
-        source          boxToCell;
+        name    c0;
+        type    cellSet;
+        action  new;
+        source  boxToCell;
         sourceInfo
         {
             box (0.004 -0.001 -1) (0.012 0.001 1);
@@ -29,5 +29,4 @@ actions
     }
 );
 
-
 // ************************************************************************* //
diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle/system/topoSetDict.2 b/tutorials/multiphase/cavitatingFoam/les/throttle/system/topoSetDict.2
index 6e9751c50668d735082d5f09616792a660e8ea45..ada32184c9d5513e5d65050952bec64a5b0a86db 100644
--- a/tutorials/multiphase/cavitatingFoam/les/throttle/system/topoSetDict.2
+++ b/tutorials/multiphase/cavitatingFoam/les/throttle/system/topoSetDict.2
@@ -18,10 +18,10 @@ FoamFile
 actions
 (
     {
-        name            c0;
-        type            cellSet;
-        action          new;
-        source          boxToCell;
+        name    c0;
+        type    cellSet;
+        action  new;
+        source  boxToCell;
         sourceInfo
         {
             box (0.0045 -0.00075 -1) (0.0095 0.00075 1);
@@ -29,5 +29,4 @@ actions
     }
 );
 
-
 // ************************************************************************* //
diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle/system/topoSetDict.3 b/tutorials/multiphase/cavitatingFoam/les/throttle/system/topoSetDict.3
index a2b19ef167dea5c561c20ee900be3f655ab4fa07..e06e313e63e3d234f65a36b6bc31281a87412d21 100644
--- a/tutorials/multiphase/cavitatingFoam/les/throttle/system/topoSetDict.3
+++ b/tutorials/multiphase/cavitatingFoam/les/throttle/system/topoSetDict.3
@@ -18,10 +18,10 @@ FoamFile
 actions
 (
     {
-        name            c0;
-        type            cellSet;
-        action          new;
-        source          boxToCell;
+        name    c0;
+        type    cellSet;
+        action  new;
+        source  boxToCell;
         sourceInfo
         {
             box (0.00475 -0.000375 -1) (0.009 0.000375 1);
@@ -29,5 +29,4 @@ actions
     }
 );
 
-
 // ************************************************************************* //
diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/controlDict b/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/controlDict
index a44791b5f98f655e62e14b340279df2fca61ead0..7b8751d21c8288a0d72c9040d49a731cf6004c55 100644
--- a/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/controlDict
+++ b/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/controlDict
@@ -37,13 +37,13 @@ writeFormat     binary;
 
 writePrecision  6;
 
-writeCompression off;
+writeCompression compressed;
 
 timeFormat      general;
 
-runTimeModifiable true;
+runTimeModifiable yes;
 
-adjustTimeStep  yes;
+adjustTimeStep  on;
 
 maxCo           0.5;
 
@@ -57,7 +57,6 @@ functions
         functionObjectLibs ( "libfieldFunctionObjects.so" );
         enabled         false;
         outputControl   outputTime;
-
         fields
         (
             U
@@ -84,4 +83,5 @@ functions
     }
 }
 
+
 // ************************************************************************* //
diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/topoSetDict.1 b/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/topoSetDict.1
index e21eca32ee76c4d624b947011006c7c1b729937a..26a7d17f9c28e6c326dd549ac9787e5c1bdd5ada 100644
--- a/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/topoSetDict.1
+++ b/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/topoSetDict.1
@@ -18,16 +18,15 @@ FoamFile
 actions
 (
     {
-        name            c0;
-        type            cellSet;
-        action          new;
-        source          boxToCell;
+        name    c0;
+        type    cellSet;
+        action  new;
+        source  boxToCell;
         sourceInfo
         {
-            box ( 0.004 -0.001 -1 ) ( 0.012 0.001 1 );
+            box (0.004 -0.001 -1) (0.012 0.001 1);
         }
     }
 );
 
-
 // ************************************************************************* //
diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/topoSetDict.2 b/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/topoSetDict.2
index 59ba8c24b93252fa0d40a7c12a314801a55af726..ada32184c9d5513e5d65050952bec64a5b0a86db 100644
--- a/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/topoSetDict.2
+++ b/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/topoSetDict.2
@@ -18,16 +18,15 @@ FoamFile
 actions
 (
     {
-        name            c0;
-        type            cellSet;
-        action          new;
-        source          boxToCell;
+        name    c0;
+        type    cellSet;
+        action  new;
+        source  boxToCell;
         sourceInfo
         {
-            box ( 0.0045 -0.00075 -1 ) ( 0.0095 0.00075 1 );
+            box (0.0045 -0.00075 -1) (0.0095 0.00075 1);
         }
     }
 );
 
-
 // ************************************************************************* //
diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/topoSetDict.3 b/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/topoSetDict.3
index 3cfea3e10353f662db402a5e88edc0f989d2aed0..e06e313e63e3d234f65a36b6bc31281a87412d21 100644
--- a/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/topoSetDict.3
+++ b/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/topoSetDict.3
@@ -18,16 +18,15 @@ FoamFile
 actions
 (
     {
-        name            c0;
-        type            cellSet;
-        action          new;
-        source          boxToCell;
+        name    c0;
+        type    cellSet;
+        action  new;
+        source  boxToCell;
         sourceInfo
         {
-            box ( 0.00475 -0.000375 -1 ) ( 0.009 0.000375 1 );
+            box (0.00475 -0.000375 -1) (0.009 0.000375 1);
         }
     }
 );
 
-
 // ************************************************************************* //
diff --git a/tutorials/multiphase/cavitatingFoam/ras/throttle/Allclean b/tutorials/multiphase/cavitatingFoam/ras/throttle/Allclean
index c49b5e9af36de8c6afe806d2b5f32894dd24f8da..70b255f01d9a086e4407b275bba5e46be028abc5 100755
--- a/tutorials/multiphase/cavitatingFoam/ras/throttle/Allclean
+++ b/tutorials/multiphase/cavitatingFoam/ras/throttle/Allclean
@@ -6,7 +6,7 @@ cd ${0%/*} || exit 1    # run from this directory
 
 rm -rf constant/polyMesh/sets > /dev/null 2>&1
 rm -rf 0/polyMesh > /dev/null 2>&1
-rm system/topoDict > /dev/null 2>&1
+rm system/topoSetDict > /dev/null 2>&1
 cleanCase
 
 # ----------------------------------------------------------------- end-of-file
diff --git a/tutorials/multiphase/cavitatingFoam/ras/throttle/system/controlDict b/tutorials/multiphase/cavitatingFoam/ras/throttle/system/controlDict
index 2f16722f4008ffc729d80db5bb7a35e5f4c8c873..c13287f7d01a590e223bc19d30ce4831d23ae0d1 100644
--- a/tutorials/multiphase/cavitatingFoam/ras/throttle/system/controlDict
+++ b/tutorials/multiphase/cavitatingFoam/ras/throttle/system/controlDict
@@ -37,13 +37,13 @@ writeFormat     ascii;
 
 writePrecision  6;
 
-writeCompression off;
+writeCompression uncompressed;
 
 timeFormat      general;
 
-runTimeModifiable true;
+runTimeModifiable yes;
 
-adjustTimeStep  yes;
+adjustTimeStep  on;
 
 maxCo           0.5;
 
diff --git a/tutorials/multiphase/cavitatingFoam/ras/throttle/system/topoSetDict.1 b/tutorials/multiphase/cavitatingFoam/ras/throttle/system/topoSetDict.1
index 8c7617d3679a463d3bbd7bc1b1750ab6592b847f..26a7d17f9c28e6c326dd549ac9787e5c1bdd5ada 100644
--- a/tutorials/multiphase/cavitatingFoam/ras/throttle/system/topoSetDict.1
+++ b/tutorials/multiphase/cavitatingFoam/ras/throttle/system/topoSetDict.1
@@ -24,10 +24,9 @@ actions
         source  boxToCell;
         sourceInfo
         {
-            box ( 0.004 -0.001 -1 ) ( 0.012 0.001 1 ) ;
+            box (0.004 -0.001 -1) (0.012 0.001 1);
         }
     }
 );
 
-
 // ************************************************************************* //
diff --git a/tutorials/multiphase/cavitatingFoam/ras/throttle/system/topoSetDict.2 b/tutorials/multiphase/cavitatingFoam/ras/throttle/system/topoSetDict.2
index f7eace90bd572dfc1097a3a6fd732f1b163e13f6..ada32184c9d5513e5d65050952bec64a5b0a86db 100644
--- a/tutorials/multiphase/cavitatingFoam/ras/throttle/system/topoSetDict.2
+++ b/tutorials/multiphase/cavitatingFoam/ras/throttle/system/topoSetDict.2
@@ -24,10 +24,9 @@ actions
         source  boxToCell;
         sourceInfo
         {
-            box ( 0.0045 -0.00075 -1 ) ( 0.0095 0.00075 1 ) ;
+            box (0.0045 -0.00075 -1) (0.0095 0.00075 1);
         }
     }
 );
 
-
 // ************************************************************************* //
diff --git a/tutorials/multiphase/cavitatingFoam/ras/throttle/system/topoSetDict.3 b/tutorials/multiphase/cavitatingFoam/ras/throttle/system/topoSetDict.3
index a09a48ea63c8890b9d2778920bcaccff69a8288e..e06e313e63e3d234f65a36b6bc31281a87412d21 100644
--- a/tutorials/multiphase/cavitatingFoam/ras/throttle/system/topoSetDict.3
+++ b/tutorials/multiphase/cavitatingFoam/ras/throttle/system/topoSetDict.3
@@ -24,10 +24,9 @@ actions
         source  boxToCell;
         sourceInfo
         {
-            box ( 0.00475 -0.000375 -1 ) ( 0.009 0.000375 1 ) ;
+            box (0.00475 -0.000375 -1) (0.009 0.000375 1);
         }
     }
 );
 
-
 // ************************************************************************* //
diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/0/alpha1.gz b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/0/alpha1.gz
deleted file mode 100644
index d976dd8e9473e71311d044ddf2a7067c8aea2690..0000000000000000000000000000000000000000
Binary files a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/0/alpha1.gz and /dev/null differ
diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/0/p.gz b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/0/p.gz
deleted file mode 100644
index 62a7129895c73d18cbc620886a4eed5adf6b334e..0000000000000000000000000000000000000000
Binary files a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/0/p.gz and /dev/null differ
diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/0/p.org b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/0/p_rgh.org
similarity index 86%
rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/0/p.org
rename to tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/0/p_rgh.org
index b6b7552d26448f7f7ad5365f42b62e0f2794b459..a7beb6a7ff9ac9ca7d43e7bde6a86e0f3e0e39ee 100644
--- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/0/p.org
+++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/0/p_rgh.org
@@ -10,22 +10,23 @@ FoamFile
     version     2.0;
     format      ascii;
     class       volScalarField;
-    object      p;
+    object      p_rgh;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 dimensions      [1 -1 -2 0 0 0 0];
 
-internalField   uniform 0;
+internalField   uniform 1e5;
 
 boundaryField
 {
     walls
     {
-        type            zeroGradient;
+        type            buoyantPressure;
+        value           uniform 1e5;
     }
 
-    defaultFaces    
+    defaultFaces
     {
         type            empty;
     }
diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/Allclean b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/Allclean
new file mode 100755
index 0000000000000000000000000000000000000000..ae79bb922fd6a55add08180ad5ea92b6398aa760
--- /dev/null
+++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/Allclean
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+foamCleanTutorials cases
+rm -rf processor*
+rm -rf 0/p_rgh.gz 0/alpha1.gz
diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/Allrun b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/Allrun
index 2e0fd036f2c1e961c065cd0eff41f647fa29fb3b..5fd844dc716a76d9e1fd863c6095de60b8e1316c 100755
--- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/Allrun
+++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/Allrun
@@ -9,7 +9,7 @@ application=`getApplication`
 
 runApplication blockMesh
 cp 0/alpha1.org 0/alpha1
-cp 0/p.org 0/p
+cp 0/p_rgh.org 0/p_rgh
 runApplication setFields
 runApplication $application
 
diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/controlDict b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/controlDict
index a921a2c599427aafa4a62317279333a969435eaa..1970af813149c8fea57f4fb4f8a880a9d886c7cd 100644
--- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/controlDict
+++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/controlDict
@@ -37,13 +37,13 @@ writeFormat     ascii;
 
 writePrecision  8;
 
-writeCompression off;
+writeCompression compressed;
 
 timeFormat      general;
 
 timePrecision   10;
 
-runTimeModifiable true;
+runTimeModifiable yes;
 
 adjustTimeStep  yes;
 
diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/fvSchemes b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/fvSchemes
index 3f248f1a38b60dbe859a600a4632bf8f80b4cd22..df3462c54ddbafc3bb39c0a13486aea3eef6e110 100644
--- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/fvSchemes
+++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/fvSchemes
@@ -30,7 +30,7 @@ divSchemes
     div(rho*phi,U)  Gauss upwind;
     div(phi,alpha)  Gauss vanLeer;
     div(phirb,alpha) Gauss interfaceCompression 1;
-    div(phi,p)      Gauss upwind;
+    div(phi,p_rgh)  Gauss upwind;
     div(phi,k)      Gauss vanLeer;
     div((nuEff*dev(grad(U).T()))) Gauss linear;
 }
@@ -53,7 +53,7 @@ snGradSchemes
 fluxRequired
 {
     default         no;
-    p;
+    p_rgh;
     pcorr;
     gamma;
 }
diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/fvSolution b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/fvSolution
index 5cc4aece13f51a6c09d98b6aa756bec1c4312a93..66a8e350d9f3322c44ff180916fcb8e7f7cd6e54 100644
--- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/fvSolution
+++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/fvSolution
@@ -44,7 +44,7 @@ solvers
         solver          diagonal;
     }
 
-    p
+    p_rgh
     {
         solver          GAMG;
         tolerance       1e-07;
@@ -59,7 +59,7 @@ solvers
         mergeLevels     1;
     }
 
-    pFinal
+    p_rghFinal
     {
         solver          PCG;
         preconditioner
diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/setFieldsDict b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/setFieldsDict
index 62496900bacbe3ee099ff945a3af28cf20be3653..f49cbcdc017dd3128cc04044888417a73fde56e2 100644
--- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/setFieldsDict
+++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/setFieldsDict
@@ -18,24 +18,24 @@ FoamFile
 defaultFieldValues
 (
     volScalarFieldValue alpha1 1
-    volScalarFieldValue p 100000
+    volScalarFieldValue p_rgh 1e5
 );
 
 regions
 (
     sphereToCell
     {
-        centre ( 0.5 0.5 0 );
+        centre (0.5 0.5 0);
         radius 0.1;
         fieldValues
         (
             volScalarFieldValue alpha1 0
-            volScalarFieldValue p 1000000
+            volScalarFieldValue p_rgh 1e6
         );
     }
     boxToCell
     {
-        box ( -10 1 -1 ) ( 10 10 1 );
+        box (-10 1 -1) (10 10 1);
         fieldValues
         (
             volScalarFieldValue alpha1 0
diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/0/p_rgh.org b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/0/p_rgh.org
new file mode 100644
index 0000000000000000000000000000000000000000..1eee89fe34523115d4847fd0606ef2dc11849d32
--- /dev/null
+++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/0/p_rgh.org
@@ -0,0 +1,30 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       volScalarField;
+    object      p_rgh;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions      [1 -1 -2 0 0 0 0];
+
+internalField   uniform 1e5;
+
+boundaryField
+{
+    walls
+    {
+        type            buoyantPressure;
+        value           uniform 1e5;
+    }
+}
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/Allclean b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/Allclean
index 6633e983d1d4584494504392fd1165090980f252..a550e023bd2a4e51fb6eaa2ee2f3a6c80ea7242b 100755
--- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/Allclean
+++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/Allclean
@@ -3,6 +3,6 @@ cd ${0%/*} || exit 1    # run from this directory
 
 foamCleanTutorials cases
 rm -rf processor*
-rm -rf 0/p.gz 0/alpha1.gz
+rm -rf 0/p_rgh.gz 0/alpha1.gz
 
 # ----------------------------------------------------------------- end-of-file
diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/Allrun b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/Allrun
index c77d2e8fc2eac1ddf9da2ca970254121986f4a39..ac00d007bcf311fc7c62e2b8e7a93ecb8d6850d3 100755
--- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/Allrun
+++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/Allrun
@@ -9,7 +9,7 @@ application=`getApplication`
 
 runApplication blockMesh
 cp 0/alpha1.org 0/alpha1
-cp 0/p.org 0/p
+cp 0/p_rgh.org 0/p_rgh
 runApplication setFields
 runApplication decomposePar
 runParallel $application 4
diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/controlDict b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/controlDict
index a921a2c599427aafa4a62317279333a969435eaa..1970af813149c8fea57f4fb4f8a880a9d886c7cd 100644
--- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/controlDict
+++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/controlDict
@@ -37,13 +37,13 @@ writeFormat     ascii;
 
 writePrecision  8;
 
-writeCompression off;
+writeCompression compressed;
 
 timeFormat      general;
 
 timePrecision   10;
 
-runTimeModifiable true;
+runTimeModifiable yes;
 
 adjustTimeStep  yes;
 
diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSchemes b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSchemes
index 3f248f1a38b60dbe859a600a4632bf8f80b4cd22..df3462c54ddbafc3bb39c0a13486aea3eef6e110 100644
--- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSchemes
+++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSchemes
@@ -30,7 +30,7 @@ divSchemes
     div(rho*phi,U)  Gauss upwind;
     div(phi,alpha)  Gauss vanLeer;
     div(phirb,alpha) Gauss interfaceCompression 1;
-    div(phi,p)      Gauss upwind;
+    div(phi,p_rgh)  Gauss upwind;
     div(phi,k)      Gauss vanLeer;
     div((nuEff*dev(grad(U).T()))) Gauss linear;
 }
@@ -53,7 +53,7 @@ snGradSchemes
 fluxRequired
 {
     default         no;
-    p;
+    p_rgh;
     pcorr;
     gamma;
 }
diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSolution b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSolution
index 5cc4aece13f51a6c09d98b6aa756bec1c4312a93..66a8e350d9f3322c44ff180916fcb8e7f7cd6e54 100644
--- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSolution
+++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSolution
@@ -44,7 +44,7 @@ solvers
         solver          diagonal;
     }
 
-    p
+    p_rgh
     {
         solver          GAMG;
         tolerance       1e-07;
@@ -59,7 +59,7 @@ solvers
         mergeLevels     1;
     }
 
-    pFinal
+    p_rghFinal
     {
         solver          PCG;
         preconditioner
diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/setFieldsDict b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/setFieldsDict
index 6ef7fdd2fe3dfdd4b21e02964e52780b5f774aab..77f81ab8d39797667e8ca59082aeb92678e1b6ee 100644
--- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/setFieldsDict
+++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/setFieldsDict
@@ -18,24 +18,24 @@ FoamFile
 defaultFieldValues
 (
     volScalarFieldValue alpha1 1
-    volScalarFieldValue p 100000
+    volScalarFieldValue p_rgh 1e5
 );
 
 regions
 (
     sphereToCell
     {
-        centre ( 0.5 0.5 0.5 );
+        centre (0.5 0.5 0.5);
         radius 0.1;
         fieldValues
         (
             volScalarFieldValue alpha1 0
-            volScalarFieldValue p 1000000
+            volScalarFieldValue p_rgh 1e6
         );
     }
     boxToCell
     {
-        box ( -10 1 -1 ) ( 10 10 1 );
+        box (-10 1 -1) (10 10 1);
         fieldValues
         (
             volScalarFieldValue alpha1 0
diff --git a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0/U b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0.org/U
similarity index 100%
rename from tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0/U
rename to tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0.org/U
diff --git a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0-orig/alpha1 b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0.org/alpha1
similarity index 95%
rename from tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0-orig/alpha1
rename to tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0.org/alpha1
index 929e2045d8d742503bbe3307e201153c64c1217c..0f1e8ba09cfe47bacfb4ff2f1603221207beaf16 100644
--- a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0-orig/alpha1
+++ b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0.org/alpha1
@@ -20,17 +20,17 @@ internalField   uniform 0;
 
 boundaryField
 {
-    walls        
+    walls
     {
         type            zeroGradient;
     }
 
-    obstacle       
+    obstacle
     {
         type            zeroGradient;
     }
 
-    atmosphere      
+    atmosphere
     {
         type            inletOutlet;
         inletValue      uniform 0;
diff --git a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0-orig/alpha1.org b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0.org/alpha1.org
similarity index 95%
rename from tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0-orig/alpha1.org
rename to tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0.org/alpha1.org
index 929e2045d8d742503bbe3307e201153c64c1217c..0f1e8ba09cfe47bacfb4ff2f1603221207beaf16 100644
--- a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0-orig/alpha1.org
+++ b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0.org/alpha1.org
@@ -20,17 +20,17 @@ internalField   uniform 0;
 
 boundaryField
 {
-    walls        
+    walls
     {
         type            zeroGradient;
     }
 
-    obstacle       
+    obstacle
     {
         type            zeroGradient;
     }
 
-    atmosphere      
+    atmosphere
     {
         type            inletOutlet;
         inletValue      uniform 0;
diff --git a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0-orig/p b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0.org/p_rgh
similarity index 98%
rename from tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0-orig/p
rename to tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0.org/p_rgh
index 775cd5b893ea19cbfc37a742d2957a8e896666fd..7d97be89f4fb01fa347ca5730d5205432116dcee 100644
--- a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0-orig/p
+++ b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0.org/p_rgh
@@ -10,7 +10,7 @@ FoamFile
     version     2.0;
     format      ascii;
     class       volScalarField;
-    object      p;
+    object      p_rgh;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0/alpha1 b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0/alpha1
deleted file mode 100644
index e2a9458b9891e19599bf31955f698d2c1fa54deb..0000000000000000000000000000000000000000
--- a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0/alpha1
+++ /dev/null
@@ -1,32809 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    format      ascii;
-    class       volScalarField;
-    location    "0";
-    object      alpha1;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-dimensions      [0 0 0 0 0 0 0];
-
-internalField   nonuniform List<scalar> 
-32768
-(
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-1
-1
-1
-1
-1
-1
-1
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
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-)
-;
-
-boundaryField
-{
-    atmosphere
-    {
-        type            inletOutlet;
-        inletValue      uniform 0;
-        value           uniform 0;
-    }
-    walls
-    {
-        type            zeroGradient;
-    }
-}
-
-
-// ************************************************************************* //
diff --git a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/Allclean b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/Allclean
new file mode 100755
index 0000000000000000000000000000000000000000..2c6db87c7f2bb23426b422dc88288ae44ead4a52
--- /dev/null
+++ b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/Allclean
@@ -0,0 +1,12 @@
+#!/bin/sh
+cd ${0%/*} || exit 1    # run from this directory
+
+# Source tutorial clean functions
+. $WM_PROJECT_DIR/bin/tools/CleanFunctions
+
+rm system/cellSetDict > /dev/null 2>&1
+rm -rf 0 > /dev/null 2>&1
+
+cleanCase
+
+# ----------------------------------------------------------------- end-of-file
diff --git a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/Allrun b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/Allrun
index deafedf7a63b23016946bb3e00b199bfb2daf729..f6ff3740d895041df559ae9479cfac49c931b3ff 100755
--- a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/Allrun
+++ b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/Allrun
@@ -4,9 +4,10 @@ cd ${0%/*} || exit 1    # run from this directory
 # Source tutorial run functions
 . $WM_PROJECT_DIR/bin/tools/RunFunctions
 
+cp -r 0.org 0 > /dev/null 2>&1
 runApplication blockMesh
 runApplication setSet -batch createObstacle.setSet
-runApplication subsetMesh c0 -patch walls
+runApplication subsetMesh -overwrite c0 -patch walls
 runApplication setFields
 runApplication interDyMFoam
 
diff --git a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/constant/polyMesh/boundary b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/constant/polyMesh/boundary
index 897a881cf0402cec2123807517050dcd98060e23..9d88d112286fd77c65ea8979ad106116a216c7e8 100644
--- a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/constant/polyMesh/boundary
+++ b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/constant/polyMesh/boundary
@@ -21,13 +21,13 @@ FoamFile
     {
         type            patch;
         nFaces          1024;
-        startFace       95232;
+        startFace       93568;
     }
     walls
     {
         type            wall;
-        nFaces          5120;
-        startFace       96256;
+        nFaces          5376;
+        startFace       94592;
     }
 )
 
diff --git a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/controlDict b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/controlDict
index c84bb054f75a9951f867b66a72c9a4059424aa02..fb1c4b1cc2300b4e6ad1c7d68459843112eae0a7 100644
--- a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/controlDict
+++ b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/controlDict
@@ -37,18 +37,18 @@ writeFormat     ascii;
 
 writePrecision  6;
 
-writeCompression off;
+writeCompression uncompressed;
 
 timeFormat      general;
 
 timePrecision   6;
 
-runTimeModifiable true;
+runTimeModifiable yes;
 
 adjustTimeStep  yes;
 
 maxCo           0.1;
-
+maxAlphaCo      0.1;
 maxDeltaT       1;
 
 
diff --git a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/decomposeParDict b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/decomposeParDict
index 583bc5fc205a4489782524e77d48868ddb5ef7bc..8c6dbf212b60067f32e3b360dfc5890bad975f19 100644
--- a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/decomposeParDict
+++ b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/decomposeParDict
@@ -15,9 +15,9 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-numberOfSubdomains 6;
+numberOfSubdomains  6;
 
-method          metis;
+method              scotch;
 
 simpleCoeffs
 {
diff --git a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/fvSchemes b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/fvSchemes
index 843103991bfcd0afa3abbf1de88e1fa46bf404b8..2f1c70d398115872f8bd1971a9ccbd02e0bc597b 100644
--- a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/fvSchemes
+++ b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/fvSchemes
@@ -50,7 +50,7 @@ snGradSchemes
 fluxRequired
 {
     default         no;
-    p;
+    p_rgh;
     pcorr;
     alpha;
 }
diff --git a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/fvSolution b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/fvSolution
index 18d59525b36c94396d873a80ac5e0878262ddf2a..b8143ab07b6bde61118c87472b921b8cf1938b59 100644
--- a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/fvSolution
+++ b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/fvSolution
@@ -34,12 +34,13 @@ solvers
             agglomerator    faceAreaPair;
             mergeLevels     1;
         }
+
         tolerance       0.0001;
         relTol          0;
         maxIter         100;
     }
 
-    p
+    p_rgh
     {
         solver          GAMG;
         tolerance       1e-08;
@@ -54,7 +55,7 @@ solvers
         mergeLevels     1;
     }
 
-    pFinal
+    p_rghFinal
     {
         solver          PCG;
         preconditioner
@@ -72,6 +73,7 @@ solvers
             agglomerator    faceAreaPair;
             mergeLevels     1;
         }
+
         tolerance       1e-08;
         relTol          0;
         maxIter         20;
@@ -103,8 +105,9 @@ PISO
     nAlphaCorr      1;
     nAlphaSubCycles 3;
     cAlpha          1;
-    pRefPoint       ( 0.51 0.51 0.51 );
-    pRefValue       0;
+
+    pRefPoint      (0.51 0.51 0.51);
+    pRefValue      0;
 }
 
 
diff --git a/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/p b/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/p_rgh
similarity index 98%
rename from tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/p
rename to tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/p_rgh
index cd1e3352f1da81ba1f7d8145c42b597e107d74ef..7a4ab53ff29d7e2db535d33b327259463ff93053 100644
--- a/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/p
+++ b/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/p_rgh
@@ -10,7 +10,7 @@ FoamFile
     version     2.0;
     format      ascii;
     class       volScalarField;
-    object      pd;
+    object      p_rgh;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/pointDisplacement b/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/pointDisplacement
index 409b66fbd57e07b1185b14f8c6faeb66b69a838f..e657901c8ad2f08fb19567a048063a1a94a1b3e4 100644
--- a/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/pointDisplacement
+++ b/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/pointDisplacement
@@ -37,6 +37,7 @@ boundaryField
         centreOfMass    (0.5 0.5 0.5);
         momentOfInertia (0.08622222 0.08622222 0.144);
         mass            9.6;
+        rhoInf          1;  // needed only for solvers solving for kinematic pressure
         report          on;
         value           uniform (0 0 0);
     }
diff --git a/tutorials/multiphase/interDyMFoam/ras/floatingObject/system/controlDict b/tutorials/multiphase/interDyMFoam/ras/floatingObject/system/controlDict
index 32c021c41b538ffb1955cf01bd88b14e4fc5bae7..5463a0d951bd109f86c878af298f52d0061917c6 100644
--- a/tutorials/multiphase/interDyMFoam/ras/floatingObject/system/controlDict
+++ b/tutorials/multiphase/interDyMFoam/ras/floatingObject/system/controlDict
@@ -37,22 +37,23 @@ writeFormat     ascii;
 
 writePrecision  12;
 
-writeCompression off;
+writeCompression uncompressed;
 
 timeFormat      general;
 
 timePrecision   6;
 
-runTimeModifiable true;
+runTimeModifiable yes;
 
 adjustTimeStep  yes;
 
 maxCo           0.5;
-
+maxAlphaCo      0.5;
 maxDeltaT       0.01;
 
 libs
 (
+    "libOpenFOAM.so"
     "libincompressibleRASModels.so"
     "libfvMotionSolvers.so"
     "libforces.so"
diff --git a/tutorials/multiphase/interDyMFoam/ras/floatingObject/system/fvSchemes b/tutorials/multiphase/interDyMFoam/ras/floatingObject/system/fvSchemes
index 2b4957876dbbe8920f90c7584b5a17eba75811c2..5aae05b6eb0305c3e24b1a2ce951e80c2086960c 100644
--- a/tutorials/multiphase/interDyMFoam/ras/floatingObject/system/fvSchemes
+++ b/tutorials/multiphase/interDyMFoam/ras/floatingObject/system/fvSchemes
@@ -29,7 +29,7 @@ divSchemes
 {
     div(rho*phi,U)  Gauss vanLeerV;
     div(phi,alpha)  Gauss vanLeer;
-    div(phirb,alpha) Gauss vanLeer;
+    div(phirb,alpha) Gauss interfaceCompression;
     div(phi,k)      Gauss upwind;
     div(phi,epsilon) Gauss upwind;
 }
@@ -52,7 +52,7 @@ snGradSchemes
 fluxRequired
 {
     default         no;
-    p;
+    p_rgh;
     pcorr;
     alpha;
 }
diff --git a/tutorials/multiphase/interDyMFoam/ras/floatingObject/system/fvSolution b/tutorials/multiphase/interDyMFoam/ras/floatingObject/system/fvSolution
index 88c608ec26a2dedc936d001033d3ab00786a8345..b6d29c62411c5de3132b6f22d6de8c7efa0bff9f 100644
--- a/tutorials/multiphase/interDyMFoam/ras/floatingObject/system/fvSolution
+++ b/tutorials/multiphase/interDyMFoam/ras/floatingObject/system/fvSolution
@@ -52,7 +52,7 @@ solvers
         maxIter         100;
     }
 
-    p
+    p_rgh
     {
         solver          GAMG;
         tolerance       1e-8;
@@ -67,7 +67,7 @@ solvers
         mergeLevels     1;
     }
 
-    pFinal
+    p_rghFinal
     {
         solver          PCG;
         preconditioner
diff --git a/tutorials/multiphase/interDyMFoam/ras/floatingObject/system/topoSetDict b/tutorials/multiphase/interDyMFoam/ras/floatingObject/system/topoSetDict
index 91b2397d23b567b64d6d25ae7a1a33dfb76681d0..12697de58a03683ef1d154bb49e3826b8e275eb3 100644
--- a/tutorials/multiphase/interDyMFoam/ras/floatingObject/system/topoSetDict
+++ b/tutorials/multiphase/interDyMFoam/ras/floatingObject/system/topoSetDict
@@ -18,20 +18,20 @@ FoamFile
 actions
 (
     {
-        name c0;
-        type cellSet;
-        action new;
-        source boxToCell;
+        name    c0;
+        type    cellSet;
+        action  new;
+        source  boxToCell;
         sourceInfo
         {
-           box   (0.35 0.35 0.44) (0.65 0.65 0.56);
+            box (0.35 0.35 0.44) (0.65 0.65 0.56);
         }
     }
 
     {
-        name c0;
-        type cellSet;
-        action invert;
+        name    c0;
+        type    cellSet;
+        action  invert;
     }
 );
 
diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/0/p b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/0/p_rgh
similarity index 97%
rename from tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/0/p
rename to tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/0/p_rgh
index d5eb5ab01e786dd9eedf5128007f5f0bb79d45f5..f51ec3490557d8d8b54d5abef85786e82dcfd9f5 100644
--- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/0/p
+++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/0/p_rgh
@@ -10,7 +10,7 @@ FoamFile
     version     2.0;
     format      ascii;
     class       volScalarField;
-    object      p;
+    object      p_rgh;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/constant/polyMesh/blockMeshDict b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/constant/polyMesh/blockMeshDict
deleted file mode 100644
index b3c363e44842e64b09d6705989df95b09c7652b9..0000000000000000000000000000000000000000
--- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/constant/polyMesh/blockMeshDict
+++ /dev/null
@@ -1,143 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    format      ascii;
-    class       dictionary;
-    object      blockMeshDict;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// General m4 macros
-
-  
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// User-defined parameters
-
-convertToMeters 1;
-
-      // Length of tank (x-direction)
-       // Breadth of tank (y-direction)
-       // Depth of tank (z-direction)
-
-      // Depth to the top (height) of lower chamfer
-     // Height of upper chamfer
-
- // Angle of lower chamfer to the horizontal
- // Angle of upper chamfer to the horizontal
-
-  // Centre of gravity in y-direction
-         // Centre of gravity in z-direction
-
-       // Number of cells in the length (1 for 2D)
-      // Number of cells in the breadth
-     // Number of cells in the height of the lower champfer
-      // Number of cells in the height between the chamfers
-    // Number of cells in the height of the upper champfer
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// Derived parameters
-
- // Breadth to the top (height) of lower chamfer
- // Breadth of upper chamfer
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// Parametric description
-
-vertices
-(
-    (-0.5 -15 -10.0) // Vertex bllcb = 0 
-    (-0.5 -20 -5)  // Vertex bllc = 1 
-    (-0.5 -20 10)  // Vertex bluc = 2 
-    (-0.5 -10 20) // Vertex bluct = 3 
-    (-0.5 15 -10.0) // Vertex brlcb = 4 
-    (-0.5 20 -5)  // Vertex brlc = 5 
-    (-0.5 20 10)  // Vertex bruc = 6 
-    (-0.5 10 20) // Vertex bruct = 7 
-
-    (0.5 -15 -10.0) // Vertex fllcb = 8 
-    (0.5 -20 -5)  // Vertex fllc = 9 
-    (0.5 -20 10)  // Vertex fluc = 10 
-    (0.5 -10 20) // Vertex fluct = 11 
-    (0.5 15 -10.0) // Vertex frlcb = 12 
-    (0.5 20 -5)  // Vertex frlc = 13 
-    (0.5 20 10)  // Vertex fruc = 14 
-    (0.5 10 20) // Vertex fruct = 15 
-);
-
-blocks
-(
-    // block0
-    hex (0 4 5 1 8 12 13 9)
-    (40 6 1)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (1 5 6 2 9 13 14 10)
-    (40 16 1)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (2 6 7 3 10 14 15 11)
-    (40 12 1)
-    simpleGrading (1 1 1)
-);
-
-patches
-(
-    patch walls
-    (
-        (0 4 12 8)
-        (4 5 13 12)
-        (5 6 14 13)
-        (6 7 15 14)
-        (7 3 11 15)
-        (3 2 10 11)
-        (2 1 9 10)
-        (1 0 8 9)
-    )
-
-    empty front
-    (
-        (8 12 13 9)
-        (9 13 14 10)
-        (10 14 15 11)
-    )
-
-    empty back
-    (
-        (0 1 5 4)
-        (1 2 6 5)
-        (2 3 7 6)
-    )
-);
-
-// ************************************************************************* //
diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/controlDict b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/controlDict
index 1b3ad49cb65417cf9785e782972109e37716accd..ce1cbc6d136856191e5458f3b8f0168134d647c4 100644
--- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/controlDict
+++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/controlDict
@@ -37,17 +37,18 @@ writeFormat     ascii;
 
 writePrecision  6;
 
-writeCompression off;
+writeCompression compressed;
 
 timeFormat      general;
 
 timePrecision   6;
 
-runTimeModifiable true;
+runTimeModifiable yes;
 
 adjustTimeStep  yes;
 
 maxCo           0.5;
+maxAlphaCo      0.5;
 
 maxDeltaT       1;
 
@@ -59,17 +60,15 @@ functions
         functionObjectLibs ("libsampling.so");
         outputControl   timeStep;
         outputInterval  1;
-
-        fields
-        (
-            p
-        );
-
         probeLocations
         (
             ( 0 9.95 19.77 )
             ( 0 -9.95 19.77 )
         );
+        fields
+        (
+            p
+        );
     }
 
     wallPressure
@@ -79,7 +78,6 @@ functions
         outputControl   timeStep;
         outputInterval  10;
         surfaceFormat   raw;
-
         fields
         (
             p
@@ -97,4 +95,5 @@ functions
     }
 }
 
+
 // ************************************************************************* //
diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/fvSchemes b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/fvSchemes
index 8bcf9acede4284b03b664045ed2cea86dc99c6e3..814f3d6e0699026d74eddb363d2bbeabf17a675a 100644
--- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/fvSchemes
+++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/fvSchemes
@@ -50,7 +50,7 @@ snGradSchemes
 fluxRequired
 {
     default         no;
-    p;
+    p_rgh;
     pcorr;
     alpha;
 }
diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/fvSolution b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/fvSolution
index 6dee08c0579b693721b581bc9791925301aad4cf..11a72d517a651a00bb96bf98b8540c55b2310cd5 100644
--- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/fvSolution
+++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/fvSolution
@@ -40,7 +40,7 @@ solvers
         maxIter         100;
     }
 
-    p
+    p_rgh
     {
         solver          GAMG;
         tolerance       1e-08;
@@ -55,7 +55,7 @@ solvers
         mergeLevels     1;
     }
 
-    pFinal
+    p_rghFinal
     {
         solver          PCG;
         preconditioner
diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/0/p b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/0/p_rgh
similarity index 97%
rename from tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/0/p
rename to tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/0/p_rgh
index d5eb5ab01e786dd9eedf5128007f5f0bb79d45f5..f51ec3490557d8d8b54d5abef85786e82dcfd9f5 100644
--- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/0/p
+++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/0/p_rgh
@@ -10,7 +10,7 @@ FoamFile
     version     2.0;
     format      ascii;
     class       volScalarField;
-    object      p;
+    object      p_rgh;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/constant/polyMesh/blockMeshDict b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/constant/polyMesh/blockMeshDict
deleted file mode 100644
index b3c363e44842e64b09d6705989df95b09c7652b9..0000000000000000000000000000000000000000
--- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/constant/polyMesh/blockMeshDict
+++ /dev/null
@@ -1,143 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    format      ascii;
-    class       dictionary;
-    object      blockMeshDict;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// General m4 macros
-
-  
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// User-defined parameters
-
-convertToMeters 1;
-
-      // Length of tank (x-direction)
-       // Breadth of tank (y-direction)
-       // Depth of tank (z-direction)
-
-      // Depth to the top (height) of lower chamfer
-     // Height of upper chamfer
-
- // Angle of lower chamfer to the horizontal
- // Angle of upper chamfer to the horizontal
-
-  // Centre of gravity in y-direction
-         // Centre of gravity in z-direction
-
-       // Number of cells in the length (1 for 2D)
-      // Number of cells in the breadth
-     // Number of cells in the height of the lower champfer
-      // Number of cells in the height between the chamfers
-    // Number of cells in the height of the upper champfer
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// Derived parameters
-
- // Breadth to the top (height) of lower chamfer
- // Breadth of upper chamfer
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// Parametric description
-
-vertices
-(
-    (-0.5 -15 -10.0) // Vertex bllcb = 0 
-    (-0.5 -20 -5)  // Vertex bllc = 1 
-    (-0.5 -20 10)  // Vertex bluc = 2 
-    (-0.5 -10 20) // Vertex bluct = 3 
-    (-0.5 15 -10.0) // Vertex brlcb = 4 
-    (-0.5 20 -5)  // Vertex brlc = 5 
-    (-0.5 20 10)  // Vertex bruc = 6 
-    (-0.5 10 20) // Vertex bruct = 7 
-
-    (0.5 -15 -10.0) // Vertex fllcb = 8 
-    (0.5 -20 -5)  // Vertex fllc = 9 
-    (0.5 -20 10)  // Vertex fluc = 10 
-    (0.5 -10 20) // Vertex fluct = 11 
-    (0.5 15 -10.0) // Vertex frlcb = 12 
-    (0.5 20 -5)  // Vertex frlc = 13 
-    (0.5 20 10)  // Vertex fruc = 14 
-    (0.5 10 20) // Vertex fruct = 15 
-);
-
-blocks
-(
-    // block0
-    hex (0 4 5 1 8 12 13 9)
-    (40 6 1)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (1 5 6 2 9 13 14 10)
-    (40 16 1)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (2 6 7 3 10 14 15 11)
-    (40 12 1)
-    simpleGrading (1 1 1)
-);
-
-patches
-(
-    patch walls
-    (
-        (0 4 12 8)
-        (4 5 13 12)
-        (5 6 14 13)
-        (6 7 15 14)
-        (7 3 11 15)
-        (3 2 10 11)
-        (2 1 9 10)
-        (1 0 8 9)
-    )
-
-    empty front
-    (
-        (8 12 13 9)
-        (9 13 14 10)
-        (10 14 15 11)
-    )
-
-    empty back
-    (
-        (0 1 5 4)
-        (1 2 6 5)
-        (2 3 7 6)
-    )
-);
-
-// ************************************************************************* //
diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/system/controlDict b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/system/controlDict
index 167803089ac08f6ff1c320effeac6fa73cfa9794..ac4e8b29705d2231ca171cd057b7e7814af36d9a 100644
--- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/system/controlDict
+++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/system/controlDict
@@ -37,18 +37,18 @@ writeFormat     ascii;
 
 writePrecision  6;
 
-writeCompression off;
+writeCompression compressed;
 
 timeFormat      general;
 
 timePrecision   6;
 
-runTimeModifiable true;
+runTimeModifiable yes;
 
 adjustTimeStep  yes;
 
 maxCo           0.5;
-
+maxAlphaCo      0.5;
 maxDeltaT       1;
 
 functions
@@ -59,27 +59,24 @@ functions
         functionObjectLibs ("libsampling.so");
         outputControl   timeStep;
         outputInterval  1;
-
-        fields
-        (
-            p
-        );
-
         probeLocations
         (
             ( 0 9.95 19.77 )
             ( 0 -9.95 19.77 )
         );
+        fields
+        (
+            p
+        );
     }
 
     wallPressure
     {
         type            surfaces;
+        functionObjectLibs ("libsampling.so");
         outputControl   timeStep;
         outputInterval  10;
         surfaceFormat   raw;
-        functionObjectLibs ("libsampling.so");
-
         fields
         (
             p
@@ -97,4 +94,5 @@ functions
     }
 }
 
+
 // ************************************************************************* //
diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/system/fvSchemes b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/system/fvSchemes
index 8bcf9acede4284b03b664045ed2cea86dc99c6e3..814f3d6e0699026d74eddb363d2bbeabf17a675a 100644
--- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/system/fvSchemes
+++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/system/fvSchemes
@@ -50,7 +50,7 @@ snGradSchemes
 fluxRequired
 {
     default         no;
-    p;
+    p_rgh;
     pcorr;
     alpha;
 }
diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/system/fvSolution b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/system/fvSolution
index 6dee08c0579b693721b581bc9791925301aad4cf..11a72d517a651a00bb96bf98b8540c55b2310cd5 100644
--- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/system/fvSolution
+++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/system/fvSolution
@@ -40,7 +40,7 @@ solvers
         maxIter         100;
     }
 
-    p
+    p_rgh
     {
         solver          GAMG;
         tolerance       1e-08;
@@ -55,7 +55,7 @@ solvers
         mergeLevels     1;
     }
 
-    pFinal
+    p_rghFinal
     {
         solver          PCG;
         preconditioner
diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/0/p b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/0/p_rgh
similarity index 97%
rename from tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/0/p
rename to tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/0/p_rgh
index 6d26a2c77bd5e06d83f40eea02b51090cd1b4198..049d7a597630e590f1c6dd571a287ac87e626ac7 100644
--- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/0/p
+++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/0/p_rgh
@@ -10,7 +10,7 @@ FoamFile
     version     2.0;
     format      ascii;
     class       volScalarField;
-    object      p;
+    object      p_rgh;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/constant/polyMesh/blockMeshDict b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/constant/polyMesh/blockMeshDict
deleted file mode 100644
index e0e276608f5aa2cef8f0c9b7a1593ce7d3f631be..0000000000000000000000000000000000000000
--- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/constant/polyMesh/blockMeshDict
+++ /dev/null
@@ -1,135 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    format      ascii;
-    class       dictionary;
-    object      blockMeshDict;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// General m4 macros
-
-  
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// User-defined parameters
-
-convertToMeters 1;
-
-       // Length of tank (x-direction)
-       // Breadth of tank (y-direction)
-       // Depth of tank (z-direction)
-
-      // Depth to the top (height) of lower chamfer
-     // Height of upper chamfer
-
- // Angle of lower chamfer to the horizontal
- // Angle of upper chamfer to the horizontal
-
-  // Centre of gravity in y-direction
-         // Centre of gravity in z-direction
-
-      // Number of cells in the length (1 for 2D)
-      // Number of cells in the breadth
-     // Number of cells in the height of the lower champfer
-      // Number of cells in the height between the chamfers
-    // Number of cells in the height of the upper champfer
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// Derived parameters
-
- // Breadth to the top (height) of lower chamfer
- // Breadth of upper chamfer
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// Parametric description
-
-vertices
-(
-    (-10 -15 -10.0) // Vertex bllcb = 0 
-    (-10 -20 -5)  // Vertex bllc = 1 
-    (-10 -20 10)  // Vertex bluc = 2 
-    (-10 -10 20) // Vertex bluct = 3 
-    (-10 15 -10.0) // Vertex brlcb = 4 
-    (-10 20 -5)  // Vertex brlc = 5 
-    (-10 20 10)  // Vertex bruc = 6 
-    (-10 10 20) // Vertex bruct = 7 
-
-    (10 -15 -10.0) // Vertex fllcb = 8 
-    (10 -20 -5)  // Vertex fllc = 9 
-    (10 -20 10)  // Vertex fluc = 10 
-    (10 -10 20) // Vertex fluct = 11 
-    (10 15 -10.0) // Vertex frlcb = 12 
-    (10 20 -5)  // Vertex frlc = 13 
-    (10 20 10)  // Vertex fruc = 14 
-    (10 10 20) // Vertex fruct = 15 
-);
-
-blocks
-(
-    // block0
-    hex (0 4 5 1 8 12 13 9)
-    (40 6 19)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (1 5 6 2 9 13 14 10)
-    (40 16 19)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (2 6 7 3 10 14 15 11)
-    (40 12 19)
-    simpleGrading (1 1 1)
-);
-
-patches
-(
-    patch walls
-    (
-        (0 4 12 8)
-        (4 5 13 12)
-        (5 6 14 13)
-        (6 7 15 14)
-        (7 3 11 15)
-        (3 2 10 11)
-        (2 1 9 10)
-        (1 0 8 9)
-        (8 12 13 9)
-        (9 13 14 10)
-        (10 14 15 11)
-        (0 1 5 4)
-        (1 2 6 5)
-        (2 3 7 6)
-    )
-);
-
-// ************************************************************************* //
diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/system/controlDict b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/system/controlDict
index b41d481d9e01a855a45c8c37c56bc05792de47f5..69f4f2ca46203b5851bb285c2499946106299764 100644
--- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/system/controlDict
+++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/system/controlDict
@@ -37,18 +37,18 @@ writeFormat     ascii;
 
 writePrecision  6;
 
-writeCompression off;
+writeCompression compressed;
 
 timeFormat      general;
 
 timePrecision   6;
 
-runTimeModifiable true;
+runTimeModifiable yes;
 
 adjustTimeStep  yes;
 
 maxCo           0.5;
-
+maxAlphaCo      0.5;
 maxDeltaT       1;
 
 functions
@@ -59,18 +59,17 @@ functions
         functionObjectLibs ("libsampling.so");
         outputControl   timeStep;
         outputInterval  1;
-
-        fields
-        (
-            p
-        );
-
         probeLocations
         (
             ( 0 9.95 19.77 )
             ( 0 -9.95 19.77 )
         );
+        fields
+        (
+            p
+        );
     }
 }
 
+
 // ************************************************************************* //
diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/system/fvSchemes b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/system/fvSchemes
index 8bcf9acede4284b03b664045ed2cea86dc99c6e3..814f3d6e0699026d74eddb363d2bbeabf17a675a 100644
--- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/system/fvSchemes
+++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/system/fvSchemes
@@ -50,7 +50,7 @@ snGradSchemes
 fluxRequired
 {
     default         no;
-    p;
+    p_rgh;
     pcorr;
     alpha;
 }
diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/system/fvSolution b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/system/fvSolution
index 6dee08c0579b693721b581bc9791925301aad4cf..11a72d517a651a00bb96bf98b8540c55b2310cd5 100644
--- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/system/fvSolution
+++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/system/fvSolution
@@ -40,7 +40,7 @@ solvers
         maxIter         100;
     }
 
-    p
+    p_rgh
     {
         solver          GAMG;
         tolerance       1e-08;
@@ -55,7 +55,7 @@ solvers
         mergeLevels     1;
     }
 
-    pFinal
+    p_rghFinal
     {
         solver          PCG;
         preconditioner
diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/0/p b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/0/p_rgh
similarity index 97%
rename from tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/0/p
rename to tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/0/p_rgh
index 6d26a2c77bd5e06d83f40eea02b51090cd1b4198..049d7a597630e590f1c6dd571a287ac87e626ac7 100644
--- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/0/p
+++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/0/p_rgh
@@ -10,7 +10,7 @@ FoamFile
     version     2.0;
     format      ascii;
     class       volScalarField;
-    object      p;
+    object      p_rgh;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/constant/polyMesh/blockMeshDict b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/constant/polyMesh/blockMeshDict
deleted file mode 100644
index e0e276608f5aa2cef8f0c9b7a1593ce7d3f631be..0000000000000000000000000000000000000000
--- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/constant/polyMesh/blockMeshDict
+++ /dev/null
@@ -1,135 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    format      ascii;
-    class       dictionary;
-    object      blockMeshDict;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// General m4 macros
-
-  
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// User-defined parameters
-
-convertToMeters 1;
-
-       // Length of tank (x-direction)
-       // Breadth of tank (y-direction)
-       // Depth of tank (z-direction)
-
-      // Depth to the top (height) of lower chamfer
-     // Height of upper chamfer
-
- // Angle of lower chamfer to the horizontal
- // Angle of upper chamfer to the horizontal
-
-  // Centre of gravity in y-direction
-         // Centre of gravity in z-direction
-
-      // Number of cells in the length (1 for 2D)
-      // Number of cells in the breadth
-     // Number of cells in the height of the lower champfer
-      // Number of cells in the height between the chamfers
-    // Number of cells in the height of the upper champfer
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// Derived parameters
-
- // Breadth to the top (height) of lower chamfer
- // Breadth of upper chamfer
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// Parametric description
-
-vertices
-(
-    (-10 -15 -10.0) // Vertex bllcb = 0 
-    (-10 -20 -5)  // Vertex bllc = 1 
-    (-10 -20 10)  // Vertex bluc = 2 
-    (-10 -10 20) // Vertex bluct = 3 
-    (-10 15 -10.0) // Vertex brlcb = 4 
-    (-10 20 -5)  // Vertex brlc = 5 
-    (-10 20 10)  // Vertex bruc = 6 
-    (-10 10 20) // Vertex bruct = 7 
-
-    (10 -15 -10.0) // Vertex fllcb = 8 
-    (10 -20 -5)  // Vertex fllc = 9 
-    (10 -20 10)  // Vertex fluc = 10 
-    (10 -10 20) // Vertex fluct = 11 
-    (10 15 -10.0) // Vertex frlcb = 12 
-    (10 20 -5)  // Vertex frlc = 13 
-    (10 20 10)  // Vertex fruc = 14 
-    (10 10 20) // Vertex fruct = 15 
-);
-
-blocks
-(
-    // block0
-    hex (0 4 5 1 8 12 13 9)
-    (40 6 19)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (1 5 6 2 9 13 14 10)
-    (40 16 19)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (2 6 7 3 10 14 15 11)
-    (40 12 19)
-    simpleGrading (1 1 1)
-);
-
-patches
-(
-    patch walls
-    (
-        (0 4 12 8)
-        (4 5 13 12)
-        (5 6 14 13)
-        (6 7 15 14)
-        (7 3 11 15)
-        (3 2 10 11)
-        (2 1 9 10)
-        (1 0 8 9)
-        (8 12 13 9)
-        (9 13 14 10)
-        (10 14 15 11)
-        (0 1 5 4)
-        (1 2 6 5)
-        (2 3 7 6)
-    )
-);
-
-// ************************************************************************* //
diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/system/controlDict b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/system/controlDict
index b41d481d9e01a855a45c8c37c56bc05792de47f5..69f4f2ca46203b5851bb285c2499946106299764 100644
--- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/system/controlDict
+++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/system/controlDict
@@ -37,18 +37,18 @@ writeFormat     ascii;
 
 writePrecision  6;
 
-writeCompression off;
+writeCompression compressed;
 
 timeFormat      general;
 
 timePrecision   6;
 
-runTimeModifiable true;
+runTimeModifiable yes;
 
 adjustTimeStep  yes;
 
 maxCo           0.5;
-
+maxAlphaCo      0.5;
 maxDeltaT       1;
 
 functions
@@ -59,18 +59,17 @@ functions
         functionObjectLibs ("libsampling.so");
         outputControl   timeStep;
         outputInterval  1;
-
-        fields
-        (
-            p
-        );
-
         probeLocations
         (
             ( 0 9.95 19.77 )
             ( 0 -9.95 19.77 )
         );
+        fields
+        (
+            p
+        );
     }
 }
 
+
 // ************************************************************************* //
diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/system/fvSchemes b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/system/fvSchemes
index 8bcf9acede4284b03b664045ed2cea86dc99c6e3..814f3d6e0699026d74eddb363d2bbeabf17a675a 100644
--- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/system/fvSchemes
+++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/system/fvSchemes
@@ -50,7 +50,7 @@ snGradSchemes
 fluxRequired
 {
     default         no;
-    p;
+    p_rgh;
     pcorr;
     alpha;
 }
diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/system/fvSolution b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/system/fvSolution
index 6dee08c0579b693721b581bc9791925301aad4cf..11a72d517a651a00bb96bf98b8540c55b2310cd5 100644
--- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/system/fvSolution
+++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/system/fvSolution
@@ -40,7 +40,7 @@ solvers
         maxIter         100;
     }
 
-    p
+    p_rgh
     {
         solver          GAMG;
         tolerance       1e-08;
@@ -55,7 +55,7 @@ solvers
         mergeLevels     1;
     }
 
-    pFinal
+    p_rghFinal
     {
         solver          PCG;
         preconditioner
diff --git a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/0/p b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/0/p_rgh
similarity index 97%
rename from tutorials/multiphase/interDyMFoam/ras/testTubeMixer/0/p
rename to tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/0/p_rgh
index 6d26a2c77bd5e06d83f40eea02b51090cd1b4198..049d7a597630e590f1c6dd571a287ac87e626ac7 100644
--- a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/0/p
+++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/0/p_rgh
@@ -10,7 +10,7 @@ FoamFile
     version     2.0;
     format      ascii;
     class       volScalarField;
-    object      p;
+    object      p_rgh;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/constant/dynamicMeshDict b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/constant/dynamicMeshDict
index efb48a0cbc148015b21c9f64e0448768454204a2..5e0445be8b6f0d892e7b170016b569ed44018c88 100644
--- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/constant/dynamicMeshDict
+++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/constant/dynamicMeshDict
@@ -22,8 +22,8 @@ solidBodyMotionFvMeshCoeffs
     solidBodyMotionFunction tabulated6DoFMotion;
     tabulated6DoFMotionCoeffs
     {
-        CofG            (0 0 0);
-        timeDataFileName "constant/6DoF.dat";
+        CofG            ( 0 0 0 );
+        timeDataFileName "$FOAM_CASE/constant/6DoF.dat";
     }
 }
 
diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/constant/polyMesh/blockMeshDict b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/constant/polyMesh/blockMeshDict
deleted file mode 100644
index e0e276608f5aa2cef8f0c9b7a1593ce7d3f631be..0000000000000000000000000000000000000000
--- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/constant/polyMesh/blockMeshDict
+++ /dev/null
@@ -1,135 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    format      ascii;
-    class       dictionary;
-    object      blockMeshDict;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// General m4 macros
-
-  
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// User-defined parameters
-
-convertToMeters 1;
-
-       // Length of tank (x-direction)
-       // Breadth of tank (y-direction)
-       // Depth of tank (z-direction)
-
-      // Depth to the top (height) of lower chamfer
-     // Height of upper chamfer
-
- // Angle of lower chamfer to the horizontal
- // Angle of upper chamfer to the horizontal
-
-  // Centre of gravity in y-direction
-         // Centre of gravity in z-direction
-
-      // Number of cells in the length (1 for 2D)
-      // Number of cells in the breadth
-     // Number of cells in the height of the lower champfer
-      // Number of cells in the height between the chamfers
-    // Number of cells in the height of the upper champfer
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// Derived parameters
-
- // Breadth to the top (height) of lower chamfer
- // Breadth of upper chamfer
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// Parametric description
-
-vertices
-(
-    (-10 -15 -10.0) // Vertex bllcb = 0 
-    (-10 -20 -5)  // Vertex bllc = 1 
-    (-10 -20 10)  // Vertex bluc = 2 
-    (-10 -10 20) // Vertex bluct = 3 
-    (-10 15 -10.0) // Vertex brlcb = 4 
-    (-10 20 -5)  // Vertex brlc = 5 
-    (-10 20 10)  // Vertex bruc = 6 
-    (-10 10 20) // Vertex bruct = 7 
-
-    (10 -15 -10.0) // Vertex fllcb = 8 
-    (10 -20 -5)  // Vertex fllc = 9 
-    (10 -20 10)  // Vertex fluc = 10 
-    (10 -10 20) // Vertex fluct = 11 
-    (10 15 -10.0) // Vertex frlcb = 12 
-    (10 20 -5)  // Vertex frlc = 13 
-    (10 20 10)  // Vertex fruc = 14 
-    (10 10 20) // Vertex fruct = 15 
-);
-
-blocks
-(
-    // block0
-    hex (0 4 5 1 8 12 13 9)
-    (40 6 19)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (1 5 6 2 9 13 14 10)
-    (40 16 19)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (2 6 7 3 10 14 15 11)
-    (40 12 19)
-    simpleGrading (1 1 1)
-);
-
-patches
-(
-    patch walls
-    (
-        (0 4 12 8)
-        (4 5 13 12)
-        (5 6 14 13)
-        (6 7 15 14)
-        (7 3 11 15)
-        (3 2 10 11)
-        (2 1 9 10)
-        (1 0 8 9)
-        (8 12 13 9)
-        (9 13 14 10)
-        (10 14 15 11)
-        (0 1 5 4)
-        (1 2 6 5)
-        (2 3 7 6)
-    )
-);
-
-// ************************************************************************* //
diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/system/controlDict b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/system/controlDict
index b41d481d9e01a855a45c8c37c56bc05792de47f5..69f4f2ca46203b5851bb285c2499946106299764 100644
--- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/system/controlDict
+++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/system/controlDict
@@ -37,18 +37,18 @@ writeFormat     ascii;
 
 writePrecision  6;
 
-writeCompression off;
+writeCompression compressed;
 
 timeFormat      general;
 
 timePrecision   6;
 
-runTimeModifiable true;
+runTimeModifiable yes;
 
 adjustTimeStep  yes;
 
 maxCo           0.5;
-
+maxAlphaCo      0.5;
 maxDeltaT       1;
 
 functions
@@ -59,18 +59,17 @@ functions
         functionObjectLibs ("libsampling.so");
         outputControl   timeStep;
         outputInterval  1;
-
-        fields
-        (
-            p
-        );
-
         probeLocations
         (
             ( 0 9.95 19.77 )
             ( 0 -9.95 19.77 )
         );
+        fields
+        (
+            p
+        );
     }
 }
 
+
 // ************************************************************************* //
diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/system/fvSchemes b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/system/fvSchemes
index 8bcf9acede4284b03b664045ed2cea86dc99c6e3..814f3d6e0699026d74eddb363d2bbeabf17a675a 100644
--- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/system/fvSchemes
+++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/system/fvSchemes
@@ -50,7 +50,7 @@ snGradSchemes
 fluxRequired
 {
     default         no;
-    p;
+    p_rgh;
     pcorr;
     alpha;
 }
diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/system/fvSolution b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/system/fvSolution
index 6dee08c0579b693721b581bc9791925301aad4cf..11a72d517a651a00bb96bf98b8540c55b2310cd5 100644
--- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/system/fvSolution
+++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/system/fvSolution
@@ -40,7 +40,7 @@ solvers
         maxIter         100;
     }
 
-    p
+    p_rgh
     {
         solver          GAMG;
         tolerance       1e-08;
@@ -55,7 +55,7 @@ solvers
         mergeLevels     1;
     }
 
-    pFinal
+    p_rghFinal
     {
         solver          PCG;
         preconditioner
diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/0/p b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/0/p_rgh
similarity index 97%
rename from tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/0/p
rename to tutorials/multiphase/interDyMFoam/ras/testTubeMixer/0/p_rgh
index 6d26a2c77bd5e06d83f40eea02b51090cd1b4198..049d7a597630e590f1c6dd571a287ac87e626ac7 100644
--- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/0/p
+++ b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/0/p_rgh
@@ -10,7 +10,7 @@ FoamFile
     version     2.0;
     format      ascii;
     class       volScalarField;
-    object      p;
+    object      p_rgh;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/Allclean b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/Allclean
index 4b3e979c4a186c0aacc698997691a0ba604c672e..82e093ec03dc36c50fb1281de4b51bf917537199 100755
--- a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/Allclean
+++ b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/Allclean
@@ -1,7 +1,10 @@
 #!/bin/sh
 cd ${0%/*} || exit 1    # run from this directory
 
-foamCleanTutorials cases
-rm -rf 0/alpha1.gz
+# Source tutorial clean functions
+. $WM_PROJECT_DIR/bin/tools/CleanFunctions
+
+cleanCase
+rm -rf 0/alpha1
 
 # ----------------------------------------------------------------- end-of-file
diff --git a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/constant/polyMesh/boundary b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/constant/polyMesh/boundary
new file mode 100644
index 0000000000000000000000000000000000000000..1057c82b824aad566dda41aaa6cda491f28c7681
--- /dev/null
+++ b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/constant/polyMesh/boundary
@@ -0,0 +1,28 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       polyBoundaryMesh;
+    location    "constant/polyMesh";
+    object      boundary;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+1
+(
+    walls
+    {
+        type            wall;
+        nFaces          1050;
+        startFace       3225;
+    }
+)
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/system/controlDict b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/system/controlDict
index 0af8c14d6665883ec2ae59013a8b5e01effad1cf..ff0727279b441857198cacdd0b2820de3fa9267a 100644
--- a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/system/controlDict
+++ b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/system/controlDict
@@ -48,6 +48,7 @@ runTimeModifiable true;
 adjustTimeStep  yes;
 
 maxCo           0.5;
+maxAlphaCo      0.5;
 
 maxDeltaT       1;
 
diff --git a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/system/fvSchemes b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/system/fvSchemes
index 8bcf9acede4284b03b664045ed2cea86dc99c6e3..814f3d6e0699026d74eddb363d2bbeabf17a675a 100644
--- a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/system/fvSchemes
+++ b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/system/fvSchemes
@@ -50,7 +50,7 @@ snGradSchemes
 fluxRequired
 {
     default         no;
-    p;
+    p_rgh;
     pcorr;
     alpha;
 }
diff --git a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/system/fvSolution b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/system/fvSolution
index 45fa8b9245adbe7821145c255f64ce55f5ed2498..b2f497532fad48f5c00c520d2bf3c669d4c99924 100644
--- a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/system/fvSolution
+++ b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/system/fvSolution
@@ -40,7 +40,7 @@ solvers
         maxIter         100;
     }
 
-    p
+    p_rgh
     {
         solver          GAMG;
         tolerance       1e-08;
@@ -55,7 +55,7 @@ solvers
         mergeLevels     1;
     }
 
-    pFinal
+    p_rghFinal
     {
         solver          PCG;
         preconditioner
diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/Make/files b/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/Make/files
deleted file mode 100644
index 706858442e6a56a1a60fb8bb7377b9879e221fd0..0000000000000000000000000000000000000000
--- a/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/Make/files
+++ /dev/null
@@ -1,3 +0,0 @@
-MRFInterFoam.C
-
-EXE = $(FOAM_USER_APPBIN)/MRFInterFoam
diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/pEqn.H b/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/pEqn.H
deleted file mode 100644
index 0a96cfc53310b15ea4275cc8d11d4d4283e71c8d..0000000000000000000000000000000000000000
--- a/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/pEqn.H
+++ /dev/null
@@ -1,49 +0,0 @@
-{
-    volScalarField rUA = 1.0/UEqn.A();
-    surfaceScalarField rUAf = fvc::interpolate(rUA);
-
-    U = rUA*UEqn.H();
-
-    surfaceScalarField phiU
-    (
-        "phiU",
-        (fvc::interpolate(U) & mesh.Sf())
-    //+ fvc::ddtPhiCorr(rUA, rho, U, phi)
-    );
-    mrfZones.relativeFlux(phiU);
-
-    phi = phiU +
-        (
-            fvc::interpolate(interface.sigmaK())
-           *fvc::snGrad(alpha1)*mesh.magSf()
-          + fvc::interpolate(rho)*(g & mesh.Sf())
-        )*rUAf;
-    adjustPhi(phi, U, p);
-
-    for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
-    {
-        fvScalarMatrix pEqn
-        (
-            fvm::laplacian(rUAf, p) == fvc::div(phi)
-        );
-
-        pEqn.setReference(pRefCell, pRefValue);
-
-        if (corr == nCorr-1 && nonOrth == nNonOrthCorr)
-        {
-            pEqn.solve(mesh.solver(p.name() + "Final"));
-        }
-        else
-        {
-            pEqn.solve(mesh.solver(p.name()));
-        }
-
-        if (nonOrth == nNonOrthCorr)
-        {
-            phi -= pEqn.flux();
-        }
-    }
-
-    U += rUA*fvc::reconstruct((phi - phiU)/rUAf);
-    U.correctBoundaryConditions();
-}
diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/polyMesh/blockMeshDict b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/polyMesh/blockMeshDict
deleted file mode 100644
index 97fcef9e025a8177b94cf7d48a67d153062932fc..0000000000000000000000000000000000000000
--- a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/polyMesh/blockMeshDict
+++ /dev/null
@@ -1,818 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    format      ascii;
-    class       dictionary;
-    object      blockMeshDict;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// General macros to create 2D/extruded-2D meshes
-
-
-
-
-
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-convertToMeters 0.1;
-
-// Hub radius
-
-
-// Impeller-tip radius
-
-
-// Baffle-tip radius
-
-
-// Tank radius
-
-
-// MRF region radius
-
-
-// Thickness of 2D slab
-
-
-// Base z
-
-
-// Top z
-
-
-// Number of cells radially between hub and impeller tip
-
-
-// Number of cells radially in each of the two regions between
-// impeller and baffle tips
-
-
-// Number of cells radially between baffle tip and tank
-
-
-// Number of cells azimuthally in each of the 8 blocks
-
-
-// Number of cells in the thickness of the slab
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-vertices
-(
-    (0.2 0 0) // Vertex r0b = 0 
-    (0.2 0 0) // Vertex r0sb = 1 
-    (0.141421356364228 -0.141421356110391 0) // Vertex r1b = 2 
-    (3.58979347393082e-10 -0.2 0) // Vertex r2b = 3 
-    (3.58979347393082e-10 -0.2 0) // Vertex r2sb = 4 
-    (-0.141421355856554 -0.141421356618065 0) // Vertex r3b = 5 
-    (-0.2 7.17958694786164e-10 0) // Vertex r4b = 6 
-    (-0.2 7.17958694786164e-10 0) // Vertex r4sb = 7 
-    (-0.141421355856554 0.141421356618065 0) // Vertex r5b = 8 
-    (3.58979347393082e-10 0.2 0) // Vertex r6b = 9 
-    (3.58979347393082e-10 0.2 0) // Vertex r6sb = 10 
-    (0.141421356364228 0.141421356110391 0) // Vertex r7b = 11 
-
-    (0.5 0 0) // Vertex rb0b = 12 
-    (0.353553390910569 -0.353553390275978 0) // Vertex rb1b = 13 
-    (8.97448368482705e-10 -0.5 0) // Vertex rb2b = 14 
-    (-0.353553389641386 -0.353553391545162 0) // Vertex rb3b = 15 
-    (-0.5 1.79489673696541e-09 0) // Vertex rb4b = 16 
-    (-0.353553389641386 0.353553391545162 0) // Vertex rb5b = 17 
-    (8.97448368482705e-10 0.5 0) // Vertex rb6b = 18 
-    (0.353553390910569 0.353553390275978 0) // Vertex rb7b = 19 
-
-    (0.6 0 0) // Vertex ri0b = 20 
-    (0.424264069092683 -0.424264068331174 0) // Vertex ri1b = 21 
-    (1.07693804217925e-09 -0.6 0) // Vertex ri2b = 22 
-    (-0.424264067569663 -0.424264069854194 0) // Vertex ri3b = 23 
-    (-0.6 2.15387608435849e-09 0) // Vertex ri4b = 24 
-    (-0.424264067569663 0.424264069854194 0) // Vertex ri5b = 25 
-    (1.07693804217925e-09 0.6 0) // Vertex ri6b = 26 
-    (0.424264069092683 0.424264068331174 0) // Vertex ri7b = 27 
-
-    (0.7 0 0) // Vertex Rb0b = 28 
-    (0.494974747274797 -0.494974746386369 0) // Vertex Rb1b = 29 
-    (1.25642771587579e-09 -0.7 0) // Vertex Rb2b = 30 
-    (-0.49497474549794 -0.494974748163226 0) // Vertex Rb3b = 31 
-    (-0.7 2.51285543175157e-09 0) // Vertex Rb4b = 32 
-    (-0.49497474549794 0.494974748163226 0) // Vertex Rb5b = 33 
-    (1.25642771587579e-09 0.7 0) // Vertex Rb6b = 34 
-    (0.494974747274797 0.494974746386369 0) // Vertex Rb7b = 35 
-
-    (1 0 0) // Vertex R0b = 36 
-    (0.707106781821139 -0.707106780551956 0) // Vertex R1b = 37 
-    (0.707106781821139 -0.707106780551956 0) // Vertex R1sb = 38 
-    (1.79489673696541e-09 -1 0) // Vertex R2b = 39 
-    (-0.707106779282772 -0.707106783090323 0) // Vertex R3b = 40 
-    (-0.707106779282772 -0.707106783090323 0) // Vertex R3sb = 41 
-    (-1 3.58979347393082e-09 0) // Vertex R4b = 42 
-    (-0.707106779282772 0.707106783090323 0) // Vertex R5b = 43 
-    (-0.707106779282772 0.707106783090323 0) // Vertex R5sb = 44 
-    (1.79489673696541e-09 1 0) // Vertex R6b = 45 
-    (0.707106781821139 0.707106780551956 0) // Vertex R7b = 46 
-    (0.707106781821139 0.707106780551956 0) // Vertex R7sb = 47 
-
-    (0.2 0 0.1) // Vertex r0t = 48 
-    (0.2 0 0.1) // Vertex r0st = 49 
-    (0.141421356364228 -0.141421356110391 0.1) // Vertex r1t = 50 
-    (3.58979347393082e-10 -0.2 0.1) // Vertex r2t = 51 
-    (3.58979347393082e-10 -0.2 0.1) // Vertex r2st = 52 
-    (-0.141421355856554 -0.141421356618065 0.1) // Vertex r3t = 53 
-    (-0.2 7.17958694786164e-10 0.1) // Vertex r4t = 54 
-    (-0.2 7.17958694786164e-10 0.1) // Vertex r4st = 55 
-    (-0.141421355856554 0.141421356618065 0.1) // Vertex r5t = 56 
-    (3.58979347393082e-10 0.2 0.1) // Vertex r6t = 57 
-    (3.58979347393082e-10 0.2 0.1) // Vertex r6st = 58 
-    (0.141421356364228 0.141421356110391 0.1) // Vertex r7t = 59 
-
-    (0.5 0 0.1) // Vertex rb0t = 60 
-    (0.353553390910569 -0.353553390275978 0.1) // Vertex rb1t = 61 
-    (8.97448368482705e-10 -0.5 0.1) // Vertex rb2t = 62 
-    (-0.353553389641386 -0.353553391545162 0.1) // Vertex rb3t = 63 
-    (-0.5 1.79489673696541e-09 0.1) // Vertex rb4t = 64 
-    (-0.353553389641386 0.353553391545162 0.1) // Vertex rb5t = 65 
-    (8.97448368482705e-10 0.5 0.1) // Vertex rb6t = 66 
-    (0.353553390910569 0.353553390275978 0.1) // Vertex rb7t = 67 
-
-    (0.6 0 0.1) // Vertex ri0t = 68 
-    (0.424264069092683 -0.424264068331174 0.1) // Vertex ri1t = 69 
-    (1.07693804217925e-09 -0.6 0.1) // Vertex ri2t = 70 
-    (-0.424264067569663 -0.424264069854194 0.1) // Vertex ri3t = 71 
-    (-0.6 2.15387608435849e-09 0.1) // Vertex ri4t = 72 
-    (-0.424264067569663 0.424264069854194 0.1) // Vertex ri5t = 73 
-    (1.07693804217925e-09 0.6 0.1) // Vertex ri6t = 74 
-    (0.424264069092683 0.424264068331174 0.1) // Vertex ri7t = 75 
-
-    (0.7 0 0.1) // Vertex Rb0t = 76 
-    (0.494974747274797 -0.494974746386369 0.1) // Vertex Rb1t = 77 
-    (1.25642771587579e-09 -0.7 0.1) // Vertex Rb2t = 78 
-    (-0.49497474549794 -0.494974748163226 0.1) // Vertex Rb3t = 79 
-    (-0.7 2.51285543175157e-09 0.1) // Vertex Rb4t = 80 
-    (-0.49497474549794 0.494974748163226 0.1) // Vertex Rb5t = 81 
-    (1.25642771587579e-09 0.7 0.1) // Vertex Rb6t = 82 
-    (0.494974747274797 0.494974746386369 0.1) // Vertex Rb7t = 83 
-
-    (1 0 0.1) // Vertex R0t = 84 
-    (0.707106781821139 -0.707106780551956 0.1) // Vertex R1t = 85 
-    (0.707106781821139 -0.707106780551956 0.1) // Vertex R1st = 86 
-    (1.79489673696541e-09 -1 0.1) // Vertex R2t = 87 
-    (-0.707106779282772 -0.707106783090323 0.1) // Vertex R3t = 88 
-    (-0.707106779282772 -0.707106783090323 0.1) // Vertex R3st = 89 
-    (-1 3.58979347393082e-09 0.1) // Vertex R4t = 90 
-    (-0.707106779282772 0.707106783090323 0.1) // Vertex R5t = 91 
-    (-0.707106779282772 0.707106783090323 0.1) // Vertex R5st = 92 
-    (1.79489673696541e-09 1 0.1) // Vertex R6t = 93 
-    (0.707106781821139 0.707106780551956 0.1) // Vertex R7t = 94 
-    (0.707106781821139 0.707106780551956 0.1) // Vertex R7st = 95 
-);
-
-blocks
-(
-    // block0
-    hex (0 2 13 12 48 50 61 60)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (2 4 14 13 50 52 62 61)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (3 5 15 14 51 53 63 62)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block3
-    hex (5 7 16 15 53 55 64 63)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block4
-    hex (6 8 17 16 54 56 65 64)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block5
-    hex (8 10 18 17 56 58 66 65)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block6
-    hex (9 11 19 18 57 59 67 66)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block7
-    hex (11 1 12 19 59 49 60 67)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block0
-    hex (12 13 21 20 60 61 69 68)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (13 14 22 21 61 62 70 69)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (14 15 23 22 62 63 71 70)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block3
-    hex (15 16 24 23 63 64 72 71)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block4
-    hex (16 17 25 24 64 65 73 72)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block5
-    hex (17 18 26 25 65 66 74 73)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block6
-    hex (18 19 27 26 66 67 75 74)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block7
-    hex (19 12 20 27 67 60 68 75)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block0
-    hex (20 21 29 28 68 69 77 76)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (21 22 30 29 69 70 78 77)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (22 23 31 30 70 71 79 78)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block3
-    hex (23 24 32 31 71 72 80 79)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block4
-    hex (24 25 33 32 72 73 81 80)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block5
-    hex (25 26 34 33 73 74 82 81)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block6
-    hex (26 27 35 34 74 75 83 82)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block7
-    hex (27 20 28 35 75 68 76 83)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block0
-    hex (28 29 38 36 76 77 86 84)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (29 30 39 37 77 78 87 85)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (30 31 41 39 78 79 89 87)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block3
-    hex (31 32 42 40 79 80 90 88)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block4
-    hex (32 33 44 42 80 81 92 90)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block5
-    hex (33 34 45 43 81 82 93 91)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block6
-    hex (34 35 47 45 82 83 95 93)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block7
-    hex (35 28 36 46 83 76 84 94)
-    (12 12 1)
-    simpleGrading (1 1 1)
-);
-
-edges
-(
-    arc 0 2 (0.184775906536601 -0.0765366863901046 0)
-    arc 2 4 (0.0765366867217582 -0.184775906399226 0)
-    arc 3 5 (-0.0765366860584508 -0.184775906673977 0)
-    arc 5 7 (-0.18477590626185 -0.0765366870534118 0)
-    arc 6 8 (-0.18477590626185 0.0765366870534118 0)
-    arc 8 10 (-0.0765366860584508 0.184775906673977 0)
-    arc 9 11 (0.0765366867217582 0.184775906399226 0)
-    arc 11 1 (0.184775906536601 0.0765366863901046 0)
-
-    arc 12 13 (0.461939766341503 -0.191341715975262 0)
-    arc 13 14 (0.191341716804395 -0.461939765998065 0)
-    arc 14 15 (-0.191341715146127 -0.461939766684942 0)
-    arc 15 16 (-0.461939765654626 -0.19134171763353 0)
-    arc 16 17 (-0.461939765654626 0.19134171763353 0)
-    arc 17 18 (-0.191341715146127 0.461939766684942 0)
-    arc 18 19 (0.191341716804395 0.461939765998065 0)
-    arc 19 12 (0.461939766341503 0.191341715975262 0)
-
-    arc 20 21 (0.554327719609804 -0.229610059170314 0)
-    arc 21 22 (0.229610060165275 -0.554327719197677 0)
-    arc 22 23 (-0.229610058175352 -0.55432772002193 0)
-    arc 23 24 (-0.554327718785551 -0.229610061160235 0)
-    arc 24 25 (-0.554327718785551 0.229610061160235 0)
-    arc 25 26 (-0.229610058175352 0.55432772002193 0)
-    arc 26 27 (0.229610060165275 0.554327719197677 0)
-    arc 27 20 (0.554327719609804 0.229610059170314 0)
-
-    arc 28 29 (0.646715672878104 -0.267878402365366 0)
-    arc 29 30 (0.267878403526154 -0.64671567239729 0)
-    arc 30 31 (-0.267878401204578 -0.646715673358918 0)
-    arc 31 32 (-0.646715671916476 -0.267878404686941 0)
-    arc 32 33 (-0.646715671916476 0.267878404686941 0)
-    arc 33 34 (-0.267878401204578 0.646715673358918 0)
-    arc 34 35 (0.267878403526154 0.64671567239729 0)
-    arc 35 28 (0.646715672878104 0.267878402365366 0)
-
-    arc 36 38 (0.923879532683006 -0.382683431950523 0)
-    arc 37 39 (0.382683433608791 -0.923879531996129 0)
-    arc 39 41 (-0.382683430292254 -0.923879533369883 0)
-    arc 40 42 (-0.923879531309252 -0.382683435267059 0)
-    arc 42 44 (-0.923879531309252 0.382683435267059 0)
-    arc 43 45 (-0.382683430292254 0.923879533369883 0)
-    arc 45 47 (0.382683433608791 0.923879531996129 0)
-    arc 46 36 (0.923879532683006 0.382683431950523 0)
-
-    arc 48 50 (0.184775906536601 -0.0765366863901046 0.1)
-    arc 50 52 (0.0765366867217582 -0.184775906399226 0.1)
-    arc 51 53 (-0.0765366860584508 -0.184775906673977 0.1)
-    arc 53 55 (-0.18477590626185 -0.0765366870534118 0.1)
-    arc 54 56 (-0.18477590626185 0.0765366870534118 0.1)
-    arc 56 58 (-0.0765366860584508 0.184775906673977 0.1)
-    arc 57 59 (0.0765366867217582 0.184775906399226 0.1)
-    arc 59 49 (0.184775906536601 0.0765366863901046 0.1)
-
-    arc 60 61 (0.461939766341503 -0.191341715975262 0.1)
-    arc 61 62 (0.191341716804395 -0.461939765998065 0.1)
-    arc 62 63 (-0.191341715146127 -0.461939766684942 0.1)
-    arc 63 64 (-0.461939765654626 -0.19134171763353 0.1)
-    arc 64 65 (-0.461939765654626 0.19134171763353 0.1)
-    arc 65 66 (-0.191341715146127 0.461939766684942 0.1)
-    arc 66 67 (0.191341716804395 0.461939765998065 0.1)
-    arc 67 60 (0.461939766341503 0.191341715975262 0.1)
-
-    arc 68 69 (0.554327719609804 -0.229610059170314 0.1)
-    arc 69 70 (0.229610060165275 -0.554327719197677 0.1)
-    arc 70 71 (-0.229610058175352 -0.55432772002193 0.1)
-    arc 71 72 (-0.554327718785551 -0.229610061160235 0.1)
-    arc 72 73 (-0.554327718785551 0.229610061160235 0.1)
-    arc 73 74 (-0.229610058175352 0.55432772002193 0.1)
-    arc 74 75 (0.229610060165275 0.554327719197677 0.1)
-    arc 75 68 (0.554327719609804 0.229610059170314 0.1)
-
-    arc 76 77 (0.646715672878104 -0.267878402365366 0.1)
-    arc 77 78 (0.267878403526154 -0.64671567239729 0.1)
-    arc 78 79 (-0.267878401204578 -0.646715673358918 0.1)
-    arc 79 80 (-0.646715671916476 -0.267878404686941 0.1)
-    arc 80 81 (-0.646715671916476 0.267878404686941 0.1)
-    arc 81 82 (-0.267878401204578 0.646715673358918 0.1)
-    arc 82 83 (0.267878403526154 0.64671567239729 0.1)
-    arc 83 76 (0.646715672878104 0.267878402365366 0.1)
-
-    arc 84 86 (0.923879532683006 -0.382683431950523 0.1)
-    arc 85 87 (0.382683433608791 -0.923879531996129 0.1)
-    arc 87 89 (-0.382683430292254 -0.923879533369883 0.1)
-    arc 88 90 (-0.923879531309252 -0.382683435267059 0.1)
-    arc 90 92 (-0.923879531309252 0.382683435267059 0.1)
-    arc 91 93 (-0.382683430292254 0.923879533369883 0.1)
-    arc 93 95 (0.382683433608791 0.923879531996129 0.1)
-    arc 94 84 (0.923879532683006 0.382683431950523 0.1)
-);
-
-patches
-(
-    wall rotor
-    (
-        (0 2 50 48)
-        (2 4 52 50)
-        (3 5 53 51)
-        (5 7 55 53)
-        (6 8 56 54)
-        (8 10 58 56)
-        (9 11 59 57)
-        (11 1 49 59)
-
-        (0 12 60 48)
-        (1 12 60 49)
-
-        (3 14 62 51)
-        (4 14 62 52)
-
-        (6 16 64 54)
-        (7 16 64 55)
-
-        (9 18 66 57)
-        (10 18 66 58)
-    )
-
-    wall stator
-    (
-        (36 38 86 84)
-        (37 39 87 85)
-        (39 41 89 87)
-        (40 42 90 88)
-        (42 44 92 90)
-        (43 45 93 91)
-        (45 47 95 93)
-        (46 36 84 94)
-
-        (37 29 77 85)
-        (38 29 77 86)
-
-        (40 31 79 88)
-        (41 31 79 89)
-
-        (43 33 81 91)
-        (44 33 81 92)
-
-        (46 35 83 94)
-        (47 35 83 95)
-    )
-
-    empty front
-    (
-        (48 50 61 60)
-        (50 52 62 61)
-        (51 53 63 62)
-        (53 55 64 63)
-        (54 56 65 64)
-        (56 58 66 65)
-        (57 59 67 66)
-        (59 49 60 67)
-        (60 61 69 68)
-        (61 62 70 69)
-        (62 63 71 70)
-        (63 64 72 71)
-        (64 65 73 72)
-        (65 66 74 73)
-        (66 67 75 74)
-        (67 60 68 75)
-        (68 69 77 76)
-        (69 70 78 77)
-        (70 71 79 78)
-        (71 72 80 79)
-        (72 73 81 80)
-        (73 74 82 81)
-        (74 75 83 82)
-        (75 68 76 83)
-        (76 77 86 84)
-        (77 78 87 85)
-        (78 79 89 87)
-        (79 80 90 88)
-        (80 81 92 90)
-        (81 82 93 91)
-        (82 83 95 93)
-        (83 76 84 94)
-    )
-
-    empty back
-    (
-        (0 12 13 2)
-        (2 13 14 4)
-        (3 14 15 5)
-        (5 15 16 7)
-        (6 16 17 8)
-        (8 17 18 10)
-        (9 18 19 11)
-        (11 19 12 1)
-        (12 20 21 13)
-        (13 21 22 14)
-        (14 22 23 15)
-        (15 23 24 16)
-        (16 24 25 17)
-        (17 25 26 18)
-        (18 26 27 19)
-        (19 27 20 12)
-        (20 28 29 21)
-        (21 29 30 22)
-        (22 30 31 23)
-        (23 31 32 24)
-        (24 32 33 25)
-        (25 33 34 26)
-        (26 34 35 27)
-        (27 35 28 20)
-        (28 36 38 29)
-        (29 37 39 30)
-        (30 39 41 31)
-        (31 40 42 32)
-        (32 42 44 33)
-        (33 43 45 34)
-        (34 45 47 35)
-        (35 46 36 28)
-    )
-);
-
-// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/laminar/Allclean b/tutorials/multiphase/interFoam/laminar/Allclean
index 114bd5f0cb46b911b1776b65ddb22dc3d189508d..909068ce6c37c3bac87a16412d03a4f4829e2d43 100755
--- a/tutorials/multiphase/interFoam/laminar/Allclean
+++ b/tutorials/multiphase/interFoam/laminar/Allclean
@@ -4,26 +4,17 @@ cd ${0%/*} || exit 1    # run from this directory
 # Source tutorial clean functions
 . $WM_PROJECT_DIR/bin/tools/CleanFunctions
 
-keepCases="damBreak"
+keepCases="damBreak capillaryRise"
 loseCases="damBreakFine"
 
-for caseName in $keepCases
+for case in $keepCases
 do
-(
-    cd $caseName || exit
-
-    foamCleanTutorials
-
-    if [ "$caseName" = damBreak ]
-    then
-        cp 0/alpha1.org 0/alpha1
-    fi
-)
+    (cd $case && foamCleanTutorials && rm -rf 0/alpha1)
 done
 
-for caseName in $loseCases
+for case in $loseCases
 do
-    removeCase $caseName
+    removeCase $case
 done
 
 # ----------------------------------------------------------------- end-of-file
diff --git a/tutorials/multiphase/interFoam/laminar/Allrun b/tutorials/multiphase/interFoam/laminar/Allrun
index 3b03260773615f1f1f96cb434c964f906b0b587c..50f30eed5f67d8262acf966817d82e485715ccd7 100755
--- a/tutorials/multiphase/interFoam/laminar/Allrun
+++ b/tutorials/multiphase/interFoam/laminar/Allrun
@@ -7,11 +7,10 @@ cd ${0%/*} || exit 1    # run from this directory
 # Set application name
 application="interFoam"
 
-setDamBreakFine()
+setDamBreakFine ()
 {
     blockMeshDict="constant/polyMesh/blockMeshDict"
     controlDict="system/controlDict"
-
     sed \
     -e s/"23 8"/"46 10"/g \
     -e s/"19 8"/"40 10"/g \
@@ -20,7 +19,6 @@ setDamBreakFine()
     -e s/"19 42\(.*\) 1 1)"/"40 76\1 2 1)"/g \
     $blockMeshDict > temp.$$
     mv temp.$$ $blockMeshDict
-
     sed \
     -e s/"\(deltaT[ \t]*\) 0.001;"/"\1 5e-04;"/g \
     -e s/"\(endTime[ \t]*\) 1;"/"\1 0.4;"/g \
@@ -33,6 +31,7 @@ setDamBreakFine()
     cd damBreak || exit
 
     runApplication blockMesh
+    cp 0/alpha1.org 0/alpha1
     runApplication setFields
     runApplication $application
 )
@@ -45,14 +44,24 @@ cloneCase damBreak damBreakFine
 
     # Modify case
     setDamBreakFine
-    cp ../damBreak/0/alpha1.org 0/alpha1
 
     # And execute
     runApplication blockMesh
+    cp ../damBreak/0/alpha1.org 0/alpha1
     runApplication setFields
     runApplication decomposePar
     runParallel $application 4
     runApplication reconstructPar
 )
 
+# Do capillaryRise
+(
+    cd capillaryRise || exit
+
+    runApplication blockMesh
+    cp 0/alpha1.org 0/alpha1
+    runApplication setFields
+    runApplication $application
+)
+
 # ----------------------------------------------------------------- end-of-file
diff --git a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0-orig/U b/tutorials/multiphase/interFoam/laminar/capillaryRise/0/U
similarity index 88%
rename from tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0-orig/U
rename to tutorials/multiphase/interFoam/laminar/capillaryRise/0/U
index 19b2cafdf38e5df1d289e771c1d0fae6e8f0d8ce..d89380916257ccdfc3f7607d5addd8123ec8a913 100644
--- a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0-orig/U
+++ b/tutorials/multiphase/interFoam/laminar/capillaryRise/0/U
@@ -10,6 +10,7 @@ FoamFile
     version     2.0;
     format      ascii;
     class       volVectorField;
+    location    "0";
     object      U;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -20,22 +21,29 @@ internalField   uniform (0 0 0);
 
 boundaryField
 {
-    walls
+    inlet
     {
-        type            fixedValue;
+        type            pressureInletOutletVelocity;
         value           uniform (0 0 0);
     }
-    obstacle
+
+    atmosphere
     {
-        type            fixedValue;
+        type            pressureInletOutletVelocity;
         value           uniform (0 0 0);
     }
-    atmosphere
+
+    walls
     {
-        type            pressureInletOutletVelocity;
-        phi             phi;
+        type            fixedValue;
         value           uniform (0 0 0);
     }
+
+    defaultFaces
+    {
+        type            empty;
+    }
 }
 
+
 // ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/laminar/damBreak/0/alpha1 b/tutorials/multiphase/interFoam/laminar/capillaryRise/0/alpha1.org
similarity index 82%
rename from tutorials/multiphase/interFoam/laminar/damBreak/0/alpha1
rename to tutorials/multiphase/interFoam/laminar/capillaryRise/0/alpha1.org
index 057f3d15003d42fa3565c8f612931ac91dd7b27a..a0fce8a117db941b6da380315222064eed48fcd7 100644
--- a/tutorials/multiphase/interFoam/laminar/damBreak/0/alpha1
+++ b/tutorials/multiphase/interFoam/laminar/capillaryRise/0/alpha1.org
@@ -20,26 +20,24 @@ internalField   uniform 0;
 
 boundaryField
 {
-    leftWall
+    inlet
     {
-        type            zeroGradient;
-    }
-
-    rightWall
-    {
-        type            zeroGradient;
+        type            inletOutlet;
+        value           uniform 1;
+        inletValue      uniform 1;
     }
 
-    lowerWall
+    atmosphere
     {
         type            zeroGradient;
     }
 
-    atmosphere
+    walls
     {
-        type            inletOutlet;
-        inletValue      uniform 0;
-        value           uniform 0;
+        type           constantAlphaContactAngle;
+        theta0         45;
+        limit          gradient;
+        value          uniform 0;
     }
 
     defaultFaces
@@ -48,4 +46,5 @@ boundaryField
     }
 }
 
+
 // ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/laminar/capillaryRise/0/p_rgh b/tutorials/multiphase/interFoam/laminar/capillaryRise/0/p_rgh
new file mode 100644
index 0000000000000000000000000000000000000000..6c8e598cf5668af926149a5cd1862b5f1cb272ec
--- /dev/null
+++ b/tutorials/multiphase/interFoam/laminar/capillaryRise/0/p_rgh
@@ -0,0 +1,48 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       volScalarField;
+    object      p_rgh;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions      [1 -1 -2 0 0 0 0];
+
+internalField   uniform 0;
+
+boundaryField
+{
+    inlet
+    {
+        type            fixedValue;
+        value           uniform 0;
+    }
+
+    atmosphere
+    {
+        type            fixedValue;
+        value           uniform 0;
+    }
+
+    walls
+    {
+        type            fixedFluxPressure;
+        adjoint         no;
+    }
+
+    defaultFaces
+    {
+        type            empty;
+    }
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/laminar/capillaryRise/constant/g b/tutorials/multiphase/interFoam/laminar/capillaryRise/constant/g
new file mode 100644
index 0000000000000000000000000000000000000000..d3adce7418e8a5e75cbe0767df99f8435c31e0ba
--- /dev/null
+++ b/tutorials/multiphase/interFoam/laminar/capillaryRise/constant/g
@@ -0,0 +1,22 @@
+/*--------------------------------*- 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       uniformDimensionedVectorField;
+    location    "constant";
+    object      g;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions      [0 1 -2 0 0 0 0];
+value           ( 0 -10 0 );
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/laminar/capillaryRise/constant/polyMesh/blockMeshDict b/tutorials/multiphase/interFoam/laminar/capillaryRise/constant/polyMesh/blockMeshDict
new file mode 100644
index 0000000000000000000000000000000000000000..baa5b581d6b0cfdae65d2db17056cda58d2f1767
--- /dev/null
+++ b/tutorials/multiphase/interFoam/laminar/capillaryRise/constant/polyMesh/blockMeshDict
@@ -0,0 +1,67 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       dictionary;
+    object      blockMeshDict;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+convertToMeters 1e-3;
+
+vertices
+(
+    (0 0 0)
+    (1 0 0)
+    (1 20 0)
+    (0 20 0)
+    (0 0 1)
+    (1 0 1)
+    (1 20 1)
+    (0 20 1)
+);
+
+blocks
+(
+    hex (0 1 2 3 4 5 6 7) (20 400 1) simpleGrading (1 1 1)
+);
+
+edges
+(
+);
+
+patches
+(
+    patch inlet
+    (
+        (1 5 4 0)
+    )
+    patch atmosphere
+    (
+        (3 7 6 2)
+    )
+    wall walls
+    (
+        (0 4 7 3)
+        (2 6 5 1)
+    )
+    empty frontAndBack
+    (
+        (0 3 2 1)
+        (4 5 6 7)
+    )
+);
+
+mergePatchPairs
+(
+);
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/laminar/capillaryRise/constant/polyMesh/boundary b/tutorials/multiphase/interFoam/laminar/capillaryRise/constant/polyMesh/boundary
new file mode 100644
index 0000000000000000000000000000000000000000..1d28aaa13e4a9de2dfa3a7f001dfc7f259d534c0
--- /dev/null
+++ b/tutorials/multiphase/interFoam/laminar/capillaryRise/constant/polyMesh/boundary
@@ -0,0 +1,47 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       polyBoundaryMesh;
+    location    "constant/polyMesh";
+    object      boundary;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+4
+(
+    inlet
+    {
+        type            patch;
+        nFaces          20;
+        startFace       15580;
+    }
+    atmosphere
+    {
+        type            patch;
+        physicalType    atmosphere;
+        nFaces          20;
+        startFace       15600;
+    }
+    walls
+    {
+        type            wall;
+        nFaces          800;
+        startFace       15620;
+    }
+    frontAndBack
+    {
+        type            empty;
+        nFaces          16000;
+        startFace       16420;
+    }
+)
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/laminar/capillaryRise/constant/transportProperties b/tutorials/multiphase/interFoam/laminar/capillaryRise/constant/transportProperties
new file mode 100644
index 0000000000000000000000000000000000000000..9fc55e94b42be55e7e814a25e6f382ea433b489d
--- /dev/null
+++ b/tutorials/multiphase/interFoam/laminar/capillaryRise/constant/transportProperties
@@ -0,0 +1,63 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       dictionary;
+    location    "constant";
+    object      transportProperties;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+phase1
+{
+    transportModel  Newtonian;
+    nu              nu [0 2 -1 0 0 0 0] 1e-06;
+    rho             rho [1 -3 0 0 0 0 0] 1000;
+    CrossPowerLawCoeffs
+    {
+        nu0             nu0 [0 2 -1 0 0 0 0] 1e-06;
+        nuInf           nuInf [0 2 -1 0 0 0 0] 1e-06;
+        m               m [0 0 1 0 0 0 0] 1;
+        n               n [0 0 0 0 0 0 0] 0;
+    }
+    BirdCarreauCoeffs
+    {
+        nu0             nu0 [0 2 -1 0 0 0 0] 0.0142515;
+        nuInf           nuInf [0 2 -1 0 0 0 0] 1e-06;
+        k               k [0 0 1 0 0 0 0] 99.6;
+        n               n [0 0 0 0 0 0 0] 0.1003;
+    }
+}
+
+phase2
+{
+    transportModel  Newtonian;
+    nu              nu [0 2 -1 0 0 0 0] 1.48e-05;
+    rho             rho [1 -3 0 0 0 0 0] 1;
+    CrossPowerLawCoeffs
+    {
+        nu0             nu0 [0 2 -1 0 0 0 0] 1e-06;
+        nuInf           nuInf [0 2 -1 0 0 0 0] 1e-06;
+        m               m [0 0 1 0 0 0 0] 1;
+        n               n [0 0 0 0 0 0 0] 0;
+    }
+    BirdCarreauCoeffs
+    {
+        nu0             nu0 [0 2 -1 0 0 0 0] 0.0142515;
+        nuInf           nuInf [0 2 -1 0 0 0 0] 1e-06;
+        k               k [0 0 1 0 0 0 0] 99.6;
+        n               n [0 0 0 0 0 0 0] 0.1003;
+    }
+}
+
+sigma           sigma [1 0 -2 0 0 0 0] 0.0707106;
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/laminar/capillaryRise/constant/turbulenceProperties b/tutorials/multiphase/interFoam/laminar/capillaryRise/constant/turbulenceProperties
new file mode 100644
index 0000000000000000000000000000000000000000..c2c3b28a1b4e8f4a2cae55f58bd61f9b1a67b488
--- /dev/null
+++ b/tutorials/multiphase/interFoam/laminar/capillaryRise/constant/turbulenceProperties
@@ -0,0 +1,21 @@
+/*--------------------------------*- 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    "constant";
+    object      turbulenceProperties;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+simulationType  laminar;
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/laminar/capillaryRise/system/controlDict b/tutorials/multiphase/interFoam/laminar/capillaryRise/system/controlDict
new file mode 100644
index 0000000000000000000000000000000000000000..c5eab38181fb3ec45f2b2a5b2153a2699df6d6b9
--- /dev/null
+++ b/tutorials/multiphase/interFoam/laminar/capillaryRise/system/controlDict
@@ -0,0 +1,56 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       dictionary;
+    location    "system";
+    object      controlDict;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+application     interFoam;
+
+startFrom       latestTime;
+
+startTime       0;
+
+stopAt          endTime;
+
+endTime         0.5;
+
+deltaT          0.001;
+
+writeControl    adjustableRunTime;
+
+writeInterval   0.05;
+
+purgeWrite      0;
+
+writeFormat     ascii;
+
+writePrecision  6;
+
+writeCompression uncompressed;
+
+timeFormat      general;
+
+timePrecision   6;
+
+runTimeModifiable yes;
+
+adjustTimeStep  yes;
+
+maxCo           0.2;
+maxAlphaCo      0.2;
+
+maxDeltaT       1;
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/laminar/capillaryRise/system/fvSchemes b/tutorials/multiphase/interFoam/laminar/capillaryRise/system/fvSchemes
new file mode 100644
index 0000000000000000000000000000000000000000..e32e05bf18e124dae1551f668a5ed25000ca4689
--- /dev/null
+++ b/tutorials/multiphase/interFoam/laminar/capillaryRise/system/fvSchemes
@@ -0,0 +1,59 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       dictionary;
+    location    "system";
+    object      fvSchemes;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+ddtSchemes
+{
+    default Euler;
+}
+
+gradSchemes
+{
+    default         Gauss linear;
+}
+
+divSchemes
+{
+    div(rho*phi,U)  Gauss upwind;
+    div(phi,alpha)  Gauss vanLeer;
+    div(phirb,alpha) Gauss interfaceCompression;
+}
+
+laplacianSchemes
+{
+    default         Gauss linear corrected;
+}
+
+interpolationSchemes
+{
+    default         linear;
+}
+
+snGradSchemes
+{
+    default         corrected;
+}
+
+fluxRequired
+{
+    default         no;
+    p_rgh;
+    pcorr;
+    alpha1;
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/fvSolution b/tutorials/multiphase/interFoam/laminar/capillaryRise/system/fvSolution
similarity index 95%
rename from tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/fvSolution
rename to tutorials/multiphase/interFoam/laminar/capillaryRise/system/fvSolution
index e934a76274bffd673196bcdfb8f18079e629ff1a..657f02a1f76ea16285c719248d129ff8a4257100 100644
--- a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/fvSolution
+++ b/tutorials/multiphase/interFoam/laminar/capillaryRise/system/fvSolution
@@ -25,7 +25,7 @@ solvers
         relTol          0;
     }
 
-    p
+    p_rgh
     {
         solver          PCG;
         preconditioner  DIC;
@@ -33,9 +33,9 @@ solvers
         relTol          0.05;
     }
 
-    pFinal
+    p_rghFinal
     {
-        $p;
+        $p_rgh;
         tolerance       1e-07;
         relTol          0;
     }
@@ -57,8 +57,6 @@ PISO
     nAlphaCorr      1;
     nAlphaSubCycles 2;
     cAlpha          1;
-    pRefCell        0;
-    pRefValue       0;
 }
 
 
diff --git a/tutorials/multiphase/cavitatingFoam/ras/throttle/system/topoSetDict b/tutorials/multiphase/interFoam/laminar/capillaryRise/system/setFieldsDict
similarity index 78%
rename from tutorials/multiphase/cavitatingFoam/ras/throttle/system/topoSetDict
rename to tutorials/multiphase/interFoam/laminar/capillaryRise/system/setFieldsDict
index a09a48ea63c8890b9d2778920bcaccff69a8288e..75c96dff6e0e47c5c7413e76427e67fc2961766c 100644
--- a/tutorials/multiphase/cavitatingFoam/ras/throttle/system/topoSetDict
+++ b/tutorials/multiphase/interFoam/laminar/capillaryRise/system/setFieldsDict
@@ -11,21 +11,25 @@ FoamFile
     format      ascii;
     class       dictionary;
     location    "system";
-    object      topoSetDict.3;
+    object      setFieldsDict;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-actions
+defaultFieldValues
 (
+    volScalarFieldValue alpha1 0
+);
+
+regions
+(
+    boxToCell
     {
-        name    c0;
-        type    cellSet;
-        action  new;
-        source  boxToCell;
-        sourceInfo
-        {
-            box ( 0.00475 -0.000375 -1 ) ( 0.009 0.000375 1 ) ;
-        }
+        box (0 0 -1) (1 8e-3 1);
+
+        fieldValues
+        (
+            volScalarFieldValue alpha1 1
+        );
     }
 );
 
diff --git a/tutorials/multiphase/interFoam/laminar/damBreak/0/p b/tutorials/multiphase/interFoam/laminar/damBreak/0/p_rgh
similarity index 98%
rename from tutorials/multiphase/interFoam/laminar/damBreak/0/p
rename to tutorials/multiphase/interFoam/laminar/damBreak/0/p_rgh
index b28c26f24f2ff052b79df245ef2c6db0458f886f..273973ed5c75bc7c83ff0f5e5d577ac867180cfb 100644
--- a/tutorials/multiphase/interFoam/laminar/damBreak/0/p
+++ b/tutorials/multiphase/interFoam/laminar/damBreak/0/p_rgh
@@ -10,7 +10,7 @@ FoamFile
     version     2.0;
     format      ascii;
     class       volScalarField;
-    object      p;
+    object      p_rgh;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/tutorials/multiphase/interFoam/laminar/damBreak/system/controlDict b/tutorials/multiphase/interFoam/laminar/damBreak/system/controlDict
index 3d025d67ee7f9f5f7bfca6c1bd0cf93330ff595b..e54b3188cff26f29a07f6f88ff0a888afab351d3 100644
--- a/tutorials/multiphase/interFoam/laminar/damBreak/system/controlDict
+++ b/tutorials/multiphase/interFoam/laminar/damBreak/system/controlDict
@@ -37,17 +37,18 @@ writeFormat     ascii;
 
 writePrecision  6;
 
-writeCompression off;
+writeCompression uncompressed;
 
 timeFormat      general;
 
 timePrecision   6;
 
-runTimeModifiable true;
+runTimeModifiable yes;
 
 adjustTimeStep  yes;
 
 maxCo           0.5;
+maxAlphaCo      0.5;
 
 maxDeltaT       1;
 
diff --git a/tutorials/multiphase/interFoam/laminar/damBreak/system/fvSchemes b/tutorials/multiphase/interFoam/laminar/damBreak/system/fvSchemes
index cd35e9f7891407710243736a973e45ce4a1243fe..13c7942e48b2a3d5b9027d30c7c58fa429dfe931 100644
--- a/tutorials/multiphase/interFoam/laminar/damBreak/system/fvSchemes
+++ b/tutorials/multiphase/interFoam/laminar/damBreak/system/fvSchemes
@@ -50,7 +50,7 @@ snGradSchemes
 fluxRequired
 {
     default         no;
-    p;
+    p_rgh;
     pcorr;
     alpha1;
 }
diff --git a/tutorials/multiphase/interFoam/laminar/damBreak/system/fvSolution b/tutorials/multiphase/interFoam/laminar/damBreak/system/fvSolution
index c0035b5a9c1b77925e39bdfd99bfe9ce4cc1053f..657f02a1f76ea16285c719248d129ff8a4257100 100644
--- a/tutorials/multiphase/interFoam/laminar/damBreak/system/fvSolution
+++ b/tutorials/multiphase/interFoam/laminar/damBreak/system/fvSolution
@@ -25,7 +25,7 @@ solvers
         relTol          0;
     }
 
-    p
+    p_rgh
     {
         solver          PCG;
         preconditioner  DIC;
@@ -33,9 +33,9 @@ solvers
         relTol          0.05;
     }
 
-    pFinal
+    p_rghFinal
     {
-        $p;
+        $p_rgh;
         tolerance       1e-07;
         relTol          0;
     }
diff --git a/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/p b/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/p_rgh
similarity index 98%
rename from tutorials/multiphase/interFoam/les/nozzleFlow2D/0/p
rename to tutorials/multiphase/interFoam/les/nozzleFlow2D/0/p_rgh
index 3a08c634952ac61cc1902ac91d709942891d3093..f98b0c3be373929b2b518d1963800f4c9c0fae6f 100644
--- a/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/p
+++ b/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/p_rgh
@@ -10,7 +10,7 @@ FoamFile
     version     2.0;
     format      ascii;
     class       volScalarField;
-    object      p;
+    object      p_rgh;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/tutorials/multiphase/interFoam/les/nozzleFlow2D/Allclean b/tutorials/multiphase/interFoam/les/nozzleFlow2D/Allclean
index cb4e2bd79201e5994ab07f6378c74dbad278b54d..e7f7e3082b5697003b474184e8cdb785ccaee963 100755
--- a/tutorials/multiphase/interFoam/les/nozzleFlow2D/Allclean
+++ b/tutorials/multiphase/interFoam/les/nozzleFlow2D/Allclean
@@ -5,6 +5,7 @@ cd ${0%/*} || exit 1    # run from this directory
 . $WM_PROJECT_DIR/bin/tools/CleanFunctions
 
 cleanCase
+rm system/topoSetDict > /dev/null 2>&1
 cp constant/polyMesh/boundary.org constant/polyMesh/boundary
 
 # ----------------------------------------------------------------- end-of-file
diff --git a/tutorials/multiphase/interFoam/les/nozzleFlow2D/Allrun b/tutorials/multiphase/interFoam/les/nozzleFlow2D/Allrun
index cb29d4ff80133e1194304732b82d06ec83321824..a66f56c1a7d5e33a012d58d0ae648d98715b26be 100755
--- a/tutorials/multiphase/interFoam/les/nozzleFlow2D/Allrun
+++ b/tutorials/multiphase/interFoam/les/nozzleFlow2D/Allrun
@@ -7,25 +7,20 @@ cd ${0%/*} || exit 1    # run from this directory
 # Get application name
 application=`getApplication`
 
-runRefineMesh()
+runRefineMesh ()
 {
     echo "Running refineMesh on $PWD"
     refineMesh -dict > log.refineMesh 2>&1
 }
 
-
 runApplication blockMesh
 
 i=1
-if [ -f log.topoSet ]
-then
-    i=3
+if [ -f log.topoSet ] ; then
+   i=3
 fi
-
-while [ "$i" -lt 3 ]
-do
-    if [ -f log.topoSet ]
-    then
+while [ "$i" -lt 3 ] ; do
+    if [ -f log.topoSet ] ; then
         mv log.topoSet log.topoSet.1
     fi
     cp system/topoSetDict.${i} system/topoSetDict
diff --git a/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/controlDict b/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/controlDict
index 26d5b09deb7dcbc4b3f3f946c2d4d64be0e33160..c0b508c78cfd9bda4c89299a713bc92b74aa4b08 100644
--- a/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/controlDict
+++ b/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/controlDict
@@ -37,17 +37,18 @@ writeFormat     ascii;
 
 writePrecision  8;
 
-writeCompression off;
+writeCompression uncompressed;
 
 timeFormat      general;
 
 timePrecision   6;
 
-runTimeModifiable true;
+runTimeModifiable yes;
 
 adjustTimeStep  yes;
 
 maxCo           0.5;
+maxAlphaCo      0.5;
 
 maxDeltaT       1e-08;
 
diff --git a/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/fvSchemes b/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/fvSchemes
index 9f2942bd1da80fd4f1d44190a0253a36d003cbc6..8159d1c62ca25e65ea01e16a019db91ad13a4b69 100644
--- a/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/fvSchemes
+++ b/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/fvSchemes
@@ -45,7 +45,6 @@ laplacianSchemes
 interpolationSchemes
 {
     default         linear;
-    interpolate(HbyA) linear;
 }
 
 snGradSchemes
@@ -56,7 +55,7 @@ snGradSchemes
 fluxRequired
 {
     default         no;
-    p;
+    p_rgh;
     pcorr;
     alpha;
 }
diff --git a/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/fvSolution b/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/fvSolution
index 88b5e30f77dff94727c79d62bf6e03a38acc664f..06e675ebf85f570e80d44f5c633bbd07d06c9076 100644
--- a/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/fvSolution
+++ b/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/fvSolution
@@ -39,7 +39,7 @@ solvers
         maxIter         100;
     }
 
-    p
+    p_rgh
     {
         solver          GAMG;
         tolerance       1e-07;
@@ -54,7 +54,7 @@ solvers
         mergeLevels     1;
     }
 
-    pFinal
+    p_rghFinal
     {
         solver          PCG;
         preconditioner
diff --git a/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/topoSetDict.1 b/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/topoSetDict.1
index ac6f3255abd219122276f306db2b4513e12a035f..37c5cdd04cdc60747d3c8ddb79dfb52283d6561c 100644
--- a/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/topoSetDict.1
+++ b/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/topoSetDict.1
@@ -11,7 +11,7 @@ FoamFile
     format      ascii;
     class       dictionary;
     location    "system";
-    object      topoSetDict.1;
+    object      topoSetDict;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -24,7 +24,7 @@ actions
         source  boxToCell;
         sourceInfo
         {
-            box ( 0 0 -2e-05 ) ( 0.0036 0.0008 4e-05 ) ;
+            box (0 0 -2e-05) (0.0036 0.0008 4e-05);
         }
     }
 );
diff --git a/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/topoSetDict.2 b/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/topoSetDict.2
index d6b1cfddc1f7f1b31f3906bc90947e6cced68946..77f65780851e347a65b4f73a5b231d23f120bf61 100644
--- a/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/topoSetDict.2
+++ b/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/topoSetDict.2
@@ -11,7 +11,7 @@ FoamFile
     format      ascii;
     class       dictionary;
     location    "system";
-    object      topoSetDict.2;
+    object      topoSetDict;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -24,10 +24,9 @@ actions
         source  boxToCell;
         sourceInfo
         {
-            box ( 0 0 -2e-05 ) ( 0.0036 0.0003 2e-05 );
+            box (0 0 -2e-05) (0.0036 0.0003 2e-05);
         }
     }
 );
 
-
 // ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/ras/Allclean b/tutorials/multiphase/interFoam/ras/Allclean
index 114bd5f0cb46b911b1776b65ddb22dc3d189508d..d2955370a9a25ae4ecc1345d5162978c70cbf1c0 100755
--- a/tutorials/multiphase/interFoam/ras/Allclean
+++ b/tutorials/multiphase/interFoam/ras/Allclean
@@ -7,23 +7,19 @@ cd ${0%/*} || exit 1    # run from this directory
 keepCases="damBreak"
 loseCases="damBreakFine"
 
-for caseName in $keepCases
+for case in $keepCases
 do
-(
-    cd $caseName || exit
+    (cd $case && foamCleanTutorials)
 
-    foamCleanTutorials
-
-    if [ "$caseName" = damBreak ]
+    if [ "$case" = "damBreak" ]
     then
-        cp 0/alpha1.org 0/alpha1
+        cp $case/0/alpha1.org $case/0/alpha1
     fi
-)
 done
 
-for caseName in $loseCases
+for case in $loseCases
 do
-    removeCase $caseName
+    removeCase $case
 done
 
 # ----------------------------------------------------------------- end-of-file
diff --git a/tutorials/multiphase/interFoam/ras/Allrun b/tutorials/multiphase/interFoam/ras/Allrun
index 059151a12c3ffd1c5a5be51c3a637d0179114379..056ec6d2ededadf9760b504e8bab03a649deb2e4 100755
--- a/tutorials/multiphase/interFoam/ras/Allrun
+++ b/tutorials/multiphase/interFoam/ras/Allrun
@@ -7,11 +7,10 @@ cd ${0%/*} || exit 1    # run from this directory
 # Set application name
 application="interFoam"
 
-setDamBreakFine()
+setDamBreakFine ()
 {
     blockMeshDict="constant/polyMesh/blockMeshDict"
     controlDict="system/controlDict"
-
     sed \
     -e s/"23 8"/"46 10"/g \
     -e s/"19 8"/"40 10"/g \
@@ -20,7 +19,6 @@ setDamBreakFine()
     -e s/"19 42\(.*\) 1 1)"/"40 76\1 2 1)"/g \
     $blockMeshDict > temp.$$
     mv temp.$$ $blockMeshDict
-
     sed \
     -e s/"\(deltaT[ \t]*\) 0.001;"/"\1 5e-04;"/g \
     -e s/"\(endTime[ \t]*\) 1;"/"\1 0.4;"/g \
@@ -29,7 +27,7 @@ setDamBreakFine()
 }
 
 # Do damBreak
-( cd damBreak && foamRunTutorials )
+(cd damBreak && foamRunTutorials)
 
 # Clone case
 cloneCase damBreak damBreakFine
@@ -40,7 +38,6 @@ cloneCase damBreak damBreakFine
     # Modify case
     setDamBreakFine
     cp ../damBreak/0/alpha1.org 0/alpha1
-
     # And execute
     runApplication blockMesh
     runApplication setFields
diff --git a/tutorials/multiphase/interFoam/ras/damBreak/0/R b/tutorials/multiphase/interFoam/ras/damBreak/0/R
deleted file mode 100644
index 25ae50174de56835d27543addc551f82f91a5391..0000000000000000000000000000000000000000
--- a/tutorials/multiphase/interFoam/ras/damBreak/0/R
+++ /dev/null
@@ -1,56 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    format      ascii;
-    class       volSymmTensorField;
-    location    "0";
-    object      R;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-dimensions      [ 0 2 -2 0 0 0 0 ];
-
-internalField   uniform ( 0 0 0 0 0 0 );
-
-boundaryField
-{
-    leftWall
-    {
-        type            kqRWallFunction;
-        value           uniform ( 0 0 0 0 0 0 );
-    }
-
-    rightWall
-    {
-        type            kqRWallFunction;
-        value           uniform ( 0 0 0 0 0 0 );
-    }
-
-    lowerWall
-    {
-        type            kqRWallFunction;
-        value           uniform ( 0 0 0 0 0 0 );
-    }
-
-    atmosphere
-    {
-        type            inletOutlet;
-        inletValue      uniform ( 0 0 0 0 0 0 );
-        value           uniform ( 0 0 0 0 0 0 );
-    }
-
-    defaultFaces
-    {
-        type            empty;
-    }
-}
-
-
-// ************************************************************************* //
diff --git a/tutorials/multiphase/interMixingFoam/laminar/damBreak/0/p b/tutorials/multiphase/interFoam/ras/damBreak/0/p_rgh
similarity index 98%
rename from tutorials/multiphase/interMixingFoam/laminar/damBreak/0/p
rename to tutorials/multiphase/interFoam/ras/damBreak/0/p_rgh
index b28c26f24f2ff052b79df245ef2c6db0458f886f..273973ed5c75bc7c83ff0f5e5d577ac867180cfb 100644
--- a/tutorials/multiphase/interMixingFoam/laminar/damBreak/0/p
+++ b/tutorials/multiphase/interFoam/ras/damBreak/0/p_rgh
@@ -10,7 +10,7 @@ FoamFile
     version     2.0;
     format      ascii;
     class       volScalarField;
-    object      p;
+    object      p_rgh;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/tutorials/multiphase/interFoam/ras/damBreak/system/controlDict b/tutorials/multiphase/interFoam/ras/damBreak/system/controlDict
index 5bf64a14a19c6d141e833c13a9e39e6a72671c0f..cb37a72ada7e460f651ef05953c324327889af35 100644
--- a/tutorials/multiphase/interFoam/ras/damBreak/system/controlDict
+++ b/tutorials/multiphase/interFoam/ras/damBreak/system/controlDict
@@ -37,17 +37,18 @@ writeFormat     ascii;
 
 writePrecision  6;
 
-writeCompression off;
+writeCompression uncompressed;
 
 timeFormat      general;
 
 timePrecision   6;
 
-runTimeModifiable true;
+runTimeModifiable yes;
 
-adjustTimeStep  yes;
+adjustTimeStep  on;
 
 maxCo           0.2;
+maxAlphaCo      0.2;
 
 maxDeltaT       1;
 
diff --git a/tutorials/multiphase/interFoam/ras/damBreak/system/fvSchemes b/tutorials/multiphase/interFoam/ras/damBreak/system/fvSchemes
index 8790334aeb46b0693b8c86c1ebcd4cd0786c2484..c6205f8cb6eb09d8631984a3324af8090b12c985 100644
--- a/tutorials/multiphase/interFoam/ras/damBreak/system/fvSchemes
+++ b/tutorials/multiphase/interFoam/ras/damBreak/system/fvSchemes
@@ -46,7 +46,6 @@ laplacianSchemes
 interpolationSchemes
 {
     default         linear;
-    interpolate(HbyA) linear;
 }
 
 snGradSchemes
@@ -57,7 +56,7 @@ snGradSchemes
 fluxRequired
 {
     default         no;
-    p;
+    p_rgh;
     pcorr;
     alpha;
 }
diff --git a/tutorials/multiphase/interFoam/ras/damBreak/system/fvSolution b/tutorials/multiphase/interFoam/ras/damBreak/system/fvSolution
index 59f271546db9a36fd36a4f32aa1bdc826cd9e934..13eeae6e00127f6ec038b71e84d1568d8aa7e064 100644
--- a/tutorials/multiphase/interFoam/ras/damBreak/system/fvSolution
+++ b/tutorials/multiphase/interFoam/ras/damBreak/system/fvSolution
@@ -25,7 +25,7 @@ solvers
         relTol          0;
     }
 
-    p
+    p_rgh
     {
         solver          PCG;
         preconditioner  DIC;
@@ -33,9 +33,10 @@ solvers
         relTol          0.05;
     }
 
-    pFinal
+    p_rghFinal
     {
-        $p;
+        solver          PCG;
+        preconditioner  DIC;
         tolerance       1e-07;
         relTol          0;
     }
@@ -50,7 +51,8 @@ solvers
 
     "(k|epsilon|R|nuTilda)"
     {
-        $U;
+        solver          PBiCG;
+        preconditioner  DILU;
         tolerance       1e-08;
         relTol          0;
     }
diff --git a/tutorials/multiphase/interFoam/ras/damBreak/0/p b/tutorials/multiphase/interMixingFoam/laminar/damBreak/0/p_rgh
similarity index 98%
rename from tutorials/multiphase/interFoam/ras/damBreak/0/p
rename to tutorials/multiphase/interMixingFoam/laminar/damBreak/0/p_rgh
index b28c26f24f2ff052b79df245ef2c6db0458f886f..273973ed5c75bc7c83ff0f5e5d577ac867180cfb 100644
--- a/tutorials/multiphase/interFoam/ras/damBreak/0/p
+++ b/tutorials/multiphase/interMixingFoam/laminar/damBreak/0/p_rgh
@@ -10,7 +10,7 @@ FoamFile
     version     2.0;
     format      ascii;
     class       volScalarField;
-    object      p;
+    object      p_rgh;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/controlDict b/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/controlDict
index 946f8fe002004659327e985a82eb99fa254842d1..86d15afac40767a0d72a160b61e8b06fdc9ef807 100644
--- a/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/controlDict
+++ b/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/controlDict
@@ -37,17 +37,18 @@ writeFormat     ascii;
 
 writePrecision  6;
 
-writeCompression off;
+writeCompression compressed;
 
 timeFormat      general;
 
 timePrecision   6;
 
-runTimeModifiable true;
+runTimeModifiable yes;
 
 adjustTimeStep  yes;
 
 maxCo           0.5;
+maxAlphaCo      0.5;
 
 maxDeltaT       1;
 
diff --git a/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/fvSchemes b/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/fvSchemes
index f89f633134b4bb65a962e46c7f80ec7e5a2b9cb2..ebf58ba310a987cc5094a4a9ac3768fd24274cff 100644
--- a/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/fvSchemes
+++ b/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/fvSchemes
@@ -50,7 +50,7 @@ snGradSchemes
 fluxRequired
 {
     default         no;
-    p;
+    p_rgh;
     pcorr;
     "alpha.";
 }
diff --git a/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/fvSolution b/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/fvSolution
index b371280f9e5be28307566c67281faf6d0b971d79..1609ba91a4794c288a872bea11a7acd4f7c99334 100644
--- a/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/fvSolution
+++ b/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/fvSolution
@@ -34,7 +34,7 @@ solvers
         relTol          0;
     }
 
-    p
+    p_rgh
     {
         solver          PCG;
         preconditioner  DIC;
@@ -42,7 +42,7 @@ solvers
         relTol          0.05;
     }
 
-    pFinal
+    p_rghFinal
     {
         solver          PCG;
         preconditioner  DIC;
diff --git a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/0/p b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/0/p_rgh
similarity index 98%
rename from tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/0/p
rename to tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/0/p_rgh
index a6270cb7adcf9954ab7b025b11f1982fab5fadaf..d9bd34672b1ef640240272e6e10999c081516e96 100644
--- a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/0/p
+++ b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/0/p_rgh
@@ -11,7 +11,7 @@ FoamFile
     format      ascii;
     class       volScalarField;
     location    "0";
-    object      p;
+    object      p_rgh;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/constant/transportProperties b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/constant/transportProperties
index 4ba69f35b28d25c6907efde4c99bea071df22e82..42b84d2a432c9b5bd42d9ff01a8c950e7772626a 100644
--- a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/constant/transportProperties
+++ b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/constant/transportProperties
@@ -54,7 +54,7 @@ MerkleCoeffs
 
 SchnerrSauerCoeffs
 {
-    n               n      [0 -3 0 0 0 0 0]     1.6e+09;
+    n               n      [0 -3 0 0 0 0 0]     1.6e+13;
     dNuc            dNuc   [0 1 0 0 0 0 0]      2.0e-06;
     Cc              Cc     [0 0 0 0 0 0 0]      1;
     Cv              Cv     [0 0 0 0 0 0 0]      1;
diff --git a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/controlDict b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/controlDict
index a3048945d2bdc1003310e72e7a486407d645a948..14f29afbeeb339aea61fce1f1d095aee912275a3 100644
--- a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/controlDict
+++ b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/controlDict
@@ -14,36 +14,37 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-application     interPhaseChangeFoam;
+application                interPhaseChangeFoam;
 
-startFrom       latestTime;
+startFrom                  latestTime;
 
-startTime       0;
+startTime                  0;
 
-stopAt          endTime;
+stopAt                     endTime;
 
-endTime         0.05;
+endTime                    0.05;
 
-deltaT          1e-8;
+deltaT                     1e-8;
 
-writeControl    adjustableRunTime;
+writeControl               adjustableRunTime;
 
-writeInterval   0.001;
+writeInterval              0.001;
 
-purgeWrite      0;
+purgeWrite                 0;
 
-writeFormat     ascii;
+writeFormat                ascii;
 
-writePrecision  6;
+writePrecision             6;
 
-writeCompression off;
+writeCompression           uncompressed;
 
-timeFormat      general;
+timeFormat                 general;
 
-runTimeModifiable true;
+runTimeModifiable          yes;
 
-adjustTimeStep  yes;
+adjustTimeStep             on;
+
+maxCo                      1.0;
 
-maxCo           1.0;
 
 // ************************************************************************* //
diff --git a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/fvSchemes b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/fvSchemes
index 81101a1ecf324afeb58a37ae9848a66d5858d30e..c7632224d4e3942a8a5f13cc74b517943e348650 100644
--- a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/fvSchemes
+++ b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/fvSchemes
@@ -56,7 +56,7 @@ snGradSchemes
 fluxRequired
 {
     default              none;
-    p;
+    p_rgh;
     pcorr;
     alpha1;
 }
diff --git a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/fvSolution b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/fvSolution
index 729941df538e3e4b4397eaa126f5fc6bede5a1bb..ea0bad663babd84221566d79540646448131741f 100644
--- a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/fvSolution
+++ b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/fvSolution
@@ -37,7 +37,7 @@ solvers
         relTol           0;
     };
 
-    p
+    p_rgh
     {
         solver           GAMG;
         tolerance        1e-8;
@@ -58,11 +58,11 @@ solvers
 
     pcorr
     {
-        $p;
+        $p_rgh;
         relTol           0;
     };
 
-    pFinal
+    p_rghFinal
     {
         solver            PCG;
         preconditioner
diff --git a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/snappyHexMeshDict b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/snappyHexMeshDict
index 456bd93ea0df6638cd98e28ef076a701743e3faa..1131e5288ca919838b51c49f98f1fcc11d81405c 100644
--- a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/snappyHexMeshDict
+++ b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/snappyHexMeshDict
@@ -224,7 +224,7 @@ addLayersControls
     //- If points get not extruded do nGrow layers of connected faces that are
     //  also not grown. This helps convergence of the layer addition process
     //  close to features.
-    nGrow 0;
+    nGrow 1;
 
 
     // Advanced settings
@@ -288,6 +288,9 @@ meshQualityControls
     //  Set to 180 to disable.
     maxConcave 80;
 
+    //- Minimum projected area v.s. actual area. Set to -1 to disable.
+    minFlatness 0.5;
+
     //- Minimum pyramid volume. Is absolute volume of cell pyramid.
     //  Set to very negative number (e.g. -1E30) to disable.
     minVol 1e-20;
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.org/U b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.org/U
index 61726a7f1a962ef9e7f5f2849f046ef794cf4d2c..f835286ef94f050bf81a97fb9acf8428b74c09e1 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.org/U
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.org/U
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.org/alphaair b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.org/alphaair
index 1a9ef8526139a6aff69b4fa72e67948a3cb284a0..14c8b6a7af8a24df5fa516cdc1a6b3a9002bdb30 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.org/alphaair
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.org/alphaair
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.org/alphamercury b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.org/alphamercury
index f4a8b4aa431a49c5b41053c8c634776649e02d8c..be9dc4d0ee98d6720d0d76fc13aaf250979d2a1b 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.org/alphamercury
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.org/alphamercury
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.org/alphaoil b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.org/alphaoil
index b1dc1977be3901f4aed4acc101e26fc873dddb8b..3f6f589eb324e9221393024c45dae4d380fafe38 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.org/alphaoil
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.org/alphaoil
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.org/alphas b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.org/alphas
index 9388080e67b89404454d03ab857d2b446ffb0ee5..3571b185b52c7b45b2d234184ea4a4d00c386b91 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.org/alphas
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.org/alphas
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.org/alphawater b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.org/alphawater
index 1928b20a852a25947bb9a9caecfe486af7503aff..19a4d2333136ef7b046cbcfb04956efeec21749b 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.org/alphawater
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.org/alphawater
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.org/p_rgh b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.org/p_rgh
index f1cdc6f9a7f192b778fafccc018fe0811aa81017..273973ed5c75bc7c83ff0f5e5d577ac867180cfb 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.org/p_rgh
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.org/p_rgh
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.0                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/U b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/U
index 61726a7f1a962ef9e7f5f2849f046ef794cf4d2c..f835286ef94f050bf81a97fb9acf8428b74c09e1 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/U
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/U
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphaair b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphaair
index 1a9ef8526139a6aff69b4fa72e67948a3cb284a0..14c8b6a7af8a24df5fa516cdc1a6b3a9002bdb30 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphaair
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphaair
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphamercury b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphamercury
index f4a8b4aa431a49c5b41053c8c634776649e02d8c..be9dc4d0ee98d6720d0d76fc13aaf250979d2a1b 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphamercury
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphamercury
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphaoil b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphaoil
index b1dc1977be3901f4aed4acc101e26fc873dddb8b..3f6f589eb324e9221393024c45dae4d380fafe38 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphaoil
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphaoil
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphas b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphas
index 9388080e67b89404454d03ab857d2b446ffb0ee5..3571b185b52c7b45b2d234184ea4a4d00c386b91 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphas
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphas
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphawater b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphawater
index 1928b20a852a25947bb9a9caecfe486af7503aff..19a4d2333136ef7b046cbcfb04956efeec21749b 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphawater
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/alphawater
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/p_rgh b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/p_rgh
index f1cdc6f9a7f192b778fafccc018fe0811aa81017..273973ed5c75bc7c83ff0f5e5d577ac867180cfb 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/p_rgh
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/p_rgh
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.0                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/Allrun b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/Allrun
index 7171316edc39f9a9cf823a55663278de00aebefe..82cf78f2f03f7a544e65e5b8ac08616bf201363f 100755
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/Allrun
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/Allrun
@@ -1,4 +1,6 @@
 #!/bin/sh
+cd ${0%/*} || exit 1    # run from this directory
+
 # Source tutorial run functions
 . $WM_PROJECT_DIR/bin/tools/RunFunctions
 
@@ -9,3 +11,4 @@ runApplication blockMesh
 runApplication setFields
 runApplication $application
 
+# ----------------------------------------------------------------- end-of-file
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/constant/g b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/constant/g
index 4a2c6c1a229ae3bb2487ef5d2fe7a7afe96ce3c8..4fea433a003518e15418a7270bcf4842db7b2126 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/constant/g
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/constant/g
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.0                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/constant/motionProperties b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/constant/motionProperties
index 089e0d7d6a7dbdddf0bdbcb9de8d63609ae1139a..4290c9fb048f37956c87ccab3d940a5c28ad1ea7 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/constant/motionProperties
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/constant/motionProperties
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.0                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/constant/polyMesh/blockMeshDict b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/constant/polyMesh/blockMeshDict
index 4be73bf9389f42b38cd35bbabb74acf541b7915b..f125110cee529519d65e4eb6588f2eff08cefff3 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/constant/polyMesh/blockMeshDict
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/constant/polyMesh/blockMeshDict
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.0                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/constant/polyMesh/boundary b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/constant/polyMesh/boundary
index f273b47cbca3a4b37f55a86f0afa105ed0b8c52f..674084c4b9bdc11f51fbd2dded45246584b9f25c 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/constant/polyMesh/boundary
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/constant/polyMesh/boundary
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/constant/transportProperties b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/constant/transportProperties
index 865e85f043c3c8d15799e69d1c21f27c5b51b539..b9f39d0fdf32e2a4955b2e92683d21b5c00a148b 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/constant/transportProperties
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/constant/transportProperties
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.0                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/constant/turbulenceProperties b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/constant/turbulenceProperties
index 1554e6cb836f95fb5564ea9269e143783870dfbc..d0a0998654c0e013d16bc1b9e58e51ff26d40edc 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/constant/turbulenceProperties
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/constant/turbulenceProperties
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.0                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/controlDict b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/controlDict
index 9db17acea6ff6ad55b4006b049fc7fb2a304f424..ec28f8f7d2232df5331755ca51fdce2f0b77c0d1 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/controlDict
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/controlDict
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.0                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/decomposeParDict b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/decomposeParDict
index b63a06b40f990d4d21ed9d25453def950fd836d4..fafe891ce1ac8e17ca07489001d9c00669dce7ef 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/decomposeParDict
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/decomposeParDict
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.0                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/fvSchemes b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/fvSchemes
index 7ede74c212445ddce5c7fae8687574df2fe44b9d..20b658a2a6a33e9e7977b33aca3762a74bcd0ba3 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/fvSchemes
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/fvSchemes
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.0                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
@@ -31,7 +31,7 @@ divSchemes
 {
     div(rho*phi,U)  Gauss upwind;
     div(phi,alpha)  Gauss vanLeer;
-    div(phic,alpha) Gauss interfaceCompression;
+    div(phirb,alpha) Gauss interfaceCompression;
 }
 
 laplacianSchemes
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/fvSolution b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/fvSolution
index c13da1cec966dad95d3984c6076b8c96c5cea075..143bfa585a677c989e06b4f2f189a8a194fe67e5 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/fvSolution
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/fvSolution
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.0                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/setFieldsDict b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/setFieldsDict
index c28a404ed53cc5cdce583e14d5d1b8966e756580..56f47044048011a9b2fb133b24a25debd16376b4 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/setFieldsDict
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/setFieldsDict
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.0                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/U b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/U
index 61726a7f1a962ef9e7f5f2849f046ef794cf4d2c..f835286ef94f050bf81a97fb9acf8428b74c09e1 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/U
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/U
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/alphaair b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/alphaair
index 1a9ef8526139a6aff69b4fa72e67948a3cb284a0..14c8b6a7af8a24df5fa516cdc1a6b3a9002bdb30 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/alphaair
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/alphaair
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/alphamercury b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/alphamercury
index f4a8b4aa431a49c5b41053c8c634776649e02d8c..be9dc4d0ee98d6720d0d76fc13aaf250979d2a1b 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/alphamercury
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/alphamercury
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/alphaoil b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/alphaoil
index b1dc1977be3901f4aed4acc101e26fc873dddb8b..3f6f589eb324e9221393024c45dae4d380fafe38 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/alphaoil
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/alphaoil
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/alphas b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/alphas
index 9388080e67b89404454d03ab857d2b446ffb0ee5..3571b185b52c7b45b2d234184ea4a4d00c386b91 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/alphas
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/alphas
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/alphawater b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/alphawater
index 1928b20a852a25947bb9a9caecfe486af7503aff..19a4d2333136ef7b046cbcfb04956efeec21749b 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/alphawater
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/alphawater
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/p_rgh b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/p_rgh
index f1cdc6f9a7f192b778fafccc018fe0811aa81017..273973ed5c75bc7c83ff0f5e5d577ac867180cfb 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/p_rgh
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.org/p_rgh
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.0                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/U b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/U
index 61726a7f1a962ef9e7f5f2849f046ef794cf4d2c..f835286ef94f050bf81a97fb9acf8428b74c09e1 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/U
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/U
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphaair b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphaair
index 1a9ef8526139a6aff69b4fa72e67948a3cb284a0..14c8b6a7af8a24df5fa516cdc1a6b3a9002bdb30 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphaair
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphaair
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphamercury b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphamercury
index f4a8b4aa431a49c5b41053c8c634776649e02d8c..be9dc4d0ee98d6720d0d76fc13aaf250979d2a1b 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphamercury
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphamercury
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphaoil b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphaoil
index b1dc1977be3901f4aed4acc101e26fc873dddb8b..3f6f589eb324e9221393024c45dae4d380fafe38 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphaoil
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphaoil
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphas b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphas
index 9388080e67b89404454d03ab857d2b446ffb0ee5..3571b185b52c7b45b2d234184ea4a4d00c386b91 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphas
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphas
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphawater b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphawater
index 1928b20a852a25947bb9a9caecfe486af7503aff..19a4d2333136ef7b046cbcfb04956efeec21749b 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphawater
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/alphawater
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/p_rgh b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/p_rgh
index f1cdc6f9a7f192b778fafccc018fe0811aa81017..273973ed5c75bc7c83ff0f5e5d577ac867180cfb 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/p_rgh
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/p_rgh
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.0                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/Allrun b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/Allrun
index 7171316edc39f9a9cf823a55663278de00aebefe..82cf78f2f03f7a544e65e5b8ac08616bf201363f 100755
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/Allrun
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/Allrun
@@ -1,4 +1,6 @@
 #!/bin/sh
+cd ${0%/*} || exit 1    # run from this directory
+
 # Source tutorial run functions
 . $WM_PROJECT_DIR/bin/tools/RunFunctions
 
@@ -9,3 +11,4 @@ runApplication blockMesh
 runApplication setFields
 runApplication $application
 
+# ----------------------------------------------------------------- end-of-file
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/constant/g b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/constant/g
index 4a2c6c1a229ae3bb2487ef5d2fe7a7afe96ce3c8..4fea433a003518e15418a7270bcf4842db7b2126 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/constant/g
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/constant/g
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.0                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/constant/motionProperties b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/constant/motionProperties
index 089e0d7d6a7dbdddf0bdbcb9de8d63609ae1139a..4290c9fb048f37956c87ccab3d940a5c28ad1ea7 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/constant/motionProperties
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/constant/motionProperties
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.0                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/constant/polyMesh/blockMeshDict b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/constant/polyMesh/blockMeshDict
index 76930d6da6b1213c0073f6b3ef5cb7568d03d37a..b9c0775f3c106f3e0334cd909880ea199c4cfe1a 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/constant/polyMesh/blockMeshDict
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/constant/polyMesh/blockMeshDict
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.0                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/constant/polyMesh/boundary b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/constant/polyMesh/boundary
index 66d15ae14901ac21b3d51ea8142fddc4a71cebdc..5f67c84fd879708cee4bd7197470c8c5284191dc 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/constant/polyMesh/boundary
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/constant/polyMesh/boundary
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.x                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/constant/transportProperties b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/constant/transportProperties
index 865e85f043c3c8d15799e69d1c21f27c5b51b539..b9f39d0fdf32e2a4955b2e92683d21b5c00a148b 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/constant/transportProperties
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/constant/transportProperties
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.0                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/constant/turbulenceProperties b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/constant/turbulenceProperties
index 1554e6cb836f95fb5564ea9269e143783870dfbc..d0a0998654c0e013d16bc1b9e58e51ff26d40edc 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/constant/turbulenceProperties
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/constant/turbulenceProperties
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.0                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/controlDict b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/controlDict
index 630089bdd8a463f9af934ede7063dc06ce2bd547..ce8d8b9af2ed61a315a8bb2c3aae5ee375b28b08 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/controlDict
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/controlDict
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.0                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/decomposeParDict b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/decomposeParDict
index b63a06b40f990d4d21ed9d25453def950fd836d4..fafe891ce1ac8e17ca07489001d9c00669dce7ef 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/decomposeParDict
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/decomposeParDict
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.0                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/fvSchemes b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/fvSchemes
index 7ede74c212445ddce5c7fae8687574df2fe44b9d..20b658a2a6a33e9e7977b33aca3762a74bcd0ba3 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/fvSchemes
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/fvSchemes
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.0                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
@@ -31,7 +31,7 @@ divSchemes
 {
     div(rho*phi,U)  Gauss upwind;
     div(phi,alpha)  Gauss vanLeer;
-    div(phic,alpha) Gauss interfaceCompression;
+    div(phirb,alpha) Gauss interfaceCompression;
 }
 
 laplacianSchemes
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/fvSolution b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/fvSolution
index a0a6f3156cc39c26e7f0713e74fb9a1ed7b143d4..c58dfc3740ae3103676050b3eca8b4ba0fc379fe 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/fvSolution
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/fvSolution
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.0                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
@@ -89,6 +89,7 @@ solvers
 
 PISO
 {
+    momentumPredictor no;
     nCorrectors     4;
     nNonOrthogonalCorrectors 0;
     nAlphaCorr      4;
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/setFieldsDict b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/setFieldsDict
index 303dc967a6cdd07b96d9225bdf1644c88a3b3ff7..7b652efaa1ba9bc948460a10e5a81af13e619391 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/setFieldsDict
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/setFieldsDict
@@ -1,7 +1,7 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.7.0                                 |
+|  \\    /   O peration     | Version:  dev                                   |
 |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
@@ -21,7 +21,6 @@ defaultFieldValues
     volScalarFieldValue alphawater 0
     volScalarFieldValue alphaoil 0
     volScalarFieldValue alphamercury 0
-    volVectorFieldValue U ( 0 0 0 )
 );
 
 regions
@@ -59,7 +58,7 @@ regions
             volScalarFieldValue alphaair 0
         );
     }
- );
+);
 
 
 // ************************************************************************* //
diff --git a/tutorials/multiphase/settlingFoam/ras/dahl/0/pmh b/tutorials/multiphase/settlingFoam/ras/dahl/0/p_rgh
similarity index 98%
rename from tutorials/multiphase/settlingFoam/ras/dahl/0/pmh
rename to tutorials/multiphase/settlingFoam/ras/dahl/0/p_rgh
index 93d16bc670dce2c80417cf5506baf4483e709b0d..f1f3ab6ae5889df87a7ec96175eebe46722c2848 100644
--- a/tutorials/multiphase/settlingFoam/ras/dahl/0/pmh
+++ b/tutorials/multiphase/settlingFoam/ras/dahl/0/p_rgh
@@ -10,7 +10,7 @@ FoamFile
     version     2.0;
     format      ascii;
     class       volScalarField;
-    object      pmh;
+    object      p_rgh;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/tutorials/multiphase/settlingFoam/ras/dahl/system/controlDict b/tutorials/multiphase/settlingFoam/ras/dahl/system/controlDict
index 2304bc7fa77a06b1c2de8e2a6df5339f9d53bb77..e723ac6686ca55a779ced6f3da7e186413877faa 100644
--- a/tutorials/multiphase/settlingFoam/ras/dahl/system/controlDict
+++ b/tutorials/multiphase/settlingFoam/ras/dahl/system/controlDict
@@ -27,7 +27,7 @@ endTime         6400;
 
 deltaT          0.1;
 
-writeControl    runTime;
+writeControl    adjustableRunTime;
 
 writeInterval   20;
 
@@ -37,13 +37,16 @@ writeFormat     ascii;
 
 writePrecision  6;
 
-writeCompression off;
+writeCompression uncompressed;
 
 timeFormat      general;
 
 timePrecision   6;
 
-runTimeModifiable true;
+runTimeModifiable yes;
 
+adjustTimeStep  yes;
+
+maxCo           1;
 
 // ************************************************************************* //
diff --git a/tutorials/multiphase/settlingFoam/ras/dahl/system/fvSchemes b/tutorials/multiphase/settlingFoam/ras/dahl/system/fvSchemes
index 38274647c11b50eff96fbdb4056ca9566c7622cc..fc16f8a24309245f503d22b0be4b793e4d0ce09f 100644
--- a/tutorials/multiphase/settlingFoam/ras/dahl/system/fvSchemes
+++ b/tutorials/multiphase/settlingFoam/ras/dahl/system/fvSchemes
@@ -39,7 +39,7 @@ laplacianSchemes
 {
     default         none;
     laplacian(muEff,U) Gauss linear corrected;
-    laplacian((rho*(1|A(U))),pmh) Gauss linear corrected;
+    laplacian((rho*(1|A(U))),p_rgh) Gauss linear corrected;
     laplacian(DkEff,k) Gauss linear corrected;
     laplacian(DepsilonEff,epsilon) Gauss linear corrected;
     laplacian(mut,Alpha) Gauss linear corrected;
@@ -58,7 +58,7 @@ snGradSchemes
 fluxRequired
 {
     default         no;
-    pmh             ;
+    p_rgh             ;
 }
 
 
diff --git a/tutorials/multiphase/settlingFoam/ras/dahl/system/fvSolution b/tutorials/multiphase/settlingFoam/ras/dahl/system/fvSolution
index 3f037c51c769311dbeeda16ec3f972c33892c5cd..bededca933b09b23ab887ee1493becfc3beb0ea4 100644
--- a/tutorials/multiphase/settlingFoam/ras/dahl/system/fvSolution
+++ b/tutorials/multiphase/settlingFoam/ras/dahl/system/fvSolution
@@ -17,7 +17,7 @@ FoamFile
 
 solvers
 {
-    pmh
+    p_rgh
     {
         solver          PCG;
         preconditioner  DIC;
@@ -25,7 +25,7 @@ solvers
         relTol          0;
     }
 
-    U
+    "U.*"
     {
         solver          PBiCG;
         preconditioner  DILU;
diff --git a/tutorials/multiphase/settlingFoam/ras/tank3D/0/U b/tutorials/multiphase/settlingFoam/ras/tank3D/0/U
index 9b41557d3196dfd8cd702966aa1290188b08a7a8..18d3647cd5e1f7633d0adaaaf189d6660cfc457d 100644
--- a/tutorials/multiphase/settlingFoam/ras/tank3D/0/U
+++ b/tutorials/multiphase/settlingFoam/ras/tank3D/0/U
@@ -136,7 +136,8 @@ boundaryField
 
     OUTL15
     {
-        type            zeroGradient;
+        type            inletOutlet;
+        inletValue      uniform (0 0 0);
     }
 }
 
diff --git a/tutorials/multiphase/settlingFoam/ras/tank3D/0/alpha b/tutorials/multiphase/settlingFoam/ras/tank3D/0/alpha
index 29ccfa6a7df8d87efb4d2d1093c269aae1237b99..3a14f4c92654763aab7fd32c9c2c5ef8dfc54af9 100644
--- a/tutorials/multiphase/settlingFoam/ras/tank3D/0/alpha
+++ b/tutorials/multiphase/settlingFoam/ras/tank3D/0/alpha
@@ -118,7 +118,8 @@ boundaryField
 
     OUTL15
     {
-        type            zeroGradient;
+        type            inletOutlet;
+        inletValue      uniform 0;
     }
 }
 
diff --git a/tutorials/multiphase/settlingFoam/ras/tank3D/0/epsilon b/tutorials/multiphase/settlingFoam/ras/tank3D/0/epsilon
index d8bee88b9cd42375a661765238f8682a5eac265c..d2257091c130237e29bb4f898cfd218e36f560ab 100644
--- a/tutorials/multiphase/settlingFoam/ras/tank3D/0/epsilon
+++ b/tutorials/multiphase/settlingFoam/ras/tank3D/0/epsilon
@@ -118,7 +118,8 @@ boundaryField
 
     OUTL15
     {
-        type            zeroGradient;
+        type            inletOutlet;
+        inletValue      uniform 1.973e-07;
     }
 }
 
diff --git a/tutorials/multiphase/settlingFoam/ras/tank3D/0/k b/tutorials/multiphase/settlingFoam/ras/tank3D/0/k
index e63dfc44a99ddf6fc8ee87ef0dbdd378b1b28d1b..a7bdc4ab36db9a49203dc3def88ee2e529b077d7 100644
--- a/tutorials/multiphase/settlingFoam/ras/tank3D/0/k
+++ b/tutorials/multiphase/settlingFoam/ras/tank3D/0/k
@@ -118,7 +118,8 @@ boundaryField
 
     OUTL15
     {
-        type            zeroGradient;
+        type            inletOutlet;
+        inletValue      uniform 0.000259;
     }
 }
 
diff --git a/tutorials/multiphase/settlingFoam/ras/tank3D/0/pmh b/tutorials/multiphase/settlingFoam/ras/tank3D/0/p_rgh
similarity index 99%
rename from tutorials/multiphase/settlingFoam/ras/tank3D/0/pmh
rename to tutorials/multiphase/settlingFoam/ras/tank3D/0/p_rgh
index 7e73f7f34d1602190b4e2c93b11341d04320c8d3..34800b6b9a6af82b298e229abeb24931417544f0 100644
--- a/tutorials/multiphase/settlingFoam/ras/tank3D/0/pmh
+++ b/tutorials/multiphase/settlingFoam/ras/tank3D/0/p_rgh
@@ -10,7 +10,7 @@ FoamFile
     version     2.0;
     format      ascii;
     class       volScalarField;
-    object      pmh;
+    object      p_rgh;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/tutorials/multiphase/settlingFoam/ras/tank3D/system/controlDict b/tutorials/multiphase/settlingFoam/ras/tank3D/system/controlDict
index 20e6b855a74e7ed70cf162279894532f25b63ce8..4a4e21da1823ed710762d6cb1a86ff7c43cbdf57 100644
--- a/tutorials/multiphase/settlingFoam/ras/tank3D/system/controlDict
+++ b/tutorials/multiphase/settlingFoam/ras/tank3D/system/controlDict
@@ -27,7 +27,7 @@ endTime         8000;
 
 deltaT          0.1;
 
-writeControl    runTime;
+writeControl    adjustableRunTime;
 
 writeInterval   50;
 
@@ -37,13 +37,18 @@ writeFormat     ascii;
 
 writePrecision  6;
 
-writeCompression off;
+writeCompression compressed;
 
 timeFormat      general;
 
 timePrecision   6;
 
-runTimeModifiable true;
+runTimeModifiable yes;
 
+adjustTimeStep  yes;
+
+maxCo           1;
+
+maxDeltaT       1;
 
 // ************************************************************************* //
diff --git a/tutorials/multiphase/settlingFoam/ras/tank3D/system/fvSchemes b/tutorials/multiphase/settlingFoam/ras/tank3D/system/fvSchemes
index 38274647c11b50eff96fbdb4056ca9566c7622cc..fc16f8a24309245f503d22b0be4b793e4d0ce09f 100644
--- a/tutorials/multiphase/settlingFoam/ras/tank3D/system/fvSchemes
+++ b/tutorials/multiphase/settlingFoam/ras/tank3D/system/fvSchemes
@@ -39,7 +39,7 @@ laplacianSchemes
 {
     default         none;
     laplacian(muEff,U) Gauss linear corrected;
-    laplacian((rho*(1|A(U))),pmh) Gauss linear corrected;
+    laplacian((rho*(1|A(U))),p_rgh) Gauss linear corrected;
     laplacian(DkEff,k) Gauss linear corrected;
     laplacian(DepsilonEff,epsilon) Gauss linear corrected;
     laplacian(mut,Alpha) Gauss linear corrected;
@@ -58,7 +58,7 @@ snGradSchemes
 fluxRequired
 {
     default         no;
-    pmh             ;
+    p_rgh             ;
 }
 
 
diff --git a/tutorials/multiphase/settlingFoam/ras/tank3D/system/fvSolution b/tutorials/multiphase/settlingFoam/ras/tank3D/system/fvSolution
index db5124bbeb6d24ec968d085921cd3f4e2faf0e95..b9cb13c5430a60db48ff09f085975750fb51609c 100644
--- a/tutorials/multiphase/settlingFoam/ras/tank3D/system/fvSolution
+++ b/tutorials/multiphase/settlingFoam/ras/tank3D/system/fvSolution
@@ -17,7 +17,7 @@ FoamFile
 
 solvers
 {
-    pmh
+    p_rgh
     {
         solver          PCG;
         preconditioner  DIC;
@@ -25,7 +25,7 @@ solvers
         relTol          0;
     }
 
-    U
+    "U.*"
     {
         solver          PBiCG;
         preconditioner  DILU;
@@ -71,7 +71,7 @@ PISO
     momentumPredictor yes;
     nOuterCorrectors  1;
     nCorrectors       2;
-    nNonOrthogonalCorrectors 0;
+    nNonOrthogonalCorrectors 1;
 }
 
 relaxationFactors
diff --git a/tutorials/multiphase/twoPhaseEulerFoam/bed/system/controlDict b/tutorials/multiphase/twoPhaseEulerFoam/bed/system/controlDict
index 0d19638c8e4f872947614fb4117e96102b2a77ab..1979edbb90c65ac7f53634b58ffff2aff6700b6c 100644
--- a/tutorials/multiphase/twoPhaseEulerFoam/bed/system/controlDict
+++ b/tutorials/multiphase/twoPhaseEulerFoam/bed/system/controlDict
@@ -37,13 +37,13 @@ writeFormat     binary;
 
 writePrecision  6;
 
-writeCompression off;
+writeCompression uncompressed;
 
 timeFormat      general;
 
 timePrecision   6;
 
-runTimeModifiable true;
+runTimeModifiable on;
 
 adjustTimeStep  yes;
 
@@ -58,38 +58,38 @@ functions
         type            fieldAverage;
         functionObjectLibs ( "libfieldFunctionObjects.so" );
         outputControl   outputTime;
-
         fields
         (
             Ua
             {
-                mean        on;
-                prime2Mean  off;
-                base        time;
+                 mean        on;
+                 prime2Mean  off;
+                 base        time;
             }
 
             Ub
             {
-                mean        on;
-                prime2Mean  off;
-                base        time;
+                 mean        on;
+                 prime2Mean  off;
+                 base        time;
             }
 
             alpha
             {
-                mean        on;
-                prime2Mean  off;
-                base        time;
+                 mean        on;
+                 prime2Mean  off;
+                 base        time;
             }
 
             p
             {
-                mean        on;
-                prime2Mean  off;
-                base        time;
+                 mean        on;
+                 prime2Mean  off;
+                 base        time;
             }
         );
     }
 }
 
+
 // ************************************************************************* //
diff --git a/tutorials/multiphase/twoPhaseEulerFoam/bed2/system/controlDict b/tutorials/multiphase/twoPhaseEulerFoam/bed2/system/controlDict
index 5acfe8ddb2d49ed2233786fbfadef4637f7d04bf..fdf35e59a18bfe699ba248d6a6910cae743ab07e 100644
--- a/tutorials/multiphase/twoPhaseEulerFoam/bed2/system/controlDict
+++ b/tutorials/multiphase/twoPhaseEulerFoam/bed2/system/controlDict
@@ -37,13 +37,13 @@ writeFormat     ascii;
 
 writePrecision  6;
 
-writeCompression off;
+writeCompression uncompressed;
 
 timeFormat      general;
 
 timePrecision   6;
 
-runTimeModifiable true;
+runTimeModifiable on;
 
 adjustTimeStep  no;
 
@@ -58,38 +58,38 @@ functions
         type            fieldAverage;
         functionObjectLibs ( "libfieldFunctionObjects.so" );
         outputControl   outputTime;
-
         fields
         (
             Ua
             {
-                mean        on;
-                prime2Mean  off;
-                base        time;
+                 mean        on;
+                 prime2Mean  off;
+                 base        time;
             }
 
             Ub
             {
-                mean        on;
-                prime2Mean  off;
-                base        time;
+                 mean        on;
+                 prime2Mean  off;
+                 base        time;
             }
 
             alpha
             {
-                mean        on;
-                prime2Mean  off;
-                base        time;
+                 mean        on;
+                 prime2Mean  off;
+                 base        time;
             }
 
             p
             {
-                mean        on;
-                prime2Mean  off;
-                base        time;
+                 mean        on;
+                 prime2Mean  off;
+                 base        time;
             }
         );
     }
 }
 
+
 // ************************************************************************* //
diff --git a/tutorials/multiphase/twoPhaseEulerFoam/bubbleColumn/system/controlDict b/tutorials/multiphase/twoPhaseEulerFoam/bubbleColumn/system/controlDict
index f51ed5524ec7fb374f5c81681e4ec1d33d105524..b27ac44f79070d16f970d8cf904531845f811419 100644
--- a/tutorials/multiphase/twoPhaseEulerFoam/bubbleColumn/system/controlDict
+++ b/tutorials/multiphase/twoPhaseEulerFoam/bubbleColumn/system/controlDict
@@ -37,13 +37,13 @@ writeFormat     ascii;
 
 writePrecision  6;
 
-writeCompression off;
+writeCompression uncompressed;
 
 timeFormat      general;
 
 timePrecision   6;
 
-runTimeModifiable true;
+runTimeModifiable yes;
 
 adjustTimeStep  no;
 
@@ -58,38 +58,38 @@ functions
         type            fieldAverage;
         functionObjectLibs ( "libfieldFunctionObjects.so" );
         outputControl   outputTime;
-
         fields
         (
             Ua
             {
-                mean        on;
-                prime2Mean  off;
-                base        time;
+                 mean        on;
+                 prime2Mean  off;
+                 base        time;
             }
 
             Ub
             {
-                mean        on;
-                prime2Mean  off;
-                base        time;
+                 mean        on;
+                 prime2Mean  off;
+                 base        time;
             }
 
             alpha
             {
-                mean        on;
-                prime2Mean  off;
-                base        time;
+                 mean        on;
+                 prime2Mean  off;
+                 base        time;
             }
 
             p
             {
-                mean        on;
-                prime2Mean  off;
-                base        time;
+                 mean        on;
+                 prime2Mean  off;
+                 base        time;
             }
         );
     }
 }
 
+
 // ************************************************************************* //