# UDF temperature profile

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

 January 2, 2016, 01:31 #61 New Member   Bahamin Join Date: Jan 2016 Posts: 13 Rep Power: 7 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 17:55.

 January 2, 2016, 17:35 #62 Senior Member   Join Date: Mar 2015 Posts: 892 Rep Power: 15 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. Roil likes this.

 January 3, 2016, 04:13 #63 Senior Member   Astio Lamar Join Date: May 2012 Location: Pipe Posts: 186 Rep Power: 11 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) } Roil likes this.

 May 21, 2018, 08:34 #65 New Member   erfan Join Date: Apr 2018 Posts: 13 Rep Power: 5 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, 04:32
#66
Member

Join Date: Oct 2017
Posts: 52
Rep Power: 5
Quote:
 Originally Posted by flotus1 Which formula describes your function? Without knowing what you put instead of the "..." in F_PROFILE(f, thread, position) = ...; no one can guess what is causing the error.
I have to calculate heat transfer losses from radial surface of the cylinder.
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"

{
real h;
real T_ext;
face_t f;
{
h = 10;
T_ext = 300;
}

}```

 August 7, 2018, 03:41 #67 Senior Member   Join Date: Nov 2013 Posts: 1,913 Rep Power: 23 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, 12:41
#68
Member

Join Date: Oct 2017
Posts: 52
Rep Power: 5
Quote:
 Originally Posted by pakk 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!
i have followed the link given below::
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)"