CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Accessing the components of a gradient (https://www.cfd-online.com/Forums/openfoam/180736-accessing-components-gradient.html)

ARUNAVA SENGUPTA November 29, 2016 09:48

Accessing the components of a gradient
 
1 Attachment(s)
Hi all,

Can you tell me that how can i access the gradient components of a scalar variable in OpenFOAM ?

I have a scalar variable theta. I have to find out the y-component of the gradient of theta. then I have to find out the x-component of the gradient of the resultant. See the attachment for more details

chunmun November 26, 2020 08:40

Same problem
 
Did you find the solution?

kandelabr November 27, 2020 01:17

where do you need that, paraView? you have a gradient filter there...

Tobermory November 27, 2020 10:02

... otherwise, if it is in a solver or utility coding then there is:
Code:

fvc::grad(theta)
Perhaps you might consider giving a little more information on what you are trying to achieve?

ErenC November 27, 2020 10:43

Your answer is in here:
foam.sourceforge.net/docs/Guides-a4/ProgrammersGuide.pdf


All times are GMT -4. The time now is 23:52.