|
[Sponsors] |
January 2, 2016, 02:31 |
|
#61 |
New Member
Bahamin
Join Date: Jan 2016
Posts: 13
Rep Power: 10 |
Dear All,
I need UDF representing a logarithmic variation for temperature as boundary condition in one wall of my geometry. I appreciate you advice me. (2D problem) The temperature varies logarithmically from x=0,y=225mm from 75 (centigrade) to x=1000 mm,y=225 to 21(centigrade). there is no z direction. I appreciate if you guide me. Last edited by Roil; January 2, 2016 at 18:55. |
|
January 2, 2016, 18:35 |
|
#62 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Use the DEFINE_PROFILE macro (see the UDF manual). Write out the temperature equation as a function of x as you'll need to code this function into the UDF. The first example in the UDF manual applies a parabolic pressure profile which should give you a starting point for your code.
|
|
January 3, 2016, 05:13 |
|
#63 |
Senior Member
Astio Lamar
Join Date: May 2012
Location: Pipe
Posts: 186
Rep Power: 14 |
Hi!
It is easy as it said by others. just find an equation representing your temperature variation in Kelvin and add it to the below UDF. That's it! #include "udf.h" DEFINE_PROFILE(inlet_x_temperature, thread, position) { real x[ND_ND]; /* this will hold the position vector */ real y; face_t f; begin_f_loop(f, thread) { F_CENTROID(x,f,thread); y = x[1]; F_PROFILE(f, thread, position) = Your Equarion; } end_f_loop(f, thread) } |
|
August 5, 2016, 21:09 |
UDF for temperature variation with time and space
|
#64 |
New Member
mm
Join Date: May 2016
Posts: 24
Rep Power: 9 |
Respected members
I have to write a UDF for temperature variation along with time and flow domain. actually temperature is varying with time at four points in flow domain, (different relation for time and temperature at these points. for example at x=0.20m i have following code: DEFINE_PROFILE(solid_temperature,thread,position ) { face_t f; begin_f_loop(f,thread) { real t = RP_Get_Real("flow-time"); if ( t <= 100.0 ) { F_PROFILE(f,thread,position) = 379.48 + 0.0004*t; } else if (100.0 < t && t <= 180.0 ) { F_PROFILE(f,thread,position) = -8.34641*pow(10,-6)*pow(t,4.0)+ 5.49800*pow(10,-3)*pow(t,3.0)- 1.35243*pow(t,2.0)+ 1.47648*pow(10,2.0)*t - 5.51650*pow(10,3.0); } else { F_PROFILE(f,thread,position) = 727.82; } } end_f_loop(f,thread) } at x=0.40m (second point) i have following relations: if ( t <= 100.0 ) { F_PROFILE(f,thread,position) = 379.48 + 0.0004*t; } else if (100.0 < t && t <= 180.0 ) { F_PROFILE(f,thread,position) = 0.2716*t + 494.4; } else { F_PROFILE(f,thread,position) = 727.82; } } end_f_loop(f,thread) } and similarly for other 2 points can any body pl guide me how to include these points in code. i just know how to write variation of temperature with time but i could not find way to write above relations at different points. Please guide me. thanks. |
|
May 21, 2018, 09:34 |
|
#65 |
New Member
erfan
Join Date: Apr 2018
Posts: 13
Rep Power: 8 |
hi i have same problem!!!can you please help me?
suppose i have a cylinder shaped cpu and i want a temperature profile on it which is varying with radius and angle! for example i want this profile: T=25*r+2sin(teta) teta is from zero to 360 on top of the cylinder. |
|
August 5, 2018, 05:32 |
|
#66 | |
Member
Join Date: Oct 2017
Posts: 52
Rep Power: 9 |
Quote:
I have written a udf for this but it is showing "segmentation fault". can you tell me where might be the problem ? Code:
#include "udf.h" DEFINE_PROFILE(fluxloss,thread,position) { real h; real T_ext; face_t f; begin_f_loop(f,thread) { h = 10; T_ext = 300; F_PROFILE(f,thread,position) =-10*(WALL_TEMP_INNER(f,thread)-T_ext); } end_f_loop(f,thread) } |
||
August 7, 2018, 04:41 |
|
#67 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
The problem is WALL_TEMP_INNER.
We don't know what this is. It is not something standard in Fluent, so it is something that you added. Did you define this somewhere else in your code? If no: you are putting words that have no meaning in your code, and Fluent does not know what to do with this, so it gives an error. If yes: tell us how you defined it! |
|
August 7, 2018, 13:41 |
|
#68 | |
Member
Join Date: Oct 2017
Posts: 52
Rep Power: 9 |
Quote:
http://cape-forum.com/index.php/topic,3.0.html I have also looked for this in fluent and i have found similar to this in a radition model which was define as "WALL_OUTER_TEMPERATURE(f,t)" |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
please help UDF for velocity profile in y-directio | raju | Fluent UDF and Scheme Programming | 6 | April 13, 2019 00:21 |
UDF error - parabolic velocity profile - 3D turbine | Zaqie | Fluent UDF and Scheme Programming | 9 | June 25, 2016 20:08 |
defining temperature profile with UDF | mohammadkm | Fluent UDF and Scheme Programming | 11 | July 3, 2013 01:15 |
UDF temp. profile BC | Shashikant | FLUENT | 0 | June 24, 2006 04:16 |
temperature profile on boundary | sivakumar | FLUENT | 5 | November 24, 2002 01:58 |