|
[Sponsors] |
February 25, 2024, 05:26 |
Tangent vectors to a surface
|
#1 |
New Member
Khoder Alshaar
Join Date: May 2021
Posts: 7
Rep Power: 4 |
Hi,
I know that the normal vector can be defined in OpenFOAM as follows: Code:
// Face area normal vectors const surfaceVectorField& Sf = mesh.Sf(); // Face areas const surfaceScalarField& magSf = mesh.magSf(); // Face normals const surfaceVectorField& N = Sf/magSf; ........................................ |
|
February 28, 2024, 07:29 |
|
#2 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 668
Rep Power: 14 |
Okay - this is a maths question, rather than an OpenFOAM question, but here goes.
You want to find a vector that is normal to unit vector N - let's call it t. There are of course an inifite number of these, but let's assume that you are not too bothered which one you get. Then: 1. define a vector t1 = (1,0,0) 2. calculate the dot product of t1.N and check whether this equals 1? 3. if it does, then N is pointing in the same direction as t1, and so you can set t=(0,1,0) 3. if it does not, then calculate t2 = t1 x N (cross product) and then divide this through by its norm to get the unit vector t. |
|
February 28, 2024, 15:21 |
|
#3 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,684
Rep Power: 40 |
Quote:
Indeed, this is similar to what is being done in https://develop.openfoam.com/Develop...ref_type=heads https://develop.openfoam.com/Develop...ref_type=heads Code:
// Guess second axis axes::rotation(axis, Zero, E3_E1) findOrthogonal() and then the removeCollinear() |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
tangent vectors in directionMixed | Martin80 | OpenFOAM Programming & Development | 1 | February 25, 2024 13:13 |
[snappyHexMesh] snappyHexMesh and CfMesh: Surface is not smooth | mortezahdr | OpenFOAM Meshing & Mesh Conversion | 1 | October 11, 2023 03:21 |
SU2 7.0.7 Built on CentOS 7, parallel computation pyscript mpi exit error? | EternalSeekerX | SU2 | 3 | October 9, 2020 18:28 |
How To Create Fowcs William Hawkings Surface in Fluent? | marinkobezu | FLUENT | 7 | October 25, 2018 10:51 |
[Gmsh] Problem with Gmsh | nishant_hull | OpenFOAM Meshing & Mesh Conversion | 23 | August 5, 2015 02:09 |