CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Accessing surface normal gradient

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

Reply
 
LinkBack Thread Tools Display Modes
Old   December 10, 2013, 09:54
Default Accessing surface normal gradient
  #1
New Member
 
Join Date: Nov 2013
Posts: 20
Rep Power: 3
Jakob1 is on a distinguished road
Hello,
I am trying to access the surface normal gradient of a certain variable (i.e. a) (unstructured grid). fvc::snGrad(a) only gives me the absolute value, right? (surfaceScalarField). How do I get the surfaceVectorField version of that?

And on top of that: How does this (hopefully existing) quantity behave on boundary surfaces of a cell? I imagine it being defined as (a(V1)-a(V2))/d. Now if a has a Diriclet condition on the boundary, how would that work? (Can't define a Neumann bc, the change of gradient on the boundary is crucial for my function).

Would be great if someone could give me a hint here Thanks in advance.
Jakob1 is offline   Reply With Quote

Old   December 10, 2013, 10:02
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Delft, Netherlands
Posts: 919
Rep Power: 17
akidess will become famous soon enough
A surface*Normal*Gradient always only has a magnitude, because the direction is given by the face normal. snGrad(a) * mesh.Sf() I guess will give you the gradient vector.
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
*Help define the OpenFOAM stackexchange Q&A site: http://area51.stackexchange.com/prop...oam-technology
akidess is offline   Reply With Quote

Old   December 10, 2013, 12:11
Default
  #3
New Member
 
Join Date: Nov 2013
Posts: 20
Rep Power: 3
Jakob1 is on a distinguished road
mesh.Sf() also includes the face area rght? So I guess mesh.Sf()/mesh.magSf() should do it then? Thanks by the way!

Still though, how does it behave at boundaries? Would it use the value on the boundary instead of the neighboring volume?
Jakob1 is offline   Reply With Quote

Old   December 10, 2013, 12:23
Default
  #4
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Delft, Netherlands
Posts: 919
Rep Power: 17
akidess will become famous soon enough
Right. About the boundary question - why would snGrad neglect your boundary conditions, no matter what you select?
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
*Help define the OpenFOAM stackexchange Q&A site: http://area51.stackexchange.com/prop...oam-technology
akidess is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
surface tension gradient using UDF; surface tension gradient as function of temperatu marimuthusundar Fluent UDF and Scheme Programming 0 June 21, 2012 04:48
Surface normal gradient on unstructured mesh fumiya OpenFOAM 1 September 30, 2011 04:34
How to get the surface normal vector ohrmond CFX 2 August 16, 2006 03:40
surface tension gradient on a free surface Abrem FLUENT 1 April 30, 2006 03:41
CFX4.3 -build analysis form Chie Min CFX 5 July 12, 2001 23:19


All times are GMT -4. The time now is 04:05.