UDF: Repatching part temperature

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

 May 29, 2003, 09:09 UDF: Repatching part temperature #1 Mcgregor Guest   Posts: n/a Hi all, I have written the following program that should repatch the temperature of a part, when the average temperature of another part reaches a given value. On the first iteration of every timestep, the average temperature of thread 2 is calculated using the first part of the program and it also prints this value. The second half of the program should reassign the cell temperature values for all of the cells in thread 4 once the average temp = 350K. At the moment this is not happening, but i know that the final loop is being entered at the correct time because the ave temp value is printed a second time in the console window. Please help!!!! Why does my program not reassign temperature values to the cells in thread 2? Andy #include "udf.h" int last_ts = -1; /* Global variable. Time step is never <0 */ DEFINE_ADJUST(repatch_saveb,d) { int curr_ts; curr_ts = RP_Get_Integer("time-step"); if (last_ts != curr_ts) { last_ts = curr_ts; { real Ttot; real Tave; Thread *t; cell_t c; int ID =2; int ID2 = 4; t = Lookup_Thread(d,ID); begin_c_loop(c,t) Ttot +=C_T(c,t); end_c_loop(c,t); Tave = (Ttot/168.0); printf("\n Ttot= %g Tave= %g",Ttot,Tave); if (Tave<350.0) { printf("\n Ttot= %g Tave= %g",Ttot,Tave); t = Lookup_Thread(d,ID2); begin_c_loop(c,t) C_T(c,t) = 493.0; end_c_loop(c,t); } } } }

 June 2, 2003, 08:51 Re: UDF: Repatching part temperature #2 Markus Guest   Posts: n/a Hi Andy, For transient problems the temperature value of the previous time step acts like a source term for the energy equation of a given cell. I suggest you should consider to adjust C_T_M1(c,t), too. br Markus

 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 NeoGamaes Fluent UDF and Scheme Programming 5 January 16, 2012 04:10 tshv247 Fluent UDF and Scheme Programming 1 October 3, 2011 12:44 Hypersonicflow Fluent UDF and Scheme Programming 2 April 18, 2011 13:27 dhanshan1986 Main CFD Forum 2 October 8, 2009 17:07 vemps FLUENT 0 May 1, 2009 01:09

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