CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

UDF temperature profile

Register Blogs Community New Posts Updated Threads Search

Like Tree23Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 2, 2016, 02:31
Default
  #61
New Member
 
Bahamin
Join Date: Jan 2016
Posts: 13
Rep Power: 10
Roil is on a distinguished road
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.
Roil is offline   Reply With Quote

Old   January 2, 2016, 18:35
Default
  #62
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
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.
`e` is offline   Reply With Quote

Old   January 3, 2016, 05:13
Default
  #63
Senior Member
 
Astio Lamar
Join Date: May 2012
Location: Pipe
Posts: 186
Rep Power: 14
asal is on a distinguished road
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.
asal is offline   Reply With Quote

Old   August 5, 2016, 21:09
Question UDF for temperature variation with time and space
  #64
New Member
 
mm
Join Date: May 2016
Posts: 24
Rep Power: 9
mmunige is an unknown quantity at this point
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.
mmunige is offline   Reply With Quote

Old   May 21, 2018, 09:34
Default
  #65
New Member
 
erfan
Join Date: Apr 2018
Posts: 13
Rep Power: 8
erfan1995 is on a distinguished road
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.
erfan1995 is offline   Reply With Quote

Old   August 5, 2018, 05:32
Default
  #66
Member
 
Join Date: Oct 2017
Posts: 52
Rep Power: 9
gouravjee is on a distinguished road
Quote:
Originally Posted by flotus1 View Post
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"


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)

}
gouravjee is offline   Reply With Quote

Old   August 7, 2018, 04:41
Default
  #67
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
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!
pakk is offline   Reply With Quote

Old   August 7, 2018, 13:41
Default
  #68
Member
 
Join Date: Oct 2017
Posts: 52
Rep Power: 9
gouravjee is on a distinguished road
Quote:
Originally Posted by pakk View Post
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)"
gouravjee is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 03:21.