|
[Sponsors] |
November 2, 2010, 06:44 |
faceNormals
|
#1 |
Member
Join Date: Aug 2010
Posts: 31
Rep Power: 16 |
Hi,
I need the normal vector of a special Face (with label faceI). I have tried mesh.faceNormals()[faceI] but got the following: error: ‘class Foam::fvMesh’ has no member named ‘faceNormals’. Maybe someone can give me a hint how to use faceNormals. B.r., M. |
|
November 2, 2010, 07:09 |
|
#2 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,902
Rep Power: 37 |
The functionality is called Sf() and not faceNormals().
So do: vector N = mesh.Sf()[faceI]; The length of N, i.e. Foam::mag(N) is the area of the face. Best regards, Niels |
|
November 2, 2010, 07:25 |
|
#3 |
Member
Join Date: Aug 2010
Posts: 31
Rep Power: 16 |
Hello Niels,
thank you for your answer, but I have not used .Sf() because I am worried about the fact that the number of faces is not equal to the number of vectors of mesh.Sf(). s1=mesh.nFaces(); s2=mesh.Sf().size(); s2<s1; My faceI is in [0...s1] B.r.,M. |
|
November 2, 2010, 08:47 |
|
#4 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,902
Rep Power: 37 |
Hi Martin
This is because mesh.Sf() returns the internal faces, hence mesh.Sf().size() = mesh.nInternalFaces(). If you are working on all the faces, the additional faces on the boundaries needs to be accessed using mesh.Sf().boundaryField()[patchi]. Best regards, Niels |
|
November 2, 2010, 09:57 |
|
#5 |
Member
Join Date: Aug 2010
Posts: 31
Rep Power: 16 |
Thanks a lot, Niels,
do you know how OpenFoam is counting the faces? To clarify my question: let's assume a field consists of 800 internal faces and 200 boundary faces. I'm using "mesh.edgeFaces()[edgeI]" and get a list of face numbers between 0 and 999. Is it true that if the number is less than 800 the corresponding face is an internal face? If not how is the counting of the "internal faces" connected to the counting of "all faces"? B.r.,M. |
|
November 2, 2010, 12:49 |
|
#6 | |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,902
Rep Power: 37 |
Quote:
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to update polyPatchbs localPoints | liu | OpenFOAM Running, Solving & CFD | 6 | December 30, 2005 18:27 |