CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Looping Problem?? (https://www.cfd-online.com/Forums/fluent/33892-looping-problem.html)

 KKLAU June 5, 2004 05:03

Looping Problem??

To all fluent Experts,

I am facing a problem to pass the looping value to the F_PROFILE. I am trying to pass the C_U(c,t)[adjacent velocity value] to my BC. But it cant... I try to check the C_U(c,t) value using printf before the F_PROFILE, it is ok. So i equal it will an variable z. Then, i pass the z to the F_PROFILE. Error starts happen. The F_PROFILE value is different from the z value. May i know what were the errors that i made???

Here is my UDF:

#include "udf.h"

begin_f_loop(c,thread) { z = C_U(c,t); //check with - printf("%15e",z); F_PROFILE(f, thread, position) = z; end_f_loop(c,thread) } }

Note: I can't change the begin_f_loop(c,thread) to begin_f_thread(f,thread) since this will make all the the C_U(c,t) value change to constant value(why??).

Thanks alot.

From KKLAU

 Rob Hart June 5, 2004 05:48

Re: Looping Problem??

Well, as it stands you never assign a value to f, so there is no way this UDF is going to work.

I'm not quite clear what you are trying to achieve here, but you probably should loop with begin_f_loop(f,thread), and then *inside* the loop, have c = F_CO(f,thread) etc.

Could you explain better what you are trying to do?

Rob

 All times are GMT -4. The time now is 08:31.