CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   Velocity gradient tensor (

kumaran January 23, 2011 10:33

Velocity gradient tensor
Hello there,

could anyone suggest how to extract second invariant of the velocity gradient tensor from fluent?

I am using Fluent v12


Nikolopoulos January 24, 2011 08:06

Yes i know how you should do it!

I did it for calculation of frictional solid viscocity in Euler -Eule granular material simulation.

If you want the IId in a UDF you should obtain the derivatives of velocity in each direction
(C_DUDX(cell, thread), C_DVDX(cell, thread), C_DWDX(cell, thread) etc. (check the command in the UDF manual).

and then just use the formula. ND_ND parameter will help you in order to obtain a code that works for 2-D and 3-D.

If you want the IId just for plotting define a custom field function (Fluent -> Define -> define a custom field function )

Be careful in this: Are you sure that you want to calculate the second invariant of gradU??? Or you want the second invariant of the deviatoric part of rate-of-strain tensor?

kumaran January 25, 2011 08:56

hello Nikolopoulos,

thank you for your response.

I am looking for the IId of gad U to look at the coherent vortices in 3D.

i am not that familiar with the UDF.. do you mind sharing the UDF file that has the skeleton? so that i can try to modify it ?


Nikolopoulos January 26, 2011 02:31

Do you want it only for post process?

kumaran January 26, 2011 03:15


yes. i want only for post process to see the streamwise vortices in teh midsection of the domain


studen January 25, 2012 04:00

udf for velocity tensor
hi kumaran and nick, i also need to see the velocity tensor for my simulation can u pls share the udf file.

regards and thnks in advance

All times are GMT -4. The time now is 08:02.