|
[Sponsors] |
October 8, 2009, 13:48 |
UDF for wall temperature
|
#1 |
New Member
Sakthivale Roshan Dhaneswar
Join Date: Oct 2009
Posts: 2
Rep Power: 0 |
Hello, I am new to using UDFs on fluent and am finding it quite hard. I need to specify a wall (vertical walls) temperature boundary condition : T(x) = 800*X/0.2 where X (m) is the distance of the point from the top of the geometry (rectangular) which is totally 50 cm long. The origin of the geometry is at the bottom.
This is the code I have written so far: #include "udf.h" DEFINE_PROFILE(wall_temp, thread, position) { real x[ND_ND]; /* this will hold the position vector */ real y; cell_t f; begin_f_loop(f,thread) { F_CENTROID(x, f, thread); y = x[1]; F_T(f,thread,position) = (800.*(50.-y))/20; } end_f_loop(f, thread) } When I interpret the udf and run my calculation on fluent, I do not get the result I expect and instead I get a contant temperature of 2000 K. I also get an 'nmake' error during compilation. Is compilation necessary ? Thanks in advance. |
|
October 8, 2009, 16:32 |
|
#2 |
New Member
Join Date: Jun 2009
Posts: 8
Rep Power: 17 |
Hi,
there is a tutorial that is very similar to your problem in the UDF manual...just change it to operate on temp and not x_velocity and the profile. Be careful with units as I see in your post you have m and cm. regards.............Bak_Flow /************************************************** ******************** udfexample.c UDF for specifying a steady-state velocity profile boundary condition ************************************************** ********************/ #include "udf.h" /* must be at the beginning of every UDF you write */ DEFINE_PROFILE(x_velocity,thread,index) { real x[ND_ND]; /* this will hold the position vector */ real y; face_t f; begin_f_loop(f,thread) /* loops over all faces in the thread passed in the DEFINE macro argument */ { F_CENTROID(x,f,thread); y = x[1]; F_PROFILE(f,thread,index) = 20. - y*y/(.0745*.0745)*20.; } end_f_loop(f,thread) } |
|
October 8, 2009, 18:07 |
|
#3 |
New Member
Sakthivale Roshan Dhaneswar
Join Date: Oct 2009
Posts: 2
Rep Power: 0 |
Yes, I am aware of this. But this equation is not a centroid (parabola type) form and intead is a profile that starts from the top of the rectangular furnace wall. Is there any command I need to change to incorporate this ?..I dont think centroid will work in my case. Please let me know. Thanks.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF for a horizontal temperature profile | CD | Fluent UDF and Scheme Programming | 9 | May 6, 2018 13:13 |
UDF or any approach for Bulk Temperature calculation | vemps | FLUENT | 0 | May 1, 2009 02:09 |
UDF velocity and temperature | Raj | FLUENT | 3 | February 1, 2009 19:29 |
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 |