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

Accessing surface normal gradient

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 10, 2013, 08:54
Default Accessing surface normal gradient
  #1
New Member
 
Join Date: Nov 2013
Posts: 20
Rep Power: 12
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, 09:02
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29
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.
akidess is offline   Reply With Quote

Old   December 10, 2013, 11:11
Default
  #3
New Member
 
Join Date: Nov 2013
Posts: 20
Rep Power: 12
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, 11:23
Default
  #4
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29
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.
akidess is offline   Reply With Quote

Old   January 6, 2017, 06:22
Default
  #5
New Member
 
fluidflowsteel
Join Date: Jun 2016
Posts: 21
Rep Power: 9
fluidflowsteel is on a distinguished road
Hi ,

I have a variable p for which I want to calculate the gradient normal to the surface in both x and y directions. Can anyone help me ?


With regards
fluidflowsteel is offline   Reply With Quote

Old   January 9, 2017, 08:22
Default
  #6
Member
 
Hasan Celik
Join Date: Sep 2016
Posts: 64
Rep Power: 9
PositronCascade is on a distinguished road
I suggest you write your own tool by modifying gradU utility of OpenFOAM or you can use swak4foam, I guess.


Quote:
Originally Posted by fluidflowsteel View Post
Hi ,

I have a variable p for which I want to calculate the gradient normal to the surface in both x and y directions. Can anyone help me ?


With regards
PositronCascade is offline   Reply With Quote

Reply


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
How to get the surface normal vector ohrmond CFX 3 February 1, 2018 05:45
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
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 13:04.