From 55f5241fc826472a0b7acda87a225b63a1cb3a04 Mon Sep 17 00:00:00 2001
From: mattijs <mattijs@hunt.opencfd.co.uk>
Date: Thu, 28 May 2009 18:14:38 +0100
Subject: [PATCH] output wallDistance

---
 .../postProcessing/wall/yPlusLES/Make/options   |  1 +
 .../postProcessing/wall/yPlusLES/yPlusLES.C     | 17 ++++++++++++++++-
 .../postProcessing/wall/yPlusRAS/Make/options   |  1 +
 .../postProcessing/wall/yPlusRAS/yPlusRAS.C     | 16 +++++++++++++++-
 4 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/applications/utilities/postProcessing/wall/yPlusLES/Make/options b/applications/utilities/postProcessing/wall/yPlusLES/Make/options
index 79fbbac91ef..f6131ce41c1 100644
--- a/applications/utilities/postProcessing/wall/yPlusLES/Make/options
+++ b/applications/utilities/postProcessing/wall/yPlusLES/Make/options
@@ -1,4 +1,5 @@
 EXE_INC = \
+    -I$(LIB_SRC)/meshTools/lnInclude \
     -I$(LIB_SRC)/turbulenceModels \
     -I$(LIB_SRC)/turbulenceModels/incompressible/LES/LESModel \
     -I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
diff --git a/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C b/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C
index 82ee27fa0ab..67dc0df3f0e 100644
--- a/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C
+++ b/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C
@@ -34,6 +34,7 @@ Description
 #include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
 #include "LESModel.H"
 #include "nearWallDist.H"
+#include "wallDist.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -49,7 +50,18 @@ int main(int argc, char *argv[])
     {
         runTime.setTime(timeDirs[timeI], timeI);
         Info<< "Time = " << runTime.timeName() << endl;
-        mesh.readUpdate();
+        fvMesh::readUpdateState state = mesh.readUpdate();
+
+        // Wall distance
+        if (timeI == 0 || state != fvMesh::UNCHANGED)
+        {
+            Info<< "Calculating wall distance\n" << endl;
+            wallDist y(mesh, true);
+            Info<< "Writing wall distance to field "
+                << y.name() << nl << endl;
+            y.write();
+        }
+
 
         volScalarField yPlus
         (
@@ -116,6 +128,9 @@ int main(int argc, char *argv[])
             }
         }
 
+        Info<< "Writing yPlus to field "
+            << yPlus.name() << nl << endl;
+
         yPlus.write();
     }
 
diff --git a/applications/utilities/postProcessing/wall/yPlusRAS/Make/options b/applications/utilities/postProcessing/wall/yPlusRAS/Make/options
index 89632547e08..9ec5fca52ba 100644
--- a/applications/utilities/postProcessing/wall/yPlusRAS/Make/options
+++ b/applications/utilities/postProcessing/wall/yPlusRAS/Make/options
@@ -1,4 +1,5 @@
 EXE_INC = \
+    -I$(LIB_SRC)/meshTools/lnInclude \
     -I$(LIB_SRC)/transportModels \
     -I$(LIB_SRC)/turbulenceModels \
     -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \
diff --git a/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C b/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C
index 7d1e4796f2b..a93712263e6 100644
--- a/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C
+++ b/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C
@@ -34,6 +34,7 @@ Description
 #include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
 #include "RASModel.H"
 #include "wallFvPatch.H"
+#include "wallDist.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -49,7 +50,17 @@ int main(int argc, char *argv[])
     {
         runTime.setTime(timeDirs[timeI], timeI);
         Info<< "Time = " << runTime.timeName() << endl;
-        mesh.readUpdate();
+        fvMesh::readUpdateState state = mesh.readUpdate();
+
+        // Wall distance
+        if (timeI == 0 || state != fvMesh::UNCHANGED)
+        {
+            Info<< "Calculating wall distance\n" << endl;
+            wallDist y(mesh, true);
+            Info<< "Writing wall distance to field "
+                << y.name() << nl << endl;
+            y.write();
+        }
 
         volScalarField yPlus
         (
@@ -106,6 +117,9 @@ int main(int argc, char *argv[])
             }
         }
 
+        Info<< "Writing yPlus to field "
+            << yPlus.name() << nl << endl;
+
         yPlus.write();
     }
 
-- 
GitLab