# Looping Problem??

 Register Blogs Members List Search Today's Posts Mark Forums Read

 June 5, 2004, 05:03 Looping Problem?? #1 KKLAU Guest   Posts: n/a 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" DEFINE_PROFILE(solute, thread, position) { face_t f; cell_t c = F_C0(f,thread); Thread *t = THREAD_T0(thread); real z; 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

 June 5, 2004, 05:48 Re: Looping Problem?? #2 Rob Hart Guest   Posts: n/a 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

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post JonW OpenFOAM 3 February 23, 2013 21:41 Wouter Fluent UDF and Scheme Programming 6 June 6, 2012 04:43 Se-Hee CFX 2 June 10, 2007 06:29 ParodDav CFX 5 April 29, 2007 19:13 Thomas P. Abraham Main CFD Forum 5 September 8, 1999 14:52

All times are GMT -4. The time now is 12:11.