CFD Online Logo CFD Online URL
Home > Forums > FLUENT

DEFINE_ADJUST udf problem

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

LinkBack Thread Tools Display Modes
Old   January 16, 2011, 17:44
Default DEFINE_ADJUST udf problem
New Member
Matevz Dular
Join Date: May 2009
Posts: 11
Rep Power: 11
mateus is on a distinguished road

I'm writing an udf where I first store temperature at the end of each time step. This part work fine - I do it like this:


Domain *d;
Thread *t;
cell_t c;
d = Get_Domain(1);

thread_loop_c (t,d)
begin_c_loop (c,t)
C_UDMI(c,t,0) = C_T(c,t);
end_c_loop (c,t)

Then in the second part I want to divide current (not converged) temperature with the converged one from the last time step (this one is stored under C_UDMI(c,t,0)).

C_UDMI(c,t,1) = C_UDMI(c,t,0)/C_T(c,t);

To check if it works fluent should give a value of 1 all over domain if I calculate this part in the last (converged) iteration of the new time step, right? - that's because also DEFINE_EXECUTE_AT_END macro will calculate C_UDMI(c,t,0) at this point. I hope I'm making some sense and that it's clear what I'm doing.

If I use DEFINE_ADJUST macro it doesn't give the correct result (1 all over domain at the end of the time step). But if I use DEFINE_EXECUTE_ON_DEMAND it does. It also gives the correct result if I use custom field function tool in Fluent GUI - but this way is not useful for me because I need this variable to define material property further on...

Thanks for any comments and ideas!
mateus is offline   Reply With Quote


Thread Tools
Display Modes

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM Rizwan Fluent UDF and Scheme Programming 40 October 18, 2017 07:17
what's the problem with my udf zzyan FLUENT 0 November 4, 2010 04:56
Problem with my udf july Fluent UDF and Scheme Programming 3 June 20, 2010 06:56
udf compiling problem akr FLUENT 3 August 22, 2007 07:14
UDF problem chiseung FLUENT 4 January 10, 2002 10:58

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