|
[Sponsors] |
April 9, 2003, 05:26 |
udf for repatching a temperature in a volume
|
#1 |
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 |
|
April 9, 2003, 08:13 |
Re: udf for repatching a temperature in a volume
|
#2 |
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, |
|
April 9, 2003, 12:10 |
Re: udf for repatching a temperature in a volume
|
#3 |
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 |
|
April 9, 2003, 12:16 |
Re: udf for repatching a temperature in a volume
|
#4 |
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 |
|
April 10, 2003, 05:28 |
Re: udf for repatching a temperature in a volume
|
#5 |
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 |
|
|
|
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 08:29 |
defining temperature profile with UDF | mohammadkm | Fluent UDF and Scheme Programming | 11 | July 3, 2013 01:15 |
UDF - Temperature adjustment | PaulK | FLUENT | 1 | July 16, 2010 16:09 |
Access Granular Temperature in UDF | Gavin | FLUENT | 5 | July 22, 2005 12:06 |
UDF: Repatching part temperature | Mcgregor | FLUENT | 1 | June 2, 2003 09:51 |