CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

DEFINE_ADJUST udf problem

Register Blogs Community New Posts Updated Threads Search

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

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:

DEFINE_EXECUTE_AT_END(execute_at_end)
{

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

thread_loop_c (t,d)
{
if (FLUID_THREAD_P(t))
{
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
mateus is offline   Reply With Quote

Reply


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 Off
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 March 18, 2018 06:05
what's the problem with my udf zzyan FLUENT 0 November 4, 2010 03: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 09:58


All times are GMT -4. The time now is 13:51.