CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   gradient for UDS variable (https://www.cfd-online.com/Forums/fluent/133779-gradient-uds-variable.html)

tejasvikrishna April 20, 2014 19:01

gradient for UDS variable
 
Can anyone please let me know how after defining a UDS using Set_User_Scalar_Name, how to define the gradients ?

Thanks Tejasvi

A CFD free user April 21, 2014 14:14

Dear Tejasvi,
You can use the predefined macro C_UDSI(c,t,i)[j], to define the gradients in direction you want. Here, i, is index of the scalar which identify the the number of the UDS you defined before. j is the direction which gradient is desired. j=0 is gradient in x direction, j=1 in y direction and j=2 in z direction. You can also use NV_MAG(C_UDSI_G(c,t,i)) to calculate the magnitude of the UDS gradient which is in turn a scalar quantity. Other information can be found in Fluent UDF manual specifically in UDS sections. Keep in mind that UDS gradient is defined only for cell threads and for wall (c0) and interior (c0,c1) faces you can use appropriate gradient macros.
I hope it helps


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