From 1aa09612e5a1eaa31dd41d39a3064006e2b4ed45 Mon Sep 17 00:00:00 2001 From: Henry Date: Mon, 8 Apr 2013 15:38:22 +0100 Subject: [PATCH] wallGradU: Calculate patch gradient only on wall patches --- .../postProcessing/wall/wallGradU/wallGradU.C | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/applications/utilities/postProcessing/wall/wallGradU/wallGradU.C b/applications/utilities/postProcessing/wall/wallGradU/wallGradU.C index 8ea4dadafc..6491f2b1f9 100644 --- a/applications/utilities/postProcessing/wall/wallGradU/wallGradU.C +++ b/applications/utilities/postProcessing/wall/wallGradU/wallGradU.C @@ -30,6 +30,7 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" +#include "wallFvPatch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -37,9 +38,9 @@ int main(int argc, char *argv[]) { timeSelector::addOptions(); #include "setRootCase.H" -# include "createTime.H" + #include "createTime.H" instantList timeDirs = timeSelector::select0(runTime, args); -# include "createMesh.H" + #include "createMesh.H" forAll(timeDirs, timeI) { @@ -83,10 +84,17 @@ int main(int argc, char *argv[]) ) ); + const fvPatchList& patches = mesh.boundary(); + forAll(wallGradU.boundaryField(), patchi) { - wallGradU.boundaryField()[patchi] = - -U.boundaryField()[patchi].snGrad(); + const fvPatch& currPatch = patches[patchi]; + + if (isA(currPatch)) + { + wallGradU.boundaryField()[patchi] = + -U.boundaryField()[patchi].snGrad(); + } } wallGradU.write();