From 6270f912f0471c3bf9198d7af8c7640e141c4719 Mon Sep 17 00:00:00 2001
From: Henry <Henry>
Date: Wed, 26 Feb 2014 10:02:00 +0000
Subject: [PATCH] wedgeFvPatch: provide specialized version of delta() to
 ensure than the delta vectors are normal to the wedge plane. Resolves
 bug-report http://www.openfoam.org/mantisbt/view.php?id=1185

---
 .../fvMesh/fvPatches/constraint/wedge/wedgeFvPatch.C | 12 ++++++++++--
 .../fvMesh/fvPatches/constraint/wedge/wedgeFvPatch.H |  5 ++++-
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/finiteVolume/fvMesh/fvPatches/constraint/wedge/wedgeFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/constraint/wedge/wedgeFvPatch.C
index 94084ad94f1..ddc60991217 100644
--- a/src/finiteVolume/fvMesh/fvPatches/constraint/wedge/wedgeFvPatch.C
+++ b/src/finiteVolume/fvMesh/fvPatches/constraint/wedge/wedgeFvPatch.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2014 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -39,7 +39,6 @@ addToRunTimeSelectionTable(fvPatch, wedgeFvPatch, polyPatch);
 
 // * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * * * * * //
 
-//- Construct from polyPatch
 wedgeFvPatch::wedgeFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm)
 :
     fvPatch(patch, bm),
@@ -47,6 +46,15 @@ wedgeFvPatch::wedgeFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm)
 {}
 
 
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
+
+Foam::tmp<Foam::vectorField> Foam::wedgeFvPatch::delta() const
+{
+    const vectorField nHat(nf());
+    return nHat*(nHat & (Cf() - Cn()));
+}
+
+
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 } // End namespace Foam
diff --git a/src/finiteVolume/fvMesh/fvPatches/constraint/wedge/wedgeFvPatch.H b/src/finiteVolume/fvMesh/fvPatches/constraint/wedge/wedgeFvPatch.H
index 81f6a5f3202..16fab3e42b8 100644
--- a/src/finiteVolume/fvMesh/fvPatches/constraint/wedge/wedgeFvPatch.H
+++ b/src/finiteVolume/fvMesh/fvPatches/constraint/wedge/wedgeFvPatch.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2014 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -83,6 +83,9 @@ public:
             {
                 return wedgePolyPatch_.cellT();
             }
+
+            //- Return cell-centre to face normal vector
+            virtual tmp<vectorField> delta() const;
 };
 
 
-- 
GitLab