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

udf for Temperature profile

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 27, 2008, 08:01
Default udf for Temperature profile
  #1
Ralf
Guest
 
Posts: n/a
Hi!

i have a solid, and i would like to define an initial temperature profile for cooling calculation in x direction (a polynom) - in y direction, the temp. should be constant.

I have created follwing UDF, but somehow, it does not work...

Maybe there is something with the units? my mesh is created in mm. the solid is 100 mm long and there should be a temp. drop at the end to 960K.

Any idea? Ralf

#include "udf.h"

DEFINE_PROFILE(start_temperature,thread,index)

{

real y[ND_ND];

real x;

face_t f;

begin_f_loop(f,thread)

{

F_CENTROID(y,f,thread);

x = y[1];

F_PROFILE(f,thread,index) = 277103.*x*x*x -64574.*x*x + 2416.*x + 1099.;

} end_f_loop(f,thread)

}
  Reply With Quote

Old   November 27, 2008, 12:02
Default Re: udf for Temperature profile
  #2
bohis
Guest
 
Posts: n/a
I guess there should be should be 0 instead of 1. I mean this: x = y[0];
  Reply With Quote

Old   November 28, 2008, 03:36
Default Re: udf for Temperature profile
  #3
Ralf Schmidt
Guest
 
Posts: n/a
yes!! that's it!! now, it works!!

thanks a lot!

For me, without c+ knowledge, it is rather difficult to understand these udf, also the udf manual is not very helpful for these problems...

Ralf
  Reply With Quote

Old   November 28, 2008, 04:31
Default Re: udf for Temperature profile
  #4
Rogerio Fernandes Brito
Guest
 
Posts: n/a
I think u must do 2 UDF´s and not only one. One for x and other for y. Then, u can input the direction of your temperature field, as u do with velocity components.

Why did u use "x = y[1];"?
  Reply With Quote

Old   November 28, 2008, 06:35
Default Re: udf for Temperature profile
  #5
Ralf
Guest
 
Posts: n/a
Hi,

the udf works for my 2d. model. Attached for completeness the udf.

T = x*x*x*277103. -x*x*64574. + x*2416. + 1099. is the polynome, that describes the Temp. distribution (x in m !!!)

Thanks you for your help!!!

Ralf

-----------------------

#include "udf.h"

DEFINE_PROFILE(start_temperature,thread,index)

{

real y[ND_ND];

real x;

cell_t c;

begin_c_loop(c,thread)

{

C_CENTROID(y,c,thread);

x = y[0];

F_PROFILE(c,thread,index) = x*x*x*277103. -x*x*64574. + x*2416. + 1099.;

}

end_c_loop(c,thread)

}
  Reply With Quote

Old   December 6, 2008, 01:42
Default ask an question about udf for Temperature profile
  #6
lucy
Guest
 
Posts: n/a
Ralf, your UDF "DEFINE_PROFILE(start_temperature,thread,index ) "for initialize temperature,not for boundary condition? lucy
  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
Plot temperature profile David FLUENT 4 July 24, 2017 05:35
UDF: temperature profile dolores FLUENT 6 August 5, 2016 20:16
giving temperature profile nag FLUENT 1 May 26, 2008 18:50
profile of temperature enzo FLUENT 0 September 4, 2005 06:53
profile of temperature enzo FLUENT 1 September 4, 2005 06:49


All times are GMT -4. The time now is 00:20.