streamFunction: Evaluate which coordinate plan the 2D geometry is in filter-out the normal component

Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1703
This commit is contained in:
Henry 2015-05-22 22:38:39 +01:00
parent e02530a0ac
commit f60808b4b8

View file

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -61,8 +61,14 @@ int main(int argc, char *argv[])
<< exit(FatalError); << exit(FatalError);
} }
const vector slabDir((Vector<label>::one - mesh.geometricD())/2); Vector<label> slabNormal((Vector<label>::one - mesh.geometricD())/2);
scalar thickness = slabDir & mesh.bounds().span(); const direction slabDir
(
slabNormal
& Vector<label>(Vector<label>::X, Vector<label>::Y, Vector<label>::Z)
);
scalar thickness = vector(slabNormal) & mesh.bounds().span();
const pointMesh& pMesh = pointMesh::New(mesh); const pointMesh& pMesh = pointMesh::New(mesh);
@ -302,7 +308,7 @@ int main(int argc, char *argv[])
vector edgeHat = vector edgeHat =
points[curBPoints[pointI]] points[curBPoints[pointI]]
- currentBStreamPoint; - currentBStreamPoint;
edgeHat.replace(vector::Z, 0); edgeHat.replace(slabDir, 0);
edgeHat /= mag(edgeHat); edgeHat /= mag(edgeHat);
vector nHat = unitAreas[faceI]; vector nHat = unitAreas[faceI];
@ -410,7 +416,7 @@ int main(int argc, char *argv[])
points[curPoints[pointI]] points[curPoints[pointI]]
- currentStreamPoint; - currentStreamPoint;
edgeHat.replace(vector::Z, 0); edgeHat.replace(slabDir, 0);
edgeHat /= mag(edgeHat); edgeHat /= mag(edgeHat);
vector nHat = unitAreas[faceI]; vector nHat = unitAreas[faceI];