CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Face normal vector at the boundary

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

LinkBack Thread Tools Search this Thread Display Modes
Old   March 14, 2016, 06:25
Default Face normal vector at the boundary
New Member
Maximilian Transinger
Join Date: Nov 2015
Posts: 2
Rep Power: 0
traens is on a distinguished road
Dear all,

I am trying to implement a new contact angle model in a cylindrical sloshing tank.
Therefore, I introduce the x-component at the boundary as a kind of damping factor on my curved boundary. Meaning, boundary cells with a normal vector perpendicular to the x-axis should have a x-component of 0, cells with a normal vector parallel to the x-axis have a x-component, and so on.

I try to get the x-component as following:
scalarField normal_x=patch().Sf().component(0)/patch().magSf();
Compiling works, running the simulations also. But obviously in the results there is no difference at boundary regarding the x-direction.

Does anyone know different ways how to get the face normal vector?

Thank you!
traens is offline   Reply With Quote

Old   March 14, 2016, 13:27
Senior Member
Join Date: Sep 2013
Posts: 262
Rep Power: 16
Bloerb will become famous soon enough

patch().nf () const - Return face normals.
patch().Sf () const - Return face area vectors.
Bloerb is offline   Reply With Quote

Old   October 21, 2019, 22:11
Bidesh Sengupta
Join Date: Sep 2018
Posts: 71
Rep Power: 4
BSengupta is on a distinguished road

When I am writing the above code I am receiving error:
‘patch’ was not declared in this scope

Can anyone help me to understand the reason for this error.
BSengupta is offline   Reply With Quote

Old   July 12, 2020, 16:18
New Member
Join Date: Feb 2020
Posts: 4
Rep Power: 2
yukuns is on a distinguished road
Hello, have you resolved this issue? I ran into the same problem.
yukuns is offline   Reply With Quote


boundary condition, normal vector, patch field

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wind turbine simulation Saturn CFX 58 July 3, 2020 02:13
Radiation interface hinca CFX 15 January 26, 2014 18:11
[General] Problem in the calculation of the normal gradient on a boundary face N1colas ParaView 1 June 28, 2013 10:38
Question about heat transfer coefficient setting for CFX Anna Tian CFX 1 June 16, 2013 07:28
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 15:00

All times are GMT -4. The time now is 14:21.