CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   How to write UDF (https://www.cfd-online.com/Forums/main/224511-how-write-udf.html)

esha February 23, 2020 00:33

How to write UDF
 
Hi everyone,
I am new to CFD. I am unable to understand coding written for ANSYS Fluent.
I know C language but kindly anyone ca tell me what is equation written in following code. What is UDSI and when one can use G(c,t). Thank you! Or highr appreciable if provide some helping material. As I have udf manual of ANSYS but it is so confusing I do not know how to use that?

source2 = eps*mu/tao/pow((1.-(C_UDSI(c,t,0)+C_UDSI(c,t,1))/L/L),2.0)*((1.-(C_UDSI(c,t,0)+C_UDSI(c,t,1))/L/L)*(C_UDSI_G(c,t,0)[0]+C_UDSI_G(c,t,2)[1]));
source2 = source2+eps*mu/tao/pow((1.-(C_UDSI(c,t,0)+C_UDSI(c,t,1))/L/L),2.0)*(C_UDSI(c,t,0)*(C_UDSI_G(c,t,0)[0]+C_UDSI_G(c,t,1)[0])+C_UDSI(c,t,2)*(C_UDSI_G(c,t,0)[1]+C_UDSI_G(c,t,1)[1]))/L/L;
dS[eqn] = 0.;

Светлана February 23, 2020 20:03

Hi esha


This is only two lines from the UDF. Can you please post the complete function?


Regards,
Svetlana

LuckyTran February 24, 2020 09:46

C_UDSI(c,t,i) is for accessing cell values for user-defined scalars
C_UDSI_G returns the gradient of the scalar


All times are GMT -4. The time now is 19:50.