CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   What does the snGrad operator do? (https://www.cfd-online.com/Forums/openfoam-programming-development/176122-what-does-sngrad-operator-do.html)

Verse August 11, 2016 09:59

What does the snGrad operator do?
 
I noticed that fvc::grad(U) gives a 2nd order tensor with the derivative of U with respects to each of the 3 coordinates, but what exactly does snGrad do? It gives a vector with 3 components, and I don't quite know what those 3 components mean.

Thank you!

anishtain4 August 11, 2016 12:09

Source code is your best friend when such questions come up.
snGrad calculates the surface normal gradient for you. Since the surface normal is only one direction, you will get one component for every component of velocity. However if you input a scalar field, you will get only a scalar. So the output really depends on the input.

fluidflowsteel January 6, 2017 06:23

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


All times are GMT -4. The time now is 00:29.