|
[Sponsors] |
December 10, 2013, 08:54 |
Accessing surface normal gradient
|
#1 |
New Member
Join Date: Nov 2013
Posts: 20
Rep Power: 12 |
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. |
|
December 10, 2013, 09:02 |
|
#2 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29 |
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. |
|
December 10, 2013, 11:11 |
|
#3 |
New Member
Join Date: Nov 2013
Posts: 20
Rep Power: 12 |
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? |
|
December 10, 2013, 11:23 |
|
#4 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29 |
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. |
|
January 6, 2017, 06:22 |
|
#5 |
New Member
fluidflowsteel
Join Date: Jun 2016
Posts: 21
Rep Power: 9 |
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 |
|
January 9, 2017, 08:22 |
|
#6 |
Member
Hasan Celik
Join Date: Sep 2016
Posts: 64
Rep Power: 9 |
I suggest you write your own tool by modifying gradU utility of OpenFOAM or you can use swak4foam, I guess.
|
|
|
|
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 |