CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   source term udf (https://www.cfd-online.com/Forums/fluent/67428-source-term-udf.html)

tas38 August 14, 2009 08:54

source term udf
 
I am trying to write a udf that adds a momentum source term.

The source term is written in terms of vorticity and vorticity magnitude. As I cannot explicitly extract vorticity and operators such as grad are not available, does anyone have suggestions as to how to write this udf?

consider for example that the source term is grad(abs(vorticity))/(abs(grad(vorticity)){cross}(vorticity)

where vorticity is the vorticity vector and {cross} indicates cross product

tstorm August 14, 2009 10:44

FLUENT stores gradients for user-defined scalars. So, you might try storing those terms as user-defined scalars (i.e., C_UDSI(c,t,0) = vorticity(c,t) ) and then accessing the gradient with C_UDSI_G(c,t,0).
Hope that helps!


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