CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Command on gradient (https://www.cfd-online.com/Forums/fluent/43896-command-gradient.html)

Tong Wu February 25, 2007 13:32

Command on gradient
 
In my case, at the end of every time step, I use UDF to calculate a UDS, this UDS does not transfer. I need the gradient of the UDS at the beginning of next time step. So I should update the UDS's gradient after I change its value. But I do not know how to da. Is there any command can be used to get the gradient? Thank you very much!

Bogdan February 26, 2007 02:28

Re: Command on gradient
 
the macro C_UDSI_G(c,t,i) gives the gradient vector of the UDS

Tong Wu February 26, 2007 05:40

Re: Command on gradient
 
I use UDF--DEFINE_EXECUTE_AT_END to change the value of a UDS. The gradient of this UDS will not be automatically updated after the UDS has been changed at the end of a time step. So the macro C_UDSI_G(c,t,i) only gives the gradient vector of the original unchanged UDS. That is the problem.

Bogdan February 26, 2007 05:55

Re: Command on gradient
 
ok, now I understood. I faced the same problem and i couldn't find an "orthodox" solution. What you can do is either compute yourself the gradient( with the formulas given in the manual chapter 26 using the solver), or if your case is with VOF, you can do a trick: set the vof liquid values to an UDMI, then set the vof values to your UDS, force the gradient calculation with the functions described in the "horizontal film boiling" tutorial, and at the end set back the vof values to the UDMI.


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