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

Thermal conductivity UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 25, 2012, 16:28
Default Thermal conductivity UDF
  #1
New Member
 
jack
Join Date: Aug 2011
Posts: 3
Rep Power: 15
jack.s is on a distinguished road
Hi friends...
i want to define thermal conductivity of fluid that varies with temperature and position. in other words i want to use this formula:
k= 3*T^2+6*y
that T is temperature and y is position in y-direction.
I wrote the following UDF and run the case but when i compared this result with constant thermal conductivity it has no effect in my results.

#include "udf.h"

DEFINE_PROPERTY(knew,c,t)
{
real ktc;
real y;
real temp = C_T(c,t);
ktc = (3. * pow (temp,2.)) + (6. *y);
return ktc;
}

can any body help me???
jack.s is offline   Reply With Quote

Old   February 26, 2012, 04:41
Default
  #2
Member
 
Join Date: Nov 2011
Location: Czech Republic
Posts: 97
Rep Power: 15
Sixkillers is on a distinguished road
Well in your code variable "y" isn't initialized, so I guess that is the problem. Here is an quick fix:

PHP Code:
DEFINE_PROPERTY(knew,c,t)
{
  
real ktc;
  
real pos[ND_ND];
  
real y;
  
  
C_CENTROID(pos,c,t);
  
pos[1];
  
real temp C_T(c,t);
  
ktc = (3. pow (temp,2.)) + (6. y);
  return 
ktc;

Sixkillers is offline   Reply With Quote

Old   February 26, 2012, 14:58
Default
  #3
New Member
 
jack
Join Date: Aug 2011
Posts: 3
Rep Power: 15
jack.s is on a distinguished road
Quote:
Originally Posted by Sixkillers View Post
Well in your code variable "y" isn't initialized, so I guess that is the problem. Here is an quick fix:

PHP Code:
DEFINE_PROPERTY(knew,c,t)
{
  
real ktc;
  
real pos[ND_ND];
  
real y;
 
  
C_CENTROID(pos,c,t);
  
pos[1];
  
real temp C_T(c,t);
  
ktc = (3. pow (temp,2.)) + (6. y);
  return 
ktc;

Thanks a lot Sixkillers for your answer...
i use this UDF and my results changed!!! But my result is not satisfactory.
i have some other question:
i want to use this UDF in 2d modeling of pipe, and use this UDF to change thermal conductivity of fluid in each section of pipe from inlet to outlet with temperature and position of each point in every section.
can i use this UDF in axisemmetric model with y or i should replace y with r???
if yes, can i replace y with r in the previous UDF???

And if i want to use this formula :
k=3*T+ \partial(U)/\partial r
how can i change previous UDF ???

Last edited by jack.s; February 27, 2012 at 07:02.
jack.s is offline   Reply With Quote

Old   February 28, 2012, 17:08
Default
  #4
Member
 
Join Date: Nov 2011
Location: Czech Republic
Posts: 97
Rep Power: 15
Sixkillers is on a distinguished road
I think that you can use this code without any modification for an axisymmetric problem, if a symmetry axis is parallel with x axis. If it is parallel with y axis than you will have to change
PHP Code:
pos[1]; 
to
PHP Code:
pos[0]; 
To obtain a derivation of velocity according to spatial variable, you can use methods: C_U_G, C_V_G (take a look to this chapter).

Once again it depends, which spatial variable represents radius. Finally I would like to say, that I haven't test it and UDF manual isn't much speaking about axisymmetric problems in general. However, this is the way how I expect it should work
Sixkillers is offline   Reply With Quote

Old   February 29, 2012, 12:57
Default
  #5
New Member
 
jack
Join Date: Aug 2011
Posts: 3
Rep Power: 15
jack.s is on a distinguished road
Quote:
Originally Posted by Sixkillers View Post
I think that you can use this code without any modification for an axisymmetric problem, if a symmetry axis is parallel with x axis. If it is parallel with y axis than you will have to change
PHP Code:
pos[1]; 
to
PHP Code:
pos[0]; 
To obtain a derivation of velocity according to spatial variable, you can use methods: C_U_G, C_V_G (take a look to this chapter).

Once again it depends, which spatial variable represents radius. Finally I would like to say, that I haven't test it and UDF manual isn't much speaking about axisymmetric problems in general. However, this is the way how I expect it should work
Thank you very much...
jack.s 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
I need one simple udf code for effective thermal conductivity of nanofluid mvf Fluent UDF and Scheme Programming 1 February 10, 2017 20:05
UDF for effective thermal conductivity Rashmi FLUENT 1 November 6, 2007 21:08
UDF for effective thermal conductivity Mona FLUENT 2 January 16, 2006 14:36
Can wemodify effective thermal conductivity by UDF FengYun FLUENT 2 October 27, 2005 06:28
Effective thermal conductivity UDF - C_K_EFF?? Craig FLUENT 4 February 11, 2004 15:02


All times are GMT -4. The time now is 19:04.