|
[Sponsors] |
July 23, 2015, 13:35 |
Problem using UDF
|
#1 |
New Member
Ali
Join Date: Mar 2014
Posts: 4
Rep Power: 12 |
Hello everyone,
I'm trying to simulate the flow around a multi tubes and fins heat exchanger in starting up condition, transient, using Fluent. The input conditions for water and air are given using the UDF shown below. When the simulation was run, the water and air inlet temperatures did not change according to the UDF. I mean they keep changing using the equations in the first interval (from 0 to 8000 sec) and did not go to the second condition even the running time was greater than 8000 sec. My experience is very limited in programming with C language and I guess there something wrong with the UDF! I appreciate your help to solve this issue. UDF: #include "udf.h" DEFINE_PROFILE(RAMP_waterIN, thread, position) { float t, waterIN; face_t f; t = RP_Get_Real("flow-time"); if (0 < t < 8000) { waterIN = (-0.00000000007*(t*t*t))+(0.0000005*(t*t))+(0.0052*t )+296.071; } else if (8000 <= t <= 10000) { waterIN = 333; } begin_f_loop(f, thread) { F_PROFILE(f, thread, position) = waterIN; } end_f_loop(f, thread) } DEFINE_PROFILE(RAMP_airIN, thread, position) { float t, airIN; face_t f; t = RP_Get_Real("flow-time"); if (0 < t < 8000) { airIN = (-0.000000000006*(t*t*t))+(0.00000006*(t*t))+(0.0002 *t)+292.23; } else if (8000 <= t <= 10000) { airIN = 294.91; } begin_f_loop(f, thread) { F_PROFILE(f, thread, position) = airIN; } end_f_loop(f, thread) } |
|
July 24, 2015, 02:59 |
|
#2 |
New Member
Jack
Join Date: Jun 2015
Posts: 3
Rep Power: 10 |
Try to change
if (0 < t < 8000) to if (0<t&&t<8000), use && as "and" in C language. other sentences can be treated as the same. |
|
July 24, 2015, 03:00 |
|
#3 |
New Member
Jack
Join Date: Jun 2015
Posts: 3
Rep Power: 10 |
Try to change
if (0 < t < 8000) to if (0<t&&t<8000), use && as "and" in C language. other sentences can be treated as the same. |
|
August 3, 2015, 09:52 |
thank you
|
#4 |
New Member
Ali
Join Date: Mar 2014
Posts: 4
Rep Power: 12 |
Thank you kamer. its working now.
|
|
|
|
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 |
udf loading problem | santu | Fluent UDF and Scheme Programming | 1 | May 22, 2015 15:47 |
Vaporization pressure UDF property problem? | lehoanganh07 | Fluent UDF and Scheme Programming | 1 | September 13, 2014 10:59 |
Problem with my udf | july | Fluent UDF and Scheme Programming | 3 | June 20, 2010 06:56 |
UDF problem | mansha goraya | FLUENT | 0 | October 29, 2007 00:31 |