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

udf for repatching a temperature in a volume

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

Reply
 
LinkBack Thread Tools Display Modes
Old   April 9, 2003, 04:26
Default udf for repatching a temperature in a volume
  #1
McGregor
Guest
 
Posts: n/a
Hi, I've tried to write a UDF that will repatch the temperature in a volume thread, once the average temperature in a surface thread reaches a certain value.

I have used the DEFINE_ADJUST macro for this, along with the Lookup_Thread function for both the surface and volume threads.

My program compiles, but when i execute it in fluent, i get a segmentation vialation.

Has anyone written similar programs where values are repatch as other values change? If so please point me in the right direction as this is causing me a lot of unnecessary stress!!!

I can attatch the program that i have written if that is of any help.

Thank you in advance,

Mcgregor
  Reply With Quote

Old   April 9, 2003, 07:13
Default Re: udf for repatching a temperature in a volume
  #2
McGregor
Guest
 
Posts: n/a
Here is a copy of the program that i wrote. I am using fluent 6.0

#include "udf.h"

DEFINE_ADJUST(repatch_save,d)

{ real Ttot,Tave;

face_t f;

Thread *t = Lookup_Thread(d,7);

begin_f_loop(f,t)

Ttot += F_T(f,t);

end_f_loop(f,t);

Tave = (Ttot/54);

if (Tave>350.0)

{

cell_t c;

Thread *t2=Lookup_Thread(d,3);

begin_c_loop(c,t2)

C_T(c,t2) = 493;

end_c_loop(c,t2);

}

else return; }

Regards,
  Reply With Quote

Old   April 9, 2003, 11:10
Default Re: udf for repatching a temperature in a volume
  #3
Alex Munoz
Guest
 
Posts: n/a
Hi

I guess you save the data in a UDM but you forgot to initialize the UDM.

If that the case let me know and I will give a way to solved

Regards

Alex
  Reply With Quote

Old   April 9, 2003, 11:16
Default Re: udf for repatching a temperature in a volume
  #4
Alex Munoz
Guest
 
Posts: n/a
Hi

careful

Tave = (Ttot/54); C_T(c,t2) = 493;

you should use 54.0 and 493.0 or 493. if not the code can not make diference between int or float, and you get unusual results!

Regards

Alex Munoz
  Reply With Quote

Old   April 10, 2003, 04:28
Default Re: udf for repatching a temperature in a volume
  #5
McGregor
Guest
 
Posts: n/a
Hi Alex,

Thanks for the help that you have already given me. With regards to storing data in a UDM, is that the data obtained from the face thread? Im not sure how to go about doing that, so any help you can give would be very much appreciated. The program i wrote is as it stands on my second post.

Thanks again

  Reply With Quote

Reply

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
specified shear at wall - temperature gradient - UDF - access violation error senD Fluent UDF and Scheme Programming 9 September 18, 2014 07:29
defining temperature profile with UDF mohammadkm Fluent UDF and Scheme Programming 11 July 3, 2013 00:15
UDF - Temperature adjustment PaulK FLUENT 1 July 16, 2010 15:09
Access Granular Temperature in UDF Gavin FLUENT 5 July 22, 2005 11:06
UDF: Repatching part temperature Mcgregor FLUENT 1 June 2, 2003 08:51


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