|
[Sponsors] |
The face normal vectors extracted by nf() and Sf()/magSf() are not unit vectors |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 9, 2019, 22:30 |
The face normal vectors extracted by nf() and Sf()/magSf() are not unit vectors
|
#1 |
Member
Wenming Yang
Join Date: Jun 2018
Posts: 42
Rep Power: 8 |
Dear Foamers,
I am trying to extract face normal vectors of each cell face on a boundary patch. I used function nf() and the calculation Sf()/magSf(). The codes are listed as follows, forAll(meshedRegions.boundaryMesh(), patchI) { if (meshedRegions.boundary()[patchI].name().match("sym")) { for(label patchFaceI(meshedRegions.boundary()[patchI].start()); patchFaceI <= meshedRegions.boundary()[patchI].start()+meshedRegions.boundary()[patchI].Cf().size()-1; patchFaceI++) { vector faceINormal1 = meshedRegions.boundary()[patchI].Sf()[patchFaceI]/meshedRegions.boundary()[patchI].magSf()[patchFaceI]; vector faceINormal2 = meshedRegions[i].boundary()[patchI].nf()()[patchFaceI]; } } } I found some problems: 1. The vectors obtained by these two methods are both not unit vectors. 2. The vectors obtained by these two methods are not same, but with large difference. 3. The boundary patch "sym" was a plane perpendicular to the z-axis, but the obtained "faceINormals" vectors did not point to z-axis. I donot know if there are some problems in my codes. |
|
Tags |
nf(), sf()/magsf() |
|
|