CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   variable in C_UDMI (https://www.cfd-online.com/Forums/fluent/114252-variable-c_udmi.html)

IndrajitW March 7, 2013 12:31

variable in C_UDMI
 
Hey,
I am using a udf where I need to pass a variable to a function. To check if correct value is passed to my function I am storing the value of the variable in a UDMI as :
C_UDMI( c,t,4) = 3.1415927; for example.
However when I try to plot the countours of user defined memory 4 , I see that the value at the cell is just half of the desired value, 1.57 in this case.
I am not able to understand the reason for this. Please help...
Regards,
Indrajit

mvee March 8, 2013 02:51

Hi

I can comment on this issue only after looking your UDF. Instead of storing the value of variable in memory, you can define it through "#define pi 3.14". This will solve your problem.

Best wishes!

IndrajitW March 8, 2013 04:16

Quote:

Originally Posted by mvee (Post 412443)
Hi

I can comment on this issue only after looking your UDF. Instead of storing the value of variable in memory, you can define it through "#define pi 3.14". This will solve your problem.

Best wishes!

Hi Mahesh,
Thanks for your attention!! Actually my variable changes at every time step.
Hence I cannot define it as a constant. I think that when a variable is assigned to a C_UDMI the contours are plotted such that the sum value in that cell equals the assigned value of the variable. Hence my maximum value in the contour is half of variable value but when I compute the maximum value in Report-> Volume integral--> Sum, it gives me the variable value!!
What do you feel??
Regards,
Indrajit


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