# faceNormals

 Register Blogs Members List Search Today's Posts Mark Forums Read

 November 2, 2010, 06:44 faceNormals #1 Member   Join Date: Aug 2010 Posts: 31 Rep Power: 9 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: Deltares, Delft, The Netherlands Posts: 1,759 Rep Power: 29 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: 9 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

 November 2, 2010, 08:47 #4 Senior Member   Niels Gjoel Jacobsen Join Date: Mar 2009 Location: Deltares, Delft, The Netherlands Posts: 1,759 Rep Power: 29 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: 9 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: Deltares, Delft, The Netherlands
Posts: 1,759
Rep Power: 29
Quote:
 Originally Posted by Martin80 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? B.r.,M.
Yes, you are right.

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post liu OpenFOAM Running, Solving & CFD 6 December 30, 2005 18:27

All times are GMT -4. The time now is 12:30.