CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   STAR-CCM+ (https://www.cfd-online.com/Forums/star-ccm/)
-   -   Fieldfunction du/dy - du/dx (https://www.cfd-online.com/Forums/star-ccm/93070-fieldfunction-du-dy-du-dx.html)

eRzBeNgEl October 4, 2011 08:21

Fieldfunction du/dy - du/dx
 
Hi guys,

I have got a little problem. I want to set up a field function where velocity gradients are included:

e.g:

du/dx -> CCM Code: grad($$Velocity[0]). I think this is for du/dx right, where u is the first component of the velocity vector.

How does this work for du/dy or du/dz??

Thanks for help

f-w October 4, 2011 11:34

Check out the help file:

Using Tools > Using Field Functions > Field Function Programming Reference > Vector Functions, Miscellaneous Functions

kyle October 5, 2011 19:10

"grad($$Velocity[0])" will get you a vector field function consisting of (du/dx, du/dy, du/dz). If you just want du/dx, then you need to do "grad($$Velocity[0])[0]"

To be clear...

du/dx = grad($$Velocity[0])[0]
du/dy = grad($$Velocity[0])[1]
dv/dx = grad($$Velocity[1])[0]
dv/dy = grad($$Velocity[1])[1]
dw/dx = grad($$Velocity[2])[0]
etc...

eRzBeNgEl October 6, 2011 02:25

Ah Kyle, thank u! :-) This is it what I was looking for....


All times are GMT -4. The time now is 03:12.