CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (http://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   refineMesh inverses face normals? (http://www.cfd-online.com/Forums/openfoam-meshing/105567-refinemesh-inverses-face-normals.html)

RoE August 2, 2012 13:16

refineMesh inverses face normals?
 
My home-brewed code crashes on meshes refined with the "refineMesh" utility. To find out what is happening I made a small mesh consisting of two cells and used refineMesh to split both cells. I wrote a code which calculates the snGrad of a scalar field, loops over all cells and writes the snGrads (which are very important for my code) and the face normals Sf() to the output file.

It seems that refineMesh inverses the face normals of some faces. Consequently, the snGrad of these faces has the opposite sign. Interestingly, the normals of the "new" faces created with refineMesh point in the correct direction whereas the normals of "old" internal cells are inversed.

Does anybody know why the nomals are inversed?

Thanks in advance!
Roland

bigphil August 2, 2012 15:05

Quote:

Originally Posted by RoE (Post 375084)
It seems that refineMesh inverses the face normals of some faces.

Hi Roland,

The normal on an internal face point from the cell owner to the cell neighbour. refineMesh probably has to reassign owners and neighbours after refining.
But the new normals should still be correctly pointing from the new owners to new neighbours. Why is it a problem?

Best regards,
Philip

RoE August 3, 2012 11:28

Hi Philip,

the normals do point from the new owners to the new neighbours. I knew I had read about the normal orientation and its relation to the owner/neighbour thingy, but I could not remember where exactly... So that was just the information I needed! My code runs on refined meshes now :)

Thank you & best wishes,
Roland

bigphil August 3, 2012 11:41

That's Great :)

Philip


All times are GMT -4. The time now is 15:35.