diff --git a/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/execFlowFunctionObjects.C b/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/execFlowFunctionObjects.C
index f0487ac2a2a5c5c9b62ff39ba8168c93a1615099..6531073136cec0d02abf3898e681223370e16637 100644
--- a/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/execFlowFunctionObjects.C
+++ b/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/execFlowFunctionObjects.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -47,7 +47,7 @@ Description
 #include "incompressible/RAS/RASModel/RASModel.H"
 #include "incompressible/LES/LESModel/LESModel.H"
 
-#include "basicPsiThermo.H"
+#include "basicThermo.H"
 #include "compressible/RAS/RASModel/RASModel.H"
 #include "compressible/LES/LESModel/LESModel.H"
 
@@ -265,7 +265,7 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
         }
         else if (phi.dimensions() == dimensionSet(1, 0, -1, 0, 0))
         {
-            autoPtr<basicPsiThermo> thermo(basicPsiThermo::New(mesh));
+            autoPtr<basicThermo> thermo(basicThermo::New(mesh));
 
             volScalarField rho
             (
diff --git a/applications/utilities/postProcessing/patch/patchAverage/patchAverage.C b/applications/utilities/postProcessing/patch/patchAverage/patchAverage.C
index d8f651c9684633dfd352dc8fc3761745bc8e45ef..f7948701cc584552f0ee8b3fa9c66484e9adda3d 100644
--- a/applications/utilities/postProcessing/patch/patchAverage/patchAverage.C
+++ b/applications/utilities/postProcessing/patch/patchAverage/patchAverage.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -32,17 +32,59 @@ Description
 #include "fvCFD.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+template<class FieldType>
+void printAverage
+(
+    const fvMesh& mesh,
+    const IOobject& fieldHeader,
+    const scalar area,
+    const label patchI,
+    bool& done
+)
+{
+    if (!done && fieldHeader.headerClassName() == FieldType::typeName)
+    {
+        Info<< "    Reading " << fieldHeader.headerClassName() << " "
+            << fieldHeader.name() << endl;
+
+        FieldType field(fieldHeader, mesh);
+
+        typename FieldType::value_type sumField =
+            pTraits<typename FieldType::value_type>::zero;
+
+        if (area > 0)
+        {
+            sumField = gSum
+            (
+                mesh.magSf().boundaryField()[patchI]
+              * field.boundaryField()[patchI]
+            ) / area;
+        }
+
+        Info<< "    Average of " << fieldHeader.headerClassName()
+            << " over patch "
+            << mesh.boundary()[patchI].name()
+            << '[' << patchI << ']' << " = "
+            << sumField << endl;
+
+        done = true;
+    }
+}
+
+
 // Main program:
 
 int main(int argc, char *argv[])
 {
     timeSelector::addOptions();
+    #include "addRegionOption.H"
     argList::validArgs.append("fieldName");
     argList::validArgs.append("patchName");
 #   include "setRootCase.H"
 #   include "createTime.H"
     instantList timeDirs = timeSelector::select0(runTime, args);
-#   include "createMesh.H"
+#   include "createNamedMesh.H"
 
     const word fieldName = args[1];
     const word patchName = args[2];
@@ -52,7 +94,7 @@ int main(int argc, char *argv[])
         runTime.setTime(timeDirs[timeI], timeI);
         Info<< "Time = " << runTime.timeName() << endl;
 
-        IOobject fieldHeader
+        IOobject io
         (
             fieldName,
             runTime.timeName(),
@@ -61,7 +103,7 @@ int main(int argc, char *argv[])
         );
 
         // Check field exists
-        if (fieldHeader.headerOk())
+        if (io.headerOk())
         {
             mesh.readUpdate();
 
@@ -72,32 +114,21 @@ int main(int argc, char *argv[])
                     << "Unable to find patch " << patchName << nl
                     << exit(FatalError);
             }
+            scalar area = gSum(mesh.magSf().boundaryField()[patchI]);
 
-            if (fieldHeader.headerClassName() == "volScalarField")
-            {
-                Info<< "    Reading volScalarField " << fieldName << endl;
-                volScalarField field(fieldHeader, mesh);
-
-                scalar area = gSum(mesh.magSf().boundaryField()[patchI]);
-                scalar sumField = 0;
-
-                if (area > 0)
-                {
-                    sumField = gSum
-                    (
-                        mesh.magSf().boundaryField()[patchI]
-                      * field.boundaryField()[patchI]
-                    ) / area;
-                }
-
-                Info<< "    Average of " << fieldName << " over patch "
-                    << patchName << '[' << patchI << ']' << " = "
-                    << sumField << endl;
-            }
-            else
+            bool done = false;
+            printAverage<volScalarField>(mesh, io, area, patchI, done);
+            printAverage<volVectorField>(mesh, io, area, patchI, done);
+            printAverage<volSphericalTensorField>(mesh, io, area, patchI, done);
+            printAverage<volSymmTensorField>(mesh, io, area, patchI, done);
+            printAverage<volTensorField>(mesh, io, area, patchI, done);
+
+            if (!done)
             {
                 FatalError
-                    << "Only possible to average volScalarFields "
+                    << "Only possible to average volFields."
+                    << " Field " << fieldName << " is of type "
+                    << io.headerClassName()
                     << nl << exit(FatalError);
             }
         }
diff --git a/applications/utilities/postProcessing/patch/patchIntegrate/patchIntegrate.C b/applications/utilities/postProcessing/patch/patchIntegrate/patchIntegrate.C
index 8696c6ffde90c9f5a48a65fa29ea6e69b3cf851d..5004df4c9e5c85f63aab1c8b0cdb0ef64efc8dbb 100644
--- a/applications/utilities/postProcessing/patch/patchIntegrate/patchIntegrate.C
+++ b/applications/utilities/postProcessing/patch/patchIntegrate/patchIntegrate.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -32,12 +32,83 @@ Description
 #include "fvCFD.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+template<class FieldType>
+void printIntegrate
+(
+    const fvMesh& mesh,
+    const IOobject& fieldHeader,
+    const label patchI,
+    bool& done
+)
+{
+    if (!done && fieldHeader.headerClassName() == FieldType::typeName)
+    {
+        Info<< "    Reading " << fieldHeader.headerClassName() << " "
+            << fieldHeader.name() << endl;
+
+        FieldType field(fieldHeader, mesh);
+
+        Info<< "    Integral of " << fieldHeader.name()
+            << " over vector area of patch "
+            << mesh.boundary()[patchI].name() << '[' << patchI << ']' << " = "
+            << gSum
+               (
+                   mesh.Sf().boundaryField()[patchI]
+                  *field.boundaryField()[patchI]
+               )
+            << nl;
+
+        Info<< "    Integral of " << fieldHeader.name()
+            << " over area magnitude of patch "
+            << mesh.boundary()[patchI].name() << '[' << patchI << ']' << " = "
+            << gSum
+               (
+                   mesh.magSf().boundaryField()[patchI]
+                  *field.boundaryField()[patchI]
+               )
+            << nl;
+
+        done = true;
+    }
+}
+
+
+template<class FieldType>
+void printSum
+(
+    const fvMesh& mesh,
+    const IOobject& fieldHeader,
+    const label patchI,
+    bool& done
+)
+{
+    if (!done && fieldHeader.headerClassName() == FieldType::typeName)
+    {
+        Info<< "    Reading " << FieldType::typeName << " "
+            << fieldHeader.name() << endl;
+
+        FieldType field(fieldHeader, mesh);
+        typename FieldType::value_type sumField = gSum
+        (
+            field.boundaryField()[patchI]
+        );
+
+        Info<< "    Integral of " << fieldHeader.name() << " over patch "
+            << mesh.boundary()[patchI].name() << '[' << patchI << ']' << " = "
+            << sumField << nl;
+
+        done = true;
+    }
+}
+
+
 // Main program:
 
 int main(int argc, char *argv[])
 {
-#   include "addRegionOption.H"
     timeSelector::addOptions();
+#   include "addRegionOption.H"
     argList::validArgs.append("fieldName");
     argList::validArgs.append("patchName");
 #   include "setRootCase.H"
@@ -83,54 +154,88 @@ int main(int argc, char *argv[])
                 << gSum(mesh.magSf().boundaryField()[patchI]) << endl;
 
             // Read field and calc integral
-            if (fieldHeader.headerClassName() == volScalarField::typeName)
-            {
-                Info<< "    Reading " << volScalarField::typeName << " "
-                    << fieldName << endl;
-
-                volScalarField field(fieldHeader, mesh);
-
-                Info<< "    Integral of " << fieldName
-                    << " over vector area of patch "
-                    << patchName << '[' << patchI << ']' << " = "
-                    << gSum
-                       (
-                           mesh.Sf().boundaryField()[patchI]
-                          *field.boundaryField()[patchI]
-                       )
-                    << nl;
-
-                Info<< "    Integral of " << fieldName
-                    << " over area magnitude of patch "
-                    << patchName << '[' << patchI << ']' << " = "
-                    << gSum
-                       (
-                           mesh.magSf().boundaryField()[patchI]
-                          *field.boundaryField()[patchI]
-                       )
-                    << nl;
-            }
-            else if
+            bool done = false;
+            printIntegrate<volScalarField>
             (
-                fieldHeader.headerClassName() == surfaceScalarField::typeName
-            )
-            {
-                Info<< "    Reading " << surfaceScalarField::typeName << " "
-                    << fieldName << endl;
+                mesh,
+                fieldHeader,
+                patchI,
+                done
+            );
+            printIntegrate<volVectorField>
+            (
+                mesh,
+                fieldHeader,
+                patchI,
+                done
+            );
 
-                surfaceScalarField field(fieldHeader, mesh);
-                scalar sumField = gSum(field.boundaryField()[patchI]);
+            //- No tensor integrations
+            //printIntegrate<volSphericalTensorField>
+            //(
+            //    mesh,
+            //    fieldHeader,
+            //    patchI,
+            //    done
+            //);
+            //printIntegrate<volSymmTensorField>
+            //(
+            //    mesh,
+            //    fieldHeader,
+            //    patchI,
+            //    done
+            //);
+            //printIntegrate<volTensorField>
+            //(
+            //    mesh,
+            //    fieldHeader,
+            //    patchI,
+            //    done
+            //);
 
-                Info<< "    Integral of " << fieldName << " over patch "
-                    << patchName << '[' << patchI << ']' << " = "
-                    << sumField << nl;
-            }
-            else
+            printSum<surfaceScalarField>
+            (
+                mesh,
+                fieldHeader,
+                patchI,
+                done
+            );
+            printSum<surfaceVectorField>
+            (
+                mesh,
+                fieldHeader,
+                patchI,
+                done
+            );
+            printSum<volSphericalTensorField>
+            (
+                mesh,
+                fieldHeader,
+                patchI,
+                done
+            );
+            printSum<volSymmTensorField>
+            (
+                mesh,
+                fieldHeader,
+                patchI,
+                done
+            );
+            printSum<volTensorField>
+            (
+                mesh,
+                fieldHeader,
+                patchI,
+                done
+            );
+
+            if (!done)
             {
                 FatalError
                     << "Only possible to integrate "
-                    << volScalarField::typeName << "s "
-                    << "and " << surfaceScalarField::typeName << "s"
+                    << "volFields and surfaceFields."
+                    << " Field " << fieldName << " is of type "
+                    << fieldHeader.headerClassName()
                     << nl << exit(FatalError);
             }
         }
diff --git a/applications/utilities/postProcessing/velocityField/Mach/Mach.C b/applications/utilities/postProcessing/velocityField/Mach/Mach.C
index 2233465bfe98b9fb070661d5aa2163aed31f452b..3463175d7725ab445f191ed7c0d736a8215dd4fa 100644
--- a/applications/utilities/postProcessing/velocityField/Mach/Mach.C
+++ b/applications/utilities/postProcessing/velocityField/Mach/Mach.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -33,9 +33,10 @@ Description
 \*---------------------------------------------------------------------------*/
 
 #include "calc.H"
-#include "basicPsiThermo.H"
+#include "basicThermo.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
 void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
 {
     bool writeResults = !args.optionFound("noWrite");
@@ -74,9 +75,9 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
         )
         {
             // thermophysical Mach
-            autoPtr<basicPsiThermo> thermo
+            autoPtr<basicThermo> thermo
             (
-                basicPsiThermo::New(mesh)
+                basicThermo::New(mesh)
             );
 
             volScalarField Cp(thermo->Cp());
diff --git a/applications/utilities/postProcessing/velocityField/Mach/thermophysicalMach.H b/applications/utilities/postProcessing/velocityField/Mach/thermophysicalMach.H
index 7283802f7790a6c0cf209195a9273e51697fc017..4e4ea81b3d87463b4c8d91fb115e0ea465e4b41b 100644
--- a/applications/utilities/postProcessing/velocityField/Mach/thermophysicalMach.H
+++ b/applications/utilities/postProcessing/velocityField/Mach/thermophysicalMach.H
@@ -18,9 +18,9 @@
         {
             volVectorField U(Uheader, mesh);
 
-            autoPtr<basicPsiThermo> thermo
+            autoPtr<basicThermo> thermo
             (
-                basicPsiThermo::New(mesh)
+                basicThermo::New(mesh)
             );
 
             volScalarField Cp = thermo->Cp();
diff --git a/applications/utilities/postProcessing/velocityField/Pe/Pe.C b/applications/utilities/postProcessing/velocityField/Pe/Pe.C
index c77c0cee056cda1e1e06ab8415ebd63ad118676b..c262482ce734e742ab063b8ac4b3463c832934b8 100644
--- a/applications/utilities/postProcessing/velocityField/Pe/Pe.C
+++ b/applications/utilities/postProcessing/velocityField/Pe/Pe.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -39,7 +39,7 @@ Description
 #include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
 #include "incompressible/RAS/RASModel/RASModel.H"
 #include "incompressible/LES/LESModel/LESModel.H"
-#include "basicPsiThermo.H"
+#include "basicThermo.H"
 #include "compressible/RAS/RASModel/RASModel.H"
 #include "compressible/LES/LESModel/LESModel.H"
 
@@ -204,7 +204,7 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
             {
                 IOdictionary RASProperties(RASPropertiesHeader);
 
-                autoPtr<basicPsiThermo> thermo(basicPsiThermo::New(mesh));
+                autoPtr<basicThermo> thermo(basicThermo::New(mesh));
 
                 volScalarField rho
                 (
@@ -252,7 +252,7 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
             {
                 IOdictionary LESProperties(LESPropertiesHeader);
 
-                autoPtr<basicPsiThermo> thermo(basicPsiThermo::New(mesh));
+                autoPtr<basicThermo> thermo(basicThermo::New(mesh));
 
                 volScalarField rho
                 (
diff --git a/applications/utilities/postProcessing/wall/solidWallHeatFlux/Make/files b/applications/utilities/postProcessing/wall/solidWallHeatFlux/Make/files
new file mode 100644
index 0000000000000000000000000000000000000000..bdf785fe20e88586224b4b014f354575ba9c9fef
--- /dev/null
+++ b/applications/utilities/postProcessing/wall/solidWallHeatFlux/Make/files
@@ -0,0 +1,3 @@
+solidWallHeatFlux.C
+
+EXE = $(FOAM_APPBIN)/solidWallHeatFlux
diff --git a/applications/utilities/postProcessing/wall/solidWallHeatFlux/Make/options b/applications/utilities/postProcessing/wall/solidWallHeatFlux/Make/options
new file mode 100644
index 0000000000000000000000000000000000000000..64d31222de00a8534b59c82b06161f38699097b4
--- /dev/null
+++ b/applications/utilities/postProcessing/wall/solidWallHeatFlux/Make/options
@@ -0,0 +1,12 @@
+EXE_INC = \
+    -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
+    -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
+    -I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \
+    -I$(LIB_SRC)/finiteVolume/lnInclude
+
+EXE_LIBS = \
+    -lbasicThermophysicalModels \
+    -lbasicSolidThermo \
+    -lspecie \
+    -lfiniteVolume \
+    -lgenericPatchFields
diff --git a/applications/utilities/postProcessing/wall/solidWallHeatFlux/createFields.H b/applications/utilities/postProcessing/wall/solidWallHeatFlux/createFields.H
new file mode 100644
index 0000000000000000000000000000000000000000..c845710399bd7dd773c2c81221efffb6fdfbe6fb
--- /dev/null
+++ b/applications/utilities/postProcessing/wall/solidWallHeatFlux/createFields.H
@@ -0,0 +1,6 @@
+autoPtr<basicSolidThermo> thermo
+(
+    basicSolidThermo::New(mesh)
+);
+
+volScalarField& T = thermo->T();
diff --git a/applications/utilities/postProcessing/wall/solidWallHeatFlux/solidWallHeatFlux.C b/applications/utilities/postProcessing/wall/solidWallHeatFlux/solidWallHeatFlux.C
new file mode 100644
index 0000000000000000000000000000000000000000..f728a626b18ec33551cf9e71dd5a5438d7804617
--- /dev/null
+++ b/applications/utilities/postProcessing/wall/solidWallHeatFlux/solidWallHeatFlux.C
@@ -0,0 +1,102 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2012 OpenFOAM Foundation
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software: you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+    for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
+
+Application
+    solidWallHeatFlux
+
+Description
+    Calculates and writes the heat flux for all patches as the boundary field
+    of a volScalarField and also prints the integrated flux for all wall
+    patches.
+
+\*---------------------------------------------------------------------------*/
+
+#include "fvCFD.H"
+#include "wallFvPatch.H"
+#include "basicSolidThermo.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+int main(int argc, char *argv[])
+{
+    timeSelector::addOptions();
+#   include "addRegionOption.H"
+    #include "setRootCase.H"
+    #include "createTime.H"
+    instantList timeDirs = timeSelector::select0(runTime, args);
+    #include "createNamedMesh.H"
+
+    forAll(timeDirs, timeI)
+    {
+        runTime.setTime(timeDirs[timeI], timeI);
+        Info<< "Time = " << runTime.timeName() << endl;
+        mesh.readUpdate();
+
+        // Read temperature
+        #include "createFields.H"
+
+        // Create heat flux as volScalarField with as boundary values
+        // the heat flux
+        volScalarField wallHeatFlux
+        (
+            IOobject
+            (
+                "solidWallHeatFlux",
+                runTime.timeName(),
+                mesh
+            ),
+            mesh,
+            dimensionedScalar("solidWallHeatFlux", dimPower/dimArea, 0.0)
+        );
+
+        Info<< "\nWall heat fluxes [W]" << endl;
+        forAll(wallHeatFlux.boundaryField(), patchi)
+        {
+            wallHeatFlux.boundaryField()[patchi] =
+                thermo().K(patchi)
+               *T.boundaryField()[patchi].snGrad();
+
+            if (isA<wallFvPatch>(mesh.boundary()[patchi]))
+            {
+                Info<< mesh.boundary()[patchi].name()
+                    << " "
+                    << gSum
+                       (
+                           mesh.magSf().boundaryField()[patchi]
+                          *wallHeatFlux.boundaryField()[patchi]
+                       )
+                    << endl;
+            }
+        }
+
+        wallHeatFlux.write();
+
+        Info<< endl;
+    }
+
+    Info<< "End" << endl;
+
+    return 0;
+}
+
+// ************************************************************************* //
diff --git a/applications/utilities/postProcessing/wall/wallHeatFlux/createFields.H b/applications/utilities/postProcessing/wall/wallHeatFlux/createFields.H
index 609d4c3776006ef5be5295695fbcce84cf8a2ca7..d4f142d54523aa937da214a2f8dfc623fd80422c 100644
--- a/applications/utilities/postProcessing/wall/wallHeatFlux/createFields.H
+++ b/applications/utilities/postProcessing/wall/wallHeatFlux/createFields.H
@@ -1,6 +1,6 @@
-autoPtr<basicPsiThermo> thermo
+autoPtr<basicThermo> thermo
 (
-    basicPsiThermo::New(mesh)
+    basicThermo::New(mesh)
 );
 
 const volScalarField& h = thermo->h();
diff --git a/applications/utilities/postProcessing/wall/wallHeatFlux/wallHeatFlux.C b/applications/utilities/postProcessing/wall/wallHeatFlux/wallHeatFlux.C
index 070869ce28e93fa995d493afdc475613af847e75..2789b52f83d7d96655ac1fb30732b4693b0ca75d 100644
--- a/applications/utilities/postProcessing/wall/wallHeatFlux/wallHeatFlux.C
+++ b/applications/utilities/postProcessing/wall/wallHeatFlux/wallHeatFlux.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -41,10 +41,11 @@ Description
 int main(int argc, char *argv[])
 {
     timeSelector::addOptions();
+#   include "addRegionOption.H"
     #include "setRootCase.H"
     #include "createTime.H"
     instantList timeDirs = timeSelector::select0(runTime, args);
-    #include "createMesh.H"
+    #include "createNamedMesh.H"
 
     forAll(timeDirs, timeI)
     {
@@ -69,7 +70,7 @@ int main(int argc, char *argv[])
             {
                 Info<< mesh.boundary()[patchi].name()
                     << " "
-                    << sum
+                    << gSum
                        (
                            mesh.magSf().boundaryField()[patchi]
                           *patchHeatFlux[patchi]
diff --git a/applications/utilities/postProcessing/wall/wallShearStress/wallShearStress.C b/applications/utilities/postProcessing/wall/wallShearStress/wallShearStress.C
index 6069837b9513d27ca51c72792ffde69f3eec68a4..83a1e57f42dccc7b522af52ac22430dd3be18830 100644
--- a/applications/utilities/postProcessing/wall/wallShearStress/wallShearStress.C
+++ b/applications/utilities/postProcessing/wall/wallShearStress/wallShearStress.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -38,7 +38,7 @@ Description
 #include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
 #include "incompressible/RAS/RASModel/RASModel.H"
 
-#include "basicPsiThermo.H"
+#include "basicThermo.H"
 #include "compressible/RAS/RASModel/RASModel.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -101,11 +101,8 @@ void calcCompressible
 
     #include "compressibleCreatePhi.H"
 
-    autoPtr<basicPsiThermo> pThermo
-    (
-        basicPsiThermo::New(mesh)
-    );
-    basicPsiThermo& thermo = pThermo();
+    autoPtr<basicThermo> pThermo(basicThermo::New(mesh));
+    basicThermo& thermo = pThermo();
 
     autoPtr<compressible::RASModel> model
     (
diff --git a/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C b/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C
index 359c3bcb4fa7ddec8b5af27d19d10c95902c4c4e..c8de884de96c61ff6ba1571fecd27f6ebfe60746 100644
--- a/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C
+++ b/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -39,7 +39,7 @@ Description
 #include "incompressible/RAS/RASModel/RASModel.H"
 #include "nutkWallFunction/nutkWallFunctionFvPatchScalarField.H"
 
-#include "basicPsiThermo.H"
+#include "basicThermo.H"
 #include "compressible/RAS/RASModel/RASModel.H"
 #include "mutkWallFunction/mutkWallFunctionFvPatchScalarField.H"
 
@@ -130,11 +130,11 @@ void calcCompressibleYPlus
 
     #include "compressibleCreatePhi.H"
 
-    autoPtr<basicPsiThermo> pThermo
+    autoPtr<basicThermo> pThermo
     (
-        basicPsiThermo::New(mesh)
+        basicThermo::New(mesh)
     );
-    basicPsiThermo& thermo = pThermo();
+    basicThermo& thermo = pThermo();
 
     autoPtr<compressible::RASModel> RASModel
     (
diff --git a/src/OpenFOAM/db/Time/Time.C b/src/OpenFOAM/db/Time/Time.C
index 7abcf7f9a0dc85ecc2e14bc14701cc3ea02eddef..4c23251542ff2a6742318eb9f9c42c5ac829963f 100644
--- a/src/OpenFOAM/db/Time/Time.C
+++ b/src/OpenFOAM/db/Time/Time.C
@@ -984,6 +984,17 @@ Foam::Time& Foam::Time::operator++()
             << " to " << precision_
             << " to distinguish between timeNames at time " << value()
             << endl;
+
+        if (precision_ == 100 && precision_ != oldPrecision)
+        {
+            // Reached limit.
+            WarningIn("Time::operator++()")
+                << "Current time name " << dimensionedScalar::name()
+                << " is the old as the previous one " << oldTimeName
+                << endl
+                << "    This might result in overwriting old results."
+                << endl;
+        }
     }
 
 
diff --git a/src/edgeMesh/edgeFormats/emesh/EMESHedgeFormat.C b/src/edgeMesh/edgeFormats/emesh/EMESHedgeFormat.C
index b7e0be2279d963830f9704f24aed660278fcce63..aa9028e4634772a98305ac2d29da0530e92bee00 100644
--- a/src/edgeMesh/edgeFormats/emesh/EMESHedgeFormat.C
+++ b/src/edgeMesh/edgeFormats/emesh/EMESHedgeFormat.C
@@ -176,7 +176,7 @@ void Foam::fileFormats::EMESHedgeFormat::write
         << "    version     " << os.version() << ";\n"
         << "    format      " << os.format() << ";\n"
         << "    class       " << "featureEdgeMesh" << ";\n"
-        << "    note        " << "written " + clock::dateTime() << nl
+        << "    note        " << "written " + clock::dateTime() << ";\n"
         << "    object      " << filename.name() << ";\n"
         << "}" << nl;
 
diff --git a/src/thermophysicalModels/basic/Make/files b/src/thermophysicalModels/basic/Make/files
index 1a9d82af062507e937dcaa3fe2c4d3633f60dd97..1c08f455dfd1f1231e23ddf8d4b1835b2cec8fb9 100644
--- a/src/thermophysicalModels/basic/Make/files
+++ b/src/thermophysicalModels/basic/Make/files
@@ -2,6 +2,7 @@ mixtures/basicMixture/basicMixture.C
 mixtures/basicMixture/basicMixtures.C
 
 basicThermo/basicThermo.C
+basicThermo/basicThermoNew.C
 
 psiThermo/basicPsiThermo/basicPsiThermo.C
 psiThermo/basicPsiThermo/basicPsiThermoNew.C
diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.C b/src/thermophysicalModels/basic/basicThermo/basicThermo.C
index 7b0d81aea78eb41e44baba35b885f283a451212f..ad40123d6eed02483f6c60a456757caace07808b 100644
--- a/src/thermophysicalModels/basic/basicThermo/basicThermo.C
+++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -39,6 +39,7 @@ License
 namespace Foam
 {
     defineTypeNameAndDebug(basicThermo, 0);
+    defineRunTimeSelectionTable(basicThermo, fvMesh);
 }
 
 // * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.H b/src/thermophysicalModels/basic/basicThermo/basicThermo.H
index aa331ded7e1a86f57e98ca4b17757c91af04d9eb..0bb67f8b49557e891f55791f29ccd4c7f7031f9d 100644
--- a/src/thermophysicalModels/basic/basicThermo/basicThermo.H
+++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -29,7 +29,7 @@ Description
 
 SourceFiles
     basicThermo.C
-    newBasicThermo.C
+    basicThermoNew.C
 
 \*---------------------------------------------------------------------------*/
 
@@ -109,12 +109,25 @@ public:
     TypeName("basicThermo");
 
 
+    //- Declare run-time constructor selection table
+    declareRunTimeSelectionTable
+    (
+        autoPtr,
+        basicThermo,
+        fvMesh,
+        (const fvMesh& mesh),
+        (mesh)
+    );
+
     // Constructors
 
         //- Construct from mesh
         basicThermo(const fvMesh&);
 
 
+    //- Selector
+    static autoPtr<basicThermo> New(const fvMesh&);
+
     //- Destructor
     virtual ~basicThermo();
 
diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermoNew.C b/src/thermophysicalModels/basic/basicThermo/basicThermoNew.C
new file mode 100644
index 0000000000000000000000000000000000000000..e7dda0d9d548d8543a47f6346c02de0895bdbacb
--- /dev/null
+++ b/src/thermophysicalModels/basic/basicThermo/basicThermoNew.C
@@ -0,0 +1,71 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2012 OpenFOAM Foundation
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software: you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+    for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
+
+\*---------------------------------------------------------------------------*/
+
+#include "basicThermo.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+Foam::autoPtr<Foam::basicThermo> Foam::basicThermo::New
+(
+    const fvMesh& mesh
+)
+{
+    // get model name, but do not register the dictionary
+    // otherwise it is registered in the database twice
+    const word modelType
+    (
+        IOdictionary
+        (
+            IOobject
+            (
+                "thermophysicalProperties",
+                mesh.time().constant(),
+                mesh,
+                IOobject::MUST_READ_IF_MODIFIED,
+                IOobject::NO_WRITE,
+                false
+            )
+        ).lookup("thermoType")
+    );
+
+    Info<< "Selecting thermodynamics package " << modelType << endl;
+
+    fvMeshConstructorTable::iterator cstrIter =
+        fvMeshConstructorTablePtr_->find(modelType);
+
+    if (cstrIter == fvMeshConstructorTablePtr_->end())
+    {
+        FatalErrorIn("basicThermo::New(const fvMesh&)")
+            << "Unknown basicThermo type " << modelType << nl << nl
+            << "Valid basicThermo types are:" << nl
+            << fvMeshConstructorTablePtr_->sortedToc() << nl
+            << exit(FatalError);
+    }
+
+    return autoPtr<basicThermo>(cstrIter()(mesh));
+}
+
+
+// ************************************************************************* //
diff --git a/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/makeBasicPsiThermo.H b/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/makeBasicPsiThermo.H
index 890b5f2b90f197863c5ecc793c067a831eca7d5d..d9322918d59a9f76e9050e2ce68376015f2852b4 100644
--- a/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/makeBasicPsiThermo.H
+++ b/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/makeBasicPsiThermo.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -55,7 +55,14 @@ addToRunTimeSelectionTable                                                    \
     basicPsiThermo,                                                           \
     Cthermo##Mixture##Transport##Thermo##EqnOfState,                          \
     fvMesh                                                                    \
-)
+);                                                                            \
+                                                                              \
+addToRunTimeSelectionTable                                                    \
+(                                                                             \
+    basicThermo,                                                              \
+    Cthermo##Mixture##Transport##Thermo##EqnOfState,                          \
+    fvMesh                                                                    \
+);
 
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/makeBasicRhoThermo.H b/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/makeBasicRhoThermo.H
index 3edfa3a69c03407913421cd850d4bbadaf6f7cf8..e7a4de187e1272083c4f07eb27ce7d3e4a9fc63d 100644
--- a/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/makeBasicRhoThermo.H
+++ b/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/makeBasicRhoThermo.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -55,7 +55,14 @@ addToRunTimeSelectionTable                                                    \
     basicRhoThermo,                                                           \
     Cthermo##Mixture##Transport##Thermo##EqnOfState,                          \
     fvMesh                                                                    \
-)
+);                                                                            \
+                                                                              \
+addToRunTimeSelectionTable                                                    \
+(                                                                             \
+    basicThermo,                                                              \
+    Cthermo##Mixture##Transport##Thermo##EqnOfState,                          \
+    fvMesh                                                                    \
+);
 
 
 #define makeBasicRhoPolyThermo(Cthermo,Mixture,Order)                         \
@@ -88,7 +95,14 @@ addToRunTimeSelectionTable                                                    \
     basicRhoThermo,                                                           \
     Cthermo##Mixture##icoPoly##Order##ThermoPhysics,                          \
     fvMesh                                                                    \
-)
+);                                                                            \
+                                                                              \
+addToRunTimeSelectionTable                                                    \
+(                                                                             \
+    basicThermo,                                                              \
+    Cthermo##Mixture##icoPoly##Order##ThermoPhysics,                          \
+    fvMesh                                                                    \
+);
 
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //